Repository: geeeeeeeek/py_stock Branch: dev Commit: 3453d2073bed Files: 142 Total size: 7.6 MB Directory structure: gitextract_81rq_106/ ├── .gitignore ├── backend/ │ ├── .gitignore │ ├── data.json │ ├── index.config.js │ ├── nodemon.json │ ├── package.json │ ├── src/ │ │ ├── index.js │ │ ├── subgraph.js │ │ ├── upload.js │ │ └── wallet.js │ └── vercel.json ├── client/ │ ├── .eslintrc.json │ ├── .gitignore │ ├── README.md │ ├── components.json │ ├── jsconfig.json │ ├── next.config.mjs │ ├── out/ │ │ ├── 404.html │ │ ├── _next/ │ │ │ └── static/ │ │ │ ├── Qvu3_p21LuapbgDau0_w0/ │ │ │ │ ├── _buildManifest.js │ │ │ │ └── _ssgManifest.js │ │ │ ├── chunks/ │ │ │ │ ├── 112-05ef4e14cff1a5e4.js │ │ │ │ ├── 202-9b05294c1bfbdfa7.js │ │ │ │ ├── 23-a2a6d2cb6c50ca8e.js │ │ │ │ ├── 26.1d107b0aeb7c14be.js │ │ │ │ ├── 318.67461aab1aa569d4.js │ │ │ │ ├── 385cb88d-d4d0cd34753b4b85.js │ │ │ │ ├── 3ab9597f-9ca74e94c08af310.js │ │ │ │ ├── 3d47b92a-88f28c2ab0026672.js │ │ │ │ ├── 53c13509-fd73beeb7afe2e31.js │ │ │ │ ├── 550.78062c8e0f31c7e4.js │ │ │ │ ├── 5ab80550-22a236d451c69b50.js │ │ │ │ ├── 5e22fd23-a888f1085fc13e55.js │ │ │ │ ├── 795d4814-3c1aeb3c4a7db891.js │ │ │ │ ├── 866.ab29f905adb91a5f.js │ │ │ │ ├── app/ │ │ │ │ │ ├── _not-found/ │ │ │ │ │ │ └── page-55d3376e1599fe3a.js │ │ │ │ │ ├── layout-696be0f0413601fb.js │ │ │ │ │ └── page-bbd1448002907ff3.js │ │ │ │ ├── dc112a36-9245e58b51327391.js │ │ │ │ ├── e34aaff9-73cdc0c2aa38fff5.js │ │ │ │ ├── fd9d1056-819464016f7ad85c.js │ │ │ │ ├── framework-00a8ba1a63cfdc9e.js │ │ │ │ ├── main-0fb83ae612d5aa4d.js │ │ │ │ ├── main-app-0e53d5b0820fa726.js │ │ │ │ ├── pages/ │ │ │ │ │ ├── _app-037b5d058bd9a820.js │ │ │ │ │ └── _error-6ae619510b1539d6.js │ │ │ │ ├── polyfills-78c92fac7aa8fdd8.js │ │ │ │ └── webpack-1f4c176689af895b.js │ │ │ └── css/ │ │ │ └── 888b2de5347592df.css │ │ ├── index.html │ │ ├── index.txt │ │ └── nft.avif │ ├── package.json │ ├── postcss.config.mjs │ ├── public/ │ │ └── nft.avif │ ├── src/ │ │ ├── abi/ │ │ │ ├── MusicX.js │ │ │ └── OwnSound.js │ │ ├── animations/ │ │ │ └── no.json │ │ ├── app/ │ │ │ ├── globals.css │ │ │ ├── layout.js │ │ │ └── page.js │ │ ├── components/ │ │ │ ├── bottom-audio-player.js │ │ │ ├── contact-abhi.js │ │ │ ├── explore/ │ │ │ │ ├── explore.js │ │ │ │ ├── playlistItem.js │ │ │ │ └── track-item.js │ │ │ ├── home-page.js │ │ │ ├── horizontal-scroll.js │ │ │ ├── loader.js │ │ │ ├── login.js │ │ │ ├── mymusic/ │ │ │ │ └── my-music.js │ │ │ ├── playlist/ │ │ │ │ ├── createPlaylistAlert.js │ │ │ │ └── playlist.js │ │ │ ├── profile/ │ │ │ │ ├── playlist-item.js │ │ │ │ ├── profile.js │ │ │ │ └── track-item.js │ │ │ ├── resizable.js │ │ │ ├── song/ │ │ │ │ ├── rent.js │ │ │ │ └── song.js │ │ │ ├── ui/ │ │ │ │ ├── alert-dialog.jsx │ │ │ │ ├── badge.jsx │ │ │ │ ├── button.jsx │ │ │ │ ├── card.jsx │ │ │ │ ├── dropdown-menu.jsx │ │ │ │ ├── input.jsx │ │ │ │ ├── label.jsx │ │ │ │ ├── resizable.jsx │ │ │ │ ├── select.jsx │ │ │ │ ├── skeleton.jsx │ │ │ │ ├── slider.jsx │ │ │ │ ├── sonner.jsx │ │ │ │ ├── switch.jsx │ │ │ │ └── textarea.jsx │ │ │ └── uploadMusic/ │ │ │ └── publish-audio.js │ │ ├── lib/ │ │ │ └── utils.js │ │ ├── privy/ │ │ │ ├── chains.js │ │ │ ├── config.js │ │ │ └── privyProvider.js │ │ ├── redux/ │ │ │ ├── musicPlayerSlice.js │ │ │ ├── redux-provider.js │ │ │ └── store.js │ │ ├── theme/ │ │ │ ├── theme-provider.js │ │ │ └── theme-toggle.js │ │ └── utils/ │ │ ├── contract.js │ │ ├── dummy.js │ │ └── truncateAddress.js │ ├── tailwind.config.js │ └── 技术文档.md ├── docs/ │ ├── 404.html │ ├── _next/ │ │ └── static/ │ │ ├── Qvu3_p21LuapbgDau0_w0/ │ │ │ ├── _buildManifest.js │ │ │ └── _ssgManifest.js │ │ ├── chunks/ │ │ │ ├── 112-05ef4e14cff1a5e4.js │ │ │ ├── 202-9b05294c1bfbdfa7.js │ │ │ ├── 23-a2a6d2cb6c50ca8e.js │ │ │ ├── 26.1d107b0aeb7c14be.js │ │ │ ├── 318.67461aab1aa569d4.js │ │ │ ├── 385cb88d-d4d0cd34753b4b85.js │ │ │ ├── 3ab9597f-9ca74e94c08af310.js │ │ │ ├── 3d47b92a-88f28c2ab0026672.js │ │ │ ├── 53c13509-fd73beeb7afe2e31.js │ │ │ ├── 550.78062c8e0f31c7e4.js │ │ │ ├── 5ab80550-22a236d451c69b50.js │ │ │ ├── 5e22fd23-a888f1085fc13e55.js │ │ │ ├── 795d4814-3c1aeb3c4a7db891.js │ │ │ ├── 866.ab29f905adb91a5f.js │ │ │ ├── app/ │ │ │ │ ├── _not-found/ │ │ │ │ │ └── page-55d3376e1599fe3a.js │ │ │ │ ├── layout-696be0f0413601fb.js │ │ │ │ └── page-bbd1448002907ff3.js │ │ │ ├── dc112a36-9245e58b51327391.js │ │ │ ├── e34aaff9-73cdc0c2aa38fff5.js │ │ │ ├── fd9d1056-819464016f7ad85c.js │ │ │ ├── framework-00a8ba1a63cfdc9e.js │ │ │ ├── main-0fb83ae612d5aa4d.js │ │ │ ├── main-app-0e53d5b0820fa726.js │ │ │ ├── pages/ │ │ │ │ ├── _app-037b5d058bd9a820.js │ │ │ │ └── _error-6ae619510b1539d6.js │ │ │ ├── polyfills-78c92fac7aa8fdd8.js │ │ │ └── webpack-1f4c176689af895b.js │ │ └── css/ │ │ └── 888b2de5347592df.css │ ├── index.html │ ├── index.txt │ └── nft.avif └── readme.md ================================================ FILE CONTENTS ================================================ ================================================ FILE: .gitignore ================================================ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies /node_modules /.pnp .pnp.js .yarn/install-state.gz # testing /coverage # next.js /.next/ /out/ # production /build # misc .DS_Store *.pem # debug npm-debug.log* yarn-debug.log* yarn-error.log* # local env files .env*.local # vercel .vercel # typescript *.tsbuildinfo next-env.d.ts .idea ================================================ FILE: backend/.gitignore ================================================ node_modules/ node_modules/* .env ================================================ FILE: backend/data.json ================================================ ================================================ FILE: backend/index.config.js ================================================ module.exports = { apps: [ { name: "spread", script: "nodemon", args: "src/index.js", // Arguments to pass to nodemon interpreter: "none", // This tells PM2 to use the system's PATH to find the interpreter env: { NODE_ENV: "production" } } ] }; ================================================ FILE: backend/nodemon.json ================================================ { "watch": ["*.js"], "ext": "js,json", "ignore": [ "node_modules/" ] } ================================================ FILE: backend/package.json ================================================ { "name": "server", "version": "1.0.0", "main": "index.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1", "dev": "nodemon src/index.js" }, "keywords": [], "author": "", "license": "ISC", "description": "", "dependencies": { "@urql/core": "^5.0.5", "axios": "^1.7.3", "cookie-parser": "^1.4.6", "cors": "^2.8.5", "dotenv": "^16.4.5", "ethers": "^5.7.2", "express": "^4.19.2", "fhevmjs": "^0.4.0-3", "multer": "^1.4.5-lts.1", "node": "^20.16.0", "node-fetch": "^3.3.2", "nodemon": "^3.1.4", "pm2": "^5.4.2" } } ================================================ FILE: backend/src/index.js ================================================ const express = require("express"); const dotenv = require("dotenv"); const multer = require("multer"); const fs = require("fs"); const cors = require("cors"); const path = require("path"); const cookieParser = require("cookie-parser"); const crypto = require("crypto"); const { JsonRpcProvider, ethers } = require("ethers"); const { defaultAbiCoder } = require("ethers/lib/utils"); const { FHE, createInstance } = require("fhevmjs"); const axios = require("axios"); const FormData = require("form-data"); const app = express(); dotenv.config(); app.use(express.json()); app.use( express.urlencoded({ extended: true, }) ); const allowedIps = [ "http://localhost:3000", "https://onenfs.github.io/", "https://onenfs.vercel.app", ]; app.use( cors({ origin: function (origin, callback) { if (allowedIps.indexOf(origin) !== -1 || !origin) { callback(null, true); } else { callback(new Error("Not allowed by CORS")); } }, methods: ["GET", "POST", "PUT", "DELETE", "FETCH"], credentials: true, }) ); app.use(cookieParser()); // Configure multer for file uploads const storage = multer.diskStorage({ destination: (req, file, cb) => { cb(null, "uploads/audio"); }, filename: (req, file, cb) => { cb(null, Date.now() + path.extname(file.originalname)); }, }); const upload = multer({ storage: storage }); let ipfsHash; function encrypt(text, secretKey) { const cipher = crypto.createCipher("aes-128-ecb", secretKey); let encrypted = cipher.update(text, "utf8", "hex"); encrypted += cipher.final("hex"); return encrypted; } function decrypt(encryptedText, secretKey) { const decipher = crypto.createDecipher("aes-128-ecb", "" + secretKey + ""); let decrypted = decipher.update(encryptedText, "hex", "utf8"); decrypted += decipher.final("utf8"); return decrypted; } // for uploading music file app.post( "/endpoint", upload.fields([{ name: "musicFile" }, { name: "coverImage" }]), async (req, res) => { var JWT = process.env.JWT; const { userAddress } = req.body; const musicFile = req.files["musicFile"] ? req.files["musicFile"][0] : null; // const coverImage = req.files["coverImage"] // ? req.files["coverImage"][0] // : null; if (musicFile) { const formData = new FormData(); const fileStream = fs.createReadStream(musicFile.path); formData.append("file", fileStream); const pinataMetadata = JSON.stringify({ name: musicFile.originalname, }); formData.append("pinataMetadata", pinataMetadata); const pinataOptions = JSON.stringify({ cidVersion: 1, }); formData.append("pinataOptions", pinataOptions); try { const pinataResponse = await axios.post( "https://api.pinata.cloud/pinning/pinFileToIPFS", formData, { headers: { Authorization: `Bearer ${JWT}`, ...formData.getHeaders(), }, } ); ipfsHash = pinataResponse.data.IpfsHash; const FHE_LIB_ADDRESS = "0x000000000000000000000000000000000000005d"; const provider = new ethers.providers.JsonRpcProvider( "https://testnet.inco.org", { chainId: 9090, name: "Inco Gentry Testnet", } ); const createFhevmInstance = async () => { const network = await provider.getNetwork(); const chainId = +network.chainId.toString(); // Get blockchain public key const ret = await provider.call({ to: FHE_LIB_ADDRESS, // first four bytes of keccak256('fhePubKey(bytes1)') + 1 byte for library data: "0xd9d47bb001", }); const decoded = defaultAbiCoder.decode(["bytes"], ret); const publicKey = decoded[0]; const instance = await createInstance({ chainId, publicKey }); console.log("created instance"); return instance; }; const getInstance = async (myVariable) => { const instance = await createFhevmInstance(); // Create a provider const provider1 = new ethers.providers.JsonRpcProvider( "https://testnet.inco.org" ); // Create a wallet instance const wallet = new ethers.Wallet( "b726794ec951fa89e8d8c145a44888899291b7593a5c0b21d24d66cb32802f09", provider1 ); const signer = wallet.connect(provider); // Example ERC-20 token contract address and ABI (basic) const ERC20_ABI = [ { inputs: [ { internalType: "address", name: "newAdmin", type: "address", }, ], name: "addAdmin", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], stateMutability: "nonpayable", type: "constructor", }, { inputs: [], name: "InvalidShortString", type: "error", }, { inputs: [ { internalType: "string", name: "str", type: "string", }, ], name: "StringTooLong", type: "error", }, { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event", }, { inputs: [], name: "setNewRandomNumber", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "string", name: "encryptedIpfsCid", type: "string", }, { internalType: "bytes", name: "salt1", type: "bytes", }, { internalType: "bytes", name: "salt2", type: "bytes", }, { internalType: "bytes", name: "salt3", type: "bytes", }, { internalType: "address", name: "creator", type: "address", }, ], name: "storeCid", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "address", name: "newCreator", type: "address", }, { internalType: "euint32", name: "salt1", type: "uint256", }, { internalType: "euint32", name: "salt2", type: "uint256", }, { internalType: "euint32", name: "salt3", type: "uint256", }, ], name: "updateRandomNumberOrCreator", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "eip712Domain", outputs: [ { internalType: "bytes1", name: "fields", type: "bytes1", }, { internalType: "string", name: "name", type: "string", }, { internalType: "string", name: "version", type: "string", }, { internalType: "uint256", name: "chainId", type: "uint256", }, { internalType: "address", name: "verifyingContract", type: "address", }, { internalType: "bytes32", name: "salt", type: "bytes32", }, { internalType: "uint256[]", name: "extensions", type: "uint256[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getCreator", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedCid", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt1", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt2", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt3", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "getNewRandomNumber", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getRandomNumberAndCreator", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt1", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt2", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt3", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, ]; // Replace with the contract address of the inco you want to interact with const TOKEN_CONTRACT_ADDRESS = "0x533eD2257CFA5fb172F08a10e82756D5a0Af16f9"; // Create a contract instance const tokenContract = await new ethers.Contract( TOKEN_CONTRACT_ADDRESS, ERC20_ABI, signer ); const e = await tokenContract.setNewRandomNumber(); const idRandom = await tokenContract.getNewRandomNumber(); myVariable = idRandom; global.myVariable = idRandom; // Generate a random 16-digit number as a string const randomNumber = Math.floor(Math.random() * 10 ** 16) .toString() .padStart(16, "0"); // Split the number into two 8-digit parts const salt1tmp = instance.encrypt32(Number(randomNumber.slice(0, 5))); const salt2tmp = instance.encrypt32( Number(randomNumber.slice(5, 10)) ); const salt3tmp = instance.encrypt32( Number(randomNumber.slice(10, 16)) ); const toHexString = (bytes) => bytes.reduce( (str, byte) => str + byte.toString(16).padStart(2, "0"), "" ); const salt1 = "0x" + toHexString(salt1tmp); const salt2 = "0x" + toHexString(salt2tmp); const salt3 = "0x" + toHexString(salt3tmp); // Encrypt message with AES const aesEncrypted = encrypt(ipfsHash, randomNumber); // Function to store CID in the contract async function storeCid( idRandom, aesEncrypted, salt1, salt2, salt3, userAddress ) { try { const result = await tokenContract.storeCid( idRandom, aesEncrypted, salt1, salt2, salt3, userAddress, { gasLimit: 2500000, } ); console.log("Transaction storing CID result:", result); } catch (error) { console.error("Error storing CID:", error); } } // Execute the function const walletAddress = ethers.utils.getAddress(wallet.address); await storeCid( idRandom, aesEncrypted, salt1, salt2, salt3, userAddress ); return idRandom; }; let myVariable; const dbh = await getInstance(myVariable); global.myGlobalVariable = ipfsHash; console.log("Pinata Response:", pinataResponse.data); res.status(200).send({ message: "Data received and uploaded successfully", // pinataResponse: pinataResponse.data, value: dbh, }); // Unlink (delete) the music file from the server fs.unlink(musicFile.path, (err) => { if (err) { console.error("Error deleting file:", err); } else { console.log("File deleted successfully"); } }); } catch (error) { console.error("Error uploading to Pinata:", error); res.status(500).send({ message: "Failed to upload to Pinata", error: error.message, }); } } else { res.status(400).send("No music file provided"); } } ); // for playing music file app.get("/hashsong/:randomId", async (req, res) => { const { randomId } = req.params; console.log("randomId", randomId); const provider2 = new ethers.providers.JsonRpcProvider( "https://testnet.inco.org", { chainId: 9090, name: "Inco Gentry Testnet", } ); // Create a provider const provider3 = new ethers.providers.JsonRpcProvider( "https://testnet.inco.org" ); // Create a wallet instance const wallet2 = new ethers.Wallet( "b726794ec951fa89e8d8c145a44888899291b7593a5c0b21d24d66cb32802f09", provider3 ); const signer2 = wallet2.connect(provider2); // Example ERC-20 token contract address and ABI (basic) const ERC20_ABI2 = [ { inputs: [ { internalType: "address", name: "newAdmin", type: "address", }, ], name: "addAdmin", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], stateMutability: "nonpayable", type: "constructor", }, { inputs: [], name: "InvalidShortString", type: "error", }, { inputs: [ { internalType: "string", name: "str", type: "string", }, ], name: "StringTooLong", type: "error", }, { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event", }, { inputs: [], name: "setNewRandomNumber", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "string", name: "encryptedIpfsCid", type: "string", }, { internalType: "bytes", name: "salt1", type: "bytes", }, { internalType: "bytes", name: "salt2", type: "bytes", }, { internalType: "bytes", name: "salt3", type: "bytes", }, { internalType: "address", name: "creator", type: "address", }, ], name: "storeCid", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "address", name: "newCreator", type: "address", }, { internalType: "euint32", name: "salt1", type: "uint256", }, { internalType: "euint32", name: "salt2", type: "uint256", }, { internalType: "euint32", name: "salt3", type: "uint256", }, ], name: "updateRandomNumberOrCreator", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "eip712Domain", outputs: [ { internalType: "bytes1", name: "fields", type: "bytes1", }, { internalType: "string", name: "name", type: "string", }, { internalType: "string", name: "version", type: "string", }, { internalType: "uint256", name: "chainId", type: "uint256", }, { internalType: "address", name: "verifyingContract", type: "address", }, { internalType: "bytes32", name: "salt", type: "bytes32", }, { internalType: "uint256[]", name: "extensions", type: "uint256[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getCreator", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedCid", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt1", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt2", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt3", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "getNewRandomNumber", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getRandomNumberAndCreator", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt1", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt2", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt3", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, ]; // Replace with the contract address of the inco you want to interact with const TOKEN_CONTRACT_ADDRESS2 = "0x533eD2257CFA5fb172F08a10e82756D5a0Af16f9"; // Create a contract instance const tokenContract2 = await new ethers.Contract( TOKEN_CONTRACT_ADDRESS2, ERC20_ABI2, signer2 ); try { const result = await tokenContract2.getDecryptedCid(randomId); const result1 = await tokenContract2.getDecryptedSalt1(randomId); const result2 = await tokenContract2.getDecryptedSalt2(randomId); const result3 = await tokenContract2.getDecryptedSalt3(randomId); const mainSalt = result1.toString() + result2.toString() + result3.toString(); console.log("mainSalt", mainSalt); console.log("result", result); const aesDecrypted = await decrypt(""+result+"", ""+mainSalt+""); console.log("aesDecrypted", aesDecrypted); const audioUrl = `https://harlequin-secure-tortoise-165.mypinata.cloud/ipfs/${aesDecrypted}`; const range = req.headers.range; const headResponse = await axios.head(audioUrl); const contentLength = headResponse.headers["content-length"]; const contentType = headResponse.headers["content-type"]; if (range) { const parts = range.replace(/bytes=/, "").split("-"); const start = parseInt(parts[0], 10); const end = parts[1] ? parseInt(parts[1], 10) : contentLength - 1; const chunksize = end - start + 1; const rangeResponse = await axios({ method: "get", url: audioUrl, responseType: "stream", headers: { Range: `bytes=${start}-${end}` }, }); res.writeHead(206, { "Content-Range": `bytes ${start}-${end}/${contentLength}`, "Accept-Ranges": "bytes", "Content-Length": chunksize, "Content-Type": contentType, }); rangeResponse.data.pipe(res); } else { const fullResponse = await axios({ method: "get", url: audioUrl, responseType: "stream", }); res.writeHead(200, { "Content-Length": contentLength, "Content-Type": contentType, }); fullResponse.data.pipe(res); } } catch (error) { console.error("Error:", error); } }); // store private playlist app.post("/playlist", (req, res) => { const { playArray, playName, rentalAdd } = req.body; const providerPlaylist = new ethers.providers.JsonRpcProvider( "https://testnet.inco.org", { chainId: 9090, name: "Inco Gentry Testnet", } ); const walletPlaylist = new ethers.Wallet( "b726794ec951fa89e8d8c145a44888899291b7593a5c0b21d24d66cb32802f09", providerPlaylist ); const signerPlaylist = walletPlaylist.connect(providerPlaylist); const ERC20_ABI_Playlist = [ { inputs: [ { internalType: "address", name: "newAdmin", type: "address", }, ], name: "addAdmin", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], stateMutability: "nonpayable", type: "constructor", }, { inputs: [], name: "InvalidShortString", type: "error", }, { inputs: [ { internalType: "string", name: "str", type: "string", }, ], name: "StringTooLong", type: "error", }, { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event", }, { inputs: [], name: "setNewRandomNumber", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "string", name: "encryptedIpfsCid", type: "string", }, { internalType: "bytes", name: "salt1", type: "bytes", }, { internalType: "bytes", name: "salt2", type: "bytes", }, { internalType: "bytes", name: "salt3", type: "bytes", }, { internalType: "address", name: "creator", type: "address", }, ], name: "storeCid", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "string", name: "encryptedString", type: "string", }, { internalType: "string", name: "playlistName", type: "string", }, { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "address", name: "wallet", type: "address", }, ], name: "storePrivatePlaylist", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "address", name: "newCreator", type: "address", }, { internalType: "euint32", name: "salt1", type: "uint256", }, { internalType: "euint32", name: "salt2", type: "uint256", }, { internalType: "euint32", name: "salt3", type: "uint256", }, ], name: "updateRandomNumberOrCreator", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "eip712Domain", outputs: [ { internalType: "bytes1", name: "fields", type: "bytes1", }, { internalType: "string", name: "name", type: "string", }, { internalType: "string", name: "version", type: "string", }, { internalType: "uint256", name: "chainId", type: "uint256", }, { internalType: "address", name: "verifyingContract", type: "address", }, { internalType: "bytes32", name: "salt", type: "bytes32", }, { internalType: "uint256[]", name: "extensions", type: "uint256[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getCreator", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedCid", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt1", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt2", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt3", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "string", name: "playlistName", type: "string", }, ], name: "getEncryptedStringByPlaylistName", outputs: [ { internalType: "string", name: "value", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "getNewRandomNumber", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylist", outputs: [ { internalType: "string[]", name: "", type: "string[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylistByRandomNumber", outputs: [ { internalType: "string[]", name: "", type: "string[]", }, { internalType: "address", name: "", type: "address", }, { internalType: "string[]", name: "", type: "string[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "address", name: "wallet", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "getPlaylistByRandomNumberAndWallet", outputs: [ { internalType: "string", name: "", type: "string", }, { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylistCountByRandomNumber", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "wallet", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "getPlaylistRandomNumberFromIndex", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getRandomNumberAndCreator", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt1", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt2", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt3", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, ]; const TOKEN_CONTRACT_ADDRESS_Playlist = "0xd3E06D670A1C0180AB1e3AC36254457039bBfD89"; const tokenContractPlaylist = new ethers.Contract( TOKEN_CONTRACT_ADDRESS_Playlist, ERC20_ABI_Playlist, signerPlaylist ); // Attempt to get the random number for the playlist tokenContractPlaylist .getPlaylistRandomNumberFromIndex(rentalAdd, 0) .then((resultPlaylist) => { const bigNumber = ethers.BigNumber.from(resultPlaylist); // Convert BigNumber to number const number = bigNumber.toNumber(); let aesEncrypted; let finalRandom; if (number > 0) { aesEncrypted = encrypt(playArray.toString(), number.toString()); finalRandom = number; } else { const randomNumberPlaylist = Math.floor(Math.random() * 10 ** 16) .toString() .padStart(16, "0"); // Encrypt message with AES aesEncrypted = encrypt( playArray.toString(), randomNumberPlaylist.toString() ); finalRandom = randomNumberPlaylist; } // Call the storePrivatePlaylist function return tokenContractPlaylist.storePrivatePlaylist( aesEncrypted, playName, finalRandom, rentalAdd ); }) .then((playlistData) => { res.status(200).json({ message: "Playlist RandomNumber Exist", playlistData: playlistData, sucess: true, }); }) .catch((error) => { console.error("Error processing request:", error); res .status(500) .json({ error: "An error occurred while processing the request" }); }); }); // get playlist of signin user app.get("/getPlaylist/:rentAdd", async (req, res) => { const { rentAdd } = req.params; const providerPlaylist = new ethers.providers.JsonRpcProvider( "https://testnet.inco.org", { chainId: 9090, name: "Inco Gentry Testnet", } ); const walletPlaylist = new ethers.Wallet( "b726794ec951fa89e8d8c145a44888899291b7593a5c0b21d24d66cb32802f09", providerPlaylist ); const signerPlaylist = walletPlaylist.connect(providerPlaylist); const ERC20_ABI_Playlist = [ { inputs: [ { internalType: "address", name: "newAdmin", type: "address", }, ], name: "addAdmin", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], stateMutability: "nonpayable", type: "constructor", }, { inputs: [], name: "InvalidShortString", type: "error", }, { inputs: [ { internalType: "string", name: "str", type: "string", }, ], name: "StringTooLong", type: "error", }, { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event", }, { inputs: [], name: "setNewRandomNumber", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "string", name: "encryptedIpfsCid", type: "string", }, { internalType: "bytes", name: "salt1", type: "bytes", }, { internalType: "bytes", name: "salt2", type: "bytes", }, { internalType: "bytes", name: "salt3", type: "bytes", }, { internalType: "address", name: "creator", type: "address", }, ], name: "storeCid", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "string", name: "encryptedString", type: "string", }, { internalType: "string", name: "playlistName", type: "string", }, { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "address", name: "wallet", type: "address", }, ], name: "storePrivatePlaylist", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "address", name: "newCreator", type: "address", }, { internalType: "euint32", name: "salt1", type: "uint256", }, { internalType: "euint32", name: "salt2", type: "uint256", }, { internalType: "euint32", name: "salt3", type: "uint256", }, ], name: "updateRandomNumberOrCreator", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "eip712Domain", outputs: [ { internalType: "bytes1", name: "fields", type: "bytes1", }, { internalType: "string", name: "name", type: "string", }, { internalType: "string", name: "version", type: "string", }, { internalType: "uint256", name: "chainId", type: "uint256", }, { internalType: "address", name: "verifyingContract", type: "address", }, { internalType: "bytes32", name: "salt", type: "bytes32", }, { internalType: "uint256[]", name: "extensions", type: "uint256[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getCreator", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedCid", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt1", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt2", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt3", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "string", name: "playlistName", type: "string", }, ], name: "getEncryptedStringByPlaylistName", outputs: [ { internalType: "string", name: "value", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "getNewRandomNumber", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylist", outputs: [ { internalType: "string[]", name: "", type: "string[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylistByRandomNumber", outputs: [ { internalType: "string[]", name: "", type: "string[]", }, { internalType: "address", name: "", type: "address", }, { internalType: "string[]", name: "", type: "string[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "address", name: "wallet", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "getPlaylistByRandomNumberAndWallet", outputs: [ { internalType: "string", name: "", type: "string", }, { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylistCountByRandomNumber", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "wallet", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "getPlaylistRandomNumberFromIndex", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getRandomNumberAndCreator", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt1", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt2", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt3", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, ]; const TOKEN_CONTRACT_ADDRESS_Playlist = "0xd3E06D670A1C0180AB1e3AC36254457039bBfD89"; const tokenContractPlaylist = new ethers.Contract( TOKEN_CONTRACT_ADDRESS_Playlist, ERC20_ABI_Playlist, signerPlaylist ); // Attempt to get the random number for the playlist tokenContractPlaylist .getPlaylistRandomNumberFromIndex(rentAdd, 0) .then((resultPlaylist) => { const salt2 = resultPlaylist; const bigNumberSalty = ethers.BigNumber.from(salt2); // Convert BigNumber to number const numberSalt = bigNumberSalty; const saltRandom = tokenContractPlaylist .getPlaylist(numberSalt) .then((result) => { const mainSalt = result; res.status(200).json({ message: "Playlist RandomNumber Exist", playlistame: mainSalt, Randomsalt: Number(numberSalt), }); }); }) .catch((error) => { console.error("Error processing request:", error); res .status(500) .json({ error: "An error occurred while processing the request" }); }); }); // get sound of playlist using playname app.post("/getSound", (req, res) => { const { random, playName } = req.body; const providerPlaylist = new ethers.providers.JsonRpcProvider( "https://testnet.inco.org", { chainId: 9090, name: "Inco Gentry Testnet", } ); const walletPlaylist = new ethers.Wallet( "b726794ec951fa89e8d8c145a44888899291b7593a5c0b21d24d66cb32802f09", providerPlaylist ); const signerPlaylist = walletPlaylist.connect(providerPlaylist); const ERC20_ABI_Playlist = [ { inputs: [ { internalType: "address", name: "newAdmin", type: "address", }, ], name: "addAdmin", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], stateMutability: "nonpayable", type: "constructor", }, { inputs: [], name: "InvalidShortString", type: "error", }, { inputs: [ { internalType: "string", name: "str", type: "string", }, ], name: "StringTooLong", type: "error", }, { anonymous: false, inputs: [], name: "EIP712DomainChanged", type: "event", }, { inputs: [], name: "setNewRandomNumber", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "string", name: "encryptedIpfsCid", type: "string", }, { internalType: "bytes", name: "salt1", type: "bytes", }, { internalType: "bytes", name: "salt2", type: "bytes", }, { internalType: "bytes", name: "salt3", type: "bytes", }, { internalType: "address", name: "creator", type: "address", }, ], name: "storeCid", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "string", name: "encryptedString", type: "string", }, { internalType: "string", name: "playlistName", type: "string", }, { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "address", name: "wallet", type: "address", }, ], name: "storePrivatePlaylist", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, { internalType: "address", name: "newCreator", type: "address", }, { internalType: "euint32", name: "salt1", type: "uint256", }, { internalType: "euint32", name: "salt2", type: "uint256", }, { internalType: "euint32", name: "salt3", type: "uint256", }, ], name: "updateRandomNumberOrCreator", outputs: [], stateMutability: "nonpayable", type: "function", }, { inputs: [], name: "eip712Domain", outputs: [ { internalType: "bytes1", name: "fields", type: "bytes1", }, { internalType: "string", name: "name", type: "string", }, { internalType: "string", name: "version", type: "string", }, { internalType: "uint256", name: "chainId", type: "uint256", }, { internalType: "address", name: "verifyingContract", type: "address", }, { internalType: "bytes32", name: "salt", type: "bytes32", }, { internalType: "uint256[]", name: "extensions", type: "uint256[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getCreator", outputs: [ { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedCid", outputs: [ { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt1", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt2", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getDecryptedSalt3", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "string", name: "playlistName", type: "string", }, ], name: "getEncryptedStringByPlaylistName", outputs: [ { internalType: "string", name: "value", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [], name: "getNewRandomNumber", outputs: [ { internalType: "uint32", name: "", type: "uint32", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylist", outputs: [ { internalType: "string[]", name: "", type: "string[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylistByRandomNumber", outputs: [ { internalType: "string[]", name: "", type: "string[]", }, { internalType: "address", name: "", type: "address", }, { internalType: "string[]", name: "", type: "string[]", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, { internalType: "address", name: "wallet", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "getPlaylistByRandomNumberAndWallet", outputs: [ { internalType: "string", name: "", type: "string", }, { internalType: "string", name: "", type: "string", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "randomNumber", type: "uint256", }, ], name: "getPlaylistCountByRandomNumber", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "address", name: "wallet", type: "address", }, { internalType: "uint256", name: "index", type: "uint256", }, ], name: "getPlaylistRandomNumberFromIndex", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getRandomNumberAndCreator", outputs: [ { internalType: "uint256", name: "", type: "uint256", }, { internalType: "address", name: "", type: "address", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt1", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt2", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, { inputs: [ { internalType: "uint256", name: "tokenId", type: "uint256", }, ], name: "getSalt3", outputs: [ { internalType: "euint32", name: "", type: "uint256", }, ], stateMutability: "view", type: "function", }, ]; const TOKEN_CONTRACT_ADDRESS_Playlist = "0xd3E06D670A1C0180AB1e3AC36254457039bBfD89"; const tokenContractPlaylist = new ethers.Contract( TOKEN_CONTRACT_ADDRESS_Playlist, ERC20_ABI_Playlist, signerPlaylist ); tokenContractPlaylist .getEncryptedStringByPlaylistName("" + random + "", "" + playName + "") .then((encryptresultPlaylist) => { const aesDecryptedNew = decrypt(encryptresultPlaylist, "" + random + ""); res.status(200).json({ message: "Selected Playlist", playlistData: aesDecryptedNew, }); }); }); app.get("/", (req, res) => { res.send("Hello World!"); }); const port = process.env.PORT; app.listen(port, () => { console.log(`Server is running on http://localhost:${port}`); }).on("error", (err) => { console.error("Error starting server:", err); }); ================================================ FILE: backend/src/subgraph.js ================================================ const express = require("express"); const { createClient, fetchExchange } = require("@urql/core"); const fetch = require("node-fetch"); const app = express(); const port = 3002; // Create a URQL client const client = createClient({ url: "https://api.studio.thegraph.com/query/63941/finalows/version/latest", exchanges: [fetchExchange], fetch: fetch, }); // Define your GraphQL query const MY_QUERY = ` query { nftminteds(orderBy: tokenId) { id creator tokenId } nftpurchaseds(orderBy: tokenId) { id buyer tokenId } nftrenteds { id renter tokenId duration } rentInfoSets(orderBy: tokenId) { id rentBaseAmount rentDuration tokenId } royaltyPaids(orderBy: tokenId) { id creator tokenId amount } transfers(orderBy: OwnSound_id) { id from to OwnSound_id } } `; // Function to fetch data from The Graph async function fetchData() { try { const result = await client.query(MY_QUERY).toPromise(); if (result.error) { console.error("Error:", result.error); return null; } console.log("Query result:", result.data); return result.data; } catch (error) { console.error("Error fetching data:", error); return null; } } // API endpoint to get data app.get("/api/data", async (req, res) => { const data = await fetchData(); if (data) { res.json(data); } else { res.status(500).json({ error: "Failed to fetch data" }); } }); // Start the server app.listen(port, () => { console.log(`Server running at http://localhost:${port}`); }); ================================================ FILE: backend/src/upload.js ================================================ // src/upload.js export const config = { api: { bodyParser: false, // Disable body parsing for FormData }, }; export default async function handler(req, res) { if (req.method === "POST") { try { const formData = await new Promise((resolve, reject) => { const busboy = require("busboy"); const bb = busboy({ headers: req.headers }); const fields = {}; const files = {}; bb.on("field", (name, value) => { fields[name] = value; }); bb.on("file", (name, file, info) => { const { filename, mimeType } = info; const chunks = []; file .on("data", (chunk) => { chunks.push(chunk); }) .on("end", () => { files[name] = { buffer: Buffer.concat(chunks), filename, mimeType, }; }); }); bb.on("finish", () => { resolve({ fields, files }); }); req.pipe(bb); }); console.log("Data received from formData:", formData); // Forward data to your Node.js API const apiResponse = await fetch("http://localhost:8000//endpoint", { method: "POST", headers: { "Content-Type": "application/json", }, body: JSON.stringify(formDataformData), }); console.log("Data received on Node.js API:", apiResponse); if (apiResponse.ok) { res.status(200).json({ message: "Data forwarded successfully" }); } else { res.status(500).json({ error: "Failed to forward data" }); } } catch (error) { res.status(500).json({ error: "An error occurred" }); } } else { res.setHeader("Allow", ["POST","GET"]); res.status(405).end(`Method ${req.method} Not Allowed`); } } ================================================ FILE: backend/src/wallet.js ================================================ const { ethers } = require("ethers"); // Replace with your own RPC URL and private key const RPC_URL = process.env.RPC_URL; const PRIVATE_KEY = process.env.PRIVATE_KEY; // Create a provider const provider = new ethers.JsonRpcProvider(RPC_URL); // Create a wallet instance const wallet = new ethers.Wallet(PRIVATE_KEY, provider); // Log the wallet address console.log("Wallet address:", wallet.address); // Example ERC-20 token contract address and ABI (basic) const ERC20_ABI = [ // Some ERC-20 methods "function balanceOf(address owner) view returns (uint256)", ]; // Replace with the contract address of the ERC-20 token you want to interact with const TOKEN_CONTRACT_ADDRESS = "0xYourTokenContractAddress"; // Create a contract instance const tokenContract = new ethers.Contract( TOKEN_CONTRACT_ADDRESS, ERC20_ABI, wallet ); // Function to get the balance of the wallet address async function getBalance() { try { const balance = await tokenContract.balanceOf(wallet.address); console.log("Token balance:", ethers.formatEther(balance)); } catch (error) { console.error("Error fetching balance:", error); } } // Execute the function getBalance(); ================================================ FILE: backend/vercel.json ================================================ { "version": 2, "builds": [ { "src": "src/index.js", "use": "@vercel/node" } ], "routes": [ { "src": "/(.*)", "dest": "src/index.js" } ] } ================================================ FILE: client/.eslintrc.json ================================================ { "extends": "next/core-web-vitals", "rules": { "react/no-unescaped-entities": "off", "@next/next/no-img-element": "off" } } ================================================ FILE: client/.gitignore ================================================ # See https://help.github.com/articles/ignoring-files/ for more about ignoring files. # dependencies /node_modules /.pnp .pnp.js .yarn/install-state.gz # testing /coverage # next.js /.next/ # production /build # misc .DS_Store *.pem # debug npm-debug.log* yarn-debug.log* yarn-error.log* # local env files .env*.local # vercel .vercel # typescript *.tsbuildinfo next-env.d.ts ================================================ FILE: client/README.md ================================================ ## Getting Started First, run the development server: ```bash npm run dev # or yarn dev # or pnpm dev # or bun dev ``` Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. ================================================ FILE: client/components.json ================================================ { "$schema": "https://ui.shadcn.com/schema.json", "style": "default", "rsc": true, "tsx": false, "tailwind": { "config": "tailwind.config.js", "css": "src/app/globals.css", "baseColor": "slate", "cssVariables": true, "prefix": "" }, "aliases": { "components": "@/components", "utils": "@/lib/utils" } } ================================================ FILE: client/jsconfig.json ================================================ { "compilerOptions": { "paths": { "@/*": ["./src/*"] } } } ================================================ FILE: client/next.config.mjs ================================================ /** @type {import('next').NextConfig} */ const API_URL = process.env.API_URL; const nextConfig = { output: 'export', reactStrictMode: false, env: { NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME: "da9h8exvs", NEXT_PUBLIC_CLOUDINARY_PRESET_NAME: "fi0lxkc1", }, images: { domains: ["res.cloudinary.com"], }, async rewrites() { return [ { source: "/api/:path*", destination: `${API_URL}/:path*`, }, ]; }, }; export default nextConfig; ================================================ FILE: client/out/404.html ================================================ 404: This page could not be found.Own Sound

404

This page could not be found.

================================================ FILE: client/out/_next/static/Qvu3_p21LuapbgDau0_w0/_buildManifest.js ================================================ self.__BUILD_MANIFEST=function(e){return{__rewrites:{afterFiles:[{has:e,source:"/api/:path*",destination:e}],beforeFiles:[],fallback:[]},"/_error":["static/chunks/pages/_error-6ae619510b1539d6.js"],sortedPages:["/_app","/_error"]}}(void 0),self.__BUILD_MANIFEST_CB&&self.__BUILD_MANIFEST_CB(); ================================================ FILE: client/out/_next/static/Qvu3_p21LuapbgDau0_w0/_ssgManifest.js ================================================ self.__SSG_MANIFEST=new Set([]);self.__SSG_MANIFEST_CB&&self.__SSG_MANIFEST_CB() ================================================ FILE: client/out/_next/static/chunks/112-05ef4e14cff1a5e4.js ================================================ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[112],{78369:function(e,t,r){"use strict";r.d(t,{Ry:function(){return u}});var n=new WeakMap,o=new WeakMap,i={},a=0,s=function(e){return e&&(e.host||s(e.parentNode))},l=function(e,t,r,l){var u=(Array.isArray(e)?e:[e]).map(function(e){if(t.contains(e))return e;var r=s(e);return r&&t.contains(r)?r:(console.error("aria-hidden",e,"in not contained inside",t,". Doing nothing"),null)}).filter(function(e){return!!e});i[r]||(i[r]=new WeakMap);var c=i[r],d=[],f=new Set,p=new Set(u),h=function(e){!e||f.has(e)||(f.add(e),h(e.parentNode))};u.forEach(h);var m=function(e){!e||p.has(e)||Array.prototype.forEach.call(e.children,function(e){if(f.has(e))m(e);else try{var t=e.getAttribute(l),i=null!==t&&"false"!==t,a=(n.get(e)||0)+1,s=(c.get(e)||0)+1;n.set(e,a),c.set(e,s),d.push(e),1===a&&i&&o.set(e,!0),1===s&&e.setAttribute(r,"true"),i||e.setAttribute(l,"true")}catch(t){console.error("aria-hidden: cannot operate on ",e,t)}})};return m(t),f.clear(),a++,function(){d.forEach(function(e){var t=n.get(e)-1,i=c.get(e)-1;n.set(e,t),c.set(e,i),t||(o.has(e)||e.removeAttribute(l),o.delete(e)),i||e.removeAttribute(r)}),--a||(n=new WeakMap,n=new WeakMap,o=new WeakMap,i={})}},u=function(e,t,r){void 0===r&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),o=t||("undefined"==typeof document?null:(Array.isArray(e)?e[0]:e).ownerDocument.body);return o?(n.push.apply(n,Array.from(o.querySelectorAll("[aria-live]"))),l(n,o,r,"aria-hidden")):function(){return null}}},50084:function(e,t,r){"use strict";var n=r(77323),o=r(11356),i=o(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&i(e,".prototype.")>-1?o(r):r}},11356:function(e,t,r){"use strict";var n=r(71769),o=r(77323),i=r(49813),a=r(31354),s=o("%Function.prototype.apply%"),l=o("%Function.prototype.call%"),u=o("%Reflect.apply%",!0)||n.call(l,s),c=r(7723),d=o("%Math.max%");e.exports=function(e){if("function"!=typeof e)throw new a("a function is required");var t=u(n,l,arguments);return i(t,1+d(0,e.length-(arguments.length-1)),!0)};var f=function(){return u(n,s,arguments)};c?c(e.exports,"apply",{value:f}):e.exports.apply=f},30602:function(e,t,r){"use strict";var n=r(7723),o=r(97422),i=r(31354),a=r(68136);e.exports=function(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw new i("`obj` must be an object or a function`");if("string"!=typeof t&&"symbol"!=typeof t)throw new i("`property` must be a string or a symbol`");if(arguments.length>3&&"boolean"!=typeof arguments[3]&&null!==arguments[3])throw new i("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&"boolean"!=typeof arguments[4]&&null!==arguments[4])throw new i("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&"boolean"!=typeof arguments[5]&&null!==arguments[5])throw new i("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&"boolean"!=typeof arguments[6])throw new i("`loose`, if provided, must be a boolean");var s=arguments.length>3?arguments[3]:null,l=arguments.length>4?arguments[4]:null,u=arguments.length>5?arguments[5]:null,c=arguments.length>6&&arguments[6],d=!!a&&a(e,t);if(n)n(e,t,{configurable:null===u&&d?d.configurable:!u,enumerable:null===s&&d?d.enumerable:!s,value:r,writable:null===l&&d?d.writable:!l});else if(!c&&(s||l||u))throw new o("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");else e[t]=r}},7723:function(e,t,r){"use strict";var n=r(77323)("%Object.defineProperty%",!0)||!1;if(n)try{n({},"a",{value:1})}catch(e){n=!1}e.exports=n},41479:function(e){"use strict";e.exports=EvalError},19509:function(e){"use strict";e.exports=Error},33231:function(e){"use strict";e.exports=RangeError},78531:function(e){"use strict";e.exports=ReferenceError},97422:function(e){"use strict";e.exports=SyntaxError},31354:function(e){"use strict";e.exports=TypeError},88150:function(e){"use strict";e.exports=URIError},78734:function(e){"use strict";var t=Object.prototype.toString,r=Math.max,n=function(e,t){for(var r=[],n=0;n1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===M(/^%?[^%]*%?$/,e))throw new l("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=N(e),n=r.length>0?r[0]:"",o=L("%"+n+"%",t),i=o.name,a=o.value,s=!1,c=o.alias;c&&(n=c[0],C(r,j([0,1],c)));for(var d=1,f=!0;d=r.length){var g=p(a,h);a=(f=!!g)&&"get"in g&&!("originalValue"in g.get)?g.get:a[h]}else f=R(a,h),a=a[h];f&&!s&&(x[i]=a)}}return a}},68136:function(e,t,r){"use strict";var n=r(77323)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n},66626:function(e,t,r){"use strict";var n=r(7723),o=function(){return!!n};o.hasArrayLengthDefineBug=function(){if(!n)return null;try{return 1!==n([],"length",{value:1}).length}catch(e){return!0}},e.exports=o},77077:function(e){"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return({__proto__:t}).foo===t.foo&&!(t instanceof r)}},42152:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,o=r(41770);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&o()}},41770:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;for(t in e[t]=42,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var n=Object.getOwnPropertySymbols(e);if(1!==n.length||n[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(42!==o.value||!0!==o.enumerable)return!1}return!0}},71060:function(e,t,r){"use strict";var n=Function.prototype.call,o=Object.prototype.hasOwnProperty,i=r(71769);e.exports=i.call(n,o)},43393:function(e,t,r){!function(e,t,r){"use strict";function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var o=n(t),i=n(r);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t=0||(o[r]=e[r]);return o}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}function u(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r0&&void 0!==arguments[0]?arguments[0]:{};if(O.current){null===(t=C.current)||void 0===t||t.destroy();var n=s(s(s({},e),r),{},{container:O.current});return C.current=o.default.loadAnimation(n),j(!!C.current),function(){var e;null===(e=C.current)||void 0===e||e.destroy(),C.current=void 0}}};return r.useEffect(function(){var e=T();return function(){return null==e?void 0:e()}},[a,d]),r.useEffect(function(){C.current&&(C.current.autoplay=!!f)},[f]),r.useEffect(function(){if(C.current){if(!p){C.current.resetSegments(!0);return}Array.isArray(p)&&p.length&&((C.current.currentRawFramep[1])&&(C.current.currentRawFrame=p[0]),C.current.setSegment(p[0],p[1]))}},[p]),r.useEffect(function(){var e=[{name:"complete",handler:h},{name:"loopComplete",handler:m},{name:"enterFrame",handler:y},{name:"segmentStart",handler:g},{name:"config_ready",handler:v},{name:"data_ready",handler:b},{name:"data_failed",handler:w},{name:"loaded_images",handler:x},{name:"DOMLoaded",handler:S},{name:"destroy",handler:P}].filter(function(e){return null!=e.handler});if(e.length){var t=e.map(function(e){var t;return null===(t=C.current)||void 0===t||t.addEventListener(e.name,e.handler),function(){var t;null===(t=C.current)||void 0===t||t.removeEventListener(e.name,e.handler)}});return function(){t.forEach(function(e){return e()})}}},[h,m,y,g,v,b,w,x,S,P]),{View:i.default.createElement("div",s({style:t,ref:O},E)),play:function(){var e;null===(e=C.current)||void 0===e||e.play()},stop:function(){var e;null===(e=C.current)||void 0===e||e.stop()},pause:function(){var e;null===(e=C.current)||void 0===e||e.pause()},setSpeed:function(e){var t;null===(t=C.current)||void 0===t||t.setSpeed(e)},goToAndStop:function(e,t){var r;null===(r=C.current)||void 0===r||r.goToAndStop(e,t)},goToAndPlay:function(e,t){var r;null===(r=C.current)||void 0===r||r.goToAndPlay(e,t)},setDirection:function(e){var t;null===(t=C.current)||void 0===t||t.setDirection(e)},playSegments:function(e,t){var r;null===(r=C.current)||void 0===r||r.playSegments(e,t)},setSubframe:function(e){var t;null===(t=C.current)||void 0===t||t.setSubframe(e)},getDuration:function(e){var t;return null===(t=C.current)||void 0===t?void 0:t.getDuration(e)},destroy:function(){var e;null===(e=C.current)||void 0===e||e.destroy(),C.current=void 0},animationContainerRef:O,animationLoaded:R,animationItem:C.current}},f=function(e){var t=e.wrapperRef,n=e.animationItem,o=e.mode,i=e.actions;r.useEffect(function(){var e,r,a,s,l,u=t.current;if(u&&n&&i.length)switch(n.stop(),o){case"scroll":return e=null,r=function(){var t,r,o,a=(r=(t=u.getBoundingClientRect()).top,o=t.height,(window.innerHeight-r)/(window.innerHeight+o)),s=i.find(function(e){var t=e.visibility;return t&&a>=t[0]&&a<=t[1]});if(s){if("seek"===s.type&&s.visibility&&2===s.frames.length){var l=s.frames[0]+Math.ceil((a-s.visibility[0])/(s.visibility[1]-s.visibility[0])*s.frames[1]);n.goToAndStop(l-n.firstFrame-1,!0)}"loop"===s.type&&(null===e?(n.playSegments(s.frames,!0),e=s.frames):e!==s.frames?(n.playSegments(s.frames,!0),e=s.frames):n.isPaused&&(n.playSegments(s.frames,!0),e=s.frames)),"play"===s.type&&n.isPaused&&(n.resetSegments(!0),n.play()),"stop"===s.type&&n.goToAndStop(s.frames[0]-n.firstFrame-1,!0)}},document.addEventListener("scroll",r),function(){document.removeEventListener("scroll",r)};case"cursor":return a=function(e,t){var r=e,o=t;if(-1!==r&&-1!==o){var a,s,l,c,d=(a=r,s=o,c=(l=u.getBoundingClientRect()).top,{x:(a-l.left)/l.width,y:(s-c)/l.height});r=d.x,o=d.y}var f=i.find(function(e){var t=e.position;return t&&Array.isArray(t.x)&&Array.isArray(t.y)?r>=t.x[0]&&r<=t.x[1]&&o>=t.y[0]&&o<=t.y[1]:!(!t||Number.isNaN(t.x)||Number.isNaN(t.y))&&r===t.x&&o===t.y});if(f){if("seek"===f.type&&f.position&&Array.isArray(f.position.x)&&Array.isArray(f.position.y)&&2===f.frames.length){var p=(r-f.position.x[0])/(f.position.x[1]-f.position.x[0]),h=(o-f.position.y[0])/(f.position.y[1]-f.position.y[0]);n.playSegments(f.frames,!0),n.goToAndStop(Math.ceil((p+h)/2*(f.frames[1]-f.frames[0])),!0)}"loop"===f.type&&n.playSegments(f.frames,!0),"play"===f.type&&(n.isPaused&&n.resetSegments(!1),n.playSegments(f.frames)),"stop"===f.type&&n.goToAndStop(f.frames[0],!0)}},s=function(e){a(e.clientX,e.clientY)},l=function(){a(-1,-1)},u.addEventListener("mousemove",s),u.addEventListener("mouseout",l),function(){u.removeEventListener("mousemove",s),u.removeEventListener("mouseout",l)}}},[o,n])},p=function(e){var t=e.actions,r=e.mode,n=e.lottieObj,o=n.animationItem,i=n.View;return f({actions:t,animationItem:o,mode:r,wrapperRef:n.animationContainerRef}),i},h=["style","interactivity"];Object.defineProperty(e,"LottiePlayer",{enumerable:!0,get:function(){return o.default}}),e.default=function(e){var t,n,o,i=e.style,a=e.interactivity,s=d(l(e,h),i),u=s.View,c=s.play,f=s.stop,m=s.pause,y=s.setSpeed,g=s.goToAndStop,v=s.goToAndPlay,b=s.setDirection,w=s.playSegments,x=s.setSubframe,S=s.getDuration,P=s.destroy,E=s.animationContainerRef,A=s.animationLoaded,R=s.animationItem;return r.useEffect(function(){e.lottieRef&&(e.lottieRef.current={play:c,stop:f,pause:m,setSpeed:y,goToAndPlay:v,goToAndStop:g,setDirection:b,playSegments:w,setSubframe:x,getDuration:S,destroy:P,animationContainerRef:E,animationLoaded:A,animationItem:R})},[null===(t=e.lottieRef)||void 0===t?void 0:t.current]),p({lottieObj:{View:u,play:c,stop:f,pause:m,setSpeed:y,goToAndStop:g,goToAndPlay:v,setDirection:b,playSegments:w,setSubframe:x,getDuration:S,destroy:P,animationContainerRef:E,animationLoaded:A,animationItem:R},actions:null!==(n=null==a?void 0:a.actions)&&void 0!==n?n:[],mode:null!==(o=null==a?void 0:a.mode)&&void 0!==o?o:"scroll"})},e.useLottie=d,e.useLottieInteractivity=p,Object.defineProperty(e,"__esModule",{value:!0})}(t,r(71451),r(2265))},78030:function(e,t,r){"use strict";r.d(t,{Z:function(){return l}});var n=r(2265);/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let o=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),i=function(){for(var e=arguments.length,t=Array(e),r=0;r!!e&&r.indexOf(e)===t).join(" ")};/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var a={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"};/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let s=(0,n.forwardRef)((e,t)=>{let{color:r="currentColor",size:o=24,strokeWidth:s=2,absoluteStrokeWidth:l,className:u="",children:c,iconNode:d,...f}=e;return(0,n.createElement)("svg",{ref:t,...a,width:o,height:o,stroke:r,strokeWidth:l?24*Number(s)/Number(o):s,className:i("lucide",u),...f},[...d.map(e=>{let[t,r]=e;return(0,n.createElement)(t,r)}),...Array.isArray(c)?c:[c]])}),l=(e,t)=>{let r=(0,n.forwardRef)((r,a)=>{let{className:l,...u}=r;return(0,n.createElement)(s,{ref:a,iconNode:t,className:i("lucide-".concat(o(e)),l),...u})});return r.displayName="".concat(e),r}},95137:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},22468:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},87592:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])},40472:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("CirclePlay",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]])},28165:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])},40933:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},22584:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("CloudUpload",[["path",{d:"M12 13v8",key:"1l5pq0"}],["path",{d:"M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242",key:"1pljnt"}],["path",{d:"m8 17 4-4 4 4",key:"1quai1"}]])},51077:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]])},71322:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]])},3274:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])},89896:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]])},92699:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]])},14504:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]])},24841:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]])},18422:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])},38401:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]])},98094:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]])},38296:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]])},52022:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]])},74697:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});/** * @license lucide-react v0.424.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */let n=(0,r(78030).Z)("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])},66648:function(e,t,r){"use strict";r.d(t,{default:function(){return o.a}});var n=r(55601),o=r.n(n)},87138:function(e,t,r){"use strict";r.d(t,{default:function(){return o.a}});var n=r(231),o=r.n(n)},844:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addLocale",{enumerable:!0,get:function(){return n}}),r(18157);let n=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{}).then(()=>{if(e.parentElement&&e.isConnected){if("empty"!==t&&o(!0),null==r?void 0:r.current){let t=new Event("load");Object.defineProperty(t,"target",{writable:!1,value:e});let n=!1,o=!1;r.current({...t,nativeEvent:t,currentTarget:e,target:e,isDefaultPrevented:()=>n,isPropagationStopped:()=>o,persist:()=>{},preventDefault:()=>{n=!0,t.preventDefault()},stopPropagation:()=>{o=!0,t.stopPropagation()}})}(null==n?void 0:n.current)&&n.current(e)}}))}function y(e){return a.use?{fetchPriority:e}:{fetchpriority:e}}"undefined"==typeof window&&(globalThis.__NEXT_IMAGE_IMPORTED=!0);let g=(0,a.forwardRef)((e,t)=>{let{src:r,srcSet:n,sizes:o,height:s,width:l,decoding:u,className:c,style:d,fetchPriority:f,placeholder:p,loading:h,unoptimized:g,fill:v,onLoadRef:b,onLoadingCompleteRef:w,setBlurComplete:x,setShowAltText:S,sizesInput:P,onLoad:E,onError:A,...R}=e;return(0,i.jsx)("img",{...R,...y(f),loading:h,width:l,height:s,decoding:u,"data-nimg":v?"fill":"1",className:c,style:d,sizes:o,srcSet:n,src:r,ref:(0,a.useCallback)(e=>{t&&("function"==typeof t?t(e):"object"==typeof t&&(t.current=e)),e&&(A&&(e.src=e.src),e.complete&&m(e,p,b,w,x,g,P))},[r,p,b,w,x,A,g,P,t]),onLoad:e=>{m(e.currentTarget,p,b,w,x,g,P)},onError:e=>{S(!0),"empty"!==p&&x(!0),A&&A(e)}})});function v(e){let{isAppRouter:t,imgAttributes:r}=e,n={as:"image",imageSrcSet:r.srcSet,imageSizes:r.sizes,crossOrigin:r.crossOrigin,referrerPolicy:r.referrerPolicy,...y(r.fetchPriority)};return t&&s.default.preload?(s.default.preload(r.src,n),null):(0,i.jsx)(l.default,{children:(0,i.jsx)("link",{rel:"preload",href:r.srcSet?void 0:r.src,...n},"__nimg-"+r.src+r.srcSet+r.sizes)})}let b=(0,a.forwardRef)((e,t)=>{let r=(0,a.useContext)(f.RouterContext),n=(0,a.useContext)(d.ImageConfigContext),o=(0,a.useMemo)(()=>{let e=h||n||c.imageConfigDefault,t=[...e.deviceSizes,...e.imageSizes].sort((e,t)=>e-t),r=e.deviceSizes.sort((e,t)=>e-t);return{...e,allSizes:t,deviceSizes:r}},[n]),{onLoad:s,onLoadingComplete:l}=e,m=(0,a.useRef)(s);(0,a.useEffect)(()=>{m.current=s},[s]);let y=(0,a.useRef)(l);(0,a.useEffect)(()=>{y.current=l},[l]);let[b,w]=(0,a.useState)(!1),[x,S]=(0,a.useState)(!1),{props:P,meta:E}=(0,u.getImgProps)(e,{defaultLoader:p.default,imgConf:o,blurComplete:b,showAltText:x});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(g,{...P,unoptimized:E.unoptimized,placeholder:E.placeholder,fill:E.fill,onLoadRef:m,onLoadingCompleteRef:y,setBlurComplete:w,setShowAltText:S,sizesInput:e.sizes,ref:t}),E.priority?(0,i.jsx)(v,{isAppRouter:!r,imgAttributes:P}):null]})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},231:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return w}});let n=r(99920),o=r(57437),i=n._(r(2265)),a=r(98016),s=r(18029),l=r(41142),u=r(43461),c=r(844),d=r(60291),f=r(44467),p=r(53106),h=r(25944),m=r(4897),y=r(51507),g=new Set;function v(e,t,r,n,o,i){if("undefined"!=typeof window&&(i||(0,s.isLocalURL)(t))){if(!n.bypassPrefetchedCheck){let o=t+"%"+r+"%"+(void 0!==n.locale?n.locale:"locale"in e?e.locale:void 0);if(g.has(o))return;g.add(o)}(async()=>i?e.prefetch(t,o):e.prefetch(t,r,n))().catch(e=>{})}}function b(e){return"string"==typeof e?e:(0,l.formatUrl)(e)}let w=i.default.forwardRef(function(e,t){let r,n;let{href:l,as:g,children:w,prefetch:x=null,passHref:S,replace:P,shallow:E,scroll:A,locale:R,onClick:j,onMouseEnter:C,onTouchStart:O,legacyBehavior:T=!1,...M}=e;r=w,T&&("string"==typeof r||"number"==typeof r)&&(r=(0,o.jsx)("a",{children:r}));let k=i.default.useContext(d.RouterContext),D=i.default.useContext(f.AppRouterContext),N=null!=k?k:D,L=!k,I=!1!==x,F=null===x?y.PrefetchKind.AUTO:y.PrefetchKind.FULL,{href:_,as:V}=i.default.useMemo(()=>{if(!k){let e=b(l);return{href:e,as:g?b(g):e}}let[e,t]=(0,a.resolveHref)(k,l,!0);return{href:e,as:g?(0,a.resolveHref)(k,g):t||e}},[k,l,g]),z=i.default.useRef(_),B=i.default.useRef(V);T&&(n=i.default.Children.only(r));let W=T?n&&"object"==typeof n&&n.ref:t,[U,$,H]=(0,p.useIntersection)({rootMargin:"200px"}),K=i.default.useCallback(e=>{(B.current!==V||z.current!==_)&&(H(),B.current=V,z.current=_),U(e),W&&("function"==typeof W?W(e):"object"==typeof W&&(W.current=e))},[V,W,_,H,U]);i.default.useEffect(()=>{N&&$&&I&&v(N,_,V,{locale:R},{kind:F},L)},[V,_,$,R,I,null==k?void 0:k.locale,N,L,F]);let q={ref:K,onClick(e){T||"function"!=typeof j||j(e),T&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),N&&!e.defaultPrevented&&function(e,t,r,n,o,a,l,u,c){let{nodeName:d}=e.currentTarget;if("A"===d.toUpperCase()&&(function(e){let t=e.currentTarget.getAttribute("target");return t&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!c&&!(0,s.isLocalURL)(r)))return;e.preventDefault();let f=()=>{let e=null==l||l;"beforePopState"in t?t[o?"replace":"push"](r,n,{shallow:a,locale:u,scroll:e}):t[o?"replace":"push"](n||r,{scroll:e})};c?i.default.startTransition(f):f()}(e,N,_,V,P,E,A,R,L)},onMouseEnter(e){T||"function"!=typeof C||C(e),T&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),N&&(I||!L)&&v(N,_,V,{locale:R,priority:!0,bypassPrefetchedCheck:!0},{kind:F},L)},onTouchStart:function(e){T||"function"!=typeof O||O(e),T&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),N&&(I||!L)&&v(N,_,V,{locale:R,priority:!0,bypassPrefetchedCheck:!0},{kind:F},L)}};if((0,u.isAbsoluteUrl)(V))q.href=V;else if(!T||S||"a"===n.type&&!("href"in n.props)){let e=void 0!==R?R:null==k?void 0:k.locale,t=(null==k?void 0:k.isLocaleDomain)&&(0,h.getDomainLocale)(V,e,null==k?void 0:k.locales,null==k?void 0:k.domainLocales);q.href=t||(0,m.addBasePath)((0,c.addLocale)(V,e,null==k?void 0:k.defaultLocale))}return T?i.default.cloneElement(n,q):(0,o.jsx)("a",{...M,...q,children:r})});("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49189:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{cancelIdleCallback:function(){return n},requestIdleCallback:function(){return r}});let r="undefined"!=typeof self&&self.requestIdleCallback&&self.requestIdleCallback.bind(window)||function(e){let t=Date.now();return self.setTimeout(function(){e({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-t))}})},1)},n="undefined"!=typeof self&&self.cancelIdleCallback&&self.cancelIdleCallback.bind(window)||function(e){return clearTimeout(e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98016:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"resolveHref",{enumerable:!0,get:function(){return d}});let n=r(18323),o=r(41142),i=r(45519),a=r(43461),s=r(18157),l=r(18029),u=r(59195),c=r(80020);function d(e,t,r){let d;let f="string"==typeof t?t:(0,o.formatWithValidation)(t),p=f.match(/^[a-zA-Z]{1,}:\/\//),h=p?f.slice(p[0].length):f;if((h.split("?",1)[0]||"").match(/(\/\/|\\)/)){console.error("Invalid href '"+f+"' passed to next/router in page: '"+e.pathname+"'. Repeated forward-slashes (//) or backslashes \\ are not valid in the href.");let t=(0,a.normalizeRepeatedSlashes)(h);f=(p?p[0]:"")+t}if(!(0,l.isLocalURL)(f))return r?[f]:f;try{d=new URL(f.startsWith("#")?e.asPath:e.pathname,"http://n")}catch(e){d=new URL("/","http://n")}try{let e=new URL(f,d);e.pathname=(0,s.normalizePathTrailingSlash)(e.pathname);let t="";if((0,u.isDynamicRoute)(e.pathname)&&e.searchParams&&r){let r=(0,n.searchParamsToUrlQuery)(e.searchParams),{result:a,params:s}=(0,c.interpolateAs)(e.pathname,e.pathname,r);a&&(t=(0,o.formatWithValidation)({pathname:a,hash:e.hash,query:(0,i.omit)(r,s)}))}let a=e.origin===d.origin?e.href.slice(e.origin.length):e.href;return r?[a,t||a]:a}catch(e){return r?[f]:f}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53106:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"useIntersection",{enumerable:!0,get:function(){return l}});let n=r(2265),o=r(49189),i="function"==typeof IntersectionObserver,a=new Map,s=[];function l(e){let{rootRef:t,rootMargin:r,disabled:l}=e,u=l||!i,[c,d]=(0,n.useState)(!1),f=(0,n.useRef)(null),p=(0,n.useCallback)(e=>{f.current=e},[]);return(0,n.useEffect)(()=>{if(i){if(u||c)return;let e=f.current;if(e&&e.tagName)return function(e,t,r){let{id:n,observer:o,elements:i}=function(e){let t;let r={root:e.root||null,margin:e.rootMargin||""},n=s.find(e=>e.root===r.root&&e.margin===r.margin);if(n&&(t=a.get(n)))return t;let o=new Map;return t={id:r,observer:new IntersectionObserver(e=>{e.forEach(e=>{let t=o.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)})},e),elements:o},s.push(r),a.set(r,t),t}(r);return i.set(e,t),o.observe(e),function(){if(i.delete(e),o.unobserve(e),0===i.size){o.disconnect(),a.delete(n);let e=s.findIndex(e=>e.root===n.root&&e.margin===n.margin);e>-1&&s.splice(e,1)}}}(e,e=>e&&d(e),{root:null==t?void 0:t.current,rootMargin:r})}else if(!c){let e=(0,o.requestIdleCallback)(()=>d(!0));return()=>(0,o.cancelIdleCallback)(e)}},[u,r,t,c,f.current]),[p,c,(0,n.useCallback)(()=>{d(!1)},[])]}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},82901:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"AmpStateContext",{enumerable:!0,get:function(){return n}});let n=r(99920)._(r(2265)).default.createContext({})},40687:function(e,t){"use strict";function r(e){let{ampFirst:t=!1,hybrid:r=!1,hasQuery:n=!1}=void 0===e?{}:e;return t||r&&n}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isInAmpMode",{enumerable:!0,get:function(){return r}})},81943:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"escapeStringRegexp",{enumerable:!0,get:function(){return o}});let r=/[|\\{}()[\]^$+*?.-]/,n=/[|\\{}()[\]^$+*?.-]/g;function o(e){return r.test(e)?e.replace(n,"\\$&"):e}},80497:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImgProps",{enumerable:!0,get:function(){return s}}),r(72301);let n=r(51564),o=r(7103);function i(e){return void 0!==e.default}function a(e){return void 0===e?e:"number"==typeof e?Number.isFinite(e)?e:NaN:"string"==typeof e&&/^[0-9]+$/.test(e)?parseInt(e,10):NaN}function s(e,t){var r;let s,l,u,{src:c,sizes:d,unoptimized:f=!1,priority:p=!1,loading:h,className:m,quality:y,width:g,height:v,fill:b=!1,style:w,overrideSrc:x,onLoad:S,onLoadingComplete:P,placeholder:E="empty",blurDataURL:A,fetchPriority:R,layout:j,objectFit:C,objectPosition:O,lazyBoundary:T,lazyRoot:M,...k}=e,{imgConf:D,showAltText:N,blurComplete:L,defaultLoader:I}=t,F=D||o.imageConfigDefault;if("allSizes"in F)s=F;else{let e=[...F.deviceSizes,...F.imageSizes].sort((e,t)=>e-t),t=F.deviceSizes.sort((e,t)=>e-t);s={...F,allSizes:e,deviceSizes:t}}if(void 0===I)throw Error("images.loaderFile detected but the file is missing default export.\nRead more: https://nextjs.org/docs/messages/invalid-images-config");let _=k.loader||I;delete k.loader,delete k.srcSet;let V="__next_img_default"in _;if(V){if("custom"===s.loader)throw Error('Image with src "'+c+'" is missing "loader" prop.\nRead more: https://nextjs.org/docs/messages/next-image-missing-loader')}else{let e=_;_=t=>{let{config:r,...n}=t;return e(n)}}if(j){"fill"===j&&(b=!0);let e={intrinsic:{maxWidth:"100%",height:"auto"},responsive:{width:"100%",height:"auto"}}[j];e&&(w={...w,...e});let t={responsive:"100vw",fill:"100vw"}[j];t&&!d&&(d=t)}let z="",B=a(g),W=a(v);if("object"==typeof(r=c)&&(i(r)||void 0!==r.src)){let e=i(c)?c.default:c;if(!e.src)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include src. Received "+JSON.stringify(e));if(!e.height||!e.width)throw Error("An object should only be passed to the image component src parameter if it comes from a static image import. It must include height and width. Received "+JSON.stringify(e));if(l=e.blurWidth,u=e.blurHeight,A=A||e.blurDataURL,z=e.src,!b){if(B||W){if(B&&!W){let t=B/e.width;W=Math.round(e.height*t)}else if(!B&&W){let t=W/e.height;B=Math.round(e.width*t)}}else B=e.width,W=e.height}}let U=!p&&("lazy"===h||void 0===h);(!(c="string"==typeof c?c:z)||c.startsWith("data:")||c.startsWith("blob:"))&&(f=!0,U=!1),s.unoptimized&&(f=!0),V&&c.endsWith(".svg")&&!s.dangerouslyAllowSVG&&(f=!0),p&&(R="high");let $=a(y),H=Object.assign(b?{position:"absolute",height:"100%",width:"100%",left:0,top:0,right:0,bottom:0,objectFit:C,objectPosition:O}:{},N?{}:{color:"transparent"},w),K=L||"empty"===E?null:"blur"===E?'url("data:image/svg+xml;charset=utf-8,'+(0,n.getImageBlurSvg)({widthInt:B,heightInt:W,blurWidth:l,blurHeight:u,blurDataURL:A||"",objectFit:H.objectFit})+'")':'url("'+E+'")',q=K?{backgroundSize:H.objectFit||"cover",backgroundPosition:H.objectPosition||"50% 50%",backgroundRepeat:"no-repeat",backgroundImage:K}:{},G=function(e){let{config:t,src:r,unoptimized:n,width:o,quality:i,sizes:a,loader:s}=e;if(n)return{src:r,srcSet:void 0,sizes:void 0};let{widths:l,kind:u}=function(e,t,r){let{deviceSizes:n,allSizes:o}=e;if(r){let e=/(^|\s)(1?\d?\d)vw/g,t=[];for(let n;n=e.exec(r);n)t.push(parseInt(n[2]));if(t.length){let e=.01*Math.min(...t);return{widths:o.filter(t=>t>=n[0]*e),kind:"w"}}return{widths:o,kind:"w"}}return"number"!=typeof t?{widths:n,kind:"w"}:{widths:[...new Set([t,2*t].map(e=>o.find(t=>t>=e)||o[o.length-1]))],kind:"x"}}(t,o,a),c=l.length-1;return{sizes:a||"w"!==u?a:"100vw",srcSet:l.map((e,n)=>s({config:t,src:r,quality:i,width:e})+" "+("w"===u?e:n+1)+u).join(", "),src:s({config:t,src:r,quality:i,width:l[c]})}}({config:s,src:c,unoptimized:f,width:B,quality:$,sizes:d,loader:_});return{props:{...k,loading:U?"lazy":h,fetchPriority:R,width:B,height:W,decoding:"async",className:m,style:{...H,...q},sizes:G.sizes,srcSet:G.srcSet,src:x||G.src},meta:{unoptimized:f,priority:p,placeholder:E,fill:b}}}},28321:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return m},defaultHead:function(){return d}});let n=r(99920),o=r(41452),i=r(57437),a=o._(r(2265)),s=n._(r(65960)),l=r(82901),u=r(36590),c=r(40687);function d(e){void 0===e&&(e=!1);let t=[(0,i.jsx)("meta",{charSet:"utf-8"})];return e||t.push((0,i.jsx)("meta",{name:"viewport",content:"width=device-width"})),t}function f(e,t){return"string"==typeof t||"number"==typeof t?e:t.type===a.default.Fragment?e.concat(a.default.Children.toArray(t.props.children).reduce((e,t)=>"string"==typeof t||"number"==typeof t?e:e.concat(t),[])):e.concat(t)}r(72301);let p=["name","httpEquiv","charSet","itemProp"];function h(e,t){let{inAmpMode:r}=t;return e.reduce(f,[]).reverse().concat(d(r).reverse()).filter(function(){let e=new Set,t=new Set,r=new Set,n={};return o=>{let i=!0,a=!1;if(o.key&&"number"!=typeof o.key&&o.key.indexOf("$")>0){a=!0;let t=o.key.slice(o.key.indexOf("$")+1);e.has(t)?i=!1:e.add(t)}switch(o.type){case"title":case"base":t.has(o.type)?i=!1:t.add(o.type);break;case"meta":for(let e=0,t=p.length;e{let n=e.key||t;if(!r&&"link"===e.type&&e.props.href&&["https://fonts.googleapis.com/css","https://use.typekit.net/"].some(t=>e.props.href.startsWith(t))){let t={...e.props||{}};return t["data-href"]=t.href,t.href=void 0,t["data-optimized-fonts"]=!0,a.default.cloneElement(e,t)}return a.default.cloneElement(e,{key:n})})}let m=function(e){let{children:t}=e,r=(0,a.useContext)(l.AmpStateContext),n=(0,a.useContext)(u.HeadManagerContext);return(0,i.jsx)(s.default,{reduceComponentsToState:h,headManager:n,inAmpMode:(0,c.isInAmpMode)(r),children:t})};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51564:function(e,t){"use strict";function r(e){let{widthInt:t,heightInt:r,blurWidth:n,blurHeight:o,blurDataURL:i,objectFit:a}=e,s=n?40*n:t,l=o?40*o:r,u=s&&l?"viewBox='0 0 "+s+" "+l+"'":"";return"%3Csvg xmlns='http://www.w3.org/2000/svg' "+u+"%3E%3Cfilter id='b' color-interpolation-filters='sRGB'%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3CfeColorMatrix values='1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 100 -1' result='s'/%3E%3CfeFlood x='0' y='0' width='100%25' height='100%25'/%3E%3CfeComposite operator='out' in='s'/%3E%3CfeComposite in2='SourceGraphic'/%3E%3CfeGaussianBlur stdDeviation='20'/%3E%3C/filter%3E%3Cimage width='100%25' height='100%25' x='0' y='0' preserveAspectRatio='"+(u?"none":"contain"===a?"xMidYMid":"cover"===a?"xMidYMid slice":"none")+"' style='filter: url(%23b);' href='"+i+"'/%3E%3C/svg%3E"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getImageBlurSvg",{enumerable:!0,get:function(){return r}})},93938:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ImageConfigContext",{enumerable:!0,get:function(){return i}});let n=r(99920)._(r(2265)),o=r(7103),i=n.default.createContext(o.imageConfigDefault)},7103:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{VALID_LOADERS:function(){return r},imageConfigDefault:function(){return n}});let r=["default","imgix","cloudinary","akamai","custom"],n={deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",loaderFile:"",domains:[],disableStaticImages:!1,minimumCacheTTL:60,formats:["image/webp"],dangerouslyAllowSVG:!1,contentSecurityPolicy:"script-src 'none'; frame-src 'none'; sandbox;",contentDispositionType:"inline",remotePatterns:[],unoptimized:!1}},55601:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{default:function(){return l},getImageProps:function(){return s}});let n=r(99920),o=r(80497),i=r(38173),a=n._(r(21241));function s(e){let{props:t}=(0,o.getImgProps)(e,{defaultLoader:a.default,imgConf:{deviceSizes:[640,750,828,1080,1200,1920,2048,3840],imageSizes:[16,32,48,64,96,128,256,384],path:"/_next/image",loader:"default",dangerouslyAllowSVG:!1,unoptimized:!1}});for(let[e,r]of Object.entries(t))void 0===r&&delete t[e];return{props:t}}let l=i.Image},21241:function(e,t){"use strict";function r(e){let{config:t,src:r,width:n,quality:o}=e;return t.path+"?url="+encodeURIComponent(r)+"&w="+n+"&q="+(o||75)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return n}}),r.__next_img_default=!0;let n=r},60291:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RouterContext",{enumerable:!0,get:function(){return n}});let n=r(99920)._(r(2265)).default.createContext(null)},41142:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{formatUrl:function(){return i},formatWithValidation:function(){return s},urlObjectKeys:function(){return a}});let n=r(41452)._(r(18323)),o=/https?|ftp|gopher|file/;function i(e){let{auth:t,hostname:r}=e,i=e.protocol||"",a=e.pathname||"",s=e.hash||"",l=e.query||"",u=!1;t=t?encodeURIComponent(t).replace(/%3A/i,":")+"@":"",e.host?u=t+e.host:r&&(u=t+(~r.indexOf(":")?"["+r+"]":r),e.port&&(u+=":"+e.port)),l&&"object"==typeof l&&(l=String(n.urlQueryToSearchParams(l)));let c=e.search||l&&"?"+l||"";return i&&!i.endsWith(":")&&(i+=":"),e.slashes||(!i||o.test(i))&&!1!==u?(u="//"+(u||""),a&&"/"!==a[0]&&(a="/"+a)):u||(u=""),s&&"#"!==s[0]&&(s="#"+s),c&&"?"!==c[0]&&(c="?"+c),""+i+u+(a=a.replace(/[?#]/g,encodeURIComponent))+(c=c.replace("#","%23"))+s}let a=["auth","hash","host","hostname","href","path","pathname","port","protocol","query","search","slashes"];function s(e){return i(e)}},59195:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getSortedRoutes:function(){return n.getSortedRoutes},isDynamicRoute:function(){return o.isDynamicRoute}});let n=r(49089),o=r(28083)},80020:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"interpolateAs",{enumerable:!0,get:function(){return i}});let n=r(41533),o=r(63169);function i(e,t,r){let i="",a=(0,o.getRouteRegex)(e),s=a.groups,l=(t!==e?(0,n.getRouteMatcher)(a)(t):"")||r;i=e;let u=Object.keys(s);return u.every(e=>{let t=l[e]||"",{repeat:r,optional:n}=s[e],o="["+(r?"...":"")+e+"]";return n&&(o=(t?"":"/")+"["+o+"]"),r&&!Array.isArray(t)&&(t=[t]),(n||e in l)&&(i=i.replace(o,r?t.map(e=>encodeURIComponent(e)).join("/"):encodeURIComponent(t))||"/")})||(i=""),{params:u,result:i}}},28083:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isDynamicRoute",{enumerable:!0,get:function(){return i}});let n=r(82269),o=/\/\[[^/]+?\](?=\/|$)/;function i(e){return(0,n.isInterceptionRouteAppPath)(e)&&(e=(0,n.extractInterceptionRouteInformation)(e).interceptedRoute),o.test(e)}},18029:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isLocalURL",{enumerable:!0,get:function(){return i}});let n=r(43461),o=r(49404);function i(e){if(!(0,n.isAbsoluteUrl)(e))return!0;try{let t=(0,n.getLocationOrigin)(),r=new URL(e,t);return r.origin===t&&(0,o.hasBasePath)(r.pathname)}catch(e){return!1}}},45519:function(e,t){"use strict";function r(e,t){let r={};return Object.keys(e).forEach(n=>{t.includes(n)||(r[n]=e[n])}),r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"omit",{enumerable:!0,get:function(){return r}})},18323:function(e,t){"use strict";function r(e){let t={};return e.forEach((e,r)=>{void 0===t[r]?t[r]=e:Array.isArray(t[r])?t[r].push(e):t[r]=[t[r],e]}),t}function n(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}function o(e){let t=new URLSearchParams;return Object.entries(e).forEach(e=>{let[r,o]=e;Array.isArray(o)?o.forEach(e=>t.append(r,n(e))):t.set(r,n(o))}),t}function i(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n{Array.from(t.keys()).forEach(t=>e.delete(t)),t.forEach((t,r)=>e.append(r,t))}),e}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{assign:function(){return i},searchParamsToUrlQuery:function(){return r},urlQueryToSearchParams:function(){return o}})},41533:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getRouteMatcher",{enumerable:!0,get:function(){return o}});let n=r(43461);function o(e){let{re:t,groups:r}=e;return e=>{let o=t.exec(e);if(!o)return!1;let i=e=>{try{return decodeURIComponent(e)}catch(e){throw new n.DecodeError("failed to decode param")}},a={};return Object.keys(r).forEach(e=>{let t=r[e],n=o[t.pos];void 0!==n&&(a[e]=~n.indexOf("/")?n.split("/").map(e=>i(e)):t.repeat?[i(n)]:i(n))}),a}}},63169:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{getNamedMiddlewareRegex:function(){return f},getNamedRouteRegex:function(){return d},getRouteRegex:function(){return l}});let n=r(82269),o=r(81943),i=r(67741);function a(e){let t=e.startsWith("[")&&e.endsWith("]");t&&(e=e.slice(1,-1));let r=e.startsWith("...");return r&&(e=e.slice(3)),{key:e,repeat:r,optional:t}}function s(e){let t=(0,i.removeTrailingSlash)(e).slice(1).split("/"),r={},s=1;return{parameterizedRoute:t.map(e=>{let t=n.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(t&&i){let{key:e,optional:n,repeat:l}=a(i[1]);return r[e]={pos:s++,repeat:l,optional:n},"/"+(0,o.escapeStringRegexp)(t)+"([^/]+?)"}if(!i)return"/"+(0,o.escapeStringRegexp)(e);{let{key:e,repeat:t,optional:n}=a(i[1]);return r[e]={pos:s++,repeat:t,optional:n},t?n?"(?:/(.+?))?":"/(.+?)":"/([^/]+?)"}}).join(""),groups:r}}function l(e){let{parameterizedRoute:t,groups:r}=s(e);return{re:RegExp("^"+t+"(?:/)?$"),groups:r}}function u(e){let{interceptionMarker:t,getSafeRouteKey:r,segment:n,routeKeys:i,keyPrefix:s}=e,{key:l,optional:u,repeat:c}=a(n),d=l.replace(/\W/g,"");s&&(d=""+s+d);let f=!1;(0===d.length||d.length>30)&&(f=!0),isNaN(parseInt(d.slice(0,1)))||(f=!0),f&&(d=r()),s?i[d]=""+s+l:i[d]=l;let p=t?(0,o.escapeStringRegexp)(t):"";return c?u?"(?:/"+p+"(?<"+d+">.+?))?":"/"+p+"(?<"+d+">.+?)":"/"+p+"(?<"+d+">[^/]+?)"}function c(e,t){let r;let a=(0,i.removeTrailingSlash)(e).slice(1).split("/"),s=(r=0,()=>{let e="",t=++r;for(;t>0;)e+=String.fromCharCode(97+(t-1)%26),t=Math.floor((t-1)/26);return e}),l={};return{namedParameterizedRoute:a.map(e=>{let r=n.INTERCEPTION_ROUTE_MARKERS.some(t=>e.startsWith(t)),i=e.match(/\[((?:\[.*\])|.+)\]/);if(r&&i){let[r]=e.split(i[0]);return u({getSafeRouteKey:s,interceptionMarker:r,segment:i[1],routeKeys:l,keyPrefix:t?"nxtI":void 0})}return i?u({getSafeRouteKey:s,segment:i[1],routeKeys:l,keyPrefix:t?"nxtP":void 0}):"/"+(0,o.escapeStringRegexp)(e)}).join(""),routeKeys:l}}function d(e,t){let r=c(e,t);return{...l(e),namedRegex:"^"+r.namedParameterizedRoute+"(?:/)?$",routeKeys:r.routeKeys}}function f(e,t){let{parameterizedRoute:r}=s(e),{catchAll:n=!0}=t;if("/"===r)return{namedRegex:"^/"+(n?".*":"")+"$"};let{namedParameterizedRoute:o}=c(e,!1);return{namedRegex:"^"+o+(n?"(?:(/.*)?)":"")+"$"}}},49089:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSortedRoutes",{enumerable:!0,get:function(){return n}});class r{insert(e){this._insert(e.split("/").filter(Boolean),[],!1)}smoosh(){return this._smoosh()}_smoosh(e){void 0===e&&(e="/");let t=[...this.children.keys()].sort();null!==this.slugName&&t.splice(t.indexOf("[]"),1),null!==this.restSlugName&&t.splice(t.indexOf("[...]"),1),null!==this.optionalRestSlugName&&t.splice(t.indexOf("[[...]]"),1);let r=t.map(t=>this.children.get(t)._smoosh(""+e+t+"/")).reduce((e,t)=>[...e,...t],[]);if(null!==this.slugName&&r.push(...this.children.get("[]")._smoosh(e+"["+this.slugName+"]/")),!this.placeholder){let t="/"===e?"/":e.slice(0,-1);if(null!=this.optionalRestSlugName)throw Error('You cannot define a route with the same specificity as a optional catch-all route ("'+t+'" and "'+t+"[[..."+this.optionalRestSlugName+']]").');r.unshift(t)}return null!==this.restSlugName&&r.push(...this.children.get("[...]")._smoosh(e+"[..."+this.restSlugName+"]/")),null!==this.optionalRestSlugName&&r.push(...this.children.get("[[...]]")._smoosh(e+"[[..."+this.optionalRestSlugName+"]]/")),r}_insert(e,t,n){if(0===e.length){this.placeholder=!1;return}if(n)throw Error("Catch-all must be the last part of the URL.");let o=e[0];if(o.startsWith("[")&&o.endsWith("]")){let r=o.slice(1,-1),a=!1;if(r.startsWith("[")&&r.endsWith("]")&&(r=r.slice(1,-1),a=!0),r.startsWith("...")&&(r=r.substring(3),n=!0),r.startsWith("[")||r.endsWith("]"))throw Error("Segment names may not start or end with extra brackets ('"+r+"').");if(r.startsWith("."))throw Error("Segment names may not start with erroneous periods ('"+r+"').");function i(e,r){if(null!==e&&e!==r)throw Error("You cannot use different slug names for the same dynamic path ('"+e+"' !== '"+r+"').");t.forEach(e=>{if(e===r)throw Error('You cannot have the same slug name "'+r+'" repeat within a single dynamic path');if(e.replace(/\W/g,"")===o.replace(/\W/g,""))throw Error('You cannot have the slug names "'+e+'" and "'+r+'" differ only by non-word symbols within a single dynamic path')}),t.push(r)}if(n){if(a){if(null!=this.restSlugName)throw Error('You cannot use both an required and optional catch-all route at the same level ("[...'+this.restSlugName+']" and "'+e[0]+'" ).');i(this.optionalRestSlugName,r),this.optionalRestSlugName=r,o="[[...]]"}else{if(null!=this.optionalRestSlugName)throw Error('You cannot use both an optional and required catch-all route at the same level ("[[...'+this.optionalRestSlugName+']]" and "'+e[0]+'").');i(this.restSlugName,r),this.restSlugName=r,o="[...]"}}else{if(a)throw Error('Optional route parameters are not yet supported ("'+e[0]+'").');i(this.slugName,r),this.slugName=r,o="[]"}}this.children.has(o)||this.children.set(o,new r),this.children.get(o)._insert(e.slice(1),t,n)}constructor(){this.placeholder=!0,this.children=new Map,this.slugName=null,this.restSlugName=null,this.optionalRestSlugName=null}}function n(e){let t=new r;return e.forEach(e=>t.insert(e)),t.smoosh()}},65960:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}});let n=r(2265),o="undefined"==typeof window,i=o?()=>{}:n.useLayoutEffect,a=o?()=>{}:n.useEffect;function s(e){let{headManager:t,reduceComponentsToState:r}=e;function s(){if(t&&t.mountedInstances){let o=n.Children.toArray(Array.from(t.mountedInstances).filter(Boolean));t.updateHead(r(o,e))}}if(o){var l;null==t||null==(l=t.mountedInstances)||l.add(e.children),s()}return i(()=>{var r;return null==t||null==(r=t.mountedInstances)||r.add(e.children),()=>{var r;null==t||null==(r=t.mountedInstances)||r.delete(e.children)}}),i(()=>(t&&(t._pendingUpdate=s),()=>{t&&(t._pendingUpdate=s)})),a(()=>(t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null),()=>{t&&t._pendingUpdate&&(t._pendingUpdate(),t._pendingUpdate=null)})),null}},43461:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var r in t)Object.defineProperty(e,r,{enumerable:!0,get:t[r]})}(t,{DecodeError:function(){return h},MiddlewareNotFoundError:function(){return v},MissingStaticPage:function(){return g},NormalizeError:function(){return m},PageNotFoundError:function(){return y},SP:function(){return f},ST:function(){return p},WEB_VITALS:function(){return r},execOnce:function(){return n},getDisplayName:function(){return l},getLocationOrigin:function(){return a},getURL:function(){return s},isAbsoluteUrl:function(){return i},isResSent:function(){return u},loadGetInitialProps:function(){return d},normalizeRepeatedSlashes:function(){return c},stringifyError:function(){return b}});let r=["CLS","FCP","FID","INP","LCP","TTFB"];function n(e){let t,r=!1;return function(){for(var n=arguments.length,o=Array(n),i=0;io.test(e);function a(){let{protocol:e,hostname:t,port:r}=window.location;return e+"//"+t+(r?":"+r:"")}function s(){let{href:e}=window.location,t=a();return e.substring(t.length)}function l(e){return"string"==typeof e?e:e.displayName||e.name||"Unknown"}function u(e){return e.finished||e.headersSent}function c(e){let t=e.split("?");return t[0].replace(/\\/g,"/").replace(/\/\/+/g,"/")+(t[1]?"?"+t.slice(1).join("?"):"")}async function d(e,t){let r=t.res||t.ctx&&t.ctx.res;if(!e.getInitialProps)return t.ctx&&t.Component?{pageProps:await d(t.Component,t.ctx)}:{};let n=await e.getInitialProps(t);if(r&&u(r))return n;if(!n)throw Error('"'+l(e)+'.getInitialProps()" should resolve to an object. But found "'+n+'" instead.');return n}let f="undefined"!=typeof performance,p=f&&["mark","measure","getEntriesByName"].every(e=>"function"==typeof performance[e]);class h extends Error{}class m extends Error{}class y extends Error{constructor(e){super(),this.code="ENOENT",this.name="PageNotFoundError",this.message="Cannot find module for page: "+e}}class g extends Error{constructor(e,t){super(),this.message="Failed to load static file for page: "+e+" "+t}}class v extends Error{constructor(){super(),this.code="ENOENT",this.message="Cannot find the middleware module"}}function b(e){return JSON.stringify({message:e.message,stack:e.stack})}},56919:function(e,t,r){var n="function"==typeof Map&&Map.prototype,o=Object.getOwnPropertyDescriptor&&n?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,i=n&&o&&"function"==typeof o.get?o.get:null,a=n&&Map.prototype.forEach,s="function"==typeof Set&&Set.prototype,l=Object.getOwnPropertyDescriptor&&s?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,u=s&&l&&"function"==typeof l.get?l.get:null,c=s&&Set.prototype.forEach,d="function"==typeof WeakMap&&WeakMap.prototype?WeakMap.prototype.has:null,f="function"==typeof WeakSet&&WeakSet.prototype?WeakSet.prototype.has:null,p="function"==typeof WeakRef&&WeakRef.prototype?WeakRef.prototype.deref:null,h=Boolean.prototype.valueOf,m=Object.prototype.toString,y=Function.prototype.toString,g=String.prototype.match,v=String.prototype.slice,b=String.prototype.replace,w=String.prototype.toUpperCase,x=String.prototype.toLowerCase,S=RegExp.prototype.test,P=Array.prototype.concat,E=Array.prototype.join,A=Array.prototype.slice,R=Math.floor,j="function"==typeof BigInt?BigInt.prototype.valueOf:null,C=Object.getOwnPropertySymbols,O="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?Symbol.prototype.toString:null,T="function"==typeof Symbol&&"object"==typeof Symbol.iterator,M="function"==typeof Symbol&&Symbol.toStringTag&&(typeof Symbol.toStringTag===T?"object":"symbol")?Symbol.toStringTag:null,k=Object.prototype.propertyIsEnumerable,D=("function"==typeof Reflect?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(e){return e.__proto__}:null);function N(e,t){if(e===1/0||e===-1/0||e!=e||e&&e>-1e3&&e<1e3||S.call(/e/,t))return t;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if("number"==typeof e){var n=e<0?-R(-e):R(e);if(n!==e){var o=String(n),i=v.call(t,o.length+1);return b.call(o,r,"$&_")+"."+b.call(b.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return b.call(t,r,"$&_")}var L=r(24654),I=L.custom,F=B(I)?I:null;function _(e,t,r){var n="double"===(r.quoteStyle||t)?'"':"'";return n+e+n}function V(e){return"[object Array]"===$(e)&&(!M||!("object"==typeof e&&M in e))}function z(e){return"[object RegExp]"===$(e)&&(!M||!("object"==typeof e&&M in e))}function B(e){if(T)return e&&"object"==typeof e&&e instanceof Symbol;if("symbol"==typeof e)return!0;if(!e||"object"!=typeof e||!O)return!1;try{return O.call(e),!0}catch(e){}return!1}e.exports=function e(t,n,o,s){var l=n||{};if(U(l,"quoteStyle")&&"single"!==l.quoteStyle&&"double"!==l.quoteStyle)throw TypeError('option "quoteStyle" must be "single" or "double"');if(U(l,"maxStringLength")&&("number"==typeof l.maxStringLength?l.maxStringLength<0&&l.maxStringLength!==1/0:null!==l.maxStringLength))throw TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var m=!U(l,"customInspect")||l.customInspect;if("boolean"!=typeof m&&"symbol"!==m)throw TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(U(l,"indent")&&null!==l.indent&&" "!==l.indent&&!(parseInt(l.indent,10)===l.indent&&l.indent>0))throw TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(U(l,"numericSeparator")&&"boolean"!=typeof l.numericSeparator)throw TypeError('option "numericSeparator", if provided, must be `true` or `false`');var w=l.numericSeparator;if(void 0===t)return"undefined";if(null===t)return"null";if("boolean"==typeof t)return t?"true":"false";if("string"==typeof t)return function e(t,r){if(t.length>r.maxStringLength){var n=t.length-r.maxStringLength;return e(v.call(t,0,r.maxStringLength),r)+"... "+n+" more character"+(n>1?"s":"")}return _(b.call(b.call(t,/(['\\])/g,"\\$1"),/[\x00-\x1f]/g,K),"single",r)}(t,l);if("number"==typeof t){if(0===t)return 1/0/t>0?"0":"-0";var S=String(t);return w?N(t,S):S}if("bigint"==typeof t){var R=String(t)+"n";return w?N(t,R):R}var C=void 0===l.depth?5:l.depth;if(void 0===o&&(o=0),o>=C&&C>0&&"object"==typeof t)return V(t)?"[Array]":"[Object]";var I=function(e,t){var r;if(" "===e.indent)r=" ";else{if("number"!=typeof e.indent||!(e.indent>0))return null;r=E.call(Array(e.indent+1)," ")}return{base:r,prev:E.call(Array(t+1),r)}}(l,o);if(void 0===s)s=[];else if(H(s,t)>=0)return"[Circular]";function W(t,r,n){if(r&&(s=A.call(s)).push(r),n){var i={depth:l.depth};return U(l,"quoteStyle")&&(i.quoteStyle=l.quoteStyle),e(t,i,o+1,s)}return e(t,l,o+1,s)}if("function"==typeof t&&!z(t)){var J=function(e){if(e.name)return e.name;var t=g.call(y.call(e),/^function\s*([\w$]+)/);return t?t[1]:null}(t),Q=Y(t,W);return"[Function"+(J?": "+J:" (anonymous)")+"]"+(Q.length>0?" { "+E.call(Q,", ")+" }":"")}if(B(t)){var ee=T?b.call(String(t),/^(Symbol\(.*\))_[^)]*$/,"$1"):O.call(t);return"object"!=typeof t||T?ee:q(ee)}if(t&&"object"==typeof t&&("undefined"!=typeof HTMLElement&&t instanceof HTMLElement||"string"==typeof t.nodeName&&"function"==typeof t.getAttribute)){for(var et,er="<"+x.call(String(t.nodeName)),en=t.attributes||[],eo=0;eo"}if(V(t)){if(0===t.length)return"[]";var ei=Y(t,W);return I&&!function(e){for(var t=0;t=0)return!1;return!0}(ei)?"["+X(ei,I)+"]":"[ "+E.call(ei,", ")+" ]"}if("[object Error]"===$(t)&&(!M||!("object"==typeof t&&M in t))){var ea=Y(t,W);return"cause"in Error.prototype||!("cause"in t)||k.call(t,"cause")?0===ea.length?"["+String(t)+"]":"{ ["+String(t)+"] "+E.call(ea,", ")+" }":"{ ["+String(t)+"] "+E.call(P.call("[cause]: "+W(t.cause),ea),", ")+" }"}if("object"==typeof t&&m){if(F&&"function"==typeof t[F]&&L)return L(t,{depth:C-o});if("symbol"!==m&&"function"==typeof t.inspect)return t.inspect()}if(function(e){if(!i||!e||"object"!=typeof e)return!1;try{i.call(e);try{u.call(e)}catch(e){return!0}return e instanceof Map}catch(e){}return!1}(t)){var es=[];return a&&a.call(t,function(e,r){es.push(W(r,t,!0)+" => "+W(e,t))}),Z("Map",i.call(t),es,I)}if(function(e){if(!u||!e||"object"!=typeof e)return!1;try{u.call(e);try{i.call(e)}catch(e){return!0}return e instanceof Set}catch(e){}return!1}(t)){var el=[];return c&&c.call(t,function(e){el.push(W(e,t))}),Z("Set",u.call(t),el,I)}if(function(e){if(!d||!e||"object"!=typeof e)return!1;try{d.call(e,d);try{f.call(e,f)}catch(e){return!0}return e instanceof WeakMap}catch(e){}return!1}(t))return G("WeakMap");if(function(e){if(!f||!e||"object"!=typeof e)return!1;try{f.call(e,f);try{d.call(e,d)}catch(e){return!0}return e instanceof WeakSet}catch(e){}return!1}(t))return G("WeakSet");if(function(e){if(!p||!e||"object"!=typeof e)return!1;try{return p.call(e),!0}catch(e){}return!1}(t))return G("WeakRef");if("[object Number]"===$(t)&&(!M||!("object"==typeof t&&M in t)))return q(W(Number(t)));if(function(e){if(!e||"object"!=typeof e||!j)return!1;try{return j.call(e),!0}catch(e){}return!1}(t))return q(W(j.call(t)));if("[object Boolean]"===$(t)&&(!M||!("object"==typeof t&&M in t)))return q(h.call(t));if("[object String]"===$(t)&&(!M||!("object"==typeof t&&M in t)))return q(W(String(t)));if("undefined"!=typeof window&&t===window)return"{ [object Window] }";if("undefined"!=typeof globalThis&&t===globalThis||void 0!==r.g&&t===r.g)return"{ [object globalThis] }";if(!("[object Date]"===$(t)&&(!M||!("object"==typeof t&&M in t)))&&!z(t)){var eu=Y(t,W),ec=D?D(t)===Object.prototype:t instanceof Object||t.constructor===Object,ed=t instanceof Object?"":"null prototype",ef=!ec&&M&&Object(t)===t&&M in t?v.call($(t),8,-1):ed?"Object":"",ep=(ec||"function"!=typeof t.constructor?"":t.constructor.name?t.constructor.name+" ":"")+(ef||ed?"["+E.call(P.call([],ef||[],ed||[]),": ")+"] ":"");return 0===eu.length?ep+"{}":I?ep+"{"+X(eu,I)+"}":ep+"{ "+E.call(eu,", ")+" }"}return String(t)};var W=Object.prototype.hasOwnProperty||function(e){return e in this};function U(e,t){return W.call(e,t)}function $(e){return m.call(e)}function H(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0,n=e.length;r-1?e.split(","):e},l=function(e,t){var r={__proto__:null},l=t.ignoreQueryPrefix?e.replace(/^\?/,""):e;l=l.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var u=t.parameterLimit===1/0?void 0:t.parameterLimit,c=l.split(t.delimiter,u),d=-1,f=t.charset;if(t.charsetSentinel)for(p=0;p=0;--i){var a,l=e[i];if("[]"===l&&r.parseArrays)a=r.allowEmptyArrays&&(""===o||r.strictNullHandling&&null===o)?[]:[].concat(o);else{a=r.plainObjects?Object.create(null):{};var u="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,c=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,d=parseInt(c,10);r.parseArrays||""!==c?!isNaN(d)&&l!==c&&String(d)===c&&d>=0&&r.parseArrays&&d<=r.arrayLimit?(a=[])[d]=o:"__proto__"!==c&&(a[c]=o):a={0:o}}o=a}return o},c=function(e,t,r,n){if(e){var i=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/g,s=r.depth>0&&/(\[[^[\]]*])/.exec(i),l=s?i.slice(0,s.index):i,c=[];if(l){if(!r.plainObjects&&o.call(Object.prototype,l)&&!r.allowPrototypes)return;c.push(l)}for(var d=0;r.depth>0&&null!==(s=a.exec(i))&&d0?j.join(",")||null:void 0}];else if(l(y))R=y;else{var D=Object.keys(j);R=g?D.sort(g):D}var N=f?r.replace(/\./g,"%2E"):r,L=a&&l(j)&&1===j.length?N+"[]":N;if(s&&l(j)&&0===j.length)return L+"[]";for(var I=0;I0?v+g:""}},65600:function(e,t,r){"use strict";var n=r(3462),o=Object.prototype.hasOwnProperty,i=Array.isArray,a=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),s=function(e){for(;e.length>1;){var t=e.pop(),r=t.obj[t.prop];if(i(r)){for(var n=[],o=0;o=1024?s.slice(u,u+1024):s,d=[],f=0;f=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122||i===n.RFC1738&&(40===p||41===p)){d[d.length]=c.charAt(f);continue}if(p<128){d[d.length]=a[p];continue}if(p<2048){d[d.length]=a[192|p>>6]+a[128|63&p];continue}if(p<55296||p>=57344){d[d.length]=a[224|p>>12]+a[128|p>>6&63]+a[128|63&p];continue}f+=1,p=65536+((1023&p)<<10|1023&c.charCodeAt(f)),d[d.length]=a[240|p>>18]+a[128|p>>12&63]+a[128|p>>6&63]+a[128|63&p]}l+=d.join("")}return l},isBuffer:function(e){return!!e&&"object"==typeof e&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(i(e)){for(var r=[],n=0;nt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,n=Object.getOwnPropertySymbols(e);ot.indexOf(n[o])&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r}"function"==typeof SuppressedError&&SuppressedError;var f=r(2265),p="right-scroll-bar-position",h="width-before-scroll-bar";function m(e,t){return"function"==typeof e?e(t):e&&(e.current=t),e}var y="undefined"!=typeof window?f.useLayoutEffect:f.useEffect,g=new WeakMap,v=(void 0===o&&(o={}),(void 0===i&&(i=function(e){return e}),a=[],s=!1,l={read:function(){if(s)throw Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return a.length?a[a.length-1]:null},useMedium:function(e){var t=i(e,s);return a.push(t),function(){a=a.filter(function(e){return e!==t})}},assignSyncMedium:function(e){for(s=!0;a.length;){var t=a;a=[],t.forEach(e)}a={push:function(t){return e(t)},filter:function(){return a}}},assignMedium:function(e){s=!0;var t=[];if(a.length){var r=a;a=[],r.forEach(e),t=a}var n=function(){var r=t;t=[],r.forEach(e)},o=function(){return Promise.resolve().then(n)};o(),a={push:function(e){t.push(e),o()},filter:function(e){return t=t.filter(e),a}}}}).options=c({async:!0,ssr:!1},o),l),b=function(){},w=f.forwardRef(function(e,t){var r,n,o,i,a=f.useRef(null),s=f.useState({onScrollCapture:b,onWheelCapture:b,onTouchMoveCapture:b}),l=s[0],u=s[1],p=e.forwardProps,h=e.children,w=e.className,x=e.removeScrollBar,S=e.enabled,P=e.shards,E=e.sideCar,A=e.noIsolation,R=e.inert,j=e.allowPinchZoom,C=e.as,O=e.gapMode,T=d(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),M=(r=[a,t],n=function(e){return r.forEach(function(t){return m(t,e)})},(o=(0,f.useState)(function(){return{value:null,callback:n,facade:{get current(){return o.value},set current(value){var e=o.value;e!==value&&(o.value=value,o.callback(value,e))}}}})[0]).callback=n,i=o.facade,y(function(){var e=g.get(i);if(e){var t=new Set(e),n=new Set(r),o=i.current;t.forEach(function(e){n.has(e)||m(e,null)}),n.forEach(function(e){t.has(e)||m(e,o)})}g.set(i,r)},[r]),i),k=c(c({},T),l);return f.createElement(f.Fragment,null,S&&f.createElement(E,{sideCar:v,removeScrollBar:x,shards:P,noIsolation:A,inert:R,setCallbacks:u,allowPinchZoom:!!j,lockRef:a,gapMode:O}),p?f.cloneElement(f.Children.only(h),c(c({},k),{ref:M})):f.createElement(void 0===C?"div":C,c({},k,{className:w,ref:M}),h))});w.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1},w.classNames={fullWidth:h,zeroRight:p};var x=function(e){var t=e.sideCar,r=d(e,["sideCar"]);if(!t)throw Error("Sidecar: please provide `sideCar` property to import the right car");var n=t.read();if(!n)throw Error("Sidecar medium not found");return f.createElement(n,c({},r))};x.isSideCarExport=!0;var S=function(){var e=0,t=null;return{add:function(o){if(0==e&&(t=function(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=n||r.nc;return t&&e.setAttribute("nonce",t),e}())){var i,a;(i=t).styleSheet?i.styleSheet.cssText=o:i.appendChild(document.createTextNode(o)),a=t,(document.head||document.getElementsByTagName("head")[0]).appendChild(a)}e++},remove:function(){--e||!t||(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},P=function(){var e=S();return function(t,r){f.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&r])}},E=function(){var e=P();return function(t){return e(t.styles,t.dynamic),null}},A={left:0,top:0,right:0,gap:0},R=function(e){return parseInt(e||"",10)||0},j=function(e){var t=window.getComputedStyle(document.body),r=t["padding"===e?"paddingLeft":"marginLeft"],n=t["padding"===e?"paddingTop":"marginTop"],o=t["padding"===e?"paddingRight":"marginRight"];return[R(r),R(n),R(o)]},C=function(e){if(void 0===e&&(e="margin"),"undefined"==typeof window)return A;var t=j(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},O=E(),T="data-scroll-locked",M=function(e,t,r,n){var o=e.left,i=e.top,a=e.right,s=e.gap;return void 0===r&&(r="margin"),"\n .".concat("with-scroll-bars-hidden"," {\n overflow: hidden ").concat(n,";\n padding-right: ").concat(s,"px ").concat(n,";\n }\n body[").concat(T,"] {\n overflow: hidden ").concat(n,";\n overscroll-behavior: contain;\n ").concat([t&&"position: relative ".concat(n,";"),"margin"===r&&"\n padding-left: ".concat(o,"px;\n padding-top: ").concat(i,"px;\n padding-right: ").concat(a,"px;\n margin-left:0;\n margin-top:0;\n margin-right: ").concat(s,"px ").concat(n,";\n "),"padding"===r&&"padding-right: ".concat(s,"px ").concat(n,";")].filter(Boolean).join(""),"\n }\n \n .").concat(p," {\n right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(h," {\n margin-right: ").concat(s,"px ").concat(n,";\n }\n \n .").concat(p," .").concat(p," {\n right: 0 ").concat(n,";\n }\n \n .").concat(h," .").concat(h," {\n margin-right: 0 ").concat(n,";\n }\n \n body[").concat(T,"] {\n ").concat("--removed-body-scroll-bar-size",": ").concat(s,"px;\n }\n")},k=function(){var e=parseInt(document.body.getAttribute(T)||"0",10);return isFinite(e)?e:0},D=function(){f.useEffect(function(){return document.body.setAttribute(T,(k()+1).toString()),function(){var e=k()-1;e<=0?document.body.removeAttribute(T):document.body.setAttribute(T,e.toString())}},[])},N=function(e){var t=e.noRelative,r=e.noImportant,n=e.gapMode,o=void 0===n?"margin":n;D();var i=f.useMemo(function(){return C(o)},[o]);return f.createElement(O,{styles:M(i,!t,o,r?"":"!important")})},L=!1;if("undefined"!=typeof window)try{var I=Object.defineProperty({},"passive",{get:function(){return L=!0,!0}});window.addEventListener("test",I,I),window.removeEventListener("test",I,I)}catch(e){L=!1}var F=!!L&&{passive:!1},_=function(e,t){var r=window.getComputedStyle(e);return"hidden"!==r[t]&&!(r.overflowY===r.overflowX&&"TEXTAREA"!==e.tagName&&"visible"===r[t])},V=function(e,t){var r=t.ownerDocument,n=t;do{if("undefined"!=typeof ShadowRoot&&n instanceof ShadowRoot&&(n=n.host),z(e,n)){var o=B(e,n);if(o[1]>o[2])return!0}n=n.parentNode}while(n&&n!==r.body);return!1},z=function(e,t){return"v"===e?_(t,"overflowY"):_(t,"overflowX")},B=function(e,t){return"v"===e?[t.scrollTop,t.scrollHeight,t.clientHeight]:[t.scrollLeft,t.scrollWidth,t.clientWidth]},W=function(e,t,r,n,o){var i,a=(i=window.getComputedStyle(t).direction,"h"===e&&"rtl"===i?-1:1),s=a*n,l=r.target,u=t.contains(l),c=!1,d=s>0,f=0,p=0;do{var h=B(e,l),m=h[0],y=h[1]-h[2]-a*m;(m||y)&&z(e,l)&&(f+=y,p+=m),l instanceof ShadowRoot?l=l.host:l=l.parentNode}while(!u&&l!==document.body||u&&(t.contains(l)||t===l));return d&&(o&&1>Math.abs(f)||!o&&s>f)?c=!0:!d&&(o&&1>Math.abs(p)||!o&&-s>p)&&(c=!0),c},U=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},$=function(e){return[e.deltaX,e.deltaY]},H=function(e){return e&&"current"in e?e.current:e},K=0,q=[],G=(u=function(e){var t=f.useRef([]),r=f.useRef([0,0]),n=f.useRef(),o=f.useState(K++)[0],i=f.useState(E)[0],a=f.useRef(e);f.useEffect(function(){a.current=e},[e]),f.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(o));var t=(function(e,t,r){if(r||2==arguments.length)for(var n,o=0,i=t.length;oMath.abs(u)?"h":"v";if("touches"in e&&"h"===d&&"range"===c.type)return!1;var f=V(d,c);if(!f)return!0;if(f?o=d:(o="v"===d?"h":"v",f=V(d,c)),!f)return!1;if(!n.current&&"changedTouches"in e&&(l||u)&&(n.current=o),!o)return!0;var p=n.current||o;return W(p,t,e,"h"===p?l:u,!0)},[]),l=f.useCallback(function(e){if(q.length&&q[q.length-1]===i){var r="deltaY"in e?$(e):U(e),n=t.current.filter(function(t){var n;return t.name===e.type&&(t.target===e.target||e.target===t.shadowParent)&&(n=t.delta)[0]===r[0]&&n[1]===r[1]})[0];if(n&&n.should){e.cancelable&&e.preventDefault();return}if(!n){var o=(a.current.shards||[]).map(H).filter(Boolean).filter(function(t){return t.contains(e.target)});(o.length>0?s(e,o[0]):!a.current.noIsolation)&&e.cancelable&&e.preventDefault()}}},[]),u=f.useCallback(function(e,r,n,o){var i={name:e,delta:r,target:n,should:o,shadowParent:function(e){for(var t=null;null!==e;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}(n)};t.current.push(i),setTimeout(function(){t.current=t.current.filter(function(e){return e!==i})},1)},[]),c=f.useCallback(function(e){r.current=U(e),n.current=void 0},[]),d=f.useCallback(function(t){u(t.type,$(t),t.target,s(t,e.lockRef.current))},[]),p=f.useCallback(function(t){u(t.type,U(t),t.target,s(t,e.lockRef.current))},[]);f.useEffect(function(){return q.push(i),e.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:p}),document.addEventListener("wheel",l,F),document.addEventListener("touchmove",l,F),document.addEventListener("touchstart",c,F),function(){q=q.filter(function(e){return e!==i}),document.removeEventListener("wheel",l,F),document.removeEventListener("touchmove",l,F),document.removeEventListener("touchstart",c,F)}},[]);var h=e.removeScrollBar,m=e.inert;return f.createElement(f.Fragment,null,m?f.createElement(i,{styles:"\n .block-interactivity-".concat(o," {pointer-events: none;}\n .allow-interactivity-").concat(o," {pointer-events: all;}\n")}):null,h?f.createElement(N,{gapMode:e.gapMode}):null)},v.useMedium(u),x),Z=f.forwardRef(function(e,t){return f.createElement(w,c({},e,{ref:t,sideCar:G}))});Z.classNames=w.classNames;var X=Z},41505:function(e,t,r){"use strict";r.d(t,{OT:function(){return eR},eh:function(){return eP},s_:function(){return P}});var n,o=r(2265);let{createElement:i,createContext:a,createRef:s,forwardRef:l,useCallback:u,useContext:c,useEffect:d,useImperativeHandle:f,useLayoutEffect:p,useMemo:h,useRef:m,useState:y}=n||(n=r.t(o,2)),g=(n||(n=r.t(o,2)))["useId".toString()],v=a(null);v.displayName="PanelGroupContext";let b="function"==typeof g?g:()=>null,w=0;function x(e=null){let t=b(),r=m(e||t||null);return null===r.current&&(r.current=""+w++),null!=e?e:r.current}function S({children:e,className:t="",collapsedSize:r,collapsible:n,defaultSize:o,forwardedRef:a,id:s,maxSize:l,minSize:u,onCollapse:d,onExpand:h,onResize:y,order:g,style:b,tagName:w="div",...S}){let P=c(v);if(null===P)throw Error("Panel components must be rendered within a PanelGroup container");let{collapsePanel:E,expandPanel:A,getPanelSize:R,getPanelStyle:j,groupId:C,isPanelCollapsed:O,reevaluatePanelConstraints:T,registerPanel:M,resizePanel:k,unregisterPanel:D}=P,N=x(s),L=m({callbacks:{onCollapse:d,onExpand:h,onResize:y},constraints:{collapsedSize:r,collapsible:n,defaultSize:o,maxSize:l,minSize:u},id:N,idIsFromProps:void 0!==s,order:g});m({didLogMissingDefaultSizeWarning:!1}),p(()=>{let{callbacks:e,constraints:t}=L.current,i={...t};L.current.id=N,L.current.idIsFromProps=void 0!==s,L.current.order=g,e.onCollapse=d,e.onExpand=h,e.onResize=y,t.collapsedSize=r,t.collapsible=n,t.defaultSize=o,t.maxSize=l,t.minSize=u,(i.collapsedSize!==t.collapsedSize||i.collapsible!==t.collapsible||i.maxSize!==t.maxSize||i.minSize!==t.minSize)&&T(L.current,i)}),p(()=>{let e=L.current;return M(e),()=>{D(e)}},[g,N,M,D]),f(a,()=>({collapse:()=>{E(L.current)},expand:e=>{A(L.current,e)},getId:()=>N,getSize:()=>R(L.current),isCollapsed:()=>O(L.current),isExpanded:()=>!O(L.current),resize:e=>{k(L.current,e)}}),[E,A,R,O,N,k]);let I=j(L.current,o);return i(w,{...S,children:e,className:t,id:s,style:{...I,...b},"data-panel":"","data-panel-collapsible":n||void 0,"data-panel-group-id":C,"data-panel-id":N,"data-panel-size":parseFloat(""+I.flexGrow).toFixed(1)})}let P=l((e,t)=>i(S,{...e,forwardedRef:t}));S.displayName="Panel",P.displayName="forwardRef(Panel)";let E=null,A=null;function R(e,t){let r=function(e,t){if(t){let e=(t&I)!=0,r=(t&F)!=0,n=(t&_)!=0,o=(t&V)!=0;if(e)return n?"se-resize":o?"ne-resize":"e-resize";if(r)return n?"sw-resize":o?"nw-resize":"w-resize";if(n)return"s-resize";if(o)return"n-resize"}switch(e){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}(e,t);E!==r&&(E=r,null===A&&(A=document.createElement("style"),document.head.appendChild(A)),A.innerHTML=`*{cursor: ${r}!important;}`)}function j(e){return"keydown"===e.type}function C(e){return e.type.startsWith("pointer")}function O(e){return e.type.startsWith("mouse")}function T(e){if(C(e)){if(e.isPrimary)return{x:e.clientX,y:e.clientY}}else if(O(e))return{x:e.clientX,y:e.clientY};return{x:1/0,y:1/0}}let M=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function k(e){let t=e.length;for(;t--;){let r=e[t];if(Q(r,"Missing node"),function(e){let t=getComputedStyle(e);return!!("fixed"===t.position||"auto"!==t.zIndex&&("static"!==t.position||function(e){var t;let r=getComputedStyle(null!==(t=L(e))&&void 0!==t?t:e).display;return"flex"===r||"inline-flex"===r}(e))||1>+t.opacity||"transform"in t&&"none"!==t.transform||"webkitTransform"in t&&"none"!==t.webkitTransform||"mixBlendMode"in t&&"normal"!==t.mixBlendMode||"filter"in t&&"none"!==t.filter||"webkitFilter"in t&&"none"!==t.webkitFilter||"isolation"in t&&"isolate"===t.isolation||M.test(t.willChange))||"touch"===t.webkitOverflowScrolling}(r))return r}return null}function D(e){return e&&Number(getComputedStyle(e).zIndex)||0}function N(e){let t=[];for(;e;)t.push(e),e=L(e);return t}function L(e){let{parentNode:t}=e;return t&&t instanceof ShadowRoot?t.host:t}let I=1,F=2,_=4,V=8,z="coarse"===function(){if("function"==typeof matchMedia)return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}(),B=[],W=!1,U=new Map,$=new Map,H=new Set;function K(e){let{target:t}=e,{x:r,y:n}=T(e);W=!0,Z({target:t,x:r,y:n}),Y(),B.length>0&&(J("down",e),e.preventDefault(),e.stopPropagation())}function q(e){let{x:t,y:r}=T(e);if(0===e.buttons&&(W=!1,J("up",e)),!W){let{target:n}=e;Z({target:n,x:t,y:r})}J("move",e),X(),B.length>0&&e.preventDefault()}function G(e){let{target:t}=e,{x:r,y:n}=T(e);$.clear(),W=!1,B.length>0&&e.preventDefault(),J("up",e),Z({target:t,x:r,y:n}),X(),Y()}function Z({target:e,x:t,y:r}){B.splice(0);let n=null;e instanceof HTMLElement&&(n=e),H.forEach(e=>{let{element:o,hitAreaMargins:i}=e,a=o.getBoundingClientRect(),{bottom:s,left:l,right:u,top:c}=a,d=z?i.coarse:i.fine;if(t>=l-d&&t<=u+d&&r>=c-d&&r<=s+d){if(null!==n&&o!==n&&!o.contains(n)&&!n.contains(o)&&function(e,t){let r;if(e===t)throw Error("Cannot compare node with itself");let n={a:N(e),b:N(t)};for(;n.a.at(-1)===n.b.at(-1);)e=n.a.pop(),t=n.b.pop(),r=e;Q(r,"Stacking order can only be calculated for elements with a common ancestor");let o={a:D(k(n.a)),b:D(k(n.b))};if(o.a===o.b){let e=r.childNodes,t={a:n.a.at(-1),b:n.b.at(-1)},o=e.length;for(;o--;){let r=e[o];if(r===t.a)return 1;if(r===t.b)return -1}}return Math.sign(o.a-o.b)}(n,o)>0){let e=n,t=!1;for(;e;){var f;if(e.contains(o))break;if((f=e.getBoundingClientRect()).xa.x&&f.ya.y){t=!0;break}e=e.parentElement}if(t)return}B.push(e)}})}function X(){let e=!1,t=!1;B.forEach(r=>{let{direction:n}=r;"horizontal"===n?e=!0:t=!0});let r=0;$.forEach(e=>{r|=e}),e&&t?R("intersection",r):e?R("horizontal",r):t?R("vertical",r):null!==A&&(document.head.removeChild(A),E=null,A=null)}function Y(){U.forEach((e,t)=>{let{body:r}=t;r.removeEventListener("contextmenu",G),r.removeEventListener("pointerdown",K),r.removeEventListener("pointerleave",q),r.removeEventListener("pointermove",q)}),window.removeEventListener("pointerup",G),window.removeEventListener("pointercancel",G),H.size>0&&(W?(B.length>0&&U.forEach((e,t)=>{let{body:r}=t;e>0&&(r.addEventListener("contextmenu",G),r.addEventListener("pointerleave",q),r.addEventListener("pointermove",q))}),window.addEventListener("pointerup",G),window.addEventListener("pointercancel",G)):U.forEach((e,t)=>{let{body:r}=t;e>0&&(r.addEventListener("pointerdown",K,{capture:!0}),r.addEventListener("pointermove",q))}))}function J(e,t){H.forEach(r=>{let{setResizeHandlerState:n}=r;n(e,B.includes(r),t)})}function Q(e,t){if(!e)throw console.error(t),Error(t)}function ee(e,t,r=10){return e.toFixed(r)===t.toFixed(r)?0:e>t?1:-1}function et(e,t,r=10){return 0===ee(e,t,r)}function er(e,t,r){return 0===ee(e,t,r)}function en({panelConstraints:e,panelIndex:t,size:r}){let n=e[t];Q(null!=n,`Panel constraints not found for index ${t}`);let{collapsedSize:o=0,collapsible:i,maxSize:a=100,minSize:s=0}=n;return 0>ee(r,s)&&(r=i&&0>ee(r,(o+s)/2)?o:s),r=parseFloat((r=Math.min(a,r)).toFixed(10))}function eo({delta:e,initialLayout:t,panelConstraints:r,pivotIndices:n,prevLayout:o,trigger:i}){if(er(e,0))return t;let a=[...t],[s,l]=n;Q(null!=s,"Invalid first pivot index"),Q(null!=l,"Invalid second pivot index");let u=0;if("keyboard"===i){{let n=e<0?l:s,o=r[n];Q(o,`Panel constraints not found for index ${n}`);let{collapsedSize:i=0,collapsible:a,minSize:u=0}=o;if(a){let r=t[n];if(Q(null!=r,`Previous layout not found for panel index ${n}`),er(r,i)){let t=u-r;ee(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}{let n=e<0?s:l,o=r[n];Q(o,`No panel constraints found for index ${n}`);let{collapsedSize:i=0,collapsible:a,minSize:u=0}=o;if(a){let r=t[n];if(Q(null!=r,`Previous layout not found for panel index ${n}`),er(r,u)){let t=r-i;ee(t,Math.abs(e))>0&&(e=e<0?0-t:t)}}}}{let n=e<0?1:-1,o=e<0?l:s,i=0;for(;;){let e=t[o];if(Q(null!=e,`Previous layout not found for panel index ${o}`),i+=en({panelConstraints:r,panelIndex:o,size:100})-e,(o+=n)<0||o>=r.length)break}let a=Math.min(Math.abs(e),Math.abs(i));e=e<0?0-a:a}{let n=e<0?s:l;for(;n>=0&&n=0))break;e<0?n--:n++}}if(function(e,t,r){if(e.length!==t.length)return!1;for(let r=0;r=0&&n0?n--:n++}}}return er(a.reduce((e,t)=>t+e,0),100)?a:o}function ei(e,t=document){return Array.from(t.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${e}"]`))}function ea(e,t,r=document){let n=ei(e,r).findIndex(e=>e.getAttribute("data-panel-resize-handle-id")===t);return null!=n?n:null}function es(e,t,r){let n=ea(e,t,r);return null!=n?[n,n+1]:[-1,-1]}function el(e,t=document){var r;return t instanceof HTMLElement&&(null==t?void 0:null===(r=t.dataset)||void 0===r?void 0:r.panelGroupId)==e?t:t.querySelector(`[data-panel-group][data-panel-group-id="${e}"]`)||null}function eu(e,t=document){return t.querySelector(`[data-panel-resize-handle-id="${e}"]`)||null}function ec(e,t){if(e.length!==t.length)return!1;for(let r=0;r{let o=e[n];Q(o,`Panel data not found for index ${n}`);let{callbacks:i,constraints:a,id:s}=o,{collapsedSize:l=0,collapsible:u}=a,c=r[s];if(null==c||t!==c){r[s]=t;let{onCollapse:e,onExpand:n,onResize:o}=i;o&&o(t,c),u&&(e||n)&&(n&&(null==c||et(c,l))&&!et(t,l)&&n(),e&&(null==c||!et(c,l))&&et(t,l)&&e())}})}function ep(e,t){if(e.length!==t.length)return!1;for(let r=0;rlocalStorage.getItem(e),e.setItem=(e,t)=>{localStorage.setItem(e,t)};else throw Error("localStorage not supported in this environment")}catch(t){console.error(t),e.getItem=()=>null,e.setItem=()=>{}}}function em(e){return`react-resizable-panels:${e}`}function ey(e){return e.map(e=>{let{constraints:t,id:r,idIsFromProps:n,order:o}=e;return n?r:o?`${o}:${JSON.stringify(t)}`:JSON.stringify(t)}).sort((e,t)=>e.localeCompare(t)).join(",")}function eg(e,t){try{let r=em(e),n=t.getItem(r);if(n){let e=JSON.parse(n);if("object"==typeof e&&null!=e)return e}}catch(e){}return null}function ev(e,t,r,n,o){var i;let a=em(e),s=ey(t),l=null!==(i=eg(e,o))&&void 0!==i?i:{};l[s]={expandToSizes:Object.fromEntries(r.entries()),layout:n};try{o.setItem(a,JSON.stringify(l))}catch(e){console.error(e)}}function eb({layout:e,panelConstraints:t}){let r=[...e],n=r.reduce((e,t)=>e+t,0);if(r.length!==t.length)throw Error(`Invalid ${t.length} panel layout: ${r.map(e=>`${e}%`).join(", ")}`);if(!er(n,100))for(let e=0;e(eh(ew),ew.getItem(e)),setItem:(e,t)=>{eh(ew),ew.setItem(e,t)}},ex={};function eS({autoSaveId:e=null,children:t,className:r="",direction:n,forwardedRef:o,id:a=null,onLayout:s=null,keyboardResizeBy:l=null,storage:c=ew,style:g,tagName:b="div",...w}){let S=x(a),P=m(null),[E,A]=y(null),[R,T]=y([]),M=function(){let[e,t]=y(0);return u(()=>t(e=>e+1),[])}(),k=m({}),D=m(new Map),N=m(0),L=m({autoSaveId:e,direction:n,dragState:E,id:S,keyboardResizeBy:l,onLayout:s,storage:c}),z=m({layout:R,panelDataArray:[],panelDataArrayChanged:!1});m({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),f(o,()=>({getId:()=>L.current.id,getLayout:()=>{let{layout:e}=z.current;return e},setLayout:e=>{let{onLayout:t}=L.current,{layout:r,panelDataArray:n}=z.current,o=eb({layout:e,panelConstraints:n.map(e=>e.constraints)});ec(r,o)||(T(o),z.current.layout=o,t&&t(o),ef(n,o,k.current))}}),[]),p(()=>{L.current.autoSaveId=e,L.current.direction=n,L.current.dragState=E,L.current.id=S,L.current.onLayout=s,L.current.storage=c}),function({committedValuesRef:e,eagerValuesRef:t,groupId:r,layout:n,panelDataArray:o,panelGroupElement:i,setLayout:a}){m({didWarnAboutMissingResizeHandle:!1}),p(()=>{if(!i)return;let e=ei(r,i);for(let t=0;t{let{constraints:r}=e,{maxSize:l=100,minSize:u=0}=r;t===s?(n=u,o=l):(i+=u,a+=l)}),{valueMax:Math.min(o,100-i),valueMin:Math.max(n,100-a),valueNow:e[s]}}({layout:n,panelsArray:o,pivotIndices:[t,t+1]}),s=e[t];if(null==s);else{let e=o[t];Q(e,`No panel data found for index "${t}"`),s.setAttribute("aria-controls",e.id),s.setAttribute("aria-valuemax",""+Math.round(r)),s.setAttribute("aria-valuemin",""+Math.round(i)),s.setAttribute("aria-valuenow",null!=a?""+Math.round(a):"")}}return()=>{e.forEach((e,t)=>{e.removeAttribute("aria-controls"),e.removeAttribute("aria-valuemax"),e.removeAttribute("aria-valuemin"),e.removeAttribute("aria-valuenow")})}},[r,n,o,i]),d(()=>{if(!i)return;let e=t.current;Q(e,"Eager values not found");let{panelDataArray:o}=e;Q(null!=el(r,i),`No group found for id "${r}"`);let s=ei(r,i);Q(s,`No resize handles found for group id "${r}"`);let l=s.map(e=>{let t=e.getAttribute("data-panel-resize-handle-id");Q(t,"Resize handle element has no handle id attribute");let[s,l]=function(e,t,r,n=document){var o,i,a,s;let l=eu(t,n),u=ei(e,n),c=l?u.indexOf(l):-1;return[null!==(o=null===(i=r[c])||void 0===i?void 0:i.id)&&void 0!==o?o:null,null!==(a=null===(s=r[c+1])||void 0===s?void 0:s.id)&&void 0!==a?a:null]}(r,t,o,i);if(null==s||null==l)return()=>{};let u=e=>{if(!e.defaultPrevented&&"Enter"===e.key){e.preventDefault();let l=o.findIndex(e=>e.id===s);if(l>=0){let e=o[l];Q(e,`No panel data found for index ${l}`);let s=n[l],{collapsedSize:u=0,collapsible:c,minSize:d=0}=e.constraints;if(null!=s&&c){let e=eo({delta:er(s,u)?d-u:u-s,initialLayout:n,panelConstraints:o.map(e=>e.constraints),pivotIndices:es(r,t,i),prevLayout:n,trigger:"keyboard"});n!==e&&a(e)}}}};return e.addEventListener("keydown",u),()=>{e.removeEventListener("keydown",u)}});return()=>{l.forEach(e=>e())}},[i,e,t,r,n,o,a])}({committedValuesRef:L,eagerValuesRef:z,groupId:S,layout:R,panelDataArray:z.current.panelDataArray,setLayout:T,panelGroupElement:P.current}),d(()=>{let{panelDataArray:t}=z.current;if(e){if(0===R.length||R.length!==t.length)return;let r=ex[e];null==r&&(r=function(e,t=10){let r=null;return(...n)=>{null!==r&&clearTimeout(r),r=setTimeout(()=>{e(...n)},t)}}(ev,100),ex[e]=r),r(e,[...t],new Map(D.current),R,c)}},[e,R,c]),d(()=>{});let B=u(e=>{let{onLayout:t}=L.current,{layout:r,panelDataArray:n}=z.current;if(e.constraints.collapsible){let o=n.map(e=>e.constraints),{collapsedSize:i=0,panelSize:a,pivotIndices:s}=eA(n,e,r);if(Q(null!=a,`Panel size not found for panel "${e.id}"`),!et(a,i)){D.current.set(e.id,a);let l=eo({delta:eE(n,e)===n.length-1?a-i:i-a,initialLayout:r,panelConstraints:o,pivotIndices:s,prevLayout:r,trigger:"imperative-api"});ep(r,l)||(T(l),z.current.layout=l,t&&t(l),ef(n,l,k.current))}}},[]),W=u((e,t)=>{let{onLayout:r}=L.current,{layout:n,panelDataArray:o}=z.current;if(e.constraints.collapsible){let i=o.map(e=>e.constraints),{collapsedSize:a=0,panelSize:s=0,minSize:l=0,pivotIndices:u}=eA(o,e,n),c=null!=t?t:l;if(et(s,a)){let t=D.current.get(e.id),a=null!=t&&t>=c?t:c,l=eo({delta:eE(o,e)===o.length-1?s-a:a-s,initialLayout:n,panelConstraints:i,pivotIndices:u,prevLayout:n,trigger:"imperative-api"});ep(n,l)||(T(l),z.current.layout=l,r&&r(l),ef(o,l,k.current))}}},[]),U=u(e=>{let{layout:t,panelDataArray:r}=z.current,{panelSize:n}=eA(r,e,t);return Q(null!=n,`Panel size not found for panel "${e.id}"`),n},[]),H=u((e,t)=>{let{panelDataArray:r}=z.current,n=eE(r,e);return function({defaultSize:e,dragState:t,layout:r,panelData:n,panelIndex:o,precision:i=3}){let a=r[o];return{flexBasis:0,flexGrow:null==a?void 0!=e?e.toPrecision(i):"1":1===n.length?"1":a.toPrecision(i),flexShrink:1,overflow:"hidden",pointerEvents:null!==t?"none":void 0}}({defaultSize:t,dragState:E,layout:R,panelData:r,panelIndex:n})},[E,R]),K=u(e=>{let{layout:t,panelDataArray:r}=z.current,{collapsedSize:n=0,collapsible:o,panelSize:i}=eA(r,e,t);return Q(null!=i,`Panel size not found for panel "${e.id}"`),!0===o&&et(i,n)},[]),q=u(e=>{let{layout:t,panelDataArray:r}=z.current,{collapsedSize:n=0,collapsible:o,panelSize:i}=eA(r,e,t);return Q(null!=i,`Panel size not found for panel "${e.id}"`),!o||ee(i,n)>0},[]),G=u(e=>{let{panelDataArray:t}=z.current;t.push(e),t.sort((e,t)=>{let r=e.order,n=t.order;return null==r&&null==n?0:null==r?-1:null==n?1:r-n}),z.current.panelDataArrayChanged=!0,M()},[M]);p(()=>{if(z.current.panelDataArrayChanged){z.current.panelDataArrayChanged=!1;let{autoSaveId:r,onLayout:n,storage:o}=L.current,{layout:i,panelDataArray:a}=z.current,s=null;if(r){var e,t;let n=null!==(t=(null!==(e=eg(r,o))&&void 0!==e?e:{})[ey(a)])&&void 0!==t?t:null;n&&(D.current=new Map(Object.entries(n.expandToSizes)),s=n.layout)}null==s&&(s=function({panelDataArray:e}){let t=Array(e.length),r=e.map(e=>e.constraints),n=0,o=100;for(let i=0;ie.constraints)});ec(i,l)||(T(l),z.current.layout=l,n&&n(l),ef(a,l,k.current))}}),p(()=>{let e=z.current;return()=>{e.layout=[]}},[]);let Z=u(e=>function(t){t.preventDefault();let r=P.current;if(!r)return()=>null;let{direction:n,dragState:o,id:i,keyboardResizeBy:a,onLayout:s}=L.current,{layout:l,panelDataArray:u}=z.current,{initialLayout:c}=null!=o?o:{},d=es(i,e,r),f=function(e,t,r,n,o,i){if(j(e)){let t="horizontal"===r,n=0;n=e.shiftKey?100:null!=o?o:10;let i=0;switch(e.key){case"ArrowDown":i=t?0:n;break;case"ArrowLeft":i=t?-n:0;break;case"ArrowRight":i=t?n:0;break;case"ArrowUp":i=t?0:-n;break;case"End":i=100;break;case"Home":i=-100}return i}return null==n?0:function(e,t,r,n,o){let i="horizontal"===r,a=eu(t,o);Q(a,`No resize handle element found for id "${t}"`);let s=a.getAttribute("data-panel-group-id");Q(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=n,u=ed(r,e),c=el(s,o);Q(c,`No group element found for id "${s}"`);let d=c.getBoundingClientRect();return(u-l)/(i?d.width:d.height)*100}(e,t,r,n,i)}(t,e,n,o,a,r),p="horizontal"===n;"rtl"===document.dir&&p&&(f=-f);let h=eo({delta:f,initialLayout:null!=c?c:l,panelConstraints:u.map(e=>e.constraints),pivotIndices:d,prevLayout:l,trigger:j(t)?"keyboard":"mouse-or-touch"}),m=!ep(l,h);if((C(t)||O(t))&&N.current!=f){var y,g;(N.current=f,m)?$.set(e,0):p?(y=f<0?I:F,$.set(e,y)):(g=f<0?_:V,$.set(e,g))}m&&(T(h),z.current.layout=h,s&&s(h),ef(u,h,k.current))},[]),X=u((e,t)=>{let{onLayout:r}=L.current,{layout:n,panelDataArray:o}=z.current,i=o.map(e=>e.constraints),{panelSize:a,pivotIndices:s}=eA(o,e,n);Q(null!=a,`Panel size not found for panel "${e.id}"`);let l=eo({delta:eE(o,e)===o.length-1?a-t:t-a,initialLayout:n,panelConstraints:i,pivotIndices:s,prevLayout:n,trigger:"imperative-api"});ep(n,l)||(T(l),z.current.layout=l,r&&r(l),ef(o,l,k.current))},[]),Y=u((e,t)=>{let{layout:r,panelDataArray:n}=z.current,{collapsedSize:o=0,collapsible:i}=t,{collapsedSize:a=0,collapsible:s,maxSize:l=100,minSize:u=0}=e.constraints,{panelSize:c}=eA(n,e,r);null!=c&&(i&&s&&et(c,o)?et(o,a)||X(e,a):cl&&X(e,l))},[X]),J=u((e,t)=>{let{direction:r}=L.current,{layout:n}=z.current;if(!P.current)return;let o=eu(e,P.current);Q(o,`Drag handle element not found for id "${e}"`);let i=ed(r,t);A({dragHandleId:e,dragHandleRect:o.getBoundingClientRect(),initialCursorPosition:i,initialLayout:n})},[]),en=u(()=>{A(null)},[]),ea=u(e=>{let{panelDataArray:t}=z.current,r=eE(t,e);r>=0&&(t.splice(r,1),delete k.current[e.id],z.current.panelDataArrayChanged=!0,M())},[M]),eh=h(()=>({collapsePanel:B,direction:n,dragState:E,expandPanel:W,getPanelSize:U,getPanelStyle:H,groupId:S,isPanelCollapsed:K,isPanelExpanded:q,reevaluatePanelConstraints:Y,registerPanel:G,registerResizeHandle:Z,resizePanel:X,startDragging:J,stopDragging:en,unregisterPanel:ea,panelGroupElement:P.current}),[B,E,n,W,U,H,S,K,q,Y,G,Z,X,J,en,ea]);return i(v.Provider,{value:eh},i(b,{...w,children:t,className:r,id:a,ref:P,style:{display:"flex",flexDirection:"horizontal"===n?"row":"column",height:"100%",overflow:"hidden",width:"100%",...g},"data-panel-group":"","data-panel-group-direction":n,"data-panel-group-id":S}))}let eP=l((e,t)=>i(eS,{...e,forwardedRef:t}));function eE(e,t){return e.findIndex(e=>e===t||e.id===t.id)}function eA(e,t,r){let n=eE(e,t),o=n===e.length-1,i=r[n];return{...t.constraints,panelSize:i,pivotIndices:o?[n-1,n]:[n,n+1]}}function eR({children:e=null,className:t="",disabled:r=!1,hitAreaMargins:n,id:o,onBlur:a,onDragging:s,onFocus:l,style:u={},tabIndex:f=0,tagName:h="div",...g}){var b,w;let S=m(null),P=m({onDragging:s});d(()=>{P.current.onDragging=s});let E=c(v);if(null===E)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");let{direction:A,groupId:R,registerResizeHandle:j,startDragging:C,stopDragging:O,panelGroupElement:T}=E,M=x(o),[k,D]=y("inactive"),[N,L]=y(!1),[I,F]=y(null),_=m({state:k});p(()=>{_.current.state=k}),d(()=>{if(r)F(null);else{let e=j(M);F(()=>e)}},[r,M,j]);let V=null!==(b=null==n?void 0:n.coarse)&&void 0!==b?b:15,z=null!==(w=null==n?void 0:n.fine)&&void 0!==w?w:5;return d(()=>{if(r||null==I)return;let e=S.current;return Q(e,"Element ref not attached"),function(e,t,r,n,o){var i;let{ownerDocument:a}=t,s={direction:r,element:t,hitAreaMargins:n,setResizeHandlerState:o},l=null!==(i=U.get(a))&&void 0!==i?i:0;return U.set(a,l+1),H.add(s),Y(),function(){var t;$.delete(e),H.delete(s);let r=null!==(t=U.get(a))&&void 0!==t?t:1;if(U.set(a,r-1),Y(),1===r&&U.delete(a),B.includes(s)){let e=B.indexOf(s);e>=0&&B.splice(e,1),X()}}}(M,e,A,{coarse:V,fine:z},(e,t,r)=>{if(t)switch(e){case"down":{D("drag"),C(M,r);let{onDragging:e}=P.current;e&&e(!0);break}case"move":{let{state:e}=_.current;"drag"!==e&&D("hover"),I(r);break}case"up":{D("hover"),O();let{onDragging:e}=P.current;e&&e(!1)}}else D("inactive")})},[V,A,r,z,j,M,I,C,O]),!function({disabled:e,handleId:t,resizeHandler:r,panelGroupElement:n}){d(()=>{if(e||null==r||null==n)return;let o=eu(t,n);if(null==o)return;let i=e=>{if(!e.defaultPrevented)switch(e.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":e.preventDefault(),r(e);break;case"F6":{e.preventDefault();let r=o.getAttribute("data-panel-group-id");Q(r,`No group element found for id "${r}"`);let i=ei(r,n),a=ea(r,t,n);Q(null!==a,`No resize element found for id "${t}"`);let s=e.shiftKey?a>0?a-1:i.length-1:a+1{o.removeEventListener("keydown",i)}},[n,e,t,r])}({disabled:r,handleId:M,resizeHandler:I,panelGroupElement:T}),i(h,{...g,children:e,className:t,id:o,onBlur:()=>{L(!1),null==a||a()},onFocus:()=>{L(!0),null==l||l()},ref:S,role:"separator",style:{touchAction:"none",userSelect:"none",...u},tabIndex:f,"data-panel-group-direction":A,"data-panel-group-id":R,"data-resize-handle":"","data-resize-handle-active":"drag"===k?"pointer":N?"keyboard":void 0,"data-resize-handle-state":k,"data-panel-resize-handle-enabled":!r,"data-panel-resize-handle-id":M})}eS.displayName="PanelGroup",eP.displayName="forwardRef(PanelGroup)",eR.displayName="PanelResizeHandle"},49813:function(e,t,r){"use strict";var n=r(77323),o=r(30602),i=r(66626)(),a=r(68136),s=r(31354),l=n("%Math.floor%");e.exports=function(e,t){if("function"!=typeof e)throw new s("`fn` is not a function");if("number"!=typeof t||t<0||t>4294967295||l(t)!==t)throw new s("`length` must be a positive 32-bit integer");var r=arguments.length>2&&!!arguments[2],n=!0,u=!0;if("length"in e&&a){var c=a(e,"length");c&&!c.configurable&&(n=!1),c&&!c.writable&&(u=!1)}return(n||u||!r)&&(i?o(e,"length",t,!0,!0):o(e,"length",t)),e}},16689:function(e,t,r){"use strict";var n=r(77323),o=r(50084),i=r(56919),a=r(31354),s=n("%WeakMap%",!0),l=n("%Map%",!0),u=o("WeakMap.prototype.get",!0),c=o("WeakMap.prototype.set",!0),d=o("WeakMap.prototype.has",!0),f=o("Map.prototype.get",!0),p=o("Map.prototype.set",!0),h=o("Map.prototype.has",!0),m=function(e,t){for(var r,n=e;null!==(r=n.next);n=r)if(r.key===t)return n.next=r.next,r.next=e.next,e.next=r,r},y=function(e,t){var r=m(e,t);return r&&r.value},g=function(e,t,r){var n=m(e,t);n?n.value=r:e.next={key:t,next:e.next,value:r}};e.exports=function(){var e,t,r,n={assert:function(e){if(!n.has(e))throw new a("Side channel does not contain "+i(e))},get:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return u(e,n)}else if(l){if(t)return f(t,n)}else if(r)return y(r,n)},has:function(n){if(s&&n&&("object"==typeof n||"function"==typeof n)){if(e)return d(e,n)}else if(l){if(t)return h(t,n)}else if(r)return!!m(r,n);return!1},set:function(n,o){s&&n&&("object"==typeof n||"function"==typeof n)?(e||(e=new s),c(e,n,o)):l?(t||(t=new l),p(t,n,o)):(r||(r={key:{},next:null}),g(r,n,o))}};return n}},78149:function(e,t,r){"use strict";function n(e,t,{checkForDefaultPrevented:r=!0}={}){return function(n){if(e?.(n),!1===r||!n.defaultPrevented)return t?.(n)}}r.d(t,{M:function(){return n}})},6538:function(e,t,r){"use strict";r.d(t,{aU:function(){return eS},$j:function(){return eP},VY:function(){return ex},dk:function(){return eA},aV:function(){return ew},h_:function(){return eb},fC:function(){return eg},Dx:function(){return eE},xz:function(){return ev}});var n=r(2265),o=r(98324),i=r(1584),a=r(78149),s=r(53201),l=r(91715),u=r(53938),c=r(80467),d=r(56935),f=r(31383),p=r(25171),h=r(20589),m=r(49418),y=r(78369),g=r(71538),v=r(57437),b="Dialog",[w,x]=(0,o.b)(b),[S,P]=w(b),E=e=>{let{__scopeDialog:t,children:r,open:o,defaultOpen:i,onOpenChange:a,modal:u=!0}=e,c=n.useRef(null),d=n.useRef(null),[f=!1,p]=(0,l.T)({prop:o,defaultProp:i,onChange:a});return(0,v.jsx)(S,{scope:t,triggerRef:c,contentRef:d,contentId:(0,s.M)(),titleId:(0,s.M)(),descriptionId:(0,s.M)(),open:f,onOpenChange:p,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),modal:u,children:r})};E.displayName=b;var A="DialogTrigger",R=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,o=P(A,r),s=(0,i.e)(t,o.triggerRef);return(0,v.jsx)(p.WV.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":H(o.open),...n,ref:s,onClick:(0,a.M)(e.onClick,o.onOpenToggle)})});R.displayName=A;var j="DialogPortal",[C,O]=w(j,{forceMount:void 0}),T=e=>{let{__scopeDialog:t,forceMount:r,children:o,container:i}=e,a=P(j,t);return(0,v.jsx)(C,{scope:t,forceMount:r,children:n.Children.map(o,e=>(0,v.jsx)(f.z,{present:r||a.open,children:(0,v.jsx)(d.h,{asChild:!0,container:i,children:e})}))})};T.displayName=j;var M="DialogOverlay",k=n.forwardRef((e,t)=>{let r=O(M,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=P(M,e.__scopeDialog);return i.modal?(0,v.jsx)(f.z,{present:n||i.open,children:(0,v.jsx)(D,{...o,ref:t})}):null});k.displayName=M;var D=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,o=P(M,r);return(0,v.jsx)(m.Z,{as:g.g7,allowPinchZoom:!0,shards:[o.contentRef],children:(0,v.jsx)(p.WV.div,{"data-state":H(o.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),N="DialogContent",L=n.forwardRef((e,t)=>{let r=O(N,e.__scopeDialog),{forceMount:n=r.forceMount,...o}=e,i=P(N,e.__scopeDialog);return(0,v.jsx)(f.z,{present:n||i.open,children:i.modal?(0,v.jsx)(I,{...o,ref:t}):(0,v.jsx)(F,{...o,ref:t})})});L.displayName=N;var I=n.forwardRef((e,t)=>{let r=P(N,e.__scopeDialog),o=n.useRef(null),s=(0,i.e)(t,r.contentRef,o);return n.useEffect(()=>{let e=o.current;if(e)return(0,y.Ry)(e)},[]),(0,v.jsx)(_,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:(0,a.M)(e.onCloseAutoFocus,e=>{var t;e.preventDefault(),null===(t=r.triggerRef.current)||void 0===t||t.focus()}),onPointerDownOutside:(0,a.M)(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey;(2===t.button||r)&&e.preventDefault()}),onFocusOutside:(0,a.M)(e.onFocusOutside,e=>e.preventDefault())})}),F=n.forwardRef((e,t)=>{let r=P(N,e.__scopeDialog),o=n.useRef(!1),i=n.useRef(!1);return(0,v.jsx)(_,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{var n,a;null===(n=e.onCloseAutoFocus)||void 0===n||n.call(e,t),t.defaultPrevented||(o.current||null===(a=r.triggerRef.current)||void 0===a||a.focus(),t.preventDefault()),o.current=!1,i.current=!1},onInteractOutside:t=>{var n,a;null===(n=e.onInteractOutside)||void 0===n||n.call(e,t),t.defaultPrevented||(o.current=!0,"pointerdown"!==t.detail.originalEvent.type||(i.current=!0));let s=t.target;(null===(a=r.triggerRef.current)||void 0===a?void 0:a.contains(s))&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&i.current&&t.preventDefault()}})}),_=n.forwardRef((e,t)=>{let{__scopeDialog:r,trapFocus:o,onOpenAutoFocus:a,onCloseAutoFocus:s,...l}=e,d=P(N,r),f=n.useRef(null),p=(0,i.e)(t,f);return(0,h.EW)(),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(c.M,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:a,onUnmountAutoFocus:s,children:(0,v.jsx)(u.XB,{role:"dialog",id:d.contentId,"aria-describedby":d.descriptionId,"aria-labelledby":d.titleId,"data-state":H(d.open),...l,ref:p,onDismiss:()=>d.onOpenChange(!1)})}),(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(Z,{titleId:d.titleId}),(0,v.jsx)(X,{contentRef:f,descriptionId:d.descriptionId})]})]})}),V="DialogTitle",z=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,o=P(V,r);return(0,v.jsx)(p.WV.h2,{id:o.titleId,...n,ref:t})});z.displayName=V;var B="DialogDescription",W=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,o=P(B,r);return(0,v.jsx)(p.WV.p,{id:o.descriptionId,...n,ref:t})});W.displayName=B;var U="DialogClose",$=n.forwardRef((e,t)=>{let{__scopeDialog:r,...n}=e,o=P(U,r);return(0,v.jsx)(p.WV.button,{type:"button",...n,ref:t,onClick:(0,a.M)(e.onClick,()=>o.onOpenChange(!1))})});function H(e){return e?"open":"closed"}$.displayName=U;var K="DialogTitleWarning",[q,G]=(0,o.k)(K,{contentName:N,titleName:V,docsSlug:"dialog"}),Z=e=>{let{titleId:t}=e,r=G(K),o="`".concat(r.contentName,"` requires a `").concat(r.titleName,"` for the component to be accessible for screen reader users.\n\nIf you want to hide the `").concat(r.titleName,"`, you can wrap it with our VisuallyHidden component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/").concat(r.docsSlug);return n.useEffect(()=>{t&&!document.getElementById(t)&&console.error(o)},[o,t]),null},X=e=>{let{contentRef:t,descriptionId:r}=e,o=G("DialogDescriptionWarning"),i="Warning: Missing `Description` or `aria-describedby={undefined}` for {".concat(o.contentName,"}.");return n.useEffect(()=>{var e;let n=null===(e=t.current)||void 0===e?void 0:e.getAttribute("aria-describedby");r&&n&&!document.getElementById(r)&&console.warn(i)},[i,t,r]),null},Y="AlertDialog",[J,Q]=(0,o.b)(Y,[x]),ee=x(),et=e=>{let{__scopeAlertDialog:t,...r}=e,n=ee(t);return(0,v.jsx)(E,{...n,...r,modal:!0})};et.displayName=Y;var er=n.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,o=ee(r);return(0,v.jsx)(R,{...o,...n,ref:t})});er.displayName="AlertDialogTrigger";var en=e=>{let{__scopeAlertDialog:t,...r}=e,n=ee(t);return(0,v.jsx)(T,{...n,...r})};en.displayName="AlertDialogPortal";var eo=n.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,o=ee(r);return(0,v.jsx)(k,{...o,...n,ref:t})});eo.displayName="AlertDialogOverlay";var ei="AlertDialogContent",[ea,es]=J(ei),el=n.forwardRef((e,t)=>{let{__scopeAlertDialog:r,children:o,...s}=e,l=ee(r),u=n.useRef(null),c=(0,i.e)(t,u),d=n.useRef(null);return(0,v.jsx)(q,{contentName:ei,titleName:eu,docsSlug:"alert-dialog",children:(0,v.jsx)(ea,{scope:r,cancelRef:d,children:(0,v.jsxs)(L,{role:"alertdialog",...l,...s,ref:c,onOpenAutoFocus:(0,a.M)(s.onOpenAutoFocus,e=>{var t;e.preventDefault(),null===(t=d.current)||void 0===t||t.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:[(0,v.jsx)(g.A4,{children:o}),(0,v.jsx)(ey,{contentRef:u})]})})})});el.displayName=ei;var eu="AlertDialogTitle",ec=n.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,o=ee(r);return(0,v.jsx)(z,{...o,...n,ref:t})});ec.displayName=eu;var ed="AlertDialogDescription",ef=n.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,o=ee(r);return(0,v.jsx)(W,{...o,...n,ref:t})});ef.displayName=ed;var ep=n.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,o=ee(r);return(0,v.jsx)($,{...o,...n,ref:t})});ep.displayName="AlertDialogAction";var eh="AlertDialogCancel",em=n.forwardRef((e,t)=>{let{__scopeAlertDialog:r,...n}=e,{cancelRef:o}=es(eh,r),a=ee(r),s=(0,i.e)(t,o);return(0,v.jsx)($,{...a,...n,ref:s})});em.displayName=eh;var ey=e=>{let{contentRef:t}=e,r="`".concat(ei,"` requires a description for the component to be accessible for screen reader users.\n\nYou can add a description to the `").concat(ei,"` by passing a `").concat(ed,"` component as a child, which also benefits sighted users by adding visible context to the dialog.\n\nAlternatively, you can use your own component as a description by assigning it an `id` and passing the same value to the `aria-describedby` prop in `").concat(ei,"`. If the description is confusing or duplicative for sighted users, you can use the `@radix-ui/react-visually-hidden` primitive as a wrapper around your description component.\n\nFor more information, see https://radix-ui.com/primitives/docs/components/alert-dialog");return n.useEffect(()=>{var e;document.getElementById(null===(e=t.current)||void 0===e?void 0:e.getAttribute("aria-describedby"))||console.warn(r)},[r,t]),null},eg=et,ev=er,eb=en,ew=eo,ex=el,eS=ep,eP=em,eE=ec,eA=ef},90976:function(e,t,r){"use strict";r.d(t,{B:function(){return l}});var n=r(2265),o=r(98324),i=r(1584),a=r(71538),s=r(57437);function l(e){let t=e+"CollectionProvider",[r,l]=(0,o.b)(t),[u,c]=r(t,{collectionRef:{current:null},itemMap:new Map}),d=e=>{let{scope:t,children:r}=e,o=n.useRef(null),i=n.useRef(new Map).current;return(0,s.jsx)(u,{scope:t,itemMap:i,collectionRef:o,children:r})};d.displayName=t;let f=e+"CollectionSlot",p=n.forwardRef((e,t)=>{let{scope:r,children:n}=e,o=c(f,r),l=(0,i.e)(t,o.collectionRef);return(0,s.jsx)(a.g7,{ref:l,children:n})});p.displayName=f;let h=e+"CollectionItemSlot",m="data-radix-collection-item",y=n.forwardRef((e,t)=>{let{scope:r,children:o,...l}=e,u=n.useRef(null),d=(0,i.e)(t,u),f=c(h,r);return n.useEffect(()=>(f.itemMap.set(u,{ref:u,...l}),()=>void f.itemMap.delete(u))),(0,s.jsx)(a.g7,{[m]:"",ref:d,children:o})});return y.displayName=h,[{Provider:d,Slot:p,ItemSlot:y},function(t){let r=c(e+"CollectionConsumer",t);return n.useCallback(()=>{let e=r.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll("[".concat(m,"]")));return Array.from(r.itemMap.values()).sort((e,r)=>t.indexOf(e.ref.current)-t.indexOf(r.ref.current))},[r.collectionRef,r.itemMap])},l]}},1584:function(e,t,r){"use strict";r.d(t,{F:function(){return o},e:function(){return i}});var n=r(2265);function o(...e){return t=>e.forEach(e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)})}function i(...e){return n.useCallback(o(...e),e)}},98324:function(e,t,r){"use strict";r.d(t,{b:function(){return a},k:function(){return i}});var n=r(2265),o=r(57437);function i(e,t){let r=n.createContext(t);function i(e){let{children:t,...i}=e,a=n.useMemo(()=>i,Object.values(i));return(0,o.jsx)(r.Provider,{value:a,children:t})}return i.displayName=e+"Provider",[i,function(o){let i=n.useContext(r);if(i)return i;if(void 0!==t)return t;throw Error(`\`${o}\` must be used within \`${e}\``)}]}function a(e,t=[]){let r=[],i=()=>{let t=r.map(e=>n.createContext(e));return function(r){let o=r?.[e]||t;return n.useMemo(()=>({[`__scope${e}`]:{...r,[e]:o}}),[r,o])}};return i.scopeName=e,[function(t,i){let a=n.createContext(i),s=r.length;function l(t){let{scope:r,children:i,...l}=t,u=r?.[e][s]||a,c=n.useMemo(()=>l,Object.values(l));return(0,o.jsx)(u.Provider,{value:c,children:i})}return r=[...r,i],l.displayName=t+"Provider",[l,function(r,o){let l=o?.[e][s]||a,u=n.useContext(l);if(u)return u;if(void 0!==i)return i;throw Error(`\`${r}\` must be used within \`${t}\``)}]},function(...e){let t=e[0];if(1===e.length)return t;let r=()=>{let r=e.map(e=>({useScope:e(),scopeName:e.scopeName}));return function(e){let o=r.reduce((t,{useScope:r,scopeName:n})=>{let o=r(e)[`__scope${n}`];return{...t,...o}},{});return n.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}(i,...t)]}},87513:function(e,t,r){"use strict";r.d(t,{gm:function(){return i}});var n=r(2265);r(57437);var o=n.createContext(void 0);function i(e){let t=n.useContext(o);return e||t||"ltr"}},53938:function(e,t,r){"use strict";r.d(t,{XB:function(){return f}});var n,o=r(2265),i=r(78149),a=r(25171),s=r(1584),l=r(75137),u=r(57437),c="dismissableLayer.update",d=o.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),f=o.forwardRef((e,t)=>{var r,f;let{disableOutsidePointerEvents:m=!1,onEscapeKeyDown:y,onPointerDownOutside:g,onFocusOutside:v,onInteractOutside:b,onDismiss:w,...x}=e,S=o.useContext(d),[P,E]=o.useState(null),A=null!==(f=null==P?void 0:P.ownerDocument)&&void 0!==f?f:null===(r=globalThis)||void 0===r?void 0:r.document,[,R]=o.useState({}),j=(0,s.e)(t,e=>E(e)),C=Array.from(S.layers),[O]=[...S.layersWithOutsidePointerEventsDisabled].slice(-1),T=C.indexOf(O),M=P?C.indexOf(P):-1,k=S.layersWithOutsidePointerEventsDisabled.size>0,D=M>=T,N=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=(0,l.W)(e),i=o.useRef(!1),a=o.useRef(()=>{});return o.useEffect(()=>{let e=e=>{if(e.target&&!i.current){let t=function(){h("dismissableLayer.pointerDownOutside",n,o,{discrete:!0})},o={originalEvent:e};"touch"===e.pointerType?(r.removeEventListener("click",a.current),a.current=t,r.addEventListener("click",a.current,{once:!0})):t()}else r.removeEventListener("click",a.current);i.current=!1},t=window.setTimeout(()=>{r.addEventListener("pointerdown",e)},0);return()=>{window.clearTimeout(t),r.removeEventListener("pointerdown",e),r.removeEventListener("click",a.current)}},[r,n]),{onPointerDownCapture:()=>i.current=!0}}(e=>{let t=e.target,r=[...S.branches].some(e=>e.contains(t));!D||r||(null==g||g(e),null==b||b(e),e.defaultPrevented||null==w||w())},A),L=function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null===(t=globalThis)||void 0===t?void 0:t.document,n=(0,l.W)(e),i=o.useRef(!1);return o.useEffect(()=>{let e=e=>{e.target&&!i.current&&h("dismissableLayer.focusOutside",n,{originalEvent:e},{discrete:!1})};return r.addEventListener("focusin",e),()=>r.removeEventListener("focusin",e)},[r,n]),{onFocusCapture:()=>i.current=!0,onBlurCapture:()=>i.current=!1}}(e=>{let t=e.target;[...S.branches].some(e=>e.contains(t))||(null==v||v(e),null==b||b(e),e.defaultPrevented||null==w||w())},A);return!function(e,t=globalThis?.document){let r=(0,l.W)(e);o.useEffect(()=>{let e=e=>{"Escape"===e.key&&r(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})},[r,t])}(e=>{M!==S.layers.size-1||(null==y||y(e),!e.defaultPrevented&&w&&(e.preventDefault(),w()))},A),o.useEffect(()=>{if(P)return m&&(0===S.layersWithOutsidePointerEventsDisabled.size&&(n=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),S.layersWithOutsidePointerEventsDisabled.add(P)),S.layers.add(P),p(),()=>{m&&1===S.layersWithOutsidePointerEventsDisabled.size&&(A.body.style.pointerEvents=n)}},[P,A,m,S]),o.useEffect(()=>()=>{P&&(S.layers.delete(P),S.layersWithOutsidePointerEventsDisabled.delete(P),p())},[P,S]),o.useEffect(()=>{let e=()=>R({});return document.addEventListener(c,e),()=>document.removeEventListener(c,e)},[]),(0,u.jsx)(a.WV.div,{...x,ref:j,style:{pointerEvents:k?D?"auto":"none":void 0,...e.style},onFocusCapture:(0,i.M)(e.onFocusCapture,L.onFocusCapture),onBlurCapture:(0,i.M)(e.onBlurCapture,L.onBlurCapture),onPointerDownCapture:(0,i.M)(e.onPointerDownCapture,N.onPointerDownCapture)})});function p(){let e=new CustomEvent(c);document.dispatchEvent(e)}function h(e,t,r,n){let{discrete:o}=n,i=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&i.addEventListener(e,t,{once:!0}),o?(0,a.jH)(i,s):i.dispatchEvent(s)}f.displayName="DismissableLayer",o.forwardRef((e,t)=>{let r=o.useContext(d),n=o.useRef(null),i=(0,s.e)(t,n);return o.useEffect(()=>{let e=n.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}},[r.branches]),(0,u.jsx)(a.WV.div,{...e,ref:i})}).displayName="DismissableLayerBranch"},21246:function(e,t,r){"use strict";r.d(t,{oC:function(){return rI},VY:function(){return rk},ZA:function(){return rD},ck:function(){return rL},wU:function(){return rV},__:function(){return rN},Uv:function(){return rM},Ee:function(){return rF},Rk:function(){return r_},fC:function(){return rO},Z0:function(){return rz},Tr:function(){return rB},tu:function(){return rU},fF:function(){return rW},xz:function(){return rT}});var n=r(2265),o=r(78149),i=r(1584),a=r(98324),s=r(91715),l=r(25171),u=r(90976),c=r(87513),d=r(53938),f=r(20589),p=r(80467),h=r(53201);let m=["top","right","bottom","left"],y=Math.min,g=Math.max,v=Math.round,b=Math.floor,w=e=>({x:e,y:e}),x={left:"right",right:"left",bottom:"top",top:"bottom"},S={start:"end",end:"start"};function P(e,t){return"function"==typeof e?e(t):e}function E(e){return e.split("-")[0]}function A(e){return e.split("-")[1]}function R(e){return"x"===e?"y":"x"}function j(e){return"y"===e?"height":"width"}function C(e){return["top","bottom"].includes(E(e))?"y":"x"}function O(e){return e.replace(/start|end/g,e=>S[e])}function T(e){return e.replace(/left|right|bottom|top/g,e=>x[e])}function M(e){return"number"!=typeof e?{top:0,right:0,bottom:0,left:0,...e}:{top:e,right:e,bottom:e,left:e}}function k(e){let{x:t,y:r,width:n,height:o}=e;return{width:n,height:o,top:r,left:t,right:t+n,bottom:r+o,x:t,y:r}}function D(e,t,r){let n,{reference:o,floating:i}=e,a=C(t),s=R(C(t)),l=j(s),u=E(t),c="y"===a,d=o.x+o.width/2-i.width/2,f=o.y+o.height/2-i.height/2,p=o[l]/2-i[l]/2;switch(u){case"top":n={x:d,y:o.y-i.height};break;case"bottom":n={x:d,y:o.y+o.height};break;case"right":n={x:o.x+o.width,y:f};break;case"left":n={x:o.x-i.width,y:f};break;default:n={x:o.x,y:o.y}}switch(A(t)){case"start":n[s]-=p*(r&&c?-1:1);break;case"end":n[s]+=p*(r&&c?-1:1)}return n}let N=async(e,t,r)=>{let{placement:n="bottom",strategy:o="absolute",middleware:i=[],platform:a}=r,s=i.filter(Boolean),l=await (null==a.isRTL?void 0:a.isRTL(t)),u=await a.getElementRects({reference:e,floating:t,strategy:o}),{x:c,y:d}=D(u,n,l),f=n,p={},h=0;for(let r=0;re[t]>=0)}async function _(e,t){let{placement:r,platform:n,elements:o}=e,i=await (null==n.isRTL?void 0:n.isRTL(o.floating)),a=E(r),s=A(r),l="y"===C(r),u=["left","top"].includes(a)?-1:1,c=i&&l?-1:1,d=P(t,e),{mainAxis:f,crossAxis:p,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof h&&(p="end"===s?-1*h:h),l?{x:p*c,y:f*u}:{x:f*u,y:p*c}}function V(e){return W(e)?(e.nodeName||"").toLowerCase():"#document"}function z(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function B(e){var t;return null==(t=(W(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function W(e){return e instanceof Node||e instanceof z(e).Node}function U(e){return e instanceof Element||e instanceof z(e).Element}function $(e){return e instanceof HTMLElement||e instanceof z(e).HTMLElement}function H(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof z(e).ShadowRoot)}function K(e){let{overflow:t,overflowX:r,overflowY:n,display:o}=Y(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!["inline","contents"].includes(o)}function q(e){return[":popover-open",":modal"].some(t=>{try{return e.matches(t)}catch(e){return!1}})}function G(e){let t=Z(),r=U(e)?Y(e):e;return"none"!==r.transform||"none"!==r.perspective||!!r.containerType&&"normal"!==r.containerType||!t&&!!r.backdropFilter&&"none"!==r.backdropFilter||!t&&!!r.filter&&"none"!==r.filter||["transform","perspective","filter"].some(e=>(r.willChange||"").includes(e))||["paint","layout","strict","content"].some(e=>(r.contain||"").includes(e))}function Z(){return"undefined"!=typeof CSS&&!!CSS.supports&&CSS.supports("-webkit-backdrop-filter","none")}function X(e){return["html","body","#document"].includes(V(e))}function Y(e){return z(e).getComputedStyle(e)}function J(e){return U(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function Q(e){if("html"===V(e))return e;let t=e.assignedSlot||e.parentNode||H(e)&&e.host||B(e);return H(t)?t.host:t}function ee(e,t,r){var n;void 0===t&&(t=[]),void 0===r&&(r=!0);let o=function e(t){let r=Q(t);return X(r)?t.ownerDocument?t.ownerDocument.body:t.body:$(r)&&K(r)?r:e(r)}(e),i=o===(null==(n=e.ownerDocument)?void 0:n.body),a=z(o);return i?t.concat(a,a.visualViewport||[],K(o)?o:[],a.frameElement&&r?ee(a.frameElement):[]):t.concat(o,ee(o,[],r))}function et(e){let t=Y(e),r=parseFloat(t.width)||0,n=parseFloat(t.height)||0,o=$(e),i=o?e.offsetWidth:r,a=o?e.offsetHeight:n,s=v(r)!==i||v(n)!==a;return s&&(r=i,n=a),{width:r,height:n,$:s}}function er(e){return U(e)?e:e.contextElement}function en(e){let t=er(e);if(!$(t))return w(1);let r=t.getBoundingClientRect(),{width:n,height:o,$:i}=et(t),a=(i?v(r.width):r.width)/n,s=(i?v(r.height):r.height)/o;return a&&Number.isFinite(a)||(a=1),s&&Number.isFinite(s)||(s=1),{x:a,y:s}}let eo=w(0);function ei(e){let t=z(e);return Z()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:eo}function ea(e,t,r,n){var o;void 0===t&&(t=!1),void 0===r&&(r=!1);let i=e.getBoundingClientRect(),a=er(e),s=w(1);t&&(n?U(n)&&(s=en(n)):s=en(e));let l=(void 0===(o=r)&&(o=!1),n&&(!o||n===z(a))&&o)?ei(a):w(0),u=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,d=i.width/s.x,f=i.height/s.y;if(a){let e=z(a),t=n&&U(n)?z(n):n,r=e,o=r.frameElement;for(;o&&n&&t!==r;){let e=en(o),t=o.getBoundingClientRect(),n=Y(o),i=t.left+(o.clientLeft+parseFloat(n.paddingLeft))*e.x,a=t.top+(o.clientTop+parseFloat(n.paddingTop))*e.y;u*=e.x,c*=e.y,d*=e.x,f*=e.y,u+=i,c+=a,o=(r=z(o)).frameElement}}return k({width:d,height:f,x:u,y:c})}function es(e){return ea(B(e)).left+J(e).scrollLeft}function el(e,t,r){let n;if("viewport"===t)n=function(e,t){let r=z(e),n=B(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;let e=Z();(!e||e&&"fixed"===t)&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s,y:l}}(e,r);else if("document"===t)n=function(e){let t=B(e),r=J(e),n=e.ownerDocument.body,o=g(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=g(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight),a=-r.scrollLeft+es(e),s=-r.scrollTop;return"rtl"===Y(n).direction&&(a+=g(t.clientWidth,n.clientWidth)-o),{width:o,height:i,x:a,y:s}}(B(e));else if(U(t))n=function(e,t){let r=ea(e,!0,"fixed"===t),n=r.top+e.clientTop,o=r.left+e.clientLeft,i=$(e)?en(e):w(1),a=e.clientWidth*i.x;return{width:a,height:e.clientHeight*i.y,x:o*i.x,y:n*i.y}}(t,r);else{let r=ei(e);n={...t,x:t.x-r.x,y:t.y-r.y}}return k(n)}function eu(e){return"static"===Y(e).position}function ec(e,t){return $(e)&&"fixed"!==Y(e).position?t?t(e):e.offsetParent:null}function ed(e,t){let r=z(e);if(q(e))return r;if(!$(e)){let t=Q(e);for(;t&&!X(t);){if(U(t)&&!eu(t))return t;t=Q(t)}return r}let n=ec(e,t);for(;n&&["table","td","th"].includes(V(n))&&eu(n);)n=ec(n,t);return n&&X(n)&&eu(n)&&!G(n)?r:n||function(e){let t=Q(e);for(;$(t)&&!X(t);){if(G(t))return t;if(q(t))break;t=Q(t)}return null}(e)||r}let ef=async function(e){let t=this.getOffsetParent||ed,r=this.getDimensions,n=await r(e.floating);return{reference:function(e,t,r){let n=$(t),o=B(t),i="fixed"===r,a=ea(e,!0,i,t),s={scrollLeft:0,scrollTop:0},l=w(0);if(n||!n&&!i){if(("body"!==V(t)||K(o))&&(s=J(t)),n){let e=ea(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=es(o))}return{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}},ep={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:r,offsetParent:n,strategy:o}=e,i="fixed"===o,a=B(n),s=!!t&&q(t.floating);if(n===a||s&&i)return r;let l={scrollLeft:0,scrollTop:0},u=w(1),c=w(0),d=$(n);if((d||!d&&!i)&&(("body"!==V(n)||K(a))&&(l=J(n)),$(n))){let e=ea(n);u=en(n),c.x=e.x+n.clientLeft,c.y=e.y+n.clientTop}return{width:r.width*u.x,height:r.height*u.y,x:r.x*u.x-l.scrollLeft*u.x+c.x,y:r.y*u.y-l.scrollTop*u.y+c.y}},getDocumentElement:B,getClippingRect:function(e){let{element:t,boundary:r,rootBoundary:n,strategy:o}=e,i=[..."clippingAncestors"===r?q(t)?[]:function(e,t){let r=t.get(e);if(r)return r;let n=ee(e,[],!1).filter(e=>U(e)&&"body"!==V(e)),o=null,i="fixed"===Y(e).position,a=i?Q(e):e;for(;U(a)&&!X(a);){let t=Y(a),r=G(a);r||"fixed"!==t.position||(o=null),(i?!r&&!o:!r&&"static"===t.position&&!!o&&["absolute","fixed"].includes(o.position)||K(a)&&!r&&function e(t,r){let n=Q(t);return!(n===r||!U(n)||X(n))&&("fixed"===Y(n).position||e(n,r))}(e,a))?n=n.filter(e=>e!==a):o=t,a=Q(a)}return t.set(e,n),n}(t,this._c):[].concat(r),n],a=i[0],s=i.reduce((e,r)=>{let n=el(t,r,o);return e.top=g(n.top,e.top),e.right=y(n.right,e.right),e.bottom=y(n.bottom,e.bottom),e.left=g(n.left,e.left),e},el(t,a,o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:ed,getElementRects:ef,getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){let{width:t,height:r}=et(e);return{width:t,height:r}},getScale:en,isElement:U,isRTL:function(e){return"rtl"===Y(e).direction}},eh=e=>({name:"arrow",options:e,async fn(t){let{x:r,y:n,placement:o,rects:i,platform:a,elements:s,middlewareData:l}=t,{element:u,padding:c=0}=P(e,t)||{};if(null==u)return{};let d=M(c),f={x:r,y:n},p=R(C(o)),h=j(p),m=await a.getDimensions(u),v="y"===p,b=v?"clientHeight":"clientWidth",w=i.reference[h]+i.reference[p]-f[p]-i.floating[h],x=f[p]-i.reference[p],S=await (null==a.getOffsetParent?void 0:a.getOffsetParent(u)),E=S?S[b]:0;E&&await (null==a.isElement?void 0:a.isElement(S))||(E=s.floating[b]||i.floating[h]);let O=E/2-m[h]/2-1,T=y(d[v?"top":"left"],O),k=y(d[v?"bottom":"right"],O),D=E-m[h]-k,N=E/2-m[h]/2+(w/2-x/2),L=g(T,y(N,D)),I=!l.arrow&&null!=A(o)&&N!==L&&i.reference[h]/2-(N{let n=new Map,o={platform:ep,...r},i={...o.platform,_c:n};return N(e,t,{...o,platform:i})};var ey=r(54887),eg="undefined"!=typeof document?n.useLayoutEffect:n.useEffect;function ev(e,t){let r,n,o;if(e===t)return!0;if(typeof e!=typeof t)return!1;if("function"==typeof e&&e.toString()===t.toString())return!0;if(e&&t&&"object"==typeof e){if(Array.isArray(e)){if((r=e.length)!==t.length)return!1;for(n=r;0!=n--;)if(!ev(e[n],t[n]))return!1;return!0}if((r=(o=Object.keys(e)).length)!==Object.keys(t).length)return!1;for(n=r;0!=n--;)if(!({}).hasOwnProperty.call(t,o[n]))return!1;for(n=r;0!=n--;){let r=o[n];if(("_owner"!==r||!e.$$typeof)&&!ev(e[r],t[r]))return!1}return!0}return e!=e&&t!=t}function eb(e){return"undefined"==typeof window?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ew(e,t){let r=eb(e);return Math.round(t*r)/r}function ex(e){let t=n.useRef(e);return eg(()=>{t.current=e}),t}let eS=e=>({name:"arrow",options:e,fn(t){let{element:r,padding:n}="function"==typeof e?e(t):e;return r&&({}).hasOwnProperty.call(r,"current")?null!=r.current?eh({element:r.current,padding:n}).fn(t):{}:r?eh({element:r,padding:n}).fn(t):{}}}),eP=(e,t)=>{var r;return{...(void 0===(r=e)&&(r=0),{name:"offset",options:r,async fn(e){var t,n;let{x:o,y:i,placement:a,middlewareData:s}=e,l=await _(e,r);return a===(null==(t=s.offset)?void 0:t.placement)&&null!=(n=s.arrow)&&n.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:a}}}}),options:[e,t]}},eE=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"shift",options:r,async fn(e){let{x:t,y:n,placement:o}=e,{mainAxis:i=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:r}=e;return{x:t,y:r}}},...l}=P(r,e),u={x:t,y:n},c=await L(e,l),d=C(E(o)),f=R(d),p=u[f],h=u[d];if(i){let e="y"===f?"top":"left",t="y"===f?"bottom":"right",r=p+c[e],n=p-c[t];p=g(r,y(p,n))}if(a){let e="y"===d?"top":"left",t="y"===d?"bottom":"right",r=h+c[e],n=h-c[t];h=g(r,y(h,n))}let m=s.fn({...e,[f]:p,[d]:h});return{...m,data:{x:m.x-t,y:m.y-n}}}}),options:[e,t]}},eA=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{options:r,fn(e){let{x:t,y:n,placement:o,rects:i,middlewareData:a}=e,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=P(r,e),c={x:t,y:n},d=C(o),f=R(d),p=c[f],h=c[d],m=P(s,e),y="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let e="y"===f?"height":"width",t=i.reference[f]-i.floating[e]+y.mainAxis,r=i.reference[f]+i.reference[e]-y.mainAxis;pr&&(p=r)}if(u){var g,v;let e="y"===f?"width":"height",t=["top","left"].includes(E(o)),r=i.reference[d]-i.floating[e]+(t&&(null==(g=a.offset)?void 0:g[d])||0)+(t?0:y.crossAxis),n=i.reference[d]+i.reference[e]+(t?0:(null==(v=a.offset)?void 0:v[d])||0)-(t?y.crossAxis:0);hn&&(h=n)}return{[f]:p,[d]:h}}}),options:[e,t]}},eR=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"flip",options:r,async fn(e){var t,n,o,i,a;let{placement:s,middlewareData:l,rects:u,initialPlacement:c,platform:d,elements:f}=e,{mainAxis:p=!0,crossAxis:h=!0,fallbackPlacements:m,fallbackStrategy:y="bestFit",fallbackAxisSideDirection:g="none",flipAlignment:v=!0,...b}=P(r,e);if(null!=(t=l.arrow)&&t.alignmentOffset)return{};let w=E(s),x=C(c),S=E(c)===c,M=await (null==d.isRTL?void 0:d.isRTL(f.floating)),k=m||(S||!v?[T(c)]:function(e){let t=T(e);return[O(e),t,O(t)]}(c)),D="none"!==g;!m&&D&&k.push(...function(e,t,r,n){let o=A(e),i=function(e,t,r){let n=["left","right"],o=["right","left"];switch(e){case"top":case"bottom":if(r)return t?o:n;return t?n:o;case"left":case"right":return t?["top","bottom"]:["bottom","top"];default:return[]}}(E(e),"start"===r,n);return o&&(i=i.map(e=>e+"-"+o),t&&(i=i.concat(i.map(O)))),i}(c,v,g,M));let N=[c,...k],I=await L(e,b),F=[],_=(null==(n=l.flip)?void 0:n.overflows)||[];if(p&&F.push(I[w]),h){let e=function(e,t,r){void 0===r&&(r=!1);let n=A(e),o=R(C(e)),i=j(o),a="x"===o?n===(r?"end":"start")?"right":"left":"start"===n?"bottom":"top";return t.reference[i]>t.floating[i]&&(a=T(a)),[a,T(a)]}(s,u,M);F.push(I[e[0]],I[e[1]])}if(_=[..._,{placement:s,overflows:F}],!F.every(e=>e<=0)){let e=((null==(o=l.flip)?void 0:o.index)||0)+1,t=N[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let r=null==(i=_.filter(e=>e.overflows[0]<=0).sort((e,t)=>e.overflows[1]-t.overflows[1])[0])?void 0:i.placement;if(!r)switch(y){case"bestFit":{let e=null==(a=_.filter(e=>{if(D){let t=C(e.placement);return t===x||"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:a[0];e&&(r=e);break}case"initialPlacement":r=c}if(s!==r)return{reset:{placement:r}}}return{}}}),options:[e,t]}},ej=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"size",options:r,async fn(e){let t,n;let{placement:o,rects:i,platform:a,elements:s}=e,{apply:l=()=>{},...u}=P(r,e),c=await L(e,u),d=E(o),f=A(o),p="y"===C(o),{width:h,height:m}=i.floating;"top"===d||"bottom"===d?(t=d,n=f===(await (null==a.isRTL?void 0:a.isRTL(s.floating))?"start":"end")?"left":"right"):(n=d,t="end"===f?"top":"bottom");let v=m-c.top-c.bottom,b=h-c.left-c.right,w=y(m-c[t],v),x=y(h-c[n],b),S=!e.middlewareData.shift,R=w,j=x;if(p?j=f||S?y(x,b):b:R=f||S?y(w,v):v,S&&!f){let e=g(c.left,0),t=g(c.right,0),r=g(c.top,0),n=g(c.bottom,0);p?j=h-2*(0!==e||0!==t?e+t:g(c.left,c.right)):R=m-2*(0!==r||0!==n?r+n:g(c.top,c.bottom))}await l({...e,availableWidth:j,availableHeight:R});let O=await a.getDimensions(s.floating);return h!==O.width||m!==O.height?{reset:{rects:!0}}:{}}}),options:[e,t]}},eC=(e,t)=>{var r;return{...(void 0===(r=e)&&(r={}),{name:"hide",options:r,async fn(e){let{rects:t}=e,{strategy:n="referenceHidden",...o}=P(r,e);switch(n){case"referenceHidden":{let r=I(await L(e,{...o,elementContext:"reference"}),t.reference);return{data:{referenceHiddenOffsets:r,referenceHidden:F(r)}}}case"escaped":{let r=I(await L(e,{...o,altBoundary:!0}),t.floating);return{data:{escapedOffsets:r,escaped:F(r)}}}default:return{}}}}),options:[e,t]}},eO=(e,t)=>({...eS(e),options:[e,t]});var eT=r(57437),eM=n.forwardRef((e,t)=>{let{children:r,width:n=10,height:o=5,...i}=e;return(0,eT.jsx)(l.WV.svg,{...i,ref:t,width:n,height:o,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:(0,eT.jsx)("polygon",{points:"0,0 30,0 15,10"})})});eM.displayName="Arrow";var ek=r(75137),eD=r(1336),eN=r(75238),eL="Popper",[eI,eF]=(0,a.b)(eL),[e_,eV]=eI(eL),ez=e=>{let{__scopePopper:t,children:r}=e,[o,i]=n.useState(null);return(0,eT.jsx)(e_,{scope:t,anchor:o,onAnchorChange:i,children:r})};ez.displayName=eL;var eB="PopperAnchor",eW=n.forwardRef((e,t)=>{let{__scopePopper:r,virtualRef:o,...a}=e,s=eV(eB,r),u=n.useRef(null),c=(0,i.e)(t,u);return n.useEffect(()=>{s.onAnchorChange((null==o?void 0:o.current)||u.current)}),o?null:(0,eT.jsx)(l.WV.div,{...a,ref:c})});eW.displayName=eB;var eU="PopperContent",[e$,eH]=eI(eU),eK=n.forwardRef((e,t)=>{var r,o,a,s,u,c,d,f;let{__scopePopper:p,side:h="bottom",sideOffset:m=0,align:v="center",alignOffset:w=0,arrowPadding:x=0,avoidCollisions:S=!0,collisionBoundary:P=[],collisionPadding:E=0,sticky:A="partial",hideWhenDetached:R=!1,updatePositionStrategy:j="optimized",onPlaced:C,...O}=e,T=eV(eU,p),[M,k]=n.useState(null),D=(0,i.e)(t,e=>k(e)),[N,L]=n.useState(null),I=(0,eN.t)(N),F=null!==(d=null==I?void 0:I.width)&&void 0!==d?d:0,_=null!==(f=null==I?void 0:I.height)&&void 0!==f?f:0,V="number"==typeof E?E:{top:0,right:0,bottom:0,left:0,...E},z=Array.isArray(P)?P:[P],W=z.length>0,U={padding:V,boundary:z.filter(eX),altBoundary:W},{refs:$,floatingStyles:H,placement:K,isPositioned:q,middlewareData:G}=function(e){void 0===e&&(e={});let{placement:t="bottom",strategy:r="absolute",middleware:o=[],platform:i,elements:{reference:a,floating:s}={},transform:l=!0,whileElementsMounted:u,open:c}=e,[d,f]=n.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=n.useState(o);ev(p,o)||h(o);let[m,y]=n.useState(null),[g,v]=n.useState(null),b=n.useCallback(e=>{e!==P.current&&(P.current=e,y(e))},[]),w=n.useCallback(e=>{e!==E.current&&(E.current=e,v(e))},[]),x=a||m,S=s||g,P=n.useRef(null),E=n.useRef(null),A=n.useRef(d),R=null!=u,j=ex(u),C=ex(i),O=n.useCallback(()=>{if(!P.current||!E.current)return;let e={placement:t,strategy:r,middleware:p};C.current&&(e.platform=C.current),em(P.current,E.current,e).then(e=>{let t={...e,isPositioned:!0};T.current&&!ev(A.current,t)&&(A.current=t,ey.flushSync(()=>{f(t)}))})},[p,t,r,C]);eg(()=>{!1===c&&A.current.isPositioned&&(A.current.isPositioned=!1,f(e=>({...e,isPositioned:!1})))},[c]);let T=n.useRef(!1);eg(()=>(T.current=!0,()=>{T.current=!1}),[]),eg(()=>{if(x&&(P.current=x),S&&(E.current=S),x&&S){if(j.current)return j.current(x,S,O);O()}},[x,S,O,j,R]);let M=n.useMemo(()=>({reference:P,floating:E,setReference:b,setFloating:w}),[b,w]),k=n.useMemo(()=>({reference:x,floating:S}),[x,S]),D=n.useMemo(()=>{let e={position:r,left:0,top:0};if(!k.floating)return e;let t=ew(k.floating,d.x),n=ew(k.floating,d.y);return l?{...e,transform:"translate("+t+"px, "+n+"px)",...eb(k.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:t,top:n}},[r,l,k.floating,d.x,d.y]);return n.useMemo(()=>({...d,update:O,refs:M,elements:k,floatingStyles:D}),[d,O,M,k,D])}({strategy:"fixed",placement:h+("center"!==v?"-"+v:""),whileElementsMounted:function(){for(var e=arguments.length,t=Array(e),r=0;r{i&&e.addEventListener("scroll",r,{passive:!0}),a&&e.addEventListener("resize",r)});let f=c&&l?function(e,t){let r,n=null,o=B(e);function i(){var e;clearTimeout(r),null==(e=n)||e.disconnect(),n=null}return!function a(s,l){void 0===s&&(s=!1),void 0===l&&(l=1),i();let{left:u,top:c,width:d,height:f}=e.getBoundingClientRect();if(s||t(),!d||!f)return;let p=b(c),h=b(o.clientWidth-(u+d)),m={rootMargin:-p+"px "+-h+"px "+-b(o.clientHeight-(c+f))+"px "+-b(u)+"px",threshold:g(0,y(1,l))||1},v=!0;function w(e){let t=e[0].intersectionRatio;if(t!==l){if(!v)return a();t?a(!1,t):r=setTimeout(()=>{a(!1,1e-7)},1e3)}v=!1}try{n=new IntersectionObserver(w,{...m,root:o.ownerDocument})}catch(e){n=new IntersectionObserver(w,m)}n.observe(e)}(!0),i}(c,r):null,p=-1,h=null;s&&(h=new ResizeObserver(e=>{let[n]=e;n&&n.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var e;null==(e=h)||e.observe(t)})),r()}),c&&!u&&h.observe(c),h.observe(t));let m=u?ea(e):null;return u&&function t(){let n=ea(e);m&&(n.x!==m.x||n.y!==m.y||n.width!==m.width||n.height!==m.height)&&r(),m=n,o=requestAnimationFrame(t)}(),r(),()=>{var e;d.forEach(e=>{i&&e.removeEventListener("scroll",r),a&&e.removeEventListener("resize",r)}),null==f||f(),null==(e=h)||e.disconnect(),h=null,u&&cancelAnimationFrame(o)}}(...t,{animationFrame:"always"===j})},elements:{reference:T.anchor},middleware:[eP({mainAxis:m+_,alignmentAxis:w}),S&&eE({mainAxis:!0,crossAxis:!1,limiter:"partial"===A?eA():void 0,...U}),S&&eR({...U}),ej({...U,apply:e=>{let{elements:t,rects:r,availableWidth:n,availableHeight:o}=e,{width:i,height:a}=r.reference,s=t.floating.style;s.setProperty("--radix-popper-available-width","".concat(n,"px")),s.setProperty("--radix-popper-available-height","".concat(o,"px")),s.setProperty("--radix-popper-anchor-width","".concat(i,"px")),s.setProperty("--radix-popper-anchor-height","".concat(a,"px"))}}),N&&eO({element:N,padding:x}),eY({arrowWidth:F,arrowHeight:_}),R&&eC({strategy:"referenceHidden",...U})]}),[Z,X]=eJ(K),Y=(0,ek.W)(C);(0,eD.b)(()=>{q&&(null==Y||Y())},[q,Y]);let J=null===(r=G.arrow)||void 0===r?void 0:r.x,Q=null===(o=G.arrow)||void 0===o?void 0:o.y,et=(null===(a=G.arrow)||void 0===a?void 0:a.centerOffset)!==0,[en,eo]=n.useState();return(0,eD.b)(()=>{M&&eo(window.getComputedStyle(M).zIndex)},[M]),(0,eT.jsx)("div",{ref:$.setFloating,"data-radix-popper-content-wrapper":"",style:{...H,transform:q?H.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:en,"--radix-popper-transform-origin":[null===(s=G.transformOrigin)||void 0===s?void 0:s.x,null===(u=G.transformOrigin)||void 0===u?void 0:u.y].join(" "),...(null===(c=G.hide)||void 0===c?void 0:c.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:(0,eT.jsx)(e$,{scope:p,placedSide:Z,onArrowChange:L,arrowX:J,arrowY:Q,shouldHideArrow:et,children:(0,eT.jsx)(l.WV.div,{"data-side":Z,"data-align":X,...O,ref:D,style:{...O.style,animation:q?void 0:"none"}})})})});eK.displayName=eU;var eq="PopperArrow",eG={top:"bottom",right:"left",bottom:"top",left:"right"},eZ=n.forwardRef(function(e,t){let{__scopePopper:r,...n}=e,o=eH(eq,r),i=eG[o.placedSide];return(0,eT.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:(0,eT.jsx)(eM,{...n,ref:t,style:{...n.style,display:"block"}})})});function eX(e){return null!==e}eZ.displayName=eq;var eY=e=>({name:"transformOrigin",options:e,fn(t){var r,n,o,i,a;let{placement:s,rects:l,middlewareData:u}=t,c=(null===(r=u.arrow)||void 0===r?void 0:r.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[p,h]=eJ(s),m={start:"0%",center:"50%",end:"100%"}[h],y=(null!==(i=null===(n=u.arrow)||void 0===n?void 0:n.x)&&void 0!==i?i:0)+d/2,g=(null!==(a=null===(o=u.arrow)||void 0===o?void 0:o.y)&&void 0!==a?a:0)+f/2,v="",b="";return"bottom"===p?(v=c?m:"".concat(y,"px"),b="".concat(-f,"px")):"top"===p?(v=c?m:"".concat(y,"px"),b="".concat(l.floating.height+f,"px")):"right"===p?(v="".concat(-f,"px"),b=c?m:"".concat(g,"px")):"left"===p&&(v="".concat(l.floating.width+f,"px"),b=c?m:"".concat(g,"px")),{data:{x:v,y:b}}}});function eJ(e){let[t,r="center"]=e.split("-");return[t,r]}var eQ=r(56935),e0=r(31383),e1="rovingFocusGroup.onEntryFocus",e2={bubbles:!1,cancelable:!0},e3="RovingFocusGroup",[e5,e4,e8]=(0,u.B)(e3),[e6,e9]=(0,a.b)(e3,[e8]),[e7,te]=e6(e3),tt=n.forwardRef((e,t)=>(0,eT.jsx)(e5.Provider,{scope:e.__scopeRovingFocusGroup,children:(0,eT.jsx)(e5.Slot,{scope:e.__scopeRovingFocusGroup,children:(0,eT.jsx)(tr,{...e,ref:t})})}));tt.displayName=e3;var tr=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,orientation:a,loop:u=!1,dir:d,currentTabStopId:f,defaultCurrentTabStopId:p,onCurrentTabStopIdChange:h,onEntryFocus:m,preventScrollOnEntryFocus:y=!1,...g}=e,v=n.useRef(null),b=(0,i.e)(t,v),w=(0,c.gm)(d),[x=null,S]=(0,s.T)({prop:f,defaultProp:p,onChange:h}),[P,E]=n.useState(!1),A=(0,ek.W)(m),R=e4(r),j=n.useRef(!1),[C,O]=n.useState(0);return n.useEffect(()=>{let e=v.current;if(e)return e.addEventListener(e1,A),()=>e.removeEventListener(e1,A)},[A]),(0,eT.jsx)(e7,{scope:r,orientation:a,dir:w,loop:u,currentTabStopId:x,onItemFocus:n.useCallback(e=>S(e),[S]),onItemShiftTab:n.useCallback(()=>E(!0),[]),onFocusableItemAdd:n.useCallback(()=>O(e=>e+1),[]),onFocusableItemRemove:n.useCallback(()=>O(e=>e-1),[]),children:(0,eT.jsx)(l.WV.div,{tabIndex:P||0===C?-1:0,"data-orientation":a,...g,ref:b,style:{outline:"none",...e.style},onMouseDown:(0,o.M)(e.onMouseDown,()=>{j.current=!0}),onFocus:(0,o.M)(e.onFocus,e=>{let t=!j.current;if(e.target===e.currentTarget&&t&&!P){let t=new CustomEvent(e1,e2);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){let e=R().filter(e=>e.focusable);ta([e.find(e=>e.active),e.find(e=>e.id===x),...e].filter(Boolean).map(e=>e.ref.current),y)}}j.current=!1}),onBlur:(0,o.M)(e.onBlur,()=>E(!1))})})}),tn="RovingFocusGroupItem",to=n.forwardRef((e,t)=>{let{__scopeRovingFocusGroup:r,focusable:i=!0,active:a=!1,tabStopId:s,...u}=e,c=(0,h.M)(),d=s||c,f=te(tn,r),p=f.currentTabStopId===d,m=e4(r),{onFocusableItemAdd:y,onFocusableItemRemove:g}=f;return n.useEffect(()=>{if(i)return y(),()=>g()},[i,y,g]),(0,eT.jsx)(e5.ItemSlot,{scope:r,id:d,focusable:i,active:a,children:(0,eT.jsx)(l.WV.span,{tabIndex:p?0:-1,"data-orientation":f.orientation,...u,ref:t,onMouseDown:(0,o.M)(e.onMouseDown,e=>{i?f.onItemFocus(d):e.preventDefault()}),onFocus:(0,o.M)(e.onFocus,()=>f.onItemFocus(d)),onKeyDown:(0,o.M)(e.onKeyDown,e=>{if("Tab"===e.key&&e.shiftKey){f.onItemShiftTab();return}if(e.target!==e.currentTarget)return;let t=function(e,t,r){var n;let o=(n=e.key,"rtl"!==r?n:"ArrowLeft"===n?"ArrowRight":"ArrowRight"===n?"ArrowLeft":n);if(!("vertical"===t&&["ArrowLeft","ArrowRight"].includes(o))&&!("horizontal"===t&&["ArrowUp","ArrowDown"].includes(o)))return ti[o]}(e,f.orientation,f.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=m().filter(e=>e.focusable).map(e=>e.ref.current);if("last"===t)o.reverse();else if("prev"===t||"next"===t){var r,n;"prev"===t&&o.reverse();let i=o.indexOf(e.currentTarget);o=f.loop?(r=o,n=i+1,r.map((e,t)=>r[(n+t)%r.length])):o.slice(i+1)}setTimeout(()=>ta(o))}})})})});to.displayName=tn;var ti={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function ta(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=document.activeElement;for(let n of e)if(n===r||(n.focus({preventScroll:t}),document.activeElement!==r))return}var ts=r(71538),tl=r(78369),tu=r(49418),tc=["Enter"," "],td=["ArrowUp","PageDown","End"],tf=["ArrowDown","PageUp","Home",...td],tp={ltr:[...tc,"ArrowRight"],rtl:[...tc,"ArrowLeft"]},th={ltr:["ArrowLeft"],rtl:["ArrowRight"]},tm="Menu",[ty,tg,tv]=(0,u.B)(tm),[tb,tw]=(0,a.b)(tm,[tv,eF,e9]),tx=eF(),tS=e9(),[tP,tE]=tb(tm),[tA,tR]=tb(tm),tj=e=>{let{__scopeMenu:t,open:r=!1,children:o,dir:i,onOpenChange:a,modal:s=!0}=e,l=tx(t),[u,d]=n.useState(null),f=n.useRef(!1),p=(0,ek.W)(a),h=(0,c.gm)(i);return n.useEffect(()=>{let e=()=>{f.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>f.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})}},[]),(0,eT.jsx)(ez,{...l,children:(0,eT.jsx)(tP,{scope:t,open:r,onOpenChange:p,content:u,onContentChange:d,children:(0,eT.jsx)(tA,{scope:t,onClose:n.useCallback(()=>p(!1),[p]),isUsingKeyboardRef:f,dir:h,modal:s,children:o})})})};tj.displayName=tm;var tC=n.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=tx(r);return(0,eT.jsx)(eW,{...o,...n,ref:t})});tC.displayName="MenuAnchor";var tO="MenuPortal",[tT,tM]=tb(tO,{forceMount:void 0}),tk=e=>{let{__scopeMenu:t,forceMount:r,children:n,container:o}=e,i=tE(tO,t);return(0,eT.jsx)(tT,{scope:t,forceMount:r,children:(0,eT.jsx)(e0.z,{present:r||i.open,children:(0,eT.jsx)(eQ.h,{asChild:!0,container:o,children:n})})})};tk.displayName=tO;var tD="MenuContent",[tN,tL]=tb(tD),tI=n.forwardRef((e,t)=>{let r=tM(tD,e.__scopeMenu),{forceMount:n=r.forceMount,...o}=e,i=tE(tD,e.__scopeMenu),a=tR(tD,e.__scopeMenu);return(0,eT.jsx)(ty.Provider,{scope:e.__scopeMenu,children:(0,eT.jsx)(e0.z,{present:n||i.open,children:(0,eT.jsx)(ty.Slot,{scope:e.__scopeMenu,children:a.modal?(0,eT.jsx)(tF,{...o,ref:t}):(0,eT.jsx)(t_,{...o,ref:t})})})})}),tF=n.forwardRef((e,t)=>{let r=tE(tD,e.__scopeMenu),a=n.useRef(null),s=(0,i.e)(t,a);return n.useEffect(()=>{let e=a.current;if(e)return(0,tl.Ry)(e)},[]),(0,eT.jsx)(tV,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:(0,o.M)(e.onFocusOutside,e=>e.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})}),t_=n.forwardRef((e,t)=>{let r=tE(tD,e.__scopeMenu);return(0,eT.jsx)(tV,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})}),tV=n.forwardRef((e,t)=>{let{__scopeMenu:r,loop:a=!1,trapFocus:s,onOpenAutoFocus:l,onCloseAutoFocus:u,disableOutsidePointerEvents:c,onEntryFocus:h,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:v,onDismiss:b,disableOutsideScroll:w,...x}=e,S=tE(tD,r),P=tR(tD,r),E=tx(r),A=tS(r),R=tg(r),[j,C]=n.useState(null),O=n.useRef(null),T=(0,i.e)(t,O,S.onContentChange),M=n.useRef(0),k=n.useRef(""),D=n.useRef(0),N=n.useRef(null),L=n.useRef("right"),I=n.useRef(0),F=w?tu.Z:n.Fragment,_=w?{as:ts.g7,allowPinchZoom:!0}:void 0,V=e=>{var t,r;let n=k.current+e,o=R().filter(e=>!e.disabled),i=document.activeElement,a=null===(t=o.find(e=>e.ref.current===i))||void 0===t?void 0:t.textValue,s=function(e,t,r){var n;let o=t.length>1&&Array.from(t).every(e=>e===t[0])?t[0]:t,i=(n=Math.max(r?e.indexOf(r):-1,0),e.map((t,r)=>e[(n+r)%e.length]));1===o.length&&(i=i.filter(e=>e!==r));let a=i.find(e=>e.toLowerCase().startsWith(o.toLowerCase()));return a!==r?a:void 0}(o.map(e=>e.textValue),n,a),l=null===(r=o.find(e=>e.textValue===s))||void 0===r?void 0:r.ref.current;!function e(t){k.current=t,window.clearTimeout(M.current),""!==t&&(M.current=window.setTimeout(()=>e(""),1e3))}(n),l&&setTimeout(()=>l.focus())};n.useEffect(()=>()=>window.clearTimeout(M.current),[]),(0,f.EW)();let z=n.useCallback(e=>{var t,r,n;return L.current===(null===(t=N.current)||void 0===t?void 0:t.side)&&!!(n=null===(r=N.current)||void 0===r?void 0:r.area)&&function(e,t){let{x:r,y:n}=e,o=!1;for(let e=0,i=t.length-1;en!=u>n&&r<(l-a)*(n-s)/(u-s)+a&&(o=!o)}return o}({x:e.clientX,y:e.clientY},n)},[]);return(0,eT.jsx)(tN,{scope:r,searchRef:k,onItemEnter:n.useCallback(e=>{z(e)&&e.preventDefault()},[z]),onItemLeave:n.useCallback(e=>{var t;z(e)||(null===(t=O.current)||void 0===t||t.focus(),C(null))},[z]),onTriggerLeave:n.useCallback(e=>{z(e)&&e.preventDefault()},[z]),pointerGraceTimerRef:D,onPointerGraceIntentChange:n.useCallback(e=>{N.current=e},[]),children:(0,eT.jsx)(F,{..._,children:(0,eT.jsx)(p.M,{asChild:!0,trapped:s,onMountAutoFocus:(0,o.M)(l,e=>{var t;e.preventDefault(),null===(t=O.current)||void 0===t||t.focus({preventScroll:!0})}),onUnmountAutoFocus:u,children:(0,eT.jsx)(d.XB,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:m,onPointerDownOutside:y,onFocusOutside:g,onInteractOutside:v,onDismiss:b,children:(0,eT.jsx)(tt,{asChild:!0,...A,dir:P.dir,orientation:"vertical",loop:a,currentTabStopId:j,onCurrentTabStopIdChange:C,onEntryFocus:(0,o.M)(h,e=>{P.isUsingKeyboardRef.current||e.preventDefault()}),preventScrollOnEntryFocus:!0,children:(0,eT.jsx)(eK,{role:"menu","aria-orientation":"vertical","data-state":rn(S.open),"data-radix-menu-content":"",dir:P.dir,...E,...x,ref:T,style:{outline:"none",...x.style},onKeyDown:(0,o.M)(x.onKeyDown,e=>{let t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,r=e.ctrlKey||e.altKey||e.metaKey,n=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!r&&n&&V(e.key));let o=O.current;if(e.target!==o||!tf.includes(e.key))return;e.preventDefault();let i=R().filter(e=>!e.disabled).map(e=>e.ref.current);td.includes(e.key)&&i.reverse(),function(e){let t=document.activeElement;for(let r of e)if(r===t||(r.focus(),document.activeElement!==t))return}(i)}),onBlur:(0,o.M)(e.onBlur,e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(M.current),k.current="")}),onPointerMove:(0,o.M)(e.onPointerMove,ra(e=>{let t=e.target,r=I.current!==e.clientX;if(e.currentTarget.contains(t)&&r){let t=e.clientX>I.current?"right":"left";L.current=t,I.current=e.clientX}}))})})})})})})});tI.displayName=tD;var tz=n.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,eT.jsx)(l.WV.div,{role:"group",...n,ref:t})});tz.displayName="MenuGroup";var tB=n.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,eT.jsx)(l.WV.div,{...n,ref:t})});tB.displayName="MenuLabel";var tW="MenuItem",tU="menu.itemSelect",t$=n.forwardRef((e,t)=>{let{disabled:r=!1,onSelect:a,...s}=e,u=n.useRef(null),c=tR(tW,e.__scopeMenu),d=tL(tW,e.__scopeMenu),f=(0,i.e)(t,u),p=n.useRef(!1);return(0,eT.jsx)(tH,{...s,ref:f,disabled:r,onClick:(0,o.M)(e.onClick,()=>{let e=u.current;if(!r&&e){let t=new CustomEvent(tU,{bubbles:!0,cancelable:!0});e.addEventListener(tU,e=>null==a?void 0:a(e),{once:!0}),(0,l.jH)(e,t),t.defaultPrevented?p.current=!1:c.onClose()}}),onPointerDown:t=>{var r;null===(r=e.onPointerDown)||void 0===r||r.call(e,t),p.current=!0},onPointerUp:(0,o.M)(e.onPointerUp,e=>{var t;p.current||null===(t=e.currentTarget)||void 0===t||t.click()}),onKeyDown:(0,o.M)(e.onKeyDown,e=>{let t=""!==d.searchRef.current;!r&&(!t||" "!==e.key)&&tc.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())})})});t$.displayName=tW;var tH=n.forwardRef((e,t)=>{let{__scopeMenu:r,disabled:a=!1,textValue:s,...u}=e,c=tL(tW,r),d=tS(r),f=n.useRef(null),p=(0,i.e)(t,f),[h,m]=n.useState(!1),[y,g]=n.useState("");return n.useEffect(()=>{let e=f.current;if(e){var t;g((null!==(t=e.textContent)&&void 0!==t?t:"").trim())}},[u.children]),(0,eT.jsx)(ty.ItemSlot,{scope:r,disabled:a,textValue:null!=s?s:y,children:(0,eT.jsx)(to,{asChild:!0,...d,focusable:!a,children:(0,eT.jsx)(l.WV.div,{role:"menuitem","data-highlighted":h?"":void 0,"aria-disabled":a||void 0,"data-disabled":a?"":void 0,...u,ref:p,onPointerMove:(0,o.M)(e.onPointerMove,ra(e=>{a?c.onItemLeave(e):(c.onItemEnter(e),e.defaultPrevented||e.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:(0,o.M)(e.onPointerLeave,ra(e=>c.onItemLeave(e))),onFocus:(0,o.M)(e.onFocus,()=>m(!0)),onBlur:(0,o.M)(e.onBlur,()=>m(!1))})})})}),tK=n.forwardRef((e,t)=>{let{checked:r=!1,onCheckedChange:n,...i}=e;return(0,eT.jsx)(t0,{scope:e.__scopeMenu,checked:r,children:(0,eT.jsx)(t$,{role:"menuitemcheckbox","aria-checked":ro(r)?"mixed":r,...i,ref:t,"data-state":ri(r),onSelect:(0,o.M)(i.onSelect,()=>null==n?void 0:n(!!ro(r)||!r),{checkForDefaultPrevented:!1})})})});tK.displayName="MenuCheckboxItem";var tq="MenuRadioGroup",[tG,tZ]=tb(tq,{value:void 0,onValueChange:()=>{}}),tX=n.forwardRef((e,t)=>{let{value:r,onValueChange:n,...o}=e,i=(0,ek.W)(n);return(0,eT.jsx)(tG,{scope:e.__scopeMenu,value:r,onValueChange:i,children:(0,eT.jsx)(tz,{...o,ref:t})})});tX.displayName=tq;var tY="MenuRadioItem",tJ=n.forwardRef((e,t)=>{let{value:r,...n}=e,i=tZ(tY,e.__scopeMenu),a=r===i.value;return(0,eT.jsx)(t0,{scope:e.__scopeMenu,checked:a,children:(0,eT.jsx)(t$,{role:"menuitemradio","aria-checked":a,...n,ref:t,"data-state":ri(a),onSelect:(0,o.M)(n.onSelect,()=>{var e;return null===(e=i.onValueChange)||void 0===e?void 0:e.call(i,r)},{checkForDefaultPrevented:!1})})})});tJ.displayName=tY;var tQ="MenuItemIndicator",[t0,t1]=tb(tQ,{checked:!1}),t2=n.forwardRef((e,t)=>{let{__scopeMenu:r,forceMount:n,...o}=e,i=t1(tQ,r);return(0,eT.jsx)(e0.z,{present:n||ro(i.checked)||!0===i.checked,children:(0,eT.jsx)(l.WV.span,{...o,ref:t,"data-state":ri(i.checked)})})});t2.displayName=tQ;var t3=n.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e;return(0,eT.jsx)(l.WV.div,{role:"separator","aria-orientation":"horizontal",...n,ref:t})});t3.displayName="MenuSeparator";var t5=n.forwardRef((e,t)=>{let{__scopeMenu:r,...n}=e,o=tx(r);return(0,eT.jsx)(eZ,{...o,...n,ref:t})});t5.displayName="MenuArrow";var t4="MenuSub",[t8,t6]=tb(t4),t9=e=>{let{__scopeMenu:t,children:r,open:o=!1,onOpenChange:i}=e,a=tE(t4,t),s=tx(t),[l,u]=n.useState(null),[c,d]=n.useState(null),f=(0,ek.W)(i);return n.useEffect(()=>(!1===a.open&&f(!1),()=>f(!1)),[a.open,f]),(0,eT.jsx)(ez,{...s,children:(0,eT.jsx)(tP,{scope:t,open:o,onOpenChange:f,content:c,onContentChange:d,children:(0,eT.jsx)(t8,{scope:t,contentId:(0,h.M)(),triggerId:(0,h.M)(),trigger:l,onTriggerChange:u,children:r})})})};t9.displayName=t4;var t7="MenuSubTrigger",re=n.forwardRef((e,t)=>{let r=tE(t7,e.__scopeMenu),a=tR(t7,e.__scopeMenu),s=t6(t7,e.__scopeMenu),l=tL(t7,e.__scopeMenu),u=n.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:d}=l,f={__scopeMenu:e.__scopeMenu},p=n.useCallback(()=>{u.current&&window.clearTimeout(u.current),u.current=null},[]);return n.useEffect(()=>p,[p]),n.useEffect(()=>{let e=c.current;return()=>{window.clearTimeout(e),d(null)}},[c,d]),(0,eT.jsx)(tC,{asChild:!0,...f,children:(0,eT.jsx)(tH,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":rn(r.open),...e,ref:(0,i.F)(t,s.onTriggerChange),onClick:t=>{var n;null===(n=e.onClick)||void 0===n||n.call(e,t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:(0,o.M)(e.onPointerMove,ra(t=>{l.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||u.current||(l.onPointerGraceIntentChange(null),u.current=window.setTimeout(()=>{r.onOpenChange(!0),p()},100))})),onPointerLeave:(0,o.M)(e.onPointerLeave,ra(e=>{var t,n;p();let o=null===(t=r.content)||void 0===t?void 0:t.getBoundingClientRect();if(o){let t=null===(n=r.content)||void 0===n?void 0:n.dataset.side,i="right"===t,a=o[i?"left":"right"],s=o[i?"right":"left"];l.onPointerGraceIntentChange({area:[{x:e.clientX+(i?-5:5),y:e.clientY},{x:a,y:o.top},{x:s,y:o.top},{x:s,y:o.bottom},{x:a,y:o.bottom}],side:t}),window.clearTimeout(c.current),c.current=window.setTimeout(()=>l.onPointerGraceIntentChange(null),300)}else{if(l.onTriggerLeave(e),e.defaultPrevented)return;l.onPointerGraceIntentChange(null)}})),onKeyDown:(0,o.M)(e.onKeyDown,t=>{let n=""!==l.searchRef.current;if(!e.disabled&&(!n||" "!==t.key)&&tp[a.dir].includes(t.key)){var o;r.onOpenChange(!0),null===(o=r.content)||void 0===o||o.focus(),t.preventDefault()}})})})});re.displayName=t7;var rt="MenuSubContent",rr=n.forwardRef((e,t)=>{let r=tM(tD,e.__scopeMenu),{forceMount:a=r.forceMount,...s}=e,l=tE(tD,e.__scopeMenu),u=tR(tD,e.__scopeMenu),c=t6(rt,e.__scopeMenu),d=n.useRef(null),f=(0,i.e)(t,d);return(0,eT.jsx)(ty.Provider,{scope:e.__scopeMenu,children:(0,eT.jsx)(e0.z,{present:a||l.open,children:(0,eT.jsx)(ty.Slot,{scope:e.__scopeMenu,children:(0,eT.jsx)(tV,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:f,align:"start",side:"rtl"===u.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{var t;u.isUsingKeyboardRef.current&&(null===(t=d.current)||void 0===t||t.focus()),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:(0,o.M)(e.onFocusOutside,e=>{e.target!==c.trigger&&l.onOpenChange(!1)}),onEscapeKeyDown:(0,o.M)(e.onEscapeKeyDown,e=>{u.onClose(),e.preventDefault()}),onKeyDown:(0,o.M)(e.onKeyDown,e=>{let t=e.currentTarget.contains(e.target),r=th[u.dir].includes(e.key);if(t&&r){var n;l.onOpenChange(!1),null===(n=c.trigger)||void 0===n||n.focus(),e.preventDefault()}})})})})})});function rn(e){return e?"open":"closed"}function ro(e){return"indeterminate"===e}function ri(e){return ro(e)?"indeterminate":e?"checked":"unchecked"}function ra(e){return t=>"mouse"===t.pointerType?e(t):void 0}rr.displayName=rt;var rs="DropdownMenu",[rl,ru]=(0,a.b)(rs,[tw]),rc=tw(),[rd,rf]=rl(rs),rp=e=>{let{__scopeDropdownMenu:t,children:r,dir:o,open:i,defaultOpen:a,onOpenChange:l,modal:u=!0}=e,c=rc(t),d=n.useRef(null),[f=!1,p]=(0,s.T)({prop:i,defaultProp:a,onChange:l});return(0,eT.jsx)(rd,{scope:t,triggerId:(0,h.M)(),triggerRef:d,contentId:(0,h.M)(),open:f,onOpenChange:p,onOpenToggle:n.useCallback(()=>p(e=>!e),[p]),modal:u,children:(0,eT.jsx)(tj,{...c,open:f,onOpenChange:p,dir:o,modal:u,children:r})})};rp.displayName=rs;var rh="DropdownMenuTrigger",rm=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,disabled:n=!1,...a}=e,s=rf(rh,r),u=rc(r);return(0,eT.jsx)(tC,{asChild:!0,...u,children:(0,eT.jsx)(l.WV.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":n?"":void 0,disabled:n,...a,ref:(0,i.F)(t,s.triggerRef),onPointerDown:(0,o.M)(e.onPointerDown,e=>{n||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())}),onKeyDown:(0,o.M)(e.onKeyDown,e=>{!n&&(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())})})})});rm.displayName=rh;var ry=e=>{let{__scopeDropdownMenu:t,...r}=e,n=rc(t);return(0,eT.jsx)(tk,{...n,...r})};ry.displayName="DropdownMenuPortal";var rg="DropdownMenuContent",rv=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...i}=e,a=rf(rg,r),s=rc(r),l=n.useRef(!1);return(0,eT.jsx)(tI,{id:a.contentId,"aria-labelledby":a.triggerId,...s,...i,ref:t,onCloseAutoFocus:(0,o.M)(e.onCloseAutoFocus,e=>{var t;l.current||null===(t=a.triggerRef.current)||void 0===t||t.focus(),l.current=!1,e.preventDefault()}),onInteractOutside:(0,o.M)(e.onInteractOutside,e=>{let t=e.detail.originalEvent,r=0===t.button&&!0===t.ctrlKey,n=2===t.button||r;(!a.modal||n)&&(l.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)"}})});rv.displayName=rg;var rb=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(tz,{...o,...n,ref:t})});rb.displayName="DropdownMenuGroup";var rw=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(tB,{...o,...n,ref:t})});rw.displayName="DropdownMenuLabel";var rx=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(t$,{...o,...n,ref:t})});rx.displayName="DropdownMenuItem";var rS=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(tK,{...o,...n,ref:t})});rS.displayName="DropdownMenuCheckboxItem";var rP=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(tX,{...o,...n,ref:t})});rP.displayName="DropdownMenuRadioGroup";var rE=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(tJ,{...o,...n,ref:t})});rE.displayName="DropdownMenuRadioItem";var rA=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(t2,{...o,...n,ref:t})});rA.displayName="DropdownMenuItemIndicator";var rR=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(t3,{...o,...n,ref:t})});rR.displayName="DropdownMenuSeparator",n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(t5,{...o,...n,ref:t})}).displayName="DropdownMenuArrow";var rj=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(re,{...o,...n,ref:t})});rj.displayName="DropdownMenuSubTrigger";var rC=n.forwardRef((e,t)=>{let{__scopeDropdownMenu:r,...n}=e,o=rc(r);return(0,eT.jsx)(rr,{...o,...n,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)"}})});rC.displayName="DropdownMenuSubContent";var rO=rp,rT=rm,rM=ry,rk=rv,rD=rb,rN=rw,rL=rx,rI=rS,rF=rP,r_=rE,rV=rA,rz=rR,rB=e=>{let{__scopeDropdownMenu:t,children:r,open:n,onOpenChange:o,defaultOpen:i}=e,a=rc(t),[l=!1,u]=(0,s.T)({prop:n,defaultProp:i,onChange:o});return(0,eT.jsx)(t9,{...a,open:l,onOpenChange:u,children:r})},rW=rj,rU=rC},20589:function(e,t,r){"use strict";r.d(t,{EW:function(){return i}});var n=r(2265),o=0;function i(){n.useEffect(()=>{var e,t;let r=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",null!==(e=r[0])&&void 0!==e?e:a()),document.body.insertAdjacentElement("beforeend",null!==(t=r[1])&&void 0!==t?t:a()),o++,()=>{1===o&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),o--}},[])}function a(){let e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.cssText="outline: none; opacity: 0; position: fixed; pointer-events: none",e}},80467:function(e,t,r){"use strict";let n;r.d(t,{M:function(){return f}});var o=r(2265),i=r(1584),a=r(25171),s=r(75137),l=r(57437),u="focusScope.autoFocusOnMount",c="focusScope.autoFocusOnUnmount",d={bubbles:!1,cancelable:!0},f=o.forwardRef((e,t)=>{let{loop:r=!1,trapped:n=!1,onMountAutoFocus:f,onUnmountAutoFocus:g,...v}=e,[b,w]=o.useState(null),x=(0,s.W)(f),S=(0,s.W)(g),P=o.useRef(null),E=(0,i.e)(t,e=>w(e)),A=o.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;o.useEffect(()=>{if(n){let e=function(e){if(A.paused||!b)return;let t=e.target;b.contains(t)?P.current=t:m(P.current,{select:!0})},t=function(e){if(A.paused||!b)return;let t=e.relatedTarget;null===t||b.contains(t)||m(P.current,{select:!0})};document.addEventListener("focusin",e),document.addEventListener("focusout",t);let r=new MutationObserver(function(e){if(document.activeElement===document.body)for(let t of e)t.removedNodes.length>0&&m(b)});return b&&r.observe(b,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}},[n,b,A.paused]),o.useEffect(()=>{if(b){y.add(A);let e=document.activeElement;if(!b.contains(e)){let t=new CustomEvent(u,d);b.addEventListener(u,x),b.dispatchEvent(t),t.defaultPrevented||(function(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=document.activeElement;for(let n of e)if(m(n,{select:t}),document.activeElement!==r)return}(p(b).filter(e=>"A"!==e.tagName),{select:!0}),document.activeElement===e&&m(b))}return()=>{b.removeEventListener(u,x),setTimeout(()=>{let t=new CustomEvent(c,d);b.addEventListener(c,S),b.dispatchEvent(t),t.defaultPrevented||m(null!=e?e:document.body,{select:!0}),b.removeEventListener(c,S),y.remove(A)},0)}}},[b,x,S,A]);let R=o.useCallback(e=>{if(!r&&!n||A.paused)return;let t="Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey,o=document.activeElement;if(t&&o){let t=e.currentTarget,[n,i]=function(e){let t=p(e);return[h(t,e),h(t.reverse(),e)]}(t);n&&i?e.shiftKey||o!==i?e.shiftKey&&o===n&&(e.preventDefault(),r&&m(i,{select:!0})):(e.preventDefault(),r&&m(n,{select:!0})):o===t&&e.preventDefault()}},[r,n,A.paused]);return(0,l.jsx)(a.WV.div,{tabIndex:-1,...v,ref:E,onKeyDown:R})});function p(e){let t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>{let 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(;r.nextNode();)t.push(r.currentNode);return t}function h(e,t){for(let r of e)if(!function(e,t){let{upTo:r}=t;if("hidden"===getComputedStyle(e).visibility)return!0;for(;e&&(void 0===r||e!==r);){if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}(r,{upTo:t}))return r}function m(e){let{select:t=!1}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&e.focus){var r;let n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&(r=e)instanceof HTMLInputElement&&"select"in r&&t&&e.select()}}f.displayName="FocusScope";var y=(n=[],{add(e){let t=n[0];e!==t&&(null==t||t.pause()),(n=g(n,e)).unshift(e)},remove(e){var t;null===(t=(n=g(n,e))[0])||void 0===t||t.resume()}});function g(e,t){let r=[...e],n=r.indexOf(t);return -1!==n&&r.splice(n,1),r}},53201:function(e,t,r){"use strict";r.d(t,{M:function(){return l}});var n,o=r(2265),i=r(1336),a=(n||(n=r.t(o,2)))["useId".toString()]||(()=>void 0),s=0;function l(e){let[t,r]=o.useState(a());return(0,i.b)(()=>{e||r(e=>e??String(s++))},[e]),e||(t?`radix-${t}`:"")}},38364:function(e,t,r){"use strict";r.d(t,{f:function(){return s}});var n=r(2265),o=r(25171),i=r(57437),a=n.forwardRef((e,t)=>(0,i.jsx)(o.WV.label,{...e,ref:t,onMouseDown:t=>{var r;t.target.closest("button, input, select, textarea")||(null===(r=e.onMouseDown)||void 0===r||r.call(e,t),!t.defaultPrevented&&t.detail>1&&t.preventDefault())}}));a.displayName="Label";var s=a},56935:function(e,t,r){"use strict";r.d(t,{h:function(){return l}});var n=r(2265),o=r(54887),i=r(25171),a=r(1336),s=r(57437),l=n.forwardRef((e,t)=>{var r,l;let{container:u,...c}=e,[d,f]=n.useState(!1);(0,a.b)(()=>f(!0),[]);let p=u||d&&(null===(l=globalThis)||void 0===l?void 0:null===(r=l.document)||void 0===r?void 0:r.body);return p?o.createPortal((0,s.jsx)(i.WV.div,{...c,ref:t}),p):null});l.displayName="Portal"},31383:function(e,t,r){"use strict";r.d(t,{z:function(){return s}});var n=r(2265),o=r(54887),i=r(1584),a=r(1336),s=e=>{var t,r;let s,u;let{present:c,children:d}=e,f=function(e){var t,r;let[i,s]=n.useState(),u=n.useRef({}),c=n.useRef(e),d=n.useRef("none"),[f,p]=(t=e?"mounted":"unmounted",r={mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}},n.useReducer((e,t)=>{let n=r[e][t];return null!=n?n:e},t));return n.useEffect(()=>{let e=l(u.current);d.current="mounted"===f?e:"none"},[f]),(0,a.b)(()=>{let t=u.current,r=c.current;if(r!==e){let n=d.current,o=l(t);e?p("MOUNT"):"none"===o||(null==t?void 0:t.display)==="none"?p("UNMOUNT"):r&&n!==o?p("ANIMATION_OUT"):p("UNMOUNT"),c.current=e}},[e,p]),(0,a.b)(()=>{if(i){let e=e=>{let t=l(u.current).includes(e.animationName);e.target===i&&t&&o.flushSync(()=>p("ANIMATION_END"))},t=e=>{e.target===i&&(d.current=l(u.current))};return i.addEventListener("animationstart",t),i.addEventListener("animationcancel",e),i.addEventListener("animationend",e),()=>{i.removeEventListener("animationstart",t),i.removeEventListener("animationcancel",e),i.removeEventListener("animationend",e)}}p("ANIMATION_END")},[i,p]),{isPresent:["mounted","unmountSuspended"].includes(f),ref:n.useCallback(e=>{e&&(u.current=getComputedStyle(e)),s(e)},[])}}(c),p="function"==typeof d?d({present:f.isPresent}):n.Children.only(d),h=(0,i.e)(f.ref,(s=null===(t=Object.getOwnPropertyDescriptor(p.props,"ref"))||void 0===t?void 0:t.get)&&"isReactWarning"in s&&s.isReactWarning?p.ref:(s=null===(r=Object.getOwnPropertyDescriptor(p,"ref"))||void 0===r?void 0:r.get)&&"isReactWarning"in s&&s.isReactWarning?p.props.ref:p.props.ref||p.ref);return"function"==typeof d||f.isPresent?n.cloneElement(p,{ref:h}):null};function l(e){return(null==e?void 0:e.animationName)||"none"}s.displayName="Presence"},25171:function(e,t,r){"use strict";r.d(t,{WV:function(){return s},jH:function(){return l}});var n=r(2265),o=r(54887),i=r(71538),a=r(57437),s=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce((e,t)=>{let r=n.forwardRef((e,r)=>{let{asChild:n,...o}=e,s=n?i.g7:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),(0,a.jsx)(s,{...o,ref:r})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function l(e,t){e&&o.flushSync(()=>e.dispatchEvent(t))}},85068:function(e,t,r){"use strict";r.d(t,{e6:function(){return $},fC:function(){return W},bU:function(){return H},fQ:function(){return U}});var n=r(2265);function o(e,[t,r]){return Math.min(r,Math.max(t,e))}var i=r(78149),a=r(1584),s=r(98324),l=r(91715),u=r(87513),c=r(47250),d=r(75238),f=r(25171),p=r(90976),h=r(57437),m=["PageUp","PageDown"],y=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],g={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},v="Slider",[b,w,x]=(0,p.B)(v),[S,P]=(0,s.b)(v,[x]),[E,A]=S(v),R=n.forwardRef((e,t)=>{let{name:r,min:a=0,max:s=100,step:u=1,orientation:c="horizontal",disabled:d=!1,minStepsBetweenThumbs:f=0,defaultValue:p=[a],value:g,onValueChange:v=()=>{},onValueCommit:w=()=>{},inverted:x=!1,...S}=e,P=n.useRef(new Set),A=n.useRef(0),R="horizontal"===c?O:T,[j=[],C]=(0,l.T)({prop:g,defaultProp:p,onChange:e=>{var t;null===(t=[...P.current][A.current])||void 0===t||t.focus(),v(e)}}),M=n.useRef(j);function k(e,t){let{commit:r}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{commit:!1},n=(String(u).split(".")[1]||"").length,i=o(function(e,t){let r=Math.pow(10,t);return Math.round(e*r)/r}(Math.round((e-a)/u)*u+a,n),[a,s]);C(function(){var e,n;let o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],a=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=[...e];return n[r]=t,n.sort((e,t)=>e-t)}(o,i,t);if(e=a,!(!((n=f*u)>0)||Math.min(...e.slice(0,-1).map((t,r)=>e[r+1]-t))>=n))return o;{A.current=a.indexOf(i);let e=String(a)!==String(o);return e&&r&&w(a),e?a:o}})}return(0,h.jsx)(E,{scope:e.__scopeSlider,name:r,disabled:d,min:a,max:s,valueIndexToChangeRef:A,thumbs:P.current,values:j,orientation:c,children:(0,h.jsx)(b.Provider,{scope:e.__scopeSlider,children:(0,h.jsx)(b.Slot,{scope:e.__scopeSlider,children:(0,h.jsx)(R,{"aria-disabled":d,"data-disabled":d?"":void 0,...S,ref:t,onPointerDown:(0,i.M)(S.onPointerDown,()=>{d||(M.current=j)}),min:a,max:s,inverted:x,onSlideStart:d?void 0:function(e){let t=function(e,t){if(1===e.length)return 0;let r=e.map(e=>Math.abs(e-t));return r.indexOf(Math.min(...r))}(j,e);k(e,t)},onSlideMove:d?void 0:function(e){k(e,A.current)},onSlideEnd:d?void 0:function(){let e=M.current[A.current];j[A.current]!==e&&w(j)},onHomeKeyDown:()=>!d&&k(a,0,{commit:!0}),onEndKeyDown:()=>!d&&k(s,j.length-1,{commit:!0}),onStepKeyDown:e=>{let{event:t,direction:r}=e;if(!d){let e=m.includes(t.key)||t.shiftKey&&y.includes(t.key),n=A.current;k(j[n]+u*(e?10:1)*r,n,{commit:!0})}}})})})})});R.displayName=v;var[j,C]=S(v,{startEdge:"left",endEdge:"right",size:"width",direction:1}),O=n.forwardRef((e,t)=>{let{min:r,max:o,dir:i,inverted:s,onSlideStart:l,onSlideMove:c,onSlideEnd:d,onStepKeyDown:f,...p}=e,[m,y]=n.useState(null),v=(0,a.e)(t,e=>y(e)),b=n.useRef(),w=(0,u.gm)(i),x="ltr"===w,S=x&&!s||!x&&s;function P(e){let t=b.current||m.getBoundingClientRect(),n=B([0,t.width],S?[r,o]:[o,r]);return b.current=t,n(e-t.left)}return(0,h.jsx)(j,{scope:e.__scopeSlider,startEdge:S?"left":"right",endEdge:S?"right":"left",direction:S?1:-1,size:"width",children:(0,h.jsx)(M,{dir:w,"data-orientation":"horizontal",...p,ref:v,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:e=>{let t=P(e.clientX);null==l||l(t)},onSlideMove:e=>{let t=P(e.clientX);null==c||c(t)},onSlideEnd:()=>{b.current=void 0,null==d||d()},onStepKeyDown:e=>{let t=g[S?"from-left":"from-right"].includes(e.key);null==f||f({event:e,direction:t?-1:1})}})})}),T=n.forwardRef((e,t)=>{let{min:r,max:o,inverted:i,onSlideStart:s,onSlideMove:l,onSlideEnd:u,onStepKeyDown:c,...d}=e,f=n.useRef(null),p=(0,a.e)(t,f),m=n.useRef(),y=!i;function v(e){let t=m.current||f.current.getBoundingClientRect(),n=B([0,t.height],y?[o,r]:[r,o]);return m.current=t,n(e-t.top)}return(0,h.jsx)(j,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:(0,h.jsx)(M,{"data-orientation":"vertical",...d,ref:p,style:{...d.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:e=>{let t=v(e.clientY);null==s||s(t)},onSlideMove:e=>{let t=v(e.clientY);null==l||l(t)},onSlideEnd:()=>{m.current=void 0,null==u||u()},onStepKeyDown:e=>{let t=g[y?"from-bottom":"from-top"].includes(e.key);null==c||c({event:e,direction:t?-1:1})}})})}),M=n.forwardRef((e,t)=>{let{__scopeSlider:r,onSlideStart:n,onSlideMove:o,onSlideEnd:a,onHomeKeyDown:s,onEndKeyDown:l,onStepKeyDown:u,...c}=e,d=A(v,r);return(0,h.jsx)(f.WV.span,{...c,ref:t,onKeyDown:(0,i.M)(e.onKeyDown,e=>{"Home"===e.key?(s(e),e.preventDefault()):"End"===e.key?(l(e),e.preventDefault()):m.concat(y).includes(e.key)&&(u(e),e.preventDefault())}),onPointerDown:(0,i.M)(e.onPointerDown,e=>{let t=e.target;t.setPointerCapture(e.pointerId),e.preventDefault(),d.thumbs.has(t)?t.focus():n(e)}),onPointerMove:(0,i.M)(e.onPointerMove,e=>{e.target.hasPointerCapture(e.pointerId)&&o(e)}),onPointerUp:(0,i.M)(e.onPointerUp,e=>{let t=e.target;t.hasPointerCapture(e.pointerId)&&(t.releasePointerCapture(e.pointerId),a(e))})})}),k="SliderTrack",D=n.forwardRef((e,t)=>{let{__scopeSlider:r,...n}=e,o=A(k,r);return(0,h.jsx)(f.WV.span,{"data-disabled":o.disabled?"":void 0,"data-orientation":o.orientation,...n,ref:t})});D.displayName=k;var N="SliderRange",L=n.forwardRef((e,t)=>{let{__scopeSlider:r,...o}=e,i=A(N,r),s=C(N,r),l=n.useRef(null),u=(0,a.e)(t,l),c=i.values.length,d=i.values.map(e=>z(e,i.min,i.max));return(0,h.jsx)(f.WV.span,{"data-orientation":i.orientation,"data-disabled":i.disabled?"":void 0,...o,ref:u,style:{...e.style,[s.startEdge]:(c>1?Math.min(...d):0)+"%",[s.endEdge]:100-Math.max(...d)+"%"}})});L.displayName=N;var I="SliderThumb",F=n.forwardRef((e,t)=>{let r=w(e.__scopeSlider),[o,i]=n.useState(null),s=(0,a.e)(t,e=>i(e)),l=n.useMemo(()=>o?r().findIndex(e=>e.ref.current===o):-1,[r,o]);return(0,h.jsx)(_,{...e,ref:s,index:l})}),_=n.forwardRef((e,t)=>{var r;let{__scopeSlider:o,index:s,name:l,...u}=e,c=A(I,o),p=C(I,o),[m,y]=n.useState(null),g=(0,a.e)(t,e=>y(e)),v=!m||!!m.closest("form"),w=(0,d.t)(m),x=c.values[s],S=void 0===x?0:z(x,c.min,c.max),P=(r=c.values.length)>2?"Value ".concat(s+1," of ").concat(r):2===r?["Minimum","Maximum"][s]:void 0,E=null==w?void 0:w[p.size],R=E?function(e,t,r){let n=e/2,o=B([0,50],[0,n]);return(n-o(t)*r)*r}(E,S,p.direction):0;return n.useEffect(()=>{if(m)return c.thumbs.add(m),()=>{c.thumbs.delete(m)}},[m,c.thumbs]),(0,h.jsxs)("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[p.startEdge]:"calc(".concat(S,"% + ").concat(R,"px)")},children:[(0,h.jsx)(b.ItemSlot,{scope:e.__scopeSlider,children:(0,h.jsx)(f.WV.span,{role:"slider","aria-label":e["aria-label"]||P,"aria-valuemin":c.min,"aria-valuenow":x,"aria-valuemax":c.max,"aria-orientation":c.orientation,"data-orientation":c.orientation,"data-disabled":c.disabled?"":void 0,tabIndex:c.disabled?void 0:0,...u,ref:g,style:void 0===x?{display:"none"}:e.style,onFocus:(0,i.M)(e.onFocus,()=>{c.valueIndexToChangeRef.current=s})})}),v&&(0,h.jsx)(V,{name:null!=l?l:c.name?c.name+(c.values.length>1?"[]":""):void 0,value:x},s)]})});F.displayName=I;var V=e=>{let{value:t,...r}=e,o=n.useRef(null),i=(0,c.D)(t);return n.useEffect(()=>{let e=o.current,r=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"value").set;if(i!==t&&r){let n=new Event("input",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[i,t]),(0,h.jsx)("input",{style:{display:"none"},...r,ref:o,defaultValue:t})};function z(e,t,r){return o(100/(r-t)*(e-t),[0,100])}function B(e,t){return r=>{if(e[0]===e[1]||t[0]===t[1])return t[0];let n=(t[1]-t[0])/(e[1]-e[0]);return t[0]+n*(r-e[0])}}var W=R,U=D,$=L,H=F},71538:function(e,t,r){"use strict";r.d(t,{A4:function(){return l},g7:function(){return a}});var n=r(2265),o=r(1584),i=r(57437),a=n.forwardRef((e,t)=>{let{children:r,...o}=e,a=n.Children.toArray(r),l=a.find(u);if(l){let e=l.props.children,r=a.map(t=>t!==l?t:n.Children.count(e)>1?n.Children.only(null):n.isValidElement(e)?e.props.children:null);return(0,i.jsx)(s,{...o,ref:t,children:n.isValidElement(e)?n.cloneElement(e,void 0,r):null})}return(0,i.jsx)(s,{...o,ref:t,children:r})});a.displayName="Slot";var s=n.forwardRef((e,t)=>{let{children:r,...i}=e;if(n.isValidElement(r)){let e,a;let s=(e=Object.getOwnPropertyDescriptor(r.props,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.ref:(e=Object.getOwnPropertyDescriptor(r,"ref")?.get)&&"isReactWarning"in e&&e.isReactWarning?r.props.ref:r.props.ref||r.ref;return n.cloneElement(r,{...function(e,t){let r={...t};for(let n in t){let o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...e)=>{i(...e),o(...e)}:o&&(r[n]=o):"style"===n?r[n]={...o,...i}:"className"===n&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}(i,r.props),ref:t?(0,o.F)(t,s):s})}return n.Children.count(r)>1?n.Children.only(null):null});s.displayName="SlotClone";var l=({children:e})=>(0,i.jsx)(i.Fragment,{children:e});function u(e){return n.isValidElement(e)&&e.type===l}},9646:function(e,t,r){"use strict";r.d(t,{bU:function(){return P},fC:function(){return S}});var n=r(2265),o=r(78149),i=r(1584),a=r(98324),s=r(91715),l=r(47250),u=r(75238),c=r(25171),d=r(57437),f="Switch",[p,h]=(0,a.b)(f),[m,y]=p(f),g=n.forwardRef((e,t)=>{let{__scopeSwitch:r,name:a,checked:l,defaultChecked:u,required:f,disabled:p,value:h="on",onCheckedChange:y,...g}=e,[v,b]=n.useState(null),S=(0,i.e)(t,e=>b(e)),P=n.useRef(!1),E=!v||!!v.closest("form"),[A=!1,R]=(0,s.T)({prop:l,defaultProp:u,onChange:y});return(0,d.jsxs)(m,{scope:r,checked:A,disabled:p,children:[(0,d.jsx)(c.WV.button,{type:"button",role:"switch","aria-checked":A,"aria-required":f,"data-state":x(A),"data-disabled":p?"":void 0,disabled:p,value:h,...g,ref:S,onClick:(0,o.M)(e.onClick,e=>{R(e=>!e),E&&(P.current=e.isPropagationStopped(),P.current||e.stopPropagation())})}),E&&(0,d.jsx)(w,{control:v,bubbles:!P.current,name:a,value:h,checked:A,required:f,disabled:p,style:{transform:"translateX(-100%)"}})]})});g.displayName=f;var v="SwitchThumb",b=n.forwardRef((e,t)=>{let{__scopeSwitch:r,...n}=e,o=y(v,r);return(0,d.jsx)(c.WV.span,{"data-state":x(o.checked),"data-disabled":o.disabled?"":void 0,...n,ref:t})});b.displayName=v;var w=e=>{let{control:t,checked:r,bubbles:o=!0,...i}=e,a=n.useRef(null),s=(0,l.D)(r),c=(0,u.t)(t);return n.useEffect(()=>{let e=a.current,t=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,"checked").set;if(s!==r&&t){let n=new Event("click",{bubbles:o});t.call(e,r),e.dispatchEvent(n)}},[s,r,o]),(0,d.jsx)("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...i,tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function x(e){return e?"checked":"unchecked"}var S=g,P=b},75137:function(e,t,r){"use strict";r.d(t,{W:function(){return o}});var n=r(2265);function o(e){let t=n.useRef(e);return n.useEffect(()=>{t.current=e}),n.useMemo(()=>(...e)=>t.current?.(...e),[])}},91715:function(e,t,r){"use strict";r.d(t,{T:function(){return i}});var n=r(2265),o=r(75137);function i({prop:e,defaultProp:t,onChange:r=()=>{}}){let[i,a]=function({defaultProp:e,onChange:t}){let r=n.useState(e),[i]=r,a=n.useRef(i),s=(0,o.W)(t);return n.useEffect(()=>{a.current!==i&&(s(i),a.current=i)},[i,a,s]),r}({defaultProp:t,onChange:r}),s=void 0!==e,l=s?e:i,u=(0,o.W)(r);return[l,n.useCallback(t=>{if(s){let r="function"==typeof t?t(e):t;r!==e&&u(r)}else a(t)},[s,e,a,u])]}},1336:function(e,t,r){"use strict";r.d(t,{b:function(){return o}});var n=r(2265),o=globalThis?.document?n.useLayoutEffect:()=>{}},47250:function(e,t,r){"use strict";r.d(t,{D:function(){return o}});var n=r(2265);function o(e){let t=n.useRef({value:e,previous:e});return n.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}},75238:function(e,t,r){"use strict";r.d(t,{t:function(){return i}});var n=r(2265),o=r(1336);function i(e){let[t,r]=n.useState(void 0);return(0,o.b)(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let n,o;if(!Array.isArray(t)||!t.length)return;let i=t[0];if("borderBoxSize"in i){let e=i.borderBoxSize,t=Array.isArray(e)?e[0]:e;n=t.inlineSize,o=t.blockSize}else n=e.offsetWidth,o=e.offsetHeight;r({width:n,height:o})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}r(void 0)},[e]),t}},38472:function(e,t,r){"use strict";let n,o,i,a;r.d(t,{Z:function(){return tp}});var s,l,u,c,d,f={};function p(e,t){return function(){return e.apply(t,arguments)}}r.r(f),r.d(f,{hasBrowserEnv:function(){return ev},hasStandardBrowserEnv:function(){return eb},hasStandardBrowserWebWorkerEnv:function(){return ew},origin:function(){return ex}});var h=r(25566);let{toString:m}=Object.prototype,{getPrototypeOf:y}=Object,g=(n=Object.create(null),e=>{let t=m.call(e);return n[t]||(n[t]=t.slice(8,-1).toLowerCase())}),v=e=>(e=e.toLowerCase(),t=>g(t)===e),b=e=>t=>typeof t===e,{isArray:w}=Array,x=b("undefined"),S=v("ArrayBuffer"),P=b("string"),E=b("function"),A=b("number"),R=e=>null!==e&&"object"==typeof e,j=e=>{if("object"!==g(e))return!1;let t=y(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},C=v("Date"),O=v("File"),T=v("Blob"),M=v("FileList"),k=v("URLSearchParams"),[D,N,L,I]=["ReadableStream","Request","Response","Headers"].map(v);function F(e,t,{allOwnKeys:r=!1}={}){let n,o;if(null!=e){if("object"!=typeof e&&(e=[e]),w(e))for(n=0,o=e.length;n0;)if(t===(r=n[o]).toLowerCase())return r;return null}let V="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,z=e=>!x(e)&&e!==V,B=(o="undefined"!=typeof Uint8Array&&y(Uint8Array),e=>o&&e instanceof o),W=v("HTMLFormElement"),U=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),$=v("RegExp"),H=(e,t)=>{let r=Object.getOwnPropertyDescriptors(e),n={};F(r,(r,o)=>{let i;!1!==(i=t(r,o,e))&&(n[o]=i||r)}),Object.defineProperties(e,n)},K="abcdefghijklmnopqrstuvwxyz",q="0123456789",G={DIGIT:q,ALPHA:K,ALPHA_DIGIT:K+K.toUpperCase()+q},Z=v("AsyncFunction"),X=(s="function"==typeof setImmediate,l=E(V.postMessage),s?setImmediate:l?(u=`axios@${Math.random()}`,c=[],V.addEventListener("message",({source:e,data:t})=>{e===V&&t===u&&c.length&&c.shift()()},!1),e=>{c.push(e),V.postMessage(u,"*")}):e=>setTimeout(e)),Y="undefined"!=typeof queueMicrotask?queueMicrotask.bind(V):void 0!==h&&h.nextTick||X;var J={isArray:w,isArrayBuffer:S,isBuffer:function(e){return null!==e&&!x(e)&&null!==e.constructor&&!x(e.constructor)&&E(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||E(e.append)&&("formdata"===(t=g(e))||"object"===t&&E(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&S(e.buffer)},isString:P,isNumber:A,isBoolean:e=>!0===e||!1===e,isObject:R,isPlainObject:j,isReadableStream:D,isRequest:N,isResponse:L,isHeaders:I,isUndefined:x,isDate:C,isFile:O,isBlob:T,isRegExp:$,isFunction:E,isStream:e=>R(e)&&E(e.pipe),isURLSearchParams:k,isTypedArray:B,isFileList:M,forEach:F,merge:function e(){let{caseless:t}=z(this)&&this||{},r={},n=(n,o)=>{let i=t&&_(r,o)||o;j(r[i])&&j(n)?r[i]=e(r[i],n):j(n)?r[i]=e({},n):w(n)?r[i]=n.slice():r[i]=n};for(let e=0,t=arguments.length;e(F(t,(t,n)=>{r&&E(t)?e[n]=p(t,r):e[n]=t},{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,i,a;let s={};if(t=t||{},null==e)return t;do{for(i=(o=Object.getOwnPropertyNames(e)).length;i-- >0;)a=o[i],(!n||n(a,e,t))&&!s[a]&&(t[a]=e[a],s[a]=!0);e=!1!==r&&y(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:g,kindOfTest:v,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;let n=e.indexOf(t,r);return -1!==n&&n===r},toArray:e=>{if(!e)return null;if(w(e))return e;let t=e.length;if(!A(t))return null;let r=Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{let r;let n=(e&&e[Symbol.iterator]).call(e);for(;(r=n.next())&&!r.done;){let n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let r;let n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:W,hasOwnProperty:U,hasOwnProp:U,reduceDescriptors:H,freezeMethods:e=>{H(e,(t,r)=>{if(E(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;if(E(e[r])){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")})}})},toObjectSet:(e,t)=>{let r={};return(e=>{e.forEach(e=>{r[e]=!0})})(w(e)?e:String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,r){return t.toUpperCase()+r}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:_,global:V,isContextDefined:z,ALPHABET:G,generateString:(e=16,t=G.ALPHA_DIGIT)=>{let r="",{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&E(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{let t=Array(10),r=(e,n)=>{if(R(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;let o=w(e)?[]:{};return F(e,(e,t)=>{let i=r(e,n+1);x(i)||(o[t]=i)}),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:Z,isThenable:e=>e&&(R(e)||E(e))&&E(e.then)&&E(e.catch),setImmediate:X,asap:Y};function Q(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}J.inherits(Q,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:J.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});let ee=Q.prototype,et={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{et[e]={value:e}}),Object.defineProperties(Q,et),Object.defineProperty(ee,"isAxiosError",{value:!0}),Q.from=(e,t,r,n,o,i)=>{let a=Object.create(ee);return J.toFlatObject(e,a,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),Q.call(a,e.message,t,r,n,o),a.cause=e,a.name=e.name,i&&Object.assign(a,i),a};var er=r(9109).Buffer;function en(e){return J.isPlainObject(e)||J.isArray(e)}function eo(e){return J.endsWith(e,"[]")?e.slice(0,-2):e}function ei(e,t,r){return e?e.concat(t).map(function(e,t){return e=eo(e),!r&&t?"["+e+"]":e}).join(r?".":""):t}let ea=J.toFlatObject(J,{},null,function(e){return/^is[A-Z]/.test(e)});var es=function(e,t,r){if(!J.isObject(e))throw TypeError("target must be an object");t=t||new FormData;let n=(r=J.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!J.isUndefined(t[e])})).metaTokens,o=r.visitor||u,i=r.dots,a=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&J.isSpecCompliantForm(t);if(!J.isFunction(o))throw TypeError("visitor must be a function");function l(e){if(null===e)return"";if(J.isDate(e))return e.toISOString();if(!s&&J.isBlob(e))throw new Q("Blob is not supported. Use a Buffer instead.");return J.isArrayBuffer(e)||J.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):er.from(e):e}function u(e,r,o){let s=e;if(e&&!o&&"object"==typeof e){if(J.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else{var u;if(J.isArray(e)&&(u=e,J.isArray(u)&&!u.some(en))||(J.isFileList(e)||J.endsWith(r,"[]"))&&(s=J.toArray(e)))return r=eo(r),s.forEach(function(e,n){J.isUndefined(e)||null===e||t.append(!0===a?ei([r],n,i):null===a?r:r+"[]",l(e))}),!1}}return!!en(e)||(t.append(ei(o,r,i),l(e)),!1)}let c=[],d=Object.assign(ea,{defaultVisitor:u,convertValue:l,isVisitable:en});if(!J.isObject(e))throw TypeError("data must be an object");return!function e(r,n){if(!J.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),J.forEach(r,function(r,i){!0===(!(J.isUndefined(r)||null===r)&&o.call(t,r,J.isString(i)?i.trim():i,n,d))&&e(r,n?n.concat(i):[i])}),c.pop()}}(e),t};function el(e){let t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function eu(e,t){this._pairs=[],e&&es(e,this,t)}let ec=eu.prototype;function ed(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function ef(e,t,r){let n;if(!t)return e;let o=r&&r.encode||ed,i=r&&r.serialize;if(n=i?i(t,r):J.isURLSearchParams(t)?t.toString():new eu(t,r).toString(o)){let t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+n}return e}ec.append=function(e,t){this._pairs.push([e,t])},ec.toString=function(e){let t=e?function(t){return e.call(this,t,el)}:el;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class ep{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){J.forEach(this.handlers,function(t){null!==t&&e(t)})}}var eh={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},em="undefined"!=typeof URLSearchParams?URLSearchParams:eu,ey="undefined"!=typeof FormData?FormData:null,eg="undefined"!=typeof Blob?Blob:null;let ev="undefined"!=typeof window&&"undefined"!=typeof document,eb=(i="undefined"!=typeof navigator&&navigator.product,ev&&0>["ReactNative","NativeScript","NS"].indexOf(i)),ew="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,ex=ev&&window.location.href||"http://localhost";var eS={...f,isBrowser:!0,classes:{URLSearchParams:em,FormData:ey,Blob:eg},protocols:["http","https","file","blob","url","data"]},eP=function(e){if(J.isFormData(e)&&J.isFunction(e.entries)){let t={};return J.forEachEntry(e,(e,r)=>{!function e(t,r,n,o){let i=t[o++];if("__proto__"===i)return!0;let a=Number.isFinite(+i),s=o>=t.length;return(i=!i&&J.isArray(n)?n.length:i,s)?J.hasOwnProp(n,i)?n[i]=[n[i],r]:n[i]=r:(n[i]&&J.isObject(n[i])||(n[i]=[]),e(t,r,n[i],o)&&J.isArray(n[i])&&(n[i]=function(e){let t,r;let n={},o=Object.keys(e),i=o.length;for(t=0;t"[]"===e[0]?"":e[1]||e[0]),r,t,0)}),t}return null};let eE={transitional:eh,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){let r;let n=t.getContentType()||"",o=n.indexOf("application/json")>-1,i=J.isObject(e);if(i&&J.isHTMLForm(e)&&(e=new FormData(e)),J.isFormData(e))return o?JSON.stringify(eP(e)):e;if(J.isArrayBuffer(e)||J.isBuffer(e)||J.isStream(e)||J.isFile(e)||J.isBlob(e)||J.isReadableStream(e))return e;if(J.isArrayBufferView(e))return e.buffer;if(J.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1){var a,s;return(a=e,s=this.formSerializer,es(a,new eS.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return eS.isNode&&J.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},s))).toString()}if((r=J.isFileList(e))||n.indexOf("multipart/form-data")>-1){let t=this.env&&this.env.FormData;return es(r?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||o?(t.setContentType("application/json",!1),function(e,t,r){if(J.isString(e))try{return(0,JSON.parse)(e),J.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(0,JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){let t=this.transitional||eE.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(J.isResponse(e)||J.isReadableStream(e))return e;if(e&&J.isString(e)&&(r&&!this.responseType||n)){let r=t&&t.silentJSONParsing;try{return JSON.parse(e)}catch(e){if(!r&&n){if("SyntaxError"===e.name)throw Q.from(e,Q.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:eS.classes.FormData,Blob:eS.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};J.forEach(["delete","get","head","post","put","patch"],e=>{eE.headers[e]={}});let eA=J.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);var eR=e=>{let t,r,n;let o={};return e&&e.split("\n").forEach(function(e){n=e.indexOf(":"),t=e.substring(0,n).trim().toLowerCase(),r=e.substring(n+1).trim(),!t||o[t]&&eA[t]||("set-cookie"===t?o[t]?o[t].push(r):o[t]=[r]:o[t]=o[t]?o[t]+", "+r:r)}),o};let ej=Symbol("internals");function eC(e){return e&&String(e).trim().toLowerCase()}function eO(e){return!1===e||null==e?e:J.isArray(e)?e.map(eO):String(e)}let eT=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function eM(e,t,r,n,o){if(J.isFunction(n))return n.call(this,t,r);if(o&&(t=r),J.isString(t)){if(J.isString(n))return -1!==t.indexOf(n);if(J.isRegExp(n))return n.test(t)}}class ek{constructor(e){e&&this.set(e)}set(e,t,r){let n=this;function o(e,t,r){let o=eC(t);if(!o)throw Error("header name must be a non-empty string");let i=J.findKey(n,o);i&&void 0!==n[i]&&!0!==r&&(void 0!==r||!1===n[i])||(n[i||t]=eO(e))}let i=(e,t)=>J.forEach(e,(e,r)=>o(e,r,t));if(J.isPlainObject(e)||e instanceof this.constructor)i(e,t);else if(J.isString(e)&&(e=e.trim())&&!eT(e))i(eR(e),t);else if(J.isHeaders(e))for(let[t,n]of e.entries())o(n,t,r);else null!=e&&o(t,e,r);return this}get(e,t){if(e=eC(e)){let r=J.findKey(this,e);if(r){let e=this[r];if(!t)return e;if(!0===t)return function(e){let t;let r=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;for(;t=n.exec(e);)r[t[1]]=t[2];return r}(e);if(J.isFunction(t))return t.call(this,e,r);if(J.isRegExp(t))return t.exec(e);throw TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=eC(e)){let r=J.findKey(this,e);return!!(r&&void 0!==this[r]&&(!t||eM(this,this[r],r,t)))}return!1}delete(e,t){let r=this,n=!1;function o(e){if(e=eC(e)){let o=J.findKey(r,e);o&&(!t||eM(r,r[o],o,t))&&(delete r[o],n=!0)}}return J.isArray(e)?e.forEach(o):o(e),n}clear(e){let t=Object.keys(this),r=t.length,n=!1;for(;r--;){let o=t[r];(!e||eM(this,this[o],o,e,!0))&&(delete this[o],n=!0)}return n}normalize(e){let t=this,r={};return J.forEach(this,(n,o)=>{let i=J.findKey(r,o);if(i){t[i]=eO(n),delete t[o];return}let a=e?o.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,r)=>t.toUpperCase()+r):String(o).trim();a!==o&&delete t[o],t[a]=eO(n),r[a]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){let t=Object.create(null);return J.forEach(this,(r,n)=>{null!=r&&!1!==r&&(t[n]=e&&J.isArray(r)?r.join(", "):r)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){let r=new this(e);return t.forEach(e=>r.set(e)),r}static accessor(e){let t=(this[ej]=this[ej]={accessors:{}}).accessors,r=this.prototype;function n(e){let n=eC(e);t[n]||(!function(e,t){let r=J.toCamelCase(" "+t);["get","set","has"].forEach(n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})})}(r,e),t[n]=!0)}return J.isArray(e)?e.forEach(n):n(e),this}}function eD(e,t){let r=this||eE,n=t||r,o=ek.from(n.headers),i=n.data;return J.forEach(e,function(e){i=e.call(r,i,o.normalize(),t?t.status:void 0)}),o.normalize(),i}function eN(e){return!!(e&&e.__CANCEL__)}function eL(e,t,r){Q.call(this,null==e?"canceled":e,Q.ERR_CANCELED,t,r),this.name="CanceledError"}function eI(e,t,r){let n=r.config.validateStatus;!r.status||!n||n(r.status)?e(r):t(new Q("Request failed with status code "+r.status,[Q.ERR_BAD_REQUEST,Q.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r))}ek.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),J.reduceDescriptors(ek.prototype,({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}}),J.freezeMethods(ek),J.inherits(eL,Q,{__CANCEL__:!0});var eF=function(e,t){let r;let n=Array(e=e||10),o=Array(e),i=0,a=0;return t=void 0!==t?t:1e3,function(s){let l=Date.now(),u=o[a];r||(r=l),n[i]=s,o[i]=l;let c=a,d=0;for(;c!==i;)d+=n[c++],c%=e;if((i=(i+1)%e)===a&&(a=(a+1)%e),l-r{o=i,r=null,n&&(clearTimeout(n),n=null),e.apply(null,t)};return[(...e)=>{let t=Date.now(),s=t-o;s>=i?a(e,t):(r=e,n||(n=setTimeout(()=>{n=null,a(r)},i-s)))},()=>r&&a(r)]};let eV=(e,t,r=3)=>{let n=0,o=eF(50,250);return e_(r=>{let i=r.loaded,a=r.lengthComputable?r.total:void 0,s=i-n,l=o(s);n=i,e({loaded:i,total:a,progress:a?i/a:void 0,bytes:s,rate:l||void 0,estimated:l&&a&&i<=a?(a-i)/l:void 0,event:r,lengthComputable:null!=a,[t?"download":"upload"]:!0})},r)},ez=(e,t)=>{let r=null!=e;return[n=>t[0]({lengthComputable:r,total:e,loaded:n}),t[1]]},eB=e=>(...t)=>J.asap(()=>e(...t));var eW=eS.hasStandardBrowserEnv?function(){let e;let t=/(msie|trident)/i.test(navigator.userAgent),r=document.createElement("a");function n(e){let n=e;return t&&(r.setAttribute("href",n),n=r.href),r.setAttribute("href",n),{href:r.href,protocol:r.protocol?r.protocol.replace(/:$/,""):"",host:r.host,search:r.search?r.search.replace(/^\?/,""):"",hash:r.hash?r.hash.replace(/^#/,""):"",hostname:r.hostname,port:r.port,pathname:"/"===r.pathname.charAt(0)?r.pathname:"/"+r.pathname}}return e=n(window.location.href),function(t){let r=J.isString(t)?n(t):t;return r.protocol===e.protocol&&r.host===e.host}}():function(){return!0},eU=eS.hasStandardBrowserEnv?{write(e,t,r,n,o,i){let a=[e+"="+encodeURIComponent(t)];J.isNumber(r)&&a.push("expires="+new Date(r).toGMTString()),J.isString(n)&&a.push("path="+n),J.isString(o)&&a.push("domain="+o),!0===i&&a.push("secure"),document.cookie=a.join("; ")},read(e){let t=document.cookie.match(RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function e$(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e:t}let eH=e=>e instanceof ek?{...e}:e;function eK(e,t){t=t||{};let r={};function n(e,t,r){return J.isPlainObject(e)&&J.isPlainObject(t)?J.merge.call({caseless:r},e,t):J.isPlainObject(t)?J.merge({},t):J.isArray(t)?t.slice():t}function o(e,t,r){return J.isUndefined(t)?J.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function i(e,t){if(!J.isUndefined(t))return n(void 0,t)}function a(e,t){return J.isUndefined(t)?J.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,o,i){return i in t?n(r,o):i in e?n(void 0,r):void 0}let l={url:i,method:i,data:i,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:s,headers:(e,t)=>o(eH(e),eH(t),!0)};return J.forEach(Object.keys(Object.assign({},e,t)),function(n){let i=l[n]||o,a=i(e[n],t[n],n);J.isUndefined(a)&&i!==s||(r[n]=a)}),r}var eq=e=>{let t;let r=eK({},e),{data:n,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:a,headers:s,auth:l}=r;if(r.headers=s=ek.from(s),r.url=ef(e$(r.baseURL,r.url),e.params,e.paramsSerializer),l&&s.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),J.isFormData(n)){if(eS.hasStandardBrowserEnv||eS.hasStandardBrowserWebWorkerEnv)s.setContentType(void 0);else if(!1!==(t=s.getContentType())){let[e,...r]=t?t.split(";").map(e=>e.trim()).filter(Boolean):[];s.setContentType([e||"multipart/form-data",...r].join("; "))}}if(eS.hasStandardBrowserEnv&&(o&&J.isFunction(o)&&(o=o(r)),o||!1!==o&&eW(r.url))){let e=i&&a&&eU.read(a);e&&s.set(i,e)}return r},eG="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,r){let n,o,i,a,s;let l=eq(e),u=l.data,c=ek.from(l.headers).normalize(),{responseType:d,onUploadProgress:f,onDownloadProgress:p}=l;function h(){a&&a(),s&&s(),l.cancelToken&&l.cancelToken.unsubscribe(n),l.signal&&l.signal.removeEventListener("abort",n)}let m=new XMLHttpRequest;function y(){if(!m)return;let n=ek.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());eI(function(e){t(e),h()},function(e){r(e),h()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:n,config:e,request:m}),m=null}m.open(l.method.toUpperCase(),l.url,!0),m.timeout=l.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(r(new Q("Request aborted",Q.ECONNABORTED,e,m)),m=null)},m.onerror=function(){r(new Q("Network Error",Q.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=l.timeout?"timeout of "+l.timeout+"ms exceeded":"timeout exceeded",n=l.transitional||eh;l.timeoutErrorMessage&&(t=l.timeoutErrorMessage),r(new Q(t,n.clarifyTimeoutError?Q.ETIMEDOUT:Q.ECONNABORTED,e,m)),m=null},void 0===u&&c.setContentType(null),"setRequestHeader"in m&&J.forEach(c.toJSON(),function(e,t){m.setRequestHeader(t,e)}),J.isUndefined(l.withCredentials)||(m.withCredentials=!!l.withCredentials),d&&"json"!==d&&(m.responseType=l.responseType),p&&([i,s]=eV(p,!0),m.addEventListener("progress",i)),f&&m.upload&&([o,a]=eV(f),m.upload.addEventListener("progress",o),m.upload.addEventListener("loadend",a)),(l.cancelToken||l.signal)&&(n=t=>{m&&(r(!t||t.type?new eL(null,e,m):t),m.abort(),m=null)},l.cancelToken&&l.cancelToken.subscribe(n),l.signal&&(l.signal.aborted?n():l.signal.addEventListener("abort",n)));let g=function(e){let t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(l.url);if(g&&-1===eS.protocols.indexOf(g)){r(new Q("Unsupported protocol "+g+":",Q.ERR_BAD_REQUEST,e));return}m.send(u||null)})},eZ=(e,t)=>{let r,n=new AbortController,o=function(e){if(!r){r=!0,a();let t=e instanceof Error?e:this.reason;n.abort(t instanceof Q?t:new eL(t instanceof Error?t.message:t))}},i=t&&setTimeout(()=>{o(new Q(`timeout ${t} of ms exceeded`,Q.ETIMEDOUT))},t),a=()=>{e&&(i&&clearTimeout(i),i=null,e.forEach(e=>{e&&(e.removeEventListener?e.removeEventListener("abort",o):e.unsubscribe(o))}),e=null)};e.forEach(e=>e&&e.addEventListener&&e.addEventListener("abort",o));let{signal:s}=n;return s.unsubscribe=a,[s,()=>{i&&clearTimeout(i),i=null}]};let eX=function*(e,t){let r,n=e.byteLength;if(!t||n{let i;let a=eY(e,t,o),s=0,l=e=>{!i&&(i=!0,n&&n(e))};return new ReadableStream({async pull(e){try{let{done:t,value:n}=await a.next();if(t){l(),e.close();return}let o=n.byteLength;if(r){let e=s+=o;r(e)}e.enqueue(new Uint8Array(n))}catch(e){throw l(e),e}},cancel:e=>(l(e),a.return())},{highWaterMark:2})},eQ="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,e0=eQ&&"function"==typeof ReadableStream,e1=eQ&&("function"==typeof TextEncoder?(a=new TextEncoder,e=>a.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer())),e2=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},e3=e0&&e2(()=>{let e=!1,t=new Request(eS.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),e5=e0&&e2(()=>J.isReadableStream(new Response("").body)),e4={stream:e5&&(e=>e.body)};eQ&&(d=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{e4[e]||(e4[e]=J.isFunction(d[e])?t=>t[e]():(t,r)=>{throw new Q(`Response type '${e}' is not supported`,Q.ERR_NOT_SUPPORT,r)})}));let e8=async e=>null==e?0:J.isBlob(e)?e.size:J.isSpecCompliantForm(e)?(await new Request(e).arrayBuffer()).byteLength:J.isArrayBufferView(e)||J.isArrayBuffer(e)?e.byteLength:(J.isURLSearchParams(e)&&(e+=""),J.isString(e))?(await e1(e)).byteLength:void 0,e6=async(e,t)=>{let r=J.toFiniteNumber(e.getContentLength());return null==r?e8(t):r},e9={http:null,xhr:eG,fetch:eQ&&(async e=>{let t,r,n,{url:o,method:i,data:a,signal:s,cancelToken:l,timeout:u,onDownloadProgress:c,onUploadProgress:d,responseType:f,headers:p,withCredentials:h="same-origin",fetchOptions:m}=eq(e);f=f?(f+"").toLowerCase():"text";let[y,g]=s||l||u?eZ([s,l],u):[],v=()=>{t||setTimeout(()=>{y&&y.unsubscribe()}),t=!0};try{if(d&&e3&&"get"!==i&&"head"!==i&&0!==(n=await e6(p,a))){let e,t=new Request(o,{method:"POST",body:a,duplex:"half"});if(J.isFormData(a)&&(e=t.headers.get("content-type"))&&p.setContentType(e),t.body){let[e,r]=ez(n,eV(eB(d)));a=eJ(t.body,65536,e,r,e1)}}J.isString(h)||(h=h?"include":"omit"),r=new Request(o,{...m,signal:y,method:i.toUpperCase(),headers:p.normalize().toJSON(),body:a,duplex:"half",credentials:h});let t=await fetch(r),s=e5&&("stream"===f||"response"===f);if(e5&&(c||s)){let e={};["status","statusText","headers"].forEach(r=>{e[r]=t[r]});let r=J.toFiniteNumber(t.headers.get("content-length")),[n,o]=c&&ez(r,eV(eB(c),!0))||[];t=new Response(eJ(t.body,65536,n,()=>{o&&o(),s&&v()},e1),e)}f=f||"text";let l=await e4[J.findKey(e4,f)||"text"](t,e);return s||v(),g&&g(),await new Promise((n,o)=>{eI(n,o,{data:l,headers:ek.from(t.headers),status:t.status,statusText:t.statusText,config:e,request:r})})}catch(t){if(v(),t&&"TypeError"===t.name&&/fetch/i.test(t.message))throw Object.assign(new Q("Network Error",Q.ERR_NETWORK,e,r),{cause:t.cause||t});throw Q.from(t,t&&t.code,e,r)}})};J.forEach(e9,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});let e7=e=>`- ${e}`,te=e=>J.isFunction(e)||null===e||!1===e;var tt=e=>{let t,r;let{length:n}=e=J.isArray(e)?e:[e],o={};for(let i=0;i`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new Q("There is no suitable adapter to dispatch the request "+(n?e.length>1?"since :\n"+e.map(e7).join("\n"):" "+e7(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function tr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new eL(null,e)}function tn(e){return tr(e),e.headers=ek.from(e.headers),e.data=eD.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1),tt(e.adapter||eE.adapter)(e).then(function(t){return tr(e),t.data=eD.call(e,e.transformResponse,t),t.headers=ek.from(t.headers),t},function(t){return!eN(t)&&(tr(e),t&&t.response&&(t.response.data=eD.call(e,e.transformResponse,t.response),t.response.headers=ek.from(t.response.headers))),Promise.reject(t)})}let to="1.7.3",ti={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ti[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});let ta={};ti.transitional=function(e,t,r){function n(e,t){return"[Axios v"+to+"] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,i)=>{if(!1===e)throw new Q(n(o," has been removed"+(t?" in "+t:"")),Q.ERR_DEPRECATED);return t&&!ta[o]&&(ta[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,i)}};var ts={assertOptions:function(e,t,r){if("object"!=typeof e)throw new Q("options must be an object",Q.ERR_BAD_OPTION_VALUE);let n=Object.keys(e),o=n.length;for(;o-- >0;){let i=n[o],a=t[i];if(a){let t=e[i],r=void 0===t||a(t,i,e);if(!0!==r)throw new Q("option "+i+" must be "+r,Q.ERR_BAD_OPTION_VALUE);continue}if(!0!==r)throw new Q("Unknown option "+i,Q.ERR_BAD_OPTION)}},validators:ti};let tl=ts.validators;class tu{constructor(e){this.defaults=e,this.interceptors={request:new ep,response:new ep}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t;Error.captureStackTrace?Error.captureStackTrace(t={}):t=Error();let r=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?r&&!String(e.stack).endsWith(r.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+r):e.stack=r}catch(e){}}throw e}}_request(e,t){let r,n;"string"==typeof e?(t=t||{}).url=e:t=e||{};let{transitional:o,paramsSerializer:i,headers:a}=t=eK(this.defaults,t);void 0!==o&&ts.assertOptions(o,{silentJSONParsing:tl.transitional(tl.boolean),forcedJSONParsing:tl.transitional(tl.boolean),clarifyTimeoutError:tl.transitional(tl.boolean)},!1),null!=i&&(J.isFunction(i)?t.paramsSerializer={serialize:i}:ts.assertOptions(i,{encode:tl.function,serialize:tl.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=a&&J.merge(a.common,a[t.method]);a&&J.forEach(["delete","get","head","post","put","patch","common"],e=>{delete a[e]}),t.headers=ek.concat(s,a);let l=[],u=!0;this.interceptors.request.forEach(function(e){("function"!=typeof e.runWhen||!1!==e.runWhen(t))&&(u=u&&e.synchronous,l.unshift(e.fulfilled,e.rejected))});let c=[];this.interceptors.response.forEach(function(e){c.push(e.fulfilled,e.rejected)});let d=0;if(!u){let e=[tn.bind(this),void 0];for(e.unshift.apply(e,l),e.push.apply(e,c),n=e.length,r=Promise.resolve(t);d{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null}),this.promise.then=e=>{let t;let n=new Promise(e=>{r.subscribe(e),t=e}).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e(function(e,n,o){r.reason||(r.reason=new eL(e,n,o),t(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){if(this.reason){e(this.reason);return}this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;let t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new tc(function(t){e=t}),cancel:e}}}let td={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(td).forEach(([e,t])=>{td[t]=e});let tf=function e(t){let r=new tu(t),n=p(tu.prototype.request,r);return J.extend(n,tu.prototype,r,{allOwnKeys:!0}),J.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(eK(t,r))},n}(eE);tf.Axios=tu,tf.CanceledError=eL,tf.CancelToken=tc,tf.isCancel=eN,tf.VERSION=to,tf.toFormData=es,tf.AxiosError=Q,tf.Cancel=tf.CanceledError,tf.all=function(e){return Promise.all(e)},tf.spread=function(e){return function(t){return e.apply(null,t)}},tf.isAxiosError=function(e){return J.isObject(e)&&!0===e.isAxiosError},tf.mergeConfig=eK,tf.AxiosHeaders=ek,tf.formToJSON=e=>eP(J.isHTMLForm(e)?new FormData(e):e),tf.getAdapter=tt,tf.HttpStatusCode=td,tf.default=tf;var tp=tf},12218:function(e,t,r){"use strict";r.d(t,{j:function(){return i}});let n=e=>"boolean"==typeof e?"".concat(e):0===e?"0":e,o=function(){for(var e,t,r=0,n="";rr=>{var i;if((null==t?void 0:t.variants)==null)return o(e,null==r?void 0:r.class,null==r?void 0:r.className);let{variants:a,defaultVariants:s}=t,l=Object.keys(a).map(e=>{let t=null==r?void 0:r[e],o=null==s?void 0:s[e];if(null===t)return null;let i=n(t)||n(o);return a[e][i]}),u=r&&Object.entries(r).reduce((e,t)=>{let[r,n]=t;return void 0===n||(e[r]=n),e},{});return o(e,l,null==t?void 0:null===(i=t.compoundVariants)||void 0===i?void 0:i.reduce((e,t)=>{let{class:r,className:n,...o}=t;return Object.entries(o).every(e=>{let[t,r]=e;return Array.isArray(r)?r.includes({...s,...u}[t]):({...s,...u})[t]===r})?[...e,r,n]:e},[]),null==r?void 0:r.class,null==r?void 0:r.className)}},44839:function(e,t,r){"use strict";function n(){for(var e,t,r=0,n="",o=arguments.length;r{let{width:e,height:n,top:o,left:s}=a.current;if(t||!i.current||!e||!n)return;i.current.dataset.motionPopId=r;let l=document.createElement("style");return u&&(l.nonce=u),document.head.appendChild(l),l.sheet&&l.sheet.insertRule(` [data-motion-pop-id="${r}"] { position: absolute !important; width: ${e}px !important; height: ${n}px !important; top: ${o}px !important; left: ${s}px !important; } `),()=>{document.head.removeChild(l)}},[t]),(0,n.jsx)(l,{isPresent:t,childRef:i,sizeRef:a,children:o.cloneElement(e,{ref:i})})}let c=({children:e,initial:t,isPresent:r,onExitComplete:s,custom:l,presenceAffectsLayout:c,mode:f})=>{let p=(0,a.h)(d),h=(0,o.useId)(),m=(0,o.useMemo)(()=>({id:h,initial:t,isPresent:r,custom:l,onExitComplete:e=>{for(let t of(p.set(e,!0),p.values()))if(!t)return;s&&s()},register:e=>(p.set(e,!1),()=>p.delete(e))}),c?[Math.random()]:[r]);return(0,o.useMemo)(()=>{p.forEach((e,t)=>p.set(t,!1))},[r]),o.useEffect(()=>{r||p.size||!s||s()},[r]),"popLayout"===f&&(e=(0,n.jsx)(u,{isPresent:r,children:e})),(0,n.jsx)(i.O.Provider,{value:m,children:e})};function d(){return new Map}var f=r(5050),p=r(19047);let h=e=>e.key||"";function m(e){let t=[];return o.Children.forEach(e,e=>{(0,o.isValidElement)(e)&&t.push(e)}),t}var y=r(9033);let g=({children:e,exitBeforeEnter:t,custom:r,initial:i=!0,onExitComplete:s,presenceAffectsLayout:l=!0,mode:u="sync"})=>{(0,p.k)(!t,"Replace exitBeforeEnter with mode='wait'");let d=(0,o.useMemo)(()=>m(e),[e]),g=d.map(h),v=(0,o.useRef)(!0),b=(0,o.useRef)(d),w=(0,a.h)(()=>new Map),[x,S]=(0,o.useState)(d),[P,E]=(0,o.useState)(d);(0,y.L)(()=>{v.current=!1,b.current=d;for(let e=0;e{let t=h(e),o=d===P||g.includes(t);return(0,n.jsx)(c,{isPresent:o,initial:(!v.current||!!i)&&void 0,custom:o?void 0:r,presenceAffectsLayout:l,mode:u,onExitComplete:o?void 0:()=>{if(!w.has(t))return;w.set(t,!0);let e=!0;w.forEach(t=>{t||(e=!1)}),e&&(null==R||R(),E(b.current),s&&s())},children:e},t)})})}},5050:function(e,t,r){"use strict";r.d(t,{p:function(){return n}});let n=(0,r(2265).createContext)({})},29791:function(e,t,r){"use strict";r.d(t,{_:function(){return n}});let n=(0,r(2265).createContext)({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"})},67797:function(e,t,r){"use strict";r.d(t,{O:function(){return n}});let n=(0,r(2265).createContext)(null)},2981:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(565);let o=["read","resolveKeyframes","update","preRender","render","postRender"];function i(e,t){let r=!1,i=!0,a={delta:0,timestamp:0,isProcessing:!1},s=()=>r=!0,l=o.reduce((e,t)=>(e[t]=function(e){let t=new Set,r=new Set,n=!1,o=!1,i=new WeakSet,a={delta:0,timestamp:0,isProcessing:!1};function s(t){i.has(t)&&(l.schedule(t),e()),t(a)}let l={schedule:(e,o=!1,a=!1)=>{let s=a&&n?t:r;return o&&i.add(e),s.has(e)||s.add(e),e},cancel:e=>{r.delete(e),i.delete(e)},process:e=>{if(a=e,n){o=!0;return}n=!0,[t,r]=[r,t],r.clear(),t.forEach(s),n=!1,o&&(o=!1,l.process(e))}};return l}(s),e),{}),{read:u,resolveKeyframes:c,update:d,preRender:f,render:p,postRender:h}=l,m=()=>{let o=n.c.useManualTiming?a.timestamp:performance.now();r=!1,a.delta=i?1e3/60:Math.max(Math.min(o-a.timestamp,40),1),a.timestamp=o,a.isProcessing=!0,u.process(a),c.process(a),d.process(a),f.process(a),p.process(a),h.process(a),a.isProcessing=!1,r&&t&&(i=!1,e(m))},y=()=>{r=!0,i=!0,a.isProcessing||e(m)};return{schedule:o.reduce((e,t)=>{let n=l[t];return e[t]=(e,t=!1,o=!1)=>(r||y(),n.schedule(e,t,o)),e},{}),cancel:e=>{for(let t=0;t(void 0===n&&s.set(i.frameData.isProcessing||o.c.useManualTiming?i.frameData.timestamp:performance.now()),n),set:e=>{n=e,queueMicrotask(a)}}},98141:function(e,t,r){"use strict";r.d(t,{E:function(){return ob}});var n,o=r(57437),i=r(2265),a=r(29791);let s=(0,i.createContext)({});var l=r(67797),u=r(9033);let c=(0,i.createContext)({strict:!1}),d=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),f="data-"+d("framerAppearId"),{schedule:p,cancel:h}=(0,r(2981).Z)(queueMicrotask,!1);function m(e){return e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}let y=(0,i.createContext)({}),g=!1;function v(){window.HandoffComplete=!0}function b(e){return"string"==typeof e||Array.isArray(e)}function w(e){return null!==e&&"object"==typeof e&&"function"==typeof e.start}let x=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],S=["initial",...x];function P(e){return w(e.animate)||S.some(t=>b(e[t]))}function E(e){return!!(P(e)||e.variants)}function A(e){return Array.isArray(e)?e.join(" "):e}let R={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},j={};for(let e in R)j[e]={isEnabled:t=>R[e].some(e=>!!t[e])};var C=r(77282),O=r(5050);let T=Symbol.for("motionComponentSymbol"),M=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function k(e){if("string"!=typeof e||e.includes("-"));else if(M.indexOf(e)>-1||/[A-Z]/u.test(e))return!0;return!1}let D={},N=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],L=new Set(N);function I(e,{layout:t,layoutId:r}){return L.has(e)||e.startsWith("origin")||(t||void 0!==r)&&(!!D[e]||"opacity"===e)}let F=e=>!!(e&&e.getVelocity),_=(e,t)=>t&&"number"==typeof e?t.transform(e):e;var V=r(40783),z=r(75480);let B={...V.Rx,transform:Math.round},W={borderWidth:z.px,borderTopWidth:z.px,borderRightWidth:z.px,borderBottomWidth:z.px,borderLeftWidth:z.px,borderRadius:z.px,radius:z.px,borderTopLeftRadius:z.px,borderTopRightRadius:z.px,borderBottomRightRadius:z.px,borderBottomLeftRadius:z.px,width:z.px,maxWidth:z.px,height:z.px,maxHeight:z.px,size:z.px,top:z.px,right:z.px,bottom:z.px,left:z.px,padding:z.px,paddingTop:z.px,paddingRight:z.px,paddingBottom:z.px,paddingLeft:z.px,margin:z.px,marginTop:z.px,marginRight:z.px,marginBottom:z.px,marginLeft:z.px,rotate:z.RW,rotateX:z.RW,rotateY:z.RW,rotateZ:z.RW,scale:V.bA,scaleX:V.bA,scaleY:V.bA,scaleZ:V.bA,skew:z.RW,skewX:z.RW,skewY:z.RW,distance:z.px,translateX:z.px,translateY:z.px,translateZ:z.px,x:z.px,y:z.px,z:z.px,perspective:z.px,transformPerspective:z.px,opacity:V.Fq,originX:z.$C,originY:z.$C,originZ:z.px,zIndex:B,backgroundPositionX:z.px,backgroundPositionY:z.px,fillOpacity:V.Fq,strokeOpacity:V.Fq,numOctaves:B},U={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},$=N.length;var H=r(61534);function K(e,t,r){let{style:n,vars:o,transformOrigin:i}=e,a=!1,s=!1;for(let e in t){let r=t[e];if(L.has(e)){a=!0;continue}if((0,H.f)(e)){o[e]=r;continue}{let t=_(r,W[e]);e.startsWith("origin")?(s=!0,i[e]=t):n[e]=t}}if(!t.transform&&(a||r?n.transform=function(e,t,r){let n="",o=!0;for(let i=0;i<$;i++){let a=N[i],s=e[a];if(void 0===s)continue;let l=!0;if(!(l="number"==typeof s?s===(a.startsWith("scale")?1:0):0===parseFloat(s))||r){let e=_(s,W[a]);if(!l){o=!1;let t=U[a]||a;n+=`${t}(${e}) `}r&&(t[a]=e)}}return n=n.trim(),r?n=r(t,o?"":n):o&&(n="none"),n}(t,e.transform,r):n.transform&&(n.transform="none")),s){let{originX:e="50%",originY:t="50%",originZ:r=0}=i;n.transformOrigin=`${e} ${t} ${r}`}}let q=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function G(e,t,r){for(let n in t)F(t[n])||I(n,r)||(e[n]=t[n])}let Z=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function X(e){return e.startsWith("while")||e.startsWith("drag")&&"draggable"!==e||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Z.has(e)}let Y=e=>!X(e);try{(n=require("@emotion/is-prop-valid").default)&&(Y=e=>e.startsWith("on")?!X(e):n(e))}catch(e){}function J(e,t,r){return"string"==typeof e?e:z.px.transform(t+r*e)}let Q={offset:"stroke-dashoffset",array:"stroke-dasharray"},ee={offset:"strokeDashoffset",array:"strokeDasharray"};function et(e,{attrX:t,attrY:r,attrScale:n,originX:o,originY:i,pathLength:a,pathSpacing:s=1,pathOffset:l=0,...u},c,d){if(K(e,u,d),c){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};let{attrs:f,style:p,dimensions:h}=e;f.transform&&(h&&(p.transform=f.transform),delete f.transform),h&&(void 0!==o||void 0!==i||p.transform)&&(p.transformOrigin=function(e,t,r){let n=J(t,e.x,e.width),o=J(r,e.y,e.height);return`${n} ${o}`}(h,void 0!==o?o:.5,void 0!==i?i:.5)),void 0!==t&&(f.x=t),void 0!==r&&(f.y=r),void 0!==n&&(f.scale=n),void 0!==a&&function(e,t,r=1,n=0,o=!0){e.pathLength=1;let i=o?Q:ee;e[i.offset]=z.px.transform(-n);let a=z.px.transform(t),s=z.px.transform(r);e[i.array]=`${a} ${s}`}(f,a,s,l,!1)}let er=()=>({...q(),attrs:{}}),en=e=>"string"==typeof e&&"svg"===e.toLowerCase();function eo(e,{style:t,vars:r},n,o){for(let i in Object.assign(e.style,t,o&&o.getProjectionStyles(n)),r)e.style.setProperty(i,r[i])}let ei=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function ea(e,t,r,n){for(let r in eo(e,t,void 0,n),t.attrs)e.setAttribute(ei.has(r)?r:d(r),t.attrs[r])}function es(e,t,r){var n;let{style:o}=e,i={};for(let a in o)(F(o[a])||t.style&&F(t.style[a])||I(a,e)||(null===(n=null==r?void 0:r.getValue(a))||void 0===n?void 0:n.liveStyle)!==void 0)&&(i[a]=o[a]);return r&&o&&"string"==typeof o.willChange&&(r.applyWillChange=!1),i}function el(e,t,r){let n=es(e,t,r);for(let r in e)(F(e[r])||F(t[r]))&&(n[-1!==N.indexOf(r)?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r]=e[r]);return n}function eu(e){let t=[{},{}];return null==e||e.values.forEach((e,r)=>{t[0][r]=e.get(),t[1][r]=e.getVelocity()}),t}function ec(e,t,r,n){if("function"==typeof t){let[o,i]=eu(n);t=t(void 0!==r?r:e.custom,o,i)}if("string"==typeof t&&(t=e.variants&&e.variants[t]),"function"==typeof t){let[o,i]=eu(n);t=t(void 0!==r?r:e.custom,o,i)}return t}var ed=r(30458);let ef=e=>Array.isArray(e),ep=e=>!!(e&&"object"==typeof e&&e.mix&&e.toValue),eh=e=>ef(e)?e[e.length-1]||0:e;function em(e){let t=F(e)?e.get():e;return ep(t)?t.toValue():t}let ey=new Set(["opacity","clipPath","filter","transform"]);function eg(e){return L.has(e)?"transform":ey.has(e)?d(e):void 0}var ev=r(28746);let eb=e=>(t,r)=>{let n=(0,i.useContext)(s),o=(0,i.useContext)(l.O),a=()=>(function({applyWillChange:e=!1,scrapeMotionValuesFromProps:t,createRenderState:r,onMount:n},o,i,a,s){let l={latestValues:function(e,t,r,n,o){var i;let a={},s=[],l=n&&(null===(i=e.style)||void 0===i?void 0:i.willChange)===void 0,u=o(e,{});for(let e in u)a[e]=em(u[e]);let{initial:c,animate:d}=e,f=P(e),p=E(e);t&&p&&!f&&!1!==e.inherit&&(void 0===c&&(c=t.initial),void 0===d&&(d=t.animate));let h=!!r&&!1===r.initial,m=(h=h||!1===c)?d:c;return m&&"boolean"!=typeof m&&!w(m)&&ew(e,m,(e,t)=>{for(let t in e){let r=e[t];if(Array.isArray(r)){let e=h?r.length-1:0;r=r[e]}null!==r&&(a[t]=r)}for(let e in t)a[e]=t[e]}),l&&(d&&!1!==c&&!w(d)&&ew(e,d,e=>{for(let t in e)!function(e,t){let r=eg(t);r&&(0,ev.y4)(e,r)}(s,t)}),s.length&&(a.willChange=s.join(","))),a}(o,i,a,!s&&e,t),renderState:r()};return n&&(l.mount=e=>n(o,e,l)),l})(e,t,n,o,r);return r?a():(0,ed.h)(a)};function ew(e,t,r){let n=Array.isArray(t)?t:[t];for(let t=0;t{ex.Wi.read(()=>{try{r.dimensions="function"==typeof t.getBBox?t.getBBox():t.getBoundingClientRect()}catch(e){r.dimensions={x:0,y:0,width:0,height:0}}}),ex.Wi.render(()=>{et(r,n,en(t.tagName),e.transformTemplate),ea(t,r)})}})},eP={useVisualState:eb({applyWillChange:!0,scrapeMotionValuesFromProps:es,createRenderState:q})};function eE(e,t,r,n={passive:!0}){return e.addEventListener(t,r,n),()=>e.removeEventListener(t,r)}let eA=e=>"mouse"===e.pointerType?"number"!=typeof e.button||e.button<=0:!1!==e.isPrimary;function eR(e,t="page"){return{point:{x:e[`${t}X`],y:e[`${t}Y`]}}}let ej=e=>t=>eA(t)&&e(t,eR(t));function eC(e,t,r,n){return eE(e,t,ej(r),n)}var eO=r(89654);function eT(e){let t=null;return()=>null===t&&(t=e,()=>{t=null})}let eM=eT("dragHorizontal"),ek=eT("dragVertical");function eD(e){let t=!1;if("y"===e)t=ek();else if("x"===e)t=eM();else{let e=eM(),r=ek();e&&r?t=()=>{e(),r()}:(e&&e(),r&&r())}return t}function eN(){let e=eD(!0);return!e||(e(),!1)}class eL{constructor(e){this.isMounted=!1,this.node=e}update(){}}function eI(e,t){let r=t?"onHoverStart":"onHoverEnd";return eC(e.current,t?"pointerenter":"pointerleave",(n,o)=>{if("touch"===n.pointerType||eN())return;let i=e.getProps();e.animationState&&i.whileHover&&e.animationState.setActive("whileHover",t);let a=i[r];a&&ex.Wi.postRender(()=>a(n,o))},{passive:!e.getProps()[r]})}class eF extends eL{mount(){this.unmount=(0,eO.z)(eI(this.node,!0),eI(this.node,!1))}unmount(){}}class e_ extends eL{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch(t){e=!0}e&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){this.isActive&&this.node.animationState&&(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=(0,eO.z)(eE(this.node.current,"focus",()=>this.onFocus()),eE(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}let eV=(e,t)=>!!t&&(e===t||eV(e,t.parentElement));var ez=r(69276);function eB(e,t){if(!t)return;let r=new PointerEvent("pointer"+e);t(r,eR(r))}class eW extends eL{constructor(){super(...arguments),this.removeStartListeners=ez.Z,this.removeEndListeners=ez.Z,this.removeAccessibleListeners=ez.Z,this.startPointerPress=(e,t)=>{if(this.isPressing)return;this.removeEndListeners();let r=this.node.getProps(),n=eC(window,"pointerup",(e,t)=>{if(!this.checkPressEnd())return;let{onTap:r,onTapCancel:n,globalTapTarget:o}=this.node.getProps(),i=o||eV(this.node.current,e.target)?r:n;i&&ex.Wi.update(()=>i(e,t))},{passive:!(r.onTap||r.onPointerUp)}),o=eC(window,"pointercancel",(e,t)=>this.cancelPress(e,t),{passive:!(r.onTapCancel||r.onPointerCancel)});this.removeEndListeners=(0,eO.z)(n,o),this.startPress(e,t)},this.startAccessiblePress=()=>{let e=eE(this.node.current,"keydown",e=>{"Enter"!==e.key||this.isPressing||(this.removeEndListeners(),this.removeEndListeners=eE(this.node.current,"keyup",e=>{"Enter"===e.key&&this.checkPressEnd()&&eB("up",(e,t)=>{let{onTap:r}=this.node.getProps();r&&ex.Wi.postRender(()=>r(e,t))})}),eB("down",(e,t)=>{this.startPress(e,t)}))}),t=eE(this.node.current,"blur",()=>{this.isPressing&&eB("cancel",(e,t)=>this.cancelPress(e,t))});this.removeAccessibleListeners=(0,eO.z)(e,t)}}startPress(e,t){this.isPressing=!0;let{onTapStart:r,whileTap:n}=this.node.getProps();n&&this.node.animationState&&this.node.animationState.setActive("whileTap",!0),r&&ex.Wi.postRender(()=>r(e,t))}checkPressEnd(){return this.removeEndListeners(),this.isPressing=!1,this.node.getProps().whileTap&&this.node.animationState&&this.node.animationState.setActive("whileTap",!1),!eN()}cancelPress(e,t){if(!this.checkPressEnd())return;let{onTapCancel:r}=this.node.getProps();r&&ex.Wi.postRender(()=>r(e,t))}mount(){let e=this.node.getProps(),t=eC(e.globalTapTarget?window:this.node.current,"pointerdown",this.startPointerPress,{passive:!(e.onTapStart||e.onPointerStart)}),r=eE(this.node.current,"focus",this.startAccessiblePress);this.removeStartListeners=(0,eO.z)(t,r)}unmount(){this.removeStartListeners(),this.removeEndListeners(),this.removeAccessibleListeners()}}let eU=new WeakMap,e$=new WeakMap,eH=e=>{let t=eU.get(e.target);t&&t(e)},eK=e=>{e.forEach(eH)},eq={some:0,all:1};class eG extends eL{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();let{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:n="some",once:o}=e,i={root:t?t.current:void 0,rootMargin:r,threshold:"number"==typeof n?n:eq[n]};return function(e,t,r){let n=function({root:e,...t}){let r=e||document;e$.has(r)||e$.set(r,{});let n=e$.get(r),o=JSON.stringify(t);return n[o]||(n[o]=new IntersectionObserver(eK,{root:e,...t})),n[o]}(t);return eU.set(e,r),n.observe(e),()=>{eU.delete(e),n.unobserve(e)}}(this.node.current,i,e=>{let{isIntersecting:t}=e;if(this.isInView===t||(this.isInView=t,o&&!t&&this.hasEnteredView))return;t&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",t);let{onViewportEnter:r,onViewportLeave:n}=this.node.getProps(),i=t?r:n;i&&i(e)})}mount(){this.startObserver()}update(){if("undefined"==typeof IntersectionObserver)return;let{props:e,prevProps:t}=this.node;["amount","margin","root"].some(function({viewport:e={}},{viewport:t={}}={}){return r=>e[r]!==t[r]}(e,t))&&this.startObserver()}unmount(){}}function eZ(e,t){if(!Array.isArray(t))return!1;let r=t.length;if(r!==e.length)return!1;for(let n=0;n1e3*e,eJ=e=>e/1e3,eQ={type:"spring",stiffness:500,damping:25,restSpeed:10},e0=e=>({type:"spring",stiffness:550,damping:0===e?2*Math.sqrt(550):30,restSpeed:10}),e1={type:"keyframes",duration:.8},e2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},e3=(e,{keyframes:t})=>t.length>2?e1:L.has(e)?e.startsWith("scale")?e0(t[1]):eQ:e2;function e5(e,t){return e[t]||e.default||e}var e4=r(565);let e8={current:!1},e6=e=>null!==e;function e9(e,{repeat:t,repeatType:r="loop"},n){let o=e.filter(e6),i=t&&"loop"!==r&&t%2==1?0:o.length-1;return i&&void 0!==n?n:o[i]}var e7=r(59993);let te=e=>/^0[^.\s]+$/u.test(e);var tt=r(19047);let tr=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),tn=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u,to=new Set(["width","height","top","left","right","bottom","x","y","translateX","translateY"]),ti=e=>e===V.Rx||e===z.px,ta=(e,t)=>parseFloat(e.split(", ")[t]),ts=(e,t)=>(r,{transform:n})=>{if("none"===n||!n)return 0;let o=n.match(/^matrix3d\((.+)\)$/u);if(o)return ta(o[1],t);{let t=n.match(/^matrix\((.+)\)$/u);return t?ta(t[1],e):0}},tl=new Set(["x","y","z"]),tu=N.filter(e=>!tl.has(e)),tc={width:({x:e},{paddingLeft:t="0",paddingRight:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),height:({y:e},{paddingTop:t="0",paddingBottom:r="0"})=>e.max-e.min-parseFloat(t)-parseFloat(r),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:ts(4,13),y:ts(5,14)};tc.translateX=tc.x,tc.translateY=tc.y;let td=e=>t=>t.test(e),tf=[V.Rx,z.px,z.aQ,z.RW,z.vw,z.vh,{test:e=>"auto"===e,parse:e=>e}],tp=e=>tf.find(td(e)),th=new Set,tm=!1,ty=!1;function tg(){if(ty){let e=Array.from(th).filter(e=>e.needsMeasurement),t=new Set(e.map(e=>e.element)),r=new Map;t.forEach(e=>{let t=function(e){let t=[];return tu.forEach(r=>{let n=e.getValue(r);void 0!==n&&(t.push([r,n.get()]),n.set(r.startsWith("scale")?1:0))}),t}(e);t.length&&(r.set(e,t),e.render())}),e.forEach(e=>e.measureInitialState()),t.forEach(e=>{e.render();let t=r.get(e);t&&t.forEach(([t,r])=>{var n;null===(n=e.getValue(t))||void 0===n||n.set(r)})}),e.forEach(e=>e.measureEndState()),e.forEach(e=>{void 0!==e.suspendedScrollY&&window.scrollTo(0,e.suspendedScrollY)})}ty=!1,tm=!1,th.forEach(e=>e.complete()),th.clear()}function tv(){th.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(ty=!0)})}class tb{constructor(e,t,r,n,o,i=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=n,this.element=o,this.isAsync=i}scheduleResolve(){this.isScheduled=!0,this.isAsync?(th.add(this),tm||(tm=!0,ex.Wi.read(tv),ex.Wi.resolveKeyframes(tg))):(this.readKeyframes(),this.complete())}readKeyframes(){let{unresolvedKeyframes:e,name:t,element:r,motionValue:n}=this;for(let o=0;o{let t=e.match(tE);return t?t.map(tP).join(" "):e}};var tR=r(50146);let tj={...W,color:tR.$,backgroundColor:tR.$,outlineColor:tR.$,fill:tR.$,stroke:tR.$,borderColor:tR.$,borderTopColor:tR.$,borderRightColor:tR.$,borderBottomColor:tR.$,borderLeftColor:tR.$,filter:tA,WebkitFilter:tA},tC=e=>tj[e];function tO(e,t){let r=tC(e);return r!==tA&&(r=tw.P),r.getAnimatableNone?r.getAnimatableNone(t):void 0}let tT=new Set(["auto","none","0"]);class tM extends tb{constructor(e,t,r,n){super(e,t,r,n,null==n?void 0:n.owner,!0)}readKeyframes(){let{unresolvedKeyframes:e,element:t,name:r}=this;if(!t.current)return;super.readKeyframes();for(let r=0;r{t.getValue(e).set(r)}),this.resolveNoneKeyframes()}}function tk(e){let t;return()=>(void 0===t&&(t=e()),t)}let tD=(e,t)=>"zIndex"!==t&&!!("number"==typeof e||Array.isArray(e)||"string"==typeof e&&(tw.P.test(e)||"0"===e)&&!e.startsWith("url("));class tN{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:n=0,repeatDelay:o=0,repeatType:i="loop",...a}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.options={autoplay:e,delay:t,type:r,repeat:n,repeatDelay:o,repeatType:i,...a},this.updateFinishedPromise()}get resolved(){return this._resolved||this.hasAttemptedResolve||(tv(),tg()),this._resolved}onKeyframesResolved(e,t){this.hasAttemptedResolve=!0;let{name:r,type:n,velocity:o,delay:i,onComplete:a,onUpdate:s,isGenerator:l}=this.options;if(!l&&!function(e,t,r,n){let o=e[0];if(null===o)return!1;if("display"===t||"visibility"===t)return!0;let i=e[e.length-1],a=tD(o,t),s=tD(i,t);return(0,tt.K)(a===s,`You are trying to animate ${t} from "${o}" to "${i}". ${o} is not an animatable value - to enable this animation set ${o} to a value animatable to ${i} via the \`style\` property.`),!!a&&!!s&&(function(e){let t=e[0];if(1===e.length)return!0;for(let r=0;r{this.resolveFinishedPromise=e})}}var tL=r(83476);function tI(e,t,r){let n=Math.max(t-5,0);return(0,tL.R)(r-e(n),t-n)}var tF=r(51506);function t_(e,t){return e*Math.sqrt(1-t*t)}let tV=["duration","bounce"],tz=["stiffness","damping","mass"];function tB(e,t){return t.some(t=>void 0!==e[t])}function tW({keyframes:e,restDelta:t,restSpeed:r,...n}){let o;let i=e[0],a=e[e.length-1],s={done:!1,value:i},{stiffness:l,damping:u,mass:c,duration:d,velocity:f,isResolvedFromDuration:p}=function(e){let t={velocity:0,stiffness:100,damping:10,mass:1,isResolvedFromDuration:!1,...e};if(!tB(e,tz)&&tB(e,tV)){let r=function({duration:e=800,bounce:t=.25,velocity:r=0,mass:n=1}){let o,i;(0,tt.K)(e<=eY(10),"Spring duration must be 10 seconds or less");let a=1-t;a=(0,tF.u)(.05,1,a),e=(0,tF.u)(.01,10,eJ(e)),a<1?(o=t=>{let n=t*a,o=n*e;return .001-(n-r)/t_(t,a)*Math.exp(-o)},i=t=>{let n=t*a*e,i=Math.pow(a,2)*Math.pow(t,2)*e,s=t_(Math.pow(t,2),a);return(n*r+r-i)*Math.exp(-n)*(-o(t)+.001>0?-1:1)/s}):(o=t=>-.001+Math.exp(-t*e)*((t-r)*e+1),i=t=>e*e*(r-t)*Math.exp(-t*e));let s=function(e,t,r){let n=r;for(let r=1;r<12;r++)n-=e(n)/t(n);return n}(o,i,5/e);if(e=eY(e),isNaN(s))return{stiffness:100,damping:10,duration:e};{let t=Math.pow(s,2)*n;return{stiffness:t,damping:2*a*Math.sqrt(n*t),duration:e}}}(e);(t={...t,...r,mass:1}).isResolvedFromDuration=!0}return t}({...n,velocity:-eJ(n.velocity||0)}),h=f||0,m=u/(2*Math.sqrt(l*c)),y=a-i,g=eJ(Math.sqrt(l/c)),v=5>Math.abs(y);if(r||(r=v?.01:2),t||(t=v?.005:.5),m<1){let e=t_(g,m);o=t=>a-Math.exp(-m*g*t)*((h+m*g*y)/e*Math.sin(e*t)+y*Math.cos(e*t))}else if(1===m)o=e=>a-Math.exp(-g*e)*(y+(h+g*y)*e);else{let e=g*Math.sqrt(m*m-1);o=t=>{let r=Math.exp(-m*g*t),n=Math.min(e*t,300);return a-r*((h+m*g*y)*Math.sinh(n)+e*y*Math.cosh(n))/e}}return{calculatedDuration:p&&d||null,next:e=>{let n=o(e);if(p)s.done=e>=d;else{let i=0;m<1&&(i=0===e?eY(h):tI(o,e,n));let l=Math.abs(i)<=r,u=Math.abs(a-n)<=t;s.done=l&&u}return s.value=s.done?a:n,s}}}function tU({keyframes:e,velocity:t=0,power:r=.8,timeConstant:n=325,bounceDamping:o=10,bounceStiffness:i=500,modifyTarget:a,min:s,max:l,restDelta:u=.5,restSpeed:c}){let d,f;let p=e[0],h={done:!1,value:p},m=e=>void 0!==s&&el,y=e=>void 0===s?l:void 0===l?s:Math.abs(s-e)-g*Math.exp(-e/n),x=e=>b+w(e),S=e=>{let t=w(e),r=x(e);h.done=Math.abs(t)<=u,h.value=h.done?b:r},P=e=>{m(h.value)&&(d=e,f=tW({keyframes:[h.value,y(h.value)],velocity:tI(x,e,h.value),damping:o,stiffness:i,restDelta:u,restSpeed:c}))};return P(0),{calculatedDuration:null,next:e=>{let t=!1;return(f||void 0!==d||(t=!0,S(e),P(e)),void 0!==d&&e>=d)?f.next(e-d):(t||S(e),h)}}}let t$=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function tH(e,t,r,n){if(e===t&&r===n)return ez.Z;let o=t=>(function(e,t,r,n,o){let i,a;let s=0;do(i=t$(a=t+(r-t)/2,n,o)-e)>0?r=a:t=a;while(Math.abs(i)>1e-7&&++s<12);return a})(t,0,1,e,r);return e=>0===e||1===e?e:t$(o(e),t,n)}let tK=tH(.42,0,1,1),tq=tH(0,0,.58,1),tG=tH(.42,0,.58,1),tZ=e=>Array.isArray(e)&&"number"!=typeof e[0],tX=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,tY=e=>t=>1-e(1-t),tJ=e=>1-Math.sin(Math.acos(e)),tQ=tY(tJ),t0=tX(tJ),t1=tH(.33,1.53,.69,.99),t2=tY(t1),t3=tX(t2),t5={linear:ez.Z,easeIn:tK,easeInOut:tG,easeOut:tq,circIn:tJ,circInOut:t0,circOut:tQ,backIn:t2,backInOut:t3,backOut:t1,anticipate:e=>(e*=2)<1?.5*t2(e):.5*(2-Math.pow(2,-10*(e-1)))},t4=e=>{if(Array.isArray(e)){(0,tt.k)(4===e.length,"Cubic bezier arrays must contain four numerical values.");let[t,r,n,o]=e;return tH(t,r,n,o)}return"string"==typeof e?((0,tt.k)(void 0!==t5[e],`Invalid easing type '${e}'`),t5[e]):e};var t8=r(42548),t6=r(75004),t9=r(33217);function t7({duration:e=300,keyframes:t,times:r,ease:n="easeInOut"}){let o=tZ(n)?n.map(t4):t4(n),i={done:!1,value:t[0]},a=(r&&r.length===t.length?r:function(e){let t=[0];return function(e,t){let r=e[e.length-1];for(let n=1;n<=t;n++){let o=(0,t9.Y)(0,t,n);e.push((0,t6.t)(r,1,o))}}(t,e.length-1),t}(t)).map(t=>t*e),s=(0,t8.s)(a,t,{ease:Array.isArray(o)?o:t.map(()=>o||tG).splice(0,t.length-1)});return{calculatedDuration:e,next:t=>(i.value=s(t),i.done=t>=e,i)}}var re=r(5389);let rt=e=>{let t=({timestamp:t})=>e(t);return{start:()=>ex.Wi.update(t,!0),stop:()=>(0,ex.Pn)(t),now:()=>ex.frameData.isProcessing?ex.frameData.timestamp:e7.X.now()}},rr={decay:tU,inertia:tU,tween:t7,keyframes:t7,spring:tW},rn=e=>e/100;class ro extends tN{constructor({KeyframeResolver:e=tb,...t}){super(t),this.holdTime=null,this.startTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.teardown();let{onStop:e}=this.options;e&&e()};let{name:r,motionValue:n,keyframes:o}=this.options,i=(e,t)=>this.onKeyframesResolved(e,t);r&&n&&n.owner?this.resolver=n.owner.resolveKeyframes(o,i,r,n):this.resolver=new e(o,i,r,n),this.resolver.scheduleResolve()}initPlayback(e){let t,r;let{type:n="keyframes",repeat:o=0,repeatDelay:i=0,repeatType:a,velocity:s=0}=this.options,l=rr[n]||t7;l!==t7&&"number"!=typeof e[0]&&(t=(0,eO.z)(rn,(0,re.C)(e[0],e[1])),e=[0,100]);let u=l({...this.options,keyframes:e});"mirror"===a&&(r=l({...this.options,keyframes:[...e].reverse(),velocity:-s})),null===u.calculatedDuration&&(u.calculatedDuration=function(e){let t=0,r=e.next(t);for(;!r.done&&t<2e4;)t+=50,r=e.next(t);return t>=2e4?1/0:t}(u));let{calculatedDuration:c}=u,d=c+i;return{generator:u,mirroredGenerator:r,mapPercentToKeyframes:t,calculatedDuration:c,resolvedDuration:d,totalDuration:d*(o+1)-i}}onPostResolved(){let{autoplay:e=!0}=this.options;this.play(),"paused"!==this.pendingPlayState&&e?this.state=this.pendingPlayState:this.pause()}tick(e,t=!1){let{resolved:r}=this;if(!r){let{keyframes:e}=this.options;return{done:!0,value:e[e.length-1]}}let{finalKeyframe:n,generator:o,mirroredGenerator:i,mapPercentToKeyframes:a,keyframes:s,calculatedDuration:l,totalDuration:u,resolvedDuration:c}=r;if(null===this.startTime)return o.next(0);let{delay:d,repeat:f,repeatType:p,repeatDelay:h,onUpdate:m}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-u/this.speed,this.startTime)),t?this.currentTime=e:null!==this.holdTime?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;let y=this.currentTime-d*(this.speed>=0?1:-1),g=this.speed>=0?y<0:y>u;this.currentTime=Math.max(y,0),"finished"===this.state&&null===this.holdTime&&(this.currentTime=u);let v=this.currentTime,b=o;if(f){let e=Math.min(this.currentTime,u)/c,t=Math.floor(e),r=e%1;!r&&e>=1&&(r=1),1===r&&t--,(t=Math.min(t,f+1))%2&&("reverse"===p?(r=1-r,h&&(r-=h/c)):"mirror"===p&&(b=i)),v=(0,tF.u)(0,1,r)*c}let w=g?{done:!1,value:s[0]}:b.next(v);a&&(w.value=a(w.value));let{done:x}=w;g||null===l||(x=this.speed>=0?this.currentTime>=u:this.currentTime<=0);let S=null===this.holdTime&&("finished"===this.state||"running"===this.state&&x);return S&&void 0!==n&&(w.value=e9(s,this.options,n)),m&&m(w.value),S&&this.finish(),w}get duration(){let{resolved:e}=this;return e?eJ(e.calculatedDuration):0}get time(){return eJ(this.currentTime)}set time(e){e=eY(e),this.currentTime=e,null!==this.holdTime||0===this.speed?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){let t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=eJ(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;let{driver:e=rt,onPlay:t}=this.options;this.driver||(this.driver=e(e=>this.tick(e))),t&&t();let r=this.driver.now();null!==this.holdTime?this.startTime=r-this.holdTime:this.startTime&&"finished"!==this.state||(this.startTime=r),"finished"===this.state&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=null!==(e=this.currentTime)&&void 0!==e?e:0}complete(){"running"!==this.state&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";let{onComplete:e}=this.options;e&&e()}cancel(){null!==this.cancelTime&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}}let ri=e=>Array.isArray(e)&&"number"==typeof e[0],ra=([e,t,r,n])=>`cubic-bezier(${e}, ${t}, ${r}, ${n})`,rs={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:ra([0,.65,.55,1]),circOut:ra([.55,0,1,.45]),backIn:ra([.31,.01,.66,-.59]),backOut:ra([.33,1.53,.69,.99])};function rl(e){return ru(e)||rs.easeOut}function ru(e){if(e)return ri(e)?ra(e):Array.isArray(e)?e.map(rl):rs[e]}let rc=tk(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));class rd extends tN{constructor(e){super(e);let{name:t,motionValue:r,keyframes:n}=this.options;this.resolver=new tM(n,(e,t)=>this.onKeyframesResolved(e,t),t,r),this.resolver.scheduleResolve()}initPlayback(e,t){var r,n;let{duration:o=300,times:i,ease:a,type:s,motionValue:l,name:u}=this.options;if(!(null===(r=l.owner)||void 0===r?void 0:r.current))return!1;if("spring"===(n=this.options).type||!function e(t){return!!(!t||"string"==typeof t&&t in rs||ri(t)||Array.isArray(t)&&t.every(e))}(n.ease)){let{onComplete:t,onUpdate:r,motionValue:n,...l}=this.options,u=function(e,t){let r=new ro({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0}),n={done:!1,value:e[0]},o=[],i=0;for(;!n.done&&i<2e4;)o.push((n=r.sample(i)).value),i+=10;return{times:void 0,keyframes:o,duration:i-10,ease:"linear"}}(e,l);1===(e=u.keyframes).length&&(e[1]=e[0]),o=u.duration,i=u.times,a=u.ease,s="keyframes"}let c=function(e,t,r,{delay:n=0,duration:o=300,repeat:i=0,repeatType:a="loop",ease:s,times:l}={}){let u={[t]:r};l&&(u.offset=l);let c=ru(s);return Array.isArray(c)&&(u.easing=c),e.animate(u,{delay:n,duration:o,easing:Array.isArray(c)?"linear":c,fill:"both",iterations:i+1,direction:"reverse"===a?"alternate":"normal"})}(l.owner.current,u,e,{...this.options,duration:o,times:i,ease:a});return c.startTime=e7.X.now(),this.pendingTimeline?(c.timeline=this.pendingTimeline,this.pendingTimeline=void 0):c.onfinish=()=>{let{onComplete:r}=this.options;l.set(e9(e,this.options,t)),r&&r(),this.cancel(),this.resolveFinishedPromise()},{animation:c,duration:o,times:i,type:s,ease:a,keyframes:e}}get duration(){let{resolved:e}=this;if(!e)return 0;let{duration:t}=e;return eJ(t)}get time(){let{resolved:e}=this;if(!e)return 0;let{animation:t}=e;return eJ(t.currentTime||0)}set time(e){let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.currentTime=eY(e)}get speed(){let{resolved:e}=this;if(!e)return 1;let{animation:t}=e;return t.playbackRate}set speed(e){let{resolved:t}=this;if(!t)return;let{animation:r}=t;r.playbackRate=e}get state(){let{resolved:e}=this;if(!e)return"idle";let{animation:t}=e;return t.playState}attachTimeline(e){if(this._resolved){let{resolved:t}=this;if(!t)return ez.Z;let{animation:r}=t;r.timeline=e,r.onfinish=null}else this.pendingTimeline=e;return ez.Z}play(){if(this.isStopped)return;let{resolved:e}=this;if(!e)return;let{animation:t}=e;"finished"===t.playState&&this.updateFinishedPromise(),t.play()}pause(){let{resolved:e}=this;if(!e)return;let{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,"idle"===this.state)return;this.resolveFinishedPromise(),this.updateFinishedPromise();let{resolved:e}=this;if(!e)return;let{animation:t,keyframes:r,duration:n,type:o,ease:i,times:a}=e;if("idle"===t.playState||"finished"===t.playState)return;if(this.time){let{motionValue:e,onUpdate:t,onComplete:s,...l}=this.options,u=new ro({...l,keyframes:r,duration:n,type:o,ease:i,times:a,isGenerator:!0}),c=eY(this.time);e.setWithVelocity(u.sample(c-10).value,u.sample(c).value,10)}let{onStop:s}=this.options;s&&s(),this.cancel()}complete(){let{resolved:e}=this;e&&e.animation.finish()}cancel(){let{resolved:e}=this;e&&e.animation.cancel()}static supports(e){let{motionValue:t,name:r,repeatDelay:n,repeatType:o,damping:i,type:a}=e;return rc()&&r&&ey.has(r)&&t&&t.owner&&t.owner.current instanceof HTMLElement&&!t.owner.getProps().onUpdate&&!n&&"mirror"!==o&&0!==i&&"inertia"!==a}}let rf=tk(()=>void 0!==window.ScrollTimeline);class rp{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}then(e,t){return Promise.all(this.animations).then(e).catch(t)}getAll(e){return this.animations[0][e]}setAll(e,t){for(let r=0;r{if(!rf()||!t.attachTimeline)return t.pause(),function(e,t){let r;let n=()=>{let{currentTime:n}=t,o=(null===n?0:n.value)/100;r!==o&&e(o),r=o};return ex.Wi.update(n,!0),()=>(0,ex.Pn)(n)}(e=>{t.time=t.duration*e},e);t.attachTimeline(e)});return()=>{t.forEach((e,t)=>{e&&e(),this.animations[t].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get duration(){let e=0;for(let t=0;tt[e]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}let rh=(e,t,r,n={},o,i,a)=>s=>{let l=e5(n,e)||{},u=l.delay||n.delay||0,{elapsed:c=0}=n;c-=eY(u);let d={keyframes:Array.isArray(r)?r:[null,r],ease:"easeOut",velocity:t.getVelocity(),...l,delay:-c,onUpdate:e=>{t.set(e),l.onUpdate&&l.onUpdate(e)},onComplete:()=>{s(),l.onComplete&&l.onComplete(),a&&a()},onStop:a,name:e,motionValue:t,element:i?void 0:o};!function({when:e,delay:t,delayChildren:r,staggerChildren:n,staggerDirection:o,repeat:i,repeatType:a,repeatDelay:s,from:l,elapsed:u,...c}){return!!Object.keys(c).length}(l)&&(d={...d,...e3(e,d)}),d.duration&&(d.duration=eY(d.duration)),d.repeatDelay&&(d.repeatDelay=eY(d.repeatDelay)),void 0!==d.from&&(d.keyframes[0]=d.from);let f=!1;if(!1!==d.type&&(0!==d.duration||d.repeatDelay)||(d.duration=0,0!==d.delay||(f=!0)),(e8.current||e4.c.skipAnimations)&&(f=!0,d.duration=0,d.delay=0),f&&!i&&void 0!==t.get()){let e=e9(d.keyframes,l);if(void 0!==e)return ex.Wi.update(()=>{d.onUpdate(e),d.onComplete()}),new rp([])}return!i&&rd.supports(d)?new rd(d):new ro(d)};var rm=r(20804);function ry(e){return e.getProps()[f]}class rg extends rm.Hg{constructor(){super(...arguments),this.output=[],this.counts=new Map}add(e){let t=eg(e);if(!t)return;let r=this.counts.get(t)||0;this.counts.set(t,r+1),0===r&&(this.output.push(t),this.update());let n=!1;return()=>{if(n)return;n=!0;let e=this.counts.get(t)-1;this.counts.set(t,e),0===e&&((0,ev.cl)(this.output,t),this.update())}}update(){this.set(this.output.length?this.output.join(", "):"auto")}}function rv(e,t){var r,n;if(!e.applyWillChange)return;let o=e.getValue("willChange");if(o||(null===(r=e.props.style)||void 0===r?void 0:r.willChange)||(o=new rg("auto"),e.addValue("willChange",o)),F(n=o)&&n.add)return o.add(t)}function rb(e,t,{delay:r=0,transitionOverride:n,type:o}={}){var i;let{transition:a=e.getDefaultTransition(),transitionEnd:s,...l}=t;n&&(a=n);let u=[],c=o&&e.animationState&&e.animationState.getState()[o];for(let t in l){let n=e.getValue(t,null!==(i=e.latestValues[t])&&void 0!==i?i:null),o=l[t];if(void 0===o||c&&function({protectedKeys:e,needsAnimating:t},r){let n=e.hasOwnProperty(r)&&!0!==t[r];return t[r]=!1,n}(c,t))continue;let s={delay:r,elapsed:0,...e5(a||{},t)},d=!1;if(window.HandoffAppearAnimations){let r=ry(e);if(r){let e=window.HandoffAppearAnimations(r,t,n,ex.Wi);null!==e&&(s.elapsed=e,d=!0)}}n.start(rh(t,n,o,e.shouldReduceMotion&&L.has(t)?{type:!1}:s,e,d,rv(e,t)));let f=n.animation;f&&u.push(f)}return s&&Promise.all(u).then(()=>{ex.Wi.update(()=>{s&&function(e,t){let{transitionEnd:r={},transition:n={},...o}=eX(e,t)||{};for(let t in o={...o,...r}){let r=eh(o[t]);e.hasValue(t)?e.getValue(t).set(r):e.addValue(t,(0,rm.BX)(r))}}(e,s)})}),u}function rw(e,t,r={}){var n;let o=eX(e,t,"exit"===r.type?null===(n=e.presenceContext)||void 0===n?void 0:n.custom:void 0),{transition:i=e.getDefaultTransition()||{}}=o||{};r.transitionOverride&&(i=r.transitionOverride);let a=o?()=>Promise.all(rb(e,o,r)):()=>Promise.resolve(),s=e.variantChildren&&e.variantChildren.size?(n=0)=>{let{delayChildren:o=0,staggerChildren:a,staggerDirection:s}=i;return function(e,t,r=0,n=0,o=1,i){let a=[],s=(e.variantChildren.size-1)*n,l=1===o?(e=0)=>e*n:(e=0)=>s-e*n;return Array.from(e.variantChildren).sort(rx).forEach((e,n)=>{e.notify("AnimationStart",t),a.push(rw(e,t,{...i,delay:r+l(n)}).then(()=>e.notify("AnimationComplete",t)))}),Promise.all(a)}(e,t,o+n,a,s,r)}:()=>Promise.resolve(),{when:l}=i;if(!l)return Promise.all([a(),s(r.delay)]);{let[e,t]="beforeChildren"===l?[a,s]:[s,a];return e().then(()=>t())}}function rx(e,t){return e.sortNodePosition(t)}let rS=[...x].reverse(),rP=x.length;function rE(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function rA(){return{animate:rE(!0),whileInView:rE(),whileHover:rE(),whileTap:rE(),whileDrag:rE(),whileFocus:rE(),exit:rE()}}class rR extends eL{constructor(e){super(e),e.animationState||(e.animationState=function(e){let t=t=>Promise.all(t.map(({animation:t,options:r})=>(function(e,t,r={}){let n;if(e.notify("AnimationStart",t),Array.isArray(t))n=Promise.all(t.map(t=>rw(e,t,r)));else if("string"==typeof t)n=rw(e,t,r);else{let o="function"==typeof t?eX(e,t,r.custom):t;n=Promise.all(rb(e,o,r))}return n.then(()=>{e.notify("AnimationComplete",t)})})(e,t,r))),r=rA(),n=!0,o=t=>(r,n)=>{var o;let i=eX(e,n,"exit"===t?null===(o=e.presenceContext)||void 0===o?void 0:o.custom:void 0);if(i){let{transition:e,transitionEnd:t,...n}=i;r={...r,...n,...t}}return r};function i(i){let a=e.getProps(),s=e.getVariantContext(!0)||{},l=[],u=new Set,c={},d=1/0;for(let t=0;td&&y),S=!1,P=Array.isArray(m)?m:[m],E=P.reduce(o(p),{});!1===g&&(E={});let{prevResolvedValues:A={}}=h,R={...A,...E},j=t=>{x=!0,u.has(t)&&(S=!0,u.delete(t)),h.needsAnimating[t]=!0;let r=e.getValue(t);r&&(r.liveStyle=!1)};for(let e in R){let t=E[e],r=A[e];if(!c.hasOwnProperty(e))(ef(t)&&ef(r)?eZ(t,r):t===r)?void 0!==t&&u.has(e)?j(e):h.protectedKeys[e]=!0:null!=t?j(e):u.add(e)}h.prevProp=m,h.prevResolvedValues=E,h.isActive&&(c={...c,...E}),n&&e.blockInitialAnimation&&(x=!1),x&&(!v||S)&&l.push(...P.map(e=>({animation:e,options:{type:p}})))}if(u.size){let t={};u.forEach(r=>{let n=e.getBaseTarget(r),o=e.getValue(r);o&&(o.liveStyle=!0),t[r]=null!=n?n:null}),l.push({animation:t})}let p=!!l.length;return n&&(!1===a.initial||a.initial===a.animate)&&!e.manuallyAnimateOnMount&&(p=!1),n=!1,p?t(l):Promise.resolve()}return{animateChanges:i,setActive:function(t,n){var o;if(r[t].isActive===n)return Promise.resolve();null===(o=e.variantChildren)||void 0===o||o.forEach(e=>{var r;return null===(r=e.animationState)||void 0===r?void 0:r.setActive(t,n)}),r[t].isActive=n;let a=i(t);for(let e in r)r[e].protectedKeys={};return a},setAnimateFunction:function(r){t=r(e)},getState:()=>r,reset:()=>{r=rA(),n=!0}}}(e))}updateAnimationControlsSubscription(){let{animate:e}=this.node.getProps();w(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){let{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),null===(e=this.unmountControls)||void 0===e||e.call(this)}}let rj=0;class rC extends eL{constructor(){super(...arguments),this.id=rj++}update(){if(!this.node.presenceContext)return;let{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;let n=this.node.animationState.setActive("exit",!e);t&&!e&&n.then(()=>t(this.id))}mount(){let{register:e}=this.node.presenceContext||{};e&&(this.unmount=e(this.id))}unmount(){}}let rO=(e,t)=>Math.abs(e-t);class rT{constructor(e,t,{transformPagePoint:r,contextWindow:n,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{var e,t;if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let r=rD(this.lastMoveEventInfo,this.history),n=null!==this.startEvent,o=(e=r.offset,t={x:0,y:0},Math.sqrt(rO(e.x,t.x)**2+rO(e.y,t.y)**2)>=3);if(!n&&!o)return;let{point:i}=r,{timestamp:a}=ex.frameData;this.history.push({...i,timestamp:a});let{onStart:s,onMove:l}=this.handlers;n||(s&&s(this.lastMoveEvent,r),this.startEvent=this.lastMoveEvent),l&&l(this.lastMoveEvent,r)},this.handlePointerMove=(e,t)=>{this.lastMoveEvent=e,this.lastMoveEventInfo=rM(t,this.transformPagePoint),ex.Wi.update(this.updatePoint,!0)},this.handlePointerUp=(e,t)=>{this.end();let{onEnd:r,onSessionEnd:n,resumeAnimation:o}=this.handlers;if(this.dragSnapToOrigin&&o&&o(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;let i=rD("pointercancel"===e.type?this.lastMoveEventInfo:rM(t,this.transformPagePoint),this.history);this.startEvent&&r&&r(e,i),n&&n(e,i)},!eA(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=r,this.contextWindow=n||window;let i=rM(eR(e),this.transformPagePoint),{point:a}=i,{timestamp:s}=ex.frameData;this.history=[{...a,timestamp:s}];let{onSessionStart:l}=t;l&&l(e,rD(i,this.history)),this.removeListeners=(0,eO.z)(eC(this.contextWindow,"pointermove",this.handlePointerMove),eC(this.contextWindow,"pointerup",this.handlePointerUp),eC(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),(0,ex.Pn)(this.updatePoint)}}function rM(e,t){return t?{point:t(e.point)}:e}function rk(e,t){return{x:e.x-t.x,y:e.y-t.y}}function rD({point:e},t){return{point:e,delta:rk(e,rN(t)),offset:rk(e,t[0]),velocity:function(e,t){if(e.length<2)return{x:0,y:0};let r=e.length-1,n=null,o=rN(e);for(;r>=0&&(n=e[r],!(o.timestamp-n.timestamp>eY(.1)));)r--;if(!n)return{x:0,y:0};let i=eJ(o.timestamp-n.timestamp);if(0===i)return{x:0,y:0};let a={x:(o.x-n.x)/i,y:(o.y-n.y)/i};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}(t,0)}}function rN(e){return e[e.length-1]}function rL(e){return e.max-e.min}function rI(e,t,r,n=.5){e.origin=n,e.originPoint=(0,t6.t)(t.min,t.max,e.origin),e.scale=rL(r)/rL(t),e.translate=(0,t6.t)(r.min,r.max,e.origin)-e.originPoint,(e.scale>=.9999&&e.scale<=1.0001||isNaN(e.scale))&&(e.scale=1),(e.translate>=-.01&&e.translate<=.01||isNaN(e.translate))&&(e.translate=0)}function rF(e,t,r,n){rI(e.x,t.x,r.x,n?n.originX:void 0),rI(e.y,t.y,r.y,n?n.originY:void 0)}function r_(e,t,r){e.min=r.min+t.min,e.max=e.min+rL(t)}function rV(e,t,r){e.min=t.min-r.min,e.max=e.min+rL(t)}function rz(e,t,r){rV(e.x,t.x,r.x),rV(e.y,t.y,r.y)}function rB(e,t,r){return{min:void 0!==t?e.min+t:void 0,max:void 0!==r?e.max+r-(e.max-e.min):void 0}}function rW(e,t){let r=t.min-e.min,n=t.max-e.max;return t.max-t.min({translate:0,scale:1,origin:0,originPoint:0}),rK=()=>({x:rH(),y:rH()}),rq=()=>({min:0,max:0}),rG=()=>({x:rq(),y:rq()});function rZ(e){return[e("x"),e("y")]}function rX({top:e,left:t,right:r,bottom:n}){return{x:{min:t,max:r},y:{min:e,max:n}}}function rY(e){return void 0===e||1===e}function rJ({scale:e,scaleX:t,scaleY:r}){return!rY(e)||!rY(t)||!rY(r)}function rQ(e){return rJ(e)||r0(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function r0(e){var t,r;return(t=e.x)&&"0%"!==t||(r=e.y)&&"0%"!==r}function r1(e,t,r,n,o){return void 0!==o&&(e=n+o*(e-n)),n+r*(e-n)+t}function r2(e,t=0,r=1,n,o){e.min=r1(e.min,t,r,n,o),e.max=r1(e.max,t,r,n,o)}function r3(e,{x:t,y:r}){r2(e.x,t.translate,t.scale,t.originPoint),r2(e.y,r.translate,r.scale,r.originPoint)}function r5(e,t){e.min=e.min+t,e.max=e.max+t}function r4(e,t,r,n,o=.5){let i=(0,t6.t)(e.min,e.max,o);r2(e,t,r,i,n)}function r8(e,t){r4(e.x,t.x,t.scaleX,t.scale,t.originX),r4(e.y,t.y,t.scaleY,t.scale,t.originY)}function r6(e,t){return rX(function(e,t){if(!t)return e;let r=t({x:e.left,y:e.top}),n=t({x:e.right,y:e.bottom});return{top:r.y,left:r.x,bottom:n.y,right:n.x}}(e.getBoundingClientRect(),t))}let r9=({current:e})=>e?e.ownerDocument.defaultView:null,r7=new WeakMap;class ne{constructor(e){this.openGlobalLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=rG(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){let{presenceContext:r}=this.visualElement;if(r&&!1===r.isPresent)return;let{dragSnapToOrigin:n}=this.getProps();this.panSession=new rT(e,{onSessionStart:e=>{let{dragSnapToOrigin:r}=this.getProps();r?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(eR(e,"page").point)},onStart:(e,t)=>{var r;let{drag:n,dragPropagation:o,onDragStart:i}=this.getProps();if(n&&!o&&(this.openGlobalLock&&this.openGlobalLock(),this.openGlobalLock=eD(n),!this.openGlobalLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),rZ(e=>{let t=this.getAxisMotionValue(e).get()||0;if(z.aQ.test(t)){let{projection:r}=this.visualElement;if(r&&r.layout){let n=r.layout.layoutBox[e];if(n){let e=rL(n);t=parseFloat(t)/100*e}}}this.originPoint[e]=t}),i&&ex.Wi.postRender(()=>i(e,t)),null===(r=this.removeWillChange)||void 0===r||r.call(this),this.removeWillChange=rv(this.visualElement,"transform");let{animationState:a}=this.visualElement;a&&a.setActive("whileDrag",!0)},onMove:(e,t)=>{let{dragPropagation:r,dragDirectionLock:n,onDirectionLock:o,onDrag:i}=this.getProps();if(!r&&!this.openGlobalLock)return;let{offset:a}=t;if(n&&null===this.currentDirection){this.currentDirection=function(e,t=10){let r=null;return Math.abs(e.y)>t?r="y":Math.abs(e.x)>t&&(r="x"),r}(a),null!==this.currentDirection&&o&&o(this.currentDirection);return}this.updateAxis("x",t.point,a),this.updateAxis("y",t.point,a),this.visualElement.render(),i&&i(e,t)},onSessionEnd:(e,t)=>this.stop(e,t),resumeAnimation:()=>rZ(e=>{var t;return"paused"===this.getAnimationState(e)&&(null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.play())})},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:n,contextWindow:r9(this.visualElement)})}stop(e,t){var r;null===(r=this.removeWillChange)||void 0===r||r.call(this);let n=this.isDragging;if(this.cancel(),!n)return;let{velocity:o}=t;this.startAnimation(o);let{onDragEnd:i}=this.getProps();i&&ex.Wi.postRender(()=>i(e,t))}cancel(){this.isDragging=!1;let{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;let{dragPropagation:r}=this.getProps();!r&&this.openGlobalLock&&(this.openGlobalLock(),this.openGlobalLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,r){let{drag:n}=this.getProps();if(!r||!nt(e,n,this.currentDirection))return;let o=this.getAxisMotionValue(e),i=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(i=function(e,{min:t,max:r},n){return void 0!==t&&er&&(e=n?(0,t6.t)(r,e,n.max):Math.min(e,r)),e}(i,this.constraints[e],this.elastic[e])),o.set(i)}resolveConstraints(){var e;let{dragConstraints:t,dragElastic:r}=this.getProps(),n=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):null===(e=this.visualElement.projection)||void 0===e?void 0:e.layout,o=this.constraints;t&&m(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&n?this.constraints=function(e,{top:t,left:r,bottom:n,right:o}){return{x:rB(e.x,r,o),y:rB(e.y,t,n)}}(n.layoutBox,t):this.constraints=!1,this.elastic=function(e=.35){return!1===e?e=0:!0===e&&(e=.35),{x:rU(e,"left","right"),y:rU(e,"top","bottom")}}(r),o!==this.constraints&&n&&this.constraints&&!this.hasMutatedConstraints&&rZ(e=>{!1!==this.constraints&&this.getAxisMotionValue(e)&&(this.constraints[e]=function(e,t){let r={};return void 0!==t.min&&(r.min=t.min-e.min),void 0!==t.max&&(r.max=t.max-e.min),r}(n.layoutBox[e],this.constraints[e]))})}resolveRefConstraints(){var e;let{dragConstraints:t,onMeasureDragConstraints:r}=this.getProps();if(!t||!m(t))return!1;let n=t.current;(0,tt.k)(null!==n,"If `dragConstraints` is set as a React ref, that ref must be passed to another component's `ref` prop.");let{projection:o}=this.visualElement;if(!o||!o.layout)return!1;let i=function(e,t,r){let n=r6(e,r),{scroll:o}=t;return o&&(r5(n.x,o.offset.x),r5(n.y,o.offset.y)),n}(n,o.root,this.visualElement.getTransformPagePoint()),a={x:rW((e=o.layout.layoutBox).x,i.x),y:rW(e.y,i.y)};if(r){let e=r(function({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}(a));this.hasMutatedConstraints=!!e,e&&(a=rX(e))}return a}startAnimation(e){let{drag:t,dragMomentum:r,dragElastic:n,dragTransition:o,dragSnapToOrigin:i,onDragTransitionEnd:a}=this.getProps(),s=this.constraints||{};return Promise.all(rZ(a=>{if(!nt(a,t,this.currentDirection))return;let l=s&&s[a]||{};i&&(l={min:0,max:0});let u={type:"inertia",velocity:r?e[a]:0,bounceStiffness:n?200:1e6,bounceDamping:n?40:1e7,timeConstant:750,restDelta:1,restSpeed:10,...o,...l};return this.startAxisValueAnimation(a,u)})).then(a)}startAxisValueAnimation(e,t){let r=this.getAxisMotionValue(e);return r.start(rh(e,r,0,t,this.visualElement,!1,rv(this.visualElement,e)))}stopAnimation(){rZ(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){rZ(e=>{var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.pause()})}getAnimationState(e){var t;return null===(t=this.getAxisMotionValue(e).animation)||void 0===t?void 0:t.state}getAxisMotionValue(e){let t=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps();return r[t]||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){rZ(t=>{let{drag:r}=this.getProps();if(!nt(t,r,this.currentDirection))return;let{projection:n}=this.visualElement,o=this.getAxisMotionValue(t);if(n&&n.layout){let{min:r,max:i}=n.layout.layoutBox[t];o.set(e[t]-(0,t6.t)(r,i,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;let{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!m(t)||!r||!this.constraints)return;this.stopAnimation();let n={x:0,y:0};rZ(e=>{let t=this.getAxisMotionValue(e);if(t&&!1!==this.constraints){let r=t.get();n[e]=function(e,t){let r=.5,n=rL(e),o=rL(t);return o>n?r=(0,t9.Y)(t.min,t.max-n,e.min):n>o&&(r=(0,t9.Y)(e.min,e.max-o,t.min)),(0,tF.u)(0,1,r)}({min:r,max:r},this.constraints[e])}});let{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),rZ(t=>{if(!nt(t,e,null))return;let r=this.getAxisMotionValue(t),{min:o,max:i}=this.constraints[t];r.set((0,t6.t)(o,i,n[t]))})}addListeners(){if(!this.visualElement.current)return;r7.set(this.visualElement,this);let e=eC(this.visualElement.current,"pointerdown",e=>{let{drag:t,dragListener:r=!0}=this.getProps();t&&r&&this.start(e)}),t=()=>{let{dragConstraints:e}=this.getProps();m(e)&&e.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,n=r.addEventListener("measure",t);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),ex.Wi.read(t);let o=eE(window,"resize",()=>this.scalePositionWithinConstraints()),i=r.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t})=>{this.isDragging&&t&&(rZ(t=>{let r=this.getAxisMotionValue(t);r&&(this.originPoint[t]+=e[t].translate,r.set(r.get()+e[t].translate))}),this.visualElement.render())});return()=>{o(),e(),n(),i&&i()}}getProps(){let e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:n=!1,dragConstraints:o=!1,dragElastic:i=.35,dragMomentum:a=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:n,dragConstraints:o,dragElastic:i,dragMomentum:a}}}function nt(e,t,r){return(!0===t||t===e)&&(null===r||r===e)}class nr extends eL{constructor(e){super(e),this.removeGroupControls=ez.Z,this.removeListeners=ez.Z,this.controls=new ne(e)}mount(){let{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||ez.Z}unmount(){this.removeGroupControls(),this.removeListeners()}}let nn=e=>(t,r)=>{e&&ex.Wi.postRender(()=>e(t,r))};class no extends eL{constructor(){super(...arguments),this.removePointerDownListener=ez.Z}onPointerDown(e){this.session=new rT(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:r9(this.node)})}createPanHandlers(){let{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:n}=this.node.getProps();return{onSessionStart:nn(e),onStart:nn(t),onMove:r,onEnd:(e,t)=>{delete this.session,n&&ex.Wi.postRender(()=>n(e,t))}}}mount(){this.removePointerDownListener=eC(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let ni={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function na(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}let ns={correct:(e,t)=>{if(!t.target)return e;if("string"==typeof e){if(!z.px.test(e))return e;e=parseFloat(e)}let r=na(e,t.target.x),n=na(e,t.target.y);return`${r}% ${n}%`}};class nl extends i.Component{componentDidMount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:n}=this.props,{projection:o}=e;Object.assign(D,nc),o&&(t.group&&t.group.add(o),r&&r.register&&n&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ni.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){let{layoutDependency:t,visualElement:r,drag:n,isPresent:o}=this.props,i=r.projection;return i&&(i.isPresent=o,n||e.layoutDependency!==t||void 0===t?i.willUpdate():this.safeToRemove(),e.isPresent===o||(o?i.promote():i.relegate()||ex.Wi.postRender(()=>{let e=i.getStack();e&&e.members.length||this.safeToRemove()}))),null}componentDidUpdate(){let{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),p.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){let{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:n}=e;n&&(n.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(n),r&&r.deregister&&r.deregister(n))}safeToRemove(){let{safeToRemove:e}=this.props;e&&e()}render(){return null}}function nu(e){let[t,r]=function(){let e=(0,i.useContext)(l.O);if(null===e)return[!0,null];let{isPresent:t,onExitComplete:r,register:n}=e,o=(0,i.useId)();(0,i.useEffect)(()=>n(o),[]);let a=(0,i.useCallback)(()=>r&&r(o),[o,r]);return!t&&r?[!1,a]:[!0]}(),n=(0,i.useContext)(O.p);return(0,o.jsx)(nl,{...e,layoutGroup:n,switchLayoutGroup:(0,i.useContext)(y),isPresent:t,safeToRemove:r})}let nc={borderRadius:{...ns,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:ns,borderTopRightRadius:ns,borderBottomLeftRadius:ns,borderBottomRightRadius:ns,boxShadow:{correct:(e,{treeScale:t,projectionDelta:r})=>{let n=tw.P.parse(e);if(n.length>5)return e;let o=tw.P.createTransformer(e),i="number"!=typeof n[0]?1:0,a=r.x.scale*t.x,s=r.y.scale*t.y;n[0+i]/=a,n[1+i]/=s;let l=(0,t6.t)(a,s,.5);return"number"==typeof n[2+i]&&(n[2+i]/=l),"number"==typeof n[3+i]&&(n[3+i]/=l),o(n)}}};var nd=r(72428);let nf=["TopLeft","TopRight","BottomLeft","BottomRight"],np=nf.length,nh=e=>"string"==typeof e?parseFloat(e):e,nm=e=>"number"==typeof e||z.px.test(e);function ny(e,t){return void 0!==e[t]?e[t]:e.borderRadius}let ng=nb(0,.5,tQ),nv=nb(.5,.95,ez.Z);function nb(e,t,r){return n=>nt?1:r((0,t9.Y)(e,t,n))}function nw(e,t){e.min=t.min,e.max=t.max}function nx(e,t){nw(e.x,t.x),nw(e.y,t.y)}function nS(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function nP(e,t,r,n,o){return e-=t,e=n+1/r*(e-n),void 0!==o&&(e=n+1/o*(e-n)),e}function nE(e,t,[r,n,o],i,a){!function(e,t=0,r=1,n=.5,o,i=e,a=e){if(z.aQ.test(t)&&(t=parseFloat(t),t=(0,t6.t)(a.min,a.max,t/100)-a.min),"number"!=typeof t)return;let s=(0,t6.t)(i.min,i.max,n);e===i&&(s-=t),e.min=nP(e.min,t,r,s,o),e.max=nP(e.max,t,r,s,o)}(e,t[r],t[n],t[o],t.scale,i,a)}let nA=["x","scaleX","originX"],nR=["y","scaleY","originY"];function nj(e,t,r,n){nE(e.x,t,nA,r?r.x:void 0,n?n.x:void 0),nE(e.y,t,nR,r?r.y:void 0,n?n.y:void 0)}function nC(e){return 0===e.translate&&1===e.scale}function nO(e){return nC(e.x)&&nC(e.y)}function nT(e,t){return e.min===t.min&&e.max===t.max}function nM(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function nk(e,t){return nM(e.x,t.x)&&nM(e.y,t.y)}function nD(e){return rL(e.x)/rL(e.y)}function nN(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class nL{constructor(){this.members=[]}add(e){(0,ev.y4)(this.members,e),e.scheduleRender()}remove(e){if((0,ev.cl)(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){let e=this.members[this.members.length-1];e&&this.promote(e)}}relegate(e){let t;let r=this.members.findIndex(t=>e===t);if(0===r)return!1;for(let e=r;e>=0;e--){let r=this.members[e];if(!1!==r.isPresent){t=r;break}}return!!t&&(this.promote(t),!0)}promote(e,t){let r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,t&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);let{crossfade:n}=e.options;!1===n&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{let{options:t,resumingFrom:r}=e;t.onExitComplete&&t.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}let nI=(e,t)=>e.depth-t.depth;class nF{constructor(){this.children=[],this.isDirty=!1}add(e){(0,ev.y4)(this.children,e),this.isDirty=!0}remove(e){(0,ev.cl)(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(nI),this.isDirty=!1,this.children.forEach(e)}}let n_={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},nV="undefined"!=typeof window&&void 0!==window.MotionDebug,nz=["","X","Y","Z"],nB={visibility:"hidden"},nW=0;function nU(e,t,r,n){let{latestValues:o}=t;o[e]&&(r[e]=o[e],t.setStaticValue(e,0),n&&(n[e]=0))}function n$({attachResizeListener:e,defaultParent:t,measureScroll:r,checkIsScrollRoot:n,resetTransform:o}){return class{constructor(e={},r=null==t?void 0:t()){this.id=nW++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,nV&&(n_.totalNodes=n_.resolvedTargetDeltas=n_.recalculatedProjection=0),this.nodes.forEach(nq),this.nodes.forEach(n0),this.nodes.forEach(n1),this.nodes.forEach(nG),nV&&window.MotionDebug.record(n_)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=e,this.root=r?r.root||r:this,this.path=r?[...r.path,r]:[],this.parent=r,this.depth=r?r.depth+1:0;for(let e=0;ethis.root.updateBlockedByResize=!1;e(t,()=>{this.root.updateBlockedByResize=!0,r&&r(),r=function(e,t){let r=e7.X.now(),n=({timestamp:t})=>{let o=t-r;o>=250&&((0,ex.Pn)(n),e(o-250))};return ex.Wi.read(n,!0),()=>(0,ex.Pn)(n)}(n,0),ni.hasAnimatedSinceResize&&(ni.hasAnimatedSinceResize=!1,this.nodes.forEach(nQ))})}n&&this.root.registerSharedNode(n,this),!1!==this.options.animate&&i&&(n||o)&&this.addEventListener("didUpdate",({delta:e,hasLayoutChanged:t,hasRelativeTargetChanged:r,layout:n})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}let o=this.options.transition||i.getDefaultTransition()||n6,{onLayoutAnimationStart:a,onLayoutAnimationComplete:s}=i.getProps(),l=!this.targetLayout||!nk(this.targetLayout,n)||r,u=!t&&r;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||u||t&&(l||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(e,u);let t={...e5(o,"layout"),onPlay:a,onComplete:s};(i.shouldReduceMotion||this.options.layoutRoot)&&(t.delay=0,t.type=!1),this.startAnimation(t)}else t||nQ(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=n})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);let e=this.getStack();e&&e.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,(0,ex.Pn)(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){!this.isUpdateBlocked()&&(this.isUpdating=!0,this.nodes&&this.nodes.forEach(n2),this.animationId++)}getTransformTemplate(){let{visualElement:e}=this.options;return e&&e.getProps().transformTemplate}willUpdate(e=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.HandoffCancelAllAnimations&&function e(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return!1;let{visualElement:r}=t.options;return!!r&&(!!ry(r)||!!t.parent&&!t.parent.hasCheckedOptimisedAppear&&e(t.parent))}(this)&&window.HandoffCancelAllAnimations(),this.root.isUpdating||this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let e=0;e{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){!this.snapshot&&this.instance&&(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let e=0;e.999999999999&&(t.x=1),t.y<1.0000000000001&&t.y>.999999999999&&(t.y=1)}}(this.layoutCorrected,this.treeScale,this.path,r),t.layout&&!t.target&&(1!==this.treeScale.x||1!==this.treeScale.y)&&(t.target=t.layout.layoutBox,t.targetWithTransforms=rG());let{target:l}=t;if(!l){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}this.projectionDelta&&this.prevProjectionDelta?(nS(this.prevProjectionDelta.x,this.projectionDelta.x),nS(this.prevProjectionDelta.y,this.projectionDelta.y)):this.createProjectionDeltas(),rF(this.projectionDelta,this.layoutCorrected,l,this.latestValues),this.treeScale.x===a&&this.treeScale.y===s&&nN(this.projectionDelta.x,this.prevProjectionDelta.x)&&nN(this.projectionDelta.y,this.prevProjectionDelta.y)||(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",l)),nV&&n_.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(e=!0){var t;if(null===(t=this.options.visualElement)||void 0===t||t.scheduleRender(),e){let e=this.getStack();e&&e.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=rK(),this.projectionDelta=rK(),this.projectionDeltaWithTransform=rK()}setAnimationOrigin(e,t=!1){let r;let n=this.snapshot,o=n?n.latestValues:{},i={...this.latestValues},a=rK();this.relativeParent&&this.relativeParent.options.layoutRoot||(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!t;let s=rG(),l=(n?n.source:void 0)!==(this.layout?this.layout.source:void 0),u=this.getStack(),c=!u||u.members.length<=1,d=!!(l&&!c&&!0===this.options.crossfade&&!this.path.some(n8));this.animationProgress=0,this.mixTargetDelta=t=>{let n=t/1e3;if(n5(a.x,e.x,n),n5(a.y,e.y,n),this.setTargetDelta(a),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout){var u,f,p,h;rz(s,this.layout.layoutBox,this.relativeParent.layout.layoutBox),p=this.relativeTarget,h=this.relativeTargetOrigin,n4(p.x,h.x,s.x,n),n4(p.y,h.y,s.y,n),r&&(u=this.relativeTarget,f=r,nT(u.x,f.x)&&nT(u.y,f.y))&&(this.isProjectionDirty=!1),r||(r=rG()),nx(r,this.relativeTarget)}l&&(this.animationValues=i,function(e,t,r,n,o,i){o?(e.opacity=(0,t6.t)(0,void 0!==r.opacity?r.opacity:1,ng(n)),e.opacityExit=(0,t6.t)(void 0!==t.opacity?t.opacity:1,0,nv(n))):i&&(e.opacity=(0,t6.t)(void 0!==t.opacity?t.opacity:1,void 0!==r.opacity?r.opacity:1,n));for(let o=0;o{ni.hasAnimatedSinceResize=!0,this.currentAnimation=function(e,t,r){let n=F(0)?0:(0,rm.BX)(0);return n.start(rh("",n,1e3,r)),n.animation}(0,0,{...e,onUpdate:t=>{this.mixTargetDelta(t),e.onUpdate&&e.onUpdate(t)},onComplete:()=>{e.onComplete&&e.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);let e=this.getStack();e&&e.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(1e3),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){let e=this.getLead(),{targetWithTransforms:t,target:r,layout:n,latestValues:o}=e;if(t&&r&&n){if(this!==e&&this.layout&&n&&ot(this.options.animationType,this.layout.layoutBox,n.layoutBox)){r=this.target||rG();let t=rL(this.layout.layoutBox.x);r.x.min=e.target.x.min,r.x.max=r.x.min+t;let n=rL(this.layout.layoutBox.y);r.y.min=e.target.y.min,r.y.max=r.y.min+n}nx(t,r),r8(t,o),rF(this.projectionDeltaWithTransform,this.layoutCorrected,t,o)}}registerSharedNode(e,t){this.sharedNodes.has(e)||this.sharedNodes.set(e,new nL),this.sharedNodes.get(e).add(t);let r=t.options.initialPromotionConfig;t.promote({transition:r?r.transition:void 0,preserveFollowOpacity:r&&r.shouldPreserveFollowOpacity?r.shouldPreserveFollowOpacity(t):void 0})}isLead(){let e=this.getStack();return!e||e.lead===this}getLead(){var e;let{layoutId:t}=this.options;return t&&(null===(e=this.getStack())||void 0===e?void 0:e.lead)||this}getPrevLead(){var e;let{layoutId:t}=this.options;return t?null===(e=this.getStack())||void 0===e?void 0:e.prevLead:void 0}getStack(){let{layoutId:e}=this.options;if(e)return this.root.sharedNodes.get(e)}promote({needsReset:e,transition:t,preserveFollowOpacity:r}={}){let n=this.getStack();n&&n.promote(this,r),e&&(this.projectionDelta=void 0,this.needsReset=!0),t&&this.setOptions({transition:t})}relegate(){let e=this.getStack();return!!e&&e.relegate(this)}resetSkewAndRotation(){let{visualElement:e}=this.options;if(!e)return;let t=!1,{latestValues:r}=e;if((r.z||r.rotate||r.rotateX||r.rotateY||r.rotateZ||r.skewX||r.skewY)&&(t=!0),!t)return;let n={};r.z&&nU("z",e,n,this.animationValues);for(let t=0;t{var t;return null===(t=e.currentAnimation)||void 0===t?void 0:t.stop()}),this.root.nodes.forEach(nX),this.root.sharedNodes.clear()}}}function nH(e){e.updateLayout()}function nK(e){var t;let r=(null===(t=e.resumeFrom)||void 0===t?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&r&&e.hasListeners("didUpdate")){let{layoutBox:t,measuredBox:n}=e.layout,{animationType:o}=e.options,i=r.source!==e.layout.source;"size"===o?rZ(e=>{let n=i?r.measuredBox[e]:r.layoutBox[e],o=rL(n);n.min=t[e].min,n.max=n.min+o}):ot(o,r.layoutBox,t)&&rZ(n=>{let o=i?r.measuredBox[n]:r.layoutBox[n],a=rL(t[n]);o.max=o.min+a,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[n].max=e.relativeTarget[n].min+a)});let a=rK();rF(a,t,r.layoutBox);let s=rK();i?rF(s,e.applyTransform(n,!0),r.measuredBox):rF(s,t,r.layoutBox);let l=!nO(a),u=!1;if(!e.resumeFrom){let n=e.getClosestProjectingParent();if(n&&!n.resumeFrom){let{snapshot:o,layout:i}=n;if(o&&i){let a=rG();rz(a,r.layoutBox,o.layoutBox);let s=rG();rz(s,t,i.layoutBox),nk(a,s)||(u=!0),n.options.layoutRoot&&(e.relativeTarget=s,e.relativeTargetOrigin=a,e.relativeParent=n)}}}e.notifyListeners("didUpdate",{layout:t,snapshot:r,delta:s,layoutDelta:a,hasLayoutChanged:l,hasRelativeTargetChanged:u})}else if(e.isLead()){let{onExitComplete:t}=e.options;t&&t()}e.options.transition=void 0}function nq(e){nV&&n_.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function nG(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function nZ(e){e.clearSnapshot()}function nX(e){e.clearMeasurements()}function nY(e){e.isLayoutDirty=!1}function nJ(e){let{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function nQ(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function n0(e){e.resolveTargetDelta()}function n1(e){e.calcProjection()}function n2(e){e.resetSkewAndRotation()}function n3(e){e.removeLeadSnapshot()}function n5(e,t,r){e.translate=(0,t6.t)(t.translate,0,r),e.scale=(0,t6.t)(t.scale,1,r),e.origin=t.origin,e.originPoint=t.originPoint}function n4(e,t,r,n){e.min=(0,t6.t)(t.min,r.min,n),e.max=(0,t6.t)(t.max,r.max,n)}function n8(e){return e.animationValues&&void 0!==e.animationValues.opacityExit}let n6={duration:.45,ease:[.4,0,.1,1]},n9=e=>"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),n7=n9("applewebkit/")&&!n9("chrome/")?Math.round:ez.Z;function oe(e){e.min=n7(e.min),e.max=n7(e.max)}function ot(e,t,r){return"position"===e||"preserve-aspect"===e&&!(.2>=Math.abs(nD(t)-nD(r)))}function or(e){var t;return e!==e.root&&(null===(t=e.scroll)||void 0===t?void 0:t.wasRoot)}let on=n$({attachResizeListener:(e,t)=>eE(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),oo={current:void 0},oi=n$({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!oo.current){let e=new on({});e.mount(window),e.setOptions({layoutScroll:!0}),oo.current=e}return oo.current},resetTransform:(e,t)=>{e.style.transform=void 0!==t?t:"none"},checkIsScrollRoot:e=>"fixed"===window.getComputedStyle(e).position}),oa={current:null},os={current:!1},ol=new WeakMap,ou=[...tf,tR.$,tw.P],oc=e=>ou.find(td(e)),od=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"],of=S.length;class op{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:n,blockInitialAnimation:o,visualState:i},a={}){this.applyWillChange=!1,this.resolveKeyframes=(e,t,r,n)=>new this.KeyframeResolver(e,t,r,n,this),this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=tb,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.isRenderScheduled=!1,this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.isRenderScheduled=!1,this.scheduleRender=()=>{this.isRenderScheduled||(this.isRenderScheduled=!0,ex.Wi.render(this.render,!1,!0))};let{latestValues:s,renderState:l}=i;this.latestValues=s,this.baseTarget={...s},this.initialValues=t.initial?{...s}:{},this.renderState=l,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=n,this.options=a,this.blockInitialAnimation=!!o,this.isControllingVariants=P(t),this.isVariantNode=E(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);let{willChange:u,...c}=this.scrapeMotionValuesFromProps(t,{},this);for(let e in c){let t=c[e];void 0!==s[e]&&F(t)&&t.set(s[e],!1)}}mount(e){this.current=e,ol.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((e,t)=>this.bindToMotionValue(t,e)),os.current||function(){if(os.current=!0,C.j){if(window.matchMedia){let e=window.matchMedia("(prefers-reduced-motion)"),t=()=>oa.current=e.matches;e.addListener(t),t()}else oa.current=!1}}(),this.shouldReduceMotion="never"!==this.reducedMotionConfig&&("always"===this.reducedMotionConfig||oa.current),this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){for(let e in ol.delete(this.current),this.projection&&this.projection.unmount(),(0,ex.Pn)(this.notifyUpdate),(0,ex.Pn)(this.render),this.valueSubscriptions.forEach(e=>e()),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this),this.events)this.events[e].clear();for(let e in this.features){let t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){let r=L.has(e),n=t.on("change",t=>{this.latestValues[e]=t,this.props.onUpdate&&ex.Wi.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);this.valueSubscriptions.set(e,()=>{n(),o(),t.owner&&t.stop()})}sortNodePosition(e){return this.current&&this.sortInstanceNodePosition&&this.type===e.type?this.sortInstanceNodePosition(this.current,e.current):0}updateFeatures(){let e="animation";for(e in j){let t=j[e];if(!t)continue;let{isEnabled:r,Feature:n}=t;if(!this.features[e]&&n&&r(this.props)&&(this.features[e]=new n(this)),this.features[e]){let t=this.features[e];t.isMounted?t.update():(t.mount(),t.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):rG()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let t=0;tt.variantChildren.delete(e)}addValue(e,t){let r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);let t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return void 0===r&&void 0!==t&&(r=(0,rm.BX)(null===t?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){var r;let n=void 0===this.latestValues[e]&&this.current?null!==(r=this.getBaseTargetFromProps(this.props,e))&&void 0!==r?r:this.readValueFromInstance(this.current,e,this.options):this.latestValues[e];return null!=n&&("string"==typeof n&&(tr(n)||te(n))?n=parseFloat(n):!oc(n)&&tw.P.test(t)&&(n=tO(e,t)),this.setBaseTarget(e,F(n)?n.get():n)),F(n)?n.get():n}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;let r;let{initial:n}=this.props;if("string"==typeof n||"object"==typeof n){let o=ec(this.props,n,null===(t=this.presenceContext)||void 0===t?void 0:t.custom);o&&(r=o[e])}if(n&&void 0!==r)return r;let o=this.getBaseTargetFromProps(this.props,e);return void 0===o||F(o)?void 0!==this.initialValues[e]&&void 0===r?void 0:this.baseTarget[e]:o}on(e,t){return this.events[e]||(this.events[e]=new nd.L),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class oh extends op{constructor(){super(...arguments),this.KeyframeResolver=tM}sortInstanceNodePosition(e,t){return 2&e.compareDocumentPosition(t)?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}}class om extends oh{constructor(){super(...arguments),this.type="html",this.applyWillChange=!0,this.renderInstance=eo}readValueFromInstance(e,t){if(L.has(t)){let e=tC(t);return e&&e.default||0}{let r=window.getComputedStyle(e),n=((0,H.f)(t)?r.getPropertyValue(t):r[t])||0;return"string"==typeof n?n.trim():n}}measureInstanceViewportBox(e,{transformPagePoint:t}){return r6(e,t)}build(e,t,r){K(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return es(e,t,r)}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);let{children:e}=this.props;F(e)&&(this.childSubscription=e.on("change",e=>{this.current&&(this.current.textContent=`${e}`)}))}}class oy extends oh{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=rG}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(L.has(t)){let e=tC(t);return e&&e.default||0}return t=ei.has(t)?t:d(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return el(e,t,r)}build(e,t,r){et(e,t,this.isSVGTag,r.transformTemplate)}renderInstance(e,t,r,n){ea(e,t,r,n)}mount(e){this.isSVGTag=en(e.tagName),super.mount(e)}}let og=(e,t)=>k(e)?new oy(t):new om(t,{allowProjection:e!==i.Fragment}),ov={animation:{Feature:rR},exit:{Feature:rC},inView:{Feature:eG},tap:{Feature:eW},focus:{Feature:e_},hover:{Feature:eF},pan:{Feature:no},drag:{Feature:nr,ProjectionNode:oi,MeasureLayout:nu},layout:{ProjectionNode:oi,MeasureLayout:nu}},ob=function(e){function t(t,r={}){return function({preloadedFeatures:e,createVisualElement:t,useRender:r,useVisualState:n,Component:d}){e&&function(e){for(let t in e)j[t]={...j[t],...e[t]}}(e);let h=(0,i.forwardRef)(function(e,h){var w;let x;let S={...(0,i.useContext)(a._),...e,layoutId:function({layoutId:e}){let t=(0,i.useContext)(O.p).id;return t&&void 0!==e?t+"-"+e:e}(e)},{isStatic:E}=S,R=function(e){let{initial:t,animate:r}=function(e,t){if(P(e)){let{initial:t,animate:r}=e;return{initial:!1===t||b(t)?t:void 0,animate:b(r)?r:void 0}}return!1!==e.inherit?t:{}}(e,(0,i.useContext)(s));return(0,i.useMemo)(()=>({initial:t,animate:r}),[A(t),A(r)])}(e),T=n(e,E);if(!E&&C.j){(0,i.useContext)(c).strict;let e=function(e){let{drag:t,layout:r}=j;if(!t&&!r)return{};let n={...t,...r};return{MeasureLayout:(null==t?void 0:t.isEnabled(e))||(null==r?void 0:r.isEnabled(e))?n.MeasureLayout:void 0,ProjectionNode:n.ProjectionNode}}(S);x=e.MeasureLayout,R.visualElement=function(e,t,r,n,o){let{visualElement:d}=(0,i.useContext)(s),h=(0,i.useContext)(c),b=(0,i.useContext)(l.O),w=(0,i.useContext)(a._).reducedMotion,x=(0,i.useRef)();n=n||h.renderer,!x.current&&n&&(x.current=n(e,{visualState:t,parent:d,props:r,presenceContext:b,blockInitialAnimation:!!b&&!1===b.initial,reducedMotionConfig:w}));let S=x.current,P=(0,i.useContext)(y);S&&!S.projection&&o&&("html"===S.type||"svg"===S.type)&&function(e,t,r,n){let{layoutId:o,layout:i,drag:a,dragConstraints:s,layoutScroll:l,layoutRoot:u}=t;e.projection=new r(e.latestValues,t["data-framer-portal-id"]?void 0:function e(t){if(t)return!1!==t.options.allowProjection?t.projection:e(t.parent)}(e.parent)),e.projection.setOptions({layoutId:o,layout:i,alwaysMeasureLayout:!!a||s&&m(s),visualElement:e,animationType:"string"==typeof i?i:"both",initialPromotionConfig:n,layoutScroll:l,layoutRoot:u})}(x.current,r,o,P),(0,i.useInsertionEffect)(()=>{S&&S.update(r,b)});let E=(0,i.useRef)(!!(r[f]&&!window.HandoffComplete));return(0,u.L)(()=>{S&&(S.updateFeatures(),p.render(S.render),E.current&&S.animationState&&S.animationState.animateChanges())}),(0,i.useEffect)(()=>{S&&(!E.current&&S.animationState&&S.animationState.animateChanges(),E.current&&(E.current=!1,g||(g=!0,queueMicrotask(v))))}),S}(d,T,S,t,e.ProjectionNode)}return(0,o.jsxs)(s.Provider,{value:R,children:[x&&R.visualElement?(0,o.jsx)(x,{visualElement:R.visualElement,...S}):null,r(d,e,(w=R.visualElement,(0,i.useCallback)(e=>{e&&T.mount&&T.mount(e),w&&(e?w.mount(e):w.unmount()),h&&("function"==typeof h?h(e):m(h)&&(h.current=e))},[w])),T,E,R.visualElement)]})});return h[T]=d,h}(e(t,r))}if("undefined"==typeof Proxy)return t;let r=new Map;return new Proxy(t,{get:(e,n)=>(r.has(n)||r.set(n,t(n)),r.get(n))})}((e,t)=>(function(e,{forwardMotionProps:t=!1},r,n){return{...k(e)?eS:eP,preloadedFeatures:r,useRender:function(e=!1){return(t,r,n,{latestValues:o},a)=>{let s=(k(t)?function(e,t,r,n){let o=(0,i.useMemo)(()=>{let r=er();return et(r,t,en(n),e.transformTemplate),{...r.attrs,style:{...r.style}}},[t]);if(e.style){let t={};G(t,e.style,e),o.style={...t,...o.style}}return o}:function(e,t){let r={},n=function(e,t){let r=e.style||{},n={};return G(n,r,e),Object.assign(n,function({transformTemplate:e},t){return(0,i.useMemo)(()=>{let r=q();return K(r,t,e),Object.assign({},r.vars,r.style)},[t])}(e,t)),n}(e,t);return e.drag&&!1!==e.dragListener&&(r.draggable=!1,n.userSelect=n.WebkitUserSelect=n.WebkitTouchCallout="none",n.touchAction=!0===e.drag?"none":`pan-${"x"===e.drag?"y":"x"}`),void 0===e.tabIndex&&(e.onTap||e.onTapStart||e.whileTap)&&(r.tabIndex=0),r.style=n,r})(r,o,a,t),l=function(e,t,r){let n={};for(let o in e)("values"!==o||"object"!=typeof e.values)&&(Y(o)||!0===r&&X(o)||!t&&!X(o)||e.draggable&&o.startsWith("onDrag"))&&(n[o]=e[o]);return n}(r,"string"==typeof t,e),u=t!==i.Fragment?{...l,...s,ref:n}:{},{children:c}=r,d=(0,i.useMemo)(()=>F(c)?c.get():c,[c]);return(0,i.createElement)(t,{...u,children:d})}}(t),createVisualElement:n,Component:e}})(e,t,ov,og))},61534:function(e,t,r){"use strict";r.d(t,{f:function(){return o},t:function(){return a}});let n=e=>t=>"string"==typeof t&&t.startsWith(e),o=n("--"),i=n("var(--"),a=e=>!!i(e)&&s.test(e.split("/*")[0].trim()),s=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu},565:function(e,t,r){"use strict";r.d(t,{c:function(){return n}});let n={skipAnimations:!1,useManualTiming:!1}},28746:function(e,t,r){"use strict";function n(e,t){-1===e.indexOf(t)&&e.push(t)}function o(e,t){let r=e.indexOf(t);r>-1&&e.splice(r,1)}r.d(t,{cl:function(){return o},y4:function(){return n}})},51506:function(e,t,r){"use strict";r.d(t,{u:function(){return n}});let n=(e,t,r)=>r>t?t:rt[0];if(2===d&&e[0]===e[1])return()=>t[1];e[0]>e[d-1]&&(e=[...e].reverse(),t=[...t].reverse());let f=function(e,t,r){let n=[],o=r||l.C,a=e.length-1;for(let r=0;r{let r=0;if(p>1)for(;rh((0,o.u)(e[0],e[d-1],t)):h}},77282:function(e,t,r){"use strict";r.d(t,{j:function(){return n}});let n="undefined"!=typeof window},5389:function(e,t,r){"use strict";r.d(t,{C:function(){return A}});var n=r(75004),o=r(19047);function i(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}var a=r(45778),s=r(91583),l=r(598);function u(e,t){return r=>r>0?t:e}let c=(e,t,r)=>{let n=e*e,o=r*(t*t-n)+n;return o<0?0:Math.sqrt(o)},d=[a.$,s.m,l.J],f=e=>d.find(t=>t.test(e));function p(e){let t=f(e);if((0,o.K)(!!t,`'${e}' is not an animatable color. Use the equivalent color code instead.`),!t)return!1;let r=t.parse(e);return t===l.J&&(r=function({hue:e,saturation:t,lightness:r,alpha:n}){e/=360,r/=100;let o=0,a=0,s=0;if(t/=100){let n=r<.5?r*(1+t):r+t-r*t,l=2*r-n;o=i(l,n,e+1/3),a=i(l,n,e),s=i(l,n,e-1/3)}else o=a=s=r;return{red:Math.round(255*o),green:Math.round(255*a),blue:Math.round(255*s),alpha:n}}(r)),r}let h=(e,t)=>{let r=p(e),o=p(t);if(!r||!o)return u(e,t);let i={...r};return e=>(i.red=c(r.red,o.red,e),i.green=c(r.green,o.green,e),i.blue=c(r.blue,o.blue,e),i.alpha=(0,n.t)(r.alpha,o.alpha,e),s.m.transform(i))};var m=r(89654),y=r(50146),g=r(83646),v=r(61534);let b=new Set(["none","hidden"]);function w(e,t){return r=>(0,n.t)(e,t,r)}function x(e){return"number"==typeof e?w:"string"==typeof e?(0,v.t)(e)?u:y.$.test(e)?h:E:Array.isArray(e)?S:"object"==typeof e?y.$.test(e)?h:P:u}function S(e,t){let r=[...e],n=r.length,o=e.map((e,r)=>x(e)(e,t[r]));return e=>{for(let t=0;t{for(let t in n)r[t]=n[t](e);return r}}let E=(e,t)=>{let r=g.P.createTransformer(t),n=(0,g.V)(e),i=(0,g.V)(t);return n.indexes.var.length===i.indexes.var.length&&n.indexes.color.length===i.indexes.color.length&&n.indexes.number.length>=i.indexes.number.length?b.has(e)&&!i.values.length||b.has(t)&&!n.values.length?b.has(e)?r=>r<=0?e:t:r=>r>=1?t:e:(0,m.z)(S(function(e,t){var r;let n=[],o={color:0,var:0,number:0};for(let i=0;ie+(t-e)*r},69276:function(e,t,r){"use strict";r.d(t,{Z:function(){return n}});let n=e=>e},89654:function(e,t,r){"use strict";r.d(t,{z:function(){return o}});let n=(e,t)=>r=>t(e(r)),o=(...e)=>e.reduce(n)},33217:function(e,t,r){"use strict";r.d(t,{Y:function(){return n}});let n=(e,t,r)=>{let n=t-e;return 0===n?1:(r-e)/n}},72428:function(e,t,r){"use strict";r.d(t,{L:function(){return o}});var n=r(28746);class o{constructor(){this.subscriptions=[]}add(e){return(0,n.y4)(this.subscriptions,e),()=>(0,n.cl)(this.subscriptions,e)}notify(e,t,r){let n=this.subscriptions.length;if(n){if(1===n)this.subscriptions[0](e,t,r);else for(let o=0;o!isNaN(parseFloat(e)),l={current:void 0};class u{constructor(e,t={}){this.version="11.3.22",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(e,t=!0)=>{let r=i.X.now();this.updatedAt!==r&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(e),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),t&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=i.X.now(),null===this.canTrackVelocity&&void 0!==e&&(this.canTrackVelocity=s(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new n.L);let r=this.events[e].add(t);return"change"===e?()=>{r(),a.Wi.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(let e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){t&&this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e,t)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return l.current&&l.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){let e=i.X.now();if(!this.canTrackVelocity||void 0===this.prevFrameValue||e-this.updatedAt>30)return 0;let t=Math.min(this.updatedAt-this.prevUpdatedAt,30);return(0,o.R)(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function c(e,t){return new u(e,t)}},45778:function(e,t,r){"use strict";r.d(t,{$:function(){return o}});var n=r(91583);let o={test:(0,r(93338).i)("#"),parse:function(e){let t="",r="",n="",o="";return e.length>5?(t=e.substring(1,3),r=e.substring(3,5),n=e.substring(5,7),o=e.substring(7,9)):(t=e.substring(1,2),r=e.substring(2,3),n=e.substring(3,4),o=e.substring(4,5),t+=t,r+=r,n+=n,o+=o),{red:parseInt(t,16),green:parseInt(r,16),blue:parseInt(n,16),alpha:o?parseInt(o,16)/255:1}},transform:n.m.transform}},598:function(e,t,r){"use strict";r.d(t,{J:function(){return s}});var n=r(40783),o=r(75480),i=r(47292),a=r(93338);let s={test:(0,a.i)("hsl","hue"),parse:(0,a.d)("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:r,alpha:a=1})=>"hsla("+Math.round(e)+", "+o.aQ.transform((0,i.Nw)(t))+", "+o.aQ.transform((0,i.Nw)(r))+", "+(0,i.Nw)(n.Fq.transform(a))+")"}},50146:function(e,t,r){"use strict";r.d(t,{$:function(){return s}});var n=r(47292),o=r(45778),i=r(598),a=r(91583);let s={test:e=>a.m.test(e)||o.$.test(e)||i.J.test(e),parse:e=>a.m.test(e)?a.m.parse(e):i.J.test(e)?i.J.parse(e):o.$.parse(e),transform:e=>(0,n.HD)(e)?e:e.hasOwnProperty("red")?a.m.transform(e):i.J.transform(e)}},91583:function(e,t,r){"use strict";r.d(t,{m:function(){return u}});var n=r(51506),o=r(40783),i=r(47292),a=r(93338);let s=e=>(0,n.u)(0,255,e),l={...o.Rx,transform:e=>Math.round(s(e))},u={test:(0,a.i)("rgb","red"),parse:(0,a.d)("red","green","blue"),transform:({red:e,green:t,blue:r,alpha:n=1})=>"rgba("+l.transform(e)+", "+l.transform(t)+", "+l.transform(r)+", "+(0,i.Nw)(o.Fq.transform(n))+")"}},93338:function(e,t,r){"use strict";r.d(t,{d:function(){return i},i:function(){return o}});var n=r(47292);let o=(e,t)=>r=>!!((0,n.HD)(r)&&n.mj.test(r)&&r.startsWith(e)||t&&!(0,n.Rw)(r)&&Object.prototype.hasOwnProperty.call(r,t)),i=(e,t,r)=>o=>{if(!(0,n.HD)(o))return o;let[i,a,s,l]=o.match(n.KP);return{[e]:parseFloat(i),[t]:parseFloat(a),[r]:parseFloat(s),alpha:void 0!==l?parseFloat(l):1}}},83646:function(e,t,r){"use strict";r.d(t,{P:function(){return f},V:function(){return l}});var n=r(50146),o=r(47292);let i="number",a="color",s=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function l(e){let t=e.toString(),r=[],o={color:[],number:[],var:[]},l=[],u=0,c=t.replace(s,e=>(n.$.test(e)?(o.color.push(u),l.push(a),r.push(n.$.parse(e))):e.startsWith("var(")?(o.var.push(u),l.push("var"),r.push(e)):(o.number.push(u),l.push(i),r.push(parseFloat(e))),++u,"${}")).split("${}");return{values:r,split:c,indexes:o,types:l}}function u(e){return l(e).values}function c(e){let{split:t,types:r}=l(e),s=t.length;return e=>{let l="";for(let u=0;u"number"==typeof e?0:e,f={test:function(e){var t,r;return isNaN(e)&&(0,o.HD)(e)&&((null===(t=e.match(o.KP))||void 0===t?void 0:t.length)||0)+((null===(r=e.match(o.dA))||void 0===r?void 0:r.length)||0)>0},parse:u,createTransformer:c,getAnimatableNone:function(e){let t=u(e);return c(e)(t.map(d))}}},40783:function(e,t,r){"use strict";r.d(t,{Fq:function(){return i},Rx:function(){return o},bA:function(){return a}});var n=r(51506);let o={test:e=>"number"==typeof e,parse:parseFloat,transform:e=>e},i={...o,transform:e=>(0,n.u)(0,1,e)},a={...o,default:1}},75480:function(e,t,r){"use strict";r.d(t,{$C:function(){return c},RW:function(){return i},aQ:function(){return a},px:function(){return s},vh:function(){return l},vw:function(){return u}});var n=r(47292);let o=e=>({test:t=>(0,n.HD)(t)&&t.endsWith(e)&&1===t.split(" ").length,parse:parseFloat,transform:t=>`${t}${e}`}),i=o("deg"),a=o("%"),s=o("px"),l=o("vh"),u=o("vw"),c={...a,parse:e=>a.parse(e)/100,transform:e=>a.transform(100*e)}},47292:function(e,t,r){"use strict";r.d(t,{HD:function(){return s},KP:function(){return o},Nw:function(){return n},Rw:function(){return l},dA:function(){return i},mj:function(){return a}});let n=e=>Math.round(1e5*e)/1e5,o=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu,i=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu,a=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu;function s(e){return"string"==typeof e}function l(e){return null==e}},45282:function(e,t,r){"use strict";r.d(t,{c:function(){return s}});var n=r(2265),o=r(20804),i=r(29791),a=r(30458);function s(e){let t=(0,a.h)(()=>(0,o.BX)(e)),{isStatic:r}=(0,n.useContext)(i._);if(r){let[,r]=(0,n.useState)(e);(0,n.useEffect)(()=>t.on("change",r),[])}return t}},80847:function(e,t,r){"use strict";r.d(t,{H:function(){return f}});var n=r(42548);let o=e=>e&&"object"==typeof e&&e.mix,i=e=>o(e)?e.mix:void 0;var a=r(45282),s=r(9033),l=r(86219);function u(e,t){let r=(0,a.c)(t()),n=()=>r.set(t());return n(),(0,s.L)(()=>{let t=()=>l.Wi.preRender(n,!1,!0),r=e.map(e=>e.on("change",t));return()=>{r.forEach(e=>e()),(0,l.Pn)(n)}}),r}var c=r(30458),d=r(20804);function f(e,t,r,o){if("function"==typeof e)return function(e){d.S1.current=[],e();let t=u(d.S1.current,e);return d.S1.current=void 0,t}(e);let a="function"==typeof t?t:function(...e){let t=!Array.isArray(e[0]),r=t?0:-1,o=e[0+r],a=e[1+r],s=e[2+r],l=e[3+r],u=(0,n.s)(a,s,{mixer:i(s[0]),...l});return t?u(o):u}(t,r,o);return Array.isArray(e)?p(e,a):p([e],([e])=>a(e))}function p(e,t){let r=(0,c.h)(()=>[]);return u(e,()=>{r.length=0;let n=e.length;for(let t=0;tn.createElement(d,s({attr:u({},e.attr)},t),function e(t){return t&&t.map((t,r)=>n.createElement(t.tag,u({key:r},t.attr),e(t.child)))}(e.child))}function d(e){var t=t=>{var r,{attr:o,size:i,title:l}=e,c=function(e,t){if(null==e)return{};var r,n,o=function(e,t){if(null==e)return{};var r={};for(var n in e)if(Object.prototype.hasOwnProperty.call(e,n)){if(t.indexOf(n)>=0)continue;r[n]=e[n]}return r}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(o[r]=e[r])}return o}(e,a),d=i||t.size||"1em";return t.className&&(r=t.className),e.className&&(r=(r?r+" ":"")+e.className),n.createElement("svg",s({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},t.attr,o,c,{className:r,style:u(u({color:e.color||t.color},t.style),e.style),height:d,width:d,xmlns:"http://www.w3.org/2000/svg"}),l&&n.createElement("title",null,l),e.children)};return void 0!==i?n.createElement(i.Consumer,null,e=>t(e)):t(o)}},96164:function(e,t,r){"use strict";r.d(t,{m6:function(){return I}});let n=/^\[(.+)\]$/;function o(e,t){let r=e;return t.split("-").forEach(e=>{r.nextPart.has(e)||r.nextPart.set(e,{nextPart:new Map,validators:[]}),r=r.nextPart.get(e)}),r}let i=/\s+/;function a(){let e,t,r=0,n="";for(;rt[e]||[];return t.isThemeGetter=!0,t}let l=/^\[(?:([a-z-]+):)?(.+)\]$/i,u=/^\d+\/\d+$/,c=new Set(["px","full","screen"]),d=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,f=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,p=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,h=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,m=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/;function y(e){return v(e)||c.has(e)||u.test(e)}function g(e){return M(e,"length",k)}function v(e){return!!e&&!Number.isNaN(Number(e))}function b(e){return M(e,"number",v)}function w(e){return!!e&&Number.isInteger(Number(e))}function x(e){return e.endsWith("%")&&v(e.slice(0,-1))}function S(e){return l.test(e)}function P(e){return d.test(e)}let E=new Set(["length","size","percentage"]);function A(e){return M(e,E,D)}function R(e){return M(e,"position",D)}let j=new Set(["image","url"]);function C(e){return M(e,j,L)}function O(e){return M(e,"",N)}function T(){return!0}function M(e,t,r){let n=l.exec(e);return!!n&&(n[1]?"string"==typeof t?n[1]===t:t.has(n[1]):r(n[2]))}function k(e){return f.test(e)&&!p.test(e)}function D(){return!1}function N(e){return h.test(e)}function L(e){return m.test(e)}let I=function(e,...t){let r,s,l;let u=function(i){var a;return s=(r={cache:function(e){if(e<1)return{get:()=>void 0,set:()=>{}};let t=0,r=new Map,n=new Map;function o(o,i){r.set(o,i),++t>e&&(t=0,n=r,r=new Map)}return{get(e){let t=r.get(e);return void 0!==t?t:void 0!==(t=n.get(e))?(o(e,t),t):void 0},set(e,t){r.has(e)?r.set(e,t):o(e,t)}}}((a=t.reduce((e,t)=>t(e),e())).cacheSize),parseClassName:function(e){let{separator:t,experimentalParseClassName:r}=e,n=1===t.length,o=t[0],i=t.length;function a(e){let r;let a=[],s=0,l=0;for(let u=0;ul?r-l:void 0}}return r?function(e){return r({className:e,parseClassName:a})}:a}(a),...function(e){let t=function(e){var t;let{theme:r,prefix:n}=e,i={nextPart:new Map,validators:[]};return(t=Object.entries(e.classGroups),n?t.map(([e,t])=>[e,t.map(e=>"string"==typeof e?n+e:"object"==typeof e?Object.fromEntries(Object.entries(e).map(([e,t])=>[n+e,t])):e)]):t).forEach(([e,t])=>{(function e(t,r,n,i){t.forEach(t=>{if("string"==typeof t){(""===t?r:o(r,t)).classGroupId=n;return}if("function"==typeof t){if(t.isThemeGetter){e(t(i),r,n,i);return}r.validators.push({validator:t,classGroupId:n});return}Object.entries(t).forEach(([t,a])=>{e(a,o(r,t),n,i)})})})(t,i,e,r)}),i}(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:i}=e;return{getClassGroupId:function(e){let r=e.split("-");return""===r[0]&&1!==r.length&&r.shift(),function e(t,r){if(0===t.length)return r.classGroupId;let n=t[0],o=r.nextPart.get(n),i=o?e(t.slice(1),o):void 0;if(i)return i;if(0===r.validators.length)return;let a=t.join("-");return r.validators.find(({validator:e})=>e(a))?.classGroupId}(r,t)||function(e){if(n.test(e)){let t=n.exec(e)[1],r=t?.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}}(e)},getConflictingClassGroupIds:function(e,t){let n=r[e]||[];return t&&i[e]?[...n,...i[e]]:n}}}(a)}).cache.get,l=r.cache.set,u=c,c(i)};function c(e){let t=s(e);if(t)return t;let n=function(e,t){let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,a=new Set;return e.trim().split(i).map(e=>{let{modifiers:t,hasImportantModifier:o,baseClassName:i,maybePostfixModifierPosition:a}=r(e),s=!!a,l=n(s?i.substring(0,a):i);if(!l){if(!s||!(l=n(i)))return{isTailwindClass:!1,originalClassName:e};s=!1}let u=(function(e){if(e.length<=1)return e;let t=[],r=[];return e.forEach(e=>{"["===e[0]?(t.push(...r.sort(),e),r=[]):r.push(e)}),t.push(...r.sort()),t})(t).join(":");return{isTailwindClass:!0,modifierId:o?u+"!":u,classGroupId:l,originalClassName:e,hasPostfixModifier:s}}).reverse().filter(e=>{if(!e.isTailwindClass)return!0;let{modifierId:t,classGroupId:r,hasPostfixModifier:n}=e,i=t+r;return!a.has(i)&&(a.add(i),o(r,n).forEach(e=>a.add(t+e)),!0)}).reverse().map(e=>e.originalClassName).join(" ")}(e,r);return l(e,n),n}return function(){return u(a.apply(null,arguments))}}(function(){let e=s("colors"),t=s("spacing"),r=s("blur"),n=s("brightness"),o=s("borderColor"),i=s("borderRadius"),a=s("borderSpacing"),l=s("borderWidth"),u=s("contrast"),c=s("grayscale"),d=s("hueRotate"),f=s("invert"),p=s("gap"),h=s("gradientColorStops"),m=s("gradientColorStopPositions"),E=s("inset"),j=s("margin"),M=s("opacity"),k=s("padding"),D=s("saturate"),N=s("scale"),L=s("sepia"),I=s("skew"),F=s("space"),_=s("translate"),V=()=>["auto","contain","none"],z=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto",S,t],W=()=>[S,t],U=()=>["",y,g],$=()=>["auto",v,S],H=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],K=()=>["solid","dashed","dotted","double","none"],q=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],G=()=>["start","end","center","between","around","evenly","stretch"],Z=()=>["","0",S],X=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Y=()=>[v,b],J=()=>[v,S];return{cacheSize:500,separator:":",theme:{colors:[T],spacing:[y,g],blur:["none","",P,S],brightness:Y(),borderColor:[e],borderRadius:["none","","full",P,S],borderSpacing:W(),borderWidth:U(),contrast:Y(),grayscale:Z(),hueRotate:J(),invert:Z(),gap:W(),gradientColorStops:[e],gradientColorStopPositions:[x,g],inset:B(),margin:B(),opacity:Y(),padding:W(),saturate:Y(),scale:Y(),sepia:Z(),skew:J(),space:W(),translate:W()},classGroups:{aspect:[{aspect:["auto","square","video",S]}],container:["container"],columns:[{columns:[P]}],"break-after":[{"break-after":X()}],"break-before":[{"break-before":X()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...H(),S]}],overflow:[{overflow:z()}],"overflow-x":[{"overflow-x":z()}],"overflow-y":[{"overflow-y":z()}],overscroll:[{overscroll:V()}],"overscroll-x":[{"overscroll-x":V()}],"overscroll-y":[{"overscroll-y":V()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[E]}],"inset-x":[{"inset-x":[E]}],"inset-y":[{"inset-y":[E]}],start:[{start:[E]}],end:[{end:[E]}],top:[{top:[E]}],right:[{right:[E]}],bottom:[{bottom:[E]}],left:[{left:[E]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",w,S]}],basis:[{basis:B()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",S]}],grow:[{grow:Z()}],shrink:[{shrink:Z()}],order:[{order:["first","last","none",w,S]}],"grid-cols":[{"grid-cols":[T]}],"col-start-end":[{col:["auto",{span:["full",w,S]},S]}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":[T]}],"row-start-end":[{row:["auto",{span:[w,S]},S]}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",S]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",S]}],gap:[{gap:[p]}],"gap-x":[{"gap-x":[p]}],"gap-y":[{"gap-y":[p]}],"justify-content":[{justify:["normal",...G()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...G(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...G(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[k]}],px:[{px:[k]}],py:[{py:[k]}],ps:[{ps:[k]}],pe:[{pe:[k]}],pt:[{pt:[k]}],pr:[{pr:[k]}],pb:[{pb:[k]}],pl:[{pl:[k]}],m:[{m:[j]}],mx:[{mx:[j]}],my:[{my:[j]}],ms:[{ms:[j]}],me:[{me:[j]}],mt:[{mt:[j]}],mr:[{mr:[j]}],mb:[{mb:[j]}],ml:[{ml:[j]}],"space-x":[{"space-x":[F]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[F]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",S,t]}],"min-w":[{"min-w":[S,t,"min","max","fit"]}],"max-w":[{"max-w":[S,t,"none","full","min","max","fit","prose",{screen:[P]},P]}],h:[{h:[S,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[S,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[S,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[S,t,"auto","min","max","fit"]}],"font-size":[{text:["base",P,g]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",b]}],"font-family":[{font:[T]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",S]}],"line-clamp":[{"line-clamp":["none",v,b]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",y,S]}],"list-image":[{"list-image":["none",S]}],"list-style-type":[{list:["none","disc","decimal",S]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[M]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[M]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...K(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",y,g]}],"underline-offset":[{"underline-offset":["auto",y,S]}],"text-decoration-color":[{decoration:[e]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:W()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",S]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",S]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[M]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...H(),R]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",A]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},C]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[h]}],"gradient-via":[{via:[h]}],"gradient-to":[{to:[h]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[l]}],"border-w-x":[{"border-x":[l]}],"border-w-y":[{"border-y":[l]}],"border-w-s":[{"border-s":[l]}],"border-w-e":[{"border-e":[l]}],"border-w-t":[{"border-t":[l]}],"border-w-r":[{"border-r":[l]}],"border-w-b":[{"border-b":[l]}],"border-w-l":[{"border-l":[l]}],"border-opacity":[{"border-opacity":[M]}],"border-style":[{border:[...K(),"hidden"]}],"divide-x":[{"divide-x":[l]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[l]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[M]}],"divide-style":[{divide:K()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...K()]}],"outline-offset":[{"outline-offset":[y,S]}],"outline-w":[{outline:[y,g]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:U()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[M]}],"ring-offset-w":[{"ring-offset":[y,g]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",P,O]}],"shadow-color":[{shadow:[T]}],opacity:[{opacity:[M]}],"mix-blend":[{"mix-blend":[...q(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":q()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",P,S]}],grayscale:[{grayscale:[c]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[f]}],saturate:[{saturate:[D]}],sepia:[{sepia:[L]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[c]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[f]}],"backdrop-opacity":[{"backdrop-opacity":[M]}],"backdrop-saturate":[{"backdrop-saturate":[D]}],"backdrop-sepia":[{"backdrop-sepia":[L]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",S]}],duration:[{duration:J()}],ease:[{ease:["linear","in","out","in-out",S]}],delay:[{delay:J()}],animate:[{animate:["none","spin","ping","pulse","bounce",S]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[N]}],"scale-x":[{"scale-x":[N]}],"scale-y":[{"scale-y":[N]}],rotate:[{rotate:[w,S]}],"translate-x":[{"translate-x":[_]}],"translate-y":[{"translate-y":[_]}],"skew-x":[{"skew-x":[I]}],"skew-y":[{"skew-y":[I]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",S]}],accent:[{accent:["auto",e]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",S]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":W()}],"scroll-mx":[{"scroll-mx":W()}],"scroll-my":[{"scroll-my":W()}],"scroll-ms":[{"scroll-ms":W()}],"scroll-me":[{"scroll-me":W()}],"scroll-mt":[{"scroll-mt":W()}],"scroll-mr":[{"scroll-mr":W()}],"scroll-mb":[{"scroll-mb":W()}],"scroll-ml":[{"scroll-ml":W()}],"scroll-p":[{"scroll-p":W()}],"scroll-px":[{"scroll-px":W()}],"scroll-py":[{"scroll-py":W()}],"scroll-ps":[{"scroll-ps":W()}],"scroll-pe":[{"scroll-pe":W()}],"scroll-pt":[{"scroll-pt":W()}],"scroll-pr":[{"scroll-pr":W()}],"scroll-pb":[{"scroll-pb":W()}],"scroll-pl":[{"scroll-pl":W()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",S]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[y,g,b]}],stroke:[{stroke:[e,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}})}}]); ================================================ FILE: client/out/_next/static/chunks/202-9b05294c1bfbdfa7.js ================================================ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[202],{5777:function(e,t,r){"use strict";var n=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletProvider=void 0;let s=i(r(37836)),o=r(39172),a=r(47224),l=r(34468),u=r(98997),c=r(96741),d=r(66320),h=r(42057),f=r(17475),p=r(9876);class g extends s.default{constructor(e){var t,r,{metadata:i}=e,s=e.preference,{keysUrl:a}=s,f=n(s,["keysUrl"]);super(),this.accounts=[],this.handlers={handshake:async e=>{try{if(this.connected)return this.emit("connect",{chainId:(0,u.hexStringFromIntNumber)((0,l.IntNumber)(this.chain.id))}),this.accounts;let e=await this.requestSignerSelection(),t=this.initSigner(e),r=await t.handshake();return this.signer=t,(0,c.storeSignerType)(e),this.emit("connect",{chainId:(0,u.hexStringFromIntNumber)((0,l.IntNumber)(this.chain.id))}),r}catch(e){throw this.handleUnauthorizedError(e),e}},sign:async e=>{if(!this.connected||!this.signer)throw o.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(e)}catch(e){throw this.handleUnauthorizedError(e),e}},fetch:e=>(0,d.fetchRPCRequest)(e,this.chain),state:e=>{let t=()=>{if(this.connected)return this.accounts;throw o.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(e.method){case"eth_chainId":return(0,u.hexStringFromIntNumber)((0,l.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return t();case"eth_coinbase":return t()[0];default:return this.handlers.unsupported(e)}},deprecated:({method:e})=>{throw o.standardErrors.rpc.methodNotSupported(`Method ${e} is deprecated.`)},unsupported:({method:e})=>{throw o.standardErrors.rpc.methodNotSupported(`Method ${e} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:e,source:t})=>{(0,u.areAddressArraysEqual)(this.accounts,e)||(this.accounts=e,"storage"!==t&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:e,source:t})=>{(e.id!==this.chain.id||e.rpcUrl!==this.chain.rpcUrl)&&(this.chain=e,"storage"!==t&&this.emit("chainChanged",(0,u.hexStringFromIntNumber)((0,l.IntNumber)(e.id))))}},this.metadata=i,this.preference=f,this.communicator=new h.Communicator(a),this.chain={id:null!==(r=null===(t=i.appChainIds)||void 0===t?void 0:t[0])&&void 0!==r?r:1};let p=(0,c.loadSignerType)();this.signer=p?this.initSigner(p):null}get connected(){return this.accounts.length>0}async request(e){var t;try{let r=(0,d.checkErrorForInvalidRequestArgs)(e);if(r)throw r;let n=null!==(t=(0,f.determineMethodCategory)(e.method))&&void 0!==t?t:"fetch";return this.handlers[n](e)}catch(t){return Promise.reject((0,a.serializeError)(t,e.method))}}handleUnauthorizedError(e){e.code===o.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1},p.ScopedLocalStorage.clearAll(),this.emit("disconnect",o.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,c.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(e){return(0,c.createSigner)({signerType:e,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}t.CoinbaseWalletProvider=g},46111:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CoinbaseWalletSDK=void 0;let n=r(5814),i=r(5777),s=r(9876),o=r(54750),a=r(98997),l=r(66320);class u{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||(0,a.getFavicon)(),appChainIds:e.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(e={options:"all"}){var t;let r={metadata:this.metadata,preference:e};return null!==(t=(0,l.getCoinbaseInjectedProvider)(r))&&void 0!==t?t:new i.CoinbaseWalletProvider(r)}getCoinbaseWalletLogo(e,t=240){return(0,n.walletLogo)(e,t)}storeLatestVersion(){new s.ScopedLocalStorage("CBWSDK").setItem("VERSION",o.LIB_VERSION)}}t.CoinbaseWalletSDK=u},5814:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.walletLogo=void 0,t.walletLogo=(e,t)=>{let r;switch(e){case"standard":default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}}},42057:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Communicator=void 0;let n=r(54750),i=r(64583),s=r(99285),o=r(39172);class a{constructor(e=s.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async e=>{(await this.waitForPopupLoaded()).postMessage(e,this.url.origin)},this.postRequestAndWaitForResponse=async e=>{let t=this.onMessage(({requestId:t})=>t===e.id);return this.postMessage(e),await t},this.onMessage=async e=>new Promise((t,r)=>{let n=r=>{if(r.origin!==this.url.origin)return;let i=r.data;e(i)&&(t(i),window.removeEventListener("message",n),this.listeners.delete(n))};window.addEventListener("message",n),this.listeners.set(n,{reject:r})}),this.disconnect=()=>{(0,i.closePopup)(this.popup),this.popup=null,this.listeners.forEach(({reject:e},t)=>{e(o.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",t)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?this.popup:(this.popup=(0,i.openPopup)(this.url),this.onMessage(({event:e})=>"PopupUnload"===e).then(this.disconnect).catch(()=>{}),this.onMessage(({event:e})=>"PopupLoaded"===e).then(e=>{this.postMessage({requestId:e.id,data:{version:n.LIB_VERSION}})}).then(()=>{if(!this.popup)throw o.standardErrors.rpc.internal();return this.popup})),this.url=new URL(e)}}t.Communicator=a},64583:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.closePopup=t.openPopup=void 0;let n=r(39172);t.openPopup=function(e){let t=(window.innerWidth-420)/2+window.screenX,r=(window.innerHeight-540)/2+window.screenY,i=window.open(e,"Smart Wallet",`width=420, height=540, left=${t}, top=${r}`);if(null==i||i.focus(),!i)throw n.standardErrors.rpc.internal("Pop up window failed to open");return i},t.closePopup=function(e){e&&!e.closed&&e.close()}},99285:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.CBW_MOBILE_DEEPLINK_URL=t.WALLETLINK_URL=t.CB_KEYS_URL=void 0,t.CB_KEYS_URL="https://keys.coinbase.com/connect",t.WALLETLINK_URL="https://www.walletlink.org",t.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink"},4406:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.errorValues=t.standardErrorCodes=void 0,t.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},t.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}}},71839:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=void 0;let n=r(4406),i=r(86687);function s(e,t){let[r,n]=a(t);return new l(e,r||(0,i.getMessageFromCode)(e),n)}function o(e,t){let[r,n]=a(t);return new u(e,r||(0,i.getMessageFromCode)(e),n)}function a(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:r}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,r]}}return[]}t.standardErrors={rpc:{parse:e=>s(n.standardErrorCodes.rpc.parse,e),invalidRequest:e=>s(n.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>s(n.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>s(n.standardErrorCodes.rpc.methodNotFound,e),internal:e=>s(n.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code <= -32005');return s(t,e)},invalidInput:e=>s(n.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>s(n.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>s(n.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>s(n.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>s(n.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>s(n.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>o(n.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>o(n.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>o(n.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>o(n.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>o(n.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>o(n.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:r,data:n}=e;if(!r||"string"!=typeof r)throw Error('"message" must be a nonempty string');return new u(t,r,n)}}};class l extends Error{constructor(e,t,r){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==r&&(this.data=r)}}class u extends l{constructor(e,t,r){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,r)}}},39172:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.standardErrors=t.standardErrorCodes=void 0;var n=r(4406);Object.defineProperty(t,"standardErrorCodes",{enumerable:!0,get:function(){return n.standardErrorCodes}});var i=r(71839);Object.defineProperty(t,"standardErrors",{enumerable:!0,get:function(){return i.standardErrors}})},47224:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serializeError=void 0;let n=r(83705),i=r(54750),s=r(4406),o=r(86687);t.serializeError=function(e,t){let r=(0,o.serialize)("string"==typeof e?{message:e,code:s.standardErrorCodes.rpc.internal}:(0,n.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e,{shouldIncludeStack:!0}),a=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");a.searchParams.set("version",i.LIB_VERSION),a.searchParams.set("code",r.code.toString());let l=function(e,t){let r=null==e?void 0:e.method;if(r)return r;if(void 0===t);else if("string"==typeof t)return t;else if(!Array.isArray(t))return t.method;else if(t.length>0)return t[0].method}(r.data,t);return l&&a.searchParams.set("method",l),a.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:a.href})}},86687:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.serialize=t.getErrorCode=t.isValidCode=t.getMessageFromCode=t.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;let n=r(4406),i="Unspecified error message.";function s(e,r=i){if(e&&Number.isInteger(e)){let r=e.toString();if(l(n.errorValues,r))return n.errorValues[r].message;if(e>=-32099&&e<=-32e3)return t.JSON_RPC_SERVER_ERROR_MESSAGE}return r}function o(e){if(!Number.isInteger(e))return!1;let t=e.toString();return!!(n.errorValues[t]||e>=-32099&&e<=-32e3)}function a(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function l(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}t.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.",t.getMessageFromCode=s,t.isValidCode=o,t.getErrorCode=function(e){var t;return"number"==typeof e?e:"object"==typeof e&&null!==e&&("number"==typeof e.code||"number"==typeof e.errorCode)?null!==(t=e.code)&&void 0!==t?t:e.errorCode:void 0},t.serialize=function(e,{shouldIncludeStack:t=!1}={}){let r={};return e&&"object"==typeof e&&!Array.isArray(e)&&l(e,"code")&&o(e.code)?(r.code=e.code,e.message&&"string"==typeof e.message?(r.message=e.message,l(e,"data")&&(r.data=e.data)):(r.message=s(r.code),r.data={originalError:a(e)})):(r.code=n.standardErrorCodes.rpc.internal,r.message=u(e,"message")?e.message:i,r.data={originalError:a(e)}),t&&(r.stack=u(e,"stack")?e.stack:void 0),r}},17475:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.determineMethodCategory=void 0;let r={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};t.determineMethodCategory=function(e){for(let t in r)if(r[t].includes(e))return t}},34468:function(e,t){"use strict";function r(){return e=>e}Object.defineProperty(t,"__esModule",{value:!0}),t.RegExpString=t.IntNumber=t.BigIntString=t.AddressString=t.HexString=t.OpaqueType=void 0,t.OpaqueType=r,t.HexString=r(),t.AddressString=r(),t.BigIntString=r(),t.IntNumber=function(e){return Math.floor(e)},t.RegExpString=r()},98997:function(e,t,r){"use strict";var n=r(9109).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.areAddressArraysEqual=t.getFavicon=t.range=t.isBigNumber=t.ensureParsedJSONObject=t.ensureBigInt=t.ensureRegExpString=t.ensureIntNumber=t.ensureBuffer=t.ensureAddressString=t.ensureEvenLengthHexString=t.ensureHexString=t.isHexString=t.prepend0x=t.strip0x=t.has0xPrefix=t.hexStringFromIntNumber=t.intNumberFromHexString=t.bigIntStringFromBigInt=t.hexStringFromBuffer=t.hexStringToUint8Array=t.uint8ArrayToHex=t.randomBytesHex=void 0;let i=r(39172),s=r(34468),o=/^[0-9]*$/,a=/^[a-f0-9]*$/;function l(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function u(e){return e.startsWith("0x")||e.startsWith("0X")}function c(e){return u(e)?e.slice(2):e}function d(e){return u(e)?`0x${e.slice(2)}`:`0x${e}`}function h(e){if("string"!=typeof e)return!1;let t=c(e).toLowerCase();return a.test(t)}function f(e,t=!1){if("string"==typeof e){let r=c(e).toLowerCase();if(a.test(r))return(0,s.HexString)(t?`0x${r}`:r)}throw i.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}function p(e,t=!1){let r=f(e,!1);return r.length%2==1&&(r=(0,s.HexString)(`0${r}`)),t?(0,s.HexString)(`0x${r}`):r}function g(e){if("number"==typeof e&&Number.isInteger(e))return(0,s.IntNumber)(e);if("string"==typeof e){if(o.test(e))return(0,s.IntNumber)(Number(e));if(h(e))return(0,s.IntNumber)(Number(BigInt(p(e,!0))))}throw i.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}function m(e){if(null==e||"function"!=typeof e.constructor)return!1;let{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}t.randomBytesHex=function(e){return l(crypto.getRandomValues(new Uint8Array(e)))},t.uint8ArrayToHex=l,t.hexStringToUint8Array=function(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},t.hexStringFromBuffer=function(e,t=!1){let r=e.toString("hex");return(0,s.HexString)(t?`0x${r}`:r)},t.bigIntStringFromBigInt=function(e){return(0,s.BigIntString)(e.toString(10))},t.intNumberFromHexString=function(e){return(0,s.IntNumber)(Number(BigInt(p(e,!0))))},t.hexStringFromIntNumber=function(e){return(0,s.HexString)(`0x${BigInt(e).toString(16)}`)},t.has0xPrefix=u,t.strip0x=c,t.prepend0x=d,t.isHexString=h,t.ensureHexString=f,t.ensureEvenLengthHexString=p,t.ensureAddressString=function(e){if("string"==typeof e){let t=c(e).toLowerCase();if(h(t)&&40===t.length)return(0,s.AddressString)(d(t))}throw i.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)},t.ensureBuffer=function(e){if(n.isBuffer(e))return e;if("string"==typeof e){if(h(e)){let t=p(e,!1);return n.from(t,"hex")}return n.from(e,"utf8")}throw i.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)},t.ensureIntNumber=g,t.ensureRegExpString=function(e){if(e instanceof RegExp)return(0,s.RegExpString)(e.toString());throw i.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)},t.ensureBigInt=function(e){if(null!==e&&("bigint"==typeof e||m(e)))return BigInt(e.toString(10));if("number"==typeof e)return BigInt(g(e));if("string"==typeof e){if(o.test(e))return BigInt(e);if(h(e))return BigInt(p(e,!0))}throw i.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)},t.ensureParsedJSONObject=function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw i.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)},t.isBigNumber=m,t.range=function(e,t){return Array.from({length:t-e},(t,r)=>e+r)},t.getFavicon=function(){let e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`},t.areAddressArraysEqual=function(e,t){return e.length===t.length&&e.every((e,r)=>e===t[r])}},86080:function(e,t,r){"use strict";let n=r(46111);t.ZP=n.CoinbaseWalletSDK,r(46111)},7977:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCWKeyManager=void 0;let n=r(89665),i=r(9876),s={storageKey:"ownPrivateKey",keyType:"private"},o={storageKey:"ownPublicKey",keyType:"public"},a={storageKey:"peerPublicKey",keyType:"public"};class l{constructor(){this.storage=new i.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(a,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(o.storageKey),this.storage.removeItem(s.storageKey),this.storage.removeItem(a.storageKey)}async generateKeyPair(){let e=await (0,n.generateKeyPair)();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(s,e.privateKey),await this.storeKey(o,e.publicKey)}async loadKeysIfNeeded(){null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(s)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(o)),(null===this.ownPrivateKey||null===this.ownPublicKey)&&await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(a)),null===this.sharedSecret&&null!==this.ownPrivateKey&&null!==this.peerPublicKey&&(this.sharedSecret=await (0,n.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey))}async loadKey(e){let t=this.storage.getItem(e.storageKey);return t?(0,n.importKeyFromHexString)(e.keyType,t):null}async storeKey(e,t){let r=await (0,n.exportKeyToHexString)(e.keyType,t);this.storage.setItem(e.storageKey,r)}}t.SCWKeyManager=l},51902:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCWSigner=void 0;let n=r(7977),i=r(5561),s=r(39172),o=r(98997),a=r(89665);class l{constructor(e){this.metadata=e.metadata,this.communicator=e.communicator,this.keyManager=new n.SCWKeyManager,this.stateManager=new i.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:e.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){let e=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),t=await this.communicator.postRequestAndWaitForResponse(e);if("failure"in t.content)throw t.content.failure;let r=await (0,a.importKeyFromHexString)("public",t.sender);await this.keyManager.setPeerPublicKey(r);let n=await this.decryptResponseMessage(t);this.updateInternalState({method:"eth_requestAccounts"},n);let i=n.result;if("error"in i)throw i.error;return this.stateManager.accounts}async request(e){let t=this.tryLocalHandling(e);if(void 0!==t){if(t instanceof Error)throw t;return t}await this.communicator.waitForPopupLoaded();let r=await this.sendEncryptedRequest(e),n=await this.decryptResponseMessage(r);this.updateInternalState(e,n);let i=n.result;if("error"in i)throw i.error;return i.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(e){var t;switch(e.method){case"wallet_switchEthereumChain":{let r=e.params;if(!r||!(null===(t=r[0])||void 0===t?void 0:t.chainId))throw s.standardErrors.rpc.invalidParams();let n=(0,o.ensureIntNumber)(r[0].chainId);return this.stateManager.switchChain(n)?null:void 0}case"wallet_getCapabilities":{let e=this.stateManager.walletCapabilities;if(!e)throw s.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return e}default:return}}async sendEncryptedRequest(e){let t=await this.keyManager.getSharedSecret();if(!t)throw s.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");let r=await (0,a.encryptContent)({action:e,chainId:this.stateManager.activeChain.id},t),n=await this.createRequestMessage({encrypted:r});return this.communicator.postRequestAndWaitForResponse(n)}async createRequestMessage(e){let t=await (0,a.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){let t=e.content;if("failure"in t)throw t.failure;let r=await this.keyManager.getSharedSecret();if(!r)throw s.standardErrors.provider.unauthorized("Invalid session");return(0,a.decryptContent)(t.encrypted,r)}updateInternalState(e,t){var r,n;let i=null===(r=t.data)||void 0===r?void 0:r.chains;i&&this.stateManager.updateAvailableChains(i);let s=null===(n=t.data)||void 0===n?void 0:n.capabilities;s&&this.stateManager.updateWalletCapabilities(s);let a=t.result;if(!("error"in a))switch(e.method){case"eth_requestAccounts":{let e=a.value;this.stateManager.updateAccounts(e);break}case"wallet_switchEthereumChain":{if(null!==a.value)return;let t=e.params,r=(0,o.ensureIntNumber)(t[0].chainId);this.stateManager.switchChain(r)}}}}t.SCWSigner=l},5561:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCWStateManager=void 0;let n=r(9876),i="accounts",s="activeChain",o="availableChains",a="walletCapabilities";class l{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(e){var t,r;this.storage=new n.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=e.updateListener,this.availableChains=this.loadItemFromStorage(o),this._walletCapabilities=this.loadItemFromStorage(a);let l=this.loadItemFromStorage(i),u=this.loadItemFromStorage(s);l&&this.updateListener.onAccountsUpdate({accounts:l,source:"storage"}),u&&this.updateListener.onChainUpdate({chain:u,source:"storage"}),this._accounts=l||[],this._activeChain=u||{id:null!==(r=null===(t=e.appChainIds)||void 0===t?void 0:t[0])&&void 0!==r?r:1}}updateAccounts(e){this._accounts=e,this.storeItemToStorage(i,e),this.updateListener.onAccountsUpdate({accounts:e,source:"wallet"})}switchChain(e){var t;let r=null===(t=this.availableChains)||void 0===t?void 0:t.find(t=>t.id===e);return!!r&&(r===this._activeChain||(this._activeChain=r,this.storeItemToStorage(s,r),this.updateListener.onChainUpdate({chain:r,source:"wallet"}),!0))}updateAvailableChains(e){if(!e||0===Object.keys(e).length)return;let t=Object.entries(e).map(([e,t])=>({id:Number(e),rpcUrl:t}));this.availableChains=t,this.storeItemToStorage(o,t),this.switchChain(this._activeChain.id)}updateWalletCapabilities(e){this._walletCapabilities=e,this.storeItemToStorage(a,e)}storeItemToStorage(e,t){this.storage.setItem(e,JSON.stringify(t))}loadItemFromStorage(e){let t=this.storage.getItem(e);return t?JSON.parse(t):void 0}clear(){this.storage.clear()}}t.SCWStateManager=l},96741:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createSigner=t.fetchSignerType=t.storeSignerType=t.loadSignerType=void 0;let n=r(51902),i=r(86510),s=r(39172),o=r(66320),a=r(9876),l="SignerType",u=new a.ScopedLocalStorage("CBWSDK","SignerConfigurator");async function c(e){let{communicator:t,metadata:r}=e;d(t,r).catch(()=>{});let n={id:crypto.randomUUID(),event:"selectSignerType",data:e.preference},{data:i}=await t.postRequestAndWaitForResponse(n);return i}async function d(e,t){await e.onMessage(({event:e})=>"WalletLinkSessionRequest"===e);let r=new i.WalletLinkSigner({metadata:t});e.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}t.loadSignerType=function(){return u.getItem(l)},t.storeSignerType=function(e){u.setItem(l,e)},t.fetchSignerType=c,t.createSigner=function(e){let{signerType:t,metadata:r,communicator:a,updateListener:l}=e;switch(t){case"scw":return new n.SCWSigner({metadata:r,updateListener:l,communicator:a});case"walletlink":return new i.WalletLinkSigner({metadata:r,updateListener:l});case"extension":{let e=(0,o.getCoinbaseInjectedSigner)();if(!e)throw s.standardErrors.rpc.internal("injected signer not found");return e}}}},86510:function(e,t,r){"use strict";var n=r(9109).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkSigner=void 0;let s=i(r(80745)),o=r(56663),a=r(65896),l=r(83705),u=r(78461),c=r(99285),d=r(39172),h=r(98997),f=r(9876),p="DefaultChainId",g="DefaultJsonRpcUrl";class m{constructor(e){var t,r;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;let{appName:n,appLogoUrl:i}=e.metadata;this._appName=n,this._appLogoUrl=i,this._storage=new f.ScopedLocalStorage("walletlink",c.WALLETLINK_URL),this.updateListener=e.updateListener,this._relayEventManager=new a.RelayEventManager,this._jsonRpcUrlFromOpts="";let s=this._storage.getItem(o.LOCAL_STORAGE_ADDRESSES_KEY);if(s){let e=s.split(" ");""!==e[0]&&(this._addresses=e.map(e=>(0,h.ensureAddressString)(e)),null===(t=this.updateListener)||void 0===t||t.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(p)&&(null===(r=this.updateListener)||void 0===r||r.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){let{id:e,secret:t}=this.initializeRelay().getWalletLinkSession();return{id:e,secret:t}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(g))&&void 0!==e?e:this._jsonRpcUrlFromOpts}set jsonRpcUrl(e){this._storage.setItem(g,e)}updateProviderInfo(e,t){var r;this.jsonRpcUrl=e;let n=this.getChainId();this._storage.setItem(p,t.toString(10)),(0,h.ensureIntNumber)(t)===n&&this.hasMadeFirstChainChangedEmission||(null===(r=this.updateListener)||void 0===r||r.onChainUpdate({chain:{id:t,rpcUrl:e},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(e,t,r,n,i,s){let o=this.initializeRelay(),a=await o.watchAsset(e,t,r,n,i,null==s?void 0:s.toString());return!(0,l.isErrorResponse)(a)&&!!a.result}async addEthereumChain(e,t,r,n,i,s){var o,a;if((0,h.ensureIntNumber)(e)===this.getChainId())return!1;let u=this.initializeRelay();this._isAuthorized()||await u.requestEthereumAccounts();let c=await u.addEthereumChain(e.toString(),t,i,r,n,s);return!(0,l.isErrorResponse)(c)&&((null===(o=c.result)||void 0===o?void 0:o.isApproved)===!0&&this.updateProviderInfo(t[0],e),(null===(a=c.result)||void 0===a?void 0:a.isApproved)===!0)}async switchEthereumChain(e){let t=this.initializeRelay(),r=await t.switchEthereumChain(e.toString(10),this.selectedAddress||void 0);if((0,l.isErrorResponse)(r)){if(!r.errorCode)return;if(r.errorCode===d.standardErrorCodes.provider.unsupportedChain)throw d.standardErrors.provider.unsupportedChain();throw d.standardErrors.provider.custom({message:r.errorMessage,code:r.errorCode})}let n=r.result;n.isApproved&&n.rpcUrl.length>0&&this.updateProviderInfo(n.rpcUrl,e)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(e){try{return this._request(e).catch(e=>{throw e})}catch(e){return Promise.reject(e)}}async _request(e){if(!e||"object"!=typeof e||Array.isArray(e))throw d.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:e});let{method:t,params:r}=e;if("string"!=typeof t||0===t.length)throw d.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==r&&!Array.isArray(r)&&("object"!=typeof r||null===r))throw d.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:e});let n=void 0===r?[]:r,i=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:t,params:n,jsonrpc:"2.0",id:i})).result}_setAddresses(e,t){var r;if(!Array.isArray(e))throw Error("addresses is not an array");let n=e.map(e=>(0,h.ensureAddressString)(e));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,null===(r=this.updateListener)||void 0===r||r.onAccountsUpdate({accounts:n,source:"wallet"}),this._storage.setItem(o.LOCAL_STORAGE_ADDRESSES_KEY,n.join(" ")))}_sendRequestAsync(e){return new Promise((t,r)=>{try{let r=this._handleSynchronousMethods(e);if(void 0!==r)return t({jsonrpc:"2.0",id:e.id,result:r})}catch(e){return r(e)}this._handleAsynchronousMethods(e).then(r=>r&&t(Object.assign(Object.assign({},r),{id:e.id}))).catch(e=>r(e))})}_handleSynchronousMethods(e){let{method:t}=e;switch(t){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(e){let{method:t}=e,r=e.params||[];switch(t){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(r);case"eth_ecRecover":return this._eth_ecRecover(r);case"personal_sign":return this._personal_sign(r);case"personal_ecRecover":return this._personal_ecRecover(r);case"eth_signTransaction":return this._eth_signTransaction(r);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(r);case"eth_sendTransaction":return this._eth_sendTransaction(r);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(r);case"eth_signTypedData_v2":default:return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(r);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(r);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(r);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(r);case"wallet_watchAsset":return this._wallet_watchAsset(r)}}_isKnownAddress(e){try{let t=(0,h.ensureAddressString)(e);return this._addresses.map(e=>(0,h.ensureAddressString)(e)).includes(t)}catch(e){}return!1}_ensureKnownAddress(e){if(!this._isKnownAddress(e))throw Error("Unknown Ethereum address")}_prepareTransactionParams(e){let t=e.from?(0,h.ensureAddressString)(e.from):this.selectedAddress;if(!t)throw Error("Ethereum address is unavailable");this._ensureKnownAddress(t);let r=e.to?(0,h.ensureAddressString)(e.to):null,i=null!=e.value?(0,h.ensureBigInt)(e.value):BigInt(0),s=e.data?(0,h.ensureBuffer)(e.data):n.alloc(0),o=null!=e.nonce?(0,h.ensureIntNumber)(e.nonce):null,a=null!=e.gasPrice?(0,h.ensureBigInt)(e.gasPrice):null,l=null!=e.maxFeePerGas?(0,h.ensureBigInt)(e.maxFeePerGas):null;return{fromAddress:t,toAddress:r,weiValue:i,data:s,nonce:o,gasPriceInWei:a,maxFeePerGas:l,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?(0,h.ensureBigInt)(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?(0,h.ensureBigInt)(e.gas):null,chainId:e.chainId?(0,h.ensureIntNumber)(e.chainId):this.getChainId()}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw d.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw d.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(e,t,r,n){this._ensureKnownAddress(t);try{let i=this.initializeRelay(),s=await i.signEthereumMessage(e,t,r,n);if((0,l.isErrorResponse)(s))throw Error(s.errorMessage);return{jsonrpc:"2.0",id:0,result:s.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw d.standardErrors.provider.userRejectedRequest("User denied message signature");throw e}}async _ethereumAddressFromSignedMessage(e,t,r){let n=this.initializeRelay(),i=await n.ethereumAddressFromSignedMessage(e,t,r);if((0,l.isErrorResponse)(i))throw Error(i.errorMessage);return{jsonrpc:"2.0",id:0,result:i.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,h.hexStringFromIntNumber)(this.getChainId())}getChainId(){let e=this._storage.getItem(p);if(!e)return(0,h.ensureIntNumber)(1);let t=parseInt(e,10);return(0,h.ensureIntNumber)(t)}async _eth_requestAccounts(){let e;if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});try{let t=this.initializeRelay();if(e=await t.requestEthereumAccounts(),(0,l.isErrorResponse)(e))throw Error(e.errorMessage)}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw d.standardErrors.provider.userRejectedRequest("User denied account authorization");throw e}if(!e.result)throw Error("accounts received is empty");return this._setAddresses(e.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(e){this._requireAuthorization();let t=(0,h.ensureAddressString)(e[0]),r=(0,h.ensureBuffer)(e[1]);return this._signEthereumMessage(r,t,!1)}_eth_ecRecover(e){let t=(0,h.ensureBuffer)(e[0]),r=(0,h.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!1)}_personal_sign(e){this._requireAuthorization();let t=(0,h.ensureBuffer)(e[0]),r=(0,h.ensureAddressString)(e[1]);return this._signEthereumMessage(t,r,!0)}_personal_ecRecover(e){let t=(0,h.ensureBuffer)(e[0]),r=(0,h.ensureBuffer)(e[1]);return this._ethereumAddressFromSignedMessage(t,r,!0)}async _eth_signTransaction(e){this._requireAuthorization();let t=this._prepareTransactionParams(e[0]||{});try{let e=this.initializeRelay(),r=await e.signEthereumTransaction(t);if((0,l.isErrorResponse)(r))throw Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw d.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_sendRawTransaction(e){let t=(0,h.ensureBuffer)(e[0]),r=this.initializeRelay(),n=await r.submitEthereumTransaction(t,this.getChainId());if((0,l.isErrorResponse)(n))throw Error(n.errorMessage);return{jsonrpc:"2.0",id:0,result:n.result}}async _eth_sendTransaction(e){this._requireAuthorization();let t=this._prepareTransactionParams(e[0]||{});try{let e=this.initializeRelay(),r=await e.signAndSubmitEthereumTransaction(t);if((0,l.isErrorResponse)(r))throw Error(r.errorMessage);return{jsonrpc:"2.0",id:0,result:r.result}}catch(e){if("string"==typeof e.message&&e.message.match(/(denied|rejected)/i))throw d.standardErrors.provider.userRejectedRequest("User denied transaction signature");throw e}}async _eth_signTypedData_v1(e){this._requireAuthorization();let t=(0,h.ensureParsedJSONObject)(e[0]),r=(0,h.ensureAddressString)(e[1]);this._ensureKnownAddress(r);let n=s.default.hashForSignTypedDataLegacy({data:t}),i=JSON.stringify(t,null,2);return this._signEthereumMessage(n,r,!1,i)}async _eth_signTypedData_v3(e){this._requireAuthorization();let t=(0,h.ensureAddressString)(e[0]),r=(0,h.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);let n=s.default.hashForSignTypedData_v3({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,i)}async _eth_signTypedData_v4(e){this._requireAuthorization();let t=(0,h.ensureAddressString)(e[0]),r=(0,h.ensureParsedJSONObject)(e[1]);this._ensureKnownAddress(t);let n=s.default.hashForSignTypedData_v4({data:r}),i=JSON.stringify(r,null,2);return this._signEthereumMessage(n,t,!1,i)}async _wallet_addEthereumChain(e){var t,r,n,i;let s=e[0];if((null===(t=s.rpcUrls)||void 0===t?void 0:t.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!s.chainName||""===s.chainName.trim())throw d.standardErrors.rpc.invalidParams("chainName is a required field");if(!s.nativeCurrency)throw d.standardErrors.rpc.invalidParams("nativeCurrency is a required field");let o=parseInt(s.chainId,16);return await this.addEthereumChain(o,null!==(r=s.rpcUrls)&&void 0!==r?r:[],null!==(n=s.blockExplorerUrls)&&void 0!==n?n:[],s.chainName,null!==(i=s.iconUrls)&&void 0!==i?i:[],s.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(e){let t=e[0];return await this.switchEthereumChain(parseInt(t.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(e){let t=Array.isArray(e)?e[0]:e;if(!t.type)throw d.standardErrors.rpc.invalidParams("Type is required");if((null==t?void 0:t.type)!=="ERC20")throw d.standardErrors.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw d.standardErrors.rpc.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw d.standardErrors.rpc.invalidParams("Address is required");let r=this.getChainId(),{address:n,symbol:i,image:s,decimals:o}=t.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(t.type,n,i,o,s,r)}}initializeRelay(){if(!this._relay){let e=new u.WalletLinkRelay({linkAPIUrl:c.WALLETLINK_URL,storage:this._storage});e.setAppInfo(this._appName,this._appLogoUrl),e.attachUI(),e.setAccountsCallback((e,t)=>this._setAddresses(e,t)),e.setChainCallback((e,t)=>{this.updateProviderInfo(t,parseInt(e,10))}),this._relay=e}return this._relay}}t.WalletLinkSigner=m},65896:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.RelayEventManager=void 0;let n=r(98997);class i{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let e=this._nextRequestId,t=(0,n.prepend0x)(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}t.RelayEventManager=i},78461:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkRelay=void 0;let n=r(32485),i=r(56663),s=r(65896),o=r(42922),a=r(83705),l=r(44412),u=r(34614),c=r(78826),d=r(39172),h=r(98997),f=r(9876);class p{constructor(e){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,l.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=e=>{this.isLinked=e;let t=this.storage.getItem(i.LOCAL_STORAGE_ADDRESSES_KEY);if(e&&(this._session.linked=e),this.isUnlinkedErrorState=!1,t){let r=t.split(" "),n="true"===this.storage.getItem("IsStandaloneSigning");""===r[0]||e||!this._session.linked||n||(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{(this.chainCallbackParams.chainId!==e||this.chainCallbackParams.jsonRpcUrl!==t)&&(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(e,t))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),p.accountRequestCallbackIds.size>0&&(Array.from(p.accountRequestCallbackIds.values()).forEach(t=>{this.invokeCallback(Object.assign(Object.assign({},{type:"WEB3_RESPONSE",id:t,response:{method:"requestEthereumAccounts",result:[e]}}),{id:t}))}),p.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage;let{session:t,ui:r,connection:n}=this.subscribe();this._session=t,this.connection=n,this.relayEventManager=new s.RelayEventManager,this.ui=r}subscribe(){let e=o.WalletLinkSession.load(this.storage)||new o.WalletLinkSession(this.storage).save(),{linkAPIUrl:t}=this,r=new n.WalletLinkConnection({session:e,linkAPIUrl:t,listener:this}),i=this.isMobileWeb?new c.WLMobileRelayUI:new u.WalletLinkRelayUI;return r.connect(),{session:e,ui:i,connection:r}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(e=>setTimeout(()=>e(null),1e3))]).then(()=>{this.connection.destroy();let e=o.WalletLinkSession.load(this.storage);(null==e?void 0:e.id)===this._session.id&&f.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(e=>{})}setAppInfo(e,t){this.appName=e,this.appLogoUrl=t}getStorageItem(e){return this.storage.getItem(e)}setStorageItem(e,t){this.storage.setItem(e,t)}signEthereumMessage(e,t,r,n){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,h.hexStringFromBuffer)(e,!0),address:t,addPrefix:r,typedDataJson:n||null}})}ethereumAddressFromSignedMessage(e,t,r){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,h.hexStringFromBuffer)(e,!0),signature:(0,h.hexStringFromBuffer)(t,!0),addPrefix:r}})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,h.bigIntStringFromBigInt)(e.weiValue),data:(0,h.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,h.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?(0,h.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?(0,h.bigIntStringFromBigInt)(e.gasPriceInWei):null,gasLimit:e.gasLimit?(0,h.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:(0,h.bigIntStringFromBigInt)(e.weiValue),data:(0,h.hexStringFromBuffer)(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?(0,h.bigIntStringFromBigInt)(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?(0,h.bigIntStringFromBigInt)(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?(0,h.bigIntStringFromBigInt)(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?(0,h.bigIntStringFromBigInt)(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,h.hexStringFromBuffer)(e,!0),chainId:t}})}scanQRCode(e){return this.sendRequest({method:"scanQRCode",params:{regExp:e}})}getWalletLinkSession(){return this._session}genericRequest(e,t){return this.sendRequest({method:"generic",params:{action:t,data:e}})}sendGenericMessage(e){return this.sendRequest(e)}sendRequest(e){let t=null,r=(0,h.randomBytesHex)(8),n=n=>{this.publishWeb3RequestCanceledEvent(r),this.handleErrorResponse(r,e.method,n),null==t||t()};return new Promise((i,s)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(r,e=>{if(null==t||t(),(0,a.isErrorResponse)(e))return s(Error(e.errorMessage));i(e)}),this.publishWeb3RequestEvent(r,e)})}setAccountsCallback(e){this.accountsCallback=e}setChainCallback(e){this.chainCallback=e}setDappDefaultChainCallback(e){this.dappDefaultChain=e}publishWeb3RequestEvent(e,t){let r={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",r,!0).then(e=>{}).catch(e=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:r.id,response:{method:t.method,errorMessage:e.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof c.WLMobileRelayUI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink()}}publishWeb3RequestCanceledEvent(e){this.publishEvent("Web3RequestCanceled",{type:"WEB3_REQUEST_CANCELED",id:e},!1).then()}publishEvent(e,t,r){return this.connection.publishEvent(e,t,r)}handleWeb3ResponseMessage(e){let{response:t}=e;if("requestEthereumAccounts"===t.method){p.accountRequestCallbackIds.forEach(t=>this.invokeCallback(Object.assign(Object.assign({},e),{id:t}))),p.accountRequestCallbackIds.clear();return}this.invokeCallback(e)}handleErrorResponse(e,t,r){var n;let i=null!==(n=null==r?void 0:r.message)&&void 0!==n?n:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:e,response:{method:t,errorMessage:i}})}invokeCallback(e){let t=this.relayEventManager.callbacks.get(e.id);t&&(t(e.response),this.relayEventManager.callbacks.delete(e.id))}requestEthereumAccounts(){let e={method:"requestEthereumAccounts",params:{appName:this.appName,appLogoUrl:this.appLogoUrl||null}},t=(0,h.randomBytesHex)(8);return new Promise((r,n)=>{this.relayEventManager.callbacks.set(t,e=>{if((0,a.isErrorResponse)(e))return n(Error(e.errorMessage));r(e)}),p.accountRequestCallbackIds.add(t),this.publishWeb3RequestEvent(t,e)})}watchAsset(e,t,r,n,i,s){let o={method:"watchAsset",params:{type:e,options:{address:t,symbol:r,decimals:n,image:i},chainId:s}},l=null,u=(0,h.randomBytesHex)(8);return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:e=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,e),null==l||l()},onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(u,r=>{if(null==l||l(),(0,a.isErrorResponse)(r))return t(Error(r.errorMessage));e(r)}),this.publishWeb3RequestEvent(u,o)})}addEthereumChain(e,t,r,n,i,s){let o={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:n,chainName:i,iconUrls:r,nativeCurrency:s}},l=null,u=(0,h.randomBytesHex)(8);return l=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:e=>{this.publishWeb3RequestCanceledEvent(u),this.handleErrorResponse(u,o.method,e),null==l||l()},onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(u,r=>{if(null==l||l(),(0,a.isErrorResponse)(r))return t(Error(r.errorMessage));e(r)}),this.publishWeb3RequestEvent(u,o)})}switchEthereumChain(e,t){let r={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},n=(0,h.randomBytesHex)(8);return new Promise((e,t)=>{this.relayEventManager.callbacks.set(n,r=>(0,a.isErrorResponse)(r)&&r.errorCode?t(d.standardErrors.provider.custom({code:r.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):(0,a.isErrorResponse)(r)?t(Error(r.errorMessage)):void e(r)),this.publishWeb3RequestEvent(n,r)})}}t.WalletLinkRelay=p,p.accountRequestCallbackIds=new Set},93007:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkCipher=void 0;let n=r(98997);class i{constructor(e){this.secret=e}async encrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");let r=crypto.getRandomValues(new Uint8Array(12)),i=await crypto.subtle.importKey("raw",(0,n.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,o=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:r},i,s.encode(e)),a=o.slice(o.byteLength-16),l=o.slice(0,o.byteLength-16),u=new Uint8Array(a),c=new Uint8Array(l),d=new Uint8Array([...r,...u,...c]);return(0,n.uint8ArrayToHex)(d)}async decrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((r,i)=>{!async function(){let s=await crypto.subtle.importKey("raw",(0,n.hexStringToUint8Array)(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),o=(0,n.hexStringToUint8Array)(e),a=o.slice(0,12),l=o.slice(12,28),u=new Uint8Array([...o.slice(28),...l]),c={name:"AES-GCM",iv:new Uint8Array(a)};try{let e=await window.crypto.subtle.decrypt(c,s,u),t=new TextDecoder;r(t.decode(e))}catch(e){i(e)}}()})}}t.WalletLinkCipher=i},32485:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkConnection=void 0;let n=r(56663),i=r(93007),s=r(99085),o=r(77730),a=r(34468);class l{constructor({session:e,linkAPIUrl:t,listener:r,WebSocketClass:l=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,a.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{e&&new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach((t,r)=>{let n=e[r];void 0!==n&&t(n)})},this.handleDestroyed=e=>{var t;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;{let r=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(r)}},this.handleMetadataUpdated=async(e,t)=>{var r;{let n=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.metadataUpdated(e,n)}},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated(n.WALLET_USER_NAME_KEY,e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated(n.APP_VERSION_KEY,e)},this.handleChainUpdated=async(e,t)=>{var r;{let n=await this.cipher.decrypt(e),i=await this.cipher.decrypt(t);null===(r=this.listener)||void 0===r||r.chainUpdated(n,i)}},this.session=e,this.cipher=new i.WalletLinkCipher(e.secret),this.listener=r;let u=new o.WalletLinkWebSocket(`${t}/rpc`,l);u.setConnectionStateListener(async e=>{let t=!1;switch(e){case o.ConnectionState.DISCONNECTED:if(!this.destroyed){let e=async()=>{await new Promise(e=>setTimeout(e,5e3)),this.destroyed||u.connect().catch(()=>{e()})};e()}break;case o.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),t=!0}catch(e){}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case o.ConnectionState.CONNECTING:}this.connected!==t&&(this.connected=t)}),u.setIncomingDataListener(e=>{var t;switch(e.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{let t="IsLinkedOK"===e.type?e.linked:void 0;this.linked=t||e.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":this.handleSessionMetadataUpdated(e.metadata);break;case"Event":this.handleIncomingEvent(e)}void 0!==e.id&&(null===(t=this.requestResolutions.get(e.id))||void 0===t||t(e))}),this.ws=u,this.http=new s.WalletLinkHTTP(t,e.id,e.key)}connect(){if(this.destroyed)throw Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(e){var t;this._connected=e,e&&(null===(t=this.onceConnected)||void 0===t||t.call(this))}setOnceConnected(e){return new Promise(t=>{this.connected?e().then(t):this.onceConnected=()=>{e().then(t),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(e){var t,r;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(r=this.listener)||void 0===r||r.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if("Event"===e.type&&"Web3Response"===e.event){let r=JSON.parse(await this.cipher.decrypt(e.data));if("WEB3_RESPONSE"!==r.type)return;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(r)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(e=>this.handleIncomingEvent(e))}async setSessionMetadata(e,t){let r={type:"SetSessionConfig",id:(0,a.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[e]:t}};return this.setOnceConnected(async()=>{let e=await this.makeRequest(r);if("Fail"===e.type)throw Error(e.error||"failed to set session metadata")})}async publishEvent(e,t,r=!1){let n=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),i={type:"PublishEvent",id:(0,a.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:e,data:n,callWebhook:r};return this.setOnceLinked(async()=>{let e=await this.makeRequest(i);if("Fail"===e.type)throw Error(e.error||"failed to publish event");return e.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4){this.ws.disconnect();return}try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t=6e4){let r;let n=e.id;return this.sendData(e),Promise.race([new Promise((e,i)=>{r=window.setTimeout(()=>{i(Error(`request ${n} timed out`))},t)}),new Promise(e=>{this.requestResolutions.set(n,t=>{clearTimeout(r),e(t),this.requestResolutions.delete(n)})})])}async authenticate(){let e={type:"HostSession",id:(0,a.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},t=await this.makeRequest(e);if("Fail"===t.type)throw Error(t.error||"failed to authenticate")}sendIsLinked(){let e={type:"IsLinked",id:(0,a.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}sendGetSessionConfig(){let e={type:"GetSessionConfig",id:(0,a.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(e)}}t.WalletLinkConnection=l},99085:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkHTTP=void 0;class r{constructor(e,t,r){this.linkAPIUrl=e,this.sessionId=t;let n=`${t}:${r}`;this.auth=`Basic ${btoa(n)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(e=>console.error("Unabled to mark event as failed:",e))}async fetchUnseenEvents(){var e;let t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){let{events:r,error:n}=await t.json();if(n)throw Error(`Check unseen events failed: ${n}`);let i=null!==(e=null==r?void 0:r.filter(e=>"Web3Response"===e.event).map(e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data})))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(i),i}throw Error(`Check unseen events failed: ${t.status}`)}}t.WalletLinkHTTP=r},77730:function(e,t){"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkWebSocket=t.ConnectionState=void 0,(n=r||(t.ConnectionState=r={}))[n.DISCONNECTED=0]="DISCONNECTED",n[n.CONNECTING=1]="CONNECTING",n[n.CONNECTED=2]="CONNECTED";class i{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw Error("webSocket object is not null");return new Promise((e,t)=>{var n;let i;try{this.webSocket=i=new this.WebSocketClass(this.url)}catch(e){t(e);return}null===(n=this.connectionStateListener)||void 0===n||n.call(this,r.CONNECTING),i.onclose=e=>{var n;this.clearWebSocket(),t(Error(`websocket error ${e.code}: ${e.reason}`)),null===(n=this.connectionStateListener)||void 0===n||n.call(this,r.DISCONNECTED)},i.onopen=t=>{var n;e(),null===(n=this.connectionStateListener)||void 0===n||n.call(this,r.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(e=>this.sendData(e)),this.pendingData=[])},i.onmessage=e=>{var t,r;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{let t=JSON.parse(e.data);null===(r=this.incomingDataListener)||void 0===r||r.call(this,t)}catch(e){}}})}disconnect(){var e;let{webSocket:t}=this;if(t){this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,r.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){let{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}t.WalletLinkWebSocket=i},56663:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.APP_VERSION_KEY=t.LOCAL_STORAGE_ADDRESSES_KEY=t.WALLET_USER_NAME_KEY=void 0,t.WALLET_USER_NAME_KEY="walletUsername",t.LOCAL_STORAGE_ADDRESSES_KEY="Addresses",t.APP_VERSION_KEY="AppVersion"},42922:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkSession=void 0;let n=r(42724),i=r(98997),s="session:id",o="session:secret",a="session:linked";class l{constructor(e,t,r,s){this._storage=e,this._id=t||(0,i.randomBytesHex)(16),this._secret=r||(0,i.randomBytesHex)(32),this._key=new n.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!s}static load(e){let t=e.getItem(s),r=e.getItem(a),n=e.getItem(o);return t&&n?new l(e,t,n,"1"===r):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this._storage.setItem(s,this._id),this._storage.setItem(o,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(a,this._linked?"1":"0")}}t.WalletLinkSession=l},83705:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isErrorResponse=void 0,t.isErrorResponse=function(e){return void 0!==e.errorMessage}},78826:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WLMobileRelayUI=void 0;let n=r(30054),i=r(44412),s=r(99285);class o{constructor(){this.attached=!1,this.redirectDialog=new n.RedirectDialog}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){let t=new URL(s.CBW_MOBILE_DEEPLINK_URL);t.searchParams.append("redirect_url",(0,i.getLocation)().href),e&&t.searchParams.append("wl_url",e);let r=document.createElement("a");r.target="cbw-opener",r.href=t.href,r.rel="noreferrer noopener",r.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}t.WLMobileRelayUI=o},34614:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletLinkRelayUI=void 0;let n=r(69573),i=r(91989);class s{constructor(){this.attached=!1,this.snackbar=new i.Snackbar}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");let e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,(0,n.injectCssReset)()}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}t.WalletLinkRelayUI=s},7568:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"},30054:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.RedirectDialog=void 0;let i=n(r(25796)),s=r(57764),o=r(69573),a=r(91989),l=r(44412),u=n(r(7568));class c{constructor(){this.root=null,this.darkMode=(0,l.isDarkMode)()}attach(){let e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),(0,o.injectCssReset)()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,s.render)(null,this.root),e&&(0,s.render)((0,s.h)(d,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}t.RedirectDialog=c;let d=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:o})=>(0,s.h)(a.SnackbarContainer,{darkMode:r},(0,s.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,s.h)("style",null,u.default),(0,s.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:o}),(0,s.h)("div",{class:(0,i.default)("-cbwsdk-redirect-dialog-box",r?"dark":"light")},(0,s.h)("p",null,e),(0,s.h)("button",{onClick:n},t))))},91931:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"},91989:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.SnackbarInstance=t.SnackbarContainer=t.Snackbar=void 0;let i=n(r(25796)),s=r(57764),o=r(83148),a=r(44412),l=n(r(91931));class u{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,a.isDarkMode)()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,s.render)((0,s.h)("div",null,(0,s.h)(t.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,r])=>(0,s.h)(t.SnackbarInstance,Object.assign({},r,{key:e}))))),this.root)}}t.Snackbar=u,t.SnackbarContainer=e=>(0,s.h)("div",{class:(0,i.default)("-cbwsdk-snackbar-container")},(0,s.h)("style",null,l.default),(0,s.h)("div",{class:"-cbwsdk-snackbar"},e.children)),t.SnackbarInstance=({autoExpand:e,message:t,menuItems:r})=>{let[n,a]=(0,o.useState)(!0),[l,u]=(0,o.useState)(null!=e&&e);return(0,o.useEffect)(()=>{let e=[window.setTimeout(()=>{a(!1)},1),window.setTimeout(()=>{u(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}}),(0,s.h)("div",{class:(0,i.default)("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",l&&"-cbwsdk-snackbar-instance-expanded")},(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{u(!l)}},(0,s.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,s.h)("div",{class:"-gear-container"},!l&&(0,s.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,s.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),r&&r.length>0&&(0,s.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},r.map((e,t)=>(0,s.h)("div",{class:(0,i.default)("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,s.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,s.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,s.h)("span",{class:(0,i.default)("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))}},4316:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}'},69573:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.injectCssReset=void 0;let i=n(r(4316));t.injectCssReset=function(){let e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(i.default)),document.documentElement.appendChild(e)}},44412:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isDarkMode=t.isMobileWeb=t.getLocation=t.createQrUrl=void 0,t.createQrUrl=function(e,t,r,n,i,s){let o=new URLSearchParams({[n?"parent-id":"id"]:e,secret:t,server:r,v:i,chainId:s.toString()}).toString();return`${r}/#/link?${o}`},t.getLocation=function(){try{if(function(){try{return null!==window.frameElement}catch(e){return!1}}()&&window.top)return window.top.location;return window.location}catch(e){return window.location}},t.isMobileWeb=function(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(e=null==window?void 0:window.navigator)||void 0===e?void 0:e.userAgent)},t.isDarkMode=function(){var e,t;return null!==(t=null===(e=null==window?void 0:window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)&&void 0!==t&&t}},9876:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ScopedLocalStorage=void 0;class r{constructor(e,t){this.scope=e,this.module=t}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),t=[];for(let r=0;rlocalStorage.removeItem(e))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new r("CBWSDK").clear(),new r("walletlink").clear()}}t.ScopedLocalStorage=r},89665:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.decryptContent=t.encryptContent=t.importKeyFromHexString=t.exportKeyToHexString=t.decrypt=t.encrypt=t.deriveSharedSecret=t.generateKeyPair=void 0;let n=r(98997);async function i(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function s(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function o(e,t){let r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},e,new TextEncoder().encode(t));return{iv:r,cipherText:n}}async function a(e,{iv:t,cipherText:r}){let n=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,r);return new TextDecoder().decode(n)}function l(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function u(e,t){let r=l(e),i=await crypto.subtle.exportKey(r,t);return(0,n.uint8ArrayToHex)(new Uint8Array(i))}async function c(e,t){let r=l(e),i=(0,n.hexStringToUint8Array)(t).buffer;return await crypto.subtle.importKey(r,i,{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])}async function d(e,t){return o(t,JSON.stringify(e,(e,t)=>t instanceof Error?Object.assign(Object.assign({},t.code?{code:t.code}:{}),{message:t.message}):t))}async function h(e,t){return JSON.parse(await a(t,e))}t.generateKeyPair=i,t.deriveSharedSecret=s,t.encrypt=o,t.decrypt=a,t.exportKeyToHexString=u,t.importKeyFromHexString=c,t.encryptContent=d,t.decryptContent=h},66320:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.checkErrorForInvalidRequestArgs=t.getCoinbaseInjectedProvider=t.getCoinbaseInjectedSigner=t.fetchRPCRequest=void 0;let n=r(54750),i=r(39172);async function s(e,t){if(!t.rpcUrl)throw i.standardErrors.rpc.internal("No RPC URL set for chain");let r=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}),s=await window.fetch(t.rpcUrl,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":n.LIB_VERSION}});return(await s.json()).result}function o(){return globalThis.coinbaseWalletSigner}t.fetchRPCRequest=s,t.getCoinbaseInjectedSigner=o,t.getCoinbaseInjectedProvider=function({metadata:e,preference:t}){var r,n,i;let s=globalThis;if("smartWalletOnly"!==t.options){if(o())return;let t=s.coinbaseWalletExtension;if(t){let{appName:n,appLogoUrl:i,appChainIds:s}=e;return null===(r=t.setAppInfo)||void 0===r||r.call(t,n,i,s),t}}let a=null!==(n=s.ethereum)&&void 0!==n?n:null===(i=s.top)||void 0===i?void 0:i.ethereum;if(null==a?void 0:a.isCoinbaseBrowser)return a},t.checkErrorForInvalidRequestArgs=function(e){if(!e||"object"!=typeof e||Array.isArray(e))return i.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:e});let{method:t,params:r}=e;return"string"!=typeof t||0===t.length?i.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:e}):void 0===r||Array.isArray(r)||"object"==typeof r&&null!==r?void 0:i.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:e})}},86105:function(e,t,r){var n=r(9109).Buffer;let i=r(77114);function s(e){if(e.startsWith("int["))return"int256"+e.slice(3);if("int"===e)return"int256";if(e.startsWith("uint["))return"uint256"+e.slice(4);if("uint"===e)return"uint256";if(e.startsWith("fixed["))return"fixed128x128"+e.slice(5);if("fixed"===e)return"fixed128x128";if(e.startsWith("ufixed["))return"ufixed128x128"+e.slice(6);else if("ufixed"===e)return"ufixed128x128";return e}function o(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function a(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function l(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":parseInt(t[2],10):null}function u(e){var t=typeof e;if("string"===t||"number"===t)return BigInt(e);if("bigint"===t)return e;throw Error("Argument is not a number")}function c(e,t){if("address"===e)return c("uint160",u(t));if("bool"===e)return c("uint8",t?1:0);if("string"===e)return c("bytes",new n(t,"utf8"));if((f=e).lastIndexOf("]")===f.length-1){if(void 0===t.length)throw Error("Not an array?");if("dynamic"!==(r=l(e))&&0!==r&&t.length>r)throw Error("Elements exceed array size: "+r);for(h in d=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)d.push(c(e,t[h]));if("dynamic"===r){var r,s,d,h,f,p=c("uint256",t.length);d.unshift(p)}return n.concat(d)}if("bytes"===e)return t=new n(t),d=n.concat([c("uint256",t.length),t]),t.length%32!=0&&(d=n.concat([d,i.zeros(32-t.length%32)])),d;if(e.startsWith("bytes")){if((r=o(e))<1||r>32)throw Error("Invalid bytes width: "+r);return i.setLengthRight(t,32)}else if(e.startsWith("uint")){if((r=o(e))%8||r<8||r>256)throw Error("Invalid uint width: "+r);s=u(t);let n=i.bitLengthFromBigInt(s);if(n>r)throw Error("Supplied uint exceeds width: "+r+" vs "+n);if(s<0)throw Error("Supplied uint is negative");return i.bufferBEFromBigInt(s,32)}else if(e.startsWith("int")){if((r=o(e))%8||r<8||r>256)throw Error("Invalid int width: "+r);s=u(t);let n=i.bitLengthFromBigInt(s);if(n>r)throw Error("Supplied int exceeds width: "+r+" vs "+n);let a=i.twosFromBigInt(s,256);return i.bufferBEFromBigInt(a,32)}else if(e.startsWith("ufixed")){if(r=a(e),(s=u(t))<0)throw Error("Supplied ufixed is negative");return c("uint256",s*BigInt(2)**BigInt(r[1]))}else if(e.startsWith("fixed"))return r=a(e),c("int256",u(t)*BigInt(2)**BigInt(r[1]));throw Error("Unsupported or invalid type: "+e)}function d(e,t){if(e.length!==t.length)throw Error("Number of types are not matching the values");for(var r,a,l=[],c=0;c32)throw Error("Invalid bytes width: "+r);l.push(i.setLengthRight(h,r))}else if(d.startsWith("uint")){if((r=o(d))%8||r<8||r>256)throw Error("Invalid uint width: "+r);a=u(h);let e=i.bitLengthFromBigInt(a);if(e>r)throw Error("Supplied uint exceeds width: "+r+" vs "+e);l.push(i.bufferBEFromBigInt(a,r/8))}else if(d.startsWith("int")){if((r=o(d))%8||r<8||r>256)throw Error("Invalid int width: "+r);a=u(h);let e=i.bitLengthFromBigInt(a);if(e>r)throw Error("Supplied int exceeds width: "+r+" vs "+e);let t=i.twosFromBigInt(a,r);l.push(i.bufferBEFromBigInt(t,r/8))}else throw Error("Unsupported or invalid type: "+d)}return n.concat(l)}e.exports={rawEncode:function(e,t){var r=[],i=[],o=32*e.length;for(var a in e){var u=s(e[a]),d=c(u,t[a]);"string"===u||"bytes"===u||"dynamic"===l(u)?(r.push(c("uint256",o)),i.push(d),o+=d.length):r.push(d)}return n.concat(r.concat(i))},solidityPack:d,soliditySHA3:function(e,t){return i.keccak(d(e,t))}}},80745:function(e,t,r){var n=r(9109).Buffer;let i=r(77114),s=r(86105),o={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},a={encodeData(e,t,r,o=!0){let a=["bytes32"],l=[this.hashType(e,r)];if(o){let u=(e,t,a)=>{if(void 0!==r[t])return["bytes32",null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":i.keccak(this.encodeData(t,a,r,o))];if(void 0===a)throw Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",i.keccak(a)];if("string"===t)return"string"==typeof a&&(a=n.from(a,"utf8")),["bytes32",i.keccak(a)];if(t.lastIndexOf("]")===t.length-1){let r=t.slice(0,t.lastIndexOf("[")),n=a.map(t=>u(e,r,t));return["bytes32",i.keccak(s.rawEncode(n.map(([e])=>e),n.map(([,e])=>e)))]}return[t,a]};for(let n of r[e]){let[e,r]=u(n.name,n.type,t[n.name]);a.push(e),l.push(r)}}else for(let s of r[e]){let e=t[s.name];if(void 0!==e){if("bytes"===s.type)a.push("bytes32"),e=i.keccak(e),l.push(e);else if("string"===s.type)a.push("bytes32"),"string"==typeof e&&(e=n.from(e,"utf8")),e=i.keccak(e),l.push(e);else if(void 0!==r[s.type])a.push("bytes32"),e=i.keccak(this.encodeData(s.type,e,r,o)),l.push(e);else if(s.type.lastIndexOf("]")===s.type.length-1)throw Error("Arrays currently unimplemented in encodeData");else a.push(s.type),l.push(e)}}return s.rawEncode(a,l)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(t=>t!==e);for(let i of n=[e].concat(n.sort())){if(!t[i])throw Error("No type definition specified: "+i);r+=i+"("+t[i].map(({name:e,type:t})=>t+" "+e).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||void 0===t[e])return r;for(let n of(r.push(e),t[e]))for(let e of this.findTypeDependencies(n.type,t,r))r.includes(e)||r.push(e);return r},hashStruct(e,t,r,n=!0){return i.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return i.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let r in o.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let r=this.sanitizeData(e),s=[n.from("1901","hex")];return s.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),"EIP712Domain"!==r.primaryType&&s.push(this.hashStruct(r.primaryType,r.message,r.types,t)),i.keccak(n.concat(s))}};e.exports={TYPED_MESSAGE_SCHEMA:o,TypedDataUtils:a,hashForSignTypedDataLegacy:function(e){return function(e){let t=Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;let r=e.map(function(e){return"bytes"===e.type?i.toBuffer(e.value):e.value}),n=e.map(function(e){return e.type}),o=e.map(function(e){if(!e.name)throw t;return e.type+" "+e.name});return s.soliditySHA3(["bytes32","bytes32"],[s.soliditySHA3(Array(e.length).fill("string"),o),s.soliditySHA3(n,r)])}(e.data)},hashForSignTypedData_v3:function(e){return a.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return a.hash(e.data)}}},77114:function(e,t,r){var n=r(9109).Buffer;let i=r(6230);function s(e){return n.allocUnsafe(e).fill(0)}function o(e,t){let r=e.toString(16);r.length%2!=0&&(r="0"+r);let i=r.match(/.{1,2}/g).map(e=>parseInt(e,16));for(;i.lengthnull)}),r=null,s=null,o=null;return e&&e.baseFeePerGas&&(r=e.baseFeePerGas,o=n.O$.from("1500000000"),s=e.baseFeePerGas.mul(2).add(o)),{lastBaseFeePerGas:r,maxFeePerGas:s,maxPriorityFeePerGas:o,gasPrice:t}},new(r||(r=Promise))(function(n,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!!(e&&e._isProvider)}}},37637:function(e,t,r){"use strict";r.d(t,{E:function(){return u},b:function(){return c}});var n=r(36173),i=r(13421),s=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let o=new i.Yd("abstract-signer/5.7.0"),a=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],l=[i.Yd.errors.INSUFFICIENT_FUNDS,i.Yd.errors.NONCE_EXPIRED,i.Yd.errors.REPLACEMENT_UNDERPRICED];class u{constructor(){o.checkAbstract(new.target,u),(0,n.zG)(this,"_isSigner",!0)}getBalance(e){return s(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return s(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return s(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let t=yield(0,n.mE)(this.checkTransaction(e));return yield this.provider.estimateGas(t)})}call(e,t){return s(this,void 0,void 0,function*(){this._checkProvider("call");let r=yield(0,n.mE)(this.checkTransaction(e));return yield this.provider.call(r,t)})}sendTransaction(e){return s(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)})}getChainId(){return s(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return s(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return s(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return s(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let t in e)-1===a.indexOf(t)&&o.throwArgumentError("invalid transaction key: "+t,"transaction",e);let t=(0,n.DC)(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then(t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&o.throwArgumentError("from address mismatch","transaction",e),t[0])),t}populateTransaction(e){return s(this,void 0,void 0,function*(){let t=yield(0,n.mE)(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then(e=>s(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.resolveName(e);return null==t&&o.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})),t.to.catch(e=>{}));let r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null!=t.gasPrice&&(2===t.type||r)?o.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(0===t.type||1===t.type)&&r&&o.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(2===t.type||null==t.type)&&null!=t.maxFeePerGas&&null!=t.maxPriorityFeePerGas)t.type=2;else if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{let e=yield this.getFeeData();if(null==t.type){if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas){if(t.type=2,null!=t.gasPrice){let e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas)}else null!=e.gasPrice?(r&&o.throwError("network does not support EIP-1559",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):o.throwError("failed to get consistent fee data",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"})}else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch(e=>{if(l.indexOf(e.code)>=0)throw e;return o.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",i.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})})),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then(t=>(0!==t[1]&&t[0]!==t[1]&&o.throwArgumentError("chainId address mismatch","transaction",e),t[0])),yield(0,n.mE)(t)})}_checkProvider(e){this.provider||o.throwError("missing provider",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}}class c extends u{constructor(e,t){super(),(0,n.zG)(this,"address",e),(0,n.zG)(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then(()=>{o.throwError(e,i.Yd.errors.UNSUPPORTED_OPERATION,{operation:t})})}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new c(this.address,e)}}},89005:function(e,t,r){"use strict";r.d(t,{Kn:function(){return d},CR:function(){return h}});var n=r(9784),i=r(22594),s=r(43481),o=r(18162);let a=new(r(13421)).Yd("address/5.7.0");function l(e){(0,n.A7)(e,20)||a.throwArgumentError("invalid address","address",e);let t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let e=0;e<40;e++)r[e]=t[e].charCodeAt(0);let i=(0,n.lE)((0,s.w)(r));for(let e=0;e<40;e+=2)i[e>>1]>>4>=8&&(t[e]=t[e].toUpperCase()),(15&i[e>>1])>=8&&(t[e+1]=t[e+1].toUpperCase());return"0x"+t.join("")}let u={};for(let e=0;e<10;e++)u[String(e)]=String(e);for(let e=0;e<26;e++)u[String.fromCharCode(65+e)]=String(10+e);let c=Math.floor(Math.log10?Math.log10(9007199254740991):Math.log(9007199254740991)/Math.LN10);function d(e){let t=null;if("string"!=typeof e&&a.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=l(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&a.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==function(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map(e=>u[e]).join("");for(;t.length>=c;){let e=t.substring(0,c);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}(e)&&a.throwArgumentError("bad icap checksum","address",e),t=(0,i.g$)(e.substring(4));t.length<40;)t="0"+t;t=l("0x"+t)}else a.throwArgumentError("invalid address","address",e);return t}function h(e){let t=null;try{t=d(e.from)}catch(t){a.throwArgumentError("missing from address","transaction",e)}let r=(0,n.G1)((0,n.lE)(i.O$.from(e.nonce).toHexString()));return d((0,n.p3)((0,s.w)((0,o.c)([t,r])),12))}},38418:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="bignumber/5.7.0"},22594:function(e,t,r){"use strict";r.d(t,{O$:function(){return f},Zm:function(){return d},g$:function(){return b}});var n=r(58171),i=r.n(n),s=r(9784),o=r(13421),a=r(38418),l=i().BN;let u=new o.Yd(a.i),c={};function d(e){return null!=e&&(f.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||(0,s.A7)(e)||"bigint"==typeof e||(0,s._t)(e))}let h=!1;class f{constructor(e,t){e!==c&&u.throwError("cannot call constructor directly; use BigNumber.from",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return g(m(this).fromTwos(e))}toTwos(e){return g(m(this).toTwos(e))}abs(){return"-"===this._hex[0]?f.from(this._hex.substring(1)):this}add(e){return g(m(this).add(m(e)))}sub(e){return g(m(this).sub(m(e)))}div(e){return f.from(e).isZero()&&y("division-by-zero","div"),g(m(this).div(m(e)))}mul(e){return g(m(this).mul(m(e)))}mod(e){let t=m(e);return t.isNeg()&&y("division-by-zero","mod"),g(m(this).umod(t))}pow(e){let t=m(e);return t.isNeg()&&y("negative-power","pow"),g(m(this).pow(t))}and(e){let t=m(e);return(this.isNegative()||t.isNeg())&&y("unbound-bitwise-result","and"),g(m(this).and(t))}or(e){let t=m(e);return(this.isNegative()||t.isNeg())&&y("unbound-bitwise-result","or"),g(m(this).or(t))}xor(e){let t=m(e);return(this.isNegative()||t.isNeg())&&y("unbound-bitwise-result","xor"),g(m(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&y("negative-width","mask"),g(m(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&y("negative-width","shl"),g(m(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&y("negative-width","shr"),g(m(this).shrn(e))}eq(e){return m(this).eq(m(e))}lt(e){return m(this).lt(m(e))}lte(e){return m(this).lte(m(e))}gt(e){return m(this).gt(m(e))}gte(e){return m(this).gte(m(e))}isNegative(){return"-"===this._hex[0]}isZero(){return m(this).isZero()}toNumber(){try{return m(this).toNumber()}catch(e){y("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return u.throwError("this platform does not support BigInt",o.Yd.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?h||(h=!0,u.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?u.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",o.Yd.errors.UNEXPECTED_ARGUMENT,{}):u.throwError("BigNumber.toString does not accept parameters",o.Yd.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof f)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new f(c,p(e)):e.match(/^-?[0-9]+$/)?new f(c,p(new l(e))):u.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&y("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&y("overflow","BigNumber.from",e),f.from(String(e));if("bigint"==typeof e)return f.from(e.toString());if((0,s._t)(e))return f.from((0,s.Dv)(e));if(e){if(e.toHexString){let t=e.toHexString();if("string"==typeof t)return f.from(t)}else{let t=e._hex;if(null==t&&"BigNumber"===e.type&&(t=e.hex),"string"==typeof t&&((0,s.A7)(t)||"-"===t[0]&&(0,s.A7)(t.substring(1))))return f.from(t)}}return u.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}}function p(e){if("string"!=typeof e)return p(e.toString(16));if("-"===e[0])return("-"===(e=e.substring(1))[0]&&u.throwArgumentError("invalid hex","value",e),"0x00"===(e=p(e)))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function g(e){return f.from(p(e))}function m(e){let t=f.from(e).toHexString();return"-"===t[0]?new l("-"+t.substring(3),16):new l(t.substring(2),16)}function y(e,t,r){let n={fault:e,operation:t};return null!=r&&(n.value=r),u.throwError(e,o.Yd.errors.NUMERIC_FAULT,n)}function b(e){return new l(e,36).toString(16)}},9784:function(e,t,r){"use strict";r.d(t,{lE:function(){return u},zo:function(){return c},xs:function(){return y},E1:function(){return g},p3:function(){return m},$P:function(){return b},$m:function(){return v},Dv:function(){return p},_t:function(){return l},Zq:function(){return o},A7:function(){return h},N:function(){return w},G1:function(){return d}});let n=new(r(13421)).Yd("bytes/5.7.0");function i(e){return!!e.toHexString}function s(e){return e.slice||(e.slice=function(){let t=Array.prototype.slice.call(arguments);return s(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function o(e){return h(e)&&!(e.length%2)||l(e)}function a(e){return"number"==typeof e&&e==e&&e%1==0}function l(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e||!a(e.length)||e.length<0)return!1;for(let t=0;t=256)return!1}return!0}function u(e,t){if(t||(t={}),"number"==typeof e){n.checkSafeUint53(e,"invalid arrayify value");let t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),s(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),i(e)&&(e=e.toHexString()),h(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":n.throwArgumentError("hex data is odd-length","value",e));let i=[];for(let e=0;eu(e)),r=new Uint8Array(t.reduce((e,t)=>e+t.length,0));return t.reduce((e,t)=>(r.set(t,e),e+t.length),0),s(r)}function d(e){let t=u(e);if(0===t.length)return t;let r=0;for(;r>4]+f[15&n]}return t}return n.throwArgumentError("invalid hexlify value","value",e)}function g(e){if("string"!=typeof e)e=p(e);else if(!h(e)||e.length%2)return null;return(e.length-2)/2}function m(e,t,r){return("string"!=typeof e?e=p(e):(!h(e)||e.length%2)&&n.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r)?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function y(e){let t="0x";return e.forEach(e=>{t+=p(e).substring(2)}),t}function b(e){let t=function(e){"string"!=typeof e&&(e=p(e)),h(e)||n.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t2*t+2&&n.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function w(e){let t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(o(e)){let r=u(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64))):65===r.length?(t.r=p(r.slice(0,32)),t.s=p(r.slice(32,64)),t.v=r[64]):n.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:n.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=p(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){let r=function(e,t){(e=u(e)).length>t&&n.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(t);return r.set(e,t-e.length),s(r)}(u(t._vs),32);t._vs=p(r);let i=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&n.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;let o=p(r);null==t.s?t.s=o:t.s!==o&&n.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?n.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{let r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&n.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&h(t.r)?t.r=v(t.r,32):n.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&h(t.s)?t.s=v(t.s,32):n.throwArgumentError("signature missing or invalid s","signature",e);let r=u(t.s);r[0]>=128&&n.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);let i=p(r);t._vs&&(h(t._vs)||n.throwArgumentError("signature invalid _vs","signature",e),t._vs=v(t._vs,32)),null==t._vs?t._vs=i:t._vs!==i&&n.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}},75986:function(e,t,r){"use strict";r.d(t,{Bz:function(){return a},_Y:function(){return s},fh:function(){return o},tL:function(){return i}});var n=r(22594);let i=n.O$.from(-1),s=n.O$.from(0),o=n.O$.from(1),a=n.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")},22554:function(e,t,r){"use strict";r.d(t,{CH:function(){return eC}});var n=r(9784),i=r(22594),s=r(36173),o=r(13421);let a="abi/5.7.0",l=new o.Yd(a);class u{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){l.throwArgumentError(e,this.localName,t)}}class c{constructor(e){(0,s.zG)(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return(0,n.xs)(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData((0,n.zo)(e._data))}writeBytes(e){let t=(0,n.lE)(e),r=t.length%this.wordSize;return r&&(t=(0,n.zo)([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=(0,n.lE)(i.O$.from(e));return t.length>this.wordSize&&l.throwError("value out-of-bounds",o.Yd.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=(0,n.zo)([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){let e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class d{constructor(e,t,r,i){(0,s.zG)(this,"_data",(0,n.lE)(e)),(0,s.zG)(this,"wordSize",t||32),(0,s.zG)(this,"_coerceFunc",r),(0,s.zG)(this,"allowLoose",i),this._offset=0}get data(){return(0,n.Dv)(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&48>=parseInt(r[1])&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):d.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:l.throwError("data out-of-bounds",o.Yd.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new d(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return i.O$.from(this.readBytes(this.wordSize))}}var h=r(89005),f=r(99554),p=r(43481);class g extends u{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=(0,h.Kn)(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}decode(e){return(0,h.Kn)((0,n.$m)(e.readValue().toHexString(),20))}}class m extends u{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}let y=new o.Yd(a);function b(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map(t=>{let n=t.localName;return n||y.throwError("cannot encode object for signature with missing names",o.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&y.throwError("cannot encode object for signature with duplicate names",o.Yd.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]})}else y.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&y.throwArgumentError("types/value length mismatch","tuple",r);let i=new c(e.wordSize),s=new c(e.wordSize),a=[];return t.forEach((e,t)=>{let r=n[t];if(e.dynamic){let t=s.length;e.encode(s,r);let n=i.writeUpdatableValue();a.push(e=>{n(e+t)})}else e.encode(i,r)}),a.forEach(e=>{e(i.length)}),e.appendWriter(i)+e.appendWriter(s)}function v(e,t){let r=[],n=e.subReader(0);t.forEach(t=>{let i=null;if(t.dynamic){let r=e.readValue(),s=n.subReader(r.toNumber());try{i=t.decode(s)}catch(e){if(e.code===o.Yd.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===o.Yd.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}void 0!=i&&r.push(i)});let i=t.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});t.forEach((e,t)=>{let n=e.localName;if(!n||1!==i[n]||("length"===n&&(n="_length"),null!=r[n]))return;let s=r[t];s instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw s}}):r[n]=s});for(let e=0;e{throw t}})}return Object.freeze(r)}class w extends u{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){let e=this.coder.defaultValue(),t=[];for(let r=0;re._data.length&&y.throwError("insufficient data length",o.Yd.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});let r=[];for(let e=0;e{e.dynamic&&(r=!0),n.push(e.type)}),super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){let e=[];this.coders.forEach(t=>{e.push(t.defaultValue())});let t=this.coders.reduce((e,t)=>{let r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e},{});return this.coders.forEach((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))}),Object.freeze(e)}encode(e,t){return b(e,this.coders,t)}decode(e){return e.coerce(this.name,v(e,this.coders))}}let O=new o.Yd(a),N={},M={calldata:!0,memory:!0,storage:!0},R={calldata:!0,memory:!0};function T(e,t){if("bytes"===e||"string"===e){if(M[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&R[t])return!0;return(M[t]||"payable"===t)&&O.throwArgumentError("invalid modifier","name",t),!1}function D(e,t){for(let r in t)(0,s.zG)(e,r,t[r])}let L=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),j=new RegExp(/^(.*)\[([0-9]*)\]$/);class B{constructor(e,t){e!==N&&O.throwError("use fromString",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),D(this,t);let r=this.type.match(j);r?D(this,{arrayLength:parseInt(r[2]||"-1"),arrayChildren:B.fromObject({type:r[1],components:this.components}),baseType:"array"}):D(this,{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=L.sighash),L[e]||O.throwArgumentError("invalid format type","format",e),e===L.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map(t=>JSON.parse(t.format(e)))),JSON.stringify(t)}let t="";return"array"===this.baseType?t+=this.arrayChildren.format(e)+"["+(this.arrayLength<0?"":String(this.arrayLength))+"]":"tuple"===this.baseType?(e!==L.sighash&&(t+=this.type),t+="("+this.components.map(t=>t.format(e)).join(e===L.full?", ":",")+")"):t+=this.type,e!==L.sighash&&(!0===this.indexed&&(t+=" indexed"),e===L.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?B.fromString(e,t):B.fromObject(e)}static fromObject(e){return B.isParamType(e)?e:new B(N,{name:e.name||null,type:Z(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(B.fromObject):null})}static fromString(e,t){var r;return r=function(e,t){let r=e;function n(t){O.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let s={type:"",name:"",state:{allowType:!0}},o=s;for(let r=0;rB.fromString(e,t))}class U{constructor(e,t){e!==N&&O.throwError("use a static from method",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),D(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return U.isFragment(e)?e:"string"==typeof e?U.fromString(e):U.fromObject(e)}static fromObject(e){if(U.isFragment(e))return e;switch(e.type){case"function":return W.fromObject(e);case"event":return z.fromObject(e);case"constructor":return V.fromObject(e);case"error":return Y.fromObject(e);case"fallback":case"receive":return null}return O.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?z.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?W.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?V.fromString(e.trim()):"error"===e.split(" ")[0]?Y.fromString(e.substring(5).trim()):O.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!!(e&&e._isFragment)}}class z extends U{format(e){if(e||(e=L.sighash),L[e]||O.throwArgumentError("invalid format type","format",e),e===L.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==L.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===L.full?", ":",")+") ",e!==L.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?z.fromString(e):z.fromObject(e)}static fromObject(e){return z.isEventFragment(e)?e:("event"!==e.type&&O.throwArgumentError("invalid event object","value",e),new z(N,{name:Q(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(B.fromObject):[],type:"event"}))}static fromString(e){let t=e.match(X);t||O.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach(e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:O.warn("unknown modifier: "+e)}}),z.fromObject({name:t[1].trim(),anonymous:r,inputs:F(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function q(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&O.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||O.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=i.O$.from(r[1]),r[0]):e}function H(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach(e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}})}function G(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&O.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&O.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||O.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&O.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&O.throwArgumentError("unable to determine stateMutability","value",e),t}class V extends U{format(e){if(e||(e=L.sighash),L[e]||O.throwArgumentError("invalid format type","format",e),e===L.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});e===L.sighash&&O.throwError("cannot format a constructor for sighash",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map(t=>t.format(e)).join(e===L.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?V.fromString(e):V.fromObject(e)}static fromObject(e){if(V.isConstructorFragment(e))return e;"constructor"!==e.type&&O.throwArgumentError("invalid constructor object","value",e);let t=G(e);return t.constant&&O.throwArgumentError("constructor cannot be constant","value",e),new V(N,{name:null,type:e.type,inputs:e.inputs?e.inputs.map(B.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?i.O$.from(e.gas):null})}static fromString(e){let t={type:"constructor"},r=(e=q(e,t)).match(X);return r&&"constructor"===r[1].trim()||O.throwArgumentError("invalid constructor string","value",e),t.inputs=F(r[2].trim(),!1),H(r[3].trim(),t),V.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class W extends V{format(e){if(e||(e=L.sighash),L[e]||O.throwArgumentError("invalid format type","format",e),e===L.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map(t=>JSON.parse(t.format(e))),outputs:this.outputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==L.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===L.full?", ":",")+") ",e!==L.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map(t=>t.format(e)).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?W.fromString(e):W.fromObject(e)}static fromObject(e){if(W.isFunctionFragment(e))return e;"function"!==e.type&&O.throwArgumentError("invalid function object","value",e);let t=G(e);return new W(N,{type:e.type,name:Q(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(B.fromObject):[],outputs:e.outputs?e.outputs.map(B.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?i.O$.from(e.gas):null})}static fromString(e){let t={type:"function"},r=(e=q(e,t)).split(" returns ");r.length>2&&O.throwArgumentError("invalid function string","value",e);let n=r[0].match(X);if(n||O.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Q(t.name),t.inputs=F(n[2],!1),H(n[3].trim(),t),r.length>1){let n=r[1].match(X);(""!=n[1].trim()||""!=n[3].trim())&&O.throwArgumentError("unexpected tokens","value",e),t.outputs=F(n[2],!1)}else t.outputs=[];return W.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function K(e){let t=e.format();return("Error(string)"===t||"Panic(uint256)"===t)&&O.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class Y extends U{format(e){if(e||(e=L.sighash),L[e]||O.throwArgumentError("invalid format type","format",e),e===L.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map(t=>JSON.parse(t.format(e)))});let t="";return e!==L.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map(t=>t.format(e)).join(e===L.full?", ":",")+") ").trim()}static from(e){return"string"==typeof e?Y.fromString(e):Y.fromObject(e)}static fromObject(e){return Y.isErrorFragment(e)?e:("error"!==e.type&&O.throwArgumentError("invalid error object","value",e),K(new Y(N,{type:e.type,name:Q(e.name),inputs:e.inputs?e.inputs.map(B.fromObject):[]})))}static fromString(e){let t={type:"error"},r=e.match(X);return r||O.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Q(t.name),t.inputs=F(r[2],!1),K(Y.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Z(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}let J=RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Q(e){return e&&e.match(J)||O.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}let X=RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$"),ee=new o.Yd(a),et=new RegExp(/^bytes([0-9]*)$/),er=new RegExp(/^(u?int)([0-9]*)$/);class en{constructor(e){(0,s.zG)(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new g(e.name);case"bool":return new _(e.name);case"string":return new P(e.name);case"bytes":return new A(e.name);case"array":return new w(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new I((e.components||[]).map(e=>this._getCoder(e)),e.name);case"":return new k(e.name)}let t=e.type.match(er);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&ee.throwArgumentError("invalid "+t[1]+" bit length","param",e),new $(r/8,"int"===t[1],e.name)}if(t=e.type.match(et)){let r=parseInt(t[1]);return(0===r||r>32)&&ee.throwArgumentError("invalid bytes length","param",e),new x(r,e.name)}return ee.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new d(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new c(this._getWordSize())}getDefaultValue(e){return new I(e.map(e=>this._getCoder(B.from(e))),"_").defaultValue()}encode(e,t){e.length!==t.length&&ee.throwError("types/values length mismatch",o.Yd.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});let r=new I(e.map(e=>this._getCoder(B.from(e))),"_"),n=this._getWriter();return r.encode(n,t),n.data}decode(e,t,r){return new I(e.map(e=>this._getCoder(B.from(e))),"_").decode(this._getReader((0,n.lE)(t),r))}}let ei=new en,es=new o.Yd(a);class eo extends s.dk{}class ea extends s.dk{}class el extends s.dk{}class eu extends s.dk{static isIndexed(e){return!!(e&&e._isIndexed)}}let ec={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function ed(e,t){let r=Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class eh{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,(0,s.zG)(this,"fragments",t.map(e=>U.from(e)).filter(e=>null!=e)),(0,s.zG)(this,"_abiCoder",(0,s.tu)(new.target,"getAbiCoder")()),(0,s.zG)(this,"functions",{}),(0,s.zG)(this,"errors",{}),(0,s.zG)(this,"events",{}),(0,s.zG)(this,"structs",{}),this.fragments.forEach(e=>{let t=null;switch(e.type){case"constructor":if(this.deploy){es.warn("duplicate definition - constructor");return}(0,s.zG)(this,"deploy",e);return;case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();if(t[r]){es.warn("duplicate definition - "+r);return}t[r]=e}),this.deploy||(0,s.zG)(this,"deploy",V.from({payable:!1,type:"constructor"})),(0,s.zG)(this,"_isInterface",!0)}format(e){e||(e=L.full),e===L.sighash&&es.throwArgumentError("interface does not support formatting sighash","format",e);let t=this.fragments.map(t=>t.format(e));return e===L.json?JSON.stringify(t.map(e=>JSON.parse(e))):t}static getAbiCoder(){return ei}static getAddress(e){return(0,h.Kn)(e)}static getSighash(e){return(0,n.p3)((0,f.id)(e.format()),0,4)}static getEventTopic(e){return(0,f.id)(e.format())}getFunction(e){if((0,n.A7)(e)){for(let t in this.functions)if(e===this.getSighash(t))return this.functions[t];es.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){let t=e.trim(),r=Object.keys(this.functions).filter(e=>e.split("(")[0]===t);return 0===r.length?es.throwArgumentError("no matching function","name",t):r.length>1&&es.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}let t=this.functions[W.fromString(e).format()];return t||es.throwArgumentError("no matching function","signature",e),t}getEvent(e){if((0,n.A7)(e)){let t=e.toLowerCase();for(let e in this.events)if(t===this.getEventTopic(e))return this.events[e];es.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){let t=e.trim(),r=Object.keys(this.events).filter(e=>e.split("(")[0]===t);return 0===r.length?es.throwArgumentError("no matching event","name",t):r.length>1&&es.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}let t=this.events[z.fromString(e).format()];return t||es.throwArgumentError("no matching event","signature",e),t}getError(e){if((0,n.A7)(e)){let t=(0,s.tu)(this.constructor,"getSighash");for(let r in this.errors)if(e===t(this.errors[r]))return this.errors[r];es.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){let t=e.trim(),r=Object.keys(this.errors).filter(e=>e.split("(")[0]===t);return 0===r.length?es.throwArgumentError("no matching error","name",t):r.length>1&&es.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}let t=this.errors[W.fromString(e).format()];return t||es.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return(0,s.tu)(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),(0,s.tu)(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));let r=(0,n.lE)(t);return(0,n.Dv)(r.slice(0,4))!==this.getSighash(e)&&es.throwArgumentError(`data signature does not match error ${e.name}.`,"data",(0,n.Dv)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),(0,n.Dv)((0,n.zo)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,n.lE)(t);return(0,n.Dv)(r.slice(0,4))!==this.getSighash(e)&&es.throwArgumentError(`data signature does not match function ${e.name}.`,"data",(0,n.Dv)(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,n.Dv)((0,n.zo)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=(0,n.lE)(t),i=null,s="",a=null,l=null,u=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(e){}break;case 4:{let e=(0,n.Dv)(r.slice(0,4)),t=ec[e];if(t)a=this._abiCoder.decode(t.inputs,r.slice(4)),l=t.name,u=t.signature,t.reason&&(i=a[0]),"Error"===l?s=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(a[0])}`:"Panic"===l&&(s=`; VM Exception while processing transaction: reverted with panic code ${a[0]}`);else try{let t=this.getError(e);a=this._abiCoder.decode(t.inputs,r.slice(4)),l=t.name,u=t.format()}catch(e){}}}return es.throwError("call revert exception"+s,o.Yd.errors.CALL_EXCEPTION,{method:e.format(),data:(0,n.Dv)(t),errorArgs:a,errorName:l,errorSignature:u,reason:i})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),(0,n.Dv)(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&es.throwError("too many arguments for "+e.format(),o.Yd.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));let s=(e,t)=>"string"===e.type?(0,f.id)(t):"bytes"===e.type?(0,p.w)((0,n.Dv)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=i.O$.from(t).toHexString()),"address"===e.type&&this._abiCoder.encode(["address"],[t]),(0,n.$m)((0,n.Dv)(t),32));for(t.forEach((t,n)=>{let i=e.inputs[n];if(!i.indexed){null!=t&&es.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+i.name,t);return}null==t?r.push(null):"array"===i.baseType||"tuple"===i.baseType?es.throwArgumentError("filtering with tuples or arrays not supported","contract."+i.name,t):Array.isArray(t)?r.push(t.map(e=>s(i,e))):r.push(s(i,t))});r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));let r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&es.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((e,s)=>{let o=t[s];if(e.indexed){if("string"===e.type)r.push((0,f.id)(o));else if("bytes"===e.type)r.push((0,p.w)(o));else if("tuple"===e.baseType||"array"===e.baseType)throw Error("not implemented");else r.push(this._abiCoder.encode([e.type],[o]))}else n.push(e),i.push(o)}),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);(0,n.A7)(r[0],32)&&r[0].toLowerCase()===t||es.throwError("fragment/topic mismatch",o.Yd.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let i=[],s=[],a=[];e.inputs.forEach((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(B.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(s.push(e),a.push(!1))});let l=null!=r?this._abiCoder.decode(i,(0,n.zo)(r)):null,u=this._abiCoder.decode(s,t,!0),c=[],d=0,h=0;e.inputs.forEach((e,t)=>{if(e.indexed){if(null==l)c[t]=new eu({_isIndexed:!0,hash:null});else if(a[t])c[t]=new eu({_isIndexed:!0,hash:l[h++]});else try{c[t]=l[h++]}catch(e){c[t]=e}}else try{c[t]=u[d++]}catch(e){c[t]=e}if(e.name&&null==c[e.name]){let r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw ed(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}});for(let e=0;e{throw ed(`index ${e}`,t)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new ea({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:i.O$.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new eo({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){let t=(0,n.Dv)(e),r=this.getError(t.substring(0,10).toLowerCase());return r?new el({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!!(e&&e._isInterface)}}var ef=r(59035),ep=r(37637),eg=r(2149),em=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let ey=new o.Yd("contracts/5.7.0");function eb(e,t){return em(this,void 0,void 0,function*(){let r=yield t;"string"!=typeof r&&ey.throwArgumentError("invalid address or ENS name","name",r);try{return(0,h.Kn)(r)}catch(e){}e||ey.throwError("a provider or signer is needed to resolve ENS names",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});let n=yield e.resolveName(r);return null==n&&ey.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n})}function ev(e,t,r){return em(this,void 0,void 0,function*(){let a={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(a=(0,s.DC)(r.pop())),ey.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?a.from?a.from=(0,s.mE)({override:eb(e.signer,a.from),signer:e.signer.getAddress()}).then(e=>em(this,void 0,void 0,function*(){return(0,h.Kn)(e.signer)!==e.override&&ey.throwError("Contract with a Signer cannot override from",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})):a.from=e.signer.getAddress():a.from&&(a.from=eb(e.provider,a.from));let l=yield(0,s.mE)({args:function e(t,r,n){return em(this,void 0,void 0,function*(){return Array.isArray(n)?yield Promise.all(n.map((n,i)=>e(t,Array.isArray(r)?r[i]:r[n.name],n))):"address"===n.type?yield eb(t,r):"tuple"===n.type?yield e(t,r,n.components):"array"===n.baseType?Array.isArray(r)?yield Promise.all(r.map(r=>e(t,r,n.arrayChildren))):Promise.reject(ey.makeError("invalid value for array",o.Yd.errors.INVALID_ARGUMENT,{argument:"value",value:r})):r})}(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:(0,s.mE)(a)||{}}),u=e.interface.encodeFunctionData(t,l.args),c={data:u,to:l.address},d=l.overrides;if(null!=d.nonce&&(c.nonce=i.O$.from(d.nonce).toNumber()),null!=d.gasLimit&&(c.gasLimit=i.O$.from(d.gasLimit)),null!=d.gasPrice&&(c.gasPrice=i.O$.from(d.gasPrice)),null!=d.maxFeePerGas&&(c.maxFeePerGas=i.O$.from(d.maxFeePerGas)),null!=d.maxPriorityFeePerGas&&(c.maxPriorityFeePerGas=i.O$.from(d.maxPriorityFeePerGas)),null!=d.from&&(c.from=d.from),null!=d.type&&(c.type=d.type),null!=d.accessList&&(c.accessList=(0,eg.z7)(d.accessList)),null==c.gasLimit&&null!=t.gas){let e=21e3,r=(0,n.lE)(u);for(let t=0;tnull!=a[e]);return f.length&&ey.throwError(`cannot override ${f.map(e=>JSON.stringify(e)).join(",")}`,o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:f}),c})}function ew(e,t,r){let n=e.signer||e.provider;return function(...i){return em(this,void 0,void 0,function*(){let a;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){let e=(0,s.DC)(i.pop());null!=e.blockTag&&(a=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(a));let l=yield ev(e,t,i),u=yield n.call(l,a);try{let n=e.interface.decodeFunctionResult(t,u);return r&&1===t.outputs.length&&(n=n[0]),n}catch(t){throw t.code===o.Yd.errors.CALL_EXCEPTION&&(t.address=e.address,t.args=i,t.transaction=l),t}})}}function e_(e,t,r){return t.constant?ew(e,t,r):function(...r){return em(this,void 0,void 0,function*(){e.signer||ey.throwError("sending a transaction requires a signer",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());let n=yield ev(e,t,r),i=yield e.signer.sendTransaction(n);return function(e,t){let r=t.wait.bind(t);t.wait=t=>r(t).then(t=>(t.events=t.logs.map(r=>{let n=(0,s.p$)(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n}),t))}(e,i),i})}}function eE(e){return e.address&&(null==e.topics||0===e.topics.length)?"*":(e.address||"*")+"@"+(e.topics?e.topics.map(e=>Array.isArray(e)?e.join("|"):e).join(":"):"")}class eA{constructor(e,t){(0,s.zG)(this,"tag",e),(0,s.zG)(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter(r=>!!t||r.listener!==e||(t=!0,!1))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map(e=>e.listener)}listenerCount(){return this._listeners.length}run(e){let t=this.listenerCount();return this._listeners=this._listeners.filter(t=>{let r=e.slice();return setTimeout(()=>{t.listener.apply(this,r)},0),!t.once}),t}prepareEvent(e){}getEmit(e){return[e]}}class ex extends eA{constructor(){super("error",null)}}class ek extends eA{constructor(e,t,r,n){let i={address:e},o=t.getEventTopic(r);n?(o!==n[0]&&ey.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(eE(i),i),(0,s.zG)(this,"address",e),(0,s.zG)(this,"interface",t),(0,s.zG)(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){let t=function(e){let t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){let s=e.slice();s.push(i);try{r(s,n[i])}catch(e){t.push({path:s,error:e})}}};return r([],e),t}(e.args);if(t.length)throw t[0].error;let r=(e.args||[]).slice();return r.push(e),r}}class eS extends eA{constructor(e,t){super("*",{address:e}),(0,s.zG)(this,"address",e),(0,s.zG)(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{let t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(e){}}}class e${constructor(e,t,r){(0,s.zG)(this,"interface",(0,s.tu)(new.target,"getInterface")(t)),null==r?((0,s.zG)(this,"provider",null),(0,s.zG)(this,"signer",null)):ep.E.isSigner(r)?((0,s.zG)(this,"provider",r.provider||null),(0,s.zG)(this,"signer",r)):ef.zt.isProvider(r)?((0,s.zG)(this,"provider",r),(0,s.zG)(this,"signer",null)):ey.throwArgumentError("invalid signer or provider","signerOrProvider",r),(0,s.zG)(this,"callStatic",{}),(0,s.zG)(this,"estimateGas",{}),(0,s.zG)(this,"functions",{}),(0,s.zG)(this,"populateTransaction",{}),(0,s.zG)(this,"filters",{});{let e={};Object.keys(this.interface.events).forEach(t=>{let r=this.interface.events[t];(0,s.zG)(this.filters,t,(...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)})),e[r.name]||(e[r.name]=[]),e[r.name].push(t)}),Object.keys(e).forEach(t=>{let r=e[t];1===r.length?(0,s.zG)(this.filters,t,this.filters[r[0]]):ey.warn(`Duplicate definition of ${t} (${r.join(", ")})`)})}if((0,s.zG)(this,"_runningEvents",{}),(0,s.zG)(this,"_wrappedEmits",{}),null==e&&ey.throwArgumentError("invalid contract address or ENS name","addressOrName",e),(0,s.zG)(this,"address",e),this.provider)(0,s.zG)(this,"resolvedAddress",eb(this.provider,e));else try{(0,s.zG)(this,"resolvedAddress",Promise.resolve((0,h.Kn)(e)))}catch(e){ey.throwError("provider is required to use ENS name as contract address",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch(e=>{});let n={},i={};Object.keys(this.interface.functions).forEach(e=>{let t=this.interface.functions[e];if(i[e]){ey.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);return}i[e]=!0;{let r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}if(null==this[e]&&(0,s.zG)(this,e,e_(this,t,!0)),null==this.functions[e]&&(0,s.zG)(this.functions,e,e_(this,t,!1)),null==this.callStatic[e]&&(0,s.zG)(this.callStatic,e,ew(this,t,!0)),null==this.populateTransaction[e]){var r;(0,s.zG)(this.populateTransaction,e,(r=this,function(...e){return ev(r,t,e)}))}null==this.estimateGas[e]&&(0,s.zG)(this.estimateGas,e,function(e,t){let r=e.signer||e.provider;return function(...n){return em(this,void 0,void 0,function*(){r||ey.throwError("estimate require a provider or signer",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});let i=yield ev(e,t,n);return yield r.estimateGas(i)})}}(this,t))}),Object.keys(n).forEach(e=>{let t=n[e];if(t.length>1)return;e=e.substring(1);let r=t[0];try{null==this[e]&&(0,s.zG)(this,e,this[r])}catch(e){}null==this.functions[e]&&(0,s.zG)(this.functions,e,this.functions[r]),null==this.callStatic[e]&&(0,s.zG)(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&(0,s.zG)(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&(0,s.zG)(this.estimateGas,e,this.estimateGas[r])})}static getContractAddress(e){return(0,h.CR)(e)}static getInterface(e){return eh.isInterface(e)?e:new eh(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then(()=>this):this._deployedPromise=this.provider.getCode(this.address,e).then(e=>("0x"===e&&ey.throwError("contract not deployed",o.Yd.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this))),this._deployedPromise}fallback(e){this.signer||ey.throwError("sending a transactions require a signer",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});let t=(0,s.DC)(e||{});return["from","to"].forEach(function(e){null!=t[e]&&ey.throwError("cannot override "+e,o.Yd.errors.UNSUPPORTED_OPERATION,{operation:e})}),t.to=this.resolvedAddress,this.deployed().then(()=>this.signer.sendTransaction(t))}connect(e){"string"==typeof e&&(e=new ep.b(e,this.provider));let t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&(0,s.zG)(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return eu.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new ex);if("event"===e)return this._normalizeRunningEvent(new eA("event",null));if("*"===e)return this._normalizeRunningEvent(new eS(this.address,this.interface));let t=this.interface.getEvent(e);return this._normalizeRunningEvent(new ek(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{let t=e.topics[0];if("string"!=typeof t)throw Error("invalid topic");let r=this.interface.getEvent(t);return this._normalizeRunningEvent(new ek(this.address,this.interface,r,e.topics))}catch(e){}let t={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new eA(eE(t),t))}return this._normalizeRunningEvent(new eS(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];let t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){let n=(0,s.p$)(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||ey.throwError("events require a provider or a signer with a provider",o.Yd.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){let r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{let t=e.getEmit(n);this.emit(e.filter,...t)}catch(e){n.decodeError=e.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){let i=this._getRunningEvent(e),o=(0,s.DC)(i.filter);return"string"==typeof t&&(0,n.A7)(t,32)?(null!=r&&ey.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then(e=>e.map(e=>this._wrapEvent(i,e,null)))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;let r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce((e,t)=>e+this._runningEvents[t].listenerCount(),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){let e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach(t=>{e.push(t)});return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(let e in this._runningEvents){let t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}let t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;let r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class eC extends e${}},99554:function(e,t,r){"use strict";r.d(t,{id:function(){return s}});var n=r(43481),i=r(28257);function s(e){return(0,n.w)((0,i.Y0)(e))}},43481:function(e,t,r){"use strict";r.d(t,{w:function(){return o}});var n=r(83524),i=r.n(n),s=r(9784);function o(e){return"0x"+i().keccak_256((0,s.lE)(e))}},13421:function(e,t,r){"use strict";var n,i,s,o;r.d(t,{jK:function(){return i},Yd:function(){return p}});let a=!1,l=!1,u={debug:1,default:2,info:2,warning:3,error:4,off:5},c=u.default,d=null,h=function(){try{let e=[];if(["NFD","NFC","NFKD","NFKC"].forEach(t=>{try{if("test"!=="test".normalize(t))throw Error("bad normalize")}catch(r){e.push(t)}}),e.length)throw Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(e){return e.message}return null}();(s=n||(n={})).DEBUG="DEBUG",s.INFO="INFO",s.WARNING="WARNING",s.ERROR="ERROR",s.OFF="OFF",(o=i||(i={})).UNKNOWN_ERROR="UNKNOWN_ERROR",o.NOT_IMPLEMENTED="NOT_IMPLEMENTED",o.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",o.NETWORK_ERROR="NETWORK_ERROR",o.SERVER_ERROR="SERVER_ERROR",o.TIMEOUT="TIMEOUT",o.BUFFER_OVERRUN="BUFFER_OVERRUN",o.NUMERIC_FAULT="NUMERIC_FAULT",o.MISSING_NEW="MISSING_NEW",o.INVALID_ARGUMENT="INVALID_ARGUMENT",o.MISSING_ARGUMENT="MISSING_ARGUMENT",o.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",o.CALL_EXCEPTION="CALL_EXCEPTION",o.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",o.NONCE_EXPIRED="NONCE_EXPIRED",o.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",o.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",o.TRANSACTION_REPLACED="TRANSACTION_REPLACED",o.ACTION_REJECTED="ACTION_REJECTED";let f="0123456789abcdef";class p{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){let r=e.toLowerCase();null==u[r]&&this.throwArgumentError("invalid log level name","logLevel",e),c>u[r]||console.log.apply(console,t)}debug(...e){this._log(p.levels.DEBUG,e)}info(...e){this._log(p.levels.INFO,e)}warn(...e){this._log(p.levels.WARNING,e)}makeError(e,t,r){if(l)return this.makeError("censored error",t,{});t||(t=p.errors.UNKNOWN_ERROR),r||(r={});let n=[];Object.keys(r).forEach(e=>{let t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e>4]+f[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(t){n.push(e+"="+JSON.stringify(r[e].toString()))}}),n.push(`code=${t}`),n.push(`version=${this.version}`);let s=e,o="";switch(t){case i.NUMERIC_FAULT:{o="NUMERIC_FAULT";let t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case i.CALL_EXCEPTION:case i.INSUFFICIENT_FUNDS:case i.MISSING_NEW:case i.NONCE_EXPIRED:case i.REPLACEMENT_UNDERPRICED:case i.TRANSACTION_REPLACED:case i.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");let a=Error(e);return a.reason=s,a.code=t,Object.keys(r).forEach(function(e){a[e]=r[e]}),a}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,p.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),h&&this.throwError("platform missing String.prototype.normalize",p.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:h})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,p.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",et&&this.throwError("too many arguments"+r,p.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){(e===Object||null==e)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",p.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||null==e)&&this.throwError("missing new",p.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return d||(d=new p("logger/5.7.0")),d}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),a){if(!e)return;this.globalLogger().throwError("error censorship permanent",p.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}l=!!e,a=!!t}static setLogLevel(e){let t=u[e.toLowerCase()];if(null==t){p.globalLogger().warn("invalid log level - "+e);return}c=t}static from(e){return new p(e)}}p.errors=i,p.levels=n},36173:function(e,t,r){"use strict";r.d(t,{dk:function(){return d},uj:function(){return a},p$:function(){return c},zG:function(){return i},tu:function(){return s},mE:function(){return o},DC:function(){return l}});let n=new(r(13421)).Yd("properties/5.7.0");function i(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function s(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function o(e){var t,r,n,i;return t=this,r=void 0,n=void 0,i=function*(){let t=Object.keys(e).map(t=>Promise.resolve(e[t]).then(e=>({key:t,value:e})));return(yield Promise.all(t)).reduce((e,t)=>(e[t.key]=t.value,e),{})},new(n||(n=Promise))(function(e,s){function o(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof n?r:new n(function(e){e(r)})).then(o,a)}l((i=i.apply(t,r||[])).next())})}function a(e,t){e&&"object"==typeof e||n.throwArgumentError("invalid object","object",e),Object.keys(e).forEach(r=>{t[r]||n.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)})}function l(e){let t={};for(let r in e)t[r]=e[r];return t}let u={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function c(e){return function(e){if(function e(t){if(null==t||u[typeof t])return!0;if(Array.isArray(t)||"object"==typeof t){if(!Object.isFrozen(t))return!1;let r=Object.keys(t);for(let n=0;nc(e)));if("object"==typeof e){let t={};for(let r in e){let n=e[r];void 0!==n&&i(t,r,c(n))}return t}return n.throwArgumentError(`Cannot deepCopy ${typeof e}`,"object",e)}(e)}class d{constructor(e){for(let t in e)this[t]=c(e[t])}}},86365:function(e,t,r){"use strict";r.d(t,{i:function(){return n}});let n="providers/5.7.2"},27972:function(e,t,r){"use strict";let n,i;r.d(t,{r:function(){return e0}});var s,o=r(37637),a=r(22594),l=r(9784),u=r(89005),c=r(43481),d=r(36173),h=r(13421);let f="hash/5.7.0";var p=r(99554);let g=new h.Yd(f),m=new Uint8Array(32);m.fill(0);let y=a.O$.from(-1),b=a.O$.from(0),v=a.O$.from(1),w=a.O$.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),_=(0,l.$m)(v.toHexString(),32),E=(0,l.$m)(b.toHexString(),32),A={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},x=["name","version","chainId","verifyingContract","salt"];function k(e){return function(t){return"string"!=typeof t&&g.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}let S={name:k("name"),version:k("version"),chainId:function(e){try{return a.O$.from(e).toString()}catch(e){}return g.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return(0,u.Kn)(e).toLowerCase()}catch(e){}return g.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{let t=(0,l.lE)(e);if(32!==t.length)throw Error("bad length");return(0,l.Dv)(t)}catch(e){}return g.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function $(e){{let t=e.match(/^(u?)int(\d*)$/);if(t){let r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&g.throwArgumentError("invalid numeric width","type",e);let i=w.mask(r?n-1:n),s=r?i.add(v).mul(y):b;return function(t){let r=a.O$.from(t);return(r.lt(s)||r.gt(i))&&g.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),(0,l.$m)(r.toTwos(256).toHexString(),32)}}}{let t=e.match(/^bytes(\d+)$/);if(t){let r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&g.throwArgumentError("invalid bytes width","type",e),function(t){return(0,l.lE)(t).length!==r&&g.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){let t=(0,l.lE)(e),r=t.length%32;return r?(0,l.xs)([t,m.slice(r)]):(0,l.Dv)(t)}(t)}}}switch(e){case"address":return function(e){return(0,l.$m)((0,u.Kn)(e),32)};case"bool":return function(e){return e?_:E};case"bytes":return function(e){return(0,c.w)(e)};case"string":return function(e){return(0,p.id)(e)}}return null}function C(e,t){return`${e}(${t.map(({name:e,type:t})=>t+" "+e).join(",")})`}class P{constructor(e){(0,d.zG)(this,"types",Object.freeze((0,d.p$)(e))),(0,d.zG)(this,"_encoderCache",{}),(0,d.zG)(this,"_types",{});let t={},r={},n={};for(let i in Object.keys(e).forEach(e=>{t[e]={},r[e]=[],n[e]={}}),e){let n={};e[i].forEach(s=>{n[s.name]&&g.throwArgumentError(`duplicate variable name ${JSON.stringify(s.name)} in ${JSON.stringify(i)}`,"types",e),n[s.name]=!0;let o=s.type.match(/^([^\x5b]*)(\x5b|$)/)[1];o===i&&g.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),$(o)||(r[o]||g.throwArgumentError(`unknown type ${JSON.stringify(o)}`,"types",e),r[o].push(i),t[i][o]=!0)})}let i=Object.keys(r).filter(e=>0===r[e].length);for(let s in 0===i.length?g.throwArgumentError("missing primary type","types",e):i.length>1&&g.throwArgumentError(`ambiguous primary types or unused types: ${i.map(e=>JSON.stringify(e)).join(", ")}`,"types",e),(0,d.zG)(this,"primaryType",i[0]),!function i(s,o){o[s]&&g.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e),o[s]=!0,Object.keys(t[s]).forEach(e=>{r[e]&&(i(e,o),Object.keys(o).forEach(t=>{n[t][e]=!0}))}),delete o[s]}(this.primaryType,{}),n){let t=Object.keys(n[s]);t.sort(),this._types[s]=C(s,e[s])+t.map(t=>C(t,e[t])).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{let t=$(e);if(t)return t}let t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){let e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&g.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(c.w)),(0,c.w)((0,l.xs)(i))}}let r=this.types[e];if(r){let t=(0,p.id)(this._types[e]);return e=>{let n=r.map(({name:t,type:r})=>{let n=this.getEncoder(r)(e[t]);return this._types[r]?(0,c.w)(n):n});return n.unshift(t),(0,l.xs)(n)}}return g.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let t=this._types[e];return t||g.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return(0,c.w)(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if($(e))return r(e,t);let n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){let e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&g.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map(t=>this._visit(e,t,r))}let i=this.types[e];return i?i.reduce((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e),{}):g.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new P(e)}static getPrimaryType(e){return P.from(e).primaryType}static hashStruct(e,t,r){return P.from(t).hashStruct(e,r)}static hashDomain(e){let t=[];for(let r in e){let n=A[r];n||g.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort((e,t)=>x.indexOf(e.name)-x.indexOf(t.name)),P.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return(0,l.xs)(["0x1901",P.hashDomain(e),P.from(t).hash(r)])}static hash(e,t,r){return(0,c.w)(P.encode(e,t,r))}static resolveNames(e,t,r,n){var i,s,o,a;return i=this,s=void 0,o=void 0,a=function*(){e=(0,d.DC)(e);let i={};e.verifyingContract&&!(0,l.A7)(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");let s=P.from(t);for(let e in s.visit(r,(e,t)=>("address"!==e||(0,l.A7)(t,20)||(i[t]="0x"),t)),i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=s.visit(r,(e,t)=>"address"===e&&i[t]?i[t]:t),{domain:e,value:r}},new(o||(o=Promise))(function(e,t){function r(e){try{l(a.next(e))}catch(e){t(e)}}function n(e){try{l(a.throw(e))}catch(e){t(e)}}function l(t){var i;t.done?e(t.value):((i=t.value)instanceof o?i:new o(function(e){e(i)})).then(r,n)}l((a=a.apply(i,s||[])).next())})}static getPayload(e,t,r){P.hashDomain(e);let n={},i=[];x.forEach(t=>{let r=e[t];null!=r&&(n[t]=S[t](r),i.push({name:t,type:A[t]}))});let s=P.from(t),o=(0,d.DC)(t);return o.EIP712Domain?g.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):o.EIP712Domain=i,s.encode(r),{types:o,domain:n,primaryType:s.primaryType,message:s.visit(r,(e,t)=>{if(e.match(/^bytes(\d*)/))return(0,l.Dv)((0,l.lE)(t));if(e.match(/^u?int/))return a.O$.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&g.throwArgumentError("invalid string","value",t),t}return g.throwArgumentError("unsupported type","type",e)})}}}var I=r(28257),O=r(2149);function N(e){e=atob(e);let t=[];for(let r=0;r{setTimeout(t,e)})}function D(e,t){if(null==e)return null;if("string"==typeof e)return e;if((0,l.Zq)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return(0,I.ZN)(e)}catch(e){}return(0,l.Dv)(e)}return e}function L(e,t,r){let n=null;if(null!=t){n=(0,I.Y0)(t);let r="string"==typeof e?{url:e}:(0,d.DC)(e);r.headers?0!==Object.keys(r.headers).filter(e=>"content-type"===e.toLowerCase()).length||(r.headers=(0,d.DC)(r.headers),r.headers["content-type"]="application/json"):r.headers={"content-type":"application/json"},e=r}return function(e,t,r){let n;let i="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;R.assertArgument(i>0&&i%1==0,"invalid connection throttle limit","connection.throttleLimit",i);let s="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;R.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);let a="object"==typeof e&&!!e.errorPassThrough,u={},c=null,f={method:"GET"},p=!1,g=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if((null==e||null==e.url)&&R.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(g=e.timeout),e.headers)for(let t in e.headers)u[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(p=!0);if(f.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&R.throwError("basic authentication requires a secure https url",h.Yd.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});let t=e.user+":"+e.password;u.authorization={key:"Authorization",value:"Basic "+M((0,I.Y0)(t))}}null!=e.skipFetchSetup&&(f.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(f.fetchOptions=(0,d.DC)(e.fetchOptions))}let m=RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),y=c?c.match(m):null;if(y)try{var b;let e={statusCode:200,statusMessage:"OK",headers:{"content-type":y[1]||"text/plain"},body:y[2]?N(y[3]):(b=y[3],(0,I.Y0)(b.replace(/%([0-9a-f][0-9a-f])/gi,(e,t)=>String.fromCharCode(parseInt(t,16)))))},t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(e){R.throwError("processing response error",h.Yd.errors.SERVER_ERROR,{body:D(y[1],y[2]),error:e,requestBody:null,requestMethod:"GET",url:c})}t&&(f.method="POST",f.body=t,null==u["content-type"]&&(u["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==u["content-length"]&&(u["content-length"]={key:"Content-Length",value:String(t.length)}));let v={};Object.keys(u).forEach(e=>{let t=u[e];v[t.key]=t.value}),f.headers=v;let w=(n=null,{promise:new Promise(function(e,t){g&&(n=setTimeout(()=>{null!=n&&(n=null,t(R.makeError("timeout",h.Yd.errors.TIMEOUT,{requestBody:D(f.body,v["content-type"]),requestMethod:f.method,timeout:g,url:c})))},g))}),cancel:function(){null!=n&&(clearTimeout(n),n=null)}}),_=function(){var e,t,n,u;return e=this,t=void 0,n=void 0,u=function*(){for(let e=0;e{s[t.toLowerCase()]=e}):n.headers.keys().forEach(e=>{s[e.toLowerCase()]=n.headers.get(e)}),{headers:s,statusCode:n.status,statusMessage:n.statusText,body:(0,l.lE)(new Uint8Array(i))}},new(i||(i=Promise))(function(e,t){function o(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(o,a)}l((s=s.apply(r,n||[])).next())})}(c,f),e=300)&&(w.cancel(),R.throwError("bad response",h.Yd.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:D(n,t.headers?t.headers["content-type"]:null),requestBody:D(f.body,v["content-type"]),requestMethod:f.method,url:c})),r)try{let e=yield r(n,t);return w.cancel(),e}catch(r){if(r.throttleRetry&&e{let n=null;if(null!=e)try{n=JSON.parse((0,I.ZN)(e))}catch(t){R.throwError("invalid JSON",h.Yd.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n})}function j(e,t){return t||(t={}),null==(t=(0,d.DC)(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise(function(r,n){let i=null,s=!1,o=()=>!s&&(s=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout(()=>{o()&&n(Error("timeout"))},t.timeout));let a=t.retryLimit,l=0;!function i(){return e().then(function(e){if(void 0!==e)o()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!s){if(++l>a){o()&&n(Error("retry limit reached"));return}let e=t.interval*parseInt(String(Math.random()*Math.pow(2,l)));et.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null},function(e){o()&&n(e)})}()})}var B=r(86365),F=r(59035);class U{constructor(e){(0,d.zG)(this,"alphabet",e),(0,d.zG)(this,"base",e.length),(0,d.zG)(this,"_alphabetMap",{}),(0,d.zG)(this,"_leader",e.charAt(0));for(let t=0;t0;)r.push(n%this.base),n=n/this.base|0}let n="";for(let e=0;0===t[e]&&e=0;--e)n+=this.alphabet[r[e]];return n}decode(e){if("string"!=typeof e)throw TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r0&&Array.isArray(e)?i(e,t-1):r.push(e)})};return i(e,t),r}function H(e,t){let r=Array(e);for(let n=0,i=-1;nt[e]):r}function V(e,t,r){let n=Array(e).fill(void 0).map(()=>[]);for(let i=0;i>1:n>>1}return r})(e,r).forEach((e,t)=>n[t].push(e));return n}let W=(s=function(e){let t=0;function r(){return e[t++]<<8|e[t++]}let n=r(),i=1,s=[0,1];for(let e=1;e>--l&1}let d=0;for(let e=0;e<31;e++)d=d<<1|c();let h=[],f=0,p=2147483648;for(;;){let e=Math.floor(((d-f+1)*i-1)/p),t=0,r=n;for(;r-t>1;){let n=t+r>>>1;e{switch(t-g){case 3:return g+65792+(e[a++]<<16|e[a++]<<8|e[a++]);case 2:return g+256+(e[a++]<<8|e[a++]);case 1:return g+e[a++];default:return t-1}})}(N("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),i=0,()=>s[i++]),K=new Set(G(W)),Y=new Set(G(W)),Z=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(function(e,t){let r=1+t(),n=t(),i=function(e){let t=[];for(;;){let r=e();if(0==r)break;t.push(r)}return t}(t);return q(V(i.length,1+e,t).map((e,t)=>{let s=e[0],o=e.slice(1);return Array(i[t]).fill(void 0).map((e,t)=>{let i=t*n;return[s+t*r,o.map(e=>e+i)]})}))}(r,e))}for(;;){let r=e()-1;if(r<0)break;t.push(V(1+e(),1+r,e).map(e=>[e[0],e.slice(1)]))}return function(e){let t={};for(let r=0;re-t),function e(){let t=[];for(;;){let r=G(W,n);if(0==r.length)break;t.push({set:new Set(r),node:e()})}t.sort((e,t)=>t.set.size-e.set.size);let r=W();return{branches:t,valid:r%3,fe0f:!!(1&(r=r/3|0)),save:1==(r>>=1),check:2==r}}());function Q(e){return e.filter(e=>65039!=e)}function X(e){for(let t of e.split(".")){let e=(0,I.XL)(t);try{for(let t=e.lastIndexOf(95)-1;t>=0;t--)if(95!==e[t])throw Error("underscore only allowed at start");if(e.length>=4&&e.every(e=>e<128)&&45===e[2]&&45===e[3])throw Error("invalid label extension")}catch(e){throw Error(`Invalid label "${t}": ${e.message}`)}}return e}let ee=new h.Yd(f),et=new Uint8Array(32);function er(e){if(0===e.length)throw Error("invalid ENS name; empty component");return e}function en(e){let t=(0,I.Y0)(X(function(e,t){let r=(0,I.XL)(e).reverse(),n=[];for(;r.length;){let e=function(e,t){var r;let n,i;let s=J,o=[],a=e.length;for(;a;){let t=e[--a];if(!(s=null===(r=s.branches.find(e=>e.set.has(t)))||void 0===r?void 0:r.node))break;if(s.save)i=t;else if(s.check&&t===i)break;o.push(t),s.fe0f&&(o.push(65039),a>0&&65039==e[a-1]&&a--),s.valid&&(n=o.slice(),2==s.valid&&n.splice(1,1),e.length=a)}return n}(r);if(e){n.push(...t(e));continue}let i=r.pop();if(K.has(i)){n.push(i);continue}if(Y.has(i))continue;let s=Z[i];if(s){n.push(...s);continue}throw Error(`Disallowed codepoint: 0x${i.toString(16).toUpperCase()}`)}return X(String.fromCodePoint(...n).normalize("NFC"))}(e,Q))),r=[];if(0===e.length)return r;let n=0;for(let e=0;e=t.length)throw Error("invalid ENS name; empty component");return r.push(er(t.slice(n))),r}function ei(e){"string"!=typeof e&&ee.throwArgumentError("invalid ENS name; not a string","name",e);let t=et,r=en(e);for(;r.length;)t=(0,c.w)((0,l.zo)([t,(0,c.w)(r.pop())]));return(0,l.Dv)(t)}et.fill(0);let es=new h.Yd("networks/5.7.1");function eo(e){let t=function(t,r){null==r&&(r={});let n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket)try{let i=new t.PocketProvider(e,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(e){}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{let i=new t.AnkrProvider(e,r.ankr);i.network&&-1===["ropsten"].indexOf(i.network.name)&&n.push(i)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return eo(e)},t}function ea(e,t){let r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return ea(e,t)},r}let el={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:eo("homestead")},eu={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:eo("ropsten")},ec={chainId:63,name:"classicMordor",_defaultProvider:ea("https://www.ethercluster.com/mordor","classicMordor")},ed={unspecified:{chainId:0,name:"unspecified"},homestead:el,mainnet:el,morden:{chainId:2,name:"morden"},ropsten:eu,testnet:eu,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:eo("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:eo("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:eo("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:eo("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:ea("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:ec,classicTestnet:ec,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:ea("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:eo("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:eo("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};var eh=r(83699),ef=r.n(eh);function ep(e){return"0x"+ef().sha256().update((0,l.lE)(e)).digest("hex")}new h.Yd("sha2/5.7.0");var eg=r(1192),em=r.n(eg);let ey=new h.Yd(B.i);class eb{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){let e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),s=this.hash.bind(this),o=this.hex.bind(this),a=this.number.bind(this),l=this.type.bind(this);return e.transaction={hash:s,type:l,accessList:eb.allowNull(this.accessList.bind(this),null),blockHash:eb.allowNull(s,null),blockNumber:eb.allowNull(a,null),transactionIndex:eb.allowNull(a,null),confirmations:eb.allowNull(a,null),from:t,gasPrice:eb.allowNull(r),maxPriorityFeePerGas:eb.allowNull(r),maxFeePerGas:eb.allowNull(r),gasLimit:r,to:eb.allowNull(t,null),value:r,nonce:a,data:i,r:eb.allowNull(this.uint256),s:eb.allowNull(this.uint256),v:eb.allowNull(a),creates:eb.allowNull(t,null),raw:eb.allowNull(i)},e.transactionRequest={from:eb.allowNull(t),nonce:eb.allowNull(a),gasLimit:eb.allowNull(r),gasPrice:eb.allowNull(r),maxPriorityFeePerGas:eb.allowNull(r),maxFeePerGas:eb.allowNull(r),to:eb.allowNull(t),value:eb.allowNull(r),data:eb.allowNull(e=>this.data(e,!0)),type:eb.allowNull(a),accessList:eb.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:s,address:t,topics:eb.arrayOf(s),data:i,logIndex:a,blockHash:s},e.receipt={to:eb.allowNull(this.address,null),from:eb.allowNull(this.address,null),contractAddress:eb.allowNull(t,null),transactionIndex:a,root:eb.allowNull(o),gasUsed:r,logsBloom:eb.allowNull(i),blockHash:s,transactionHash:s,logs:eb.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:eb.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:eb.allowNull(r),status:eb.allowNull(a),type:l},e.block={hash:eb.allowNull(s),parentHash:s,number:a,timestamp:a,nonce:eb.allowNull(o),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:eb.allowNull(t),extraData:i,transactions:eb.allowNull(eb.arrayOf(s)),baseFeePerGas:eb.allowNull(r)},e.blockWithTransactions=(0,d.DC)(e.block),e.blockWithTransactions.transactions=eb.allowNull(eb.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:eb.allowNull(n,void 0),toBlock:eb.allowNull(n,void 0),blockHash:eb.allowNull(s,void 0),address:eb.allowNull(t,void 0),topics:eb.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:eb.allowNull(a),blockHash:eb.allowNull(s),transactionIndex:a,removed:eb.allowNull(this.boolean.bind(this)),address:t,data:eb.allowFalsish(i,"0x"),topics:eb.arrayOf(s),transactionHash:s,logIndex:a},e}accessList(e){return(0,O.z7)(e||[])}number(e){return"0x"===e?0:a.O$.from(e).toNumber()}type(e){return"0x"===e||null==e?0:a.O$.from(e).toNumber()}bigNumber(e){return a.O$.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),(0,l.A7)(e))?e.toLowerCase():ey.throwArgumentError("invalid hash","value",e)}data(e,t){let r=this.hex(e,t);if(r.length%2!=0)throw Error("invalid data; odd-length - "+e);return r}address(e){return(0,u.Kn)(e)}callAddress(e){if(!(0,l.A7)(e,32))return null;let t=(0,u.Kn)((0,l.p3)(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}contractAddress(e){return(0,u.CR)(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||(0,l.A7)(e))return(0,l.$P)(e);throw Error("invalid blockTag")}hash(e,t){let r=this.hex(e,t);return 32!==(0,l.E1)(r)?ey.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;let t=a.O$.from(e);try{return t.toNumber()}catch(e){}return null}uint256(e){if(!(0,l.A7)(e))throw Error("invalid uint256");return(0,l.$m)(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);let r=null!=e._difficulty?e._difficulty:e.difficulty,n=eb.check(t,e);return n._difficulty=null==r?null:a.O$.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return eb.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&a.O$.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),(1===e.type||2===e.type)&&null==e.accessList&&(e.accessList=[]);let t=eb.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;(0,l.A7)(r)&&(r=a.O$.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),(0,l.A7)(r)&&(r=a.O$.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&((r=(t.v-35)/2)<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return(0,O.Qc)(e)}receiptLog(e){return eb.check(this.formats.receiptLog,e)}receipt(e){let t=eb.check(this.formats.receipt,e);if(null!=t.root){if(t.root.length<=4){let e=a.O$.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&ey.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):ey.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&ey.throwArgumentError("invalid root hash","value.root",t.root)}return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map(e=>this.topics(e)):null!=e?this.hash(e,!0):null}filter(e){return eb.check(this.formats.filter,e)}filterLog(e){return eb.check(this.formats.filterLog,e)}static check(e,t){let r={};for(let n in e)try{let i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw Error("not an array");let r=[];return t.forEach(function(t){r.push(e(t))}),r}}}var ev=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let ew=new h.Yd(B.i);function e_(e){return null==e?"null":(32!==(0,l.E1)(e)&&ew.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function eE(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map(e=>{if(!Array.isArray(e))return e_(e);{let t={};e.forEach(e=>{t[e_(e)]=!0});let r=Object.keys(t);return r.sort(),r.join("|")}}).join("&")}function eA(e){if("string"==typeof e){if(e=e.toLowerCase(),32===(0,l.E1)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else if(Array.isArray(e))return"filter:*:"+eE(e);else if(F.Sg.isForkEvent(e))throw ew.warn("not implemented"),Error("not implemented");else if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+eE(e.topics||[]);throw Error("invalid event - "+e)}function ex(){return new Date().getTime()}function ek(e){return new Promise(t=>{setTimeout(t,e)})}let eS=["block","network","pending","poll"];class e${constructor(e,t,r){(0,d.zG)(this,"tag",e),(0,d.zG)(this,"listener",t),(0,d.zG)(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){let e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){var e;let t=this.tag.split(":");if("filter"!==t[0])return null;let r=t[1],n=""===(e=t[2])?[]:e.split(/&/g).map(e=>{if(""===e)return[];let t=e.split("|").map(e=>"null"===e?null:e);return 1===t.length?t[0]:t}),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}pollable(){return this.tag.indexOf(":")>=0||eS.indexOf(this.tag)>=0}}let eC={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function eP(e){return(0,l.$m)(a.O$.from(e).toHexString(),32)}function eI(e){return z.encode((0,l.zo)([e,(0,l.p3)(ep(ep(e)),0,4)]))}let eO=RegExp("^(ipfs)://(.*)$","i"),eN=[RegExp("^(https)://(.*)$","i"),RegExp("^(data):(.*)$","i"),eO,RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function eM(e,t){try{return(0,I.ZN)(eR(e,t))}catch(e){}return null}function eR(e,t){if("0x"===e)return null;let r=a.O$.from((0,l.p3)(e,t,t+32)).toNumber(),n=a.O$.from((0,l.p3)(e,r,r+32)).toNumber();return(0,l.p3)(e,r+32,r+32+n)}function eT(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):ew.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function eD(e){let t=(0,l.lE)(e);if(t.length>32)throw Error("internal; should not happen");let r=new Uint8Array(32);return r.set(t,32-t.length),r}function eL(e){let t=[],r=0;for(let n=0;na.O$.from(e).eq(1)).catch(e=>{if(e.code===h.Yd.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e})),this._supportsEip2544}_fetch(e,t){return ev(this,void 0,void 0,function*(){let r={to:this.address,ccipReadEnabled:!0,data:(0,l.xs)([e,ei(this.name),t||"0x"])},n=!1;if(yield this.supportsWildcard()){var i;n=!0,r.data=(0,l.xs)(["0x9061b923",eL([(i=this.name,(0,l.Dv)((0,l.zo)(en(i).map(e=>{if(e.length>63)throw Error("invalid DNS encoded entry; length exceeds 63 bytes");let t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t})))+"00"),r.data])])}try{let e=yield this.provider.call(r);return(0,l.lE)(e).length%32==4&&ew.throwError("resolver threw error",h.Yd.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=eR(e,0)),e}catch(e){if(e.code===h.Yd.errors.CALL_EXCEPTION)return null;throw e}})}_fetchBytes(e,t){return ev(this,void 0,void 0,function*(){let r=yield this._fetch(e,t);return null!=r?eR(r,0):null})}_getAddress(e,t){let r=eC[String(e)];if(null==r&&ew.throwError(`unsupported coin type: ${e}`,h.Yd.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);let n=(0,l.lE)(t);if(null!=r.p2pkh){let e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){let t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return eI((0,l.zo)([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){let e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){let t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return eI((0,l.zo)([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){let e=n[1],t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){let e=em().toWords(n.slice(2));return e.unshift(t),em().encode(r.prefix,e)}}return null}getAddress(e){return ev(this,void 0,void 0,function*(){if(null==e&&(e=60),60===e)try{let e=yield this._fetch("0x3b3b57de");if("0x"===e||"0x0000000000000000000000000000000000000000000000000000000000000000"===e)return null;return this.provider.formatter.callAddress(e)}catch(e){if(e.code===h.Yd.errors.CALL_EXCEPTION)return null;throw e}let t=yield this._fetchBytes("0xf1cb7e06",eP(e));if(null==t||"0x"===t)return null;let r=this._getAddress(e,t);return null==r&&ew.throwError("invalid or unsupported coin data",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r})}getAvatar(){return ev(this,void 0,void 0,function*(){let e=[{type:"name",content:this.name}];try{let t=yield this.getText("avatar");if(null==t)return null;for(let r=0;re[t])}return ew.throwError("invalid or unsupported content hash data",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})})}getText(e){return ev(this,void 0,void 0,function*(){let t=(0,I.Y0)(e);(t=(0,l.zo)([eP(64),eP(t.length),t])).length%32!=0&&(t=(0,l.zo)([t,(0,l.$m)("0x",32-e.length%32)]));let r=yield this._fetchBytes("0x59d1d43c",(0,l.Dv)(t));return null==r||"0x"===r?null:(0,I.ZN)(r)})}}let eB=null,eF=1;class eU extends F.zt{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),(0,d.zG)(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch(e=>{}),this._ready().catch(e=>{});else{let t=(0,d.tu)(new.target,"getNetwork")(e);t?((0,d.zG)(this,"_network",t),this.emit("network",t,null)):ew.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ev(this,void 0,void 0,function*(){if(null==this._network){let e=null;if(this._networkPromise)try{e=yield this._networkPromise}catch(e){}null==e&&(e=yield this.detectNetwork()),e||ew.throwError("no network detected",h.Yd.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=e:(0,d.zG)(this,"_network",e),this.emit("network",e,null))}return this._network})}get ready(){return j(()=>this._ready().then(e=>e,e=>{if(e.code!==h.Yd.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}static getFormatter(){return null==eB&&(eB=new eb),eB}static getNetwork(e){return function(e){if(null==e)return null;if("number"==typeof e){for(let t in ed){let r=ed[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){let t=ed[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}let t=ed[e.name];if(!t)return"number"!=typeof e.chainId&&es.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&es.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;if(null==r&&t._defaultProvider){var n;r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider}return{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}(null==e?"homestead":e)}ccipReadFetch(e,t,r){return ev(this,void 0,void 0,function*(){if(this.disableCcipRead||0===r.length)return null;let n=e.to.toLowerCase(),i=t.toLowerCase(),s=[];for(let e=0;e=0?null:JSON.stringify({data:i,sender:n}),l=yield L({url:o,errorPassThrough:!0},a,(e,t)=>(e.status=t.statusCode,e));if(l.data)return l.data;let u=l.message||"unknown error";if(l.status>=400&&l.status<500)return ew.throwError(`response not found during CCIP fetch: ${u}`,h.Yd.errors.SERVER_ERROR,{url:t,errorMessage:u});s.push(u)}return ew.throwError(`error encountered during CCIP fetch: ${s.map(e=>JSON.stringify(e)).join(", ")}`,h.Yd.errors.SERVER_ERROR,{urls:r,errorMessages:s})})}_getInternalBlockNumber(e){return ev(this,void 0,void 0,function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){let t=this._internalBlockNumber;try{let r=yield t;if(ex()-r.respTime<=e)return r.blockNumber;break}catch(e){if(this._internalBlockNumber===t)break}}let t=ex(),r=(0,d.mE)({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then(e=>null,e=>e)}).then(({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;let i=ex();return(e=a.O$.from(e).toNumber()){this._internalBlockNumber===r&&(this._internalBlockNumber=null)}),(yield r).blockNumber})}poll(){return ev(this,void 0,void 0,function*(){let e=eF++,t=[],r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(e){this.emit("error",e);return}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r===this._lastBlockNumber){this.emit("didPoll",e);return}if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)ew.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",ew.makeError("network block skew detected",h.Yd.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach(e=>{if("block"===e)return;let t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]})),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach(e=>{switch(e.type){case"tx":{let r=e.hash,n=this.getTransactionReceipt(r).then(e=>(e&&null!=e.blockNumber&&(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e)),null)).catch(e=>{this.emit("error",e)});t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=r-1);let n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r;let i=n.toBlock-this._maxFilterBlockRange;i>n.fromBlock&&(n.fromBlock=i),n.fromBlock<0&&(n.fromBlock=0);let s=this.getLogs(n).then(t=>{e._inflight=!1,0!==t.length&&t.forEach(t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)})}).catch(t=>{this.emit("error",t),e._inflight=!1});t.push(s)}}}),this._lastBlockNumber=r,Promise.all(t).then(()=>{this.emit("didPoll",e)}).catch(e=>{this.emit("error",e)})})}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ev(this,void 0,void 0,function*(){return ew.throwError("provider does not support network detection",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})})}getNetwork(){return ev(this,void 0,void 0,function*(){let e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield ek(0),this._network;let r=ew.makeError("underlying network changed",h.Yd.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e})}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then(e=>{this._setFastBlockNumber(e)},e=>{}),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval(()=>{this.poll()},this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout(()=>{this.poll(),this._bootstrapPoll=setTimeout(()=>{this._poller||this.poll(),this._bootstrapPoll=null},this.pollingInterval)},0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval(()=>{this.poll()},this._pollingInterval))}_getFastBlockNumber(){let e=ex();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then(e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber))),this._fastBlockNumberPromise}_setFastBlockNumber(e){(null==this._fastBlockNumber||!(ethis._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return ev(this,void 0,void 0,function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)})}_waitForTransaction(e,t,r,n){return ev(this,void 0,void 0,function*(){let i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise((i,s)=>{let o=[],a=!1,l=function(){return!!a||(a=!0,o.forEach(e=>{e()}),!1)},u=e=>{e.confirmations{this.removeListener(e,u)}),n){let r=n.startBlock,i=null,u=o=>ev(this,void 0,void 0,function*(){a||(yield ek(1e3),this.getTransactionCount(n.from).then(c=>ev(this,void 0,void 0,function*(){if(!a){if(c<=n.nonce)r=o;else{{let t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3){a||this.once("block",u)}))});if(a)return;this.once("block",u),o.push(()=>{this.removeListener("block",u)})}if("number"==typeof r&&r>0){let e=setTimeout(()=>{l()||s(ew.makeError("timeout exceeded",h.Yd.errors.TIMEOUT,{timeout:r}))},r);e.unref&&e.unref(),o.push(()=>{clearTimeout(e)})}})})}getBlockNumber(){return ev(this,void 0,void 0,function*(){return this._getInternalBlockNumber(0)})}getGasPrice(){return ev(this,void 0,void 0,function*(){yield this.getNetwork();let e=yield this.perform("getGasPrice",{});try{return a.O$.from(e)}catch(t){return ew.throwError("bad result from backend",h.Yd.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}})}getBalance(e,t){return ev(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,d.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return a.O$.from(n)}catch(e){return ew.throwError("bad result from backend",h.Yd.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:e})}})}getTransactionCount(e,t){return ev(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,d.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return a.O$.from(n).toNumber()}catch(e){return ew.throwError("bad result from backend",h.Yd.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:e})}})}getCode(e,t){return ev(this,void 0,void 0,function*(){yield this.getNetwork();let r=yield(0,d.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return(0,l.Dv)(n)}catch(e){return ew.throwError("bad result from backend",h.Yd.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:e})}})}getStorageAt(e,t,r){return ev(this,void 0,void 0,function*(){yield this.getNetwork();let n=yield(0,d.mE)({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then(e=>(0,l.$P)(e))}),i=yield this.perform("getStorageAt",n);try{return(0,l.Dv)(i)}catch(e){return ew.throwError("bad result from backend",h.Yd.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:e})}})}_wrapTransaction(e,t,r){if(null!=t&&32!==(0,l.E1)(t))throw Error("invalid response - sendTransaction");return null!=t&&e.hash!==t&&ew.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.Yd.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),e.wait=(t,n)=>ev(this,void 0,void 0,function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});let s=yield this._waitForTransaction(e.hash,t,n,i);return null==s&&0===t?null:(this._emitted["t:"+e.hash]=s.blockNumber,0===s.status&&ew.throwError("transaction failed",h.Yd.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:s}),s)}),e}sendTransaction(e){return ev(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield Promise.resolve(e).then(e=>(0,l.Dv)(e)),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);let n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{let e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(e){throw e.transaction=r,e.transactionHash=r.hash,e}})}_getTransactionRequest(e){return ev(this,void 0,void 0,function*(){let t=yield e,r={};return["from","to"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?this._getAddress(e):null))}),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?a.O$.from(e):null))}),["type"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>null!=e?e:null))}),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach(e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then(e=>e?(0,l.Dv)(e):null))}),this.formatter.transactionRequest((yield(0,d.mE)(r)))})}_getFilter(e){return ev(this,void 0,void 0,function*(){e=yield e;let t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach(r=>{null!=e[r]&&(t[r]=e[r])}),["fromBlock","toBlock"].forEach(r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))}),this.formatter.filter((yield(0,d.mE)(t)))})}_call(e,t,r){return ev(this,void 0,void 0,function*(){r>=10&&ew.throwError("CCIP read exceeded maximum redirections",h.Yd.errors.SERVER_ERROR,{redirects:r,transaction:e});let n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&(0,l.E1)(i)%32==4)try{let s=(0,l.p3)(i,4),o=(0,l.p3)(s,0,32);a.O$.from(o).eq(n)||ew.throwError("CCIP Read sender did not match",h.Yd.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});let u=[],c=a.O$.from((0,l.p3)(s,32,64)).toNumber(),d=a.O$.from((0,l.p3)(s,c,c+32)).toNumber(),f=(0,l.p3)(s,c+32);for(let t=0;tev(this,void 0,void 0,function*(){let e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let r=0;rthis._wrapTransaction(e)),r}return this.formatter.block(e)}),{oncePoll:this})})}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ev(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return j(()=>ev(this,void 0,void 0,function*(){let r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;let n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}),{oncePoll:this})})}getTransactionReceipt(e){return ev(this,void 0,void 0,function*(){yield this.getNetwork(),e=yield e;let t={transactionHash:this.formatter.hash(e,!0)};return j(()=>ev(this,void 0,void 0,function*(){let r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;let n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}),{oncePoll:this})})}getLogs(e){return ev(this,void 0,void 0,function*(){yield this.getNetwork();let t=yield(0,d.mE)({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach(e=>{null==e.removed&&(e.removed=!1)}),eb.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)})}getEtherPrice(){return ev(this,void 0,void 0,function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})})}_getBlockTag(e){return ev(this,void 0,void 0,function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&ew.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return(t+=e)<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)})}getResolver(e){return ev(this,void 0,void 0,function*(){let t=e;for(;;){if(""===t||"."===t||"eth"!==e&&"eth"===t)return null;let r=yield this._getResolver(t,"getResolver");if(null!=r){let n=new ej(this,r,e);if(t!==e&&!(yield n.supportsWildcard()))return null;return n}t=t.split(".").slice(1).join(".")}})}_getResolver(e,t){return ev(this,void 0,void 0,function*(){null==t&&(t="ENS");let r=yield this.getNetwork();r.ensAddress||ew.throwError("network does not support ENS",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{let t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+ei(e).substring(2)});return this.formatter.callAddress(t)}catch(e){}return null})}resolveName(e){return ev(this,void 0,void 0,function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(t){if((0,l.A7)(e))throw t}"string"!=typeof e&&ew.throwArgumentError("invalid ENS name","name",e);let t=yield this.getResolver(e);return t?yield t.getAddress():null})}lookupAddress(e){return ev(this,void 0,void 0,function*(){e=yield e;let t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;let n=eM((yield this.call({to:r,data:"0x691f3431"+ei(t).substring(2)})),0);return(yield this.resolveName(n))!=e?null:n})}getAvatar(e){return ev(this,void 0,void 0,function*(){let t=null;if((0,l.A7)(e)){let r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",n=yield this._getResolver(r,"getAvatar");if(!n)return null;t=new ej(this,n,r);try{let e=yield t.getAvatar();if(e)return e.url}catch(e){if(e.code!==h.Yd.errors.CALL_EXCEPTION)throw e}try{let e=eM((yield this.call({to:n,data:"0x691f3431"+ei(r).substring(2)})),0);t=yield this.getResolver(e)}catch(e){if(e.code!==h.Yd.errors.CALL_EXCEPTION)throw e;return null}}else if(!(t=yield this.getResolver(e)))return null;let r=yield t.getAvatar();return null==r?null:r.url})}perform(e,t){return ew.throwError(e+" not implemented",h.Yd.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_stopEvent(e){this.polling=this._events.filter(e=>e.pollable()).length>0}_addEventListener(e,t,r){let n=new e$(eA(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=eA(e);return this._events=this._events.filter(e=>e.tag!==i||(setTimeout(()=>{e.listener.apply(this,t)},0),r=!0,!e.once||(n.push(e),!1))),n.forEach(e=>{this._stopEvent(e)}),r}listenerCount(e){if(!e)return this._events.length;let t=eA(e);return this._events.filter(e=>e.tag===t).length}listeners(e){if(null==e)return this._events.map(e=>e.listener);let t=eA(e);return this._events.filter(e=>e.tag===t).map(e=>e.listener)}off(e,t){if(null==t)return this.removeAllListeners(e);let r=[],n=!1,i=eA(e);return this._events=this._events.filter(e=>e.tag!==i||e.listener!=t||!!n||(n=!0,r.push(e),!1)),r.forEach(e=>{this._stopEvent(e)}),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{let r=eA(e);this._events=this._events.filter(e=>e.tag!==r||(t.push(e),!1))}return t.forEach(e=>{this._stopEvent(e)}),this}}var ez=function(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})};let eq=new h.Yd(B.i),eH=["call","estimateGas"];function eG(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){let r=(0,l.A7)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(let r in e){let n=eG(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return eG(JSON.parse(e),t)}catch(e){}return null}function eV(e,t,r){let n=r.transaction||r.signedTransaction;if("call"===e){let e=eG(t,!0);if(e)return e.data;eq.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.Yd.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=eG(t.body,!1);null==r&&(r=eG(t,!1)),r&&eq.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===h.Yd.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),(i=(i||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&eq.throwError("insufficient funds for intrinsic transaction cost",h.Yd.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&eq.throwError("nonce has already been used",h.Yd.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&eq.throwError("replacement fee too low",h.Yd.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&eq.throwError("legacy pre-eip-155 transactions not supported",h.Yd.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),eH.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&eq.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.Yd.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function eW(e){return new Promise(function(t){setTimeout(t,e)})}function eK(e){if(e.error){let t=Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function eY(e){return e?e.toLowerCase():e}let eZ={};class eJ extends o.E{constructor(e,t,r){if(super(),e!==eZ)throw Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");(0,d.zG)(this,"provider",t),null==r&&(r=0),"string"==typeof r?((0,d.zG)(this,"_address",this.provider.formatter.address(r)),(0,d.zG)(this,"_index",null)):"number"==typeof r?((0,d.zG)(this,"_index",r),(0,d.zG)(this,"_address",null)):eq.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return eq.throwError("cannot alter JSON-RPC Signer connection",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new eQ(eZ,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then(e=>(e.length<=this._index&&eq.throwError("unknown account #"+this._index,h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index])))}sendUncheckedTransaction(e){e=(0,d.DC)(e);let t=this.getAddress().then(e=>(e&&(e=e.toLowerCase()),e));if(null==e.gasLimit){let r=(0,d.DC)(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then(e=>ez(this,void 0,void 0,function*(){if(null==e)return null;let t=yield this.provider.resolveName(e);return null==t&&eq.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))),(0,d.mE)({tx:(0,d.mE)(e),sender:t}).then(({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&eq.throwArgumentError("from address mismatch","transaction",e):t.from=r;let n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then(e=>e,e=>("string"==typeof e.message&&e.message.match(/user denied/i)&&eq.throwError("user rejected transaction",h.Yd.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:t}),eV("sendTransaction",e,n)))})}signTransaction(e){return eq.throwError("signing transactions is unsupported",h.Yd.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return ez(this,void 0,void 0,function*(){let t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield j(()=>ez(this,void 0,void 0,function*(){let e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}),{oncePoll:this.provider})}catch(e){throw e.transactionHash=r,e}})}signMessage(e){return ez(this,void 0,void 0,function*(){let t="string"==typeof e?(0,I.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("personal_sign",[(0,l.Dv)(t),r.toLowerCase()])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&eq.throwError("user rejected signing",h.Yd.errors.ACTION_REJECTED,{action:"signMessage",from:r,messageData:e}),t}})}_legacySignMessage(e){return ez(this,void 0,void 0,function*(){let t="string"==typeof e?(0,I.Y0)(e):e,r=yield this.getAddress();try{return yield this.provider.send("eth_sign",[r.toLowerCase(),(0,l.Dv)(t)])}catch(t){throw"string"==typeof t.message&&t.message.match(/user denied/i)&&eq.throwError("user rejected signing",h.Yd.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:r,messageData:e}),t}})}_signTypedData(e,t,r){return ez(this,void 0,void 0,function*(){let n=yield P.resolveNames(e,t,r,e=>this.provider.resolveName(e)),i=yield this.getAddress();try{return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(P.getPayload(n.domain,t,n.value))])}catch(e){throw"string"==typeof e.message&&e.message.match(/user denied/i)&&eq.throwError("user rejected signing",h.Yd.errors.ACTION_REJECTED,{action:"_signTypedData",from:i,messageData:{domain:n.domain,types:t,value:n.value}}),e}})}unlock(e){return ez(this,void 0,void 0,function*(){let t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])})}}class eQ extends eJ{sendTransaction(e){return this.sendUncheckedTransaction(e).then(e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)}))}}let eX={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class e0 extends eU{constructor(e,t){let r=t;null==r&&(r=new Promise((e,t)=>{setTimeout(()=>{this.detectNetwork().then(t=>{e(t)},e=>{t(e)})},0)})),super(r),e||(e=(0,d.tu)(this.constructor,"defaultUrl")()),"string"==typeof e?(0,d.zG)(this,"connection",Object.freeze({url:e})):(0,d.zG)(this,"connection",Object.freeze((0,d.DC)(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout(()=>{this._cache.detectNetwork=null},0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return ez(this,void 0,void 0,function*(){yield eW(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(e){}}if(null!=e){let t=(0,d.tu)(this.constructor,"getNetwork");try{return t(a.O$.from(e).toNumber())}catch(t){return eq.throwError("could not detect network",h.Yd.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return eq.throwError("could not detect network",h.Yd.errors.NETWORK_ERROR,{event:"noNetwork"})})}getSigner(e){return new eJ(eZ,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then(e=>e.map(e=>this.formatter.address(e)))}send(e,t){let r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:(0,d.p$)(r),provider:this});let n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];let i=L(this.connection,JSON.stringify(r),eK).then(e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e});return n&&(this._cache[e]=i,setTimeout(()=>{this._cache[e]=null},0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[eY(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[eY(t.address),t.blockTag]];case"getCode":return["eth_getCode",[eY(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[eY(t.address),(0,l.$m)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":if(t.blockTag)return["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]];if(t.blockHash)return["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]];break;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[(0,d.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[(0,d.tu)(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=eY(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return ez(this,void 0,void 0,function*(){if("call"===e||"estimateGas"===e){let e=t.transaction;if(e&&null!=e.type&&a.O$.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){let r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=(0,d.DC)(t)).transaction=(0,d.DC)(e),delete t.transaction.type)}}let r=this.prepareRequest(e,t);null==r&&eq.throwError(e+" not implemented",h.Yd.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(r){return eV(e,r,t)}})}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;let e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then(function(r){return function n(){e.send("eth_getFilterChanges",[r]).then(function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach(function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then(function(){return e.getTransaction(t).then(function(t){return e.emit("pending",t),null})})}),n.then(function(){return eW(1e3)})}).then(function(){if(e._pendingFilter!=t){e.send("eth_uninstallFilter",[r]);return}return setTimeout(function(){n()},0),null}).catch(e=>{})}(),r}).catch(e=>{})}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){let r=(0,d.DC)(eX);if(t)for(let e in t)t[e]&&(r[e]=!0);(0,d.uj)(e,r);let n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach(function(t){if(null==e[t])return;let r=(0,l.$P)(a.O$.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r}),["from","to","data"].forEach(function(t){null!=e[t]&&(n[t]=(0,l.Dv)(e[t]))}),e.accessList&&(n.accessList=(0,O.z7)(e.accessList)),n}}},40739:function(e,t,r){"use strict";r.d(t,{c:function(){return l}});var n=r(36173),i=r(13421),s=r(86365),o=r(27972);let a=new i.Yd(s.i);class l extends o.r{detectNetwork(){var e,t,r,s;let o=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return e=this,t=void 0,r=void 0,s=function*(){let e=this.network;return null==e&&((e=yield o.detectNetwork.call(this))||a.throwError("no network detected",i.Yd.errors.UNKNOWN_ERROR,{}),null==this._network&&((0,n.zG)(this,"_network",e),this.emit("network",e,null))),e},new(r||(r=Promise))(function(n,i){function o(e){try{l(s.next(e))}catch(e){i(e)}}function a(e){try{l(s.throw(e))}catch(e){i(e)}}function l(e){var t;e.done?n(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((s=s.apply(e,t||[])).next())})}}},68893:function(e,t,r){"use strict";r.d(t,{Q:function(){return c}});var n=r(36173),i=r(13421),s=r(86365),o=r(27972);let a=new i.Yd(s.i),l=1;function u(e,t){let r="Web3LegacyFetcher";return function(e,i){let s={method:e,params:i,id:l++,jsonrpc:"2.0"};return new Promise((e,i)=>{this.emit("debug",{action:"request",fetcher:r,request:(0,n.p$)(s),provider:this}),t(s,(t,n)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:s,provider:this}),i(t);if(this.emit("debug",{action:"response",fetcher:r,request:s,response:n,provider:this}),n.error){let e=Error(n.error.message);return e.code=n.error.code,e.data=n.error.data,i(e)}e(n.result)})})}}class c extends o.r{constructor(e,t){null==e&&a.throwArgumentError("missing provider","provider",e);let r=null,i=null,s=null;"function"==typeof e?(r="unknown:",i=e):(((r=e.host||e.path||"")||!e.isMetaMask||(r="metamask"),s=e,e.request)?(""===r&&(r="eip-1193:"),i=function(t,r){null==r&&(r=[]);let i={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:(0,n.p$)(i),provider:this}),e.request(i).then(e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:e,provider:this}),e),e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:e,provider:this}),e})}):e.sendAsync?i=u(e,e.sendAsync.bind(e)):e.send?i=u(e,e.send.bind(e)):a.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),(0,n.zG)(this,"jsonRpcFetchFunc",i),(0,n.zG)(this,"provider",s)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}},18162:function(e,t,r){"use strict";r.d(t,{J:function(){return d},c:function(){return l}});var n=r(9784),i=r(13421);let s=new i.Yd("rlp/5.7.0");function o(e){let t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function a(e,t,r){let n=0;for(let i=0;it+1+n&&s.throwError("child data too short",i.Yd.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:o}}function c(e,t){if(0===e.length&&s.throwError("data too short",i.Yd.errors.BUFFER_OVERRUN,{}),e[t]>=248){let r=e[t]-247;t+1+r>e.length&&s.throwError("data short segment too short",i.Yd.errors.BUFFER_OVERRUN,{});let n=a(e,t+1,r);return t+1+r+n>e.length&&s.throwError("data long segment too short",i.Yd.errors.BUFFER_OVERRUN,{}),u(e,t,t+1+r,r+n)}if(e[t]>=192){let r=e[t]-192;return t+1+r>e.length&&s.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{}),u(e,t,t+1,r)}if(e[t]>=184){let r=e[t]-183;t+1+r>e.length&&s.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{});let o=a(e,t+1,r);t+1+r+o>e.length&&s.throwError("data array too short",i.Yd.errors.BUFFER_OVERRUN,{});let l=(0,n.Dv)(e.slice(t+1+r,t+1+r+o));return{consumed:1+r+o,result:l}}if(e[t]>=128){let r=e[t]-128;t+1+r>e.length&&s.throwError("data too short",i.Yd.errors.BUFFER_OVERRUN,{});let o=(0,n.Dv)(e.slice(t+1,t+1+r));return{consumed:1+r,result:o}}return{consumed:1,result:(0,n.Dv)(e[t])}}function d(e){let t=(0,n.lE)(e),r=c(t,0);return r.consumed!==t.length&&s.throwArgumentError("invalid rlp data","data",e),r.result}},28257:function(e,t,r){"use strict";r.d(t,{Y0:function(){return h},XL:function(){return p},ZN:function(){return f}});var n,i,s,o,a=r(9784);let l=new(r(13421)).Yd("strings/5.7.0");function u(e,t,r,n,i){if(e===o.BAD_PREFIX||e===o.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n>6==2;n++)e++;return e}return e===o.OVERRUN?r.length-t-1:0}(n=s||(s={})).current="",n.NFC="NFC",n.NFD="NFD",n.NFKC="NFKC",n.NFKD="NFKD",(i=o||(o={})).UNEXPECTED_CONTINUE="unexpected continuation byte",i.BAD_PREFIX="bad codepoint prefix",i.OVERRUN="string overrun",i.MISSING_CONTINUE="missing continuation byte",i.OUT_OF_RANGE="out of UTF-8 range",i.UTF16_SURROGATE="UTF-16 surrogate",i.OVERLONG="overlong representation";let c=Object.freeze({error:function(e,t,r,n,i){return l.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:u,replace:function(e,t,r,n,i){return e===o.OVERLONG?(n.push(i),0):(n.push(65533),u(e,t,r,n,i))}});function d(e,t){null==t&&(t=c.error),e=(0,a.lE)(e);let r=[],n=0;for(;n>7==0){r.push(i);continue}let s=null,a=null;if((224&i)==192)s=1,a=127;else if((240&i)==224)s=2,a=2047;else if((248&i)==240)s=3,a=65535;else{(192&i)==128?n+=t(o.UNEXPECTED_CONTINUE,n-1,e,r):n+=t(o.BAD_PREFIX,n-1,e,r);continue}if(n-1+s>=e.length){n+=t(o.OVERRUN,n-1,e,r);continue}let l=i&(1<<8-s-1)-1;for(let i=0;i1114111){n+=t(o.OUT_OF_RANGE,n-1-s,e,r,l);continue}if(l>=55296&&l<=57343){n+=t(o.UTF16_SURROGATE,n-1-s,e,r,l);continue}if(l<=a){n+=t(o.OVERLONG,n-1-s,e,r,l);continue}r.push(l)}}return r}function h(e,t=s.current){t!=s.current&&(l.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t>6|192),r.push(63&n|128);else if((64512&n)==55296){t++;let i=e.charCodeAt(t);if(t>=e.length||(64512&i)!=56320)throw Error("invalid utf-8 string");let s=65536+((1023&n)<<10)+(1023&i);r.push(s>>18|240),r.push(s>>12&63|128),r.push(s>>6&63|128),r.push(63&s|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return(0,a.lE)(r)}function f(e,t){return d(e,t).map(e=>e<=65535?String.fromCharCode(e):String.fromCharCode(((e-=65536)>>10&1023)+55296,(1023&e)+56320)).join("")}function p(e,t=s.current){return d(h(e,t))}},2149:function(e,t,r){"use strict";r.d(t,{z7:function(){return eo},Qc:function(){return eh},qC:function(){return ec}});var n,i,s=r(89005),o=r(22594),a=r(9784),l=r(75986),u=r(43481),c=r(36173),d=r(18162),h=r(58171),f=r.n(h),p=r(83699),g=r.n(p);function m(e,t,r){return e(r={path:t,exports:{},require:function(e,t){return function(){throw Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(e,null==t?r.path:t)}},r.exports),r.exports}"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==r.g?r.g:"undefined"!=typeof self&&self;var y=b;function b(e,t){if(!e)throw Error(t||"Assertion failed")}b.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)};var v=m(function(e,t){function r(e){return 1===e.length?"0"+e:e}function n(e){for(var t="",n=0;n>8,o=255&i;s?r.push(s,o):r.push(o)}return r},t.zero2=r,t.toHex=n,t.encode=function(e,t){return"hex"===t?n(e):e}}),w=m(function(e,t){t.assert=y,t.toArray=v.toArray,t.zero2=v.zero2,t.toHex=v.toHex,t.encode=v.encode,t.getNAF=function(e,t,r){var n=Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<(i>>1)-1?(i>>1)-l:l,s.isubn(a)):a=0,n[o]=a,s.iushrn(1)}return n},t.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var s,o,a,l=e.andln(3)+n&3,u=t.andln(3)+i&3;3===l&&(l=-1),3===u&&(u=-1),o=(1&l)==0?0:(3==(s=e.andln(7)+n&7)||5===s)&&2===u?-l:l,r[0].push(o),a=(1&u)==0?0:(3==(s=t.andln(7)+i&7)||5===s)&&2===l?-u:u,r[1].push(a),2*n===o+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r},t.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},t.parseBytes=function(e){return"string"==typeof e?t.toArray(e,"hex"):e},t.intFromLE=function(e){return new(f())(e,"hex","le")}}),_=w.getNAF,E=w.getJSF,A=w.assert;function x(e,t){this.type=e,this.p=new(f())(t.p,16),this.red=t.prime?f().red(t.prime):f().mont(this.p),this.zero=new(f())(0).toRed(this.red),this.one=new(f())(1).toRed(this.red),this.two=new(f())(2).toRed(this.red),this.n=t.n&&new(f())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function k(e,t){this.curve=e,this.type=t,this.precomputed=null}x.prototype.point=function(){throw Error("Not implemented")},x.prototype.validate=function(){throw Error("Not implemented")},x.prototype._fixedNafMul=function(e,t){A(e.precomputed);var r,n,i=e._getDoubles(),s=_(t,1,this._bitLength),o=(1<=r;l--)n=(n<<1)+s[l];a.push(n)}for(var u=this.jpoint(null,null,null),c=this.jpoint(null,null,null),d=o;d>0;d--){for(r=0;r=0;a--){for(var l=0;a>=0&&0===s[a];a--)l++;if(a>=0&&l++,o=o.dblp(l),a<0)break;var u=s[a];A(0!==u),o="affine"===e.type?u>0?o.mixedAdd(i[u-1>>1]):o.mixedAdd(i[-u-1>>1].neg()):u>0?o.add(i[u-1>>1]):o.add(i[-u-1>>1].neg())}return"affine"===e.type?o.toP():o},x.prototype._wnafMulAdd=function(e,t,r,n,i){var s,o,a,l=this._wnafT1,u=this._wnafT2,c=this._wnafT3,d=0;for(s=0;s=1;s-=2){var f=s-1,p=s;if(1!==l[f]||1!==l[p]){c[f]=_(r[f],l[f],this._bitLength),c[p]=_(r[p],l[p],this._bitLength),d=Math.max(c[f].length,d),d=Math.max(c[p].length,d);continue}var g=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(g[1]=t[f].add(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].add(t[p].neg())):(g[1]=t[f].toJ().mixedAdd(t[p]),g[2]=t[f].toJ().mixedAdd(t[p].neg()));var m=[-3,-1,-5,-7,0,7,5,1,3],y=E(r[f],r[p]);for(o=0,d=Math.max(y[0].length,d),c[f]=Array(d),c[p]=Array(d);o=0;s--){for(var x=0;s>=0;){var k=!0;for(o=0;o=0&&x++,w=w.dblp(x),s<0)break;for(o=0;o0?a=u[o][S-1>>1]:S<0&&(a=u[o][-S-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(s=0;s=Math.ceil((e.bitLength()+1)/t.step)},k.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;ii[0].cmp(i[1])?i[0]:i[1]).toRed(this.red)}if(e.lambda)r=new(f())(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],$(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return n=e.basis?e.basis.map(function(e){return{a:new(f())(e.a,16),b:new(f())(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:n}}},C.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:f().mont(e),r=new(f())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(f())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},C.prototype._getEndoBasis=function(e){for(var t,r,n,i,s,o,a,l,u,c=this.n.ushrn(Math.floor(this.n.bitLength()/2)),d=e,h=this.n.clone(),p=new(f())(1),g=new(f())(0),m=new(f())(0),y=new(f())(1),b=0;0!==d.cmpn(0);){var v=h.div(d);l=h.sub(v.mul(d)),u=m.sub(v.mul(p));var w=y.sub(v.mul(g));if(!n&&0>l.cmp(c))t=a.neg(),r=p,n=l.neg(),i=u;else if(n&&2==++b)break;a=l,h=d,d=l,m=p,p=u,y=g,g=w}s=l.neg(),o=u;var _=n.sqr().add(i.sqr());return s.sqr().add(o.sqr()).cmp(_)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),i=i.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:i},{a:s,b:o}]},C.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),s=r.b.neg().mul(e).divRound(this.n),o=i.mul(r.a),a=s.mul(n.a),l=i.mul(r.b),u=s.mul(n.b);return{k1:e.sub(o).sub(a),k2:l.add(u).neg()}},C.prototype.pointFromX=function(e,t){(e=new(f())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},C.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},C.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,s=0;s":""},P.prototype.isInfinity=function(){return this.inf},P.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},P.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),s=i.redSqr().redISub(this.x.redAdd(this.x)),o=i.redMul(this.x.redSub(s)).redISub(this.y);return this.curve.point(s,o)},P.prototype.getX=function(){return this.x.fromRed()},P.prototype.getY=function(){return this.y.fromRed()},P.prototype.mul=function(e){return(e=new(f())(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},P.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},P.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},P.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},P.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},P.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},S(I,x.BasePoint),C.prototype.jpoint=function(e,t,r){return new I(this,e,t,r)},I.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},I.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},I.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),s=this.y.redMul(t.redMul(e.z)),o=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),l=s.redSub(o);if(0===a.cmpn(0))return 0!==l.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),d=n.redMul(u),h=l.redSqr().redIAdd(c).redISub(d).redISub(d),f=l.redMul(d.redISub(h)).redISub(s.redMul(c)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(h,f,p)},I.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,s=e.y.redMul(t).redMul(this.z),o=r.redSub(n),a=i.redSub(s);if(0===o.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var l=o.redSqr(),u=l.redMul(o),c=r.redMul(l),d=a.redSqr().redIAdd(u).redISub(c).redISub(c),h=a.redMul(c.redISub(d)).redISub(i.redMul(u)),f=this.z.redMul(o);return this.curve.jpoint(d,h,f)},I.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},I.prototype.inspect=function(){return this.isInfinity()?"":""},I.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var O=m(function(e,t){t.base=x,t.short=C,t.mont=null,t.edwards=null}),N=m(function(e,t){var r,n=w.assert;function i(e){"short"===e.type?this.curve=new O.short(e):"edwards"===e.type?this.curve=new O.edwards(e):this.curve=new O.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,r){Object.defineProperty(t,e,{configurable:!0,enumerable:!0,get:function(){var n=new i(r);return Object.defineProperty(t,e,{configurable:!0,enumerable:!0,value:n}),n}})}t.PresetCurve=i,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:g().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:g().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:g().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:g().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:g().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g().sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:g().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(e){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:g().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function M(e){if(!(this instanceof M))return new M(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=v.toArray(e.entropy,e.entropyEnc||"hex"),r=v.toArray(e.nonce,e.nonceEnc||"hex"),n=v.toArray(e.pers,e.persEnc||"hex");y(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}M.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var i=0;i=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},M.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=v.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length"};var D=w.assert;function L(e,t){if(e instanceof L)return e;this._importDER(e,t)||(D(e.r&&e.s,"Signature without r or s"),this.r=new(f())(e.r,16),this.s=new(f())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function j(){this.place=0}function B(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,s=0,o=t.place;s>>=0;return!(i<=127)&&(t.place=o,i)}function F(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}L.prototype._importDER=function(e,t){e=w.toArray(e,t);var r=new j;if(48!==e[r.place++])return!1;var n=B(e,r);if(!1===n||n+r.place!==e.length||2!==e[r.place++])return!1;var i=B(e,r);if(!1===i)return!1;var s=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var o=B(e,r);if(!1===o||e.length!==o+r.place)return!1;var a=e.slice(r.place,o+r.place);if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(f())(s),this.s=new(f())(a),this.recoveryParam=null,!0},L.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=F(t),r=F(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];U(n,t.length),(n=n.concat(t)).push(2),U(n,r.length);var i=n.concat(r),s=[48];return U(s,i.length),s=s.concat(i),w.encode(s,e)};var z=function(){throw Error("unsupported")},q=w.assert;function H(e){if(!(this instanceof H))return new H(e);"string"==typeof e&&(q(Object.prototype.hasOwnProperty.call(N,e),"Unknown curve "+e),e=N[e]),e instanceof N.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}H.prototype.keyPair=function(e){return new T(this,e)},H.prototype.keyFromPrivate=function(e,t){return T.fromPrivate(this,e,t)},H.prototype.keyFromPublic=function(e,t){return T.fromPublic(this,e,t)},H.prototype.genKeyPair=function(e){e||(e={});for(var t=new M({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||z(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(f())(2));;){var i=new(f())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},H.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return(r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},H.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(f())(e,16));for(var i=this.n.byteLength(),s=t.getPrivate().toArray("be",i),o=e.toArray("be",i),a=new M({hash:this.hash,entropy:s,nonce:o,pers:n.pers,persEnc:n.persEnc||"utf8"}),l=this.n.sub(new(f())(1)),u=0;;u++){var c=n.k?n.k(u):new(f())(a.generate(this.n.byteLength()));if(!(0>=(c=this._truncateToN(c,!0)).cmpn(1)||c.cmp(l)>=0)){var d=this.g.mul(c);if(!d.isInfinity()){var h=d.getX(),p=h.umod(this.n);if(0!==p.cmpn(0)){var g=c.invm(this.n).mul(p.mul(t.getPrivate()).iadd(e));if(0!==(g=g.umod(this.n)).cmpn(0)){var m=(d.getY().isOdd()?1:0)|(0!==h.cmp(p)?2:0);return n.canonical&&g.cmp(this.nh)>0&&(g=this.n.sub(g),m^=1),new L({r:p,s:g,recoveryParam:m})}}}}}},H.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(f())(e,16)),r=this.keyFromPublic(r,n);var i,s=(t=new L(t,"hex")).r,o=t.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>o.cmpn(1)||o.cmp(this.n)>=0)return!1;var a=o.invm(this.n),l=a.mul(e).umod(this.n),u=a.mul(s).umod(this.n);return this.curve._maxwellTrick?!(i=this.g.jmulAdd(l,r.getPublic(),u)).isInfinity()&&i.eqXToP(s):!(i=this.g.mulAdd(l,r.getPublic(),u)).isInfinity()&&0===i.getX().umod(this.n).cmp(s)},H.prototype.recoverPubKey=function(e,t,r,n){q((3&r)===r,"The recovery param is more than two bits"),t=new L(t,n);var i=this.n,s=new(f())(e),o=t.r,a=t.s,l=1&r,u=r>>1;if(o.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw Error("Unable to find sencond key candinate");o=u?this.curve.pointFromX(o.add(this.curve.n),l):this.curve.pointFromX(o,l);var c=t.r.invm(i),d=i.sub(s).mul(c).umod(i),h=a.mul(c).umod(i);return this.g.mulAdd(d,o,h)},H.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new L(t,n)).recoveryParam)return t.recoveryParam;for(var i,s=0;s<4;s++){try{i=this.recoverPubKey(e,t,s)}catch(e){continue}if(i.eq(r))return s}throw Error("Unable to find valid recovery factor")};var G=m(function(e,t){t.version="6.5.4",t.utils=w,t.rand=function(){throw Error("unsupported")},t.curve=O,t.curves=N,t.ec=H,t.eddsa=null}).ec,V=r(13421);let W=new V.Yd("signing-key/5.7.0"),K=null;function Y(){return K||(K=new G("secp256k1")),K}class Z{constructor(e){(0,c.zG)(this,"curve","secp256k1"),(0,c.zG)(this,"privateKey",(0,a.Dv)(e)),32!==(0,a.E1)(this.privateKey)&&W.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let t=Y().keyFromPrivate((0,a.lE)(this.privateKey));(0,c.zG)(this,"publicKey","0x"+t.getPublic(!1,"hex")),(0,c.zG)(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),(0,c.zG)(this,"_isSigningKey",!0)}_addPoint(e){let t=Y().keyFromPublic((0,a.lE)(this.publicKey)),r=Y().keyFromPublic((0,a.lE)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){let t=Y().keyFromPrivate((0,a.lE)(this.privateKey)),r=(0,a.lE)(e);32!==r.length&&W.throwArgumentError("bad digest length","digest",e);let n=t.sign(r,{canonical:!0});return(0,a.N)({recoveryParam:n.recoveryParam,r:(0,a.$m)("0x"+n.r.toString(16),32),s:(0,a.$m)("0x"+n.s.toString(16),32)})}computeSharedSecret(e){let t=Y().keyFromPrivate((0,a.lE)(this.privateKey)),r=Y().keyFromPublic((0,a.lE)(J(e)));return(0,a.$m)("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}}function J(e,t){let r=(0,a.lE)(e);if(32===r.length){let e=new Z(r);return t?"0x"+Y().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?(0,a.Dv)(r):"0x"+Y().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Y().keyFromPublic(r).getPublic(!0,"hex"):(0,a.Dv)(r):W.throwArgumentError("invalid public or private key","key","[REDACTED]")}let Q=new V.Yd("transactions/5.7.0");function X(e){return"0x"===e?null:(0,s.Kn)(e)}function ee(e){return"0x"===e?l._Y:o.O$.from(e)}(n=i||(i={}))[n.legacy=0]="legacy",n[n.eip2930=1]="eip2930",n[n.eip1559=2]="eip1559";let et=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],er={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function en(e,t){return function(e){let t=J(e);return(0,s.Kn)((0,a.p3)((0,u.w)((0,a.p3)(t,1)),12))}(function(e,t){let r=(0,a.N)(t),n={r:(0,a.lE)(r.r),s:(0,a.lE)(r.s)};return"0x"+Y().recoverPubKey((0,a.lE)(e),n,r.recoveryParam).encode("hex",!1)}((0,a.lE)(e),t))}function ei(e,t){let r=(0,a.G1)(o.O$.from(e).toHexString());return r.length>32&&Q.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function es(e,t){return{address:(0,s.Kn)(e),storageKeys:(t||[]).map((t,r)=>(32!==(0,a.E1)(t)&&Q.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase()))}}function eo(e){if(Array.isArray(e))return e.map((e,t)=>Array.isArray(e)?(e.length>2&&Q.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),es(e[0],e[1])):es(e.address,e.storageKeys));let t=Object.keys(e).map(t=>{let r=e[t].reduce((e,t)=>(e[t]=!0,e),{});return es(t,Object.keys(r).sort())});return t.sort((e,t)=>e.address.localeCompare(t.address)),t}function ea(e){return eo(e).map(e=>[e.address,e.storageKeys])}function el(e,t){if(null!=e.gasPrice){let t=o.O$.from(e.gasPrice),r=o.O$.from(e.maxFeePerGas||0);t.eq(r)||Q.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}let r=[ei(e.chainId||0,"chainId"),ei(e.nonce||0,"nonce"),ei(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),ei(e.maxFeePerGas||0,"maxFeePerGas"),ei(e.gasLimit||0,"gasLimit"),null!=e.to?(0,s.Kn)(e.to):"0x",ei(e.value||0,"value"),e.data||"0x",ea(e.accessList||[])];if(t){let e=(0,a.N)(t);r.push(ei(e.recoveryParam,"recoveryParam")),r.push((0,a.G1)(e.r)),r.push((0,a.G1)(e.s))}return(0,a.xs)(["0x02",d.c(r)])}function eu(e,t){let r=[ei(e.chainId||0,"chainId"),ei(e.nonce||0,"nonce"),ei(e.gasPrice||0,"gasPrice"),ei(e.gasLimit||0,"gasLimit"),null!=e.to?(0,s.Kn)(e.to):"0x",ei(e.value||0,"value"),e.data||"0x",ea(e.accessList||[])];if(t){let e=(0,a.N)(t);r.push(ei(e.recoveryParam,"recoveryParam")),r.push((0,a.G1)(e.r)),r.push((0,a.G1)(e.s))}return(0,a.xs)(["0x01",d.c(r)])}function ec(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Q.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){(0,c.uj)(e,er);let r=[];et.forEach(function(t){let n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=(0,a.lE)((0,a.Dv)(n,i)),t.length&&n.length!==t.length&&n.length>0&&Q.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=(0,a.G1)(n)).length>t.maxLength&&Q.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push((0,a.Dv)(n))});let n=0;if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&Q.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!(0,a.Zq)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push((0,a.Dv)(n)),r.push("0x"),r.push("0x")),!t)return d.c(r);let i=(0,a.N)(t),s=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),s+=2*n+8,i.v>28&&i.v!==s&&Q.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==s&&Q.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push((0,a.Dv)(s)),r.push((0,a.G1)((0,a.lE)(i.r))),r.push((0,a.G1)((0,a.lE)(i.s))),d.c(r)}(e,t);switch(e.type){case 1:return eu(e,t);case 2:return el(e,t)}return Q.throwError(`unsupported transaction type: ${e.type}`,V.Yd.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function ed(e,t,r){try{let r=ee(t[0]).toNumber();if(0!==r&&1!==r)throw Error("bad recid");e.v=r}catch(e){Q.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=(0,a.$m)(t[1],32),e.s=(0,a.$m)(t[2],32);try{let t=(0,u.w)(r(e));e.from=en(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function eh(e){let t=(0,a.lE)(e);if(t[0]>127)return function(e){let t=d.J(e);9!==t.length&&6!==t.length&&Q.throwArgumentError("invalid raw transaction","rawTransaction",e);let r={nonce:ee(t[0]).toNumber(),gasPrice:ee(t[1]),gasLimit:ee(t[2]),to:X(t[3]),value:ee(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=o.O$.from(t[6]).toNumber()}catch(e){return r}if(r.r=(0,a.$m)(t[7],32),r.s=(0,a.$m)(t[8],32),o.O$.from(r.r).isZero()&&o.O$.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push((0,a.Dv)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);let s=(0,u.w)(d.c(i));try{r.from=en(s,{r:(0,a.Dv)(r.r),s:(0,a.Dv)(r.s),recoveryParam:n})}catch(e){}r.hash=(0,u.w)(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){let t=d.J(e.slice(1));8!==t.length&&11!==t.length&&Q.throwArgumentError("invalid component count for transaction type: 1","payload",(0,a.Dv)(e));let r={type:1,chainId:ee(t[0]).toNumber(),nonce:ee(t[1]).toNumber(),gasPrice:ee(t[2]),gasLimit:ee(t[3]),to:X(t[4]),value:ee(t[5]),data:t[6],accessList:eo(t[7])};return 8===t.length||(r.hash=(0,u.w)(e),ed(r,t.slice(8),eu)),r}(t);case 2:return function(e){let t=d.J(e.slice(1));9!==t.length&&12!==t.length&&Q.throwArgumentError("invalid component count for transaction type: 2","payload",(0,a.Dv)(e));let r=ee(t[2]),n=ee(t[3]),i={type:2,chainId:ee(t[0]).toNumber(),nonce:ee(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:ee(t[4]),to:X(t[5]),value:ee(t[6]),data:t[7],accessList:eo(t[8])};return 9===t.length||(i.hash=(0,u.w)(e),ed(i,t.slice(9),el)),i}(t)}return Q.throwError(`unsupported transaction type: ${t[0]}`,V.Yd.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}},58789:function(e,t,r){"use strict";r.d(t,{dF:function(){return x},bM:function(){return E},fi:function(){return k},vz:function(){return A}});var n=r(9784),i=r(13421),s=r(38418),o=r(22594);let a=new i.Yd(s.i),l={},u=o.O$.from(0),c=o.O$.from(-1);function d(e,t,r,n){let s={fault:t,operation:r};return void 0!==n&&(s.value=n),a.throwError(e,i.Yd.errors.NUMERIC_FAULT,s)}let h="0";for(;h.length<256;)h+=h;function f(e){if("number"!=typeof e)try{e=o.O$.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+h.substring(0,e):a.throwArgumentError("invalid decimal size","decimals",e)}function p(e,t){null==t&&(t=0);let r=f(t),n=(e=o.O$.from(e)).lt(u);n&&(e=e.mul(c));let i=e.mod(r).toString();for(;i.length2&&a.throwArgumentError("too many decimal points","value",e);let s=i[0],l=i[1];for(s||(s="0"),l||(l="0");"0"===l[l.length-1];)l=l.substring(0,l.length-1);for(l.length>r.length-1&&d("fractional component exceeds decimals","underflow","parseFixed"),""===l&&(l="0");l.lengthnull==e[t]?n:(typeof e[t]!==r&&a.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&a.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&a.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new m(l,t,r,n)}}class y{constructor(e,t,r,n){e!==l&&a.throwError("cannot use FixedNumber constructor; use FixedNumber.from",i.Yd.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&a.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);let t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);let t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);let t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);let t=g(this._value,this.format.decimals),r=g(e._value,e.format.decimals);return y.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(b.toFormat(t.format))),t}ceiling(){let e=this.toString().split(".");1===e.length&&e.push("0");let t=y.from(e[0],this.format),r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(b.toFormat(t.format))),t}round(e){null==e&&(e=0);let t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&a.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;let r=y.from("1"+h.substring(0,e),this.format),n=v.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&a.throwArgumentError("invalid byte width","width",e);let t=o.O$.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return(0,n.$m)(t,e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return y.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||(0,o.Zm)(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),y.fromString(p(e,t),m.from(r))}static fromString(e,t){null==t&&(t="fixed");let r=m.from(t),i=g(e,r.decimals);!r.signed&&i.lt(u)&&d("unsigned value cannot be negative","overflow","value",e);let s=null;return r.signed?s=i.toTwos(r.width).toHexString():(s=i.toHexString(),s=(0,n.$m)(s,r.width/8)),new y(l,s,p(i,r.decimals),r)}static fromBytes(e,t){null==t&&(t="fixed");let r=m.from(t);if((0,n.lE)(e).length>r.width/8)throw Error("overflow");let i=o.O$.from(e);return r.signed&&(i=i.fromTwos(r.width)),new y(l,i.toTwos((r.signed?0:1)+r.width).toHexString(),p(i,r.decimals),r)}static from(e,t){if("string"==typeof e)return y.fromString(e,t);if((0,n._t)(e))return y.fromBytes(e,t);try{return y.fromValue(e,0,t)}catch(e){if(e.code!==i.Yd.errors.INVALID_ARGUMENT)throw e}return a.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!!(e&&e._isFixedNumber)}}let b=y.from(1),v=y.from("0.5"),w=new i.Yd("units/5.7.0"),_=["wei","kwei","mwei","gwei","szabo","finney","ether"];function E(e,t){if("string"==typeof t){let e=_.indexOf(t);-1!==e&&(t=3*e)}return p(e,null!=t?t:18)}function A(e,t){if("string"!=typeof e&&w.throwArgumentError("value must be a string","value",e),"string"==typeof t){let e=_.indexOf(t);-1!==e&&(t=3*e)}return g(e,null!=t?t:18)}function x(e){return E(e,18)}function k(e){return A(e,18)}},3754:function(e,t,r){"use strict";var n,i;r.d(t,{GR:function(){return l},M_:function(){return a}}),(i=n||(n={})).MISSING_OR_INVALID_PRIVY_APP_ID="missing_or_invalid_privy_app_id",i.MISSING_OR_INVALID_PRIVY_ACCOUNT_ID="missing_or_invalid_privy_account_id",i.INVALID_DATA="invalid_data",i.LINKED_TO_ANOTHER_USER="linked_to_another_user",i.ALLOWLIST_REJECTED="allowlist_rejected",i.OAUTH_USER_DENIED="oauth_user_denied",i.UNKNOWN_AUTH_ERROR="unknown_auth_error",i.USER_EXITED_AUTH_FLOW="exited_auth_flow",i.MUST_BE_AUTHENTICATED="must_be_authenticated",i.UNKNOWN_CONNECT_WALLET_ERROR="unknown_connect_wallet_error",i.GENERIC_CONNECT_WALLET_ERROR="generic_connect_wallet_error",i.CLIENT_REQUEST_TIMEOUT="client_request_timeout",i.INVALID_CREDENTIALS="invalid_credentials";class s extends Error{cause;privyErrorCode;constructor(e,t,r){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=r}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}}class o extends s{type="provider_error";code;data;constructor(e,t,r){super(e),this.code=t,this.data=r}}let a={UNKNOWN_ERROR:{eipCode:0,message:"Unknown error",detail:"Unknown error",retryable:!0},E4001_DEFAULT_USER_REJECTED_REQUEST:{eipCode:4001,message:"User Rejected Request",detail:"The user rejected the request.",default:!0,retryable:!0},E4100_DEFAULT_UNAUTHORIZED:{eipCode:4100,message:"Unauthorized",detail:"The requested method and/or account has not been authorized by the user.",default:!0,retryable:!1},E4200_DEFAULT_UNSUPPORTED_METHOD:{eipCode:4200,message:"Unsupported Method",detail:"The Provider does not support the requested method.",default:!0,retryable:!1},E4900_DEFAULT_DISCONNECTED:{eipCode:4900,message:"Disconnected",detail:"The Provider is disconnected from all chains.",default:!0,retryable:!0},E4901_DEFAULT_CHAIN_DISCONNECTED:{eipCode:4901,message:"Chain Disconnected",detail:"The Provider is not connected to the requested chain.",default:!0,retryable:!0},E32700_DEFAULT_PARSE_ERROR:{eipCode:-32700,message:"Parse error",detail:"Invalid JSON",default:!0,retryable:!1},E32600_DEFAULT_INVALID_REQUEST:{eipCode:-32600,message:"Invalid request",detail:"JSON is not a valid request object",default:!0,retryable:!1},E32601_DEFAULT_METHOD_NOT_FOUND:{eipCode:-32601,message:"Method not found",detail:"Method does not exist",default:!0,retryable:!1},E32602_DEFAULT_INVALID_PARAMS:{eipCode:-32602,message:"Invalid params",detail:"Invalid method parameters",default:!0,retryable:!1},E32603_DEFAULT_INTERNAL_ERROR:{eipCode:-32603,message:"Internal error",detail:"Internal JSON-RPC error",default:!0,retryable:!0},E32000_DEFAULT_INVALID_INPUT:{eipCode:-32e3,message:"Invalid input",detail:"Missing or invalid parameters",default:!0,retryable:!1},E32001_DEFAULT_RESOURCE_NOT_FOUND:{eipCode:-32001,message:"Resource not found",detail:"Requested resource not found",default:!0,retryable:!1},E32002_DEFAULT_RESOURCE_UNAVAILABLE:{eipCode:-32002,message:"Resource unavailable",detail:"Requested resource not available",default:!0,retryable:!0},E32003_DEFAULT_TRANSACTION_REJECTED:{eipCode:-32003,message:"Transaction rejected",detail:"Transaction creation failed",default:!0,retryable:!0},E32004_DEFAULT_METHOD_NOT_SUPPORTED:{eipCode:-32004,message:"Method not supported",detail:"Method is not implemented",default:!0,retryable:!1},E32005_DEFAULT_LIMIT_EXCEEDED:{eipCode:-32005,message:"Limit exceeded",detail:"Request exceeds defined limit",default:!0,retryable:!1},E32006_DEFAULT_JSON_RPC_VERSION_NOT_SUPPORTED:{eipCode:-32006,message:"JSON-RPC version not supported",detail:"Version of JSON-RPC protocol is not supported",default:!0,retryable:!1},E32002_CONNECTION_ALREADY_PENDING:{eipCode:-32002,message:"Connection request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_REQUEST_ALREADY_PENDING:{eipCode:-32002,message:"Resource request already pending",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E32002_WALLET_LOCKED:{eipCode:-32002,message:"Wallet might be locked",detail:"Don’t see your wallet? Check your other browser windows.",retryable:!1},E4001_USER_REJECTED_REQUEST:{eipCode:4001,message:"Signature rejected",detail:"Please try signing again.",retryable:!0}};class l extends o{details;constructor(e){super(e.message,e.code,e.data);let t=Object.values(a).find(t=>t.eipCode===e.code);this.details=t||a.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=a.E32002_CONNECTION_ALREADY_PENDING:this.details=a.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=a.E32002_WALLET_LOCKED))}}},81318:function(e,t,r){"use strict";r.d(t,{no:function(){return u},t_:function(){return c},OW:function(){return l}});var n=r(22594),i=r(22554),s=r(2149),o=r(50607);let a=["function getL1Fee(bytes memory _data) external view returns (uint256)"],l=e=>[8453,84531,84532,10,420,11155420,7777777,999,999999999,81457,168587773].includes(e),u=async(e,t)=>{if(!l(e.chainId))throw Error("Invalid chain ID for OP Stack gas estimation.");if(void 0===e.type&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas||e.gasPrice)return e;try{if(!e.maxPriorityFeePerGas){let r=await t.send("eth_maxPriorityFeePerGas",[]);e.maxPriorityFeePerGas=r}if(e.maxFeePerGas&&(console.warn("maxFeePerGas is specified without maxPriorityFeePerGas - this can result in hung transactions."),e.maxPriorityFeePerGas>=e.maxFeePerGas))throw Error("Overridden maxFeePerGas is less than or equal to the calculated maxPriorityFeePerGas. Please set both values or maxPriorityFeePerGas alone for correct gas estimation.");if(!e.maxFeePerGas){let{lastBaseFeePerGas:r}=await t.getFeeData();if(!r)throw Error("Unable to fetch baseFee for last block.");let i=n.O$.from(r).mul(n.O$.from(126)).div(n.O$.from(100)).add(n.O$.from(e.maxPriorityFeePerGas));e.maxFeePerGas=(0,o.L5)(i)}}catch(e){throw Error(`Failed to set gas price for OP stack transaction: ${e}.`)}return e};async function c(e,t){if(!e.chainId||e.chainId&&!l(e.chainId))return n.O$.from(0);let r=n.O$.from(0);try{let n=new i.CH("0x420000000000000000000000000000000000000F",a,t),l=(0,o.mv)(e),u=(0,s.qC)(l);r=await n.getL1Fee(u)}catch(e){}return r}},50607:function(e,t,r){"use strict";r.d(t,{L5:function(){return s},mv:function(){return o},uq:function(){return i}});var n=r(22594);let i=e=>n.O$.from(e);function s(e){if("number"==typeof e||"bigint"==typeof e||"string"==typeof e)return e;if("function"==typeof e.toHexString)return e.toHexString();throw Error(`Expected numeric value but received ${e}`)}function o(e){let t={};return void 0!==e.to&&(t.to=e.to),void 0!==e.data&&(t.data=e.data),void 0!==e.chainId&&(t.chainId=e.chainId),void 0!==e.type&&(t.type=e.type),void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.nonce&&(t.nonce=i(e.nonce).toNumber()),void 0!==e.gasLimit&&(t.gasLimit=i(e.gasLimit)),void 0!==e.gasPrice&&(t.gasPrice=i(e.gasPrice)),void 0!==e.value&&(t.value=i(e.value)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=i(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=i(e.maxPriorityFeePerGas)),t}},37786:function(e,t,r){"use strict";r.d(t,{Fj:function(){return a},_7:function(){return u},gM:function(){return l}});var n=r(22594),i=r(3754),s=r(81318),o=r(50607);let a=async(e,t)=>{if(void 0===e.type&&(e.type=2),2===e.type){if(!e.maxFeePerGas||!e.maxPriorityFeePerGas){let r=await t.getFeeData();e.maxFeePerGas||(e.maxFeePerGas=r.maxFeePerGas?.toHexString()),e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=r.maxPriorityFeePerGas?.toHexString())}}else if(!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};async function l(e,t){if(!e.gasLimit)throw new i.GR("gasLimit was not successfully set for transaction.");let r=(0,o.uq)(e.gasLimit),a=n.O$.from(0);if(2==e.type){if(!e.maxFeePerGas)throw new i.GR("maxFeePerGas was not successfully set for transaction of type 2.");a=(0,o.uq)(e.maxFeePerGas)}else{if(!e.gasPrice)throw new i.GR("gasPrice was not successfully set for transaction of type 0 or 1.");a=(0,o.uq)(e.gasPrice)}let l=r.mul(a),u=n.O$.from(0);if(e.chainId&&(0,s.OW)(e.chainId))try{u=await (0,s.t_)(e,t),l=l.add(u)}catch(e){}return{totalGasEstimate:l,l1ExecutionFeeEstimate:u}}async function u(e,t){try{return(await t.estimateGas(e)).toHexString()}catch(r){console.warn(`Gas estimation failed with error: ${r}. Retrying gas estimation by omitting the 'from' address`);try{let r={...e,from:void 0};return(await t.estimateGas(r)).toHexString()}catch(e){throw console.warn(`Gas estimation failed with error: ${e} when omitting the 'from' address`),r}}}},58118:function(e,t,r){"use strict";r.d(t,{vT:function(){return x}});var n=r(37637),i=r(22594),s=r(50607);let o=e=>[42161,421613,421614].includes(e),a=async(e,t)=>{if(!o(e.chainId))throw Error("Invalid chain ID for Arbitrum gas estimation.");if(void 0===e.type&&(e.type=2),e.maxFeePerGas)return e;try{let{lastBaseFeePerGas:r}=await t.getFeeData();if(r){let t=r.mul(i.O$.from(120)).div(i.O$.from(100));e.maxFeePerGas=(0,s.L5)(t),e.maxPriorityFeePerGas=(0,s.L5)(i.O$.from(0))}}catch(e){throw Error(`Failed to set gas price for Arbitrum transaction: ${e}.`)}return e},l=e=>[56,97].includes(e),u=async(e,t)=>{if(!l(e.chainId))throw Error("Invalid chain ID for BSC gas estimation.");if(void 0===e.type?e.type=0:1!=e.type&&2!=e.type||console.warn("Transaction request type specified is incompatible for chain and will result in undefined behavior. Please use transaction type 0."),!e.gasPrice){let r=await t.getFeeData();e.gasPrice=r.gasPrice?.toHexString()}return e};var c=r(81318),d=r(58789),h=r(27695),f=r.n(h);let p={id:137},g={id:80002},m={id:80001},y=f()(fetch,{retries:3,retryDelay:500}),b=e=>[p.id,m.id,g.id].includes(e),v=e=>({maxPriorityFee:(0,d.vz)(e.maxPriorityFee.toFixed(9),"gwei").toHexString(),maxFee:(0,d.vz)(e.maxFee.toFixed(9),"gwei").toHexString()}),w=async e=>{let t="";switch(e){case p.id:t="https://gasstation.polygon.technology/v2";break;case m.id:t="https://gasstation-testnet.polygon.technology/v2";break;case g.id:t="https://gasstation.polygon.technology/amoy";break;default:throw Error(`chainId ${e} does not support polygon gas stations`)}let r=await y(t),n=await r.json();if(r.status>399)throw n;return{safeLow:v(n.safeLow),standard:v(n.standard),fast:v(n.fast)}};async function _(e){if(!b(e.chainId))throw Error("Invalid chain ID for Polygon gas estimation.");if(void 0===e.type&&(e.type=2),e.maxPriorityFeePerGas&&e.maxFeePerGas)return e;try{let{standard:t}=await w(e.chainId);e.maxPriorityFeePerGas||(e.maxPriorityFeePerGas=t.maxPriorityFee),e.maxFeePerGas||(e.maxFeePerGas=t.maxFee)}catch(e){throw Error(`Failed to set gas prices from Polygon gas station with error: ${e}.`)}return e}var E=r(37786);function A(e){return/^-?0x[a-f0-9]+$/i.test(e)}async function x(e,t,r){if(t.chainId=Number(t.chainId),function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(void 0!==r&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&A(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(t),t.from||(t.from=e),!t.nonce){let i=new n.b(e,r);t.nonce=await i.getTransactionCount("pending")}return t.gasLimit||(t.gas?(t.gasLimit=t.gas,delete t.gas):t.gasLimit=await (0,E._7)(t,r)),"string"==typeof t.type&&A(t.type)&&(t.type=Number(t.type)),[23294,23295].includes(t.chainId)&&(t.type=0),0===(t=b(t.chainId)?await _(t):o(t.chainId)?await a(t,r):(0,c.OW)(t.chainId)?await (0,c.no)(t,r):l(t.chainId)?await u(t,r):await (0,E.Fj)(t,r)).type&&delete t.accessList,2!==t.type&&(delete t.maxPriorityFeePerGas,delete t.maxFeePerGas),t}},59488:function(e,t,r){"use strict";r.d(t,{W:function(){return n}});let n=(e,t=!0)=>e.reduce((e,r)=>({...e,[r]:t}),{})},18615:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(24986);function i(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>8,t[r+1]=e>>>0,t}function s(e,t,r){return void 0===t&&(t=new Uint8Array(2)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t}function o(e,t){return void 0===t&&(t=0),e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3]}function a(e,t){return void 0===t&&(t=0),(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}function l(e,t){return void 0===t&&(t=0),e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t]}function u(e,t){return void 0===t&&(t=0),(e[t+3]<<24|e[t+2]<<16|e[t+1]<<8|e[t])>>>0}function c(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>24,t[r+1]=e>>>16,t[r+2]=e>>>8,t[r+3]=e>>>0,t}function d(e,t,r){return void 0===t&&(t=new Uint8Array(4)),void 0===r&&(r=0),t[r+0]=e>>>0,t[r+1]=e>>>8,t[r+2]=e>>>16,t[r+3]=e>>>24,t}function h(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),c(e/4294967296>>>0,t,r),c(e>>>0,t,r+4),t}function f(e,t,r){return void 0===t&&(t=new Uint8Array(8)),void 0===r&&(r=0),d(e>>>0,t,r),d(e/4294967296>>>0,t,r+4),t}t.readInt16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])<<16>>16},t.readUint16BE=function(e,t){return void 0===t&&(t=0),(e[t+0]<<8|e[t+1])>>>0},t.readInt16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])<<16>>16},t.readUint16LE=function(e,t){return void 0===t&&(t=0),(e[t+1]<<8|e[t])>>>0},t.writeUint16BE=i,t.writeInt16BE=i,t.writeUint16LE=s,t.writeInt16LE=s,t.readInt32BE=o,t.readUint32BE=a,t.readInt32LE=l,t.readUint32LE=u,t.writeUint32BE=c,t.writeInt32BE=c,t.writeUint32LE=d,t.writeInt32LE=d,t.readInt64BE=function(e,t){void 0===t&&(t=0);var r=o(e,t),n=o(e,t+4);return 4294967296*r+n-(n>>31)*4294967296},t.readUint64BE=function(e,t){return void 0===t&&(t=0),4294967296*a(e,t)+a(e,t+4)},t.readInt64LE=function(e,t){void 0===t&&(t=0);var r=l(e,t);return 4294967296*l(e,t+4)+r-(r>>31)*4294967296},t.readUint64LE=function(e,t){void 0===t&&(t=0);var r=u(e,t);return 4294967296*u(e,t+4)+r},t.writeUint64BE=h,t.writeInt64BE=h,t.writeUint64LE=f,t.writeInt64LE=f,t.readUintBE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintBE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintBE: array is too short for the given bitLength");for(var n=0,i=1,s=e/8+r-1;s>=r;s--)n+=t[s]*i,i*=256;return n},t.readUintLE=function(e,t,r){if(void 0===r&&(r=0),e%8!=0)throw Error("readUintLE supports only bitLengths divisible by 8");if(e/8>t.length-r)throw Error("readUintLE: array is too short for the given bitLength");for(var n=0,i=1,s=r;s=i;o--)r[o]=t/s&255,s*=256;return r},t.writeUintLE=function(e,t,r,i){if(void 0===r&&(r=new Uint8Array(e/8)),void 0===i&&(i=0),e%8!=0)throw Error("writeUintLE supports only bitLengths divisible by 8");if(!n.isSafeInteger(t))throw Error("writeUintLE value must be an integer");for(var s=1,o=i;o16)throw Error("ChaCha20Poly1305: incorrect nonce length");var o,a=new Uint8Array(16);a.set(e,a.length-e.length);var l=new Uint8Array(32);n.stream(this._key,a,l,4);var u=t.length+this.tagLength;if(i){if(i.length!==u)throw Error("ChaCha20Poly1305: incorrect destination length");o=i}else o=new Uint8Array(u);return n.streamXOR(this._key,a,t,o,4),this._authenticate(o.subarray(o.length-this.tagLength,o.length),l,o.subarray(0,o.length-this.tagLength),r),s.wipe(a),o},e.prototype.open=function(e,t,r,i){if(e.length>16)throw Error("ChaCha20Poly1305: incorrect nonce length");if(t.length0&&a.update(l.subarray(n.length%16))),a.update(r),r.length%16>0&&a.update(l.subarray(r.length%16));var u=new Uint8Array(8);n&&o.writeUint64LE(n.length,u),a.update(u),o.writeUint64LE(r.length,u),a.update(u);for(var c=a.digest(),d=0;d>>16|C<<16)|0,w=w>>>20|w<<12,P^=y=y+_|0,_^=k=k+(P=P>>>16|P<<16)|0,_=_>>>20|_<<12,I^=b=b+E|0,E^=S=S+(I=I>>>16|I<<16)|0,E=E>>>20|E<<12,O^=v=v+A|0,A^=$=$+(O=O>>>16|O<<16)|0,A=A>>>20|A<<12,I^=b=b+E|0,E^=S=S+(I=I>>>24|I<<8)|0,E=E>>>25|E<<7,O^=v=v+A|0,A^=$=$+(O=O>>>24|O<<8)|0,A=A>>>25|A<<7,P^=y=y+_|0,_^=k=k+(P=P>>>24|P<<8)|0,_=_>>>25|_<<7,C^=m=m+w|0,w^=x=x+(C=C>>>24|C<<8)|0,w=w>>>25|w<<7,O^=m=m+_|0,_^=S=S+(O=O>>>16|O<<16)|0,_=_>>>20|_<<12,C^=y=y+E|0,E^=$=$+(C=C>>>16|C<<16)|0,E=E>>>20|E<<12,P^=b=b+A|0,A^=x=x+(P=P>>>16|P<<16)|0,A=A>>>20|A<<12,I^=v=v+w|0,w^=k=k+(I=I>>>16|I<<16)|0,w=w>>>20|w<<12,P^=b=b+A|0,A^=x=x+(P=P>>>24|P<<8)|0,A=A>>>25|A<<7,I^=v=v+w|0,w^=k=k+(I=I>>>24|I<<8)|0,w=w>>>25|w<<7,C^=y=y+E|0,E^=$=$+(C=C>>>24|C<<8)|0,E=E>>>25|E<<7,O^=m=m+_|0,_^=S=S+(O=O>>>24|O<<8)|0,_=_>>>25|_<<7;n.writeUint32LE(m+1634760805|0,e,0),n.writeUint32LE(y+857760878|0,e,4),n.writeUint32LE(b+2036477234|0,e,8),n.writeUint32LE(v+1797285236|0,e,12),n.writeUint32LE(w+i|0,e,16),n.writeUint32LE(_+s|0,e,20),n.writeUint32LE(E+o|0,e,24),n.writeUint32LE(A+a|0,e,28),n.writeUint32LE(x+l|0,e,32),n.writeUint32LE(k+u|0,e,36),n.writeUint32LE(S+c|0,e,40),n.writeUint32LE($+d|0,e,44),n.writeUint32LE(C+h|0,e,48),n.writeUint32LE(P+f|0,e,52),n.writeUint32LE(I+p|0,e,56),n.writeUint32LE(O+g|0,e,60)}(u,a,e);for(var d=c;d>>=8,t++;if(n>0)throw Error("ChaCha: counter overflow")}(a,0,l)}return i.wipe(u),0===o&&i.wipe(a),s}t.streamXOR=s,t.stream=function(e,t,r,n){return void 0===n&&(n=0),i.wipe(r),s(e,t,r,r,n)}},21346:function(e,t){"use strict";function r(e,t){if(e.length!==t.length)return 0;for(var r=0,n=0;n>>8}Object.defineProperty(t,"__esModule",{value:!0}),t.select=function(e,t,r){return~(e-1)&t|e-1&r},t.lessOrEqual=function(e,t){return(0|e)-(0|t)-1>>>31&1},t.compare=r,t.equal=function(e,t){return 0!==e.length&&0!==t.length&&0!==r(e,t)}},59271:function(e,t,r){"use strict";t.Xx=t._w=t.aP=t.KS=t.jQ=void 0,r(24861);let n=r(13033);function i(e){let t=new Float64Array(16);if(e)for(let r=0;r>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,h(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}i([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function p(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]+r[n]}function g(e,t,r){for(let n=0;n<16;n++)e[n]=t[n]-r[n]}function m(e,t,r){let n,i,s=0,o=0,a=0,l=0,u=0,c=0,d=0,h=0,f=0,p=0,g=0,m=0,y=0,b=0,v=0,w=0,_=0,E=0,A=0,x=0,k=0,S=0,$=0,C=0,P=0,I=0,O=0,N=0,M=0,R=0,T=0,D=r[0],L=r[1],j=r[2],B=r[3],F=r[4],U=r[5],z=r[6],q=r[7],H=r[8],G=r[9],V=r[10],W=r[11],K=r[12],Y=r[13],Z=r[14],J=r[15];s+=(n=t[0])*D,o+=n*L,a+=n*j,l+=n*B,u+=n*F,c+=n*U,d+=n*z,h+=n*q,f+=n*H,p+=n*G,g+=n*V,m+=n*W,y+=n*K,b+=n*Y,v+=n*Z,w+=n*J,o+=(n=t[1])*D,a+=n*L,l+=n*j,u+=n*B,c+=n*F,d+=n*U,h+=n*z,f+=n*q,p+=n*H,g+=n*G,m+=n*V,y+=n*W,b+=n*K,v+=n*Y,w+=n*Z,_+=n*J,a+=(n=t[2])*D,l+=n*L,u+=n*j,c+=n*B,d+=n*F,h+=n*U,f+=n*z,p+=n*q,g+=n*H,m+=n*G,y+=n*V,b+=n*W,v+=n*K,w+=n*Y,_+=n*Z,E+=n*J,l+=(n=t[3])*D,u+=n*L,c+=n*j,d+=n*B,h+=n*F,f+=n*U,p+=n*z,g+=n*q,m+=n*H,y+=n*G,b+=n*V,v+=n*W,w+=n*K,_+=n*Y,E+=n*Z,A+=n*J,u+=(n=t[4])*D,c+=n*L,d+=n*j,h+=n*B,f+=n*F,p+=n*U,g+=n*z,m+=n*q,y+=n*H,b+=n*G,v+=n*V,w+=n*W,_+=n*K,E+=n*Y,A+=n*Z,x+=n*J,c+=(n=t[5])*D,d+=n*L,h+=n*j,f+=n*B,p+=n*F,g+=n*U,m+=n*z,y+=n*q,b+=n*H,v+=n*G,w+=n*V,_+=n*W,E+=n*K,A+=n*Y,x+=n*Z,k+=n*J,d+=(n=t[6])*D,h+=n*L,f+=n*j,p+=n*B,g+=n*F,m+=n*U,y+=n*z,b+=n*q,v+=n*H,w+=n*G,_+=n*V,E+=n*W,A+=n*K,x+=n*Y,k+=n*Z,S+=n*J,h+=(n=t[7])*D,f+=n*L,p+=n*j,g+=n*B,m+=n*F,y+=n*U,b+=n*z,v+=n*q,w+=n*H,_+=n*G,E+=n*V,A+=n*W,x+=n*K,k+=n*Y,S+=n*Z,$+=n*J,f+=(n=t[8])*D,p+=n*L,g+=n*j,m+=n*B,y+=n*F,b+=n*U,v+=n*z,w+=n*q,_+=n*H,E+=n*G,A+=n*V,x+=n*W,k+=n*K,S+=n*Y,$+=n*Z,C+=n*J,p+=(n=t[9])*D,g+=n*L,m+=n*j,y+=n*B,b+=n*F,v+=n*U,w+=n*z,_+=n*q,E+=n*H,A+=n*G,x+=n*V,k+=n*W,S+=n*K,$+=n*Y,C+=n*Z,P+=n*J,g+=(n=t[10])*D,m+=n*L,y+=n*j,b+=n*B,v+=n*F,w+=n*U,_+=n*z,E+=n*q,A+=n*H,x+=n*G,k+=n*V,S+=n*W,$+=n*K,C+=n*Y,P+=n*Z,I+=n*J,m+=(n=t[11])*D,y+=n*L,b+=n*j,v+=n*B,w+=n*F,_+=n*U,E+=n*z,A+=n*q,x+=n*H,k+=n*G,S+=n*V,$+=n*W,C+=n*K,P+=n*Y,I+=n*Z,O+=n*J,y+=(n=t[12])*D,b+=n*L,v+=n*j,w+=n*B,_+=n*F,E+=n*U,A+=n*z,x+=n*q,k+=n*H,S+=n*G,$+=n*V,C+=n*W,P+=n*K,I+=n*Y,O+=n*Z,N+=n*J,b+=(n=t[13])*D,v+=n*L,w+=n*j,_+=n*B,E+=n*F,A+=n*U,x+=n*z,k+=n*q,S+=n*H,$+=n*G,C+=n*V,P+=n*W,I+=n*K,O+=n*Y,N+=n*Z,M+=n*J,v+=(n=t[14])*D,w+=n*L,_+=n*j,E+=n*B,A+=n*F,x+=n*U,k+=n*z,S+=n*q,$+=n*H,C+=n*G,P+=n*V,I+=n*W,O+=n*K,N+=n*Y,M+=n*Z,R+=n*J,w+=(n=t[15])*D,_+=n*L,E+=n*j,A+=n*B,x+=n*F,k+=n*U,S+=n*z,$+=n*q,C+=n*H,P+=n*G,I+=n*V,O+=n*W,N+=n*K,M+=n*Y,R+=n*Z,T+=n*J,s+=38*_,o+=38*E,a+=38*A,l+=38*x,u+=38*k,c+=38*S,d+=38*$,h+=38*C,f+=38*P,p+=38*I,g+=38*O,m+=38*N,y+=38*M,b+=38*R,v+=38*T,i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=w+i+65535)/65536),w=n-65536*i,s+=i-1+37*(i-1),i=Math.floor((n=s+(i=1)+65535)/65536),s=n-65536*i,i=Math.floor((n=o+i+65535)/65536),o=n-65536*i,i=Math.floor((n=a+i+65535)/65536),a=n-65536*i,i=Math.floor((n=l+i+65535)/65536),l=n-65536*i,i=Math.floor((n=u+i+65535)/65536),u=n-65536*i,i=Math.floor((n=c+i+65535)/65536),c=n-65536*i,i=Math.floor((n=d+i+65535)/65536),d=n-65536*i,i=Math.floor((n=h+i+65535)/65536),h=n-65536*i,i=Math.floor((n=f+i+65535)/65536),f=n-65536*i,i=Math.floor((n=p+i+65535)/65536),p=n-65536*i,i=Math.floor((n=g+i+65535)/65536),g=n-65536*i,i=Math.floor((n=m+i+65535)/65536),m=n-65536*i,i=Math.floor((n=y+i+65535)/65536),y=n-65536*i,i=Math.floor((n=b+i+65535)/65536),b=n-65536*i,i=Math.floor((n=v+i+65535)/65536),v=n-65536*i,i=Math.floor((n=w+i+65535)/65536),w=n-65536*i,s+=i-1+37*(i-1),e[0]=s,e[1]=o,e[2]=a,e[3]=l,e[4]=u,e[5]=c,e[6]=d,e[7]=h,e[8]=f,e[9]=p,e[10]=g,e[11]=m,e[12]=y,e[13]=b,e[14]=v,e[15]=w}function y(e,t){let r=i(),n=i(),s=i(),o=i(),l=i(),u=i(),c=i(),d=i(),h=i();g(r,e[1],e[0]),g(h,t[1],t[0]),m(r,r,h),p(n,e[0],e[1]),p(h,t[0],t[1]),m(n,n,h),m(s,e[3],t[3]),m(s,s,a),m(o,e[2],t[2]),p(o,o,o),g(l,n,r),g(u,o,s),p(c,o,s),p(d,n,r),m(e[0],l,u),m(e[1],d,c),m(e[2],c,u),m(e[3],l,d)}function b(e,t,r){for(let n=0;n<4;n++)h(e[n],t[n],r)}function v(e,t){let r=i(),n=i(),s=i();(function(e,t){let r;let n=i();for(r=0;r<16;r++)n[r]=t[r];for(r=253;r>=0;r--)m(n,n,n),2!==r&&4!==r&&m(n,n,t);for(r=0;r<16;r++)e[r]=n[r]})(s,t[2]),m(r,t[0],s),m(n,t[1],s),f(e,n),e[31]^=function(e){let t=new Uint8Array(32);return f(t,e),1&t[0]}(r)<<7}function w(e,t){let r=[i(),i(),i(),i()];c(r[0],l),c(r[1],u),c(r[2],o),m(r[3],l,u),function(e,t,r){c(e[0],s),c(e[1],o),c(e[2],o),c(e[3],s);for(let n=255;n>=0;--n){let i=r[n/8|0]>>(7&n)&1;b(e,t,i),y(t,e),y(e,e),b(e,t,i)}}(e,r,t)}t._w=function(e){if(e.length!==t.aP)throw Error(`ed25519: seed must be ${t.aP} bytes`);let r=(0,n.hash)(e);r[0]&=248,r[31]&=127,r[31]|=64;let s=new Uint8Array(32),o=[i(),i(),i(),i()];w(o,r),v(s,o);let a=new Uint8Array(64);return a.set(e),a.set(s,32),{publicKey:s,secretKey:a}};let _=new Float64Array([237,211,245,92,26,99,18,88,214,156,247,162,222,249,222,20,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,16]);function E(e,t){let r,n,i,s;for(n=63;n>=32;--n){for(r=0,i=n-32,s=n-12;i>4)*_[i],r=t[i]>>8,t[i]&=255;for(i=0;i<32;i++)t[i]-=r*_[i];for(n=0;n<32;n++)t[n+1]+=t[n]>>8,e[n]=255&t[n]}function A(e){let t=new Float64Array(64);for(let r=0;r<64;r++)t[r]=e[r];for(let t=0;t<64;t++)e[t]=0;E(e,t)}t.Xx=function(e,t){let r=new Float64Array(64),s=[i(),i(),i(),i()],o=(0,n.hash)(e.subarray(0,32));o[0]&=248,o[31]&=127,o[31]|=64;let a=new Uint8Array(64);a.set(o.subarray(32),32);let l=new n.SHA512;l.update(a.subarray(32)),l.update(t);let u=l.digest();l.clean(),A(u),w(s,u),v(a,s),l.reset(),l.update(a.subarray(0,32)),l.update(e.subarray(32)),l.update(t);let c=l.digest();A(c);for(let e=0;e<32;e++)r[e]=u[e];for(let e=0;e<32;e++)for(let t=0;t<32;t++)r[e+t]+=c[e]*o[t];return E(a.subarray(32),r),a}},86784:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isSerializableHash=function(e){return void 0!==e.saveState&&void 0!==e.restoreState&&void 0!==e.cleanSavedState}},67878:function(e,t,r){"use strict";var n=r(4705),i=r(32583),s=function(){function e(e,t,r,i){void 0===r&&(r=new Uint8Array(0)),this._counter=new Uint8Array(1),this._hash=e,this._info=i;var s=n.hmac(this._hash,r,t);this._hmac=new n.HMAC(e,s),this._buffer=new Uint8Array(this._hmac.digestLength),this._bufpos=this._buffer.length}return e.prototype._fillBuffer=function(){this._counter[0]++;var e=this._counter[0];if(0===e)throw Error("hkdf: cannot expand more");this._hmac.reset(),e>1&&this._hmac.update(this._buffer),this._info&&this._hmac.update(this._info),this._hmac.update(this._counter),this._hmac.finish(this._buffer),this._bufpos=0},e.prototype.expand=function(e){for(var t=new Uint8Array(e),r=0;rthis.blockSize?this._inner.update(t).finish(r).clean():r.set(t);for(var i=0;i>>16&65535)*n+r*(t>>>16&65535)<<16>>>0)|0},t.add=function(e,t){return e+t|0},t.sub=function(e,t){return e-t|0},t.rotl=function(e,t){return e<>>32-t},t.rotr=function(e,t){return e<<32-t|e>>>t},t.isInteger=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},t.MAX_SAFE_INTEGER=9007199254740991,t.isSafeInteger=function(e){return t.isInteger(e)&&e>=-t.MAX_SAFE_INTEGER&&e<=t.MAX_SAFE_INTEGER}},14605:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(21346),i=r(32583);t.DIGEST_LENGTH=16;var s=function(){function e(e){this.digestLength=t.DIGEST_LENGTH,this._buffer=new Uint8Array(16),this._r=new Uint16Array(10),this._h=new Uint16Array(10),this._pad=new Uint16Array(8),this._leftover=0,this._fin=0,this._finished=!1;var r=e[0]|e[1]<<8;this._r[0]=8191&r;var n=e[2]|e[3]<<8;this._r[1]=(r>>>13|n<<3)&8191;var i=e[4]|e[5]<<8;this._r[2]=(n>>>10|i<<6)&7939;var s=e[6]|e[7]<<8;this._r[3]=(i>>>7|s<<9)&8191;var o=e[8]|e[9]<<8;this._r[4]=(s>>>4|o<<12)&255,this._r[5]=o>>>1&8190;var a=e[10]|e[11]<<8;this._r[6]=(o>>>14|a<<2)&8191;var l=e[12]|e[13]<<8;this._r[7]=(a>>>11|l<<5)&8065;var u=e[14]|e[15]<<8;this._r[8]=(l>>>8|u<<8)&8191,this._r[9]=u>>>5&127,this._pad[0]=e[16]|e[17]<<8,this._pad[1]=e[18]|e[19]<<8,this._pad[2]=e[20]|e[21]<<8,this._pad[3]=e[22]|e[23]<<8,this._pad[4]=e[24]|e[25]<<8,this._pad[5]=e[26]|e[27]<<8,this._pad[6]=e[28]|e[29]<<8,this._pad[7]=e[30]|e[31]<<8}return e.prototype._blocks=function(e,t,r){for(var n=this._fin?0:2048,i=this._h[0],s=this._h[1],o=this._h[2],a=this._h[3],l=this._h[4],u=this._h[5],c=this._h[6],d=this._h[7],h=this._h[8],f=this._h[9],p=this._r[0],g=this._r[1],m=this._r[2],y=this._r[3],b=this._r[4],v=this._r[5],w=this._r[6],_=this._r[7],E=this._r[8],A=this._r[9];r>=16;){var x,k=e[t+0]|e[t+1]<<8;i+=8191&k;var S=e[t+2]|e[t+3]<<8;s+=(k>>>13|S<<3)&8191;var $=e[t+4]|e[t+5]<<8;o+=(S>>>10|$<<6)&8191;var C=e[t+6]|e[t+7]<<8;a+=($>>>7|C<<9)&8191;var P=e[t+8]|e[t+9]<<8;l+=(C>>>4|P<<12)&8191,u+=P>>>1&8191;var I=e[t+10]|e[t+11]<<8;c+=(P>>>14|I<<2)&8191;var O=e[t+12]|e[t+13]<<8;d+=(I>>>11|O<<5)&8191;var N=e[t+14]|e[t+15]<<8;h+=(O>>>8|N<<8)&8191,f+=N>>>5|n;var M=0;M=(x=0+i*p+5*A*s+5*E*o+5*_*a+5*w*l)>>>13,x&=8191,x+=5*v*u+5*b*c+5*y*d+5*m*h+5*g*f,M+=x>>>13,x&=8191;var R=M;R+=i*g+s*p+5*A*o+5*E*a+5*_*l,M=R>>>13,R&=8191,R+=5*w*u+5*v*c+5*b*d+5*y*h+5*m*f,M+=R>>>13,R&=8191;var T=M;T+=i*m+s*g+o*p+5*A*a+5*E*l,M=T>>>13,T&=8191,T+=5*_*u+5*w*c+5*v*d+5*b*h+5*y*f,M+=T>>>13,T&=8191;var D=M;D+=i*y+s*m+o*g+a*p+5*A*l,M=D>>>13,D&=8191,D+=5*E*u+5*_*c+5*w*d+5*v*h+5*b*f,M+=D>>>13,D&=8191;var L=M;L+=i*b+s*y+o*m+a*g+l*p,M=L>>>13,L&=8191,L+=5*A*u+5*E*c+5*_*d+5*w*h+5*v*f,M+=L>>>13,L&=8191;var j=M;j+=i*v+s*b+o*y+a*m+l*g,M=j>>>13,j&=8191,j+=u*p+5*A*c+5*E*d+5*_*h+5*w*f,M+=j>>>13,j&=8191;var B=M;B+=i*w+s*v+o*b+a*y+l*m,M=B>>>13,B&=8191,B+=u*g+c*p+5*A*d+5*E*h+5*_*f,M+=B>>>13,B&=8191;var F=M;F+=i*_+s*w+o*v+a*b+l*y,M=F>>>13,F&=8191,F+=u*m+c*g+d*p+5*A*h+5*E*f,M+=F>>>13,F&=8191;var U=M;U+=i*E+s*_+o*w+a*v+l*b,M=U>>>13,U&=8191,U+=u*y+c*m+d*g+h*p+5*A*f,M+=U>>>13,U&=8191;var z=M;z+=i*A+s*E+o*_+a*w+l*v,M=z>>>13,z&=8191,z+=u*b+c*y+d*m+h*g+f*p,M+=z>>>13,z&=8191,x=8191&(M=(M=(M<<2)+M|0)+x|0),M>>>=13,R+=M,i=x,s=R,o=T,a=D,l=L,u=j,c=B,d=F,h=U,f=z,t+=16,r-=16}this._h[0]=i,this._h[1]=s,this._h[2]=o,this._h[3]=a,this._h[4]=l,this._h[5]=u,this._h[6]=c,this._h[7]=d,this._h[8]=h,this._h[9]=f},e.prototype.finish=function(e,t){void 0===t&&(t=0);var r,n,i,s,o=new Uint16Array(10);if(this._leftover){for(s=this._leftover,this._buffer[s++]=1;s<16;s++)this._buffer[s]=0;this._fin=1,this._blocks(this._buffer,0,16)}for(r=this._h[1]>>>13,this._h[1]&=8191,s=2;s<10;s++)this._h[s]+=r,r=this._h[s]>>>13,this._h[s]&=8191;for(this._h[0]+=5*r,r=this._h[0]>>>13,this._h[0]&=8191,this._h[1]+=r,r=this._h[1]>>>13,this._h[1]&=8191,this._h[2]+=r,o[0]=this._h[0]+5,r=o[0]>>>13,o[0]&=8191,s=1;s<10;s++)o[s]=this._h[s]+r,r=o[s]>>>13,o[s]&=8191;for(o[9]-=8192,n=(1^r)-1,s=0;s<10;s++)o[s]&=n;for(s=0,n=~n;s<10;s++)this._h[s]=this._h[s]&n|o[s];for(s=1,this._h[0]=(this._h[0]|this._h[1]<<13)&65535,this._h[1]=(this._h[1]>>>3|this._h[2]<<10)&65535,this._h[2]=(this._h[2]>>>6|this._h[3]<<7)&65535,this._h[3]=(this._h[3]>>>9|this._h[4]<<4)&65535,this._h[4]=(this._h[4]>>>12|this._h[5]<<1|this._h[6]<<14)&65535,this._h[5]=(this._h[6]>>>2|this._h[7]<<11)&65535,this._h[6]=(this._h[7]>>>5|this._h[8]<<8)&65535,this._h[7]=(this._h[8]>>>8|this._h[9]<<5)&65535,i=this._h[0]+this._pad[0],this._h[0]=65535&i;s<8;s++)i=(this._h[s]+this._pad[s]|0)+(i>>>16)|0,this._h[s]=65535&i;return e[t+0]=this._h[0]>>>0,e[t+1]=this._h[0]>>>8,e[t+2]=this._h[1]>>>0,e[t+3]=this._h[1]>>>8,e[t+4]=this._h[2]>>>0,e[t+5]=this._h[2]>>>8,e[t+6]=this._h[3]>>>0,e[t+7]=this._h[3]>>>8,e[t+8]=this._h[4]>>>0,e[t+9]=this._h[4]>>>8,e[t+10]=this._h[5]>>>0,e[t+11]=this._h[5]>>>8,e[t+12]=this._h[6]>>>0,e[t+13]=this._h[6]>>>8,e[t+14]=this._h[7]>>>0,e[t+15]=this._h[7]>>>8,this._finished=!0,this},e.prototype.update=function(e){var t,r=0,n=e.length;if(this._leftover){(t=16-this._leftover)>n&&(t=n);for(var i=0;i=16&&(t=n-n%16,this._blocks(e,r,t),r+=t,n-=t),n){for(var i=0;i256)throw Error("randomString charset is too long");let i="",l=r.length,u=256-256%l;for(;e>0;){let t=o(Math.ceil(256*e/u),n);for(let n=0;n0;n++){let s=t[n];s0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[r++],t--;this._bufferLength===this.blockSize&&(a(this._temp,this._state,this._buffer,0,this.blockSize),this._bufferLength=0)}for(t>=this.blockSize&&(r=a(this._temp,this._state,e,r,t),t%=this.blockSize);t>0;)this._buffer[this._bufferLength++]=e[r++],t--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t%64<56?64:128;this._buffer[r]=128;for(var s=r+1;s0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._state.set(e.state),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.state),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.mE=s;var o=new Int32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);function a(e,t,r,i,s){for(;s>=64;){for(var a=t[0],l=t[1],u=t[2],c=t[3],d=t[4],h=t[5],f=t[6],p=t[7],g=0;g<16;g++){var m=i+4*g;e[g]=n.readUint32BE(r,m)}for(var g=16;g<64;g++){var y=e[g-2],b=(y>>>17|y<<15)^(y>>>19|y<<13)^y>>>10,v=((y=e[g-15])>>>7|y<<25)^(y>>>18|y<<14)^y>>>3;e[g]=(b+e[g-7]|0)+(v+e[g-16]|0)}for(var g=0;g<64;g++){var b=(((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(d&h^~d&f)|0)+(p+(o[g]+e[g]|0)|0)|0,v=((a>>>2|a<<30)^(a>>>13|a<<19)^(a>>>22|a<<10))+(a&l^a&u^l&u)|0;p=f,f=h,h=d,d=c+b|0,c=u,u=l,l=a,a=b+v|0}t[0]+=a,t[1]+=l,t[2]+=u,t[3]+=c,t[4]+=d,t[5]+=h,t[6]+=f,t[7]+=p,i+=64,s-=64}return i}t.vp=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},13033:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(18615),i=r(32583);t.DIGEST_LENGTH=64,t.BLOCK_SIZE=128;var s=function(){function e(){this.digestLength=t.DIGEST_LENGTH,this.blockSize=t.BLOCK_SIZE,this._stateHi=new Int32Array(8),this._stateLo=new Int32Array(8),this._tempHi=new Int32Array(16),this._tempLo=new Int32Array(16),this._buffer=new Uint8Array(256),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this.reset()}return e.prototype._initState=function(){this._stateHi[0]=1779033703,this._stateHi[1]=3144134277,this._stateHi[2]=1013904242,this._stateHi[3]=2773480762,this._stateHi[4]=1359893119,this._stateHi[5]=2600822924,this._stateHi[6]=528734635,this._stateHi[7]=1541459225,this._stateLo[0]=4089235720,this._stateLo[1]=2227873595,this._stateLo[2]=4271175723,this._stateLo[3]=1595750129,this._stateLo[4]=2917565137,this._stateLo[5]=725511199,this._stateLo[6]=4215389547,this._stateLo[7]=327033209},e.prototype.reset=function(){return this._initState(),this._bufferLength=0,this._bytesHashed=0,this._finished=!1,this},e.prototype.clean=function(){i.wipe(this._buffer),i.wipe(this._tempHi),i.wipe(this._tempLo),this.reset()},e.prototype.update=function(e,r){if(void 0===r&&(r=e.length),this._finished)throw Error("SHA512: can't update because hash was finished.");var n=0;if(this._bytesHashed+=r,this._bufferLength>0){for(;this._bufferLength0;)this._buffer[this._bufferLength++]=e[n++],r--;this._bufferLength===this.blockSize&&(a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,this._buffer,0,this.blockSize),this._bufferLength=0)}for(r>=this.blockSize&&(n=a(this._tempHi,this._tempLo,this._stateHi,this._stateLo,e,n,r),r%=this.blockSize);r>0;)this._buffer[this._bufferLength++]=e[n++],r--;return this},e.prototype.finish=function(e){if(!this._finished){var t=this._bytesHashed,r=this._bufferLength,i=t%128<112?128:256;this._buffer[r]=128;for(var s=r+1;s0?new Uint8Array(this._buffer):void 0,bufferLength:this._bufferLength,bytesHashed:this._bytesHashed}},e.prototype.restoreState=function(e){return this._stateHi.set(e.stateHi),this._stateLo.set(e.stateLo),this._bufferLength=e.bufferLength,e.buffer&&this._buffer.set(e.buffer),this._bytesHashed=e.bytesHashed,this._finished=!1,this},e.prototype.cleanSavedState=function(e){i.wipe(e.stateHi),i.wipe(e.stateLo),e.buffer&&i.wipe(e.buffer),e.bufferLength=0,e.bytesHashed=0},e}();t.SHA512=s;var o=new Int32Array([1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591]);function a(e,t,r,i,s,a,l){for(var u,c,d,h,f,p,g,m,y=r[0],b=r[1],v=r[2],w=r[3],_=r[4],E=r[5],A=r[6],x=r[7],k=i[0],S=i[1],$=i[2],C=i[3],P=i[4],I=i[5],O=i[6],N=i[7];l>=128;){for(var M=0;M<16;M++){var R=8*M+a;e[M]=n.readUint32BE(s,R),t[M]=n.readUint32BE(s,R+4)}for(var M=0;M<80;M++){var T=y,D=b,L=v,j=w,B=_,F=E,U=A,z=x,q=k,H=S,G=$,V=C,W=P,K=I,Y=O,Z=N;if(u=x,f=65535&(c=N),p=c>>>16,g=65535&u,m=u>>>16,u=(_>>>14|P<<18)^(_>>>18|P<<14)^(P>>>9|_<<23),f+=65535&(c=(P>>>14|_<<18)^(P>>>18|_<<14)^(_>>>9|P<<23)),p+=c>>>16,g+=65535&u,m+=u>>>16,u=_&E^~_&A,f+=65535&(c=P&I^~P&O),p+=c>>>16,g+=65535&u,m+=u>>>16,u=o[2*M],f+=65535&(c=o[2*M+1]),p+=c>>>16,g+=65535&u,m+=u>>>16,u=e[M%16],f+=65535&(c=t[M%16]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,d=65535&g|m<<16,h=65535&f|p<<16,u=d,f=65535&(c=h),p=c>>>16,g=65535&u,m=u>>>16,u=(y>>>28|k<<4)^(k>>>2|y<<30)^(k>>>7|y<<25),f+=65535&(c=(k>>>28|y<<4)^(y>>>2|k<<30)^(y>>>7|k<<25)),p+=c>>>16,g+=65535&u,m+=u>>>16,u=y&b^y&v^b&v,f+=65535&(c=k&S^k&$^S&$),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,z=65535&g|m<<16,Z=65535&f|p<<16,u=j,f=65535&(c=V),p=c>>>16,g=65535&u,m=u>>>16,u=d,f+=65535&(c=h),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,j=65535&g|m<<16,V=65535&f|p<<16,b=T,v=D,w=L,_=j,E=B,A=F,x=U,y=z,S=q,$=H,C=G,P=V,I=W,O=K,N=Y,k=Z,M%16==15)for(var R=0;R<16;R++)u=e[R],f=65535&(c=t[R]),p=c>>>16,g=65535&u,m=u>>>16,u=e[(R+9)%16],f+=65535&(c=t[(R+9)%16]),p+=c>>>16,g+=65535&u,m+=u>>>16,u=((d=e[(R+1)%16])>>>1|(h=t[(R+1)%16])<<31)^(d>>>8|h<<24)^d>>>7,f+=65535&(c=(h>>>1|d<<31)^(h>>>8|d<<24)^(h>>>7|d<<25)),p+=c>>>16,g+=65535&u,m+=u>>>16,u=((d=e[(R+14)%16])>>>19|(h=t[(R+14)%16])<<13)^(h>>>29|d<<3)^d>>>6,f+=65535&(c=(h>>>19|d<<13)^(d>>>29|h<<3)^(h>>>6|d<<26)),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,e[R]=65535&g|m<<16,t[R]=65535&f|p<<16}u=y,f=65535&(c=k),p=c>>>16,g=65535&u,m=u>>>16,u=r[0],f+=65535&(c=i[0]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[0]=y=65535&g|m<<16,i[0]=k=65535&f|p<<16,u=b,f=65535&(c=S),p=c>>>16,g=65535&u,m=u>>>16,u=r[1],f+=65535&(c=i[1]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[1]=b=65535&g|m<<16,i[1]=S=65535&f|p<<16,u=v,f=65535&(c=$),p=c>>>16,g=65535&u,m=u>>>16,u=r[2],f+=65535&(c=i[2]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[2]=v=65535&g|m<<16,i[2]=$=65535&f|p<<16,u=w,f=65535&(c=C),p=c>>>16,g=65535&u,m=u>>>16,u=r[3],f+=65535&(c=i[3]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[3]=w=65535&g|m<<16,i[3]=C=65535&f|p<<16,u=_,f=65535&(c=P),p=c>>>16,g=65535&u,m=u>>>16,u=r[4],f+=65535&(c=i[4]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[4]=_=65535&g|m<<16,i[4]=P=65535&f|p<<16,u=E,f=65535&(c=I),p=c>>>16,g=65535&u,m=u>>>16,u=r[5],f+=65535&(c=i[5]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[5]=E=65535&g|m<<16,i[5]=I=65535&f|p<<16,u=A,f=65535&(c=O),p=c>>>16,g=65535&u,m=u>>>16,u=r[6],f+=65535&(c=i[6]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[6]=A=65535&g|m<<16,i[6]=O=65535&f|p<<16,u=x,f=65535&(c=N),p=c>>>16,g=65535&u,m=u>>>16,u=r[7],f+=65535&(c=i[7]),p+=c>>>16,g+=65535&u,m+=u>>>16,p+=f>>>16,g+=p>>>16,m+=g>>>16,r[7]=x=65535&g|m<<16,i[7]=N=65535&f|p<<16,a+=128,l-=128}return a}t.hash=function(e){var t=new s;t.update(e);var r=t.digest();return t.clean(),r}},32583:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.wipe=function(e){for(var t=0;t=0;--e){let t=r[e>>>3]>>>(7&e)&1;u(i,o,t),u(f,p,t),c(g,i,f),d(i,i,f),c(f,o,p),d(o,o,p),h(p,g,g),h(m,i,i),h(i,f,i),h(f,o,g),c(g,i,f),d(i,i,f),h(o,i,i),d(f,p,m),h(i,f,a),c(i,i,p),h(f,f,i),h(i,p,m),h(p,o,n),h(o,g,g),u(i,o,t),u(f,p,t)}for(let e=0;e<16;e++)n[e+16]=i[e],n[e+32]=f[e],n[e+48]=o[e],n[e+64]=p[e];let y=n.subarray(32),b=n.subarray(16);!function(e,t){let r=s();for(let e=0;e<16;e++)r[e]=t[e];for(let e=253;e>=0;e--)h(r,r,r),2!==e&&4!==e&&h(r,r,t);for(let t=0;t<16;t++)e[t]=r[t]}(y,y),h(b,b,y);let v=new Uint8Array(32);return!function(e,t){let r=s(),n=s();for(let e=0;e<16;e++)n[e]=t[e];l(n),l(n),l(n);for(let e=0;e<2;e++){r[0]=n[0]-65517;for(let e=1;e<15;e++)r[e]=n[e]-65535-(r[e-1]>>16&1),r[e-1]&=65535;r[15]=n[15]-32767-(r[14]>>16&1);let e=r[15]>>16&1;r[14]&=65535,u(n,r,1-e)}for(let t=0;t<16;t++)e[2*t]=255&n[t],e[2*t+1]=n[t]>>8}(v,b),v}t.Au=function(e){let r=(0,n.randomBytes)(32,e),s=function(e){if(e.length!==t.KS)throw Error(`x25519: seed must be ${t.KS} bytes`);let r=new Uint8Array(e);return{publicKey:f(r,o),secretKey:r}}(r);return(0,i.wipe)(r),s},t.gi=function(e,r,n=!1){if(e.length!==t.kz)throw Error("X25519: incorrect secret key length");if(r.length!==t.kz)throw Error("X25519: incorrect public key length");let i=f(e,r);if(n){let e=0;for(let t=0;tt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function l(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function d(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function m(){for(var e=[],t=0;t1||a(e,t)})})}function a(e,t){try{var r;(r=i[e](t)).value instanceof b?Promise.resolve(r.value.v).then(l,u):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function x(e){return e&&e.__esModule?e:{default:e}}function k(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},89649:function(e,t,r){"use strict";let n;r.d(t,{Gn:function(){return iM},gy:function(){return iw},lI:function(){return ib}});var i=r(68885),s=r.n(i),o=r(50499),a=r(10259),l=r(9109).Buffer;function u(e,...t){try{var r;return(r=e(...t))&&"function"==typeof r.then?r:Promise.resolve(r)}catch(e){return Promise.reject(e)}}function c(e){if(function(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}(e))return String(e);if(function(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return c(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}let d="base64:";function h(e){return e?e.split("?")[0].replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,""):""}function f(e){return(e=h(e))?e+":":""}let p=()=>{let e=new Map;return{name:"memory",options:{},hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>Array.from(e.keys()),clear(){e.clear()},dispose(){e.clear()}}};function g(e,t,r){return e.watch?e.watch((e,n)=>t(e,r+n)):()=>{}}async function m(e){"function"==typeof e.dispose&&await u(e.dispose)}function y(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function b(e,t){let r=indexedDB.open(e);r.onupgradeneeded=()=>r.result.createObjectStore(t);let n=y(r);return(e,r)=>n.then(n=>r(n.transaction(t,e).objectStore(t)))}function v(){return n||(n=b("keyval-store","keyval")),n}function w(e,t=v()){return t("readonly",t=>y(t.get(e)))}let _=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),E=e=>JSON.parse(e.replace(/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t);function A(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return E(e)}catch(t){return e}}function x(e){return"string"==typeof e?e:_(e)||""}var k=(e={})=>{let t;let r=e.base&&e.base.length>0?`${e.base}:`:"",n=e=>r+e;return e.dbName&&e.storeName&&(t=b(e.dbName,e.storeName)),{name:"idb-keyval",options:e,hasItem:async e=>!(typeof await w(n(e),t)>"u"),getItem:async e=>await w(n(e),t)??null,setItem:(e,r)=>(function(e,t,r=v()){return r("readwrite",r=>(r.put(t,e),y(r.transaction)))})(n(e),r,t),removeItem:e=>(function(e,t=v()){return t("readwrite",t=>(t.delete(e),y(t.transaction)))})(n(e),t),getKeys:()=>(function(e=v()){return e("readonly",e=>{var t;if(e.getAllKeys)return y(e.getAllKeys());let r=[];return(t=e=>r.push(e.key),e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},y(e.transaction)).then(()=>r)})})(t),clear:()=>(function(e=v()){return e("readwrite",e=>(e.clear(),y(e.transaction)))})(t)}};class S{constructor(){this.indexedDb=function(e={}){let t={mounts:{"":e.driver||p()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}},r=e=>{for(let r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},n=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),i=(e,r)=>{if(t.watching)for(let n of(r=h(r),t.watchListeners))n(e,r)},s=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await g(t.mounts[e],i,e)},o=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},y=(e,t,n)=>{let i=new Map,s=e=>{let t=i.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},i.set(e.base,t)),t};for(let n of e){let e="string"==typeof n,i=h(e?n:n.key),o=e?void 0:n.value,a=e||!n.options?t:{...t,...n.options},l=r(i);s(l).items.push({key:i,value:o,relativeKey:l.relativeKey,options:a})}return Promise.all([...i.values()].map(e=>n(e))).then(e=>e.flat())},b={hasItem(e,t={}){let{relativeKey:n,driver:i}=r(e=h(e));return u(i.hasItem,n,t)},getItem(e,t={}){let{relativeKey:n,driver:i}=r(e=h(e));return u(i.getItem,n,t).then(e=>(0,a.ZP)(e))},getItems:(e,t)=>y(e,t,e=>e.driver.getItems?u(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:function(...e){return h(e.join(":"))}(e.base,t.key),value:(0,a.ZP)(t.value)}))):Promise.all(e.items.map(t=>u(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:(0,a.ZP)(e)}))))),getItemRaw(e,t={}){let{relativeKey:n,driver:i}=r(e=h(e));return i.getItemRaw?u(i.getItemRaw,n,t):u(i.getItem,n,t).then(e=>"string"==typeof e&&e.startsWith(d)?l.from(e.slice(d.length),"base64"):e)},async setItem(e,t,n={}){if(void 0===t)return b.removeItem(e);let{relativeKey:s,driver:o}=r(e=h(e));o.setItem&&(await u(o.setItem,s,c(t),n),o.watch||i("update",e))},async setItems(e,t){await y(e,t,async e=>{if(e.driver.setItems)return u(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:c(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>u(e.driver.setItem,t.relativeKey,c(t.value),t.options)))})},async setItemRaw(e,t,n={}){if(void 0===t)return b.removeItem(e,n);let{relativeKey:s,driver:o}=r(e=h(e));if(o.setItemRaw)await u(o.setItemRaw,s,t,n);else{if(!o.setItem)return;await u(o.setItem,s,"string"==typeof t?t:d+l.from(t).toString("base64"),n)}o.watch||i("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:n,driver:s}=r(e=h(e));s.removeItem&&(await u(s.removeItem,n,t),(t.removeMeta||t.removeMata)&&await u(s.removeItem,n+"$",t),s.watch||i("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:n,driver:i}=r(e=h(e)),s=Object.create(null);if(i.getMeta&&Object.assign(s,await u(i.getMeta,n,t)),!t.nativeOnly){let e=await u(i.getItem,n+"$",t).then(e=>(0,a.ZP)(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(s,e))}return s},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let r=n(e=f(e),!0),i=[],s=[];for(let e of r){let r=(await u(e.driver.getKeys,e.relativeBase,t)).map(t=>e.mountpoint+h(t)).filter(e=>!i.some(t=>e.startsWith(t)));s.push(...r),i=[e.mountpoint,...i.filter(t=>!t.startsWith(e.mountpoint))]}return e?s.filter(t=>t.startsWith(e)&&!t.endsWith("$")):s.filter(e=>!e.endsWith("$"))},async clear(e,t={}){e=f(e),await Promise.all(n(e,!1).map(async e=>e.driver.clear?u(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(r=>e.driver.removeItem(r,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>m(e)))},watch:async e=>(await s(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await o()}),async unwatch(){t.watchListeners=[],await o()},mount(e,r){if((e=f(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(g(r,i,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),b},async unmount(e,r=!0){(e=f(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e](),delete t.unwatch[e]),r&&await m(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=r(e=h(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>n(e=h(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint}))};return b}({driver:k({dbName:"WALLET_CONNECT_V2_INDEXED_DB",storeName:"keyvaluestorage"})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,x(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var $="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},C={exports:{}};function P(e){var t;return[e[0],A(null!=(t=e[1])?t:"")]}!function(){function e(){}e.prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof $&&$.localStorage?C.exports=$.localStorage:"u">typeof window&&window.localStorage?C.exports=window.localStorage:C.exports=new e}();class I{constructor(){this.localStorage=C.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(P)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return A(t)}async setItem(e,t){this.localStorage.setItem(e,x(t))}async removeItem(e){this.localStorage.removeItem(e)}}let O=async(e,t,r)=>{let n="wc_storage_version",i=await t.getItem(n);if(i&&i>=1){r(t);return}let s=await e.getKeys();if(!s.length){r(t);return}let o=[];for(;s.length;){let r=s.shift();if(!r)continue;let n=r.toLowerCase();if(n.includes("wc@")||n.includes("walletconnect")||n.includes("wc_")||n.includes("wallet_connect")){let n=await e.getItem(r);await t.setItem(r,n),o.push(r)}}await t.setItem(n,1),r(t),N(e,o)},N=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class M{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new I;this.storage=e;try{let t=new S;O(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var R=r(54574);class T{}class D extends T{constructor(e){super()}}let L=R.FIVE_SECONDS,j="heartbeat_pulse";class B extends D{constructor(e){super(e),this.events=new i.EventEmitter,this.interval=L,this.interval=e?.interval||L}static async init(e){let t=new B(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,R.toMiliseconds)(this.interval))}pulse(){this.events.emit(j)}}var F=r(78227),U=r.n(F);let z={level:"info"},q="custom_context";class H{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class G{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new H(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}class V{constructor(e,t=1024e3){this.level=e??"error",this.levelValue=F.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new G(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===F.levels.values.error?console.error(e):t===F.levels.values.warn?console.warn(e):t===F.levels.values.debug?console.debug(e):t===F.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(x({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new G(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push(x({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class W{constructor(e,t=1024e3){this.baseChunkLogger=new V(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}class K{constructor(e,t=1024e3){this.baseChunkLogger=new V(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var Y=Object.defineProperty,Z=Object.defineProperties,J=Object.getOwnPropertyDescriptors,Q=Object.getOwnPropertySymbols,X=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable,et=(e,t,r)=>t in e?Y(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,er=(e,t)=>{for(var r in t||(t={}))X.call(t,r)&&et(e,r,t[r]);if(Q)for(var r of Q(t))ee.call(t,r)&&et(e,r,t[r]);return e},en=(e,t)=>Z(e,J(t));function ei(e){return en(er({},e),{level:e?.level||z.level})}function es(e,t=q){return typeof e.bindings>"u"?function(e,t=q){return e[t]||""}(e,t):e.bindings().context||""}function eo(e,t,r=q){let n=function(e,t,r=q){let n=es(e,r);return n.trim()?`${n}/${t}`:t}(e,t,r);return function(e,t,r=q){return e[r]=t,e}(e.child({context:n}),n,r)}class ea extends T{constructor(e){super(),this.opts=e,this.protocol="wc",this.version=2}}class el extends T{constructor(e,t){super(),this.core=e,this.logger=t,this.records=new Map}}class eu{constructor(e,t){this.logger=e,this.core=t}}class ec extends T{constructor(e,t){super(),this.relayer=e,this.logger=t}}class ed extends T{constructor(e){super()}}class eh{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class ef extends T{constructor(e,t){super(),this.relayer=e,this.logger=t}}class ep extends T{constructor(e,t){super(),this.core=e,this.logger=t}}class eg{constructor(e,t){this.projectId=e,this.logger=t}}class em{constructor(e,t){this.projectId=e,this.logger=t}}class ey{constructor(e){this.opts=e,this.protocol="wc",this.version=2}}class eb{constructor(e){this.client=e}}var ev=r(59271),ew=r(24861);let e_="base64url",eE="base58btc";var eA=r(69717),ex=r(3767),ek=r(55522);function eS(e){return(0,ex.B)((0,ek.m)(x(e),"utf8"),e_)}function e$(e){let t=(0,ek.m)("K36",eE);return["did","key","z"+(0,ex.B)((0,eA.z)([t,e]),eE)].join(":")}function eC(e=(0,ew.randomBytes)(32)){return ev._w(e)}async function eP(e,t,r,n,i=(0,R.fromMiliseconds)(Date.now())){var s,o,a;let l={alg:"EdDSA",typ:"JWT"},u={iss:e$(n.publicKey),sub:e,aud:t,iat:i,exp:i+r},c=(s={header:l,payload:u},(0,ek.m)([eS(s.header),eS(s.payload)].join("."),"utf8"));return[eS((o={header:l,payload:u,signature:ev.Xx(n.secretKey,c)}).header),eS(o.payload),(a=o.signature,(0,ex.B)(a,e_))].join(".")}r(77726);var eI=r(39613);let eO="INTERNAL_ERROR",eN="SERVER_ERROR",eM=[-32700,-32600,-32601,-32602,-32603],eR={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[eO]:{code:-32603,message:"Internal error"},[eN]:{code:-32e3,message:"Server error"}};function eT(e){return Object.keys(eR).includes(e)?eR[e]:eR[eN]}function eD(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${r} RPC url at ${t}`):e}var eL=r(60092);function ej(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function eB(e=6){return BigInt(ej(e))}function eF(e,t,r){return{id:r||ej(),jsonrpc:"2.0",method:e,params:t}}function eU(e,t){return{id:e,jsonrpc:"2.0",result:t}}function ez(e,t,r){var n,i,s;return{id:e,jsonrpc:"2.0",error:void 0===(n=t)?eT(eO):("string"==typeof n&&(n=Object.assign(Object.assign({},eT(eN)),{message:n})),void 0!==r&&(n.data=r),i=n.code,eM.includes(i)&&(s=n.code,n=Object.values(eR).find(e=>e.code===s)||eR[eN]),n)}}class eq{}class eH extends eq{constructor(){super()}}class eG extends eH{constructor(e){super()}}function eV(e,t){let r=function(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}(e);return void 0!==r&&new RegExp(t).test(r)}function eW(e){return eV(e,"^https?:")}function eK(e){return eV(e,"^wss?:")}function eY(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function eZ(e){return eY(e)&&"method"in e}function eJ(e){return eY(e)&&(eQ(e)||eX(e))}function eQ(e){return"result"in e}function eX(e){return"error"in e}class e0 extends eG{constructor(e){super(e),this.events=new i.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(eF(e.method,e.params||[],e.id||eB().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{eX(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),eJ(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let e1=()=>"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,e2=e=>e.split("?")[0],e3="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(27185);class e5{constructor(e){if(this.url=e,this.events=new i.EventEmitter,this.registering=!1,!eK(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(Error("Connection already closed"));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(x(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!eK(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{let n=new URLSearchParams(e).get("origin"),i=(0,eL.isReactNative)()?{headers:{origin:n}}:{rejectUnauthorized:!RegExp("wss?://localhost(:d{2,5})?").test(e)},s=new e3(e,[],i);e1()?s.onerror=e=>{r(this.emitError(e.error))}:s.on("error",e=>{r(this.emitError(e))}),s.onopen=()=>{this.onOpen(s),t(s)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?A(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=ez(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return eD(e,e2(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${e2(this.url)}`));return this.events.emit("register_error",t),t}}var e6=r(8355),e4=r.n(e6),e8=r(37185),e9=r.n(e8),e7=r(25566),te=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,o=new Uint8Array(s);e[t];){var c=r[e.charCodeAt(t)];if(255===c)return;for(var d=0,h=s-1;(0!==c||d>>0,o[h]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var f=s-i;f!==s&&0===o[f];)f++;for(var p=new Uint8Array(n+(s-f)),g=n;f!==s;)p[g++]=o[f++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var o=(s-i)*c+1>>>0,u=new Uint8Array(o);i!==s;){for(var d=t[i],h=0,f=o-1;(0!==d||h>>0,u[f]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=h,i++}for(var p=o-n;p!==o&&0===u[p];)p++;for(var g=l.repeat(r);p{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},tr=e=>new TextEncoder().encode(e),tn=e=>new TextDecoder().decode(e);class ti{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class ts{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return ta(this,e)}}class to{constructor(e){this.decoders=e}or(e){return ta(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let ta=(e,t)=>new to({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class tl{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new ti(e,t,r),this.decoder=new ts(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let tu=({name:e,prefix:t,encode:r,decode:n})=>new tl(e,t,r,n),tc=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=te(r,t);return tu({prefix:e,name:t,encode:n,decode:e=>tt(i(e))})},td=(e,t,r,n)=>{let i={};for(let e=0;e=8&&(a-=8,o[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw SyntaxError("Unexpected end of data");return o},th=(e,t,r)=>{let n="="===t[t.length-1],i=(1<r;)o-=r,s+=t[i&a>>o];if(o&&(s+=t[i&a<tu({prefix:t,name:e,encode:e=>th(e,n,r),decode:t=>td(t,n,r,e)});var tp=Object.freeze({__proto__:null,identity:tu({prefix:"\0",name:"identity",encode:e=>tn(e),decode:e=>tr(e)})}),tg=Object.freeze({__proto__:null,base2:tf({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),tm=Object.freeze({__proto__:null,base8:tf({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),ty=Object.freeze({__proto__:null,base10:tc({prefix:"9",name:"base10",alphabet:"0123456789"})}),tb=Object.freeze({__proto__:null,base16:tf({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:tf({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let tv=tf({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),tw=tf({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),t_=tf({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),tE=tf({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),tA=tf({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),tx=tf({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var tk=Object.freeze({__proto__:null,base32:tv,base32upper:tw,base32pad:t_,base32padupper:tE,base32hex:tA,base32hexupper:tx,base32hexpad:tf({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:tf({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:tf({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),tS=Object.freeze({__proto__:null,base36:tc({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:tc({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),t$=Object.freeze({__proto__:null,base58btc:tc({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:tc({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let tC=tf({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});var tP=Object.freeze({__proto__:null,base64:tC,base64pad:tf({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:tf({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:tf({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let tI=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),tO=tI.reduce((e,t,r)=>(e[r]=t,e),[]),tN=tI.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var tM=Object.freeze({__proto__:null,base256emoji:tu({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=tO[t],"")},decode:function(e){let t=[];for(let r of e){let e=tN[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})});function tR(e,t){var r,n=0,t=t||0,i=0,s=t,o=e.length;do{if(s>=o)throw tR.bytes=0,RangeError("Could not decode varint");r=e[s++],n+=i<28?(127&r)<=128);return tR.bytes=s-t,n}var tT=function e(t,r,n){r=r||[],n=n||0;for(var i=n;t>=2147483648;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r};let tD=(e,t,r=0)=>(tT(e,t,r),t),tL=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,tj=(e,t)=>{let r=t.byteLength,n=tL(e),i=n+tL(r),s=new Uint8Array(i+r);return tD(e,s,0),tD(r,s,n),s.set(t,i),new tB(e,r,t,s)};class tB{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let tF=({name:e,code:t,encode:r})=>new tU(e,t,r);class tU{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?tj(this.code,t):t.then(e=>tj(this.code,e))}throw Error("Unknown type, must be binary type")}}let tz=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var tq=Object.freeze({__proto__:null,sha256:tF({name:"sha2-256",code:18,encode:tz("SHA-256")}),sha512:tF({name:"sha2-512",code:19,encode:tz("SHA-512")})}),tH=Object.freeze({__proto__:null,identity:{code:0,name:"identity",encode:tt,digest:e=>tj(0,tt(e))}});new TextEncoder,new TextDecoder;let tG={...tp,...tg,...tm,...ty,...tb,...tk,...tS,...t$,...tP,...tM};function tV(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...tq,...tH});let tW=tV("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),tK=tV("ascii","a",e=>{let t="a";for(let r=0;r{let t=function(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}((e=e.substring(1)).length);for(let r=0;r{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}},this.has=e=>(this.isInitialized(),this.keychain.has(e)),this.set=async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()},this.get=e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t},this.del=async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()},this.core=e,this.logger=eo(t,this.name)}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,(0,o.KCv)(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?(0,o.IPd)(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class ro{constructor(e,t,r){this.core=e,this.logger=t,this.name="crypto",this.randomSessionIdentifier=(0,o.jdp)(),this.initialized=!1,this.init=async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)},this.hasKeys=e=>(this.isInitialized(),this.keychain.has(e)),this.getClientId=async()=>(this.isInitialized(),e$(eC(await this.getClientSeed()).publicKey)),this.generateKeyPair=()=>{this.isInitialized();let e=(0,o.Au2)();return this.setPrivateKey(e.publicKey,e.privateKey)},this.signJWT=async e=>{this.isInitialized();let t=eC(await this.getClientSeed()),r=this.randomSessionIdentifier;return await eP(r,e,t1,t)},this.generateSharedKey=(e,t,r)=>{this.isInitialized();let n=this.getPrivateKey(e),i=(0,o.m$A)(n,t);return this.setSymKey(i,r)},this.setSymKey=async(e,t)=>{this.isInitialized();let r=t||(0,o.YmJ)(e);return await this.keychain.set(r,e),r},this.deleteKeyPair=async e=>{this.isInitialized(),await this.keychain.del(e)},this.deleteSymKey=async e=>{this.isInitialized(),await this.keychain.del(e)},this.encode=async(e,t,r)=>{this.isInitialized();let n=(0,o.ENt)(r),i=x(t);if((0,o.Q8x)(n)){let t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}let s=this.getSymKey(e),{type:a,senderPublicKey:l}=n;return(0,o.HIp)({type:a,symKey:s,message:i,senderPublicKey:l})},this.decode=async(e,t,r)=>{this.isInitialized();let n=(0,o.Llj)(t,r);if((0,o.Q8x)(n)){let t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{let r=this.getSymKey(e),n=(0,o.peR)({symKey:r,encoded:t});return A(n)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}},this.getPayloadType=e=>{let t=(0,o.vBi)(e);return(0,o.WGe)(t.type)},this.getPayloadSenderPublicKey=e=>{let t=(0,o.vBi)(e);return t.senderPublicKey?(0,eI.BB)(t.senderPublicKey,o.AWt):void 0},this.core=e,this.logger=eo(t,this.name),this.keychain=r||new rs(this.core,this.logger)}get context(){return es(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(t0)}catch{e=(0,o.jdp)(),await this.keychain.set(t0,e)}return function(e,t="utf8"){let r=tY[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class ra extends eu{constructor(e,t){super(e,t),this.logger=e,this.core=t,this.messages=new Map,this.name="messages",this.version="0.3",this.initialized=!1,this.storagePrefix=tJ,this.init=async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}},this.set=async(e,t)=>{this.isInitialized();let r=(0,o.rjm)(t),n=this.messages.get(e);return typeof n>"u"&&(n={}),"u">typeof n[r]||(n[r]=t,this.messages.set(e,n),await this.persist()),r},this.get=e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t},this.has=(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[(0,o.rjm)(t)]),this.del=async e=>{this.isInitialized(),this.messages.delete(e),await this.persist()},this.logger=eo(e,this.name),this.core=t}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,(0,o.KCv)(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?(0,o.IPd)(e):void 0}async persist(){await this.setRelayerMessages(this.messages)}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class rl extends ec{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.events=new i.EventEmitter,this.name="publisher",this.queue=new Map,this.publishTimeout=(0,R.toMiliseconds)(R.ONE_MINUTE),this.failedPublishTimeout=(0,R.toMiliseconds)(R.ONE_SECOND),this.needsTransportRestart=!1,this.publish=async(e,t,r)=>{var n;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});let i=r?.ttl||t2,s=(0,o._HE)(r),a=r?.prompt||!1,l=r?.tag||0,u=r?.id||eB().toString(),c={topic:e,message:t,opts:{ttl:i,relay:s,prompt:a,tag:l,id:u}},d=`Failed to publish payload, please try again. id:${u} tag:${l}`,h=Date.now(),f,p=1;try{for(;void 0===f;){if(Date.now()-h>this.publishTimeout)throw Error(d);this.logger.trace({id:u,attempts:p},`publisher.publish - attempt ${p}`),f=await await (0,o.hFY)(this.rpcPublish(e,t,i,s,a,l,u).catch(e=>this.logger.warn(e)),this.publishTimeout,d),p++,f||await new Promise(e=>setTimeout(e,this.failedPublishTimeout))}this.relayer.events.emit(t5.publish,c),this.logger.debug("Successfully Published Payload"),this.logger.trace({type:"method",method:"publish",params:{id:u,topic:e,message:t,opts:r}})}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(n=r?.internal)&&n.throwOnFailedPublish)throw e;this.queue.set(u,c)}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.relayer=e,this.logger=eo(t,this.name),this.registerEventListeners()}get context(){return es(this.logger)}rpcPublish(e,t,r,n,i,s,a){var l,u,c,d;let h={method:(0,o.cOS)(n.protocol).publish,params:{topic:e,message:t,ttl:r,prompt:i,tag:s},id:a};return(0,o.o8e)(null==(l=h.params)?void 0:l.prompt)&&(null==(u=h.params)||delete u.prompt),(0,o.o8e)(null==(c=h.params)?void 0:c.tag)&&(null==(d=h.params)||delete d.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h}),this.relayer.request(h)}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async e=>{let{topic:t,message:r,opts:n}=e;await this.publish(t,r,n)})}registerEventListeners(){this.relayer.core.heartbeat.on(j,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(t5.connection_stalled);return}this.checkQueue()}),this.relayer.on(t5.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}class ru{constructor(){this.map=new Map,this.set=(e,t)=>{let r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])},this.get=e=>this.map.get(e)||[],this.exists=(e,t)=>this.get(e).includes(t),this.delete=(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let r=this.get(e);if(!this.exists(e,t))return;let n=r.filter(e=>e!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)},this.clear=()=>{this.map.clear()}}get topics(){return Array.from(this.map.keys())}}var rc=Object.defineProperty,rd=Object.defineProperties,rh=Object.getOwnPropertyDescriptors,rf=Object.getOwnPropertySymbols,rp=Object.prototype.hasOwnProperty,rg=Object.prototype.propertyIsEnumerable,rm=(e,t,r)=>t in e?rc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ry=(e,t)=>{for(var r in t||(t={}))rp.call(t,r)&&rm(e,r,t[r]);if(rf)for(var r of rf(t))rg.call(t,r)&&rm(e,r,t[r]);return e},rb=(e,t)=>rd(e,rh(t));class rv extends ef{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,this.subscriptions=new Map,this.topicMap=new ru,this.events=new i.EventEmitter,this.name="subscription",this.version="0.3",this.pending=new Map,this.cached=[],this.initialized=!1,this.pendingSubscriptionWatchLabel="pending_sub_watch_label",this.pollingInterval=20,this.storagePrefix=tJ,this.subscribeTimeout=(0,R.toMiliseconds)(R.ONE_MINUTE),this.restartInProgress=!1,this.batchSubscribeTopicsLimit=500,this.pendingBatchMessages=[],this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),this.clientId=await this.relayer.core.crypto.getClientId())},this.subscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let r=(0,o._HE)(t),n={topic:e,relay:r};this.pending.set(e,n);let i=await this.rpcSubscribe(e,r);return"string"==typeof i&&(this.onSubscribe(i,n),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}},this.unsubscribe=async(e,t)=>{await this.restartToComplete(),this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)},this.isSubscribed=async e=>{if(this.topics.includes(e))return!0;let t=`${this.pendingSubscriptionWatchLabel}_${e}`;return await new Promise((r,n)=>{let i=new R.Watch;i.start(t);let s=setInterval(()=>{!this.pending.has(e)&&this.topics.includes(e)&&(clearInterval(s),i.stop(t),r(!0)),i.elapsed(t)>=t8&&(clearInterval(s),i.stop(t),n(Error("Subscription resolution timeout")))},this.pollingInterval)}).catch(()=>!1)},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.start=async()=>{await this.onConnect()},this.stop=async()=>{await this.onDisconnect()},this.restart=async()=>{this.restartInProgress=!0,await this.restore(),await this.reset(),this.restartInProgress=!1},this.relayer=e,this.logger=eo(t,this.name),this.clientId=""}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}onEnable(){this.cached=[],this.initialized=!0}onDisable(){this.cached=this.values,this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{let n=(0,o._HE)(r);await this.rpcUnsubscribe(e,t,n);let i=(0,o.D6H)("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t){let r={method:(0,o.cOS)(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{return await await (0,o.hFY)(this.relayer.request(r).catch(e=>this.logger.warn(e)),this.subscribeTimeout)?(0,o.rjm)(e+this.clientId):null}catch{this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(t5.connection_stalled)}return null}async rpcBatchSubscribe(e){if(!e.length)return;let t=e[0].relay,r={method:(0,o.cOS)(t.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{return await await (0,o.hFY)(this.relayer.request(r).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(t5.connection_stalled)}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let r=e[0].relay,n={method:(0,o.cOS)(r.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n});try{t=await await (0,o.hFY)(this.relayer.request(n).catch(e=>this.logger.warn(e)),this.subscribeTimeout)}catch{this.relayer.events.emit(t5.connection_stalled)}return t}rpcUnsubscribe(e,t,r){let n={method:(0,o.cOS)(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,rb(ry({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,ry({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,ry({},t)),this.topicMap.set(t.topic,e),this.events.emit(t4.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(t4.deleted,rb(ry({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(t4.sync)}async reset(){if(this.cached.length){let e=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let t=0;t"u"||!e.length)return;if(this.subscriptions.size){let{message:e}=(0,o.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){if(!e.length)return;let t=await this.rpcBatchSubscribe(e);(0,o.qt8)(t)&&this.onBatchSubscribe(t.map((t,r)=>rb(ry({},e[r]),{id:t})))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(this.pendingBatchMessages=this.pendingBatchMessages.concat(t.messages))}async onConnect(){await this.restart(),this.onEnable()}onDisconnect(){this.onDisable()}async checkPending(){if(!this.initialized||!this.relayer.connected)return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e),this.pendingBatchMessages.length&&(await this.relayer.handleBatchMessageEvents(this.pendingBatchMessages),this.pendingBatchMessages=[])}registerEventListeners(){this.relayer.core.heartbeat.on(j,async()=>{await this.checkPending()}),this.events.on(t4.created,async e=>{let t=t4.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(t4.deleted,async e=>{let t=t4.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(){this.restartInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.restartInProgress||(clearInterval(t),e())},this.pollingInterval)})}}var rw=Object.defineProperty,r_=Object.getOwnPropertySymbols,rE=Object.prototype.hasOwnProperty,rA=Object.prototype.propertyIsEnumerable,rx=(e,t,r)=>t in e?rw(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rk=(e,t)=>{for(var r in t||(t={}))rE.call(t,r)&&rx(e,r,t[r]);if(r_)for(var r of r_(t))rA.call(t,r)&&rx(e,r,t[r]);return e};class rS extends ed{constructor(e){super(e),this.protocol="wc",this.version=2,this.events=new i.EventEmitter,this.name="relayer",this.transportExplicitlyClosed=!1,this.initialized=!1,this.connectionAttemptInProgress=!1,this.connectionStatusPollingInterval=20,this.staleConnectionErrors=["socket hang up","stalled","interrupted"],this.hasExperiencedNetworkDisruption=!1,this.requestsInFlight=new Map,this.heartBeatTimeout=(0,R.toMiliseconds)(R.THIRTY_SECONDS+R.ONE_SECOND),this.request=async e=>{var t,r;this.logger.debug("Publishing Request Payload");let n=e.id||eB().toString();await this.toEstablishConnection();try{let i=this.provider.request(e);this.requestsInFlight.set(n,{promise:i,request:e}),this.logger.trace({id:n,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - attempt to publish...");let s=await new Promise(async(e,t)=>{let r=()=>{t(Error(`relayer.request - publish interrupted, id: ${n}`))};this.provider.on(t6.disconnect,r);let s=await i;this.provider.off(t6.disconnect,r),e(s)});return this.logger.trace({id:n,method:e.method,topic:null==(r=e.params)?void 0:r.topic},"relayer.request - published"),s}catch(e){throw this.logger.debug(`Failed to Publish Request: ${n}`),e}finally{this.requestsInFlight.delete(n)}},this.resetPingTimeout=()=>{if((0,o.UGU)())try{clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r;null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)||r.terminate()},this.heartBeatTimeout)}catch(e){this.logger.warn(e)}},this.onPayloadHandler=e=>{this.onProviderPayload(e),this.resetPingTimeout()},this.onConnectHandler=()=>{this.logger.trace("relayer connected"),this.startPingTimeout(),this.events.emit(t5.connect)},this.onDisconnectHandler=()=>{this.logger.trace("relayer disconnected"),this.onProviderDisconnect()},this.onProviderErrorHandler=e=>{this.logger.error(e),this.events.emit(t5.error,e),this.logger.info("Fatal socket error received, closing transport"),this.transportClose()},this.registerProviderListeners=()=>{this.provider.on(t6.payload,this.onPayloadHandler),this.provider.on(t6.connect,this.onConnectHandler),this.provider.on(t6.disconnect,this.onDisconnectHandler),this.provider.on(t6.error,this.onProviderErrorHandler)},this.core=e.core,this.logger="u">typeof e.logger&&"string"!=typeof e.logger?eo(e.logger,this.name):U()(ei({level:e.logger||"error"})),this.messages=new ra(this.logger,e.core),this.subscriber=new rv(this,this.logger),this.publisher=new rl(this,this.logger),this.relayUrl=e?.relayUrl||t3,this.projectId=e.projectId,this.bundleId=(0,o.X_B)(),this.provider={}}async init(){this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),await this.transportOpen(),this.initialized=!0,setTimeout(async()=>{0===this.subscriber.topics.length&&0===this.subscriber.pending.size&&(this.logger.info("No topics subscribed to after init, closing transport"),await this.transportClose(),this.transportExplicitlyClosed=!1)},1e4)}get context(){return es(this.logger)}get connected(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===1}get connecting(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===0}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now()})}async subscribe(e,t){var r;this.isInitialized();let n=(null==(r=this.subscriber.topicMap.get(e))?void 0:r[0])||"",i,s=t=>{t.topic===e&&(this.subscriber.off(t4.created,s),i())};return await Promise.all([new Promise(e=>{i=e,this.subscriber.on(t4.created,s)}),new Promise(async r=>{n=await this.subscriber.subscribe(e,t)||n,r()})]),n}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){if(!this.hasExperiencedNetworkDisruption&&this.connected&&this.requestsInFlight.size>0)try{await Promise.all(Array.from(this.requestsInFlight.values()).map(e=>e.promise))}catch(e){this.logger.warn(e)}this.hasExperiencedNetworkDisruption||this.connected?await (0,o.hFY)(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),await this.createProvider(),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;try{await new Promise(async(e,t)=>{let r=()=>{this.provider.off(t6.disconnect,r),t(Error("Connection interrupted while trying to subscribe"))};this.provider.on(t6.disconnect,r),await (0,o.hFY)(this.provider.connect(),(0,R.toMiliseconds)(R.ONE_MINUTE),`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}),this.subscriber.start().catch(e=>{this.logger.error(e),this.onDisconnectHandler()}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(e){if(this.logger.error(e),this.hasExperiencedNetworkDisruption=!0,!this.isConnectionStalled(e.message))throw e}finally{this.connectionAttemptInProgress=!1}}async restartTransport(e){this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await (0,o.Ggh)())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.trace(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e)}this.logger.trace(`Batch of ${t.length} message events processed`)}startPingTimeout(){var e,t,r,n,i;if((0,o.UGU)())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(i=null==(n=null==(r=this.provider)?void 0:r.connection)?void 0:n.socket)||i.once("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e)}}isConnectionStalled(e){return this.staleConnectionErrors.some(t=>e.includes(t))}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new e0(new e5((0,o.$0m)({sdkVersion:"2.14.0",protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId}))),this.registerProviderListeners()}async recordMessageEvent(e){let{topic:t,message:r}=e;await this.messages.set(t,r)}async shouldIgnoreMessageEvent(e){let{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.debug(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isSubscribed(t))return this.logger.debug(`Ignoring message for non-subscribed topic ${t}`),!0;let n=this.messages.has(t,r);return n&&this.logger.debug(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),eZ(e)){if(!e.method.endsWith("_subscription"))return;let t=e.params,{topic:r,message:n,publishedAt:i}=t.data,s={topic:r,message:n,publishedAt:i};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(rk({type:"event",event:t.id},s)),this.events.emit(t.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else eJ(e)&&this.events.emit(t5.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(this.events.emit(t5.message,e),await this.recordMessageEvent(e))}async acknowledgePayload(e){let t=eU(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(t6.payload,this.onPayloadHandler),this.provider.off(t6.connect,this.onConnectHandler),this.provider.off(t6.disconnect,this.onDisconnectHandler),this.provider.off(t6.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await (0,o.Ggh)();(0,o.uwg)(async t=>{e!==t&&(e=t,t?await this.restartTransport().catch(e=>this.logger.error(e)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))})}async onProviderDisconnect(){await this.subscriber.stop(),this.requestsInFlight.clear(),clearTimeout(this.pingTimeout),this.events.emit(t5.disconnect),this.connectionAttemptInProgress=!1,this.transportExplicitlyClosed||setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e))},(0,R.toMiliseconds)(.1))}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){await this.confirmOnlineStateOrThrow(),this.connected||(this.connectionAttemptInProgress&&await new Promise(e=>{let t=setInterval(()=>{this.connected&&(clearInterval(t),e())},this.connectionStatusPollingInterval)}),await this.transportOpen())}}var r$=Object.defineProperty,rC=Object.getOwnPropertySymbols,rP=Object.prototype.hasOwnProperty,rI=Object.prototype.propertyIsEnumerable,rO=(e,t,r)=>t in e?r$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rN=(e,t)=>{for(var r in t||(t={}))rP.call(t,r)&&rO(e,r,t[r]);if(rC)for(var r of rC(t))rI.call(t,r)&&rO(e,r,t[r]);return e};class rM extends eh{constructor(e,t,r,n=tJ,i){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,this.map=new Map,this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=tJ,this.recentlyDeleted=[],this.recentlyDeletedLimit=200,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!(0,o.o8e)(e)?this.map.set(this.getKey(e),e):(0,o.xWS)(e)?this.map.set(e.id,e):(0,o.h1R)(e)&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)},this.set=async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())},this.get=e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e)),this.getAll=e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>e4()(t[r],e[r]))):this.values),this.update=async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let r=rN(rN({},this.getData(e)),t);this.map.set(e,r),await this.persist()},this.delete=async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())},this.logger=eo(t,this.name),this.storagePrefix=n,this.getKey=i}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=(0,o.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class rR{constructor(e,t){this.core=e,this.logger=t,this.name="pairing",this.version="0.3",this.events=new(s()),this.initialized=!1,this.storagePrefix=tJ,this.ignoredPayloadTypes=[o.rVF],this.registeredMethods=[],this.init=async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))},this.register=({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]},this.create=async e=>{this.isInitialized();let t=(0,o.jdp)(),r=await this.core.crypto.setSymKey(t),n=(0,o.gn4)(R.FIVE_MINUTES),i={protocol:"irn"},s=(0,o.Bvr)({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:i,expiryTimestamp:n,methods:e?.methods});return this.core.expirer.set(r,n),await this.pairings.set(r,{topic:r,expiry:n,relay:i,active:!1}),await this.core.relayer.subscribe(r),{topic:r,uri:s}},this.pair=async e=>{this.isInitialized(),this.isValidPair(e);let{topic:t,symKey:r,relay:n,expiryTimestamp:i,methods:s}=(0,o.heJ)(e.uri);if(this.pairings.keys.includes(t)&&this.pairings.get(t).active)throw Error(`Pairing already exists: ${t}. Please try again with a new connection URI.`);let a=i||(0,o.gn4)(R.FIVE_MINUTES),l={topic:t,relay:n,expiry:a,active:!1,methods:s};return this.core.expirer.set(t,a),await this.pairings.set(t,l),e.activatePairing&&await this.activate({topic:t}),this.events.emit(t7.create,l),this.core.crypto.keychain.has(t)||await this.core.crypto.setSymKey(r,t),await this.core.relayer.subscribe(t,{relay:n}),l},this.activate=async({topic:e})=>{this.isInitialized();let t=(0,o.gn4)(R.THIRTY_DAYS);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})},this.ping=async e=>{this.isInitialized(),await this.isValidPing(e);let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:i}=(0,o.H1S)();this.events.once((0,o.E0T)("pairing_ping",e),({error:e})=>{e?i(e):n()}),await r()}},this.updateExpiry=async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})},this.updateMetadata=async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})},this.getPairings=()=>(this.isInitialized(),this.pairings.values),this.disconnect=async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",(0,o.D6H)("USER_DISCONNECTED")),await this.deletePairing(t))},this.sendRequest=async(e,t,r)=>{let n=eF(t,r),i=await this.core.crypto.encode(e,n),s=t9[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,i,s),n.id},this.sendResult=async(e,t,r)=>{let n=eU(e,r),i=await this.core.crypto.encode(t,n),s=t9[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)},this.sendError=async(e,t,r)=>{let n=ez(e,r),i=await this.core.crypto.encode(t,n),s=await this.core.history.get(t,e),o=t9[s.request.method]?t9[s.request.method].res:t9.unregistered_method.res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(n)},this.deletePairing=async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,(0,o.D6H)("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])},this.cleanup=async()=>{let e=this.pairings.getAll().filter(e=>(0,o.BwD)(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))},this.onRelayEventRequest=e=>{let{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return this.onPairingPingRequest(t,r);case"wc_pairingDelete":return this.onPairingDeleteRequest(t,r);default:return this.onUnknownRpcMethodRequest(t,r)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)},this.onPairingPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(t7.ping,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onPairingPingResponse=(e,t)=>{let{id:r}=t;setTimeout(()=>{eQ(t)?this.events.emit((0,o.E0T)("pairing_ping",r),{}):eX(t)&&this.events.emit((0,o.E0T)("pairing_ping",r),{error:t.error})},500)},this.onPairingDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(t7.delete,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodRequest=async(e,t)=>{let{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;let t=(0,o.D6H)("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}},this.onUnknownRpcMethodResponse=e=>{this.registeredMethods.includes(e)||this.logger.error((0,o.D6H)("WC_METHOD_UNSUPPORTED",e))},this.isValidPair=e=>{var t;if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`pair() params: ${e}`);throw Error(t)}if(!(0,o.jvJ)(e.uri)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw Error(t)}let r=(0,o.heJ)(e.uri);if(!(null!=(t=r?.relay)&&t.protocol)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID","pair() uri#relay-protocol");throw Error(e)}if(!(null!=r&&r.symKey)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID","pair() uri#symKey");throw Error(e)}if(null!=r&&r.expiryTimestamp&&(0,R.toMiliseconds)(r?.expiryTimestamp){if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidDisconnect=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)},this.isValidPairingTopic=async e=>{if(!(0,o.M_r)(e,!1)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if((0,o.BwD)(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=(0,o.kCb)("EXPIRED",`pairing topic: ${e}`);throw Error(t)}},this.core=e,this.logger=eo(t,this.name),this.pairings=new rM(this.core,this.logger,this.name,this.storagePrefix)}get context(){return es(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(t5.message,async e=>{let{topic:t,message:r}=e;if(!this.pairings.keys.includes(t)||this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))return;let n=await this.core.crypto.decode(t,r);try{eZ(n)?(this.core.history.set(t,n),this.onRelayEventRequest({topic:t,payload:n})):eJ(n)&&(await this.core.history.resolve(n),await this.onRelayEventResponse({topic:t,payload:n}),this.core.history.delete(t,n.id))}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(rt.expired,async e=>{let{topic:t}=(0,o.iPz)(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(t7.expire,{topic:t}))})}}class rT extends el{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.records=new Map,this.events=new i.EventEmitter,this.name="history",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=tJ,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.set=(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;let n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:(0,o.gn4)(R.THIRTY_DAYS)};this.records.set(n.id,n),this.persist(),this.events.emit(re.created,n)},this.resolve=async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=eX(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(re.updated,t))},this.get=async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t)),this.delete=(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(r=>{r.topic!==e||"u">typeof t&&r.id!==t||(this.records.delete(r.id),this.events.emit(re.deleted,r))}),this.persist()},this.exists=async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e),this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=eo(t,this.name)}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];return this.values.forEach(t=>{if("u">typeof t.response)return;let r={topic:t.topic,request:eF(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(re.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=(0,o.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(re.created,e=>{let t=re.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(re.updated,e=>{let t=re.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(re.deleted,e=>{let t=re.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(j,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,R.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(re.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class rD extends ep{constructor(e,t){super(e,t),this.core=e,this.logger=t,this.expirations=new Map,this.events=new i.EventEmitter,this.name="expirer",this.version="0.3",this.cached=[],this.initialized=!1,this.storagePrefix=tJ,this.init=async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)},this.has=e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}},this.set=(e,t)=>{this.isInitialized();let r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(rt.created,{target:r,expiration:n})},this.get=e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)},this.del=e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(rt.deleted,{target:t,expiration:r})}},this.on=(e,t)=>{this.events.on(e,t)},this.once=(e,t)=>{this.events.once(e,t)},this.off=(e,t)=>{this.events.off(e,t)},this.removeListener=(e,t)=>{this.events.removeListener(e,t)},this.logger=eo(t,this.name)}get context(){return es(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return(0,o.Z42)(e);if("number"==typeof e)return(0,o.GqV)(e);let{message:t}=(0,o.kCb)("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(rt.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=(0,o.kCb)("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:r}=t;(0,R.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(rt.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(j,()=>this.checkExpirations()),this.events.on(rt.created,e=>{let t=rt.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(rt.expired,e=>{let t=rt.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(rt.deleted,e=>{let t=rt.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}}}class rL extends eg{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.name=rr,this.initialized=!1,this.queue=[],this.verifyDisabled=!1,this.init=async e=>{if(this.verifyDisabled||(0,o.b$m)()||!(0,o.jUY)())return;let t=this.getVerifyUrl(e?.verifyUrl);this.verifyUrl!==t&&this.removeIframe(),this.verifyUrl=t;try{await this.createIframe()}catch(e){this.logger.info(`Verify iframe failed to load: ${this.verifyUrl}`),this.logger.info(e),this.verifyDisabled=!0}},this.register=async e=>{this.initialized?this.sendPost(e.attestationId):(this.addToQueue(e.attestationId),await this.init())},this.resolve=async e=>{if(this.isDevEnv)return"";let t=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(e.attestationId,t)},this.fetchAttestation=async(e,t)=>{this.logger.info(`resolving attestation: ${e} from url: ${t}`);let r=this.startAbortTimer(5*R.ONE_SECOND),n=await fetch(`${t}/attestation/${e}`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0},this.addToQueue=e=>{this.queue.push(e)},this.processQueue=()=>{0!==this.queue.length&&(this.queue.forEach(e=>this.sendPost(e)),this.queue=[])},this.sendPost=e=>{var t;try{if(!this.iframe)return;null==(t=this.iframe.contentWindow)||t.postMessage(e,"*"),this.logger.info(`postMessage sent: ${e} ${this.verifyUrl}`)}catch{}},this.createIframe=async()=>{let e;let t=r=>{"verify_ready"===r.data&&(this.onInit(),window.removeEventListener("message",t),e())};await Promise.race([new Promise(r=>{let n=document.getElementById(rr);if(n)return this.iframe=n,this.onInit(),r();window.addEventListener("message",t);let i=document.createElement("iframe");i.id=rr,i.src=`${this.verifyUrl}/${this.projectId}`,i.style.display="none",document.body.append(i),this.iframe=i,e=r}),new Promise((e,r)=>setTimeout(()=>{window.removeEventListener("message",t),r("verify iframe load timeout")},(0,R.toMiliseconds)(R.FIVE_SECONDS)))])},this.onInit=()=>{this.initialized=!0,this.processQueue()},this.removeIframe=()=>{this.iframe&&(this.iframe.remove(),this.iframe=void 0,this.initialized=!1)},this.getVerifyUrl=e=>{let t=e||rn;return ri.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${rn}`),t=rn),t},this.logger=eo(t,this.name),this.verifyUrl=rn,this.abortController=new AbortController,this.isDevEnv=(0,o.UGU)()&&e7.env.IS_VITEST}get context(){return es(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,R.toMiliseconds)(e))}}class rj extends em{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,this.context="echo",this.registerDeviceToken=async e=>{let{clientId:t,token:r,notificationType:n,enableEncrypted:i=!1}=e,s=`https://echo.walletconnect.com/${this.projectId}/clients`;await e9()(s,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:i})})},this.logger=eo(t,this.context)}}var rB=Object.defineProperty,rF=Object.getOwnPropertySymbols,rU=Object.prototype.hasOwnProperty,rz=Object.prototype.propertyIsEnumerable,rq=(e,t,r)=>t in e?rB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,rH=(e,t)=>{for(var r in t||(t={}))rU.call(t,r)&&rq(e,r,t[r]);if(rF)for(var r of rF(t))rz.call(t,r)&&rq(e,r,t[r]);return e};class rG extends ea{constructor(e){var t,r;super(e),this.protocol="wc",this.version=2,this.name=tZ,this.events=new i.EventEmitter,this.initialized=!1,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||t3,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let{logger:n,chunkLoggerController:s}="u">typeof(r={opts:ei({level:"string"==typeof e?.logger&&e.logger?e.logger:tQ.logger}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger}).loggerOverride&&"string"!=typeof r.loggerOverride?{logger:r.loggerOverride,chunkLoggerController:null}:"u">typeof window?function(e){var t,r;let n=new W(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:U()(en(er({},e.opts),{level:"trace",browser:en(er({},null==(r=e.opts)?void 0:r.browser),{write:e=>n.write(e)})})),chunkLoggerController:n}}(r):function(e){var t;let r=new K(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:U()(en(er({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}(r);this.logChunkController=s,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=eo(n,this.name),this.heartbeat=new B,this.crypto=new ro(this,this.logger,e?.keychain),this.history=new rT(this,this.logger),this.expirer=new rD(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new M(rH(rH({},tX),e?.storageOptions)),this.relayer=new rS({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new rR(this,this.logger),this.verify=new rL(this.projectId||"",this.logger),this.echoClient=new rj(this.projectId||"",this.logger)}static async init(e){let t=new rG(e);await t.initialize();let r=await t.crypto.getClientId();return await t.storage.setItem("WALLETCONNECT_CLIENT_ID",r),t}get context(){return es(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(),await this.pairing.init(),this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}}let rV="client",rW=`wc@2:${rV}:`,rK={name:rV,logger:"error"},rY="WALLETCONNECT_DEEPLINK_CHOICE",rZ="Proposal expired",rJ=R.SEVEN_DAYS,rQ={wc_sessionPropose:{req:{ttl:R.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1104},res:{ttl:R.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1106},res:{ttl:R.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:R.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:R.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1112},res:{ttl:R.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:R.ONE_DAY,prompt:!1,tag:1114},res:{ttl:R.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:R.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:R.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:R.FIVE_MINUTES,prompt:!1,tag:1119}}},rX={min:R.FIVE_MINUTES,max:R.SEVEN_DAYS},r0={idle:"IDLE",active:"ACTIVE"},r1=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],r2="wc@1.5:auth:",r3=`${r2}:PUB_KEY`;var r5=Object.defineProperty,r6=Object.defineProperties,r4=Object.getOwnPropertyDescriptors,r8=Object.getOwnPropertySymbols,r9=Object.prototype.hasOwnProperty,r7=Object.prototype.propertyIsEnumerable,ne=(e,t,r)=>t in e?r5(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nt=(e,t)=>{for(var r in t||(t={}))r9.call(t,r)&&ne(e,r,t[r]);if(r8)for(var r of r8(t))r7.call(t,r)&&ne(e,r,t[r]);return e},nr=(e,t)=>r6(e,r4(t));class nn extends eb{constructor(e){super(e),this.name="engine",this.events=new(s()),this.initialized=!1,this.requestQueue={state:r0.idle,queue:[]},this.sessionRequestQueue={state:r0.idle,queue:[]},this.requestQueueDelay=R.ONE_SECOND,this.expectedPairingMethodMap=new Map,this.recentlyDeletedMap=new Map,this.recentlyDeletedLimit=200,this.relayMessageCache=[],this.init=async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),this.client.core.pairing.register({methods:Object.keys(rQ)}),this.initialized=!0,setTimeout(()=>{this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,R.toMiliseconds)(this.requestQueueDelay)))},this.connect=async e=>{await this.isInitialized();let t=nr(nt({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t);let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:s,relays:a}=t,l=r,u,c=!1;try{l&&(c=this.client.core.pairing.pairings.get(l).active)}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${l}) failed`),e}if(!l||!c){let{topic:e,uri:t}=await this.client.core.pairing.create();l=e,u=t}if(!l){let{message:e}=(0,o.kCb)("NO_MATCHING_KEY",`connect() pairing topic: ${l}`);throw Error(e)}let d=await this.client.core.crypto.generateKeyPair(),h=rQ.wc_sessionPropose.req.ttl||R.FIVE_MINUTES,f=(0,o.gn4)(h),p=nt({requiredNamespaces:n,optionalNamespaces:i,relays:a??[{protocol:"irn"}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:f,pairingTopic:l},s&&{sessionProperties:s}),{reject:g,resolve:m,done:y}=(0,o.H1S)(h,rZ);this.events.once((0,o.E0T)("session_connect"),async({error:e,session:t})=>{if(e)g(e);else if(t){t.self.publicKey=d;let e=nr(nt({},t),{pairingTopic:p.pairingTopic,requiredNamespaces:p.requiredNamespaces,optionalNamespaces:p.optionalNamespaces});await this.client.session.set(t.topic,e),await this.setExpiry(t.topic,t.expiry),l&&await this.client.core.pairing.updateMetadata({topic:l,metadata:t.peer.metadata}),this.cleanupDuplicatePairings(e),m(e)}});let b=await this.sendRequest({topic:l,method:"wc_sessionPropose",params:p,throwOnFailedPublish:!0});return await this.setProposal(b,nt({id:b},p)),{uri:u,approval:y}},this.pair=async e=>{await this.isInitialized();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}},this.approve=async e=>{let t;await this.isInitialized();try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),e}let{id:r,relayProtocol:n,namespaces:i,sessionProperties:s,sessionConfig:a}=e;try{t=this.client.proposal.get(r)}catch(e){throw this.client.logger.error(`approve() -> proposal.get(${r}) failed`),e}let{pairingTopic:l,proposer:u,requiredNamespaces:c,optionalNamespaces:d}=t,h=await this.client.core.crypto.generateKeyPair(),f=u.publicKey,p=await this.client.core.crypto.generateSharedKey(h,f),g=nt(nt({relay:{protocol:n??"irn"},namespaces:i,controller:{publicKey:h,metadata:this.client.metadata},expiry:(0,o.gn4)(rJ)},s&&{sessionProperties:s}),a&&{sessionConfig:a});await this.client.core.relayer.subscribe(p);let m=nr(nt({},g),{topic:p,requiredNamespaces:c,optionalNamespaces:d,pairingTopic:l,acknowledged:!1,self:g.controller,peer:{publicKey:u.publicKey,metadata:u.metadata},controller:h});await this.client.session.set(p,m);try{await this.sendResult({id:r,topic:l,result:{relay:{protocol:n??"irn"},responderPublicKey:h},throwOnFailedPublish:!0}),await this.sendRequest({topic:p,method:"wc_sessionSettle",params:g,throwOnFailedPublish:!0})}catch(e){throw this.client.logger.error(e),this.client.session.delete(p,(0,o.D6H)("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(p),e}return await this.client.core.pairing.updateMetadata({topic:l,metadata:u.metadata}),await this.client.proposal.delete(r,(0,o.D6H)("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:l}),await this.setExpiry(p,(0,o.gn4)(rJ)),{topic:p,acknowledged:()=>new Promise(e=>setTimeout(()=>e(this.client.session.get(p)),500))}},this.reject=async e=>{let t;await this.isInitialized();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:r,reason:n}=e;try{t=this.client.proposal.get(r).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),e}t&&(await this.sendError({id:r,topic:t,error:n,rpcOpts:rQ.wc_sessionPropose.reject}),await this.client.proposal.delete(r,(0,o.D6H)("USER_DISCONNECTED")))},this.update=async e=>{await this.isInitialized();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:r}=e,{done:n,resolve:i,reject:s}=(0,o.H1S)(),a=ej(),l=eB().toString(),u=this.client.session.get(t).namespaces;return this.events.once((0,o.E0T)("session_update",a),({error:e})=>{e?s(e):i()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:a,relayRpcId:l}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:u}),s(e)}),{acknowledged:n}},this.extend=async e=>{await this.isInitialized();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,r=ej(),{done:n,resolve:i,reject:s}=(0,o.H1S)();return this.events.once((0,o.E0T)("session_extend",r),({error:e})=>{e?s(e):i()}),await this.setExpiry(t,(0,o.gn4)(rJ)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{s(e)}),{acknowledged:n}},this.request=async e=>{await this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:r,topic:n,expiry:i=rQ.wc_sessionRequest.req.ttl}=e,s=this.client.session.get(n),a=ej(),l=eB().toString(),{done:u,resolve:c,reject:d}=(0,o.H1S)(i,"Request expired. Please try again.");return this.events.once((0,o.E0T)("session_request",a),({error:e,result:t})=>{e?d(e):c(t)}),await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:a,relayRpcId:l,topic:n,method:"wc_sessionRequest",params:{request:nr(nt({},r),{expiryTimestamp:(0,o.gn4)(i)}),chainId:t},expiry:i,throwOnFailedPublish:!0}).catch(e=>d(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:a}),e()}),new Promise(async e=>{var t;if(!(null!=(t=s.sessionConfig)&&t.disableDeepLink)){let e=await (0,o.bW6)(this.client.core.storage,rY);(0,o.HhN)({id:a,topic:n,wcDeepLink:e})}e()}),u()]).then(e=>e[2])},this.respond=async e=>{await this.isInitialized(),await this.isValidRespond(e);let{topic:t,response:r}=e,{id:n}=r;eQ(r)?await this.sendResult({id:n,topic:t,result:r.result,throwOnFailedPublish:!0}):eX(r)&&await this.sendError({id:n,topic:t,error:r.error}),this.cleanupAfterResponse(e)},this.ping=async e=>{await this.isInitialized();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=ej(),r=eB().toString(),{done:n,resolve:i,reject:s}=(0,o.H1S)();this.events.once((0,o.E0T)("session_ping",e),({error:e})=>{e?s(e):i()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),n()])}else this.client.core.pairing.pairings.keys.includes(t)&&await this.client.core.pairing.ping({topic:t})},this.emit=async e=>{await this.isInitialized(),await this.isValidEmit(e);let{topic:t,event:r,chainId:n}=e,i=eB().toString();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n},throwOnFailedPublish:!0,relayRpcId:i})},this.disconnect=async e=>{await this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:(0,o.D6H)("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=(0,o.kCb)("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}},this.find=e=>(this.isInitialized(),this.client.session.getAll().filter(t=>(0,o.Ih8)(t,e))),this.getPendingSessionRequests=()=>this.client.pendingRequest.getAll(),this.authenticate=async e=>{this.isInitialized(),this.isValidAuthenticate(e);let{chains:t,statement:r="",uri:n,domain:i,nonce:s,type:a,exp:l,nbf:u,methods:c=[],expiry:d}=e,h=[...e.resources||[]],{topic:f,uri:p}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"]});this.client.logger.info({message:"Generated new pairing",pairing:{topic:f,uri:p}});let g=await this.client.core.crypto.generateKeyPair(),m=(0,o.YmJ)(g);if(await Promise.all([this.client.auth.authKeys.set(r3,{responseTopic:m,publicKey:g}),this.client.auth.pairingTopics.set(m,{topic:m,pairingTopic:f})]),await this.client.core.relayer.subscribe(m),this.client.logger.info(`sending request to new pairing topic: ${f}`),c.length>0){let{namespace:e}=(0,o.DQe)(t[0]),r=(0,o.IkP)(e,"request",c);(0,o.hA9)(h)&&(r=(0,o.qJM)(r,h.pop())),h.push(r)}let y=d&&d>rQ.wc_sessionAuthenticate.req.ttl?d:rQ.wc_sessionAuthenticate.req.ttl,b={authPayload:{type:a??"caip122",chains:t,statement:r,aud:n,domain:i,version:"1",nonce:s,iat:new Date().toISOString(),exp:l,nbf:u,resources:h},requester:{publicKey:g,metadata:this.client.metadata},expiryTimestamp:(0,o.gn4)(y)},v={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:t,methods:[...new Set(["personal_sign",...c])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:f,proposer:{publicKey:g,metadata:this.client.metadata},expiryTimestamp:(0,o.gn4)(rQ.wc_sessionPropose.req.ttl)},{done:w,resolve:_,reject:E}=(0,o.H1S)(y,"Request expired"),A=async({error:e,session:t})=>{if(this.events.off((0,o.E0T)("session_request",k),x),e)E(e);else if(t){t.self.publicKey=g,await this.client.session.set(t.topic,t),await this.setExpiry(t.topic,t.expiry),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:t.peer.metadata});let e=this.client.session.get(t.topic);await this.deleteProposal(S),_({session:e})}},x=async e=>{let t;if(await this.deletePendingAuthRequest(k,{message:"fulfilled",code:0}),e.error){let t=(0,o.D6H)("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off((0,o.E0T)("session_connect"),A),E(e.error.message))}await this.deleteProposal(S),this.events.off((0,o.E0T)("session_connect"),A);let{cacaos:r,responder:n}=e.result,i=[],s=[];for(let e of r){await (0,o.c4l)({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),E((0,o.D6H)("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,r=(0,o.hA9)(t.resources),n=[(0,o.DJo)(t.iss)],a=(0,o.NmC)(t.iss);if(r){let e=(0,o.Y31)(r),t=(0,o.ouN)(r);i.push(...e),n.push(...t)}for(let e of n)s.push(`${e}:${a}`)}let a=await this.client.core.crypto.generateSharedKey(g,n.publicKey);i.length>0&&(t={topic:a,acknowledged:!0,self:{publicKey:g,metadata:this.client.metadata},peer:n,controller:n.publicKey,expiry:(0,o.gn4)(rJ),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:f,namespaces:(0,o.E12)([...new Set(i)],[...new Set(s)])},await this.client.core.relayer.subscribe(a),await this.client.session.set(a,t),f&&await this.client.core.pairing.updateMetadata({topic:f,metadata:n.metadata}),t=this.client.session.get(a)),_({auths:r,session:t})},k=ej(),S=ej();this.events.once((0,o.E0T)("session_connect"),A),this.events.once((0,o.E0T)("session_request",k),x);try{await Promise.all([this.sendRequest({topic:f,method:"wc_sessionAuthenticate",params:b,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:k}),this.sendRequest({topic:f,method:"wc_sessionPropose",params:v,expiry:rQ.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:S})])}catch(e){throw this.events.off((0,o.E0T)("session_connect"),A),this.events.off((0,o.E0T)("session_request",k),x),e}return await this.setProposal(S,nt({id:S},v)),await this.setAuthRequest(k,{request:nr(nt({},b),{verifyContext:{}}),pairingTopic:f}),{uri:p,response:w}},this.approveSessionAuthenticate=async e=>{let t;this.isInitialized();let{id:r,auths:n}=e,i=this.getPendingAuthRequest(r);if(!i)throw Error(`Could not find pending auth request with id ${r}`);let s=i.requester.publicKey,a=await this.client.core.crypto.generateKeyPair(),l=(0,o.YmJ)(s),u={type:o.rVF,receiverPublicKey:s,senderPublicKey:a},c=[],d=[];for(let e of n){if(!await (0,o.c4l)({cacao:e,projectId:this.client.core.projectId})){let e=(0,o.D6H)("SESSION_SETTLEMENT_FAILED","Signature verification failed");throw await this.sendError({id:r,topic:l,error:e,encodeOpts:u}),Error(e.message)}let{p:t}=e,n=(0,o.hA9)(t.resources),i=[(0,o.DJo)(t.iss)],s=(0,o.NmC)(t.iss);if(n){let e=(0,o.Y31)(n),t=(0,o.ouN)(n);c.push(...e),i.push(...t)}for(let e of i)d.push(`${e}:${s}`)}let h=await this.client.core.crypto.generateSharedKey(a,s);return c?.length>0&&(t={topic:h,acknowledged:!0,self:{publicKey:a,metadata:this.client.metadata},peer:{publicKey:s,metadata:i.requester.metadata},controller:s,expiry:(0,o.gn4)(rJ),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:i.pairingTopic,namespaces:(0,o.E12)([...new Set(c)],[...new Set(d)])},await this.client.core.relayer.subscribe(h),await this.client.session.set(h,t),await this.client.core.pairing.updateMetadata({topic:i.pairingTopic,metadata:i.requester.metadata})),await this.sendResult({topic:l,id:r,result:{cacaos:n,responder:{publicKey:a,metadata:this.client.metadata}},encodeOpts:u,throwOnFailedPublish:!0}),await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:i.pairingTopic}),{session:t}},this.rejectSessionAuthenticate=async e=>{await this.isInitialized();let{id:t,reason:r}=e,n=this.getPendingAuthRequest(t);if(!n)throw Error(`Could not find pending auth request with id ${t}`);let i=n.requester.publicKey,s=await this.client.core.crypto.generateKeyPair(),a=(0,o.YmJ)(i),l={type:o.rVF,receiverPublicKey:i,senderPublicKey:s};await this.sendError({id:t,topic:a,error:r,encodeOpts:l,rpcOpts:rQ.wc_sessionAuthenticate.reject}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.client.proposal.delete(t,(0,o.D6H)("USER_DISCONNECTED"))},this.formatAuthMessage=e=>{this.isInitialized();let{request:t,iss:r}=e;return(0,o.wvx)(t,r)},this.processRelayMessageCache=()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)},this.cleanupDuplicatePairings=async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var n,i;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(i=r.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}},this.deleteSession=async e=>{var t;let{topic:r,expirerHasDeleted:n=!1,emitEvent:i=!0,id:s=0}=e,{self:a}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,(0,o.D6H)("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(a.publicKey)&&await this.client.core.crypto.deleteKeyPair(a.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(rY).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,(0,o.D6H)("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=r0.idle),i&&this.client.events.emit("session_delete",{id:s,topic:r})},this.deleteProposal=async(e,t)=>{await Promise.all([this.client.proposal.delete(e,(0,o.D6H)("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")},this.deletePendingSessionRequest=async(e,t,r=!1)=>{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=r0.idle,this.client.events.emit("session_request_expire",{id:e}))},this.deletePendingAuthRequest=async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])},this.setExpiry=async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))},this.setProposal=async(e,t)=>{this.client.core.expirer.set(e,(0,o.gn4)(rQ.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)},this.setAuthRequest=async(e,t)=>{let{request:r,pairingTopic:n}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:n,verifyContext:r.verifyContext})},this.setPendingSessionRequest=async e=>{let{id:t,topic:r,params:n,verifyContext:i}=e,s=n.request.expiryTimestamp||(0,o.gn4)(rQ.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,s),await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:i})},this.sendRequest=async e=>{let t;let{topic:r,method:n,params:i,expiry:s,relayRpcId:a,clientRpcId:l,throwOnFailedPublish:u}=e,c=eF(n,i,l);if((0,o.jUY)()&&r1.includes(n)){let e=(0,o.rjm)(JSON.stringify(c));this.client.core.verify.register({attestationId:e})}try{t=await this.client.core.crypto.encode(r,c)}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${r} failed`),e}let d=rQ[n].req;return s&&(d.ttl=s),a&&(d.id=a),this.client.core.history.set(r,c),u?(d.internal=nr(nt({},d.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(r,t,d)):this.client.core.relayer.publish(r,t,d).catch(e=>this.client.logger.error(e)),c.id},this.sendResult=async e=>{let t,r;let{id:n,topic:i,result:s,throwOnFailedPublish:o,encodeOpts:a}=e,l=eU(n,s);try{t=await this.client.core.crypto.encode(i,l,a)}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${i} failed`),e}try{r=await this.client.core.history.get(i,n)}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${i}, ${n}) failed`),e}let u=rQ[r.request.method].res;o?(u.internal=nr(nt({},u.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,t,u)):this.client.core.relayer.publish(i,t,u).catch(e=>this.client.logger.error(e)),await this.client.core.history.resolve(l)},this.sendError=async e=>{let t,r;let{id:n,topic:i,error:s,encodeOpts:o,rpcOpts:a}=e,l=ez(n,s);try{t=await this.client.core.crypto.encode(i,l,o)}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${i} failed`),e}try{r=await this.client.core.history.get(i,n)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${i}, ${n}) failed`),e}let u=a||rQ[r.request.method].res;this.client.core.relayer.publish(i,t,u),await this.client.core.history.resolve(l)},this.cleanup=async()=>{let e=[],t=[];this.client.session.getAll().forEach(t=>{let r=!1;(0,o.BwD)(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{(0,o.BwD)(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])},this.onRelayEventRequest=async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()},this.processRequestsQueue=async()=>{if(this.requestQueue.state===r0.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=r0.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=r0.idle},this.processRequest=async e=>{let{topic:t,payload:r}=e,n=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:n}))switch(n){case"wc_sessionPropose":return await this.onSessionProposeRequest(t,r);case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest(t,r);case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest(t,r);default:return this.client.logger.info(`Unsupported request method ${n}`)}},this.onRelayEventResponse=async e=>{let{topic:t,payload:r}=e,n=(await this.client.core.history.get(t,r.id)).request.method;switch(n){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${n}`)}},this.onRelayEventUnknownPayload=e=>{let{topic:t}=e,{message:r}=(0,o.kCb)("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)},this.shouldIgnorePairingRequest=e=>{let{topic:t,requestMethod:r}=e,n=this.expectedPairingMethodMap.get(t);return!(!n||n.includes(r))&&!!(n.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)},this.onSessionProposeRequest=async(e,t)=>{let{params:r,id:n}=t;try{this.isValidConnect(nt({},t.params));let i=r.expiryTimestamp||(0,o.gn4)(rQ.wc_sessionPropose.req.ttl),s=nt({id:n,pairingTopic:e,expiryTimestamp:i},r);await this.setProposal(n,s);let a=(0,o.rjm)(JSON.stringify(t)),l=await this.getVerifyContext(a,s.proposer.metadata);this.client.events.emit("session_proposal",{id:n,params:s,verifyContext:l})}catch(t){await this.sendError({id:n,topic:e,error:t,rpcOpts:rQ.wc_sessionPropose.autoReject}),this.client.logger.error(t)}},this.onSessionProposeResponse=async(e,t)=>{let{id:r}=t;if(eQ(t)){let{result:n}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:n});let i=this.client.proposal.get(r);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:i});let s=i.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});let o=n.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:o});let a=await this.client.core.crypto.generateSharedKey(s,o);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",sessionTopic:a});let l=await this.client.core.relayer.subscribe(a);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:l}),await this.client.core.pairing.activate({topic:e})}else if(eX(t)){await this.client.proposal.delete(r,(0,o.D6H)("USER_DISCONNECTED"));let e=(0,o.E0T)("session_connect");if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit((0,o.E0T)("session_connect"),{error:t.error})}},this.onSessionSettleRequest=async(e,t)=>{let{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);let{relay:r,controller:i,expiry:s,namespaces:a,sessionProperties:l,sessionConfig:u}=t.params,c=nt(nt({topic:e,relay:r,expiry:s,namespaces:a,acknowledged:!0,pairingTopic:"",requiredNamespaces:{},optionalNamespaces:{},controller:i.publicKey,self:{publicKey:"",metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},l&&{sessionProperties:l}),u&&{sessionConfig:u});await this.sendResult({id:t.id,topic:e,result:!0,throwOnFailedPublish:!0});let d=(0,o.E0T)("session_connect");if(0===this.events.listenerCount(d))throw Error(`emitting ${d} without any listeners 997`);this.events.emit((0,o.E0T)("session_connect"),{session:c})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionSettleResponse=async(e,t)=>{let{id:r}=t;eQ(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit((0,o.E0T)("session_approve",r),{})):eX(t)&&(await this.client.session.delete(e,(0,o.D6H)("USER_DISCONNECTED")),this.events.emit((0,o.E0T)("session_approve",r),{error:t.error}))},this.onSessionUpdateRequest=async(e,t)=>{let{params:r,id:n}=t;try{let t=`${e}_session_update`,i=o.O6B.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.info(`Discarding out of sync request - ${n}`),this.sendError({id:n,topic:e,error:(0,o.D6H)("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(nt({topic:e},r));try{o.O6B.set(t,n),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0,throwOnFailedPublish:!0})}catch(e){throw o.O6B.delete(t),e}this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.isRequestOutOfSync=(e,t)=>parseInt(t.toString().slice(0,-3))<=parseInt(e.toString().slice(0,-3)),this.onSessionUpdateResponse=(e,t)=>{let{id:r}=t,n=(0,o.E0T)("session_update",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);eQ(t)?this.events.emit((0,o.E0T)("session_update",r),{}):eX(t)&&this.events.emit((0,o.E0T)("session_update",r),{error:t.error})},this.onSessionExtendRequest=async(e,t)=>{let{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,(0,o.gn4)(rJ)),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionExtendResponse=(e,t)=>{let{id:r}=t,n=(0,o.E0T)("session_extend",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);eQ(t)?this.events.emit((0,o.E0T)("session_extend",r),{}):eX(t)&&this.events.emit((0,o.E0T)("session_extend",r),{error:t.error})},this.onSessionPingRequest=async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionPingResponse=(e,t)=>{let{id:r}=t,n=(0,o.E0T)("session_ping",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);setTimeout(()=>{eQ(t)?this.events.emit((0,o.E0T)("session_ping",r),{}):eX(t)&&this.events.emit((0,o.E0T)("session_ping",r),{error:t.error})},500)},this.onSessionDeleteRequest=async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),await Promise.all([new Promise(t=>{this.client.core.relayer.once(t5.publish,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:(0,o.D6H)("USER_DISCONNECTED")})])}catch(e){this.client.logger.error(e)}},this.onSessionRequest=async(e,t)=>{var r;let{id:n,params:i}=t;try{await this.isValidRequest(nt({topic:e},i));let t=(0,o.rjm)(JSON.stringify(eF("wc_sessionRequest",i,n))),s=this.client.session.get(e),a=await this.getVerifyContext(t,s.peer.metadata),l={id:n,topic:e,params:i,verifyContext:a};await this.setPendingSessionRequest(l),null!=(r=this.client.signConfig)&&r.disableRequestQueue?this.emitSessionRequest(l):(this.addSessionRequestToSessionRequestQueue(l),this.processSessionRequestQueue())}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionRequestResponse=(e,t)=>{let{id:r}=t,n=(0,o.E0T)("session_request",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);eQ(t)?this.events.emit((0,o.E0T)("session_request",r),{result:t.result}):eX(t)&&this.events.emit((0,o.E0T)("session_request",r),{error:t.error})},this.onSessionEventRequest=async(e,t)=>{let{id:r,params:n}=t;try{let t=`${e}_session_event_${n.event.name}`,i=o.O6B.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(nt({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),o.O6B.set(t,r)}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}},this.onSessionAuthenticateResponse=(e,t)=>{let{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),eQ(t)?this.events.emit((0,o.E0T)("session_request",r),{result:t.result}):eX(t)&&this.events.emit((0,o.E0T)("session_request",r),{error:t.error})},this.onSessionAuthenticateRequest=async(e,t)=>{try{let{requester:r,authPayload:n,expiryTimestamp:i}=t.params,s=(0,o.rjm)(JSON.stringify(t)),a=await this.getVerifyContext(s,this.client.metadata),l={requester:r,pairingTopic:e,id:t.id,authPayload:n,verifyContext:a,expiryTimestamp:i};await this.setAuthRequest(t.id,{request:l,pairingTopic:e}),this.client.events.emit("session_authenticate",{topic:e,params:t.params,id:t.id,verifyContext:a})}catch(s){this.client.logger.error(s);let r=t.params.requester.publicKey,n=await this.client.core.crypto.generateKeyPair(),i={type:o.rVF,receiverPublicKey:r,senderPublicKey:n};await this.sendError({id:t.id,topic:e,error:s,encodeOpts:i,rpcOpts:rQ.wc_sessionAuthenticate.autoReject})}},this.addSessionRequestToSessionRequestQueue=e=>{this.sessionRequestQueue.queue.push(e)},this.cleanupAfterResponse=e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=r0.idle,this.processSessionRequestQueue()},(0,R.toMiliseconds)(this.requestQueueDelay))},this.cleanupPendingSentRequestsForTopic=({topic:e,error:t})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{let r=e.request.id,n=(0,o.E0T)("session_request",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);this.events.emit((0,o.E0T)("session_request",e.request.id),{error:t})})},this.processSessionRequestQueue=()=>{if(this.sessionRequestQueue.state===r0.active){this.client.logger.info("session request queue is already active.");return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=r0.active,this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}},this.emitSessionRequest=e=>{this.client.events.emit("session_request",e)},this.onPairingCreated=e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);t&&this.onSessionProposeRequest(e.topic,eF("wc_sessionPropose",{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties},t.id))},this.isValidConnect=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:i,relays:s}=e;if((0,o.o8e)(t)||await this.isValidPairingTopic(t),!(0,o.PMr)(s,!0)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`connect() relays: ${s}`);throw Error(e)}(0,o.o8e)(r)||0===(0,o.L5o)(r)||this.validateNamespaces(r,"requiredNamespaces"),(0,o.o8e)(n)||0===(0,o.L5o)(n)||this.validateNamespaces(n,"optionalNamespaces"),(0,o.o8e)(i)||this.validateSessionProps(i,"sessionProperties")},this.validateNamespaces=(e,t)=>{let r=(0,o.naP)(e,"connect()",t);if(r)throw Error(r.message)},this.isValidApprove=async e=>{if(!(0,o.EJd)(e))throw Error((0,o.kCb)("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:r,relayProtocol:n,sessionProperties:i}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let s=this.client.proposal.get(t),a=(0,o.ing)(r,"approve()");if(a)throw Error(a.message);let l=(0,o.rFo)(s.requiredNamespaces,r,"approve()");if(l)throw Error(l.message);if(!(0,o.M_r)(n,!0)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw Error(e)}(0,o.o8e)(i)||this.validateSessionProps(i,"sessionProperties")},this.isValidReject=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!(0,o.H4H)(r)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidSessionSettleRequest=e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}let{relay:t,controller:r,namespaces:n,expiry:i}=e;if(!(0,o.Z26)(t)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let s=(0,o.DdM)(r,"onSessionSettleRequest()");if(s)throw Error(s.message);let a=(0,o.ing)(n,"onSessionSettleRequest()");if(a)throw Error(a.message);if((0,o.BwD)(i)){let{message:e}=(0,o.kCb)("EXPIRED","onSessionSettleRequest()");throw Error(e)}},this.isValidUpdate=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let n=this.client.session.get(t),i=(0,o.ing)(r,"update()");if(i)throw Error(i.message);let s=(0,o.rFo)(n.requiredNamespaces,r,"update()");if(s)throw Error(s.message)},this.isValidExtend=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)},this.isValidRequest=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:t,request:r,chainId:n,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:s}=this.client.session.get(t);if(!(0,o.p8o)(s,n)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`request() chainId: ${n}`);throw Error(e)}if(!(0,o.hHR)(r)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw Error(e)}if(!(0,o.alS)(s,n,r.method)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`request() method: ${r.method}`);throw Error(e)}if(i&&!(0,o.ONw)(i,rX)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`request() expiry: ${i}. Expiry must be a number (in seconds) between ${rX.min} and ${rX.max}`);throw Error(e)}},this.isValidRespond=async e=>{var t;if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!(0,o.JTI)(n)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw Error(e)}},this.isValidPing=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidEmit=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);let{namespaces:i}=this.client.session.get(t);if(!(0,o.p8o)(i,n)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw Error(e)}if(!(0,o.nfW)(r)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw Error(e)}if(!(0,o.B95)(i,n,r.name)){let{message:e}=(0,o.kCb)("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw Error(e)}},this.isValidDisconnect=async e=>{if(!(0,o.EJd)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)},this.isValidAuthenticate=e=>{let{chains:t,uri:r,domain:n,nonce:i}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!(0,o.M_r)(r,!1))throw Error("uri is required parameter");if(!(0,o.M_r)(n,!1))throw Error("domain is required parameter");if(!(0,o.M_r)(i,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>(0,o.DQe)(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:s}=(0,o.DQe)(t[0]);if("eip155"!==s)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")},this.getVerifyContext=async(e,t)=>{let r={verified:{verifyUrl:t.verifyUrl||rn,validation:"UNKNOWN",origin:t.url||""}};try{let n=await this.client.core.verify.resolve({attestationId:e,verifyUrl:t.verifyUrl});n&&(r.verified.origin=n.origin,r.verified.isScam=n.isScam,r.verified.validation=n.origin===new URL(t.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.info(e)}return this.client.logger.info(`Verify context: ${JSON.stringify(r)}`),r},this.validateSessionProps=(e,t)=>{Object.values(e).forEach(e=>{if(!(0,o.M_r)(e,!1)){let{message:r}=(0,o.kCb)("MISSING_OR_INVALID",`${t} must be in Record format. Received: ${JSON.stringify(e)}`);throw Error(r)}})},this.getPendingAuthRequest=e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0},this.addToRecentlyDeleted=(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;for(let r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}},this.checkRecentlyDeleted=e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:r}=(0,o.kCb)("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(r)}}}async isInitialized(){if(!this.initialized){let{message:e}=(0,o.kCb)("NOT_INITIALIZED",this.name);throw Error(e)}await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(t5.message,e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):this.onRelayMessage(e)})}async onRelayMessage(e){let{topic:t,message:r}=e,{publicKey:n}=this.client.auth.authKeys.keys.includes(r3)?this.client.auth.authKeys.get(r3):{responseTopic:void 0,publicKey:void 0},i=await this.client.core.crypto.decode(t,r,{receiverPublicKey:n});try{eZ(i)?(this.client.core.history.set(t,i),this.onRelayEventRequest({topic:t,payload:i})):eJ(i)?(await this.client.core.history.resolve(i),await this.onRelayEventResponse({topic:t,payload:i}),this.client.core.history.delete(t,i.id)):this.onRelayEventUnknownPayload({topic:t,payload:i})}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(rt.expired,async e=>{let{topic:t,id:r}=(0,o.iPz)(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,(0,o.kCb)("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,(0,o.kCb)("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(t7.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(t7.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!(0,o.M_r)(e,!1)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if((0,o.BwD)(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=(0,o.kCb)("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!(0,o.M_r)(e,!1)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if((0,o.BwD)(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=(0,o.kCb)("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if((0,o.M_r)(e,!1)){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!(0,o.Q01)(e)){let{message:t}=(0,o.kCb)("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=(0,o.kCb)("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if((0,o.BwD)(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=(0,o.kCb)("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class ni extends rM{constructor(e,t){super(e,t,"proposal",rW),this.core=e,this.logger=t}}class ns extends rM{constructor(e,t){super(e,t,"session",rW),this.core=e,this.logger=t}}class no extends rM{constructor(e,t){super(e,t,"request",rW,e=>e.id),this.core=e,this.logger=t}}class na extends rM{constructor(e,t){super(e,t,"authKeys",r2,()=>r3),this.core=e,this.logger=t}}class nl extends rM{constructor(e,t){super(e,t,"pairingTopics",r2),this.core=e,this.logger=t}}class nu extends rM{constructor(e,t){super(e,t,"requests",r2,e=>e.id),this.core=e,this.logger=t}}class nc{constructor(e,t){this.core=e,this.logger=t,this.authKeys=new na(this.core,this.logger),this.pairingTopics=new nl(this.core,this.logger),this.requests=new nu(this.core,this.logger)}async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}class nd extends ey{constructor(e){super(e),this.protocol="wc",this.version=2,this.name=rK.name,this.events=new i.EventEmitter,this.on=(e,t)=>this.events.on(e,t),this.once=(e,t)=>this.events.once(e,t),this.off=(e,t)=>this.events.off(e,t),this.removeListener=(e,t)=>this.events.removeListener(e,t),this.removeAllListeners=e=>this.events.removeAllListeners(e),this.connect=async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}},this.pair=async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}},this.approve=async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}},this.reject=async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}},this.update=async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}},this.extend=async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}},this.request=async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}},this.respond=async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}},this.ping=async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}},this.emit=async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}},this.disconnect=async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}},this.find=e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}},this.getPendingSessionRequests=()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}},this.authenticate=async e=>{try{return await this.engine.authenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.formatAuthMessage=e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}},this.approveSessionAuthenticate=async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.rejectSessionAuthenticate=async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}},this.name=e?.name||rK.name,this.metadata=e?.metadata||(0,o.DaH)(),this.signConfig=e?.signConfig;let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:U()(ei({level:e?.logger||rK.logger}));this.core=e?.core||new rG(e),this.logger=eo(t,this.name),this.session=new ns(this.core,this.logger),this.proposal=new ni(this.core,this.logger),this.pendingRequest=new no(this.core,this.logger),this.engine=new nn(this),this.auth=new nc(this.core,this.logger)}static async init(e){let t=new nd(e);return await t.initialize(),t}get context(){return es(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.engine.init(),await this.auth.init(),this.core.verify.init({verifyUrl:this.metadata.verifyUrl}),this.logger.info("SignClient Initialization Success"),this.engine.processRelayMessageCache()}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}var nh=r(55151),nf=r.n(nh),np=Object.defineProperty,ng=Object.defineProperties,nm=Object.getOwnPropertyDescriptors,ny=Object.getOwnPropertySymbols,nb=Object.prototype.hasOwnProperty,nv=Object.prototype.propertyIsEnumerable,nw=(e,t,r)=>t in e?np(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n_=(e,t)=>{for(var r in t||(t={}))nb.call(t,r)&&nw(e,r,t[r]);if(ny)for(var r of ny(t))nv.call(t,r)&&nw(e,r,t[r]);return e},nE=(e,t)=>ng(e,nm(t));let nA={headers:{Accept:"application/json","Content-Type":"application/json"},method:"POST"};class nx{constructor(e,t=!1){if(this.url=e,this.disableProviderPing=t,this.events=new i.EventEmitter,this.isAvailable=!1,this.registering=!1,!eW(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);this.url=e,this.disableProviderPing=t}get connected(){return this.isAvailable}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){if(!this.isAvailable)throw Error("Connection already closed");this.onClose()}async send(e){this.isAvailable||await this.register();try{let t=x(e),r=await (await nf()(this.url,nE(n_({},nA),{body:t}))).json();this.onPayload({data:r})}catch(t){this.onError(e.id,t)}}async register(e=this.url){if(!eW(e))throw Error(`Provided URL is not compatible with HTTP connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.isAvailable>"u")return t(Error("HTTP connection is missing or invalid"));e()})})}this.url=e,this.registering=!0;try{if(!this.disableProviderPing){let t=x({id:1,jsonrpc:"2.0",method:"test",params:[]});await nf()(e,nE(n_({},nA),{body:t}))}this.onOpen()}catch(t){let e=this.parseError(t);throw this.events.emit("register_error",e),this.onClose(),e}}onOpen(){this.isAvailable=!0,this.registering=!1,this.events.emit("open")}onClose(){this.isAvailable=!1,this.registering=!1,this.events.emit("close")}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?A(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=ez(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return eD(e,t,"HTTP")}resetMaxListeners(){this.events.getMaxListeners()>10&&this.events.setMaxListeners(10)}}let nk="error",nS="wc@2:universal_provider:",n$="generic",nC="default_chain_changed";var nP="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},nI={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors */!function(e,t){(function(){var r,n="Expected a function",i="__lodash_hash_undefined__",s="__lodash_placeholder__",o=1/0,a=0/0,l=[["ary",128],["bind",1],["bindKey",2],["curry",8],["curryRight",16],["flip",512],["partial",32],["partialRight",64],["rearg",256]],u="[object Arguments]",c="[object Array]",d="[object Boolean]",h="[object Date]",f="[object Error]",p="[object Function]",g="[object GeneratorFunction]",m="[object Map]",y="[object Number]",b="[object Object]",v="[object Promise]",w="[object RegExp]",_="[object Set]",E="[object String]",A="[object Symbol]",x="[object WeakMap]",k="[object ArrayBuffer]",S="[object DataView]",$="[object Float32Array]",C="[object Float64Array]",P="[object Int8Array]",I="[object Int16Array]",O="[object Int32Array]",N="[object Uint8Array]",M="[object Uint8ClampedArray]",R="[object Uint16Array]",T="[object Uint32Array]",D=/\b__p \+= '';/g,L=/\b(__p \+=) '' \+/g,j=/(__e\(.*?\)|\b__t\)) \+\n'';/g,B=/&(?:amp|lt|gt|quot|#39);/g,F=/[&<>"']/g,U=RegExp(B.source),z=RegExp(F.source),q=/<%-([\s\S]+?)%>/g,H=/<%([\s\S]+?)%>/g,G=/<%=([\s\S]+?)%>/g,V=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,W=/^\w*$/,K=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Y=/[\\^$.*+?()[\]{}|]/g,Z=RegExp(Y.source),J=/^\s+/,Q=/\s/,X=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,ee=/\{\n\/\* \[wrapped with (.+)\] \*/,et=/,? & /,er=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,en=/[()=,{}\[\]\/\s]/,ei=/\\(\\)?/g,es=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,eo=/\w*$/,ea=/^[-+]0x[0-9a-f]+$/i,el=/^0b[01]+$/i,eu=/^\[object .+?Constructor\]$/,ec=/^0o[0-7]+$/i,ed=/^(?:0|[1-9]\d*)$/,eh=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,ef=/($^)/,ep=/['\n\r\u2028\u2029\\]/g,eg="\ud800-\udfff",em="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",ey="\\u2700-\\u27bf",eb="a-z\\xdf-\\xf6\\xf8-\\xff",ev="A-Z\\xc0-\\xd6\\xd8-\\xde",ew="\\ufe0e\\ufe0f",e_="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",eE="['’]",eA="["+e_+"]",ex="["+em+"]",ek="["+eb+"]",eS="[^"+eg+e_+"\\d+"+ey+eb+ev+"]",e$="\ud83c[\udffb-\udfff]",eC="[^"+eg+"]",eP="(?:\ud83c[\udde6-\uddff]){2}",eI="[\ud800-\udbff][\udc00-\udfff]",eO="["+ev+"]",eN="\\u200d",eM="(?:"+ek+"|"+eS+")",eR="(?:"+eE+"(?:d|ll|m|re|s|t|ve))?",eT="(?:"+eE+"(?:D|LL|M|RE|S|T|VE))?",eD="(?:"+ex+"|"+e$+")?",eL="["+ew+"]?",ej="(?:"+eN+"(?:"+[eC,eP,eI].join("|")+")"+eL+eD+")*",eB=eL+eD+ej,eF="(?:"+["["+ey+"]",eP,eI].join("|")+")"+eB,eU="(?:"+[eC+ex+"?",ex,eP,eI,"["+eg+"]"].join("|")+")",ez=RegExp(eE,"g"),eq=RegExp(ex,"g"),eH=RegExp(e$+"(?="+e$+")|"+eU+eB,"g"),eG=RegExp([eO+"?"+ek+"+"+eR+"(?="+[eA,eO,"$"].join("|")+")","(?:"+eO+"|"+eS+")+"+eT+"(?="+[eA,eO+eM,"$"].join("|")+")",eO+"?"+eM+"+"+eR,eO+"+"+eT,"\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])","\\d+",eF].join("|"),"g"),eV=RegExp("["+eN+eg+em+ew+"]"),eW=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,eK=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],eY=-1,eZ={};eZ[$]=eZ[C]=eZ[P]=eZ[I]=eZ[O]=eZ[N]=eZ[M]=eZ[R]=eZ[T]=!0,eZ[u]=eZ[c]=eZ[k]=eZ[d]=eZ[S]=eZ[h]=eZ[f]=eZ[p]=eZ[m]=eZ[y]=eZ[b]=eZ[w]=eZ[_]=eZ[E]=eZ[x]=!1;var eJ={};eJ[u]=eJ[c]=eJ[k]=eJ[S]=eJ[d]=eJ[h]=eJ[$]=eJ[C]=eJ[P]=eJ[I]=eJ[O]=eJ[m]=eJ[y]=eJ[b]=eJ[w]=eJ[_]=eJ[E]=eJ[A]=eJ[N]=eJ[M]=eJ[R]=eJ[T]=!0,eJ[f]=eJ[p]=eJ[x]=!1;var eQ={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},eX=parseFloat,e0=parseInt,e1="object"==typeof nP&&nP&&nP.Object===Object&&nP,e2="object"==typeof self&&self&&self.Object===Object&&self,e3=e1||e2||Function("return this")(),e5=t&&!t.nodeType&&t,e6=e5&&e&&!e.nodeType&&e,e4=e6&&e6.exports===e5,e8=e4&&e1.process,e9=function(){try{return e6&&e6.require&&e6.require("util").types||e8&&e8.binding&&e8.binding("util")}catch{}}(),e7=e9&&e9.isArrayBuffer,te=e9&&e9.isDate,tt=e9&&e9.isMap,tr=e9&&e9.isRegExp,tn=e9&&e9.isSet,ti=e9&&e9.isTypedArray;function ts(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}function to(e,t,r,n){for(var i=-1,s=null==e?0:e.length;++i-1}function td(e,t,r){for(var n=-1,i=null==e?0:e.length;++n-1;);return r}function tR(e,t){for(var r=e.length;r--&&tw(t,e[r],0)>-1;);return r}var tT=tk({À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"}),tD=tk({"&":"&","<":"<",">":">",'"':""","'":"'"});function tL(e){return"\\"+eQ[e]}function tj(e){return eV.test(e)}function tB(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function tF(e,t){return function(r){return e(t(r))}}function tU(e,t){for(var r=-1,n=e.length,i=0,o=[];++r",""":'"',"'":"'"}),tW=function e(t){var Q,eg,em,ey,eb=(t=null==t?e3:tW.defaults(e3.Object(),t,tW.pick(e3,eK))).Array,ev=t.Date,ew=t.Error,e_=t.Function,eE=t.Math,eA=t.Object,ex=t.RegExp,ek=t.String,eS=t.TypeError,e$=eb.prototype,eC=e_.prototype,eP=eA.prototype,eI=t["__core-js_shared__"],eO=eC.toString,eN=eP.hasOwnProperty,eM=0,eR=(Q=/[^.]+$/.exec(eI&&eI.keys&&eI.keys.IE_PROTO||""))?"Symbol(src)_1."+Q:"",eT=eP.toString,eD=eO.call(eA),eL=e3._,ej=ex("^"+eO.call(eN).replace(Y,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),eB=e4?t.Buffer:r,eF=t.Symbol,eU=t.Uint8Array,eH=eB?eB.allocUnsafe:r,eV=tF(eA.getPrototypeOf,eA),eQ=eA.create,e1=eP.propertyIsEnumerable,e2=e$.splice,e5=eF?eF.isConcatSpreadable:r,e6=eF?eF.iterator:r,e8=eF?eF.toStringTag:r,e9=function(){try{var e=ip(eA,"defineProperty");return e({},"",{}),e}catch{}}(),ty=t.clearTimeout!==e3.clearTimeout&&t.clearTimeout,tk=ev&&ev.now!==e3.Date.now&&ev.now,tK=t.setTimeout!==e3.setTimeout&&t.setTimeout,tY=eE.ceil,tZ=eE.floor,tJ=eA.getOwnPropertySymbols,tQ=eB?eB.isBuffer:r,tX=t.isFinite,t0=e$.join,t1=tF(eA.keys,eA),t2=eE.max,t3=eE.min,t5=ev.now,t6=t.parseInt,t4=eE.random,t8=e$.reverse,t9=ip(t,"DataView"),t7=ip(t,"Map"),re=ip(t,"Promise"),rt=ip(t,"Set"),rr=ip(t,"WeakMap"),rn=ip(eA,"create"),ri=rr&&new rr,rs={},ro=iB(t9),ra=iB(t7),rl=iB(re),ru=iB(rt),rc=iB(rr),rd=eF?eF.prototype:r,rh=rd?rd.valueOf:r,rf=rd?rd.toString:r;function rp(e){if(sV(e)&&!sT(e)&&!(e instanceof rb)){if(e instanceof ry)return e;if(eN.call(e,"__wrapped__"))return iF(e)}return new ry(e)}var rg=function(){function e(){}return function(t){if(!sG(t))return{};if(eQ)return eQ(t);e.prototype=t;var n=new e;return e.prototype=r,n}}();function rm(){}function ry(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=r}function rb(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=4294967295,this.__views__=[]}function rv(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t=t?e:t)),e}function rR(e,t,n,i,s,o){var a,l=1&t,c=2&t,f=4&t;if(n&&(a=s?n(e,i,s,o):n(e)),a!==r)return a;if(!sG(e))return e;var v=sT(e);if(v){if(x=e.length,D=new e.constructor(x),x&&"string"==typeof e[0]&&eN.call(e,"index")&&(D.index=e.index,D.input=e.input),a=D,!l)return nF(e,a)}else{var x,D,L,j,B,F=iy(e),U=F==p||F==g;if(sB(e))return nR(e,l);if(F==b||F==u||U&&!s){if(a=c||U?{}:iv(e),!l)return c?(L=(B=a)&&nU(e,of(e),B),nU(e,im(e),L)):(j=rI(a,e),nU(e,ig(e),j))}else{if(!eJ[F])return s?e:{};a=function(e,t,r){var n,i,s=e.constructor;switch(t){case k:return nT(e);case d:case h:return new s(+e);case S:return n=r?nT(e.buffer):e.buffer,new e.constructor(n,e.byteOffset,e.byteLength);case $:case C:case P:case I:case O:case N:case M:case R:case T:return nD(e,r);case m:return new s;case y:case E:return new s(e);case w:return(i=new e.constructor(e.source,eo.exec(e))).lastIndex=e.lastIndex,i;case _:return new s;case A:return rh?eA(rh.call(e)):{}}}(e,F,l)}}o||(o=new rA);var z=o.get(e);if(z)return z;o.set(e,a),sJ(e)?e.forEach(function(r){a.add(rR(r,t,n,r,e,o))}):sW(e)&&e.forEach(function(r,i){a.set(i,rR(r,t,n,i,e,o))});var q=f?c?io:is:c?of:oh,H=v?r:q(e);return ta(H||e,function(r,i){H&&(r=e[i=r]),r$(a,i,rR(r,t,n,i,e,o))}),a}function rT(e,t,n){var i=n.length;if(null==e)return!i;for(e=eA(e);i--;){var s=n[i],o=t[s],a=e[s];if(a===r&&!(s in e)||!o(a))return!1}return!0}function rD(e,t,i){if("function"!=typeof e)throw new eS(n);return iN(function(){e.apply(r,i)},t)}function rL(e,t,r,n){var i=-1,s=tc,o=!0,a=e.length,l=[],u=t.length;if(!a)return l;r&&(t=th(t,tI(r))),n?(s=td,o=!1):t.length>=200&&(s=tN,o=!1,t=new rE(t));e:for(;++i-1},rw.prototype.set=function(e,t){var r=this.__data__,n=rC(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},r_.prototype.clear=function(){this.size=0,this.__data__={hash:new rv,map:new(t7||rw),string:new rv}},r_.prototype.delete=function(e){var t=id(this,e).delete(e);return this.size-=t?1:0,t},r_.prototype.get=function(e){return id(this,e).get(e)},r_.prototype.has=function(e){return id(this,e).has(e)},r_.prototype.set=function(e,t){var r=id(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},rE.prototype.add=rE.prototype.push=function(e){return this.__data__.set(e,i),this},rE.prototype.has=function(e){return this.__data__.has(e)},rA.prototype.clear=function(){this.__data__=new rw,this.size=0},rA.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},rA.prototype.get=function(e){return this.__data__.get(e)},rA.prototype.has=function(e){return this.__data__.has(e)},rA.prototype.set=function(e,t){var r=this.__data__;if(r instanceof rw){var n=r.__data__;if(!t7||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new r_(n)}return r.set(e,t),this.size=r.size,this};var rj=nH(rV),rB=nH(rW,!0);function rF(e,t){var r=!0;return rj(e,function(e,n,i){return r=!!t(e,n,i)}),r}function rU(e,t,n){for(var i=-1,s=e.length;++i0&&r(a)?t>1?rq(a,t-1,r,n,i):tf(i,a):n||(i[i.length]=a)}return i}var rH=nG(),rG=nG(!0);function rV(e,t){return e&&rH(e,t,oh)}function rW(e,t){return e&&rG(e,t,oh)}function rK(e,t){return tu(t,function(t){return sz(e[t])})}function rY(e,t){t=nO(t,e);for(var n=0,i=t.length;null!=e&&nt}function rX(e,t){return null!=e&&eN.call(e,t)}function r0(e,t){return null!=e&&t in eA(e)}function r1(e,t,n){for(var i=n?td:tc,s=e[0].length,o=e.length,a=o,l=eb(o),u=1/0,c=[];a--;){var d=e[a];a&&t&&(d=th(d,tI(t))),u=t3(d.length,u),l[a]=!n&&(t||s>=120&&d.length>=120)?new rE(a&&d):r}d=e[0];var h=-1,f=l[0];e:for(;++h=a)return l;return l*("desc"==r[n]?-1:1)}}return e.index-t.index}(e,t,r)})}function no(e,t,r){for(var n=-1,i=t.length,s={};++n-1;)a!==e&&e2.call(a,l,1),e2.call(e,l,1);return e}function nl(e,t){for(var r=e?t.length:0,n=r-1;r--;){var i=t[r];if(r==n||i!==s){var s=i;i_(i)?e2.call(e,i,1):nA(e,i)}}return e}function nu(e,t){return e+tZ(t4()*(t-e+1))}function nc(e,t){var r="";if(!e||t<1||t>9007199254740991)return r;do t%2&&(r+=e),(t=tZ(t/2))&&(e+=e);while(t);return r}function nd(e,t){return iM(iC(e,t,oj),e+"")}function nh(e,t,n,i){if(!sG(e))return e;t=nO(t,e);for(var s=-1,o=t.length,a=o-1,l=e;null!=l&&++si?0:i+t),(r=r>i?i:r)<0&&(r+=i),i=t>r?0:r-t>>>0,t>>>=0;for(var s=eb(i);++n>>1,o=e[s];null!==o&&!sX(o)&&(r?o<=t:o=200){var u=t?null:n4(e);if(u)return tz(u);o=!1,i=tN,l=new rE}else l=t?[]:a;e:for(;++n=i?e:ng(e,t,n)}var nM=ty||function(e){return e3.clearTimeout(e)};function nR(e,t){if(t)return e.slice();var r=e.length,n=eH?eH(r):new e.constructor(r);return e.copy(n),n}function nT(e){var t=new e.constructor(e.byteLength);return new eU(t).set(new eU(e)),t}function nD(e,t){var r=t?nT(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}function nL(e,t){if(e!==t){var n=e!==r,i=null===e,s=e==e,o=sX(e),a=t!==r,l=null===t,u=t==t,c=sX(t);if(!l&&!c&&!o&&e>t||o&&a&&u&&!l&&!c||i&&a&&u||!n&&u||!s)return 1;if(!i&&!o&&!c&&e1?n[s-1]:r,a=s>2?n[2]:r;for(o=e.length>3&&"function"==typeof o?(s--,o):r,a&&iE(n[0],n[1],a)&&(o=s<3?r:o,s=1),t=eA(t);++i-1?s[o?t[a]:a]:r}}function nZ(e){return ii(function(t){var i=t.length,s=i,o=ry.prototype.thru;for(e&&t.reverse();s--;){var a=t[s];if("function"!=typeof a)throw new eS(n);if(o&&!l&&"wrapper"==il(a))var l=new ry([],!0)}for(s=l?s:i;++s1&&v.reverse(),d&&ul))return!1;var c=o.get(e),d=o.get(t);if(c&&d)return c==t&&d==e;var h=-1,f=!0,p=2&n?new rE:r;for(o.set(e,t),o.set(t,e);++h-1&&e%1==0&&e1?"& ":"")+t[n],t=t.join(r>2?", ":" "),e.replace(X,`{ /* [wrapped with `+t+`] */ `)}(s,(n=(i=s.match(ee))?i[1].split(et):[],ta(l,function(e){var t="_."+e[0];r&e[1]&&!tc(n,t)&&n.push(t)}),n.sort())))}function iT(e){var t=0,n=0;return function(){var i=t5(),s=16-(i-n);if(n=i,s>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(r,arguments)}}function iD(e,t){var n=-1,i=e.length,s=i-1;for(t=t===r?i:t;++n1?e[t-1]:r;return n="function"==typeof n?(e.pop(),n):r,i4(e,n)});function sn(e){var t=rp(e);return t.__chain__=!0,t}function si(e,t){return t(e)}var ss=ii(function(e){var t=e.length,n=t?e[0]:0,i=this.__wrapped__,s=function(t){return rN(t,e)};return!(t>1)&&!this.__actions__.length&&i instanceof rb&&i_(n)?((i=i.slice(n,+n+(t?1:0))).__actions__.push({func:si,args:[s],thisArg:r}),new ry(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(r),e})):this.thru(s)}),so=nz(function(e,t,r){eN.call(e,r)?++e[r]:rO(e,r,1)}),sa=nY(iH),sl=nY(iG);function su(e,t){return(sT(e)?ta:rj)(e,ic(t,3))}function sc(e,t){return(sT(e)?function(e,t){for(var r=null==e?0:e.length;r--&&!1!==t(e[r],r,e););return e}:rB)(e,ic(t,3))}var sd=nz(function(e,t,r){eN.call(e,r)?e[r].push(t):rO(e,r,[t])}),sh=nd(function(e,t,r){var n=-1,i="function"==typeof t,s=sL(e)?eb(e.length):[];return rj(e,function(e){s[++n]=i?ts(t,e,r):r2(e,t,r)}),s}),sf=nz(function(e,t,r){rO(e,r,t)});function sp(e,t){return(sT(e)?th:ne)(e,ic(t,3))}var sg=nz(function(e,t,r){e[r?0:1].push(t)},function(){return[[],[]]}),sm=nd(function(e,t){if(null==e)return[];var r=t.length;return r>1&&iE(e,t[0],t[1])?t=[]:r>2&&iE(t[0],t[1],t[2])&&(t=[t[0]]),ns(e,rq(t,1),[])}),sy=tk||function(){return e3.Date.now()};function sb(e,t,n){return t=n?r:t,t=e&&null==t?e.length:t,n9(e,128,r,r,r,r,t)}function sv(e,t){var i;if("function"!=typeof t)throw new eS(n);return e=s6(e),function(){return--e>0&&(i=t.apply(this,arguments)),e<=1&&(t=r),i}}var sw=nd(function(e,t,r){var n=1;if(r.length){var i=tU(r,iu(sw));n|=32}return n9(e,n,t,r,i)}),s_=nd(function(e,t,r){var n=3;if(r.length){var i=tU(r,iu(s_));n|=32}return n9(t,n,e,r,i)});function sE(e,t,i){var s,o,a,l,u,c,d=0,h=!1,f=!1,p=!0;if("function"!=typeof e)throw new eS(n);function g(t){var n=s,i=o;return s=o=r,d=t,l=e.apply(i,n)}function m(e){var n=e-c,i=e-d;return c===r||n>=t||n<0||f&&i>=a}function y(){var e,r,n,i=sy();if(m(i))return b(i);u=iN(y,(e=i-c,r=i-d,n=t-e,f?t3(n,a-r):n))}function b(e){return u=r,p&&s?g(e):(s=o=r,l)}function v(){var e,n=sy(),i=m(n);if(s=arguments,o=this,c=n,i){if(u===r)return d=e=c,u=iN(y,t),h?g(e):l;if(f)return nM(u),u=iN(y,t),g(c)}return u===r&&(u=iN(y,t)),l}return t=s8(t)||0,sG(i)&&(h=!!i.leading,a=(f="maxWait"in i)?t2(s8(i.maxWait)||0,t):a,p="trailing"in i?!!i.trailing:p),v.cancel=function(){u!==r&&nM(u),d=0,s=c=o=u=r},v.flush=function(){return u===r?l:b(sy())},v}var sA=nd(function(e,t){return rD(e,1,t)}),sx=nd(function(e,t,r){return rD(e,s8(t)||0,r)});function sk(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new eS(n);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],s=r.cache;if(s.has(i))return s.get(i);var o=e.apply(this,n);return r.cache=s.set(i,o)||s,o};return r.cache=new(sk.Cache||r_),r}function sS(e){if("function"!=typeof e)throw new eS(n);return function(){var t=arguments;switch(t.length){case 0:return!e.call(this);case 1:return!e.call(this,t[0]);case 2:return!e.call(this,t[0],t[1]);case 3:return!e.call(this,t[0],t[1],t[2])}return!e.apply(this,t)}}sk.Cache=r_;var s$=nd(function(e,t){var r=(t=1==t.length&&sT(t[0])?th(t[0],tI(ic())):th(rq(t,1),tI(ic()))).length;return nd(function(n){for(var i=-1,s=t3(n.length,r);++i=t}),sR=r3(function(){return arguments}())?r3:function(e){return sV(e)&&eN.call(e,"callee")&&!e1.call(e,"callee")},sT=eb.isArray,sD=e7?tI(e7):function(e){return sV(e)&&rJ(e)==k};function sL(e){return null!=e&&sH(e.length)&&!sz(e)}function sj(e){return sV(e)&&sL(e)}var sB=tQ||oJ,sF=te?tI(te):function(e){return sV(e)&&rJ(e)==h};function sU(e){if(!sV(e))return!1;var t=rJ(e);return t==f||"[object DOMException]"==t||"string"==typeof e.message&&"string"==typeof e.name&&!sY(e)}function sz(e){if(!sG(e))return!1;var t=rJ(e);return t==p||t==g||"[object AsyncFunction]"==t||"[object Proxy]"==t}function sq(e){return"number"==typeof e&&e==s6(e)}function sH(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991}function sG(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function sV(e){return null!=e&&"object"==typeof e}var sW=tt?tI(tt):function(e){return sV(e)&&iy(e)==m};function sK(e){return"number"==typeof e||sV(e)&&rJ(e)==y}function sY(e){if(!sV(e)||rJ(e)!=b)return!1;var t=eV(e);if(null===t)return!0;var r=eN.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&eO.call(r)==eD}var sZ=tr?tI(tr):function(e){return sV(e)&&rJ(e)==w},sJ=tn?tI(tn):function(e){return sV(e)&&iy(e)==_};function sQ(e){return"string"==typeof e||!sT(e)&&sV(e)&&rJ(e)==E}function sX(e){return"symbol"==typeof e||sV(e)&&rJ(e)==A}var s0=ti?tI(ti):function(e){return sV(e)&&sH(e.length)&&!!eZ[rJ(e)]},s1=n3(r7),s2=n3(function(e,t){return e<=t});function s3(e){if(!e)return[];if(sL(e))return sQ(e)?tH(e):nF(e);if(e6&&e[e6])return function(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}(e[e6]());var t=iy(e);return(t==m?tB:t==_?tz:o_)(e)}function s5(e){return e?(e=s8(e))===o||e===-o?(e<0?-1:1)*17976931348623157e292:e==e?e:0:0===e?e:0}function s6(e){var t=s5(e),r=t%1;return t==t?r?t-r:t:0}function s4(e){return e?rM(s6(e),0,4294967295):0}function s8(e){if("number"==typeof e)return e;if(sX(e))return a;if(sG(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=sG(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=tP(e);var r=el.test(e);return r||ec.test(e)?e0(e.slice(2),r?2:8):ea.test(e)?a:+e}function s9(e){return nU(e,of(e))}function s7(e){return null==e?"":n_(e)}var oe=nq(function(e,t){if(iS(t)||sL(t)){nU(t,oh(t),e);return}for(var r in t)eN.call(t,r)&&r$(e,r,t[r])}),ot=nq(function(e,t){nU(t,of(t),e)}),or=nq(function(e,t,r,n){nU(t,of(t),e,n)}),on=nq(function(e,t,r,n){nU(t,oh(t),e,n)}),oi=ii(rN),os=nd(function(e,t){e=eA(e);var n=-1,i=t.length,s=i>2?t[2]:r;for(s&&iE(t[0],t[1],s)&&(i=1);++n1),t}),nU(e,io(e),r),n&&(r=rR(r,7,it));for(var i=t.length;i--;)nA(r,t[i]);return r}),oy=ii(function(e,t){return null==e?{}:no(e,t,function(t,r){return ol(e,r)})});function ob(e,t){if(null==e)return{};var r=th(io(e),function(e){return[e]});return t=ic(t),no(e,r,function(e,r){return t(e,r[0])})}var ov=n8(oh),ow=n8(of);function o_(e){return null==e?[]:tO(e,oh(e))}var oE=nW(function(e,t,r){return t=t.toLowerCase(),e+(r?oA(t):t)});function oA(e){return oO(s7(e).toLowerCase())}function ox(e){return(e=s7(e))&&e.replace(eh,tT).replace(eq,"")}var ok=nW(function(e,t,r){return e+(r?"-":"")+t.toLowerCase()}),oS=nW(function(e,t,r){return e+(r?" ":"")+t.toLowerCase()}),o$=nV("toLowerCase"),oC=nW(function(e,t,r){return e+(r?"_":"")+t.toLowerCase()}),oP=nW(function(e,t,r){return e+(r?" ":"")+oO(t)}),oI=nW(function(e,t,r){return e+(r?" ":"")+t.toUpperCase()}),oO=nV("toUpperCase");function oN(e,t,n){var i;return e=s7(e),(t=n?r:t)===r?(i=e,eW.test(i))?e.match(eG)||[]:e.match(er)||[]:e.match(t)||[]}var oM=nd(function(e,t){try{return ts(e,r,t)}catch(e){return sU(e)?e:new ew(e)}}),oR=ii(function(e,t){return ta(t,function(t){rO(e,t=ij(t),sw(e[t],e))}),e});function oT(e){return function(){return e}}var oD=nZ(),oL=nZ(!0);function oj(e){return e}function oB(e){return r8("function"==typeof e?e:rR(e,1))}var oF=nd(function(e,t){return function(r){return r2(r,e,t)}}),oU=nd(function(e,t){return function(r){return r2(e,r,t)}});function oz(e,t,r){var n=oh(t),i=rK(t,n);null!=r||sG(t)&&(i.length||!n.length)||(r=t,t=e,e=this,i=rK(t,oh(t)));var s=!(sG(r)&&"chain"in r)||!!r.chain,o=sz(e);return ta(i,function(r){var n=t[r];e[r]=n,o&&(e.prototype[r]=function(){var t=this.__chain__;if(s||t){var r=e(this.__wrapped__);return(r.__actions__=nF(this.__actions__)).push({func:n,args:arguments,thisArg:e}),r.__chain__=t,r}return n.apply(e,tf([this.value()],arguments))})}),e}function oq(){}var oH=n0(th),oG=n0(tl),oV=n0(tm);function oW(e){return iA(e)?tx(ij(e)):function(t){return rY(t,e)}}var oK=n2(),oY=n2(!0);function oZ(){return[]}function oJ(){return!1}var oQ=nX(function(e,t){return e+t},0),oX=n6("ceil"),o0=nX(function(e,t){return e/t},1),o1=n6("floor"),o2=nX(function(e,t){return e*t},1),o3=n6("round"),o5=nX(function(e,t){return e-t},0);return rp.after=function(e,t){if("function"!=typeof t)throw new eS(n);return e=s6(e),function(){if(--e<1)return t.apply(this,arguments)}},rp.ary=sb,rp.assign=oe,rp.assignIn=ot,rp.assignInWith=or,rp.assignWith=on,rp.at=oi,rp.before=sv,rp.bind=sw,rp.bindAll=oR,rp.bindKey=s_,rp.castArray=function(){if(!arguments.length)return[];var e=arguments[0];return sT(e)?e:[e]},rp.chain=sn,rp.chunk=function(e,t,n){t=(n?iE(e,t,n):t===r)?1:t2(s6(t),0);var i=null==e?0:e.length;if(!i||t<1)return[];for(var s=0,o=0,a=eb(tY(i/t));ss?0:s+n),(i=i===r||i>s?s:s6(i))<0&&(i+=s),i=n>i?0:s4(i);n>>0)?(e=s7(e))&&("string"==typeof t||null!=t&&!sZ(t))&&!(t=n_(t))&&tj(e)?nN(tH(e),0,n):e.split(t,n):[]},rp.spread=function(e,t){if("function"!=typeof e)throw new eS(n);return t=null==t?0:t2(s6(t),0),nd(function(r){var n=r[t],i=nN(r,0,t);return n&&tf(i,n),ts(e,this,i)})},rp.tail=function(e){var t=null==e?0:e.length;return t?ng(e,1,t):[]},rp.take=function(e,t,n){return e&&e.length?ng(e,0,(t=n||t===r?1:s6(t))<0?0:t):[]},rp.takeRight=function(e,t,n){var i=null==e?0:e.length;return i?ng(e,(t=i-(t=n||t===r?1:s6(t)))<0?0:t,i):[]},rp.takeRightWhile=function(e,t){return e&&e.length?nk(e,ic(t,3),!1,!0):[]},rp.takeWhile=function(e,t){return e&&e.length?nk(e,ic(t,3)):[]},rp.tap=function(e,t){return t(e),e},rp.throttle=function(e,t,r){var i=!0,s=!0;if("function"!=typeof e)throw new eS(n);return sG(r)&&(i="leading"in r?!!r.leading:i,s="trailing"in r?!!r.trailing:s),sE(e,t,{leading:i,maxWait:t,trailing:s})},rp.thru=si,rp.toArray=s3,rp.toPairs=ov,rp.toPairsIn=ow,rp.toPath=function(e){return sT(e)?th(e,ij):sX(e)?[e]:nF(iL(s7(e)))},rp.toPlainObject=s9,rp.transform=function(e,t,r){var n=sT(e),i=n||sB(e)||s0(e);if(t=ic(t,4),null==r){var s=e&&e.constructor;r=i?n?new s:[]:sG(e)&&sz(s)?rg(eV(e)):{}}return(i?ta:rV)(e,function(e,n,i){return t(r,e,n,i)}),r},rp.unary=function(e){return sb(e,1)},rp.union=i2,rp.unionBy=i3,rp.unionWith=i5,rp.uniq=function(e){return e&&e.length?nE(e):[]},rp.uniqBy=function(e,t){return e&&e.length?nE(e,ic(t,2)):[]},rp.uniqWith=function(e,t){return t="function"==typeof t?t:r,e&&e.length?nE(e,r,t):[]},rp.unset=function(e,t){return null==e||nA(e,t)},rp.unzip=i6,rp.unzipWith=i4,rp.update=function(e,t,r){return null==e?e:nx(e,t,nI(r))},rp.updateWith=function(e,t,n,i){return i="function"==typeof i?i:r,null==e?e:nx(e,t,nI(n),i)},rp.values=o_,rp.valuesIn=function(e){return null==e?[]:tO(e,of(e))},rp.without=i8,rp.words=oN,rp.wrap=function(e,t){return sC(nI(t),e)},rp.xor=i9,rp.xorBy=i7,rp.xorWith=se,rp.zip=st,rp.zipObject=function(e,t){return nC(e||[],t||[],r$)},rp.zipObjectDeep=function(e,t){return nC(e||[],t||[],nh)},rp.zipWith=sr,rp.entries=ov,rp.entriesIn=ow,rp.extend=ot,rp.extendWith=or,oz(rp,rp),rp.add=oQ,rp.attempt=oM,rp.camelCase=oE,rp.capitalize=oA,rp.ceil=oX,rp.clamp=function(e,t,n){return n===r&&(n=t,t=r),n!==r&&(n=(n=s8(n))==n?n:0),t!==r&&(t=(t=s8(t))==t?t:0),rM(s8(e),t,n)},rp.clone=function(e){return rR(e,4)},rp.cloneDeep=function(e){return rR(e,5)},rp.cloneDeepWith=function(e,t){return rR(e,5,t="function"==typeof t?t:r)},rp.cloneWith=function(e,t){return rR(e,4,t="function"==typeof t?t:r)},rp.conformsTo=function(e,t){return null==t||rT(e,t,oh(t))},rp.deburr=ox,rp.defaultTo=function(e,t){return null==e||e!=e?t:e},rp.divide=o0,rp.endsWith=function(e,t,n){e=s7(e),t=n_(t);var i=e.length,s=n=n===r?i:rM(s6(n),0,i);return(n-=t.length)>=0&&e.slice(n,s)==t},rp.eq=sO,rp.escape=function(e){return(e=s7(e))&&z.test(e)?e.replace(F,tD):e},rp.escapeRegExp=function(e){return(e=s7(e))&&Z.test(e)?e.replace(Y,"\\$&"):e},rp.every=function(e,t,n){var i=sT(e)?tl:rF;return n&&iE(e,t,n)&&(t=r),i(e,ic(t,3))},rp.find=sa,rp.findIndex=iH,rp.findKey=function(e,t){return tb(e,ic(t,3),rV)},rp.findLast=sl,rp.findLastIndex=iG,rp.findLastKey=function(e,t){return tb(e,ic(t,3),rW)},rp.floor=o1,rp.forEach=su,rp.forEachRight=sc,rp.forIn=function(e,t){return null==e?e:rH(e,ic(t,3),of)},rp.forInRight=function(e,t){return null==e?e:rG(e,ic(t,3),of)},rp.forOwn=function(e,t){return e&&rV(e,ic(t,3))},rp.forOwnRight=function(e,t){return e&&rW(e,ic(t,3))},rp.get=oa,rp.gt=sN,rp.gte=sM,rp.has=function(e,t){return null!=e&&ib(e,t,rX)},rp.hasIn=ol,rp.head=iW,rp.identity=oj,rp.includes=function(e,t,r,n){e=sL(e)?e:o_(e),r=r&&!n?s6(r):0;var i=e.length;return r<0&&(r=t2(i+r,0)),sQ(e)?r<=i&&e.indexOf(t,r)>-1:!!i&&tw(e,t,r)>-1},rp.indexOf=function(e,t,r){var n=null==e?0:e.length;if(!n)return -1;var i=null==r?0:s6(r);return i<0&&(i=t2(n+i,0)),tw(e,t,i)},rp.inRange=function(e,t,n){var i,s,o;return t=s5(t),n===r?(n=t,t=0):n=s5(n),(i=e=s8(e))>=t3(s=t,o=n)&&i=-9007199254740991&&e<=9007199254740991},rp.isSet=sJ,rp.isString=sQ,rp.isSymbol=sX,rp.isTypedArray=s0,rp.isUndefined=function(e){return e===r},rp.isWeakMap=function(e){return sV(e)&&iy(e)==x},rp.isWeakSet=function(e){return sV(e)&&"[object WeakSet]"==rJ(e)},rp.join=function(e,t){return null==e?"":t0.call(e,t)},rp.kebabCase=ok,rp.last=iJ,rp.lastIndexOf=function(e,t,n){var i=null==e?0:e.length;if(!i)return -1;var s=i;return n!==r&&(s=(s=s6(n))<0?t2(i+s,0):t3(s,i-1)),t==t?function(e,t,r){for(var n=r+1;n--&&e[n]!==t;);return n}(e,t,s):tv(e,tE,s,!0)},rp.lowerCase=oS,rp.lowerFirst=o$,rp.lt=s1,rp.lte=s2,rp.max=function(e){return e&&e.length?rU(e,oj,rQ):r},rp.maxBy=function(e,t){return e&&e.length?rU(e,ic(t,2),rQ):r},rp.mean=function(e){return tA(e,oj)},rp.meanBy=function(e,t){return tA(e,ic(t,2))},rp.min=function(e){return e&&e.length?rU(e,oj,r7):r},rp.minBy=function(e,t){return e&&e.length?rU(e,ic(t,2),r7):r},rp.stubArray=oZ,rp.stubFalse=oJ,rp.stubObject=function(){return{}},rp.stubString=function(){return""},rp.stubTrue=function(){return!0},rp.multiply=o2,rp.nth=function(e,t){return e&&e.length?ni(e,s6(t)):r},rp.noConflict=function(){return e3._===this&&(e3._=eL),this},rp.noop=oq,rp.now=sy,rp.pad=function(e,t,r){e=s7(e);var n=(t=s6(t))?tq(e):0;if(!t||n>=t)return e;var i=(t-n)/2;return n1(tZ(i),r)+e+n1(tY(i),r)},rp.padEnd=function(e,t,r){e=s7(e);var n=(t=s6(t))?tq(e):0;return t&&nt){var i=e;e=t,t=i}if(n||e%1||t%1){var s=t4();return t3(e+s*(t-e+eX("1e-"+((s+"").length-1))),t)}return nu(e,t)},rp.reduce=function(e,t,r){var n=sT(e)?tp:tS,i=arguments.length<3;return n(e,ic(t,4),r,i,rj)},rp.reduceRight=function(e,t,r){var n=sT(e)?tg:tS,i=arguments.length<3;return n(e,ic(t,4),r,i,rB)},rp.repeat=function(e,t,n){return t=(n?iE(e,t,n):t===r)?1:s6(t),nc(s7(e),t)},rp.replace=function(){var e=arguments,t=s7(e[0]);return e.length<3?t:t.replace(e[1],e[2])},rp.result=function(e,t,n){t=nO(t,e);var i=-1,s=t.length;for(s||(s=1,e=r);++i9007199254740991)return[];var r=4294967295,n=t3(e,4294967295);t=ic(t),e-=4294967295;for(var i=tC(n,t);++r=o)return e;var l=n-tq(i);if(l<1)return i;var u=a?nN(a,0,l).join(""):e.slice(0,l);if(s===r)return u+i;if(a&&(l+=u.length-l),sZ(s)){if(e.slice(l).search(s)){var c,d=u;for(s.global||(s=ex(s.source,s7(eo.exec(s))+"g")),s.lastIndex=0;c=s.exec(d);)var h=c.index;u=u.slice(0,h===r?l:h)}}else if(e.indexOf(n_(s),l)!=l){var f=u.lastIndexOf(s);f>-1&&(u=u.slice(0,f))}return u+i},rp.unescape=function(e){return(e=s7(e))&&U.test(e)?e.replace(B,tV):e},rp.uniqueId=function(e){var t=++eM;return s7(e)+t},rp.upperCase=oI,rp.upperFirst=oO,rp.each=su,rp.eachRight=sc,rp.first=iW,oz(rp,(ey={},rV(rp,function(e,t){eN.call(rp.prototype,t)||(ey[t]=e)}),ey),{chain:!1}),rp.VERSION="4.17.21",ta(["bind","bindKey","curry","curryRight","partial","partialRight"],function(e){rp[e].placeholder=rp}),ta(["drop","take"],function(e,t){rb.prototype[e]=function(n){n=n===r?1:t2(s6(n),0);var i=this.__filtered__&&!t?new rb(this):this.clone();return i.__filtered__?i.__takeCount__=t3(n,i.__takeCount__):i.__views__.push({size:t3(n,4294967295),type:e+(i.__dir__<0?"Right":"")}),i},rb.prototype[e+"Right"]=function(t){return this.reverse()[e](t).reverse()}}),ta(["filter","map","takeWhile"],function(e,t){var r=t+1,n=1==r||3==r;rb.prototype[e]=function(e){var t=this.clone();return t.__iteratees__.push({iteratee:ic(e,3),type:r}),t.__filtered__=t.__filtered__||n,t}}),ta(["head","last"],function(e,t){var r="take"+(t?"Right":"");rb.prototype[e]=function(){return this[r](1).value()[0]}}),ta(["initial","tail"],function(e,t){var r="drop"+(t?"":"Right");rb.prototype[e]=function(){return this.__filtered__?new rb(this):this[r](1)}}),rb.prototype.compact=function(){return this.filter(oj)},rb.prototype.find=function(e){return this.filter(e).head()},rb.prototype.findLast=function(e){return this.reverse().find(e)},rb.prototype.invokeMap=nd(function(e,t){return"function"==typeof e?new rb(this):this.map(function(r){return r2(r,e,t)})}),rb.prototype.reject=function(e){return this.filter(sS(ic(e)))},rb.prototype.slice=function(e,t){e=s6(e);var n=this;return n.__filtered__&&(e>0||t<0)?new rb(n):(e<0?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==r&&(n=(t=s6(t))<0?n.dropRight(-t):n.take(t-e)),n)},rb.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},rb.prototype.toArray=function(){return this.take(4294967295)},rV(rb.prototype,function(e,t){var n=/^(?:filter|find|map|reject)|While$/.test(t),i=/^(?:head|last)$/.test(t),s=rp[i?"take"+("last"==t?"Right":""):t],o=i||/^find/.test(t);s&&(rp.prototype[t]=function(){var t=this.__wrapped__,a=i?[1]:arguments,l=t instanceof rb,u=a[0],c=l||sT(t),d=function(e){var t=s.apply(rp,tf([e],a));return i&&h?t[0]:t};c&&n&&"function"==typeof u&&1!=u.length&&(l=c=!1);var h=this.__chain__,f=!!this.__actions__.length,p=o&&!h,g=l&&!f;if(!o&&c){t=g?t:new rb(this);var m=e.apply(t,a);return m.__actions__.push({func:si,args:[d],thisArg:r}),new ry(m,h)}return p&&g?e.apply(this,a):(m=this.thru(d),p?i?m.value()[0]:m.value():m)})}),ta(["pop","push","shift","sort","splice","unshift"],function(e){var t=e$[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",n=/^(?:pop|shift)$/.test(e);rp.prototype[e]=function(){var e=arguments;if(n&&!this.__chain__){var i=this.value();return t.apply(sT(i)?i:[],e)}return this[r](function(r){return t.apply(sT(r)?r:[],e)})}}),rV(rb.prototype,function(e,t){var r=rp[t];if(r){var n=r.name+"";eN.call(rs,n)||(rs[n]=[]),rs[n].push({name:t,func:r})}}),rs[nJ(r,2).name]=[{name:"wrapper",func:r}],rb.prototype.clone=function(){var e=new rb(this.__wrapped__);return e.__actions__=nF(this.__actions__),e.__dir__=this.__dir__,e.__filtered__=this.__filtered__,e.__iteratees__=nF(this.__iteratees__),e.__takeCount__=this.__takeCount__,e.__views__=nF(this.__views__),e},rb.prototype.reverse=function(){if(this.__filtered__){var e=new rb(this);e.__dir__=-1,e.__filtered__=!0}else e=this.clone(),e.__dir__*=-1;return e},rb.prototype.value=function(){var e=this.__wrapped__.value(),t=this.__dir__,r=sT(e),n=t<0,i=r?e.length:0,s=function(e,t,r){for(var n=-1,i=r.length;++n=this.__values__.length,t=e?r:this.__values__[this.__index__++];return{done:e,value:t}},rp.prototype.plant=function(e){for(var t,n=this;n instanceof rm;){var i=iF(n);i.__index__=0,i.__values__=r,t?s.__wrapped__=i:t=i;var s=i;n=n.__wrapped__}return s.__wrapped__=e,t},rp.prototype.reverse=function(){var e=this.__wrapped__;if(e instanceof rb){var t=e;return this.__actions__.length&&(t=new rb(this)),(t=t.reverse()).__actions__.push({func:si,args:[i1],thisArg:r}),new ry(t,this.__chain__)}return this.thru(i1)},rp.prototype.toJSON=rp.prototype.valueOf=rp.prototype.value=function(){return nS(this.__wrapped__,this.__actions__)},rp.prototype.first=rp.prototype.head,e6&&(rp.prototype[e6]=function(){return this}),rp}();e6?((e6.exports=tW)._=tW,e5._=tW):e3._=tW}).call(nP)}(nI,nI.exports);var nO=Object.defineProperty,nN=Object.defineProperties,nM=Object.getOwnPropertyDescriptors,nR=Object.getOwnPropertySymbols,nT=Object.prototype.hasOwnProperty,nD=Object.prototype.propertyIsEnumerable,nL=(e,t,r)=>t in e?nO(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,nj=(e,t)=>{for(var r in t||(t={}))nT.call(t,r)&&nL(e,r,t[r]);if(nR)for(var r of nR(t))nD.call(t,r)&&nL(e,r,t[r]);return e},nB=(e,t)=>nN(e,nM(t));function nF(e,t,r){var n;let i=(0,o.DQe)(e);return(null==(n=t.rpcMap)?void 0:n[i.reference])||`https://rpc.walletconnect.com/v1/?chainId=${i.namespace}:${i.reference}&projectId=${r}`}function nU(e){return e.includes(":")?e.split(":")[1]:e}function nz(e){return e.map(e=>`${e.split(":")[0]}:${e.split(":")[1]}`)}function nq(e={},t={}){let r=nH(e),n=nH(t);return nI.exports.merge(r,n)}function nH(e){var t,r,n,i;let s={};if(!(0,o.L5o)(e))return s;for(let[a,l]of Object.entries(e)){let e=(0,o.gpE)(a)?[a]:l.chains,u=l.methods||[],c=l.events||[],d=l.rpcMap||{},h=(0,o.Maj)(a);s[h]=nB(nj(nj({},s[h]),l),{chains:(0,o.eGA)(e,null==(t=s[h])?void 0:t.chains),methods:(0,o.eGA)(u,null==(r=s[h])?void 0:r.methods),events:(0,o.eGA)(c,null==(n=s[h])?void 0:n.events),rpcMap:nj(nj({},d),null==(i=s[h])?void 0:i.rpcMap)})}return s}function nG(e){return e.includes(":")?e.split(":")[2]:e}function nV(e){let t={};for(let[r,n]of Object.entries(e)){let e=n.methods||[],i=n.events||[],s=n.accounts||[],a=(0,o.gpE)(r)?[r]:n.chains?n.chains:nz(n.accounts);t[r]={chains:a,methods:e,events:i,accounts:s}}return t}function nW(e){return"number"==typeof e?e:e.includes("0x")?parseInt(e,16):isNaN(Number(e=e.includes(":")?e.split(":")[1]:e))?e:Number(e)}let nK={},nY=e=>nK[e],nZ=(e,t)=>{nK[e]=t};class nJ{constructor(e){this.name="polkadot",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(nC,`${this.name}:${e}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=nU(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||nF(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}}var nQ=Object.defineProperty,nX=Object.defineProperties,n0=Object.getOwnPropertyDescriptors,n1=Object.getOwnPropertySymbols,n2=Object.prototype.hasOwnProperty,n3=Object.prototype.propertyIsEnumerable,n5=(e,t,r)=>t in e?nQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,n6=(e,t)=>{for(var r in t||(t={}))n2.call(t,r)&&n5(e,r,t[r]);if(n1)for(var r of n1(t))n3.call(t,r)&&n5(e,r,t[r]);return e},n4=(e,t)=>nX(e,n0(t));class n8{constructor(e){this.name="eip155",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.httpProviders=this.createHttpProviders(),this.chainId=parseInt(this.getDefaultChain())}async request(e){switch(e.request.method){case"eth_requestAccounts":case"eth_accounts":return this.getAccounts();case"wallet_switchEthereumChain":return await this.handleSwitchChain(e);case"eth_chainId":return parseInt(this.getDefaultChain());case"wallet_getCapabilities":return await this.getCapabilities(e)}return this.namespace.methods.includes(e.request.method)?await this.client.request(e):this.getHttpProvider().request(e.request)}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(parseInt(e),t),this.chainId=parseInt(e),this.events.emit(nC,`${this.name}:${e}`)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId.toString();if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}createHttpProvider(e,t){let r=t||nF(`${this.name}:${e}`,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=parseInt(nU(t));e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}getHttpProvider(){let e=this.chainId,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}async handleSwitchChain(e){var t,r;let n=e.request.params?null==(t=e.request.params[0])?void 0:t.chainId:"0x0",i=parseInt(n=n.startsWith("0x")?n:`0x${n}`,16);if(this.isChainApproved(i))this.setDefaultChain(`${i}`);else if(this.namespace.methods.includes("wallet_switchEthereumChain"))await this.client.request({topic:e.topic,request:{method:e.request.method,params:[{chainId:n}]},chainId:null==(r=this.namespace.chains)?void 0:r[0]}),this.setDefaultChain(`${i}`);else throw Error(`Failed to switch to chain 'eip155:${i}'. The chain is not approved or the wallet does not support 'wallet_switchEthereumChain' method.`);return null}isChainApproved(e){return this.namespace.chains.includes(`${this.name}:${e}`)}async getCapabilities(e){var t,r,n;let i=null==(r=null==(t=e.request)?void 0:t.params)?void 0:r[0];if(!i)throw Error("Missing address parameter in `wallet_getCapabilities` request");let s=this.client.session.get(e.topic),o=(null==(n=s?.sessionProperties)?void 0:n.capabilities)||{};if(null!=o&&o[i])return o?.[i];let a=await this.client.request(e);try{await this.client.session.update(e.topic,{sessionProperties:n4(n6({},s.sessionProperties||{}),{capabilities:n4(n6({},o||{}),{[i]:a})})})}catch(e){console.warn("Failed to update session with capabilities",e)}return a}}class n9{constructor(e){this.name="solana",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(nC,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=nU(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||nF(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}}class n7{constructor(e){this.name="cosmos",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(nC,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=nU(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||nF(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}}class ie{constructor(e){this.name="cip34",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(nC,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{let r=this.getCardanoRPCUrl(t),n=nU(t);e[n]=this.createHttpProvider(n,r)}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}getCardanoRPCUrl(e){let t=this.namespace.rpcMap;if(t)return t[e]}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||this.getCardanoRPCUrl(e);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}}class it{constructor(e){this.name="elrond",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(nC,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=nU(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||nF(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}}class ir{constructor(e){this.name="multiversx",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(nC,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;let n=nU(t);e[n]=this.createHttpProvider(n,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||nF(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}}class ii{constructor(e){this.name="near",this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace=Object.assign(this.namespace,e)}requestAccounts(){return this.getAccounts()}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider().request(e.request)}setDefaultChain(e,t){if(this.chainId=e,!this.httpProviders[e]){let r=t||nF(`${this.name}:${e}`,this.namespace);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);this.setHttpProvider(e,r)}this.events.emit(nC,`${this.name}:${this.chainId}`)}getAccounts(){let e=this.namespace.accounts;return e&&e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2])||[]}createHttpProviders(){let e={};return this.namespace.chains.forEach(t=>{var r;e[t]=this.createHttpProvider(t,null==(r=this.namespace.rpcMap)?void 0:r[t])}),e}getHttpProvider(){let e=`${this.name}:${this.chainId}`,t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||nF(e,this.namespace);return typeof r>"u"?void 0:new e0(new nx(r,nY("disableProviderPing")))}}class is{constructor(e){this.name=n$,this.namespace=e.namespace,this.events=nY("events"),this.client=nY("client"),this.chainId=this.getDefaultChain(),this.httpProviders=this.createHttpProviders()}updateNamespace(e){this.namespace.chains=[...new Set((this.namespace.chains||[]).concat(e.chains||[]))],this.namespace.accounts=[...new Set((this.namespace.accounts||[]).concat(e.accounts||[]))],this.namespace.methods=[...new Set((this.namespace.methods||[]).concat(e.methods||[]))],this.namespace.events=[...new Set((this.namespace.events||[]).concat(e.events||[]))],this.httpProviders=this.createHttpProviders()}requestAccounts(){return this.getAccounts()}request(e){return this.namespace.methods.includes(e.request.method)?this.client.request(e):this.getHttpProvider(e.chainId).request(e.request)}setDefaultChain(e,t){this.httpProviders[e]||this.setHttpProvider(e,t),this.chainId=e,this.events.emit(nC,`${this.name}:${e}`)}getDefaultChain(){if(this.chainId)return this.chainId;if(this.namespace.defaultChain)return this.namespace.defaultChain;let e=this.namespace.chains[0];if(!e)throw Error("ChainId not found");return e.split(":")[1]}getAccounts(){let e=this.namespace.accounts;return e?[...new Set(e.filter(e=>e.split(":")[1]===this.chainId.toString()).map(e=>e.split(":")[2]))]:[]}createHttpProviders(){var e,t;let r={};return null==(t=null==(e=this.namespace)?void 0:e.accounts)||t.forEach(e=>{let t=(0,o.DQe)(e);r[`${t.namespace}:${t.reference}`]=this.createHttpProvider(e)}),r}getHttpProvider(e){let t=this.httpProviders[e];if(typeof t>"u")throw Error(`JSON-RPC provider for ${e} not found`);return t}setHttpProvider(e,t){let r=this.createHttpProvider(e,t);r&&(this.httpProviders[e]=r)}createHttpProvider(e,t){let r=t||nF(e,this.namespace,this.client.core.projectId);if(!r)throw Error(`No RPC url provided for chainId: ${e}`);return new e0(new nx(r,nY("disableProviderPing")))}}var io=Object.defineProperty,ia=Object.defineProperties,il=Object.getOwnPropertyDescriptors,iu=Object.getOwnPropertySymbols,ic=Object.prototype.hasOwnProperty,id=Object.prototype.propertyIsEnumerable,ih=(e,t,r)=>t in e?io(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,ip=(e,t)=>{for(var r in t||(t={}))ic.call(t,r)&&ih(e,r,t[r]);if(iu)for(var r of iu(t))id.call(t,r)&&ih(e,r,t[r]);return e},ig=(e,t)=>ia(e,il(t));class im{constructor(e){this.events=new(s()),this.rpcProviders={},this.shouldAbortPairingAttempt=!1,this.maxPairingAttempts=10,this.disableProviderPing=!1,this.providerOpts=e,this.logger="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:U()(ei({level:e?.logger||nk})),this.disableProviderPing=e?.disableProviderPing||!1}static async init(e){let t=new im(e);return await t.initialize(),t}async request(e,t,r){let[n,i]=this.validateChain(t);if(!this.session)throw Error("Please call connect() before request()");return await this.getProvider(n).request({request:ip({},e),chainId:`${n}:${i}`,topic:this.session.topic,expiry:r})}sendAsync(e,t,r,n){let i=new Date().getTime();this.request(e,r,n).then(e=>t(null,eU(i,e))).catch(e=>t(e,void 0))}async enable(){if(!this.client)throw Error("Sign Client not initialized");return this.session||await this.connect({namespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties}),await this.requestAccounts()}async disconnect(){var e;if(!this.session)throw Error("Please call connect() before enable()");await this.client.disconnect({topic:null==(e=this.session)?void 0:e.topic,reason:(0,o.D6H)("USER_DISCONNECTED")}),await this.cleanup()}async connect(e){if(!this.client)throw Error("Sign Client not initialized");if(this.setNamespaces(e),await this.cleanupPendingPairings(),!e.skipPairing)return await this.pair(e.pairingTopic)}async authenticate(e){if(!this.client)throw Error("Sign Client not initialized");this.setNamespaces(e),await this.cleanupPendingPairings();let{uri:t,response:r}=await this.client.authenticate(e);t&&(this.uri=t,this.events.emit("display_uri",t));let n=await r();if(this.session=n.session,this.session){let e=nV(this.session.namespaces);this.namespaces=nq(this.namespaces,e),this.persist("namespaces",this.namespaces),this.onConnect()}return n}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}removeListener(e,t){this.events.removeListener(e,t)}off(e,t){this.events.off(e,t)}get isWalletConnect(){return!0}async pair(e){this.shouldAbortPairingAttempt=!1;let t=0;do{if(this.shouldAbortPairingAttempt)throw Error("Pairing aborted");if(t>=this.maxPairingAttempts)throw Error("Max auto pairing attempts reached");let{uri:r,approval:n}=await this.client.connect({pairingTopic:e,requiredNamespaces:this.namespaces,optionalNamespaces:this.optionalNamespaces,sessionProperties:this.sessionProperties});r&&(this.uri=r,this.events.emit("display_uri",r)),await n().then(e=>{this.session=e;let t=nV(e.namespaces);this.namespaces=nq(this.namespaces,t),this.persist("namespaces",this.namespaces)}).catch(e=>{if(e.message!==rZ)throw e;t++})}while(!this.session);return this.onConnect(),this.session}setDefaultChain(e,t){try{if(!this.session)return;let[r,n]=this.validateChain(e),i=this.getProvider(r);i.name===n$?i.setDefaultChain(`${r}:${n}`,t):i.setDefaultChain(n,t)}catch(e){if(!/Please call connect/.test(e.message))throw e}}async cleanupPendingPairings(e={}){this.logger.info("Cleaning up inactive pairings...");let t=this.client.pairing.getAll();if((0,o.qt8)(t)){for(let r of t)e.deletePairings?this.client.core.expirer.set(r.topic,0):await this.client.core.relayer.subscriber.unsubscribe(r.topic);this.logger.info(`Inactive pairings cleared: ${t.length}`)}}abortPairingAttempt(){this.shouldAbortPairingAttempt=!0}async checkStorage(){if(this.namespaces=await this.getFromStore("namespaces"),this.optionalNamespaces=await this.getFromStore("optionalNamespaces")||{},this.client.session.length){let e=this.client.session.keys.length-1;this.session=this.client.session.get(this.client.session.keys[e]),this.createProviders()}}async initialize(){this.logger.trace("Initialized"),await this.createClient(),await this.checkStorage(),this.registerEventListeners()}async createClient(){this.client=this.providerOpts.client||await nd.init({logger:this.providerOpts.logger||nk,relayUrl:this.providerOpts.relayUrl||"wss://relay.walletconnect.com",projectId:this.providerOpts.projectId,metadata:this.providerOpts.metadata,storageOptions:this.providerOpts.storageOptions,storage:this.providerOpts.storage,name:this.providerOpts.name}),this.logger.trace("SignClient Initialized")}createProviders(){if(!this.client)throw Error("Sign Client not initialized");if(!this.session)throw Error("Session not initialized. Please call connect() before enable()");let e=[...new Set(Object.keys(this.session.namespaces).map(e=>(0,o.Maj)(e)))];nZ("client",this.client),nZ("events",this.events),nZ("disableProviderPing",this.disableProviderPing),e.forEach(e=>{if(!this.session)return;let t=function(e,t){let r=Object.keys(t.namespaces).filter(t=>t.includes(e));if(!r.length)return[];let n=[];return r.forEach(e=>{let r=t.namespaces[e].accounts;n.push(...r)}),n}(e,this.session),r=nz(t),n=ig(ip({},nq(this.namespaces,this.optionalNamespaces)[e]),{accounts:t,chains:r});switch(e){case"eip155":this.rpcProviders[e]=new n8({namespace:n});break;case"solana":this.rpcProviders[e]=new n9({namespace:n});break;case"cosmos":this.rpcProviders[e]=new n7({namespace:n});break;case"polkadot":this.rpcProviders[e]=new nJ({namespace:n});break;case"cip34":this.rpcProviders[e]=new ie({namespace:n});break;case"elrond":this.rpcProviders[e]=new it({namespace:n});break;case"multiversx":this.rpcProviders[e]=new ir({namespace:n});break;case"near":this.rpcProviders[e]=new ii({namespace:n});break;default:this.rpcProviders[n$]?this.rpcProviders[n$].updateNamespace(n):this.rpcProviders[n$]=new is({namespace:n})}})}registerEventListeners(){if(typeof this.client>"u")throw Error("Sign Client is not initialized");this.client.on("session_ping",e=>{this.events.emit("session_ping",e)}),this.client.on("session_event",e=>{let{params:t}=e,{event:r}=t;if("accountsChanged"===r.name){let e=r.data;e&&(0,o.qt8)(e)&&this.events.emit("accountsChanged",e.map(nG))}else if("chainChanged"===r.name){let e=t.chainId,r=t.event.data,n=(0,o.Maj)(e),i=nW(e)!==nW(r)?`${n}:${nW(r)}`:e;this.onChainChanged(i)}else this.events.emit(r.name,r.data);this.events.emit("session_event",e)}),this.client.on("session_update",({topic:e,params:t})=>{var r;let{namespaces:n}=t,i=null==(r=this.client)?void 0:r.session.get(e);this.session=ig(ip({},i),{namespaces:n}),this.onSessionUpdate(),this.events.emit("session_update",{topic:e,params:t})}),this.client.on("session_delete",async e=>{await this.cleanup(),this.events.emit("session_delete",e),this.events.emit("disconnect",ig(ip({},(0,o.D6H)("USER_DISCONNECTED")),{data:e.topic}))}),this.on(nC,e=>{this.onChainChanged(e,!0)})}getProvider(e){return this.rpcProviders[e]||this.rpcProviders[n$]}onSessionUpdate(){Object.keys(this.rpcProviders).forEach(e=>{var t;this.getProvider(e).updateNamespace(null==(t=this.session)?void 0:t.namespaces[e])})}setNamespaces(e){let{namespaces:t,optionalNamespaces:r,sessionProperties:n}=e;t&&Object.keys(t).length&&(this.namespaces=t),r&&Object.keys(r).length&&(this.optionalNamespaces=r),this.sessionProperties=n,this.persist("namespaces",t),this.persist("optionalNamespaces",r)}validateChain(e){let[t,r]=e?.split(":")||["",""];if(!this.namespaces||!Object.keys(this.namespaces).length)return[t,r];if(t&&!Object.keys(this.namespaces||{}).map(e=>(0,o.Maj)(e)).includes(t))throw Error(`Namespace '${t}' is not configured. Please call connect() first with namespace config.`);if(t&&r)return[t,r];let n=(0,o.Maj)(Object.keys(this.namespaces)[0]),i=this.rpcProviders[n].getDefaultChain();return[n,i]}async requestAccounts(){let[e]=this.validateChain();return await this.getProvider(e).requestAccounts()}onChainChanged(e,t=!1){if(!this.namespaces)return;let[r,n]=this.validateChain(e);n&&(t||this.getProvider(r).setDefaultChain(n),this.namespaces[r]?this.namespaces[r].defaultChain=n:this.namespaces[`${r}:${n}`]?this.namespaces[`${r}:${n}`].defaultChain=n:this.namespaces[`${r}:${n}`]={defaultChain:n},this.persist("namespaces",this.namespaces),this.events.emit("chainChanged",n))}onConnect(){this.createProviders(),this.events.emit("connect",{session:this.session})}async cleanup(){this.session=void 0,this.namespaces=void 0,this.optionalNamespaces=void 0,this.sessionProperties=void 0,this.persist("namespaces",void 0),this.persist("optionalNamespaces",void 0),this.persist("sessionProperties",void 0),await this.cleanupPendingPairings({deletePairings:!0})}persist(e,t){this.client.core.storage.setItem(`${nS}/${e}`,t)}async getFromStore(e){return await this.client.core.storage.getItem(`${nS}/${e}`)}}let iy=["eth_sendTransaction","personal_sign"],ib=["eth_accounts","eth_requestAccounts","eth_sendRawTransaction","eth_sign","eth_signTransaction","eth_signTypedData","eth_signTypedData_v3","eth_signTypedData_v4","eth_sendTransaction","personal_sign","wallet_switchEthereumChain","wallet_addEthereumChain","wallet_getPermissions","wallet_requestPermissions","wallet_registerOnboarding","wallet_watchAsset","wallet_scanQRCode","wallet_sendCalls","wallet_getCapabilities","wallet_getCallsStatus","wallet_showCallsStatus"],iv=["chainChanged","accountsChanged"],iw=["chainChanged","accountsChanged","message","disconnect","connect"];var i_=Object.defineProperty,iE=Object.defineProperties,iA=Object.getOwnPropertyDescriptors,ix=Object.getOwnPropertySymbols,ik=Object.prototype.hasOwnProperty,iS=Object.prototype.propertyIsEnumerable,i$=(e,t,r)=>t in e?i_(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,iC=(e,t)=>{for(var r in t||(t={}))ik.call(t,r)&&i$(e,r,t[r]);if(ix)for(var r of ix(t))iS.call(t,r)&&i$(e,r,t[r]);return e},iP=(e,t)=>iE(e,iA(t));function iI(e){return Number(e[0].split(":")[1])}function iO(e){return`0x${e.toString(16)}`}class iN{constructor(){this.events=new i.EventEmitter,this.namespace="eip155",this.accounts=[],this.chainId=1,this.STORAGE_KEY="wc@2:ethereum_provider:",this.on=(e,t)=>(this.events.on(e,t),this),this.once=(e,t)=>(this.events.once(e,t),this),this.removeListener=(e,t)=>(this.events.removeListener(e,t),this),this.off=(e,t)=>(this.events.off(e,t),this),this.parseAccount=e=>this.isCompatibleChainId(e)?this.parseAccountId(e).address:e,this.signer={},this.rpc={}}static async init(e){let t=new iN;return await t.initialize(e),t}async request(e,t){return await this.signer.request(e,this.formatChainId(this.chainId),t)}sendAsync(e,t,r){this.signer.sendAsync(e,t,this.formatChainId(this.chainId),r)}get connected(){return!!this.signer.client&&this.signer.client.core.relayer.connected}get connecting(){return!!this.signer.client&&this.signer.client.core.relayer.connecting}async enable(){return this.session||await this.connect(),await this.request({method:"eth_requestAccounts"})}async connect(e){if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts(e);let{required:t,optional:r}=function(e){let{chains:t,optionalChains:r,methods:n,optionalMethods:i,events:s,optionalEvents:a,rpcMap:l}=e;if(!(0,o.qt8)(t))throw Error("Invalid chains");let u={chains:t,methods:n||iy,events:s||iv,rpcMap:iC({},t.length?{[iI(t)]:l[iI(t)]}:{})},c=s?.filter(e=>!iv.includes(e)),d=n?.filter(e=>!iy.includes(e));if(!r&&!a&&!i&&!(null!=c&&c.length)&&!(null!=d&&d.length))return{required:t.length?u:void 0};let h={chains:[...new Set(c?.length&&d?.length||!r?u.chains.concat(r||[]):r)],methods:[...new Set(u.methods.concat(null!=i&&i.length?i:ib))],events:[...new Set(u.events.concat(null!=a&&a.length?a:iw))],rpcMap:l};return{required:t.length?u:void 0,optional:r.length?h:void 0}}(this.rpc);try{let n=await new Promise(async(n,i)=>{var s;this.rpc.showQrModal&&(null==(s=this.modal)||s.subscribeModal(e=>{e.open||this.signer.session||(this.signer.abortPairingAttempt(),i(Error("Connection request reset. Please try again.")))})),await this.signer.connect(iP(iC({namespaces:iC({},t&&{[this.namespace]:t})},r&&{optionalNamespaces:{[this.namespace]:r}}),{pairingTopic:e?.pairingTopic})).then(e=>{n(e)}).catch(e=>{i(Error(e.message))})});if(!n)return;let i=(0,o.guN)(n.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:i),this.setAccounts(i),this.events.emit("connect",{chainId:iO(this.chainId)})}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async authenticate(e){if(!this.signer.client)throw Error("Provider not initialized. Call init() first");this.loadConnectOpts({chains:e?.chains});try{let t=await new Promise(async(t,r)=>{var n;this.rpc.showQrModal&&(null==(n=this.modal)||n.subscribeModal(e=>{e.open||this.signer.session||(this.signer.abortPairingAttempt(),r(Error("Connection request reset. Please try again.")))})),await this.signer.authenticate(iP(iC({},e),{chains:this.rpc.chains})).then(e=>{t(e)}).catch(e=>{r(Error(e.message))})}),r=t.session;if(r){let e=(0,o.guN)(r.namespaces,[this.namespace]);this.setChainIds(this.rpc.chains.length?this.rpc.chains:e),this.setAccounts(e),this.events.emit("connect",{chainId:iO(this.chainId)})}return t}catch(e){throw this.signer.logger.error(e),e}finally{this.modal&&this.modal.closeModal()}}async disconnect(){this.session&&await this.signer.disconnect(),this.reset()}get isWalletConnect(){return!0}get session(){return this.signer.session}registerEventListeners(){this.signer.on("session_event",e=>{let{params:t}=e,{event:r}=t;"accountsChanged"===r.name?(this.accounts=this.parseAccounts(r.data),this.events.emit("accountsChanged",this.accounts)):"chainChanged"===r.name?this.setChainId(this.formatChainId(r.data)):this.events.emit(r.name,r.data),this.events.emit("session_event",e)}),this.signer.on("chainChanged",e=>{let t=parseInt(e);this.chainId=t,this.events.emit("chainChanged",iO(this.chainId)),this.persist()}),this.signer.on("session_update",e=>{this.events.emit("session_update",e)}),this.signer.on("session_delete",e=>{this.reset(),this.events.emit("session_delete",e),this.events.emit("disconnect",iP(iC({},(0,o.D6H)("USER_DISCONNECTED")),{data:e.topic,name:"USER_DISCONNECTED"}))}),this.signer.on("display_uri",e=>{var t,r;this.rpc.showQrModal&&(null==(t=this.modal)||t.closeModal(),null==(r=this.modal)||r.openModal({uri:e})),this.events.emit("display_uri",e)})}switchEthereumChain(e){this.request({method:"wallet_switchEthereumChain",params:[{chainId:e.toString(16)}]})}isCompatibleChainId(e){return"string"==typeof e&&e.startsWith(`${this.namespace}:`)}formatChainId(e){return`${this.namespace}:${e}`}parseChainId(e){return Number(e.split(":")[1])}setChainIds(e){let t=e.filter(e=>this.isCompatibleChainId(e)).map(e=>this.parseChainId(e));t.length&&(this.chainId=t[0],this.events.emit("chainChanged",iO(this.chainId)),this.persist())}setChainId(e){if(this.isCompatibleChainId(e)){let t=this.parseChainId(e);this.chainId=t,this.switchEthereumChain(t)}}parseAccountId(e){let[t,r,n]=e.split(":");return{chainId:`${t}:${r}`,address:n}}setAccounts(e){this.accounts=e.filter(e=>this.parseChainId(this.parseAccountId(e).chainId)===this.chainId).map(e=>this.parseAccountId(e).address),this.events.emit("accountsChanged",this.accounts)}getRpcConfig(e){var t,r;let n=null!=(t=e?.chains)?t:[],i=null!=(r=e?.optionalChains)?r:[],s=n.concat(i);if(!s.length)throw Error("No chains specified in either `chains` or `optionalChains`");let o=n.length?e?.methods||iy:[],a=n.length?e?.events||iv:[],l=e?.optionalMethods||[],u=e?.optionalEvents||[],c=e?.rpcMap||this.buildRpcMap(s,e.projectId),d=e?.qrModalOptions||void 0;return{chains:n?.map(e=>this.formatChainId(e)),optionalChains:i.map(e=>this.formatChainId(e)),methods:o,events:a,optionalMethods:l,optionalEvents:u,rpcMap:c,showQrModal:!!(null!=e&&e.showQrModal),qrModalOptions:d,projectId:e.projectId,metadata:e.metadata}}buildRpcMap(e,t){let r={};return e.forEach(e=>{r[e]=this.getRpcUrl(e,t)}),r}async initialize(e){if(this.rpc=this.getRpcConfig(e),this.chainId=this.rpc.chains.length?iI(this.rpc.chains):iI(this.rpc.optionalChains),this.signer=await im.init({projectId:this.rpc.projectId,metadata:this.rpc.metadata,disableProviderPing:e.disableProviderPing,relayUrl:e.relayUrl,storageOptions:e.storageOptions}),this.registerEventListeners(),await this.loadPersistedSession(),this.rpc.showQrModal){let e;try{let{WalletConnectModal:t}=await r.e(318).then(r.bind(r,55318));e=t}catch{throw Error("To use QR modal, please install @walletconnect/modal package")}if(e)try{this.modal=new e(iC({projectId:this.rpc.projectId},this.rpc.qrModalOptions))}catch(e){throw this.signer.logger.error(e),Error("Could not generate WalletConnectModal Instance")}}}loadConnectOpts(e){if(!e)return;let{chains:t,optionalChains:r,rpcMap:n}=e;t&&(0,o.qt8)(t)&&(this.rpc.chains=t.map(e=>this.formatChainId(e)),t.forEach(e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)})),r&&(0,o.qt8)(r)&&(this.rpc.optionalChains=[],this.rpc.optionalChains=r?.map(e=>this.formatChainId(e)),r.forEach(e=>{this.rpc.rpcMap[e]=n?.[e]||this.getRpcUrl(e)}))}getRpcUrl(e,t){var r;return(null==(r=this.rpc.rpcMap)?void 0:r[e])||`https://rpc.walletconnect.com/v1/?chainId=eip155:${e}&projectId=${t||this.rpc.projectId}`}async loadPersistedSession(){if(this.session)try{let e=await this.signer.client.core.storage.getItem(`${this.STORAGE_KEY}/chainId`),t=this.session.namespaces[`${this.namespace}:${e}`]?this.session.namespaces[`${this.namespace}:${e}`]:this.session.namespaces[this.namespace];this.setChainIds(e?[this.formatChainId(e)]:t?.accounts),this.setAccounts(t?.accounts)}catch(e){this.signer.logger.error("Failed to load persisted session, clearing state..."),this.signer.logger.error(e),await this.disconnect().catch(e=>this.signer.logger.warn(e))}}reset(){this.chainId=1,this.accounts=[]}persist(){this.session&&this.signer.client.core.storage.setItem(`${this.STORAGE_KEY}/chainId`,this.chainId)}parseAccounts(e){return"string"==typeof e||e instanceof String?[this.parseAccount(e)]:e.map(e=>this.parseAccount(e))}}let iM=iN},27185:function(e){"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},57711:function(e,t,r){"use strict";r.d(t,{iO:function(){return n}});let n={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}}},77726:function(){},71851:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(24011);n.__exportStar(r(47036),t),n.__exportStar(r(62703),t)},47036:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},62703:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},54574:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(24011);n.__exportStar(r(91268),t),n.__exportStar(r(32674),t),n.__exportStar(r(79165),t),n.__exportStar(r(71851),t)},79165:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(24011).__exportStar(r(34760),t)},34760:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class r{}t.IWatch=r},25115:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let n=r(71851);t.toMiliseconds=function(e){return e*n.ONE_THOUSAND},t.fromMiliseconds=function(e){return Math.floor(e/n.ONE_THOUSAND)}},23396:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=function(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}},91268:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(24011);n.__exportStar(r(23396),t),n.__exportStar(r(25115),t)},32674:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},24011:function(e,t,r){"use strict";r.r(t),r.d(t,{__assign:function(){return s},__asyncDelegator:function(){return w},__asyncGenerator:function(){return v},__asyncValues:function(){return _},__await:function(){return b},__awaiter:function(){return c},__classPrivateFieldGet:function(){return k},__classPrivateFieldSet:function(){return S},__createBinding:function(){return h},__decorate:function(){return a},__exportStar:function(){return f},__extends:function(){return i},__generator:function(){return d},__importDefault:function(){return x},__importStar:function(){return A},__makeTemplateObject:function(){return E},__metadata:function(){return u},__param:function(){return l},__read:function(){return g},__rest:function(){return o},__spread:function(){return m},__spreadArrays:function(){return y},__values:function(){return p}});/*! ***************************************************************************** Copyright (c) Microsoft Corporation. Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ***************************************************************************** */var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var s=function(){return(s=Object.assign||function(e){for(var t,r=1,n=arguments.length;rt.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);it.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(o=(s<3?i(o):s>3?i(t,r,o):i(t,r))||o);return s>3&&o&&Object.defineProperty(t,r,o),o}function l(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function c(e,t,r,n){return new(r||(r=Promise))(function(i,s){function o(e){try{l(n.next(e))}catch(e){s(e)}}function a(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(o,a)}l((n=n.apply(e,t||[])).next())})}function d(e,t){var r,n,i,s,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return s={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(s){return function(a){return function(s){if(r)throw TypeError("Generator is already executing.");for(;o;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,n=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=(i=o.trys).length>0&&i[i.length-1])&&(6===s[0]||2===s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function g(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,s=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=s.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=s.return)&&r.call(s)}finally{if(i)throw i.error}}return o}function m(){for(var e=[],t=0;t1||a(e,t)})})}function a(e,t){try{var r;(r=i[e](t)).value instanceof b?Promise.resolve(r.value.v).then(l,u):c(s[0][2],r)}catch(e){c(s[0][3],e)}}function l(e){a("next",e)}function u(e){a("throw",e)}function c(e,t){e(t),s.shift(),s.length&&a(s[0][0],s[0][1])}}function w(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise(function(n,i){!function(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}(n,i,(t=e[r](t)).done,t.value)})}}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}function A(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function x(e){return e&&e.__esModule?e:{default:e}}function k(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function S(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},25527:function(e,t){"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){let t=r(e);if(!t)throw Error(`${e} is not defined in Window`);return t}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=function(){return n("document")},t.getDocument=function(){return r("document")},t.getNavigatorOrThrow=function(){return n("navigator")},t.getNavigator=function(){return r("navigator")},t.getLocationOrThrow=function(){return n("location")},t.getLocation=function(){return r("location")},t.getCryptoOrThrow=function(){return n("crypto")},t.getCrypto=function(){return r("crypto")},t.getLocalStorageOrThrow=function(){return n("localStorage")},t.getLocalStorage=function(){return r("localStorage")}},70053:function(e,t,r){"use strict";t.D=void 0;let n=r(25527);t.D=function(){let e,t,r;try{e=n.getDocumentOrThrow(),t=n.getLocationOrThrow()}catch(e){return null}function i(...t){let r=e.getElementsByTagName("meta");for(let e=0;en.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(i.length&&i){let e=n.getAttribute("content");if(e)return e}}return""}let s=((r=i("name","og:site_name","og:title","twitter:title"))||(r=e.title),r),o=i("description","og:description","twitter:description","keywords");return{description:o,url:t.origin,icons:function(){let r=e.getElementsByTagName("link"),n=[];for(let e=0;e-1){let e=i.getAttribute("href");if(e){if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{let n=t.pathname.split("/");n.pop(),r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){let r=t.protocol+e;n.push(r)}else n.push(e)}}}return n}(),name:s}}},48738:function(e,t){"use strict";t.byteLength=function(e){var t=l(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,s=l(e),o=s[0],a=s[1],u=new i((o+a)*3/4-a),c=0,d=a>0?o-4:o;for(r=0;r>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,s=[],o=0,a=n-i;o>18&63]+r[i>>12&63]+r[i>>6&63]+r[63&i]);return s.join("")}(e,o,o+16383>a?a:o+16383));return 1===i?s.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&s.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),s.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,a=s.length;o0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},1192:function(e){"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function o(e){for(var t=1,r=0;r126)return"Invalid prefix ("+e+")";t=s(t)^n>>5}for(r=0,t=s(t);rt)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var a=(e=n).lastIndexOf("1");if(-1===a)return"No separator character for "+e;if(0===a)return"Missing prefix for "+e;var l=e.slice(0,a),u=e.slice(a+1);if(u.length<6)return"Data too short";var c=o(l);if("string"==typeof c)return c;for(var d=[],h=0;h=u.length||d.push(p)}return 1!==c?"Invalid checksum for "+e:{prefix:l,words:d}}function l(e,t,r,n){for(var i=0,s=0,o=(1<=r;)a.push(i>>(s-=r)&o);if(n)s>0&&a.push(i<=t)return"Excess padding";if(i<n)throw TypeError("Exceeds length limit");var i=o(e=e.toLowerCase());if("string"==typeof i)throw Error(i);for(var a=e+"1",l=0;l>5!=0)throw Error("Non 5-bit word");i=s(i)^u,a+=t.charAt(u)}for(l=0;l<6;++l)i=s(i);for(i^=1,l=0;l<6;++l){var c=i>>(5-l)*5&31;a+=t.charAt(c)}return a},toWordsUnsafe:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=l(e,8,5,!0);if(Array.isArray(t))return t;throw Error(t)},fromWordsUnsafe:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=l(e,5,8,!1);if(Array.isArray(t))return t;throw Error(t)}}},58171:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function s(e,t,r){if(s.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=s:t.BN=s,s.BN=s,s.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(46601).Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function a(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function l(e,t,r,i){for(var s=0,o=0,a=Math.min(e.length,r),l=t;l=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&o0?e:t},s.min=function(e,t){return 0>e.cmp(t)?e:t},s.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i=0;o-=3)s=e[o]|e[o-1]<<8|e[o-2]<<16,this.words[i]|=s<>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(o=0,i=0;o>>26-a&67108863,(a+=24)>=26&&(a-=26,i++);return this._strip()},s.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var n,i=0;i=t;i-=2)n=a(e,t,i)<=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18?(s-=18,o+=1,this.words[o]|=n>>>26):s+=8;this._strip()},s.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var s=e.length-r,o=s%n,a=Math.min(s,s-o)+r,u=0,c=r;c1&&0===this.words[this.length-1];)this.length--;return this._normSign()},s.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{s.prototype[Symbol.for("nodejs.util.inspect.custom")]=c}catch(e){s.prototype.inspect=c}else s.prototype.inspect=c;function c(){return(this.red?""}var d,h=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],f=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function g(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],s=0|t.words[0],o=i*s,a=67108863&o,l=o/67108864|0;r.words[0]=a;for(var u=1;u>>26,d=67108863&l,h=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=h;f++){var p=u-f|0;c+=(o=(i=0|e.words[p])*(s=0|t.words[f])+d)/67108864|0,d=67108863&o}r.words[u]=0|d,l=0|c}return 0!==l?r.words[u]=0|l:r.length--,r._strip()}s.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,i=0,s=0,o=0;o>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==s||o!==this.length-1?h[6-l.length]+l+r:l+r}for(0!==s&&(r=s.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=f[e],c=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var g=d.modrn(c).toString(e);r=(d=d.idivn(c)).isZero()?g+r:h[u-g.length]+g+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},s.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},s.prototype.toJSON=function(){return this.toString(16,2)},d&&(s.prototype.toBuffer=function(e,t){return this.toArrayLike(d,e,t)}),s.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},s.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),s=r||Math.max(1,i);n(i<=s,"byte array longer than desired length"),n(s>0,"Requested array length <= 0");var o=e.allocUnsafe?e.allocUnsafe(s):new e(s);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},s.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,s=0;i>8&255),r>16&255),6===s?(r>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===s?(r>=0&&(e[r--]=o>>24&255),n=0,s=0):(n=o>>>24,s+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?s.prototype._countBits=function(e){return 32-Math.clz32(e)}:s.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},s.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},s.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},s.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},s.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},s.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},s.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},s.prototype.iuxor=function(e){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,n=0;ne.length?this.clone().ixor(e):e.clone().ixor(this)},s.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},s.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},s.prototype.notn=function(e){return this.clone().inotn(e)},s.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),t?this.words[r]=this.words[r]|1<e.length?(r=this,n=e):(r=e,n=this);for(var t,r,n,i=0,s=0;s>>26;for(;0!==i&&s>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;se.length?this.clone().iadd(e):e.clone().iadd(this)},s.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,n=this.iadd(e);return e.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(t=this,r=e):(t=e,r=this);for(var s=0,o=0;o>26,this.words[o]=67108863&n;for(;0!==s&&o>26,this.words[o]=67108863&n;if(0===s&&o>>13,f=0|o[1],p=8191&f,g=f>>>13,m=0|o[2],y=8191&m,b=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],A=8191&E,x=E>>>13,k=0|o[5],S=8191&k,$=k>>>13,C=0|o[6],P=8191&C,I=C>>>13,O=0|o[7],N=8191&O,M=O>>>13,R=0|o[8],T=8191&R,D=R>>>13,L=0|o[9],j=8191&L,B=L>>>13,F=0|a[0],U=8191&F,z=F>>>13,q=0|a[1],H=8191&q,G=q>>>13,V=0|a[2],W=8191&V,K=V>>>13,Y=0|a[3],Z=8191&Y,J=Y>>>13,Q=0|a[4],X=8191&Q,ee=Q>>>13,et=0|a[5],er=8191&et,en=et>>>13,ei=0|a[6],es=8191&ei,eo=ei>>>13,ea=0|a[7],el=8191&ea,eu=ea>>>13,ec=0|a[8],ed=8191&ec,eh=ec>>>13,ef=0|a[9],ep=8191&ef,eg=ef>>>13;r.negative=e.negative^t.negative,r.length=19;var em=(u+(n=Math.imul(d,U))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(h,U)|0))<<13)|0;u=((s=Math.imul(h,z))+(i>>>13)|0)+(em>>>26)|0,em&=67108863,n=Math.imul(p,U),i=(i=Math.imul(p,z))+Math.imul(g,U)|0,s=Math.imul(g,z);var ey=(u+(n=n+Math.imul(d,H)|0)|0)+((8191&(i=(i=i+Math.imul(d,G)|0)+Math.imul(h,H)|0))<<13)|0;u=((s=s+Math.imul(h,G)|0)+(i>>>13)|0)+(ey>>>26)|0,ey&=67108863,n=Math.imul(y,U),i=(i=Math.imul(y,z))+Math.imul(b,U)|0,s=Math.imul(b,z),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(g,H)|0,s=s+Math.imul(g,G)|0;var eb=(u+(n=n+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,K)|0)+Math.imul(h,W)|0))<<13)|0;u=((s=s+Math.imul(h,K)|0)+(i>>>13)|0)+(eb>>>26)|0,eb&=67108863,n=Math.imul(w,U),i=(i=Math.imul(w,z))+Math.imul(_,U)|0,s=Math.imul(_,z),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,H)|0,s=s+Math.imul(b,G)|0,n=n+Math.imul(p,W)|0,i=(i=i+Math.imul(p,K)|0)+Math.imul(g,W)|0,s=s+Math.imul(g,K)|0;var ev=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,J)|0)+Math.imul(h,Z)|0))<<13)|0;u=((s=s+Math.imul(h,J)|0)+(i>>>13)|0)+(ev>>>26)|0,ev&=67108863,n=Math.imul(A,U),i=(i=Math.imul(A,z))+Math.imul(x,U)|0,s=Math.imul(x,z),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,H)|0,s=s+Math.imul(_,G)|0,n=n+Math.imul(y,W)|0,i=(i=i+Math.imul(y,K)|0)+Math.imul(b,W)|0,s=s+Math.imul(b,K)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,J)|0)+Math.imul(g,Z)|0,s=s+Math.imul(g,J)|0;var ew=(u+(n=n+Math.imul(d,X)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(h,X)|0))<<13)|0;u=((s=s+Math.imul(h,ee)|0)+(i>>>13)|0)+(ew>>>26)|0,ew&=67108863,n=Math.imul(S,U),i=(i=Math.imul(S,z))+Math.imul($,U)|0,s=Math.imul($,z),n=n+Math.imul(A,H)|0,i=(i=i+Math.imul(A,G)|0)+Math.imul(x,H)|0,s=s+Math.imul(x,G)|0,n=n+Math.imul(w,W)|0,i=(i=i+Math.imul(w,K)|0)+Math.imul(_,W)|0,s=s+Math.imul(_,K)|0,n=n+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,J)|0)+Math.imul(b,Z)|0,s=s+Math.imul(b,J)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(g,X)|0,s=s+Math.imul(g,ee)|0;var e_=(u+(n=n+Math.imul(d,er)|0)|0)+((8191&(i=(i=i+Math.imul(d,en)|0)+Math.imul(h,er)|0))<<13)|0;u=((s=s+Math.imul(h,en)|0)+(i>>>13)|0)+(e_>>>26)|0,e_&=67108863,n=Math.imul(P,U),i=(i=Math.imul(P,z))+Math.imul(I,U)|0,s=Math.imul(I,z),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul($,H)|0,s=s+Math.imul($,G)|0,n=n+Math.imul(A,W)|0,i=(i=i+Math.imul(A,K)|0)+Math.imul(x,W)|0,s=s+Math.imul(x,K)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,J)|0)+Math.imul(_,Z)|0,s=s+Math.imul(_,J)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,X)|0,s=s+Math.imul(b,ee)|0,n=n+Math.imul(p,er)|0,i=(i=i+Math.imul(p,en)|0)+Math.imul(g,er)|0,s=s+Math.imul(g,en)|0;var eE=(u+(n=n+Math.imul(d,es)|0)|0)+((8191&(i=(i=i+Math.imul(d,eo)|0)+Math.imul(h,es)|0))<<13)|0;u=((s=s+Math.imul(h,eo)|0)+(i>>>13)|0)+(eE>>>26)|0,eE&=67108863,n=Math.imul(N,U),i=(i=Math.imul(N,z))+Math.imul(M,U)|0,s=Math.imul(M,z),n=n+Math.imul(P,H)|0,i=(i=i+Math.imul(P,G)|0)+Math.imul(I,H)|0,s=s+Math.imul(I,G)|0,n=n+Math.imul(S,W)|0,i=(i=i+Math.imul(S,K)|0)+Math.imul($,W)|0,s=s+Math.imul($,K)|0,n=n+Math.imul(A,Z)|0,i=(i=i+Math.imul(A,J)|0)+Math.imul(x,Z)|0,s=s+Math.imul(x,J)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,X)|0,s=s+Math.imul(_,ee)|0,n=n+Math.imul(y,er)|0,i=(i=i+Math.imul(y,en)|0)+Math.imul(b,er)|0,s=s+Math.imul(b,en)|0,n=n+Math.imul(p,es)|0,i=(i=i+Math.imul(p,eo)|0)+Math.imul(g,es)|0,s=s+Math.imul(g,eo)|0;var eA=(u+(n=n+Math.imul(d,el)|0)|0)+((8191&(i=(i=i+Math.imul(d,eu)|0)+Math.imul(h,el)|0))<<13)|0;u=((s=s+Math.imul(h,eu)|0)+(i>>>13)|0)+(eA>>>26)|0,eA&=67108863,n=Math.imul(T,U),i=(i=Math.imul(T,z))+Math.imul(D,U)|0,s=Math.imul(D,z),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(M,H)|0,s=s+Math.imul(M,G)|0,n=n+Math.imul(P,W)|0,i=(i=i+Math.imul(P,K)|0)+Math.imul(I,W)|0,s=s+Math.imul(I,K)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,J)|0)+Math.imul($,Z)|0,s=s+Math.imul($,J)|0,n=n+Math.imul(A,X)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(x,X)|0,s=s+Math.imul(x,ee)|0,n=n+Math.imul(w,er)|0,i=(i=i+Math.imul(w,en)|0)+Math.imul(_,er)|0,s=s+Math.imul(_,en)|0,n=n+Math.imul(y,es)|0,i=(i=i+Math.imul(y,eo)|0)+Math.imul(b,es)|0,s=s+Math.imul(b,eo)|0,n=n+Math.imul(p,el)|0,i=(i=i+Math.imul(p,eu)|0)+Math.imul(g,el)|0,s=s+Math.imul(g,eu)|0;var ex=(u+(n=n+Math.imul(d,ed)|0)|0)+((8191&(i=(i=i+Math.imul(d,eh)|0)+Math.imul(h,ed)|0))<<13)|0;u=((s=s+Math.imul(h,eh)|0)+(i>>>13)|0)+(ex>>>26)|0,ex&=67108863,n=Math.imul(j,U),i=(i=Math.imul(j,z))+Math.imul(B,U)|0,s=Math.imul(B,z),n=n+Math.imul(T,H)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(D,H)|0,s=s+Math.imul(D,G)|0,n=n+Math.imul(N,W)|0,i=(i=i+Math.imul(N,K)|0)+Math.imul(M,W)|0,s=s+Math.imul(M,K)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,J)|0)+Math.imul(I,Z)|0,s=s+Math.imul(I,J)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul($,X)|0,s=s+Math.imul($,ee)|0,n=n+Math.imul(A,er)|0,i=(i=i+Math.imul(A,en)|0)+Math.imul(x,er)|0,s=s+Math.imul(x,en)|0,n=n+Math.imul(w,es)|0,i=(i=i+Math.imul(w,eo)|0)+Math.imul(_,es)|0,s=s+Math.imul(_,eo)|0,n=n+Math.imul(y,el)|0,i=(i=i+Math.imul(y,eu)|0)+Math.imul(b,el)|0,s=s+Math.imul(b,eu)|0,n=n+Math.imul(p,ed)|0,i=(i=i+Math.imul(p,eh)|0)+Math.imul(g,ed)|0,s=s+Math.imul(g,eh)|0;var ek=(u+(n=n+Math.imul(d,ep)|0)|0)+((8191&(i=(i=i+Math.imul(d,eg)|0)+Math.imul(h,ep)|0))<<13)|0;u=((s=s+Math.imul(h,eg)|0)+(i>>>13)|0)+(ek>>>26)|0,ek&=67108863,n=Math.imul(j,H),i=(i=Math.imul(j,G))+Math.imul(B,H)|0,s=Math.imul(B,G),n=n+Math.imul(T,W)|0,i=(i=i+Math.imul(T,K)|0)+Math.imul(D,W)|0,s=s+Math.imul(D,K)|0,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,J)|0)+Math.imul(M,Z)|0,s=s+Math.imul(M,J)|0,n=n+Math.imul(P,X)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(I,X)|0,s=s+Math.imul(I,ee)|0,n=n+Math.imul(S,er)|0,i=(i=i+Math.imul(S,en)|0)+Math.imul($,er)|0,s=s+Math.imul($,en)|0,n=n+Math.imul(A,es)|0,i=(i=i+Math.imul(A,eo)|0)+Math.imul(x,es)|0,s=s+Math.imul(x,eo)|0,n=n+Math.imul(w,el)|0,i=(i=i+Math.imul(w,eu)|0)+Math.imul(_,el)|0,s=s+Math.imul(_,eu)|0,n=n+Math.imul(y,ed)|0,i=(i=i+Math.imul(y,eh)|0)+Math.imul(b,ed)|0,s=s+Math.imul(b,eh)|0;var eS=(u+(n=n+Math.imul(p,ep)|0)|0)+((8191&(i=(i=i+Math.imul(p,eg)|0)+Math.imul(g,ep)|0))<<13)|0;u=((s=s+Math.imul(g,eg)|0)+(i>>>13)|0)+(eS>>>26)|0,eS&=67108863,n=Math.imul(j,W),i=(i=Math.imul(j,K))+Math.imul(B,W)|0,s=Math.imul(B,K),n=n+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,J)|0)+Math.imul(D,Z)|0,s=s+Math.imul(D,J)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(M,X)|0,s=s+Math.imul(M,ee)|0,n=n+Math.imul(P,er)|0,i=(i=i+Math.imul(P,en)|0)+Math.imul(I,er)|0,s=s+Math.imul(I,en)|0,n=n+Math.imul(S,es)|0,i=(i=i+Math.imul(S,eo)|0)+Math.imul($,es)|0,s=s+Math.imul($,eo)|0,n=n+Math.imul(A,el)|0,i=(i=i+Math.imul(A,eu)|0)+Math.imul(x,el)|0,s=s+Math.imul(x,eu)|0,n=n+Math.imul(w,ed)|0,i=(i=i+Math.imul(w,eh)|0)+Math.imul(_,ed)|0,s=s+Math.imul(_,eh)|0;var e$=(u+(n=n+Math.imul(y,ep)|0)|0)+((8191&(i=(i=i+Math.imul(y,eg)|0)+Math.imul(b,ep)|0))<<13)|0;u=((s=s+Math.imul(b,eg)|0)+(i>>>13)|0)+(e$>>>26)|0,e$&=67108863,n=Math.imul(j,Z),i=(i=Math.imul(j,J))+Math.imul(B,Z)|0,s=Math.imul(B,J),n=n+Math.imul(T,X)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(D,X)|0,s=s+Math.imul(D,ee)|0,n=n+Math.imul(N,er)|0,i=(i=i+Math.imul(N,en)|0)+Math.imul(M,er)|0,s=s+Math.imul(M,en)|0,n=n+Math.imul(P,es)|0,i=(i=i+Math.imul(P,eo)|0)+Math.imul(I,es)|0,s=s+Math.imul(I,eo)|0,n=n+Math.imul(S,el)|0,i=(i=i+Math.imul(S,eu)|0)+Math.imul($,el)|0,s=s+Math.imul($,eu)|0,n=n+Math.imul(A,ed)|0,i=(i=i+Math.imul(A,eh)|0)+Math.imul(x,ed)|0,s=s+Math.imul(x,eh)|0;var eC=(u+(n=n+Math.imul(w,ep)|0)|0)+((8191&(i=(i=i+Math.imul(w,eg)|0)+Math.imul(_,ep)|0))<<13)|0;u=((s=s+Math.imul(_,eg)|0)+(i>>>13)|0)+(eC>>>26)|0,eC&=67108863,n=Math.imul(j,X),i=(i=Math.imul(j,ee))+Math.imul(B,X)|0,s=Math.imul(B,ee),n=n+Math.imul(T,er)|0,i=(i=i+Math.imul(T,en)|0)+Math.imul(D,er)|0,s=s+Math.imul(D,en)|0,n=n+Math.imul(N,es)|0,i=(i=i+Math.imul(N,eo)|0)+Math.imul(M,es)|0,s=s+Math.imul(M,eo)|0,n=n+Math.imul(P,el)|0,i=(i=i+Math.imul(P,eu)|0)+Math.imul(I,el)|0,s=s+Math.imul(I,eu)|0,n=n+Math.imul(S,ed)|0,i=(i=i+Math.imul(S,eh)|0)+Math.imul($,ed)|0,s=s+Math.imul($,eh)|0;var eP=(u+(n=n+Math.imul(A,ep)|0)|0)+((8191&(i=(i=i+Math.imul(A,eg)|0)+Math.imul(x,ep)|0))<<13)|0;u=((s=s+Math.imul(x,eg)|0)+(i>>>13)|0)+(eP>>>26)|0,eP&=67108863,n=Math.imul(j,er),i=(i=Math.imul(j,en))+Math.imul(B,er)|0,s=Math.imul(B,en),n=n+Math.imul(T,es)|0,i=(i=i+Math.imul(T,eo)|0)+Math.imul(D,es)|0,s=s+Math.imul(D,eo)|0,n=n+Math.imul(N,el)|0,i=(i=i+Math.imul(N,eu)|0)+Math.imul(M,el)|0,s=s+Math.imul(M,eu)|0,n=n+Math.imul(P,ed)|0,i=(i=i+Math.imul(P,eh)|0)+Math.imul(I,ed)|0,s=s+Math.imul(I,eh)|0;var eI=(u+(n=n+Math.imul(S,ep)|0)|0)+((8191&(i=(i=i+Math.imul(S,eg)|0)+Math.imul($,ep)|0))<<13)|0;u=((s=s+Math.imul($,eg)|0)+(i>>>13)|0)+(eI>>>26)|0,eI&=67108863,n=Math.imul(j,es),i=(i=Math.imul(j,eo))+Math.imul(B,es)|0,s=Math.imul(B,eo),n=n+Math.imul(T,el)|0,i=(i=i+Math.imul(T,eu)|0)+Math.imul(D,el)|0,s=s+Math.imul(D,eu)|0,n=n+Math.imul(N,ed)|0,i=(i=i+Math.imul(N,eh)|0)+Math.imul(M,ed)|0,s=s+Math.imul(M,eh)|0;var eO=(u+(n=n+Math.imul(P,ep)|0)|0)+((8191&(i=(i=i+Math.imul(P,eg)|0)+Math.imul(I,ep)|0))<<13)|0;u=((s=s+Math.imul(I,eg)|0)+(i>>>13)|0)+(eO>>>26)|0,eO&=67108863,n=Math.imul(j,el),i=(i=Math.imul(j,eu))+Math.imul(B,el)|0,s=Math.imul(B,eu),n=n+Math.imul(T,ed)|0,i=(i=i+Math.imul(T,eh)|0)+Math.imul(D,ed)|0,s=s+Math.imul(D,eh)|0;var eN=(u+(n=n+Math.imul(N,ep)|0)|0)+((8191&(i=(i=i+Math.imul(N,eg)|0)+Math.imul(M,ep)|0))<<13)|0;u=((s=s+Math.imul(M,eg)|0)+(i>>>13)|0)+(eN>>>26)|0,eN&=67108863,n=Math.imul(j,ed),i=(i=Math.imul(j,eh))+Math.imul(B,ed)|0,s=Math.imul(B,eh);var eM=(u+(n=n+Math.imul(T,ep)|0)|0)+((8191&(i=(i=i+Math.imul(T,eg)|0)+Math.imul(D,ep)|0))<<13)|0;u=((s=s+Math.imul(D,eg)|0)+(i>>>13)|0)+(eM>>>26)|0,eM&=67108863;var eR=(u+(n=Math.imul(j,ep))|0)+((8191&(i=(i=Math.imul(j,eg))+Math.imul(B,ep)|0))<<13)|0;return u=((s=Math.imul(B,eg))+(i>>>13)|0)+(eR>>>26)|0,eR&=67108863,l[0]=em,l[1]=ey,l[2]=eb,l[3]=ev,l[4]=ew,l[5]=e_,l[6]=eE,l[7]=eA,l[8]=ex,l[9]=ek,l[10]=eS,l[11]=e$,l[12]=eC,l[13]=eP,l[14]=eI,l[15]=eO,l[16]=eN,l[17]=eM,l[18]=eR,0!==u&&(l[19]=u,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,s=0;s>>26)|0)>>>26,o&=67108863}r.words[s]=a,n=o,o=i}return 0!==n?r.words[s]=n:r.length--,r._strip()}function b(e,t){this.x=e,this.y=t}Math.imul||(m=g),s.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):n<63?g(this,e,t):y(this,e,t)},b.prototype.makeRBT=function(e){for(var t=Array(e),r=s.prototype._countBits(e)-1,n=0;n>=1;return n},b.prototype.permute=function(e,t,r,n,i,s){for(var o=0;o>>=1)i++;return 1<>>=13,r[2*o+1]=8191&s,s>>>=13;for(o=2*t;o>=26,r+=(s/67108864|0)+(o>>>26),this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},s.prototype.muln=function(e){return this.clone().imuln(e)},s.prototype.sqr=function(){return this.mul(this)},s.prototype.isqr=function(){return this.imul(this.clone())},s.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>i&1}return t}(e);if(0===t.length)return new s(1);for(var r=this,n=0;n=0);var t,r=e%26,i=(e-r)/26,s=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t=0),i=t?(t-t%26)/26:0;var i,s=e%26,o=Math.min((e-s)/26,this.length),a=67108863^67108863>>>s<o)for(this.length-=o,l=0;l=0&&(0!==u||l>=i);l--){var c=0|this.words[l];this.words[l]=u<<26-s|c>>>s,u=c&a}return r&&0!==u&&(r.words[r.length++]=u),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},s.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},s.prototype.shln=function(e){return this.clone().ishln(e)},s.prototype.ushln=function(e){return this.clone().iushln(e)},s.prototype.shrn=function(e){return this.clone().ishrn(e)},s.prototype.ushrn=function(e){return this.clone().iushrn(e)},s.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;return!(this.length<=r)&&!!(this.words[r]&1<=0);var t=e%26,r=(e-t)/26;return(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)?this:(0!==t&&r++,this.length=Math.min(r,this.length),0!==t&&(this.words[this.length-1]&=67108863^67108863>>>t<=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},s.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(l/67108864|0),this.words[i+r]=67108863&s}for(;i>26,this.words[i+r]=67108863&s;if(0===a)return this._strip();for(n(-1===a),a=0,i=0;i>26,this.words[i]=67108863&s;return this.negative=1,this._strip()},s.prototype._wordDiv=function(e,t){var r,n=this.length-e.length,i=this.clone(),o=e,a=0|o.words[o.length-1];0!=(n=26-this._countBits(a))&&(o=o.ushln(n),i.iushln(n),a=0|o.words[o.length-1]);var l=i.length-o.length;if("mod"!==t){(r=new s(null)).length=l+1,r.words=Array(r.length);for(var u=0;u=0;d--){var h=(0|i.words[o.length+d])*67108864+(0|i.words[o.length+d-1]);for(h=Math.min(h/a|0,67108863),i._ishlnsubmul(o,h,d);0!==i.negative;)h--,i.negative=0,i._ishlnsubmul(o,1,d),i.isZero()||(i.negative^=1);r&&(r.words[d]=h)}return r&&r._strip(),i._strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},s.prototype.divmod=function(e,t,r){var i,o,a;return(n(!e.isZero()),this.isZero())?{div:new s(0),mod:new s(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:i,mod:o}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):(this.negative&e.negative)!=0?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(o=a.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:a.div,mod:o}):e.length>this.length||0>this.cmp(e)?{div:new s(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new s(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new s(this.modrn(e.words[0]))}:this._wordDiv(e,t)},s.prototype.div=function(e){return this.divmod(e,"div",!1).div},s.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},s.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},s.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),s=r.cmp(n);return s<0||1===i&&0===s?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},s.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=67108864%e,i=0,s=this.length-1;s>=0;s--)i=(r*i+(0|this.words[s]))%e;return t?-i:i},s.prototype.modn=function(e){return this.modrn(e)},s.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var s=(0|this.words[i])+67108864*r;this.words[i]=s/e|0,r=s%e}return this._strip(),t?this.ineg():this},s.prototype.divn=function(e){return this.clone().idivn(e)},s.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new s(1),o=new s(0),a=new s(0),l=new s(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var c=r.clone(),d=t.clone();!t.isZero();){for(var h=0,f=1;(t.words[0]&f)==0&&h<26;++h,f<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||o.isOdd())&&(i.iadd(c),o.isub(d)),i.iushrn(1),o.iushrn(1);for(var p=0,g=1;(r.words[0]&g)==0&&p<26;++p,g<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||l.isOdd())&&(a.iadd(c),l.isub(d)),a.iushrn(1),l.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),o.isub(l)):(r.isub(t),a.isub(i),l.isub(o))}return{a:a,b:l,gcd:r.iushln(u)}},s.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t,r=this,i=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var o=new s(1),a=new s(0),l=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,c=1;(r.words[0]&c)==0&&u<26;++u,c<<=1);if(u>0)for(r.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(l),o.iushrn(1);for(var d=0,h=1;(i.words[0]&h)==0&&d<26;++d,h<<=1);if(d>0)for(i.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(l),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),o.isub(a)):(i.isub(r),a.isub(o))}return 0>(t=0===r.cmpn(1)?o:a).cmpn(0)&&t.iadd(e),t},s.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var s=t;t=r,r=s}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},s.prototype.invm=function(e){return this.egcd(e).a.umod(e)},s.prototype.isEven=function(){return(1&this.words[0])==0},s.prototype.isOdd=function(){return(1&this.words[0])==1},s.prototype.andln=function(e){return this.words[0]&e},s.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<>>26,a&=67108863,this.words[o]=a}return 0!==s&&(this.words[o]=s,this.length++),this},s.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},s.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return -1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:ie.length)return 1;if(this.length=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){ni&&(t=1);break}}return t},s.prototype.gtn=function(e){return 1===this.cmpn(e)},s.prototype.gt=function(e){return 1===this.cmp(e)},s.prototype.gten=function(e){return this.cmpn(e)>=0},s.prototype.gte=function(e){return this.cmp(e)>=0},s.prototype.ltn=function(e){return -1===this.cmpn(e)},s.prototype.lt=function(e){return -1===this.cmp(e)},s.prototype.lten=function(e){return 0>=this.cmpn(e)},s.prototype.lte=function(e){return 0>=this.cmp(e)},s.prototype.eqn=function(e){return 0===this.cmpn(e)},s.prototype.eq=function(e){return 0===this.cmp(e)},s.red=function(e){return new k(e)},s.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},s.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},s.prototype._forceRed=function(e){return this.red=e,this},s.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},s.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},s.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},s.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},s.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},s.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},s.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},s.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},s.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},s.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},s.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},s.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},s.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},s.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new s(t,16),this.n=this.p.bitLength(),this.k=new s(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function A(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function k(e){if("string"==typeof e){var t=s._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(e){k.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new s(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new s(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var n=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),n=0;n>>22,i=s}i>>>=22,e.words[n-10]=i,0===i&&e.length>10?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},s._prime=function(e){var t;if(v[e])return v[e];if("k256"===e)t=new _;else if("p224"===e)t=new E;else if("p192"===e)t=new A;else if("p25519"===e)t=new x;else throw Error("Unknown prime "+e);return v[e]=t,t},k.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},k.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},k.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},k.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},k.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},k.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},k.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},k.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},k.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},k.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},k.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},k.prototype.isqr=function(e){return this.imul(e,e.clone())},k.prototype.sqr=function(e){return this.mul(e,e)},k.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new s(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),o=0;!i.isZero()&&0===i.andln(1);)o++,i.iushrn(1);n(!i.isZero());var a=new s(1).toRed(this),l=a.redNeg(),u=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new s(2*c*c).toRed(this);0!==this.pow(c,u).cmp(l);)c.redIAdd(l);for(var d=this.pow(c,i),h=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=o;0!==f.cmp(a);){for(var g=f,m=0;0!==g.cmp(a);m++)g=g.redSqr();n(m=0;n--){for(var u=t.words[n],c=l-1;c>=0;c--){var d=u>>c&1;if(i!==r[0]&&(i=this.sqr(i)),0===d&&0===o){a=0;continue}o<<=1,o|=d,(4==++a||0===n&&0===c)&&(i=this.mul(i,r[o]),a=0,o=0)}l=26}return i},k.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},k.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},s.mont=function(e){return new S(e)},i(S,k),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new s(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},9109:function(e,t,r){"use strict";/*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */let n=r(48738),i=r(6868),s="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function o(e){if(e>2147483647)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,a.prototype),t}function a(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return c(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return function(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!a.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|p(e,t),n=o(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(L(e,Uint8Array)){let t=new Uint8Array(e);return h(t.buffer,t.byteOffset,t.byteLength)}return d(e)}(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(L(e,ArrayBuffer)||e&&L(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(L(e,SharedArrayBuffer)||e&&L(e.buffer,SharedArrayBuffer)))return h(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return a.from(n,t,r);let i=function(e){var t;if(a.isBuffer(e)){let t=0|f(e.length),r=o(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||(t=e.length)!=t?o(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return a.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function u(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function c(e){return u(e),o(e<0?0:0|f(e))}function d(e){let t=e.length<0?0:0|f(e.length),r=o(t);for(let n=0;n=2147483647)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(a.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||L(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return R(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return T(e).length;default:if(i)return n?-1:R(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),(s=r=+r)!=s&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=a.from(t,n)),a.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let s,o=1,a=e.length,l=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;o=2,a/=2,l/=2,r/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){let n=-1;for(s=r;sa&&(r=a-l),s=r;s>=0;s--){let r=!0;for(let n=0;n239?4:t>223?3:t>191?2:1;if(i+o<=r){let r,n,a,l;switch(o){case 1:t<128&&(s=t);break;case 2:(192&(r=e[i+1]))==128&&(l=(31&t)<<6|63&r)>127&&(s=l);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(l=(15&t)<<12|(63&r)<<6|63&n)>2047&&(l<55296||l>57343)&&(s=l);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(l=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&l<1114112&&(s=l)}}null===s?(s=65533,o=1):s>65535&&(s-=65536,n.push(s>>>10&1023|55296),s=56320|1023&s),n.push(s),i+=o}return function(e){let t=e.length;if(t<=4096)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nr)throw RangeError("Trying to access beyond buffer length")}function _(e,t,r,n,i,s){if(!a.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw RangeError("Index out of range")}function E(e,t,r,n,i){I(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,r}function A(e,t,r,n,i){I(t,n,i,e,r,7);let s=Number(t&BigInt(4294967295));e[r+7]=s,s>>=8,e[r+6]=s,s>>=8,e[r+5]=s,s>>=8,e[r+4]=s;let o=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=o,o>>=8,e[r+2]=o,o>>=8,e[r+1]=o,o>>=8,e[r]=o,r+8}function x(e,t,r,n,i,s){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function k(e,t,r,n,s){return t=+t,r>>>=0,s||x(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function S(e,t,r,n,s){return t=+t,r>>>=0,s||x(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}t.Buffer=a,t.SlowBuffer=function(e){return+e!=e&&(e=0),a.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=2147483647,a.TYPED_ARRAY_SUPPORT=function(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),a.poolSize=8192,a.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array),a.alloc=function(e,t,r){return(u(e),e<=0)?o(e):void 0!==t?"string"==typeof r?o(e).fill(t,r):o(e).fill(t):o(e)},a.allocUnsafe=function(e){return c(e)},a.allocUnsafeSlow=function(e){return c(e)},a.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==a.prototype},a.compare=function(e,t){if(L(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),L(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,s=Math.min(r,n);in.length?(a.isBuffer(t)||(t=a.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(a.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},a.byteLength=p,a.prototype._isBuffer=!0,a.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},s&&(a.prototype[s]=a.prototype.inspect),a.prototype.compare=function(e,t,r,n,i){if(L(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let s=i-n,o=r-t,l=Math.min(s,o),u=this.slice(n,i),c=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let h=this.length-t;if((void 0===r||r>h)&&(r=h),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let f=!1;for(;;)switch(n){case"hex":return function(e,t,r,n){let i;r=Number(r)||0;let s=e.length-r;n?(n=Number(n))>s&&(n=s):n=s;let o=t.length;for(n>o/2&&(n=o/2),i=0;i>8,i.push(r%256),i.push(n);return i}(e,this.length-c),this,c,d);default:if(f)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),f=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},a.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||w(e,t,this.length);let n=this[e],i=1,s=0;for(;++s>>=0,t>>>=0,r||w(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e>>>=0,t||w(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e>>>=0,t||w(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=B(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&N(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+16777216*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+16777216*r;return BigInt(n)+(BigInt(i)<>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&N(e,this.length-8);let n=16777216*t+65536*this[++e]+256*this[++e]+this[++e],i=16777216*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||w(e,t,this.length);let n=this[e],i=1,s=0;for(;++s=(i*=128)&&(n-=Math.pow(2,8*t)),n},a.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||w(e,t,this.length);let n=t,i=1,s=this[e+--n];for(;n>0&&(i*=256);)s+=this[e+--n]*i;return s>=(i*=128)&&(s-=Math.pow(2,8*t)),s},a.prototype.readInt8=function(e,t){return(e>>>=0,t||w(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},a.prototype.readInt16LE=function(e,t){e>>>=0,t||w(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(e,t){e>>>=0,t||w(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e>>>=0,t||w(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=B(function(e){O(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&N(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&N(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<>>=0,t||w(e,4,this.length),i.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e>>>=0,t||w(e,4,this.length),i.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e>>>=0,t||w(e,8,this.length),i.read(this,e,!1,52,8)},a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;_(this,e,t,r,n,0)}let i=1,s=0;for(this[t]=255&e;++s>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;_(this,e,t,r,n,0)}let i=r-1,s=1;for(this[t+i]=255&e;--i>=0&&(s*=256);)this[t+i]=e/s&255;return t+r},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,255,0),this[t]=255&e,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigUInt64LE=B(function(e,t=0){return E(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=B(function(e,t=0){return A(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}let i=0,s=1,o=0;for(this[t]=255&e;++i>0)-o&255;return t+r},a.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);_(this,e,t,r,n-1,-n)}let i=r-1,s=1,o=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===o&&0!==this[t+i+1]&&(o=1),this[t+i]=(e/s>>0)-o&255;return t+r},a.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},a.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},a.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||_(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},a.prototype.writeBigInt64LE=B(function(e,t=0){return E(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=B(function(e,t=0){return A(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeFloatLE=function(e,t,r){return k(this,e,t,!0,r)},a.prototype.writeFloatBE=function(e,t,r){return k(this,e,t,!1,r)},a.prototype.writeDoubleLE=function(e,t,r){return S(this,e,t,!0,r)},a.prototype.writeDoubleBE=function(e,t,r){return S(this,e,t,!1,r)},a.prototype.copy=function(e,t,r,n){if(!a.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function I(e,t,r,n,i,s){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(s+1)*8}${i}`:`>= -(2${i} ** ${(s+1)*8-1}${i}) and < 2 ** ${(s+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new $.ERR_OUT_OF_RANGE("value",n,e)}O(i,"offset"),(void 0===n[i]||void 0===n[i+s])&&N(i,n.length-(s+1))}function O(e,t){if("number"!=typeof e)throw new $.ERR_INVALID_ARG_TYPE(t,"number",e)}function N(e,t,r){if(Math.floor(e)!==e)throw O(e,r),new $.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new $.ERR_BUFFER_OUT_OF_BOUNDS;throw new $.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}C("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),C("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),C("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>4294967296?i=P(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=P(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let M=/[^+/0-9A-Za-z-_]/g;function R(e,t){let r;t=t||1/0;let n=e.length,i=null,s=[];for(let o=0;o55295&&r<57344){if(!i){if(r>56319||o+1===n){(t-=3)>-1&&s.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&s.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&s.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;s.push(r)}else if(r<2048){if((t-=2)<0)break;s.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;s.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;s.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return s}function T(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(M,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function D(e,t,r,n){let i;for(i=0;i=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function L(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}let j=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function B(e){return"undefined"==typeof BigInt?F:e}function F(){throw Error("BigInt not supported")}},55151:function(e,t){var r="undefined"!=typeof self?self:this,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();(function(e){var t={searchParams:"URLSearchParams"in n,iterable:"Symbol"in n&&"iterator"in Symbol,blob:"FileReader"in n&&"Blob"in n&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in n,arrayBuffer:"ArrayBuffer"in n};if(t.arrayBuffer)var r=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&r.indexOf(Object.prototype.toString.call(e))>-1};function s(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function o(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function u(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function d(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function h(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=h(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=h(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(d)}),this.text=function(){var e,t,r,n=u(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function m(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function y(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}g.prototype.clone=function(){return new g(this,{body:this._bodyInit})},f.call(g.prototype),f.call(y.prototype),y.prototype.clone=function(){return new y(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},y.error=function(){var e=new y(null,{status:0,statusText:""});return e.type="error",e};var b=[301,302,303,307,308];y.redirect=function(e,t){if(-1===b.indexOf(t))throw RangeError("Invalid status code");return new y(null,{status:t,headers:{location:e}})},e.DOMException=n.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function v(r,n){return new Promise(function(i,s){var o=new g(r,n);if(o.signal&&o.signal.aborted)return s(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL"),i(new y("response"in a?a.response:a.responseText,r))},a.onerror=function(){s(TypeError("Network request failed"))},a.ontimeout=function(){s(TypeError("Network request failed"))},a.onabort=function(){s(new e.DOMException("Aborted","AbortError"))},a.open(o.method,o.url,!0),"include"===o.credentials?a.withCredentials=!0:"omit"===o.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),o.signal&&(o.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&o.signal.removeEventListener("abort",u)}),a.send(void 0===o._bodyInit?null:o._bodyInit)})}v.polyfill=!0,n.fetch||(n.fetch=v,n.Headers=l,n.Request=g,n.Response=y),e.Headers=l,e.Request=g,e.Response=y,e.fetch=v,Object.defineProperty(e,"__esModule",{value:!0})})({}),n.fetch.ponyfill=!0,delete n.fetch.polyfill,(t=n.fetch).default=n.fetch,t.fetch=n.fetch,t.Headers=n.Headers,t.Request=n.Request,t.Response=n.Response,e.exports=t},56368:function(e){"use strict";var t="%[a-f0-9]{2}",r=RegExp("("+t+")|([^%]+?)","gi"),n=RegExp("("+t+")+","gi");e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return function(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},i=n.exec(e);i;){try{t[i[0]]=decodeURIComponent(i[0])}catch(e){var s=function(e){try{return decodeURIComponent(e)}catch(i){for(var t=e.match(r)||[],n=1;nu)&&(h[o]=u,f.push(o,u),d[o]=s));if(void 0!==n&&void 0===h[n])throw Error(["Could not find a path from ",r," to ",n,"."].join(""));return d},extract_shortest_path_from_predecessor_list:function(e,t){for(var r=[],n=t;n;)r.push(n),e[n],n=e[n];return r.reverse(),r},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){this.queue.push({value:e,cost:t}),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},47059:function(e){"use strict";e.exports=function(e){for(var t=[],r=e.length,n=0;n=55296&&i<=56319&&r>n+1){var s=e.charCodeAt(n+1);s>=56320&&s<=57343&&(i=(i-55296)*1024+s-56320+65536,n+=1)}if(i<128){t.push(i);continue}if(i<2048){t.push(i>>6|192),t.push(63&i|128);continue}if(i<55296||i>=57344&&i<65536){t.push(i>>12|224),t.push(i>>6&63|128),t.push(63&i|128);continue}if(i>=65536&&i<=1114111){t.push(i>>18|240),t.push(i>>12&63|128),t.push(i>>6&63|128),t.push(63&i|128);continue}t.push(239,191,189)}return new Uint8Array(t).buffer}},37836:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function n(){}function i(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw TypeError("The listener must be a function");var a=new i(n,s||e,o),l=r?r+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1)),a.prototype.eventNames=function(){var e,n,i=[];if(0===this._eventsCount)return i;for(n in e=this._events)t.call(e,n)&&i.push(r?n.slice(1):n);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},a.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,s=n.length,o=Array(s);i0&&o.length>i&&!o.warned){o.warned=!0;var i,s,o,u=Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=o.length,console&&console.warn&&console.warn(u)}return e}function c(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=c.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?function(e){for(var t=Array(e.length),r=0;r0&&(o=t[0]),o instanceof Error)throw o;var o,a=Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var l=s[e];if(void 0===l)return!1;if("function"==typeof l)n(l,this,t);else for(var u=l.length,c=p(l,u),r=0;r=0;s--)if(r[s]===t||r[s].listener===t){o=r[s].listener,i=s;break}if(i<0)return this;0===i?r.shift():function(e,t){for(;t+1=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):f.call(e,t)},s.prototype.listenerCount=f,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},94023:function(e){"use strict";var t,r=(t=[{name:"lowercase",re:/[a-z]/,length:26},{name:"uppercase",re:/[A-Z]/,length:26},{name:"numbers",re:/[0-9]/,length:10},{name:"symbols",re:/[^a-zA-Z0-9]/,length:33}],function(e){return t.reduce(function(t,r){return t+(r.re.test(e)?r.length:0)},0)});e.exports=function(e){var t;return e?(t=r(e),Math.round(e.length*Math.log(t)/Math.LN2)):0}},27695:function(e){var t;t=function(){"use strict";function e(e){return Number.isInteger(e)&&e>=0}function t(e){this.name="ArgumentError",this.message=e}return function(r,n){if(n=n||{},"function"!=typeof r)throw new t("fetch must be a function");if("object"!=typeof n)throw new t("defaults must be an object");if(void 0!==n.retries&&!e(n.retries))throw new t("retries must be a positive integer");if(void 0!==n.retryDelay&&!e(n.retryDelay)&&"function"!=typeof n.retryDelay)throw new t("retryDelay must be a positive integer or a function returning a positive integer");if(void 0!==n.retryOn&&!Array.isArray(n.retryOn)&&"function"!=typeof n.retryOn)throw new t("retryOn property expects an array or function");return n=Object.assign({retries:3,retryDelay:1e3,retryOn:[]},n),function(i,s){var o=n.retries,a=n.retryDelay,l=n.retryOn;if(s&&void 0!==s.retries){if(e(s.retries))o=s.retries;else throw new t("retries must be a positive integer")}if(s&&void 0!==s.retryDelay){if(e(s.retryDelay)||"function"==typeof s.retryDelay)a=s.retryDelay;else throw new t("retryDelay must be a positive integer or a function returning a positive integer")}if(s&&s.retryOn){if(Array.isArray(s.retryOn)||"function"==typeof s.retryOn)l=s.retryOn;else throw new t("retryOn property expects an array or function")}return new Promise(function(e,t){var n=function(n){r("undefined"!=typeof Request&&i instanceof Request?i.clone():i,s).then(function(r){if(Array.isArray(l)&&-1===l.indexOf(r.status))e(r);else if("function"==typeof l)try{return Promise.resolve(l(n,null,r)).then(function(t){t?u(n,null,r):e(r)}).catch(t)}catch(e){t(e)}else n=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(s=8,n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0;sthis.blockSize&&(e=new this.Hash().update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},69874:function(e,t,r){"use strict";var n=r(71974),i=r(87398);function s(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function o(e){return 1===e.length?"0"+e:e}function a(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}t.inherits=i,t.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e){if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),i=0;i>6|192:((s=e,o=i,(64512&s.charCodeAt(o))!=55296||o<0||o+1>=s.length?1:(64512&s.charCodeAt(o+1))!=56320)?r[n++]=a>>12|224:(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128),r[n++]=a>>6&63|128),r[n++]=63&a|128)}}else for(i=0;i>>0;return a},t.split32=function(e,t){for(var r=Array(4*e.length),n=0,i=0;n>>24,r[i+1]=s>>>16&255,r[i+2]=s>>>8&255,r[i+3]=255&s):(r[i+3]=s>>>24,r[i+2]=s>>>16&255,r[i+1]=s>>>8&255,r[i]=255&s)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],s=n+e[t+1]>>>0;e[t]=(s>>0,e[t+1]=s},t.sum64_hi=function(e,t,r,n){return(t+n>>>0>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,s,o,a){var l,u=t;return e+r+i+o+(0+((u=u+n>>>0)>>0)>>0)>>0},t.sum64_4_lo=function(e,t,r,n,i,s,o,a){return t+n+s+a>>>0},t.sum64_5_hi=function(e,t,r,n,i,s,o,a,l,u){var c,d=t;return e+r+i+o+l+(0+((d=d+n>>>0)>>0)>>0)>>0)>>0},t.sum64_5_lo=function(e,t,r,n,i,s,o,a,l,u){return t+n+s+a+u>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},46451:function(e,t,r){"use strict";var n=r(12659),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},s={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},o={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return n.isMemo(e)?o:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=o;var u=Object.defineProperty,c=Object.getOwnPropertyNames,d=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=f(r);i&&i!==p&&e(t,i,n)}var o=c(r);d&&(o=o.concat(d(r)));for(var a=l(t),g=l(r),m=0;m */t.read=function(e,t,r,n,i){var s,o,a=8*i-n-1,l=(1<>1,c=-7,d=r?i-1:0,h=r?-1:1,f=e[t+d];for(d+=h,s=f&(1<<-c)-1,f>>=-c,c+=a;c>0;s=256*s+e[t+d],d+=h,c-=8);for(o=s&(1<<-c)-1,s>>=-c,c+=n;c>0;o=256*o+e[t+d],d+=h,c-=8);if(0===s)s=1-u;else{if(s===l)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,n),s-=u}return(f?-1:1)*o*Math.pow(2,s-n)},t.write=function(e,t,r,n,i,s){var o,a,l,u=8*s-i-1,c=(1<>1,h=23===i?5960464477539062e-23:0,f=n?0:s-1,p=n?1:-1,g=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,o=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-o))<1&&(o--,l*=2),o+d>=1?t+=h/l:t+=h*Math.pow(2,1-d),t*l>=2&&(o++,l/=2),o+d>=c?(a=0,o=c):o+d>=1?(a=(t*l-1)*Math.pow(2,i),o+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[r+f]=255&a,f+=p,a/=256,i-=8);for(o=o<0;e[r+f]=255&o,f+=p,o/=256,u-=8);e[r+f-p]|=128*g}},87398:function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},83524:function(e,t,r){var n,i=r(25566);!function(){"use strict";var s="input is invalid type",o="object"==typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var l=!o&&"object"==typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node?a=r.g:l&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,d=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,h="0123456789abcdef".split(""),f=[4,1024,262144,67108864],p=[0,8,16,24],g=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],m=[224,256,384,512],y=[128,256],b=["hex","buffer","arrayBuffer","array","digest"],v={128:168,256:136};(a.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),d&&(a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var w=function(e,t,r){return function(n){return new T(e,t,e).update(n)[r]()}},_=function(e,t,r){return function(n,i){return new T(e,t,i).update(n)[r]()}},E=function(e,t,r){return function(t,n,i,s){return $["cshake"+e].update(t,n,i,s)[r]()}},A=function(e,t,r){return function(t,n,i,s){return $["kmac"+e].update(t,n,i,s)[r]()}},x=function(e,t,r,n){for(var i=0;i>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function D(e,t,r){T.call(this,e,t,r)}T.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(s);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw Error(s)}else throw Error(s);t=!0}for(var n,i,o=this.blocks,a=this.byteCount,l=e.length,u=this.blockCount,c=0,h=this.s;c>2]|=e[c]<>2]|=i<>2]|=(192|i>>6)<=57344?o[n>>2]|=(224|i>>12)<>2]|=(240|i>>18)<>2]|=(128|i>>12&63)<>2]|=(128|i>>6&63)<>2]|=(128|63&i)<=a){for(this.start=n-a,this.block=o[u],n=0;n>=8,r=255&e;r>0;)i.unshift(r),e>>=8,r=255&e,++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},T.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(s);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw Error(s)}else throw Error(s);t=!0}var n=0,i=e.length;if(t)n=i;else for(var o=0;o=57344?n+=3:(a=65536+((1023&a)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},T.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(t=1,e[0]=e[r];t>4&15]+h[15&e]+h[e>>12&15]+h[e>>8&15]+h[e>>20&15]+h[e>>16&15]+h[e>>28&15]+h[e>>24&15];o%t==0&&(L(r),s=0)}return i&&(a+=h[(e=r[s])>>4&15]+h[15&e],i>1&&(a+=h[e>>12&15]+h[e>>8&15]),i>2&&(a+=h[e>>20&15]+h[e>>16&15])),a},T.prototype.arrayBuffer=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,s=0,o=0,a=this.outputBits>>3,l=new Uint32Array(e=new ArrayBuffer(i?n+1<<2:a));o>8&255,l[e+2]=t>>16&255,l[e+3]=t>>24&255;a%r==0&&L(n)}return s&&(e=a<<2,t=n[o],l[e]=255&t,s>1&&(l[e+1]=t>>8&255),s>2&&(l[e+2]=t>>16&255)),l},D.prototype=new T,D.prototype.finalize=function(){return this.encode(this.outputBits,!0),T.prototype.finalize.call(this)};var L=function(e){var t,r,n,i,s,o,a,l,u,c,d,h,f,p,m,y,b,v,w,_,E,A,x,k,S,$,C,P,I,O,N,M,R,T,D,L,j,B,F,U,z,q,H,G,V,W,K,Y,Z,J,Q,X,ee,et,er,en,ei,es,eo,ea,el,eu,ec;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],s=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],a=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],u=e[5]^e[15]^e[25]^e[35]^e[45],c=e[6]^e[16]^e[26]^e[36]^e[46],d=e[7]^e[17]^e[27]^e[37]^e[47],h=e[8]^e[18]^e[28]^e[38]^e[48],f=e[9]^e[19]^e[29]^e[39]^e[49],t=h^(o<<1|a>>>31),r=f^(a<<1|o>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(l<<1|u>>>31),r=s^(u<<1|l>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=o^(c<<1|d>>>31),r=a^(d<<1|c>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=l^(h<<1|f>>>31),r=u^(f<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=c^(i<<1|s>>>31),r=d^(s<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,p=e[0],m=e[1],W=e[11]<<4|e[10]>>>28,K=e[10]<<4|e[11]>>>28,P=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,ea=e[31]<<9|e[30]>>>23,el=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,H=e[41]<<18|e[40]>>>14,T=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,b=e[12]<<12|e[13]>>>20,Y=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,O=e[33]<<13|e[32]>>>19,N=e[32]<<13|e[33]>>>19,eu=e[42]<<2|e[43]>>>30,ec=e[43]<<2|e[42]>>>30,et=e[5]<<30|e[4]>>>2,er=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,J=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,M=e[45]<<29|e[44]>>>3,R=e[44]<<29|e[45]>>>3,k=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,en=e[17]<<23|e[16]>>>9,ei=e[16]<<23|e[17]>>>9,B=e[26]<<25|e[27]>>>7,F=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,X=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,G=e[8]<<27|e[9]>>>5,V=e[9]<<27|e[8]>>>5,$=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,es=e[29]<<7|e[28]>>>25,eo=e[28]<<7|e[29]>>>25,U=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,A=e[48]<<14|e[49]>>>18,x=e[49]<<14|e[48]>>>18,e[0]=p^~y&v,e[1]=m^~b&w,e[10]=k^~$&P,e[11]=S^~C&I,e[20]=T^~L&B,e[21]=D^~j&F,e[30]=G^~W&Y,e[31]=V^~K&Z,e[40]=et^~en&es,e[41]=er^~ei&eo,e[2]=y^~v&_,e[3]=b^~w&E,e[12]=$^~P&O,e[13]=C^~I&N,e[22]=L^~B&U,e[23]=j^~F&z,e[32]=W^~Y&J,e[33]=K^~Z&Q,e[42]=en^~es&ea,e[43]=ei^~eo&el,e[4]=v^~_&A,e[5]=w^~E&x,e[14]=P^~O&M,e[15]=I^~N&R,e[24]=B^~U&q,e[25]=F^~z&H,e[34]=Y^~J&X,e[35]=Z^~Q&ee,e[44]=es^~ea&eu,e[45]=eo^~el&ec,e[6]=_^~A&p,e[7]=E^~x&m,e[16]=O^~M&k,e[17]=N^~R&S,e[26]=U^~q&T,e[27]=z^~H&D,e[36]=J^~X&G,e[37]=Q^~ee&V,e[46]=ea^~eu&et,e[47]=el^~ec&er,e[8]=A^~p&y,e[9]=x^~m&b,e[18]=M^~k&$,e[19]=R^~S&C,e[28]=q^~T&L,e[29]=H^~D&j,e[38]=X^~G&W,e[39]=ee^~V&K,e[48]=eu^~et&en,e[49]=ec^~er&ei,e[0]^=g[n],e[1]^=g[n+1]};if(u)e.exports=$;else{for(P=0;Pclass t extends i{constructor(t,r,n,i,s){super(s),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._hashBitLength=i,this._options=s,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(e){let t=null;try{this.push(this.digest())}catch(e){t=e}e(t)}update(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw TypeError("Data must be a string or a buffer");if(this._finalized)throw Error("Digest already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this}digest(e){if(this._finalized)throw Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let t=this._state.squeeze(this._hashBitLength/8);return void 0!==e&&(t=t.toString(e)),this._resetState(),t}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let e=new t(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},1911:function(e,t,r){var n=r(9109).Buffer;let{Transform:i}=r(5939);e.exports=e=>class t extends i{constructor(t,r,n,i){super(i),this._rate=t,this._capacity=r,this._delimitedSuffix=n,this._options=i,this._state=new e,this._state.initialize(t,r),this._finalized=!1}_transform(e,t,r){let n=null;try{this.update(e,t)}catch(e){n=e}r(n)}_flush(){}_read(e){this.push(this.squeeze(e))}update(e,t){if(!n.isBuffer(e)&&"string"!=typeof e)throw TypeError("Data must be a string or a buffer");if(this._finalized)throw Error("Squeeze already called");return n.isBuffer(e)||(e=n.from(e,t)),this._state.absorb(e),this}squeeze(e,t){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let r=this._state.squeeze(e);return void 0!==t&&(r=r.toString(t)),r}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){let e=new t(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(e._state),e._finalized=this._finalized,e}}},66768:function(e,t){let r=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];t.p1600=function(e){for(let t=0;t<24;++t){let n=e[0]^e[10]^e[20]^e[30]^e[40],i=e[1]^e[11]^e[21]^e[31]^e[41],s=e[2]^e[12]^e[22]^e[32]^e[42],o=e[3]^e[13]^e[23]^e[33]^e[43],a=e[4]^e[14]^e[24]^e[34]^e[44],l=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],c=e[7]^e[17]^e[27]^e[37]^e[47],d=e[8]^e[18]^e[28]^e[38]^e[48],h=e[9]^e[19]^e[29]^e[39]^e[49],f=d^(s<<1|o>>>31),p=h^(o<<1|s>>>31),g=e[0]^f,m=e[1]^p,y=e[10]^f,b=e[11]^p,v=e[20]^f,w=e[21]^p,_=e[30]^f,E=e[31]^p,A=e[40]^f,x=e[41]^p;f=n^(a<<1|l>>>31),p=i^(l<<1|a>>>31);let k=e[2]^f,S=e[3]^p,$=e[12]^f,C=e[13]^p,P=e[22]^f,I=e[23]^p,O=e[32]^f,N=e[33]^p,M=e[42]^f,R=e[43]^p;f=s^(u<<1|c>>>31),p=o^(c<<1|u>>>31);let T=e[4]^f,D=e[5]^p,L=e[14]^f,j=e[15]^p,B=e[24]^f,F=e[25]^p,U=e[34]^f,z=e[35]^p,q=e[44]^f,H=e[45]^p;f=a^(d<<1|h>>>31),p=l^(h<<1|d>>>31);let G=e[6]^f,V=e[7]^p,W=e[16]^f,K=e[17]^p,Y=e[26]^f,Z=e[27]^p,J=e[36]^f,Q=e[37]^p,X=e[46]^f,ee=e[47]^p;f=u^(n<<1|i>>>31),p=c^(i<<1|n>>>31);let et=e[8]^f,er=e[9]^p,en=e[18]^f,ei=e[19]^p,es=e[28]^f,eo=e[29]^p,ea=e[38]^f,el=e[39]^p,eu=e[48]^f,ec=e[49]^p,ed=b<<4|y>>>28,eh=y<<4|b>>>28,ef=v<<3|w>>>29,ep=w<<3|v>>>29,eg=E<<9|_>>>23,em=_<<9|E>>>23,ey=A<<18|x>>>14,eb=x<<18|A>>>14,ev=k<<1|S>>>31,ew=S<<1|k>>>31,e_=C<<12|$>>>20,eE=$<<12|C>>>20,eA=P<<10|I>>>22,ex=I<<10|P>>>22,ek=N<<13|O>>>19,eS=O<<13|N>>>19,e$=M<<2|R>>>30,eC=R<<2|M>>>30,eP=D<<30|T>>>2,eI=T<<30|D>>>2,eO=L<<6|j>>>26,eN=j<<6|L>>>26,eM=F<<11|B>>>21,eR=B<<11|F>>>21,eT=U<<15|z>>>17,eD=z<<15|U>>>17,eL=H<<29|q>>>3,ej=q<<29|H>>>3,eB=G<<28|V>>>4,eF=V<<28|G>>>4,eU=K<<23|W>>>9,ez=W<<23|K>>>9,eq=Y<<25|Z>>>7,eH=Z<<25|Y>>>7,eG=J<<21|Q>>>11,eV=Q<<21|J>>>11,eW=ee<<24|X>>>8,eK=X<<24|ee>>>8,eY=et<<27|er>>>5,eZ=er<<27|et>>>5,eJ=en<<20|ei>>>12,eQ=ei<<20|en>>>12,eX=eo<<7|es>>>25,e0=es<<7|eo>>>25,e1=ea<<8|el>>>24,e2=el<<8|ea>>>24,e3=eu<<14|ec>>>18,e5=ec<<14|eu>>>18;e[0]=g^~e_&eM,e[1]=m^~eE&eR,e[10]=eB^~eJ&ef,e[11]=eF^~eQ&ep,e[20]=ev^~eO&eq,e[21]=ew^~eN&eH,e[30]=eY^~ed&eA,e[31]=eZ^~eh&ex,e[40]=eP^~eU&eX,e[41]=eI^~ez&e0,e[2]=e_^~eM&eG,e[3]=eE^~eR&eV,e[12]=eJ^~ef&ek,e[13]=eQ^~ep&eS,e[22]=eO^~eq&e1,e[23]=eN^~eH&e2,e[32]=ed^~eA&eT,e[33]=eh^~ex&eD,e[42]=eU^~eX&eg,e[43]=ez^~e0&em,e[4]=eM^~eG&e3,e[5]=eR^~eV&e5,e[14]=ef^~ek&eL,e[15]=ep^~eS&ej,e[24]=eq^~e1&ey,e[25]=eH^~e2&eb,e[34]=eA^~eT&eW,e[35]=ex^~eD&eK,e[44]=eX^~eg&e$,e[45]=e0^~em&eC,e[6]=eG^~e3&g,e[7]=eV^~e5&m,e[16]=ek^~eL&eB,e[17]=eS^~ej&eF,e[26]=e1^~ey&ev,e[27]=e2^~eb&ew,e[36]=eT^~eW&eY,e[37]=eD^~eK&eZ,e[46]=eg^~e$&eP,e[47]=em^~eC&eI,e[8]=e3^~g&e_,e[9]=e5^~m&eE,e[18]=eL^~eB&eJ,e[19]=ej^~eF&eQ,e[28]=ey^~ev&eO,e[29]=eb^~ew&eN,e[38]=eW^~eY&ed,e[39]=eK^~eZ&eh,e[48]=e$^~eP&eU,e[49]=eC^~eI&ez,e[0]^=r[2*t],e[1]^=r[2*t+1]}}},14417:function(e,t,r){var n=r(9109).Buffer;let i=r(66768);function s(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}s.prototype.initialize=function(e,t){for(let e=0;e<50;++e)this.state[e]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1},s.prototype.absorb=function(e){for(let t=0;t>>this.count%4*8&255,this.count+=1,this.count===this.blockSize&&(i.p1600(this.state),this.count=0);return t},s.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing},e.exports=s},8355:function(e,t,r){e=r.nmd(e);var n,i,s,o="__lodash_hash_undefined__",a="[object Arguments]",l="[object Array]",u="[object Boolean]",c="[object Date]",d="[object Error]",h="[object Function]",f="[object Map]",p="[object Number]",g="[object Object]",m="[object Promise]",y="[object RegExp]",b="[object Set]",v="[object String]",w="[object WeakMap]",_="[object ArrayBuffer]",E="[object DataView]",A=/^\[object .+?Constructor\]$/,x=/^(?:0|[1-9]\d*)$/,k={};k["[object Float32Array]"]=k["[object Float64Array]"]=k["[object Int8Array]"]=k["[object Int16Array]"]=k["[object Int32Array]"]=k["[object Uint8Array]"]=k["[object Uint8ClampedArray]"]=k["[object Uint16Array]"]=k["[object Uint32Array]"]=!0,k[a]=k[l]=k[_]=k[u]=k[E]=k[c]=k[d]=k[h]=k[f]=k[p]=k[g]=k[y]=k[b]=k[v]=k[w]=!1;var S="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g,$="object"==typeof self&&self&&self.Object===Object&&self,C=S||$||Function("return this")(),P=t&&!t.nodeType&&t,I=P&&e&&!e.nodeType&&e,O=I&&I.exports===P,N=O&&S.process,M=function(){try{return N&&N.binding&&N.binding("util")}catch(e){}}(),R=M&&M.isTypedArray;function T(e){var t=-1,r=Array(e.size);return e.forEach(function(e,n){r[++t]=[n,e]}),r}function D(e){var t=-1,r=Array(e.size);return e.forEach(function(e){r[++t]=e}),r}var L=Array.prototype,j=Function.prototype,B=Object.prototype,F=C["__core-js_shared__"],U=j.toString,z=B.hasOwnProperty,q=(n=/[^.]+$/.exec(F&&F.keys&&F.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",H=B.toString,G=RegExp("^"+U.call(z).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),V=O?C.Buffer:void 0,W=C.Symbol,K=C.Uint8Array,Y=B.propertyIsEnumerable,Z=L.splice,J=W?W.toStringTag:void 0,Q=Object.getOwnPropertySymbols,X=V?V.isBuffer:void 0,ee=(i=Object.keys,s=Object,function(e){return i(s(e))}),et=ek(C,"DataView"),er=ek(C,"Map"),en=ek(C,"Promise"),ei=ek(C,"Set"),es=ek(C,"WeakMap"),eo=ek(Object,"create"),ea=eC(et),el=eC(er),eu=eC(en),ec=eC(ei),ed=eC(es),eh=W?W.prototype:void 0,ef=eh?eh.valueOf:void 0;function ep(e){var t=-1,r=null==e?0:e.length;for(this.clear();++ta))return!1;var u=s.get(e);if(u&&s.get(t))return u==t;var c=-1,d=!0,h=2&r?new ey:void 0;for(s.set(e,t),s.set(t,e);++c-1&&c%1==0&&c-1},eg.prototype.set=function(e,t){var r=this.__data__,n=ev(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this},em.prototype.clear=function(){this.size=0,this.__data__={hash:new ep,map:new(er||eg),string:new ep}},em.prototype.delete=function(e){var t=ex(this,e).delete(e);return this.size-=t?1:0,t},em.prototype.get=function(e){return ex(this,e).get(e)},em.prototype.has=function(e){return ex(this,e).has(e)},em.prototype.set=function(e,t){var r=ex(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this},ey.prototype.add=ey.prototype.push=function(e){return this.__data__.set(e,o),this},ey.prototype.has=function(e){return this.__data__.has(e)},eb.prototype.clear=function(){this.__data__=new eg,this.size=0},eb.prototype.delete=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r},eb.prototype.get=function(e){return this.__data__.get(e)},eb.prototype.has=function(e){return this.__data__.has(e)},eb.prototype.set=function(e,t){var r=this.__data__;if(r instanceof eg){var n=r.__data__;if(!er||n.length<199)return n.push([e,t]),this.size=++r.size,this;r=this.__data__=new em(n)}return r.set(e,t),this.size=r.size,this};var eS=Q?function(e){return null==e?[]:function(e,t){for(var r=-1,n=null==e?0:e.length,i=0,s=[];++r-1&&e%1==0&&e<=9007199254740991}function eT(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}function eD(e){return null!=e&&"object"==typeof e}var eL=R?function(e){return R(e)}:function(e){return eD(e)&&eR(e.length)&&!!k[ew(e)]};e.exports=function(e,t){return function e(t,r,n,i,s){return t===r||(null!=t&&null!=r&&(eD(t)||eD(r))?function(e,t,r,n,i,s){var o=eO(e),h=eO(t),m=o?l:e$(e),w=h?l:e$(t);m=m==a?g:m,w=w==a?g:w;var A=m==g,x=w==g,k=m==w;if(k&&eN(e)){if(!eN(t))return!1;o=!0,A=!1}if(k&&!A)return s||(s=new eb),o||eL(e)?eE(e,t,r,n,i,s):function(e,t,r,n,i,s,o){switch(r){case E:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)break;e=e.buffer,t=t.buffer;case _:if(e.byteLength!=t.byteLength||!s(new K(e),new K(t)))break;return!0;case u:case c:case p:return eP(+e,+t);case d:return e.name==t.name&&e.message==t.message;case y:case v:return e==t+"";case f:var a=T;case b:var l=1&n;if(a||(a=D),e.size!=t.size&&!l)break;var h=o.get(e);if(h)return h==t;n|=2,o.set(e,t);var g=eE(a(e),a(t),n,i,s,o);return o.delete(e),g;case"[object Symbol]":if(ef)return ef.call(e)==ef.call(t)}return!1}(e,t,m,r,n,i,s);if(!(1&r)){var S=A&&z.call(e,"__wrapped__"),$=x&&z.call(t,"__wrapped__");if(S||$){var C=S?e.value():e,P=$?t.value():t;return s||(s=new eb),i(C,P,r,n,s)}}return!!k&&(s||(s=new eb),function(e,t,r,n,i,s){var o=1&r,a=eA(e),l=a.length;if(l!=eA(t).length&&!o)return!1;for(var u=l;u--;){var c=a[u];if(!(o?c in t:z.call(t,c)))return!1}var d=s.get(e);if(d&&s.get(t))return d==t;var h=!0;s.set(e,t),s.set(t,e);for(var f=o;++u2&&(a.children=arguments.length>3?n.call(arguments,2):r),"function"==typeof e&&null!=e.defaultProps)for(o in e.defaultProps)void 0===a[o]&&(a[o]=e.defaultProps[o]);return E(e,a,i,s,null)}function E(e,t,r,n,o){var a={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:null==o?++s:o,__i:-1,__u:0};return null==o&&null!=i.vnode&&i.vnode(a),a}function A(){return{current:null}}function x(e){return e.children}function k(e,t){this.props=e,this.context=t}function S(e,t){if(null==t)return e.__?S(e.__,e.__i+1):null;for(var r;tt&&a.sort(c));C.__r=0}function P(e,t,r,n,i,s,o,a,l,u,c){var d,h,f,p,y,v=n&&n.__k||m,w=t.length;for(r.__d=l,function(e,t,r){var n,i,s,o,a,l=t.length,u=r.length,c=u,d=0;for(e.__k=[],n=0;n0?E(i.type,i.props,i.key,i.ref?i.ref:null,i.__v):i)?(i.__=e,i.__b=e.__b+1,a=function(e,t,r,n){var i=e.key,s=e.type,o=r-1,a=r+1,l=t[r];if(null===l||l&&i==l.key&&s===l.type&&0==(131072&l.__u))return r;if(n>(null!=l&&0==(131072&l.__u)?1:0))for(;o>=0||a=0){if((l=t[o])&&0==(131072&l.__u)&&i==l.key&&s===l.type)return o;o--}if(ao?c>l-o?d+=a-o:d--:a2&&(l.children=arguments.length>3?n.call(arguments,2):r),E(e.type,l,i||e.key,s||e.ref,null)}function U(e,t){var r={__c:t="__cC"+p++,__:e,Consumer:function(e,t){return e.children(t)},Provider:function(e){var r,n;return this.getChildContext||(r=[],(n={})[t]=this,this.getChildContext=function(){return n},this.componentWillUnmount=function(){r=null},this.shouldComponentUpdate=function(e){this.props.value!==e.value&&r.some(function(e){e.__e=!0,$(e)})},this.sub=function(e){r.push(e);var t=e.componentWillUnmount;e.componentWillUnmount=function(){r&&r.splice(r.indexOf(e),1),t&&t.call(e)}}),e.children}};return r.Provider.__=r.Consumer.contextType=r}n=m.slice,i={__e:function(e,t,r,n){for(var i,s,o;t=t.__;)if((i=t.__c)&&!i.__)try{if((s=i.constructor)&&null!=s.getDerivedStateFromError&&(i.setState(s.getDerivedStateFromError(e)),o=i.__d),null!=i.componentDidCatch&&(i.componentDidCatch(e,n||{}),o=i.__d),o)return i.__E=i}catch(t){e=t}throw e}},s=0,o=function(e){return null!=e&&null==e.constructor},k.prototype.setState=function(e,t){var r;r=null!=this.__s&&this.__s!==this.state?this.__s:this.__s=v({},this.state),"function"==typeof e&&(e=e(v({},r),this.props)),e&&v(r,e),null!=e&&this.__v&&(t&&this._sb.push(t),$(this))},k.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$(this))},k.prototype.render=x,a=[],u="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,c=function(e,t){return e.__v.__b-t.__v.__b},C.__r=0,d=0,h=N(!1),f=N(!0),p=0},83148:function(e,t,r){"use strict";r.r(t),r.d(t,{useCallback:function(){return k},useContext:function(){return S},useDebugValue:function(){return $},useEffect:function(){return w},useErrorBoundary:function(){return C},useId:function(){return P},useImperativeHandle:function(){return A},useLayoutEffect:function(){return _},useMemo:function(){return x},useReducer:function(){return v},useRef:function(){return E},useState:function(){return b}});var n,i,s,o,a=r(57764),l=0,u=[],c=a.options,d=c.__b,h=c.__r,f=c.diffed,p=c.__c,g=c.unmount,m=c.__;function y(e,t){c.__h&&c.__h(i,e,l||t),l=0;var r=i.__H||(i.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function b(e){return l=1,v(T,e)}function v(e,t,r){var s=y(n++,2);if(s.t=e,!s.__c&&(s.__=[r?r(t):T(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],r=s.t(t,e);t!==r&&(s.__N=[r,s.__[1]],s.__c.setState({}))}],s.__c=i,!i.u)){var o=function(e,t,r){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter(function(e){return!!e.__c});if(n.every(function(e){return!e.__N}))return!a||a.call(this,e,t,r);var i=!1;return n.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(i=!0)}}),!(!i&&s.__c.props===e)&&(!a||a.call(this,e,t,r))};i.u=!0;var a=i.shouldComponentUpdate,l=i.componentWillUpdate;i.componentWillUpdate=function(e,t,r){if(this.__e){var n=a;a=void 0,o(e,t,r),a=n}l&&l.call(this,e,t,r)},i.shouldComponentUpdate=o}return s.__N||s.__}function w(e,t){var r=y(n++,3);!c.__s&&R(r.__H,t)&&(r.__=e,r.i=t,i.__H.__h.push(r))}function _(e,t){var r=y(n++,4);!c.__s&&R(r.__H,t)&&(r.__=e,r.i=t,i.__h.push(r))}function E(e){return l=5,x(function(){return{current:e}},[])}function A(e,t,r){l=6,_(function(){return"function"==typeof e?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},null==r?r:r.concat(e))}function x(e,t){var r=y(n++,7);return R(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function k(e,t){return l=8,x(function(){return e},t)}function S(e){var t=i.context[e.__c],r=y(n++,9);return r.c=e,t?(null==r.__&&(r.__=!0,t.sub(i)),t.props.value):e.__}function $(e,t){c.useDebugValue&&c.useDebugValue(t?t(e):e)}function C(e){var t=y(n++,10),r=b();return t.__=e,i.componentDidCatch||(i.componentDidCatch=function(e,n){t.__&&t.__(e,n),r[1](e)}),[r[0],function(){r[1](void 0)}]}function P(){var e=y(n++,11);if(!e.__){for(var t=i.__v;null!==t&&!t.__m&&null!==t.__;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function I(){for(var e;e=u.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(N),e.__H.__h.forEach(M),e.__H.__h=[]}catch(t){e.__H.__h=[],c.__e(t,e.__v)}}c.__b=function(e){i=null,d&&d(e)},c.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),m&&m(e,t)},c.__r=function(e){h&&h(e),n=0;var t=(i=e.__c).__H;t&&(s===i?(t.__h=[],i.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.i=e.__N=void 0})):(t.__h.forEach(N),t.__h.forEach(M),t.__h=[],n=0)),s=i},c.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==u.push(t)&&o===c.requestAnimationFrame||((o=c.requestAnimationFrame)||function(e){var t,r=function(){clearTimeout(n),O&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);O&&(t=requestAnimationFrame(r))})(I)),t.__H.__.forEach(function(e){e.i&&(e.__H=e.i),e.i=void 0})),s=i=null},c.__c=function(e,t){t.some(function(e){try{e.__h.forEach(N),e.__h=e.__h.filter(function(e){return!e.__||M(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],c.__e(r,e.__v)}}),p&&p(e,t)},c.unmount=function(e){g&&g(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(e){try{N(e)}catch(e){t=e}}),r.__H=void 0,t&&c.__e(t,r.__v))};var O="function"==typeof requestAnimationFrame;function N(e){var t=i,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),i=t}function M(e){var t=i;e.__c=e.__(),i=t}function R(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function T(e,t){return"function"==typeof t?t(e):t}},19783:function(e,t,r){let n=r(87936),i=r(23364),s=r(64811),o=r(65773);function a(e,t,r,s,o){let a=[].slice.call(arguments,1),l=a.length,u="function"==typeof a[l-1];if(!u&&!n())throw Error("Callback required as last argument");if(u){if(l<2)throw Error("Too few arguments provided");2===l?(o=r,r=t,t=s=void 0):3===l&&(t.getContext&&void 0===o?(o=s,s=void 0):(o=s,s=r,r=t,t=void 0))}else{if(l<1)throw Error("Too few arguments provided");return 1===l?(r=t,t=s=void 0):2!==l||t.getContext||(s=r,r=t,t=void 0),new Promise(function(n,o){try{let o=i.create(r,s);n(e(o,t,s))}catch(e){o(e)}})}try{let n=i.create(r,s);o(null,e(n,t,s))}catch(e){o(e)}}t.create=i.create,t.toCanvas=a.bind(null,s.render),t.toDataURL=a.bind(null,s.renderToDataURL),t.toString=a.bind(null,function(e,t,r){return o.render(e,r)})},87936:function(e){e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},80532:function(e,t,r){let n=r(2601).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];let t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),s=[r-7];for(let e=1;e>>7-e%8&1)==1},put:function(e,t){for(let r=0;r>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},43143:function(e){function t(e){if(!e||e<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){let i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},23841:function(e,t,r){let n=r(47059),i=r(58257);function s(e){this.mode=i.BYTE,"string"==typeof e&&(e=n(e)),this.data=new Uint8Array(e)}s.getBitsLength=function(e){return 8*e},s.prototype.getLength=function(){return this.data.length},s.prototype.getBitsLength=function(){return s.getBitsLength(this.data.length)},s.prototype.write=function(e){for(let t=0,r=this.data.length;t=0&&e.bit<4},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw Error("Unknown EC Level: "+e)}}(e)}catch(e){return r}}},16123:function(e,t,r){let n=r(2601).getSymbolSize;t.getPositions=function(e){let t=n(e);return[[0,0],[t-7,0],[0,t-7]]}},59906:function(e,t,r){let n=r(2601),i=n.getBCHDigit(1335);t.getEncodedBits=function(e,t){let r=e.bit<<3|t,s=r<<10;for(;n.getBCHDigit(s)-i>=0;)s^=1335<=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),e.put(r,13)}},e.exports=s},42903:function(e,t){t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};let r={N1:3,N2:3,N3:40,N4:10};t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){let t=e.size,n=0,i=0,s=0,o=null,a=null;for(let l=0;l=5&&(n+=r.N1+(i-5)),o=t,i=1),(t=e.get(u,l))===a?s++:(s>=5&&(n+=r.N1+(s-5)),a=t,s=1)}i>=5&&(n+=r.N1+(i-5)),s>=5&&(n+=r.N1+(s-5))}return n},t.getPenaltyN2=function(e){let t=e.size,n=0;for(let r=0;r=10&&(1488===i||93===i)&&n++,s=s<<1&2047|e.get(o,r),o>=10&&(1488===s||93===s)&&n++}return n*r.N3},t.getPenaltyN4=function(e){let t=0,n=e.data.length;for(let r=0;r=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return function(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw Error("Unknown mode: "+e)}}(e)}catch(e){return r}}},6078:function(e,t,r){let n=r(58257);function i(e){this.mode=n.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r;for(t=0;t+3<=this.data.length;t+=3)r=parseInt(this.data.substr(t,3),10),e.put(r,10);let n=this.data.length-t;n>0&&(r=parseInt(this.data.substr(t),10),e.put(r,3*n+1))},e.exports=i},80958:function(e,t,r){let n=r(61011);t.mul=function(e,t){let r=new Uint8Array(e.length+t.length-1);for(let i=0;i=0;){let e=r[0];for(let i=0;i>n&1)==1,n<6?e.set(n,8,i,!0):n<8?e.set(n+1,8,i,!0):e.set(s-15+n,8,i,!0),n<8?e.set(8,s-n-1,i,!0):n<9?e.set(8,15-n-1+1,i,!0):e.set(8,15-n-1,i,!0);e.set(s-8,8,1,!0)}t.create=function(e,t){let r,f;if(void 0===e||""===e)throw Error("No input text");let y=i.M;return void 0!==t&&(y=i.from(t.errorCorrectionLevel,i.M),r=h.from(t.version),f=u.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),function(e,t,r,i){let f;if(Array.isArray(e))f=g.fromArray(e);else if("string"==typeof e){let n=t;if(!n){let t=g.rawSplit(e);n=h.getBestVersionForData(t,r)}f=g.fromString(e,n||40)}else throw Error("Invalid data");let y=h.getBestVersionForData(f,r);if(!y)throw Error("The amount of data is too big to be stored in a QR Code");if(t){if(t=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,s+n,!0,!0):e.set(i+t,s+n,!1,!0))}}(v,t),function(e){let t=e.size;for(let r=8;r=7&&function(e,t){let r,n,i;let s=e.size,o=h.getEncodedBits(t);for(let t=0;t<18;t++)r=Math.floor(t/3),n=t%3+s-8-3,i=(o>>t&1)==1,e.set(r,n,i,!0),e.set(n,r,i,!0)}(v,t),function(e,t){let r=e.size,n=-1,i=r-1,s=7,o=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;o>>s&1)==1),e.set(i,a-r,n),-1==--s&&(o++,s=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}(v,b),isNaN(i)&&(i=u.getBestMask(v,m.bind(null,v,r))),u.applyMask(i,v),m(v,r,i),{modules:v,version:t,errorCorrectionLevel:r,maskPattern:i,segments:f}}(e,r,y,f)}},84001:function(e,t,r){let n=r(80958);function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},e.exports=i},36276:function(e,t){let r="[0-9]+",n="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",i="(?:(?![A-Z0-9 $%*+\\-./:]|"+(n=n.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";t.KANJI=RegExp(n,"g"),t.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=RegExp(i,"g"),t.NUMERIC=RegExp(r,"g"),t.ALPHANUMERIC=RegExp("[A-Z $%*+\\-./:]+","g");let s=RegExp("^"+n+"$"),o=RegExp("^"+r+"$"),a=RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return s.test(e)},t.testNumeric=function(e){return o.test(e)},t.testAlphanumeric=function(e){return a.test(e)}},25051:function(e,t,r){let n=r(58257),i=r(6078),s=r(62971),o=r(23841),a=r(62558),l=r(36276),u=r(2601),c=r(52892);function d(e){return unescape(encodeURIComponent(e)).length}function h(e,t,r){let n;let i=[];for(;null!==(n=e.exec(r));)i.push({data:n[0],index:n.index,mode:t,length:n[0].length});return i}function f(e){let t,r;let i=h(l.NUMERIC,n.NUMERIC,e),s=h(l.ALPHANUMERIC,n.ALPHANUMERIC,e);return u.isKanjiModeEnabled()?(t=h(l.BYTE,n.BYTE,e),r=h(l.KANJI,n.KANJI,e)):(t=h(l.BYTE_KANJI,n.BYTE,e),r=[]),i.concat(s,t,r).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function p(e,t){switch(t){case n.NUMERIC:return i.getBitsLength(e);case n.ALPHANUMERIC:return s.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return o.getBitsLength(e)}}function g(e,t){let r;let l=n.getBestModeForData(e);if((r=n.from(t,l))!==n.BYTE&&r.bit=0?e[e.length-1]:null;return r&&r.mode===t.mode?e[e.length-1].data+=t.data:e.push(t),e},[]))},t.rawSplit=function(e){return t.fromArray(f(e,u.isKanjiModeEnabled()))}},2601:function(e,t){let r;let n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw Error('"version" cannot be null or undefined');if(e<1||e>40)throw Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},66477:function(e,t){t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},11888:function(e,t,r){let n=r(2601),i=r(34270),s=r(38428),o=r(58257),a=r(66477),l=n.getBCHDigit(7973);function u(e,t){return o.getCharCountIndicator(e,t)+4}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw Error("Invalid QR Code version");void 0===r&&(r=o.BYTE);let s=(n.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t))*8;if(r===o.MIXED)return s;let l=s-u(r,e);switch(r){case o.NUMERIC:return Math.floor(l/10*3);case o.ALPHANUMERIC:return Math.floor(l/11*2);case o.KANJI:return Math.floor(l/13);case o.BYTE:default:return Math.floor(l/8)}},t.getBestVersionForData=function(e,r){let n;let i=s.from(r,s.M);if(Array.isArray(e)){if(e.length>1)return function(e,r){for(let n=1;n<=40;n++)if(function(e,t){let r=0;return e.forEach(function(e){let n=u(e.mode,t);r+=n+e.getBitsLength()}),r}(e,n)<=t.getCapacity(n,r,o.MIXED))return n}(e,i);if(0===e.length)return 1;n=e[0]}else n=e;return function(e,r,n){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}(n.mode,n.getLength(),i)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-l>=0;)t^=7973<':"",d="0&&u>0&&e[l-1]||(n+=o?s("M",u+r,.5+c+r):s("m",i,0),i=0,o=!1),u+1',h=''+c+d+"\n";return"function"==typeof r&&r(null,h),h}},59472:function(e,t){function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw Error("Invalid hex color: "+e);(3===t.length||4===t.length)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");let r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});let t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){let n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){let i=r.modules.size,s=r.modules.data,o=t.getScale(i,n),a=Math.floor((i+2*n.margin)*o),l=n.margin*o,u=[n.color.light,n.color.dark];for(let t=0;t=l&&r>=l&&tnull==e,l=Symbol("encodeFragmentIdentifier");function u(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function c(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function d(e,t){return t.decode?i(e):e}function h(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function f(e){let t=(e=h(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function p(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function g(e,t){u((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=function(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){n[e]=r;return}void 0===n[e]&&(n[e]={}),n[e][t[1]]=r};case"bracket":return(e,r,n)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"colon-list-separator":return(e,r,n)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"comma":case"separator":return(t,r,n)=>{let i="string"==typeof r&&r.includes(e.arrayFormatSeparator),s="string"==typeof r&&!i&&d(r,e).includes(e.arrayFormatSeparator);r=s?d(r,e):r;let o=i||s?r.split(e.arrayFormatSeparator).map(t=>d(t,e)):null===r?r:d(r,e);n[t]=o};case"bracket-separator":return(t,r,n)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i){n[t]=r?d(r,e):r;return}let s=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>d(t,e));if(void 0===n[t]){n[t]=s;return}n[t]=[].concat(n[t],s)};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}(t),n=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return n;for(let i of e.split("&")){if(""===i)continue;let[e,o]=s(t.decode?i.replace(/\+/g," "):i,"=");o=void 0===o?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?o:d(o,t),r(d(e,t),o,n)}for(let e of Object.keys(n)){let r=n[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=p(r[e],t);else n[e]=p(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{let r=n[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=function e(t){return Array.isArray(t)?t.sort():"object"==typeof t?e(Object.keys(t)).sort((e,t)=>Number(e)-Number(t)).map(e=>t[e]):t}(r):e[t]=r,e},Object.create(null))}t.extract=f,t.parse=g,t.stringify=(e,t)=>{if(!e)return"";u((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&a(e[r])||t.skipEmptyString&&""===e[r],n=function(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[",i,"]"].join("")]:[...r,[c(t,e),"[",c(i,e),"]=",c(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),"[]"].join("")]:[...r,[c(t,e),"[]=",c(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[c(t,e),":list="].join("")]:[...r,[c(t,e),":list=",c(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length)?[[c(r,e),t,c(i,e)].join("")]:[[n,c(i,e)].join(e.arrayFormatSeparator)]}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,c(t,e)]:[...r,[c(t,e),"=",c(n,e)].join("")]}}(t),i={};for(let t of Object.keys(e))r(t)||(i[t]=e[t]);let s=Object.keys(i);return!1!==t.sort&&s.sort(t.sort),s.map(r=>{let i=e[r];return void 0===i?"":null===i?c(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?c(r,t)+"[]":i.reduce(n(r),[]).join("&"):c(r,t)+"="+c(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>{t=Object.assign({decode:!0},t);let[r,n]=s(e,"#");return Object.assign({url:r.split("?")[0]||"",query:g(f(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:d(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[l]:!0},r);let n=h(e.url).split("?")[0]||"",i=t.extract(e.url),s=Object.assign(t.parse(i,{sort:!1}),e.query),o=t.stringify(s,r);o&&(o=`?${o}`);let a=function(e){let t="",r=e.indexOf("#");return -1!==r&&(t=e.slice(r)),t}(e.url);return e.fragmentIdentifier&&(a=`#${r[l]?c(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${n}${o}${a}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[l]:!1},n);let{url:i,query:s,fragmentIdentifier:a}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:o(s,r),fragmentIdentifier:a},n)},t.exclude=(e,r,n)=>{let i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},57963:function(e){"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}e.exports=function(e,r,n){var i=n&&n.stringify||t;if("object"==typeof e&&null!==e){var s=r.length+1;if(1===s)return e;var o=Array(s);o[0]=i(e);for(var a=1;a-1?d:0,e.charCodeAt(f+1)){case 100:case 102:if(c>=l||null==r[c])break;d=l||null==r[c])break;d=l||void 0===r[c])break;d",d=f+2,f++;break}u+=i(r[c]),d=f+2,f++;break;case 115:if(c>=l)break;d1&&void 0!==arguments[1]?arguments[1]:"none";return e||t},_=function(){return!!("undefined"!=typeof window&&(window.navigator||navigator))&&(window.navigator||navigator)},E=function(e){var t=_();return t&&t.platform&&(-1!==t.platform.indexOf(e)||"MacIntel"===t.platform&&t.maxTouchPoints>1&&!window.MSStream)},A=function(e){return e.type===b.Browser},x=function(e){return e.name===v.Edge},k=function(e){return"string"==typeof e&&-1!==e.indexOf("Edg/")},S=function(){return E("iPad")};p.type,b.SmartTv,p.type,b.Console,p.type,b.Wearable,p.type,b.Embedded,h.name===v.MobileSafari||S(),h.name,v.Chromium;var $=(n=p.type)===b.Mobile||n===b.Tablet||S(),C=(p.type,b.Mobile,p.type===b.Tablet||S(),A(p),A(p),"Android"===m.name),P=(m.name,"iOS"===m.name||S()),I=(h.name,v.Chrome,h.name===v.Firefox);(i=h.name)===v.Safari||v.MobileSafari,h.name,v.Opera,(s=h.name)===v.InternetExplorer||v.Ie,w(m.version),w(m.name),w(h.version),w(h.major),w(h.name),w(p.vendor),w(p.model),w(g.name),w(g.version),w(y),x(h)||k(y),h.name,v.Yandex,w(p.type,"browser"),(o=_())&&(/iPad|iPhone|iPod/.test(o.platform)||"MacIntel"===o.platform&&o.maxTouchPoints>1)&&window.MSStream,S(),E("iPhone"),E("iPod"),"string"==typeof(l=(a=_())&&a.userAgent&&a.userAgent.toLowerCase())&&/electron/.test(l),k(y),x(h)&&k(y),m.name,m.name,h.name,v.MIUI,h.name,v.SamsungBrowser,t.Dt=C,t.vU=I,t.gn=P,t.tq=$},74332:function(e,t){"use strict";/** @license React v16.13.1 * react-is.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,s=r?Symbol.for("react.fragment"):60107,o=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,d=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,g=r?Symbol.for("react.memo"):60115,m=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,b=r?Symbol.for("react.fundamental"):60117,v=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function _(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case d:case s:case a:case o:case f:return e;default:switch(e=e&&e.$$typeof){case u:case h:case m:case g:case l:return e;default:return t}}case i:return t}}}function E(e){return _(e)===d}t.AsyncMode=c,t.ConcurrentMode=d,t.ContextConsumer=u,t.ContextProvider=l,t.Element=n,t.ForwardRef=h,t.Fragment=s,t.Lazy=m,t.Memo=g,t.Portal=i,t.Profiler=a,t.StrictMode=o,t.Suspense=f,t.isAsyncMode=function(e){return E(e)||_(e)===c},t.isConcurrentMode=E,t.isContextConsumer=function(e){return _(e)===u},t.isContextProvider=function(e){return _(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return _(e)===h},t.isFragment=function(e){return _(e)===s},t.isLazy=function(e){return _(e)===m},t.isMemo=function(e){return _(e)===g},t.isPortal=function(e){return _(e)===i},t.isProfiler=function(e){return _(e)===a},t.isStrictMode=function(e){return _(e)===o},t.isSuspense=function(e){return _(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===s||e===d||e===a||e===o||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===g||e.$$typeof===l||e.$$typeof===u||e.$$typeof===h||e.$$typeof===b||e.$$typeof===v||e.$$typeof===w||e.$$typeof===y)},t.typeOf=_},12659:function(e,t,r){"use strict";e.exports=r(74332)},16058:function(e){"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){function t(t,n,i){return e.call(this,"string"==typeof r?r:r(t,n,i))||this}return t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e,t}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(!Array.isArray(e))return"of ".concat(t," ").concat(String(e));var r=e.length;return(e=e.map(function(e){return String(e)}),r>2)?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){if("string"==typeof t&&(i="not ",t.substr(0,i.length)===i)?(l="must not be",t=t.replace(/^not /,"")):l="must be",s=" argument",(void 0===o||o>e.length)&&(o=e.length),e.substring(o-s.length,o)===s)u="The ".concat(e," ").concat(l," ").concat(n(t,"type"));else{var i,s,o,a,l,u,c=("number"!=typeof a&&(a=0),a+1>e.length||-1===e.indexOf(".",a))?"argument":"property";u='The "'.concat(e,'" ').concat(c," ").concat(l," ").concat(n(t,"type"))}return u+". Received type ".concat(typeof r)},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},414:function(e,t,r){"use strict";var n=r(25566),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=c;var s=r(27813),o=r(67684);r(87398)(c,s);for(var a=i(o.prototype),l=0;l0){if("string"==typeof t||f.objectMode||Object.getPrototypeOf(t)===d.prototype||(u=t,t=d.from(u)),n)f.endEmitted?E(e,new _):$(e,f,t,!0);else if(f.ended)E(e,new v);else{if(f.destroyed)return!1;f.reading=!1,f.decoder&&!r?(t=f.decoder.write(t),f.objectMode||0!==t.length?$(e,f,t,!1):O(e,f)):$(e,f,t,!1)}}else n||(f.reading=!1,O(e,f))}return!f.ended&&(f.lengtht.highWaterMark){var r;t.highWaterMark=((r=e)>=1073741824?r=1073741824:(r--,r|=r>>>1,r|=r>>>2,r|=r>>>4,r|=r>>>8,r|=r>>>16,r++),r)}return e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0)}function P(e){var t=e._readableState;i("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(i("emitReadable",t.flowing),t.emittedReadable=!0,l.nextTick(I,e))}function I(e){var t=e._readableState;i("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,D(e)}function O(e,t){t.readingMore||(t.readingMore=!0,l.nextTick(N,e,t))}function N(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function R(e){i("readable nexttick read 0"),e.read(0)}function T(e,t){i("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),D(e),t.flowing&&!t.reading&&e.read(0)}function D(e){var t=e._readableState;for(i("flow",t.flowing);t.flowing&&null!==e.read(););}function L(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function j(e){var t=e._readableState;i("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,l.nextTick(B,t,e))}function B(e,t){if(i("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function F(e,t){for(var r=0,n=e.length;r=r.highWaterMark:r.length>0)||r.ended))return i("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?j(this):P(this),null;if(0===(e=C(e,r))&&r.ended)return 0===r.length&&j(this),null;var s=r.needReadable;return i("need readable",s),(0===r.length||r.length-e0?L(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&j(this)),null!==t&&this.emit("data",t),t},k.prototype._read=function(e){E(this,new w("_read()"))},k.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,i("pipe count=%d opts=%j",n.pipesCount,t);var s=t&&!1===t.end||e===l.stdout||e===l.stderr?g:o;function o(){i("onend"),e.end()}n.endEmitted?l.nextTick(s):r.once("end",s),e.on("unpipe",function t(s,l){i("onunpipe"),s===r&&l&&!1===l.hasUnpiped&&(l.hasUnpiped=!0,i("cleanup"),e.removeListener("close",f),e.removeListener("finish",p),e.removeListener("drain",a),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",o),r.removeListener("end",g),r.removeListener("data",d),c=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&a())});var a=function(){var e=r._readableState;i("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&u(r,"data")&&(e.flowing=!0,D(r))};e.on("drain",a);var c=!1;function d(t){i("ondata");var s=e.write(t);i("dest.write",s),!1===s&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==F(n.pipes,e))&&!c&&(i("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){i("onerror",t),g(),e.removeListener("error",h),0===u(e,"error")&&E(e,t)}function f(){e.removeListener("finish",p),g()}function p(){i("onfinish"),e.removeListener("close",f),g()}function g(){i("unpipe"),r.unpipe(e)}return r.on("data",d),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",f),e.once("finish",p),e.emit("pipe",r),n.flowing||(i("pipe resume"),r.resume()),e},k.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var s=0;s0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,i("on readable",n.length,n.reading),n.length?P(this):n.reading||l.nextTick(R,this)),r},k.prototype.addListener=k.prototype.on,k.prototype.removeListener=function(e,t){var r=c.prototype.removeListener.call(this,e,t);return"readable"===e&&l.nextTick(M,this),r},k.prototype.removeAllListeners=function(e){var t=c.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&l.nextTick(M,this),t},k.prototype.resume=function(){var e=this._readableState;return e.flowing||(i("resume"),e.flowing=!e.readableListening,e.resumeScheduled||(e.resumeScheduled=!0,l.nextTick(T,this,e))),e.paused=!1,this},k.prototype.pause=function(){return i("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(i("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},k.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var s in e.on("end",function(){if(i("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(s){i("wrapped data"),r.decoder&&(s=r.decoder.write(s)),(!r.objectMode||null!=s)&&(r.objectMode||s&&s.length)&&(t.push(s)||(n=!0,e.pause()))}),e)void 0===this[s]&&"function"==typeof e[s]&&(this[s]=function(t){return function(){return e[t].apply(e,arguments)}}(s));for(var o=0;o-1))throw new _(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(e,t,r){r(new g("_write()"))},k.prototype._writev=null,k.prototype.end=function(e,t,r){var n,i=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),i.corked&&(i.corked=1,this.uncork()),i.ending||(n=r,i.ending=!0,O(this,i),n&&(i.finished?s.nextTick(n):this.once("finish",n)),i.ended=!0,this.writable=!1),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),k.prototype.destroy=d.destroy,k.prototype._undestroy=d.undestroy,k.prototype._destroy=function(e,t){t(e)}},87136:function(e,t,r){"use strict";var n,i=r(25566);function s(e,t,r){var n;return(t="symbol"==typeof(n=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?n:String(n))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(91763),a=Symbol("lastResolve"),l=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),d=Symbol("lastPromise"),h=Symbol("handlePromise"),f=Symbol("stream");function p(e,t){return{value:e,done:t}}function g(e){var t=e[a];if(null!==t){var r=e[f].read();null!==r&&(e[d]=null,e[a]=null,e[l]=null,t(p(r,!1)))}}function m(e){i.nextTick(g,e)}var y=Object.getPrototypeOf(function(){}),b=Object.setPrototypeOf((s(n={get stream(){return this[f]},next:function(){var e,t,r=this,n=this[u];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(p(void 0,!0));if(this[f].destroyed)return new Promise(function(e,t){i.nextTick(function(){r[u]?t(r[u]):e(p(void 0,!0))})});var s=this[d];if(s)t=new Promise((e=this,function(t,r){s.then(function(){if(e[c]){t(p(void 0,!0));return}e[h](t,r)},r)}));else{var o=this[f].read();if(null!==o)return Promise.resolve(p(o,!1));t=new Promise(this[h])}return this[d]=t,t}},Symbol.asyncIterator,function(){return this}),s(n,"return",function(){var e=this;return new Promise(function(t,r){e[f].destroy(null,function(e){if(e){r(e);return}t(p(void 0,!0))})})}),n),y);e.exports=function(e){var t,r=Object.create(b,(s(t={},f,{value:e,writable:!0}),s(t,a,{value:null,writable:!0}),s(t,l,{value:null,writable:!0}),s(t,u,{value:null,writable:!0}),s(t,c,{value:e._readableState.endEmitted,writable:!0}),s(t,h,{value:function(e,t){var n=r[f].read();n?(r[d]=null,r[a]=null,r[l]=null,e(p(n,!1))):(r[a]=e,r[l]=t)},writable:!0}),t));return r[d]=null,o(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];null!==t&&(r[d]=null,r[a]=null,r[l]=null,t(e)),r[u]=e;return}var n=r[a];null!==n&&(r[d]=null,r[a]=null,r[l]=null,n(p(void 0,!0))),r[c]=!0}),e.on("readable",m.bind(null,r)),r}},36337:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return o.alloc(0);for(var t,r,n=o.allocUnsafe(e>>>0),i=this.head,s=0;i;)t=i.data,r=s,o.prototype.copy.call(t,n,r),s+=i.data.length,i=i.next;return n}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(s===i.length?n+=i:n+=i.slice(0,e),0==(e-=s)){s===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(s));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=o.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,s=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,s),0==(e-=s)){s===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(s));break}++n}return this.length-=n,t}},{key:l,value:function(e,t){return a(this,i(i({},t),{},{depth:0,customInspect:!1}))}}],function(e,t){for(var r=0;r0,u=a=function(e){t||(t=e),e&&f.forEach(l),m||(f.forEach(l),h(t))},d=!1,a=function(){d||(d=!0,u.apply(void 0,arguments))},p=!1,e.on("close",function(){p=!0}),void 0===n&&(n=r(91763)),n(e,{readable:m,writable:s},function(e){if(e)return a(e);p=!0,a()}),g=!1,function(t){if(!p&&!g){if(g=!0,e.setHeader&&"function"==typeof e.abort)return e.abort();if("function"==typeof e.destroy)return e.destroy();a(t||new o("pipe"))}}});return c.reduce(u)}},72164:function(e,t,r){"use strict";var n=r(16058).q.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var s=null!=t.highWaterMark?t.highWaterMark:i?t[r]:null;if(null!=s){if(!(isFinite(s)&&Math.floor(s)===s)||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}}},81725:function(e,t,r){e.exports=r(68885).EventEmitter},5939:function(e,t,r){(t=e.exports=r(27813)).Stream=t,t.Readable=t,t.Writable=r(67684),t.Duplex=r(414),t.Transform=r(64958),t.PassThrough=r(87802),t.finished=r(91763),t.pipeline=r(85597)},10632:function(e,t,r){/*! safe-buffer. MIT License. Feross Aboukhadijeh */var n=r(9109),i=n.Buffer;function s(e,t){for(var r in e)t[r]=e[r]}function o(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(s(n,t),t.Buffer=o),o.prototype=Object.create(i.prototype),s(i,o),o.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},o.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},o.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},o.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},40333:function(e,t,r){var n=r(10632).Buffer;function i(e,t){this._block=n.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}i.prototype.update=function(e,t){"string"==typeof e&&(t=t||"utf8",e=n.from(e,t));for(var r=this._block,i=this._blockSize,s=e.length,o=this._len,a=0;a=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=8*this._len;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(4294967295&r)>>>0;this._block.writeUInt32BE((r-n)/4294967296,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var i=this._hash();return e?i.toString(e):i},i.prototype._update=function(){throw Error("_update must be implemented by subclass")},e.exports=i},42724:function(e,t,r){var n=e.exports=function(e){var t=n[e=e.toLowerCase()];if(!t)throw Error(e+" is not supported (we accept pull requests)");return new t};n.sha=r(53799),n.sha1=r(4836),n.sha224=r(44455),n.sha256=r(51250),n.sha384=r(43836),n.sha512=r(58103)},53799:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=Array(80);function l(){this.init(),this._w=a,i.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=t[l-3]^t[l-8]^t[l-14]^t[l-16];for(var u=0;u<80;++u){var c,d,h,f,p,g=~~(u/20),m=((c=r)<<5|c>>>27)+(d=n,h=i,f=s,0===g?d&h|~d&f:2===g?d&h|d&f|h&f:d^h^f)+a+t[u]+o[g]|0;a=s,s=i,i=(p=n)<<30|p>>>2,n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},l.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=l},4836:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[1518500249,1859775393,-1894007588,-899497514],a=Array(80);function l(){this.init(),this._w=a,i.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,a=0|this._e,l=0;l<16;++l)t[l]=e.readInt32BE(4*l);for(;l<80;++l)t[l]=(c=t[l-3]^t[l-8]^t[l-14]^t[l-16])<<1|c>>>31;for(var u=0;u<80;++u){var c,d,h,f,p,g,m=~~(u/20),y=((d=r)<<5|d>>>27)+(h=n,f=i,p=s,0===m?h&f|~h&p:2===m?h&f|h&p|f&p:h^f^p)+a+t[u]+o[m]|0;a=s,s=i,i=(g=n)<<30|g>>>2,n=r,r=y}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0},l.prototype._hash=function(){var e=s.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=l},44455:function(e,t,r){var n=r(87398),i=r(51250),s=r(40333),o=r(10632).Buffer,a=Array(64);function l(){this.init(),this._w=a,s.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this},l.prototype._hash=function(){var e=o.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e},e.exports=l},51250:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=Array(64);function l(){this.init(),this._w=a,i.call(this,64,56)}n(l,i),l.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._a,n=0|this._b,i=0|this._c,s=0|this._d,a=0|this._e,l=0|this._f,u=0|this._g,c=0|this._h,d=0;d<16;++d)t[d]=e.readInt32BE(4*d);for(;d<64;++d)t[d]=(((f=t[d-2])>>>17|f<<15)^(f>>>19|f<<13)^f>>>10)+t[d-7]+(((p=t[d-15])>>>7|p<<25)^(p>>>18|p<<14)^p>>>3)+t[d-16]|0;for(var h=0;h<64;++h){var f,p,g,m,y,b,v,w,_,E=c+(((g=a)>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7))+(m=a,y=l,(b=u)^m&(y^b))+o[h]+t[h]|0,A=(((v=r)>>>2|v<<30)^(v>>>13|v<<19)^(v>>>22|v<<10))+((w=r)&(_=n)|i&(w|_))|0;c=u,u=l,l=a,a=s+E|0,s=i,i=n,n=r,r=E+A|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=i+this._c|0,this._d=s+this._d|0,this._e=a+this._e|0,this._f=l+this._f|0,this._g=u+this._g|0,this._h=c+this._h|0},l.prototype._hash=function(){var e=s.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e},e.exports=l},43836:function(e,t,r){var n=r(87398),i=r(58103),s=r(40333),o=r(10632).Buffer,a=Array(160);function l(){this.init(),this._w=a,s.call(this,128,112)}n(l,i),l.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this},l.prototype._hash=function(){var e=o.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e},e.exports=l},58103:function(e,t,r){var n=r(87398),i=r(40333),s=r(10632).Buffer,o=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],a=Array(160);function l(){this.init(),this._w=a,i.call(this,128,112)}function u(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function c(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function d(e,t){return e>>>0>>0?1:0}n(l,i),l.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this},l.prototype._update=function(e){for(var t=this._w,r=0|this._ah,n=0|this._bh,i=0|this._ch,s=0|this._dh,a=0|this._eh,l=0|this._fh,h=0|this._gh,f=0|this._hh,p=0|this._al,g=0|this._bl,m=0|this._cl,y=0|this._dl,b=0|this._el,v=0|this._fl,w=0|this._gl,_=0|this._hl,E=0;E<32;E+=2)t[E]=e.readInt32BE(4*E),t[E+1]=e.readInt32BE(4*E+4);for(;E<160;E+=2){var A,x,k,S,$,C,P,I,O=t[E-30],N=t[E-30+1],M=((A=O)>>>1|(x=N)<<31)^(A>>>8|x<<24)^A>>>7,R=((k=N)>>>1|(S=O)<<31)^(k>>>8|S<<24)^(k>>>7|S<<25);O=t[E-4],N=t[E-4+1];var T=(($=O)>>>19|(C=N)<<13)^(C>>>29|$<<3)^$>>>6,D=((P=N)>>>19|(I=O)<<13)^(I>>>29|P<<3)^(P>>>6|I<<26),L=t[E-14],j=t[E-14+1],B=t[E-32],F=t[E-32+1],U=R+j|0,z=M+L+d(U,R)|0;z=(z=z+T+d(U=U+D|0,D)|0)+B+d(U=U+F|0,F)|0,t[E]=z,t[E+1]=U}for(var q=0;q<160;q+=2){z=t[q],U=t[q+1];var H,G,V,W,K,Y,Z,J,Q,X,ee=(H=r)&(G=n)|i&(H|G),et=(V=p)&(W=g)|m&(V|W),er=u(r,p),en=u(p,r),ei=c(a,b),es=c(b,a),eo=o[q],ea=o[q+1],el=(K=a,Y=l,(Z=h)^K&(Y^Z)),eu=(J=b,Q=v,(X=w)^J&(Q^X)),ec=_+es|0,ed=f+ei+d(ec,_)|0;ed=(ed=(ed=ed+el+d(ec=ec+eu|0,eu)|0)+eo+d(ec=ec+ea|0,ea)|0)+z+d(ec=ec+U|0,U)|0;var eh=en+et|0,ef=er+ee+d(eh,en)|0;f=h,_=w,h=l,w=v,l=a,v=b,a=s+ed+d(b=y+ec|0,y)|0,s=i,y=m,i=n,m=g,n=r,g=p,r=ed+ef+d(p=ec+eh|0,ec)|0}this._al=this._al+p|0,this._bl=this._bl+g|0,this._cl=this._cl+m|0,this._dl=this._dl+y|0,this._el=this._el+b|0,this._fl=this._fl+v|0,this._gl=this._gl+w|0,this._hl=this._hl+_|0,this._ah=this._ah+r+d(this._al,p)|0,this._bh=this._bh+n+d(this._bl,g)|0,this._ch=this._ch+i+d(this._cl,m)|0,this._dh=this._dh+s+d(this._dl,y)|0,this._eh=this._eh+a+d(this._el,b)|0,this._fh=this._fh+l+d(this._fl,v)|0,this._gh=this._gh+h+d(this._gl,w)|0,this._hh=this._hh+f+d(this._hl,_)|0},l.prototype._hash=function(){var e=s.allocUnsafe(64);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e},e.exports=l},6889:function(e){e.exports=function(e,t,r,n){var i=r?r.call(n,e,t):void 0;if(void 0!==i)return!!i;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;var s=Object.keys(e),o=Object.keys(t);if(s.length!==o.length)return!1;for(var a=Object.prototype.hasOwnProperty.bind(t),l=0;l{if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return -1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},29276:function(e){"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},56123:function(e,t,r){"use strict";var n=r(10632).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function s(e){var t;switch(this.encoding=function(e){var t=function(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=l,this.end=u,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=c,this.end=d,t=3;break;default:this.write=h,this.end=f;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function o(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e,0);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function l(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function u(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function c(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function f(e){return e&&e.length?this.write(e):""}t.s=s,s.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},s.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},10506:function(e,t,r){"use strict";r.d(t,{vJ:function(){return eM},iv:function(){return e_},ZP:function(){return eT},F4:function(){return eR}});var n,i,s,o=r(12659),a=r(2265),l=r(6889),u=r.n(l),c=function(e){function t(e,t,n){var i=t.trim().split(p);t=i;var s=i.length,o=e.length;switch(o){case 0:case 1:var a=0;for(e=0===o?"":e[0]+" ";an&&(n=(t=t.trim()).charCodeAt(0)),n){case 38:return t.replace(g,"$1"+e.trim());case 58:return e.trim()+t.replace(g,"$1"+e.trim());default:if(0<1*r&&0l.charCodeAt(8))break;case 115:o=o.replace(l,"-webkit-"+l)+";"+o;break;case 207:case 102:o=o.replace(l,"-webkit-"+(102a.charCodeAt(0)&&(a=a.trim()),a=[a],0f)&&(B=(z=z.replace(" ",":")).length),0e.charCodeAt(2)},i=Object.create(null),function(e){return void 0===i[e]&&(i[e]=n(e)),i[e]}),p=r(46451),g=r.n(p),m=r(25566);function y(){return(y=Object.assign||function(e){for(var t=1;t1?t-1:0),n=1;n0?" Args: "+r.join(", "):""))}var I=function(){function e(e){this.groupSizes=new Uint32Array(512),this.length=512,this.tag=e}var t=e.prototype;return t.indexOfGroup=function(e){for(var t=0,r=0;r=this.groupSizes.length){for(var r=this.groupSizes,n=r.length,i=n;e>=i;)(i<<=1)<0&&P(16,""+e);this.groupSizes=new Uint32Array(i),this.groupSizes.set(r),this.length=i;for(var s=n;s=this.length||0===this.groupSizes[e])return t;for(var r=this.groupSizes[e],n=this.indexOfGroup(e),i=n+r,s=n;s=M&&(M=t+1),O.set(e,t),N.set(t,e)},D="style["+k+'][data-styled-version="5.3.11"]',L=RegExp("^"+k+'\\.g(\\d+)\\[id="([\\w\\d-]+)"\\].*?"([^"]*)'),j=function(e,t,r){for(var n,i=r.split(","),s=0,o=i.length;s=0;r--){var n=t[r];if(n&&1===n.nodeType&&n.hasAttribute(k))return n}}(r),s=void 0!==i?i.nextSibling:null;n.setAttribute(k,"active"),n.setAttribute("data-styled-version","5.3.11");var o=F();return o&&n.setAttribute("nonce",o),r.insertBefore(n,s),n},z=function(){function e(e){var t=this.element=U(e);t.appendChild(document.createTextNode("")),this.sheet=function(e){if(e.sheet)return e.sheet;for(var t=document.styleSheets,r=0,n=t.length;r=0){var r=document.createTextNode(t),n=this.nodes[e];return this.element.insertBefore(r,n||null),this.length++,!0}return!1},t.deleteRule=function(e){this.element.removeChild(this.nodes[e]),this.length--},t.getRule=function(e){return e0&&(c+=e+",")}),n+=""+l+u+'{content:"'+c+'"}/*!sc*/\n'}}}return n}(this)},e}(),K=/(a)(d)/gi,Y=function(e){return String.fromCharCode(e+(e>25?39:97))};function Z(e){var t,r="";for(t=Math.abs(e);t>52;t=t/52|0)r=Y(t%52)+r;return(Y(t%52)+r).replace(K,"$1-$2")}var J=function(e,t){for(var r=t.length;r;)e=33*e^t.charCodeAt(--r);return e},Q=function(e){return J(5381,e)};function X(e){for(var t=0;t>>0);if(!t.hasNameForId(n,o)){var a=r(s,"."+o,void 0,n);t.insertRules(n,o,a)}i.push(o),this.staticRulesId=o}}else{for(var l=this.rules.length,u=J(this.baseHash,r.hash),c="",d=0;d>>0);if(!t.hasNameForId(n,g)){var m=r(c,"."+g,void 0,n);t.insertRules(n,g,m)}i.push(g)}}return i.join(" ")},e}(),er=/^\s*\/\/.*$/gm,en=[":","[",".","#"];function ei(e){var t,r,n,i,s=void 0===e?_:e,o=s.options,a=void 0===o?_:o,l=s.plugins,u=void 0===l?w:l,d=new c(a),h=[],f=function(e){function t(t){if(t)try{e(t+"}")}catch(e){}}return function(r,n,i,s,o,a,l,u,c,d){switch(r){case 1:if(0===c&&64===n.charCodeAt(0))return e(n+";"),"";break;case 2:if(0===u)return n+"/*|*/";break;case 3:switch(u){case 102:case 112:return e(i[0]+n),"";default:return n+(0===d?"/*|*/":"")}case -2:n.split("/*|*/}").forEach(t)}}}(function(e){h.push(e)}),p=function(e,n,s){return 0===n&&-1!==en.indexOf(s[r.length])||s.match(i)?e:"."+t};function g(e,s,o,a){void 0===a&&(a="&");var l=e.replace(er,""),u=s&&o?o+" "+s+" { "+l+" }":l;return t=a,n=RegExp("\\"+(r=s)+"\\b","g"),i=RegExp("(\\"+r+"\\b){2,}"),d(o||!s?"":s,u)}return d.use([].concat(u,[function(e,t,i){2===e&&i.length&&i[0].lastIndexOf(r)>0&&(i[0]=i[0].replace(n,p))},f,function(e){if(-2===e){var t=h;return h=[],t}}])),g.hash=u.length?u.reduce(function(e,t){return t.name||P(15),J(e,t.name)},5381).toString():"",g}var es=a.createContext(),eo=(es.Consumer,a.createContext()),ea=(eo.Consumer,new W),el=ei();function eu(){return(0,a.useContext)(es)||ea}function ec(){return(0,a.useContext)(eo)||el}function ed(e){var t=(0,a.useState)(e.stylisPlugins),r=t[0],n=t[1],i=eu(),s=(0,a.useMemo)(function(){var t=i;return e.sheet?t=e.sheet:e.target&&(t=t.reconstructWithOptions({target:e.target},!1)),e.disableCSSOMInjection&&(t=t.reconstructWithOptions({useCSSOMInjection:!1})),t},[e.disableCSSOMInjection,e.sheet,e.target]),o=(0,a.useMemo)(function(){return ei({options:{prefix:!e.disableVendorPrefixes},plugins:r})},[e.disableVendorPrefixes,r]);return(0,a.useEffect)(function(){u()(r,e.stylisPlugins)||n(e.stylisPlugins)},[e.stylisPlugins]),a.createElement(es.Provider,{value:s},a.createElement(eo.Provider,{value:o},e.children))}var eh=function(){function e(e,t){var r=this;this.inject=function(e,t){void 0===t&&(t=el);var n=r.name+t.hash;e.hasNameForId(r.id,n)||e.insertRules(r.id,n,t(r.rules,n,"@keyframes"))},this.toString=function(){return P(12,String(r.name))},this.name=e,this.id="sc-keyframes-"+e,this.rules=t}return e.prototype.getName=function(e){return void 0===e&&(e=el),this.name+e.hash},e}(),ef=/([A-Z])/,ep=/([A-Z])/g,eg=/^ms-/,em=function(e){return"-"+e.toLowerCase()};function ey(e){return ef.test(e)?e.replace(ep,em).replace(eg,"-ms-"):e}var eb=function(e){return null==e||!1===e||""===e};function ev(e,t,r,n){if(Array.isArray(e)){for(var i,s=[],o=0,a=e.length;o1?t-1:0),n=1;n?@[\\\]^`{|}~-]+/g,ex=/(^-|-$)/g;function ek(e){return e.replace(eA,"-").replace(ex,"")}var eS=function(e){return Z(Q(e)>>>0)};function e$(e){return"string"==typeof e}var eC=function(e){return"function"==typeof e||"object"==typeof e&&null!==e&&!Array.isArray(e)},eP=a.createContext();eP.Consumer;var eI={},eO=function(e){return function e(t,r,n){if(void 0===n&&(n=_),!(0,o.isValidElementType)(r))return P(1,String(r));var i=function(){return t(r,n,e_.apply(void 0,arguments))};return i.withConfig=function(i){return e(t,r,y({},n,{},i))},i.attrs=function(i){return e(t,r,y({},n,{attrs:Array.prototype.concat(n.attrs,i).filter(Boolean)}))},i}(function e(t,r,n){var i=x(t),s=!e$(t),o=r.attrs,l=void 0===o?w:o,u=r.componentId,c=void 0===u?(v=r.displayName,k=r.parentComponentId,eI[S="string"!=typeof v?"sc":ek(v)]=(eI[S]||0)+1,$=S+"-"+eS("5.3.11"+S+eI[S]),k?k+"-"+$:$):u,d=r.displayName,h=void 0===d?e$(t)?"styled."+t:"Styled("+A(t)+")":d,p=r.displayName&&r.componentId?ek(r.displayName)+"-"+r.componentId:r.componentId||c,m=i&&t.attrs?Array.prototype.concat(t.attrs,l).filter(Boolean):l,b=r.shouldForwardProp;i&&t.shouldForwardProp&&(b=r.shouldForwardProp?function(e,n,i){return t.shouldForwardProp(e,n,i)&&r.shouldForwardProp(e,n,i)}:t.shouldForwardProp);var v,k,S,$,C,P=new et(n,p,i?t.componentStyle:void 0),I=P.isStatic&&0===l.length,O=function(e,t){return function(e,t,r,n){var i,s,o,l,u,c=e.attrs,d=e.componentStyle,h=e.defaultProps,p=e.foldedComponentIds,g=e.shouldForwardProp,m=e.styledComponentId,b=e.target,v=(void 0===(i=eE(t,(0,a.useContext)(eP),h)||_)&&(i=_),s=y({},t,{theme:i}),o={},c.forEach(function(e){var t,r,n,i=e;for(t in E(i)&&(i=i(s)),i)s[t]=o[t]="className"===t?(r=o[t],n=i[t],r&&n?r+" "+n:r||n):i[t]}),[s,o]),w=v[0],A=v[1],x=(l=eu(),u=ec(),n?d.generateAndInjectStyles(_,l,u):d.generateAndInjectStyles(w,l,u)),k=A.$as||t.$as||A.as||t.as||b,S=e$(k),$=A!==t?y({},t,{},A):t,C={};for(var P in $)"$"!==P[0]&&"as"!==P&&("forwardedAs"===P?C.as=$[P]:(g?g(P,f,k):!S||f(P))&&(C[P]=$[P]));return t.style&&A.style!==t.style&&(C.style=y({},t.style,{},A.style)),C.className=Array.prototype.concat(p,m,x!==m?x:null,t.className,A.className).filter(Boolean).join(" "),C.ref=r,(0,a.createElement)(k,C)}(C,e,t,I)};return O.displayName=h,(C=a.forwardRef(O)).attrs=m,C.componentStyle=P,C.displayName=h,C.shouldForwardProp=b,C.foldedComponentIds=i?Array.prototype.concat(t.foldedComponentIds,t.styledComponentId):w,C.styledComponentId=p,C.target=i?t.target:t,C.withComponent=function(t){var i=r.componentId,s=function(e,t){if(null==e)return{};var r,n,i={},s=Object.keys(e);for(n=0;n=0||(i[r]=e[r]);return i}(r,["componentId"]),o=i&&i+"-"+(e$(t)?t:ek(A(t)));return e(t,y({},s,{attrs:m,componentId:o}),n)},Object.defineProperty(C,"defaultProps",{get:function(){return this._foldedDefaultProps},set:function(e){this._foldedDefaultProps=i?function e(t){for(var r=arguments.length,n=Array(r>1?r-1:0),i=1;i2&&W.registerId(this.componentId+e),this.removeStyles(e,r),this.createStyles(e,t,r,n)},e}();function eM(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n1?t-1:0),n=1;n"+t+""},this.getStyleTags=function(){return e.sealed?P(2):e._emitSheetCSS()},this.getStyleElement=function(){if(e.sealed)return P(2);var t,r=((t={})[k]="",t["data-styled-version"]="5.3.11",t.dangerouslySetInnerHTML={__html:e.instance.toString()},t),n=F();return n&&(r.nonce=n),[a.createElement("style",y({},r,{key:"sc-0-0"}))]},this.seal=function(){e.sealed=!0},this.instance=new W({isServer:!0}),this.sealed=!1}).prototype).collectStyles=function(e){return this.sealed?P(2):a.createElement(ed,{sheet:this.instance},e)},s.interleaveWithNodeStream=function(e){return P(3)};var eT=eO},17914:function(e,t,r){var n;!function(i,s){"use strict";var o="function",a="undefined",l="object",u="string",c="major",d="model",h="name",f="type",p="vendor",g="version",m="architecture",y="console",b="mobile",v="tablet",w="smarttv",_="wearable",E="embedded",A="Amazon",x="Apple",k="ASUS",S="BlackBerry",$="Browser",C="Chrome",P="Firefox",I="Google",O="Huawei",N="Microsoft",M="Motorola",R="Opera",T="Samsung",D="Sharp",L="Sony",j="Xiaomi",B="Zebra",F="Facebook",U="Chromium OS",z="Mac OS",q=function(e,t){var r={};for(var n in e)t[n]&&t[n].length%2==0?r[n]=t[n].concat(e[n]):r[n]=e[n];return r},H=function(e){for(var t={},r=0;r0?2===a.length?typeof a[1]==o?this[a[0]]=a[1].call(this,c):this[a[0]]=a[1]:3===a.length?typeof a[1]!==o||a[1].exec&&a[1].test?this[a[0]]=c?c.replace(a[1],a[2]):void 0:this[a[0]]=c?a[1].call(this,c,a[2]):void 0:4===a.length&&(this[a[0]]=c?a[3].call(this,c.replace(a[1],a[2])):void 0):this[a]=c||s;d+=2}},Y=function(e,t){for(var r in t)if(typeof t[r]===l&&t[r].length>0){for(var n=0;n2&&(e[d]="iPad",e[f]=v),e},this.getEngine=function(){var e={};return e[h]=s,e[g]=s,K.call(e,n,w.engine),e},this.getOS=function(){var e={};return e[h]=s,e[g]=s,K.call(e,n,w.os),_&&!e[h]&&y&&y.platform&&"Unknown"!=y.platform&&(e[h]=y.platform.replace(/chrome os/i,U).replace(/macos/i,z)),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===u&&e.length>500?W(e,500):e,this},this.setUA(n),this};Q.VERSION="1.0.38",Q.BROWSER=H([h,g,c]),Q.CPU=H([m]),Q.DEVICE=H([d,p,f,y,b,w,v,_,E]),Q.ENGINE=Q.OS=H([h,g]),typeof t!==a?(e.exports&&(t=e.exports=Q),t.UAParser=Q):r.amdO?s!==(n=(function(){return Q}).call(t,r,t,e))&&(e.exports=n):typeof i!==a&&(i.UAParser=Q);var X=typeof i!==a&&(i.jQuery||i.Zepto);if(X&&!X.ua){var ee=new Q;X.ua=ee.getResult(),X.ua.get=function(){return ee.getUA()},X.ua.set=function(e){ee.setUA(e);var t=ee.getResult();for(var r in t)X.ua[r]=t[r]}}}("object"==typeof window?window:this)},33404:function(e,t,r){"use strict";/** * @license React * use-sync-external-store-with-selector.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var n=r(2265),i="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},s=n.useSyncExternalStore,o=n.useRef,a=n.useEffect,l=n.useMemo,u=n.useDebugValue;t.useSyncExternalStoreWithSelector=function(e,t,r,n,c){var d=o(null);if(null===d.current){var h={hasValue:!1,value:null};d.current=h}else h=d.current;var f=s(e,(d=l(function(){function e(e){if(!a){if(a=!0,s=e,e=n(e),void 0!==c&&h.hasValue){var t=h.value;if(c(t,e))return o=t}return o=e}if(t=o,i(s,e))return t;var r=n(e);return void 0!==c&&c(t,r)?t:(s=e,o=r)}var s,o,a=!1,l=void 0===r?null:r;return[function(){return e(t())},null===l?void 0:function(){return e(l())}]},[t,r,n,c]))[0],d[1]);return a(function(){h.hasValue=!0,h.value=f},[f]),u(f),f}},67183:function(e,t,r){"use strict";e.exports=r(33404)},20310:function(e,t,r){e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}};function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}},20920:function(e,t,r){"use strict";let n;r.d(t,{Z:function(){return a}});var i={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let s=new Uint8Array(16),o=[];for(let e=0;e<256;++e)o.push((e+256).toString(16).slice(1));var a=function(e,t,r){if(i.randomUUID&&!t&&!e)return i.randomUUID();let a=(e=e||{}).random||(e.rng||function(){if(!n&&!(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(s)})();if(a[6]=15&a[6]|64,a[8]=63&a[8]|128,t){r=r||0;for(let e=0;e<16;++e)t[r+e]=a[e];return t}return function(e,t=0){return o[e[t+0]]+o[e[t+1]]+o[e[t+2]]+o[e[t+3]]+"-"+o[e[t+4]]+o[e[t+5]]+"-"+o[e[t+6]]+o[e[t+7]]+"-"+o[e[t+8]]+o[e[t+9]]+"-"+o[e[t+10]]+o[e[t+11]]+o[e[t+12]]+o[e[t+13]]+o[e[t+14]]+o[e[t+15]]}(a)}},25566:function(e){var t,r,n,i=e.exports={};function s(){throw Error("setTimeout has not been defined")}function o(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===s||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:s}catch(e){t=s}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var l=[],u=!1,c=-1;function d(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&h())}function h(){if(!u){var e=a(d);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c1)for(var r=1;r-1&&(m=!1),"function"==typeof c&&(c.error=c.fatal=c.warn=c.info=c.debug=c.trace=c),!1===e.enabled&&(e.level="silent");let y=e.level||"info",b=Object.create(c);b.log||(b.log=h),Object.defineProperty(b,"levelVal",{get:function(){return"silent"===this.level?1/0:this.levels.values[this.level]}}),Object.defineProperty(b,"level",{get:function(){return this._level},set:function(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,o(v,b,"error","log"),o(v,b,"fatal","error"),o(v,b,"warn","error"),o(v,b,"info","log"),o(v,b,"debug","log"),o(v,b,"trace","log")}});let v={transmit:n,serialize:g,asObject:e.browser.asObject,levels:["error","fatal","warn","info","debug","trace"],timestamp:"function"==typeof(r=e).timestamp?r.timestamp:!1===r.timestamp?f:p};return b.levels=s.levels,b.level=y,b.setMaxListeners=b.getMaxListeners=b.emit=b.addListener=b.on=b.prependListener=b.once=b.prependOnceListener=b.removeListener=b.removeAllListeners=b.listeners=b.listenerCount=b.eventNames=b.write=b.flush=h,b.serializers=d,b._serialize=g,b._stdErrSerialize=m,b.child=function(t,r){if(!t)throw Error("missing bindings for child Pino");r=r||{},g&&t.serializers&&(r.serializers=t.serializers);let i=r.serializers;if(g&&i){var s=Object.assign({},d,i),o=!0===e.browser.serialize?Object.keys(s):g;delete t.serializers,a([t],o,s,this._stdErrSerialize)}function c(e){this._childLevel=(0|e._childLevel)+1,this.error=l(e,t,"error"),this.fatal=l(e,t,"fatal"),this.warn=l(e,t,"warn"),this.info=l(e,t,"info"),this.debug=l(e,t,"debug"),this.trace=l(e,t,"trace"),s&&(this.serializers=s,this._serialize=o),n&&(this._logEvent=u([].concat(e._logEvent.bindings,t)))}return c.prototype=this,new c(this)},n&&(b._logEvent=u()),b}function o(e,t,r,o){let l=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?h:l[r]?l[r]:i[r]||i[o]||h,function(e,t,r){if(e.transmit||t[r]!==h){var o;t[r]=(o=t[r],function(){let l=e.timestamp(),c=Array(arguments.length),d=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var h=0;h-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function l(e,t,r){return function(){let n=Array(1+arguments.length);n[0]=t;for(var i=1;i{function r(e){i.current(e)}return(e=null!=e?e:window).addEventListener(t,r,n),()=>e.removeEventListener(t,r,n)},[e,t,n])}var S=r(26400),$=r(28043);function C(e){let t=(0,A.z)(e),r=(0,w.useRef)(!1);(0,w.useEffect)(()=>(r.current=!1,()=>{r.current=!0,(0,$.Y)(()=>{r.current&&t()})}),[t])}var P=r(54462);function I(e){return P.O.isServer?null:e instanceof Node?e.ownerDocument:null!=e&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}function O(){for(var e=arguments.length,t=Array(e),r=0;rI(...t),[...t])}var N=r(33856),M=r(41469);function R(e,t,r){let n=(0,x.E)(t);(0,w.useEffect)(()=>{function t(e){n.current(e)}return window.addEventListener(e,t,r),()=>window.removeEventListener(e,t,r)},[e,r])}var T=((n=T||{})[n.Forwards=0]="Forwards",n[n.Backwards=1]="Backwards",n);function D(e,t){let r=(0,w.useRef)([]),n=(0,A.z)(e);(0,w.useEffect)(()=>{let e=[...r.current];for(let[i,s]of t.entries())if(r.current[i]!==s){let i=n(t,e);return r.current=t,i}},[n,...t])}var L=r(3600),j=((i=j||{})[i.None=1]="None",i[i.Focusable=2]="Focusable",i[i.Hidden=4]="Hidden",i);let B=(0,L.yV)(function(e,t){var r;let{features:n=1,...i}=e,s={ref:t,"aria-hidden":(2&n)==2||(null!=(r=i["aria-hidden"])?r:void 0),hidden:(4&n)==4||void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(4&n)==4&&(2&n)!=2&&{display:"none"}}};return(0,L.sY)({ourProps:s,theirProps:i,slot:{},defaultTag:"div",name:"Hidden"})}),F=[];!function(e){function t(){"loading"!==document.readyState&&(e(),document.removeEventListener("DOMContentLoaded",t))}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("DOMContentLoaded",t),t())}(()=>{function e(e){e.target instanceof HTMLElement&&e.target!==document.body&&F[0]!==e.target&&(F.unshift(e.target),(F=F.filter(e=>null!=e&&e.isConnected)).splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});var U=r(5583);let z=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>"".concat(e,":not([tabindex='-1'])")).join(",");var q=((s=q||{})[s.First=1]="First",s[s.Previous=2]="Previous",s[s.Next=4]="Next",s[s.Last=8]="Last",s[s.WrapAround=16]="WrapAround",s[s.NoScroll=32]="NoScroll",s),H=((o=H||{})[o.Error=0]="Error",o[o.Overflow=1]="Overflow",o[o.Success=2]="Success",o[o.Underflow=3]="Underflow",o),G=((a=G||{})[a.Previous=-1]="Previous",a[a.Next=1]="Next",a),V=((l=V||{})[l.Strict=0]="Strict",l[l.Loose=1]="Loose",l),W=((u=W||{})[u.Keyboard=0]="Keyboard",u[u.Mouse=1]="Mouse",u);function K(e){null==e||e.focus({preventScroll:!0})}function Y(e,t){var r,n,i;let{sorted:s=!0,relativeTo:o=null,skipElements:a=[]}=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},l=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,u=Array.isArray(e)?s?function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e=>e;return e.slice().sort((e,r)=>{let n=t(e),i=t(r);if(null===n||null===i)return 0;let s=n.compareDocumentPosition(i);return s&Node.DOCUMENT_POSITION_FOLLOWING?-1:s&Node.DOCUMENT_POSITION_PRECEDING?1:0})}(e):e:function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:document.body;return null==e?[]:Array.from(e.querySelectorAll(z)).sort((e,t)=>Math.sign((e.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}(e);a.length>0&&u.length>1&&(u=u.filter(e=>!a.includes(e))),o=null!=o?o:l.activeElement;let c=(()=>{if(5&t)return 1;if(10&t)return -1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),d=(()=>{if(1&t)return 0;if(2&t)return Math.max(0,u.indexOf(o))-1;if(4&t)return Math.max(0,u.indexOf(o))+1;if(8&t)return u.length-1;throw Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),h=32&t?{preventScroll:!0}:{},f=0,p=u.length,g;do{if(f>=p||f+p<=0)return 0;let e=d+f;if(16&t)e=(e+p)%p;else{if(e<0)return 3;if(e>=p)return 1}null==(g=u[e])||g.focus(h),f+=c}while(g!==l.activeElement);return 6&t&&null!=(i=null==(n=null==(r=g)?void 0:r.matches)?void 0:n.call(r,"textarea,input"))&&i&&g.select(),2}function Z(e){if(!e)return new Set;if("function"==typeof e)return new Set(e());let t=new Set;for(let r of e.current)r.current instanceof HTMLElement&&t.add(r.current);return t}"undefined"!=typeof window&&"undefined"!=typeof document&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{1===e.detail?delete document.documentElement.dataset.headlessuiFocusVisible:0===e.detail&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));var J=((c=J||{})[c.None=1]="None",c[c.InitialFocus=2]="InitialFocus",c[c.TabLock=4]="TabLock",c[c.FocusLock=8]="FocusLock",c[c.RestoreFocus=16]="RestoreFocus",c[c.All=30]="All",c);let Q=Object.assign((0,L.yV)(function(e,t){let r,n=(0,w.useRef)(null),i=(0,M.T)(n,t),{initialFocus:s,containers:o,features:a=30,...l}=e;(0,N.H)()||(a=1);let u=O(n);!function(e,t){let{ownerDocument:r}=e,n=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=(0,w.useRef)(F.slice());return D((e,r)=>{let[n]=e,[i]=r;!0===i&&!1===n&&(0,$.Y)(()=>{t.current.splice(0)}),!1===i&&!0===n&&(t.current=F.slice())},[e,F,t]),(0,A.z)(()=>{var e;return null!=(e=t.current.find(e=>null!=e&&e.isConnected))?e:null})}(t);D(()=>{t||(null==r?void 0:r.activeElement)===(null==r?void 0:r.body)&&K(n())},[t]),C(()=>{t&&K(n())})}({ownerDocument:u},!!(16&a));let c=function(e,t){let{ownerDocument:r,container:n,initialFocus:i}=e,s=(0,w.useRef)(null),o=(0,S.t)();return D(()=>{if(!t)return;let e=n.current;e&&(0,$.Y)(()=>{if(!o.current)return;let t=null==r?void 0:r.activeElement;if(null!=i&&i.current){if((null==i?void 0:i.current)===t){s.current=t;return}}else if(e.contains(t)){s.current=t;return}null!=i&&i.current?K(i.current):Y(e,q.First)===H.Error&&console.warn("There are no focusable elements inside the "),s.current=null==r?void 0:r.activeElement})},[t]),s}({ownerDocument:u,container:n,initialFocus:s},!!(2&a));!function(e,t){let{ownerDocument:r,container:n,containers:i,previousActiveElement:s}=e,o=(0,S.t)();k(null==r?void 0:r.defaultView,"focus",e=>{if(!t||!o.current)return;let r=Z(i);n.current instanceof HTMLElement&&r.add(n.current);let a=s.current;if(!a)return;let l=e.target;l&&l instanceof HTMLElement?X(r,l)?(s.current=l,K(l)):(e.preventDefault(),e.stopPropagation(),K(a)):K(s.current)},!0)}({ownerDocument:u,container:n,containers:o,previousActiveElement:c},!!(8&a));let d=(r=(0,w.useRef)(0),R("keydown",e=>{"Tab"===e.key&&(r.current=e.shiftKey?1:0)},!0),r),h=(0,A.z)(e=>{let t=n.current;t&&(0,U.E)(d.current,{[T.Forwards]:()=>{Y(t,q.First,{skipElements:[e.relatedTarget]})},[T.Backwards]:()=>{Y(t,q.Last,{skipElements:[e.relatedTarget]})}})}),f=(0,E.G)(),p=(0,w.useRef)(!1);return w.createElement(w.Fragment,null,!!(4&a)&&w.createElement(B,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:j.Focusable}),(0,L.sY)({ourProps:{ref:i,onKeyDown(e){"Tab"==e.key&&(p.current=!0,f.requestAnimationFrame(()=>{p.current=!1}))},onBlur(e){let t=Z(o);n.current instanceof HTMLElement&&t.add(n.current);let r=e.relatedTarget;r instanceof HTMLElement&&"true"!==r.dataset.headlessuiFocusGuard&&(X(t,r)||(p.current?Y(n.current,(0,U.E)(d.current,{[T.Forwards]:()=>q.Next,[T.Backwards]:()=>q.Previous})|q.WrapAround,{relativeTo:e.target}):e.target instanceof HTMLElement&&K(e.target)))}},theirProps:l,defaultTag:"div",name:"FocusTrap"}),!!(4&a)&&w.createElement(B,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:j.Focusable}))}),{features:J});function X(e,t){for(let r of e)if(r.contains(t))return!0;return!1}var ee=r(54887),et=r(61463);let er=(0,w.createContext)(!1);function en(e){return w.createElement(er.Provider,{value:e.force},e.children)}let ei=w.Fragment,es=w.Fragment,eo=(0,w.createContext)(null),ea=(0,w.createContext)(null),el=Object.assign((0,L.yV)(function(e,t){let r=(0,w.useRef)(null),n=(0,M.T)((0,M.h)(e=>{r.current=e}),t),i=O(r),s=function(e){let t=(0,w.useContext)(er),r=(0,w.useContext)(eo),n=O(e),[i,s]=(0,w.useState)(()=>{if(!t&&null!==r||P.O.isServer)return null;let e=null==n?void 0:n.getElementById("headlessui-portal-root");if(e)return e;if(null===n)return null;let i=n.createElement("div");return i.setAttribute("id","headlessui-portal-root"),n.body.appendChild(i)});return(0,w.useEffect)(()=>{null!==i&&(null!=n&&n.body.contains(i)||null==n||n.body.appendChild(i))},[i,n]),(0,w.useEffect)(()=>{t||null!==r&&s(r.current)},[r,s,t]),i}(r),[o]=(0,w.useState)(()=>{var e;return P.O.isServer?null:null!=(e=null==i?void 0:i.createElement("div"))?e:null}),a=(0,w.useContext)(ea),l=(0,N.H)();return(0,et.e)(()=>{!s||!o||s.contains(o)||(o.setAttribute("data-headlessui-portal",""),s.appendChild(o))},[s,o]),(0,et.e)(()=>{if(o&&a)return a.register(o)},[a,o]),C(()=>{var e;s&&o&&(o instanceof Node&&s.contains(o)&&s.removeChild(o),s.childNodes.length<=0&&(null==(e=s.parentElement)||e.removeChild(s)))}),l&&s&&o?(0,ee.createPortal)((0,L.sY)({ourProps:{ref:n},theirProps:e,defaultTag:ei,name:"Portal"}),o):null}),{Group:(0,L.yV)(function(e,t){let{target:r,...n}=e,i={ref:(0,M.T)(t)};return w.createElement(eo.Provider,{value:r},(0,L.sY)({ourProps:i,theirProps:n,defaultTag:es,name:"Popover.Group"}))})}),{useState:eu,useEffect:ec,useLayoutEffect:ed,useDebugValue:eh}=_;"undefined"!=typeof window&&void 0!==window.document&&window.document.createElement;let ef=_.useSyncExternalStore;var ep=r(70777);function eg(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}let em=(y=()=>new Map,b={PUSH(e,t){var r;let n=null!=(r=this.get(e))?r:{doc:e,count:0,d:(0,ep.k)(),meta:new Set};return n.count++,n.meta.add(t),this.set(e,n),this},POP(e,t){let r=this.get(e);return r&&(r.count--,r.meta.delete(t)),this},SCROLL_PREVENT(e){let t,{doc:r,d:n,meta:i}=e,s={doc:r,d:n,meta:function(e){let t={};for(let r of e)Object.assign(t,r(t));return t}(i)},o=[eg()?{before(e){let{doc:t,d:r,meta:n}=e;function i(e){return n.containers.flatMap(e=>e()).some(t=>t.contains(e))}r.microTask(()=>{var e;if("auto"!==window.getComputedStyle(t.documentElement).scrollBehavior){let e=(0,ep.k)();e.style(t.documentElement,"scrollBehavior","auto"),r.add(()=>r.microTask(()=>e.dispose()))}let n=null!=(e=window.scrollY)?e:window.pageYOffset,s=null;r.addEventListener(t,"click",e=>{if(e.target instanceof HTMLElement)try{let r=e.target.closest("a");if(!r)return;let{hash:n}=new URL(r.href),o=t.querySelector(n);o&&!i(o)&&(s=o)}catch(e){}},!0),r.addEventListener(t,"touchstart",e=>{if(e.target instanceof HTMLElement){if(i(e.target)){let t=e.target;for(;t.parentElement&&i(t.parentElement);)t=t.parentElement;r.style(t,"overscrollBehavior","contain")}else r.style(e.target,"touchAction","none")}}),r.addEventListener(t,"touchmove",e=>{if(e.target instanceof HTMLElement){if(i(e.target)){let t=e.target;for(;t.parentElement&&""!==t.dataset.headlessuiPortal&&!(t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth);)t=t.parentElement;""===t.dataset.headlessuiPortal&&e.preventDefault()}else e.preventDefault()}},{passive:!1}),r.add(()=>{var e;n!==(null!=(e=window.scrollY)?e:window.pageYOffset)&&window.scrollTo(0,n),s&&s.isConnected&&(s.scrollIntoView({block:"nearest"}),s=null)})})}}:{},{before(e){var r;let{doc:n}=e,i=n.documentElement;t=(null!=(r=n.defaultView)?r:window).innerWidth-i.clientWidth},after(e){let{doc:r,d:n}=e,i=r.documentElement,s=i.clientWidth-i.offsetWidth,o=t-s;n.style(i,"paddingRight","".concat(o,"px"))}},{before(e){let{doc:t,d:r}=e;r.style(t.documentElement,"overflow","hidden")}}];o.forEach(e=>{let{before:t}=e;return null==t?void 0:t(s)}),o.forEach(e=>{let{after:t}=e;return null==t?void 0:t(s)})},SCROLL_ALLOW(e){let{d:t}=e;t.dispose()},TEARDOWN(e){let{doc:t}=e;this.delete(t)}},d=y(),h=new Set,{getSnapshot:()=>d,subscribe:e=>(h.add(e),()=>h.delete(e)),dispatch(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;ne()))}});em.subscribe(()=>{let e=em.getSnapshot(),t=new Map;for(let[r]of e)t.set(r,r.documentElement.style.overflow);for(let r of e.values()){let e="hidden"===t.get(r.doc),n=0!==r.count;(n&&!e||!n&&e)&&em.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),0===r.count&&em.dispatch("TEARDOWN",r)}});let ey=null!=(v=w.useId)?v:function(){let e=(0,N.H)(),[t,r]=w.useState(e?()=>P.O.nextId():null);return(0,et.e)(()=>{null===t&&r(P.O.nextId())},[t]),null!=t?""+t:void 0},eb=new Map,ev=new Map;function ew(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];(0,et.e)(()=>{var r;if(!t)return;let n="function"==typeof e?e():e.current;if(!n)return;let i=null!=(r=ev.get(n))?r:0;return ev.set(n,i+1),0!==i||(eb.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),function(){var e;if(!n)return;let t=null!=(e=ev.get(n))?e:1;if(1===t?ev.delete(n):ev.set(n,t-1),1!==t)return;let r=eb.get(n);r&&(null===r["aria-hidden"]?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",r["aria-hidden"]),n.inert=r.inert,eb.delete(n))}},[e,t])}function e_(e,t,r){let n=(0,x.E)(t);(0,w.useEffect)(()=>{function t(e){n.current(e)}return document.addEventListener(e,t,r),()=>document.removeEventListener(e,t,r)},[e,r])}var eE=r(53509);let eA=(0,w.createContext)(()=>{});eA.displayName="StackContext";var ex=((f=ex||{})[f.Add=0]="Add",f[f.Remove=1]="Remove",f);function ek(e){let{children:t,onUpdate:r,type:n,element:i,enabled:s}=e,o=(0,w.useContext)(eA),a=(0,A.z)(function(){for(var e=arguments.length,t=Array(e),n=0;n{let e=void 0===s||!0===s;return e&&a(0,n,i),()=>{e&&a(1,n,i)}},[a,n,i,s]),w.createElement(eA.Provider,{value:a},t)}let eS=(0,w.createContext)(null),e$=Object.assign((0,L.yV)(function(e,t){let r=ey(),{id:n="headlessui-description-".concat(r),...i}=e,s=function e(){let t=(0,w.useContext)(eS);if(null===t){let t=Error("You used a component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(t,e),t}return t}(),o=(0,M.T)(t);(0,et.e)(()=>s.register(n),[n,s.register]);let a={ref:o,...s.props,id:n};return(0,L.sY)({ourProps:a,theirProps:i,slot:s.slot||{},defaultTag:"p",name:s.name||"Description"})}),{});var eC=((p=eC||{}).Space=" ",p.Enter="Enter",p.Escape="Escape",p.Backspace="Backspace",p.Delete="Delete",p.ArrowLeft="ArrowLeft",p.ArrowUp="ArrowUp",p.ArrowRight="ArrowRight",p.ArrowDown="ArrowDown",p.Home="Home",p.End="End",p.PageUp="PageUp",p.PageDown="PageDown",p.Tab="Tab",p),eP=((g=eP||{})[g.Open=0]="Open",g[g.Closed=1]="Closed",g),eI=((m=eI||{})[m.SetTitleId=0]="SetTitleId",m);let eO={0:(e,t)=>e.titleId===t.id?e:{...e,titleId:t.id}},eN=(0,w.createContext)(null);function eM(e){let t=(0,w.useContext)(eN);if(null===t){let t=Error("<".concat(e," /> is missing a parent component."));throw Error.captureStackTrace&&Error.captureStackTrace(t,eM),t}return t}function eR(e,t){return(0,U.E)(t.type,eO,e,t)}eN.displayName="DialogContext";let eT=L.AN.RenderStrategy|L.AN.Static,eD=Object.assign((0,L.yV)(function(e,t){let r,n,i,s,o,a=ey(),{id:l="headlessui-dialog-".concat(a),open:u,onClose:c,initialFocus:d,role:h="dialog",__demoMode:f=!1,...p}=e,[g,m]=(0,w.useState)(0),y=(0,w.useRef)(!1);h="dialog"===h||"alertdialog"===h?h:(y.current||(y.current=!0,console.warn("Invalid role [".concat(h,"] passed to . Only `dialog` and and `alertdialog` are supported. Using `dialog` instead."))),"dialog");let b=(0,eE.oJ)();void 0===u&&null!==b&&(u=(b&eE.ZM.Open)===eE.ZM.Open);let v=(0,w.useRef)(null),_=(0,M.T)(v,t),E=O(v),x=e.hasOwnProperty("open")||null!==b,S=e.hasOwnProperty("onClose");if(!x&&!S)throw Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!x)throw Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!S)throw Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if("boolean"!=typeof u)throw Error("You provided an `open` prop to the `Dialog`, but the value is not a boolean. Received: ".concat(u));if("function"!=typeof c)throw Error("You provided an `onClose` prop to the `Dialog`, but the value is not a function. Received: ".concat(c));let $=u?0:1,[C,P]=(0,w.useReducer)(eR,{titleId:null,descriptionId:null,panelRef:(0,w.createRef)()}),T=(0,A.z)(()=>c(!1)),D=(0,A.z)(e=>P({type:0,id:e})),F=!!(0,N.H)()&&!f&&0===$,q=g>1,H=null!==(0,w.useContext)(eN),[G,W]=(r=(0,w.useContext)(ea),n=(0,w.useRef)([]),i=(0,A.z)(e=>(n.current.push(e),r&&r.register(e),()=>s(e))),s=(0,A.z)(e=>{let t=n.current.indexOf(e);-1!==t&&n.current.splice(t,1),r&&r.unregister(e)}),o=(0,w.useMemo)(()=>({register:i,unregister:s,portals:n}),[i,s,n]),[n,(0,w.useMemo)(()=>function(e){let{children:t}=e;return w.createElement(ea.Provider,{value:o},t)},[o])]),{resolveContainers:K,mainTreeNodeRef:Y,MainTreeNode:Z}=function(){var e;let{defaultContainers:t=[],portals:r,mainTreeNodeRef:n}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=(0,w.useRef)(null!=(e=null==n?void 0:n.current)?e:null),s=O(i),o=(0,A.z)(()=>{var e,n,o;let a=[];for(let e of t)null!==e&&(e instanceof HTMLElement?a.push(e):"current"in e&&e.current instanceof HTMLElement&&a.push(e.current));if(null!=r&&r.current)for(let e of r.current)a.push(e);for(let t of null!=(e=null==s?void 0:s.querySelectorAll("html > *, body > *"))?e:[])t!==document.body&&t!==document.head&&t instanceof HTMLElement&&"headlessui-portal-root"!==t.id&&(t.contains(i.current)||t.contains(null==(o=null==(n=i.current)?void 0:n.getRootNode())?void 0:o.host)||a.some(e=>t.contains(e))||a.push(t));return a});return{resolveContainers:o,contains:(0,A.z)(e=>o().some(t=>t.contains(e))),mainTreeNodeRef:i,MainTreeNode:(0,w.useMemo)(()=>function(){return null!=n?null:w.createElement(B,{features:j.Hidden,ref:i})},[i,n])}}({portals:G,defaultContainers:[{get current(){var J;return null!=(J=C.panelRef.current)?J:v.current}}]}),X=null!==b&&(b&eE.ZM.Closing)===eE.ZM.Closing,ee=!H&&!X&&F;ew((0,w.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==E?void 0:E.querySelectorAll("body > *"))?e:[]).find(e=>"headlessui-portal-root"!==e.id&&e.contains(Y.current)&&e instanceof HTMLElement))?t:null},[Y]),ee);let er=!!q||F;ew((0,w.useCallback)(()=>{var e,t;return null!=(t=Array.from(null!=(e=null==E?void 0:E.querySelectorAll("[data-headlessui-portal]"))?e:[]).find(e=>e.contains(Y.current)&&e instanceof HTMLElement))?t:null},[Y]),er),function(e,t){let r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=(0,w.useRef)(!1);function i(r,i){if(!n.current||r.defaultPrevented)return;let s=i(r);if(null!==s&&s.getRootNode().contains(s)&&s.isConnected){for(let t of function e(t){return"function"==typeof t?e(t()):Array.isArray(t)||t instanceof Set?t:[t]}(e)){if(null===t)continue;let e=t instanceof HTMLElement?t:t.current;if(null!=e&&e.contains(s)||r.composed&&r.composedPath().includes(e))return}return!function(e){var t;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return e!==(null==(t=I(e))?void 0:t.body)&&(0,U.E)(r,{0:()=>e.matches(z),1(){let t=e;for(;null!==t;){if(t.matches(z))return!0;t=t.parentElement}return!1}})}(s,V.Loose)&&-1!==s.tabIndex&&r.preventDefault(),t(r,s)}}(0,w.useEffect)(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);let s=(0,w.useRef)(null);e_("pointerdown",e=>{var t,r;n.current&&(s.current=(null==(r=null==(t=e.composedPath)?void 0:t.call(e))?void 0:r[0])||e.target)},!0),e_("mousedown",e=>{var t,r;n.current&&(s.current=(null==(r=null==(t=e.composedPath)?void 0:t.call(e))?void 0:r[0])||e.target)},!0),e_("click",e=>{eg()||/Android/gi.test(window.navigator.userAgent)||s.current&&(i(e,()=>s.current),s.current=null)},!0),e_("touchend",e=>i(e,()=>e.target instanceof HTMLElement?e.target:null),!0),R("blur",e=>i(e,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}(K,e=>{e.preventDefault(),T()},!(!F||q));let ei=!(q||0!==$);k(null==E?void 0:E.defaultView,"keydown",e=>{ei&&(e.defaultPrevented||e.key===eC.Escape&&(e.preventDefault(),e.stopPropagation(),T()))}),function(e,t){var r;let n,i,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:()=>[document.body];r=e=>{var t;return{containers:[...null!=(t=e.containers)?t:[],s]}},n=ef(em.subscribe,em.getSnapshot,em.getSnapshot),(i=e?n.get(e):void 0)&&i.count,(0,et.e)(()=>{if(!(!e||!t))return em.dispatch("PUSH",e,r),()=>em.dispatch("POP",e,r)},[t,e])}(E,!(X||0!==$||H),K),(0,w.useEffect)(()=>{if(0!==$||!v.current)return;let e=new ResizeObserver(e=>{for(let t of e){let e=t.target.getBoundingClientRect();0===e.x&&0===e.y&&0===e.width&&0===e.height&&T()}});return e.observe(v.current),()=>e.disconnect()},[$,v,T]);let[es,eo]=function(){let[e,t]=(0,w.useState)([]);return[e.length>0?e.join(" "):void 0,(0,w.useMemo)(()=>function(e){let r=(0,A.z)(e=>(t(t=>[...t,e]),()=>t(t=>{let r=t.slice(),n=r.indexOf(e);return -1!==n&&r.splice(n,1),r}))),n=(0,w.useMemo)(()=>({register:r,slot:e.slot,name:e.name,props:e.props}),[r,e.slot,e.name,e.props]);return w.createElement(eS.Provider,{value:n},e.children)},[t])]}(),eu=(0,w.useMemo)(()=>[{dialogState:$,close:T,setTitleId:D},C],[$,C,T,D]),ec=(0,w.useMemo)(()=>({open:0===$}),[$]),ed={ref:_,id:l,role:h,"aria-modal":0===$||void 0,"aria-labelledby":C.titleId,"aria-describedby":es};return w.createElement(ek,{type:"Dialog",enabled:0===$,element:v,onUpdate:(0,A.z)((e,t)=>{"Dialog"===t&&(0,U.E)(e,{[ex.Add]:()=>m(e=>e+1),[ex.Remove]:()=>m(e=>e-1)})})},w.createElement(en,{force:!0},w.createElement(el,null,w.createElement(eN.Provider,{value:eu},w.createElement(el.Group,{target:v},w.createElement(en,{force:!1},w.createElement(eo,{slot:ec,name:"Dialog.Description"},w.createElement(Q,{initialFocus:d,containers:K,features:F?(0,U.E)(q?"parent":"leaf",{parent:Q.features.RestoreFocus,leaf:Q.features.All&~Q.features.FocusLock}):Q.features.None},w.createElement(W,null,(0,L.sY)({ourProps:ed,theirProps:p,slot:ec,defaultTag:"div",features:eT,visible:0===$,name:"Dialog"}))))))))),w.createElement(Z,null))}),{Backdrop:(0,L.yV)(function(e,t){let r=ey(),{id:n="headlessui-dialog-backdrop-".concat(r),...i}=e,[{dialogState:s},o]=eM("Dialog.Backdrop"),a=(0,M.T)(t);(0,w.useEffect)(()=>{if(null===o.panelRef.current)throw Error("A component is being used, but a component is missing.")},[o.panelRef]);let l=(0,w.useMemo)(()=>({open:0===s}),[s]);return w.createElement(en,{force:!0},w.createElement(el,null,(0,L.sY)({ourProps:{ref:a,id:n,"aria-hidden":!0},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Backdrop"})))}),Panel:(0,L.yV)(function(e,t){let r=ey(),{id:n="headlessui-dialog-panel-".concat(r),...i}=e,[{dialogState:s},o]=eM("Dialog.Panel"),a=(0,M.T)(t,o.panelRef),l=(0,w.useMemo)(()=>({open:0===s}),[s]),u=(0,A.z)(e=>{e.stopPropagation()});return(0,L.sY)({ourProps:{ref:a,id:n,onClick:u},theirProps:i,slot:l,defaultTag:"div",name:"Dialog.Panel"})}),Overlay:(0,L.yV)(function(e,t){let r=ey(),{id:n="headlessui-dialog-overlay-".concat(r),...i}=e,[{dialogState:s,close:o}]=eM("Dialog.Overlay"),a=(0,M.T)(t),l=(0,A.z)(e=>{if(e.target===e.currentTarget){if(function(e){let t=e.parentElement,r=null;for(;t&&!(t instanceof HTMLFieldSetElement);)t instanceof HTMLLegendElement&&(r=t),t=t.parentElement;let n=(null==t?void 0:t.getAttribute("disabled"))==="";return!(n&&function(e){if(!e)return!1;let t=e.previousElementSibling;for(;null!==t;){if(t instanceof HTMLLegendElement)return!1;t=t.previousElementSibling}return!0}(r))&&n}(e.currentTarget))return e.preventDefault();e.preventDefault(),e.stopPropagation(),o()}}),u=(0,w.useMemo)(()=>({open:0===s}),[s]);return(0,L.sY)({ourProps:{ref:a,id:n,"aria-hidden":!0,onClick:l},theirProps:i,slot:u,defaultTag:"div",name:"Dialog.Overlay"})}),Title:(0,L.yV)(function(e,t){let r=ey(),{id:n="headlessui-dialog-title-".concat(r),...i}=e,[{dialogState:s,setTitleId:o}]=eM("Dialog.Title"),a=(0,M.T)(t);(0,w.useEffect)(()=>(o(n),()=>o(null)),[n,o]);let l=(0,w.useMemo)(()=>({open:0===s}),[s]);return(0,L.sY)({ourProps:{ref:a,id:n},theirProps:i,slot:l,defaultTag:"h2",name:"Dialog.Title"})}),Description:e$})},59226:function(e,t,r){"use strict";let n;r.d(t,{u:function(){return N}});var i=r(2265),s=r(99299),o=r(6584),a=r(26400),l=r(61463),u=r(88703),c=r(33856),d=r(41469),h=r(70777),f=r(5583);function p(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0&&e.classList.add(...r)}function g(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n0&&e.classList.remove(...r)}var m=r(53509),y=r(12585),b=r(3600);function v(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return e.split(/\s+/).filter(e=>e.length>1)}let w=(0,i.createContext)(null);w.displayName="TransitionContext";var _=((n=_||{}).Visible="visible",n.Hidden="hidden",n);let E=(0,i.createContext)(null);function A(e){return"children"in e?A(e.children):e.current.filter(e=>{let{el:t}=e;return null!==t.current}).filter(e=>{let{state:t}=e;return"visible"===t}).length>0}function x(e,t){let r=(0,u.E)(e),n=(0,i.useRef)([]),l=(0,a.t)(),c=(0,s.G)(),d=(0,o.z)(function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:b.l4.Hidden,i=n.current.findIndex(t=>{let{el:r}=t;return r===e});-1!==i&&((0,f.E)(t,{[b.l4.Unmount](){n.current.splice(i,1)},[b.l4.Hidden](){n.current[i].state="hidden"}}),c.microTask(()=>{var e;!A(n)&&l.current&&(null==(e=r.current)||e.call(r))}))}),h=(0,o.z)(e=>{let t=n.current.find(t=>{let{el:r}=t;return r===e});return t?"visible"!==t.state&&(t.state="visible"):n.current.push({el:e,state:"visible"}),()=>d(e,b.l4.Unmount)}),p=(0,i.useRef)([]),g=(0,i.useRef)(Promise.resolve()),m=(0,i.useRef)({enter:[],leave:[],idle:[]}),y=(0,o.z)((e,r,n)=>{p.current.splice(0),t&&(t.chains.current[r]=t.chains.current[r].filter(t=>{let[r]=t;return r!==e})),null==t||t.chains.current[r].push([e,new Promise(e=>{p.current.push(e)})]),null==t||t.chains.current[r].push([e,new Promise(e=>{Promise.all(m.current[r].map(e=>{let[t,r]=e;return r})).then(()=>e())})]),"enter"===r?g.current=g.current.then(()=>null==t?void 0:t.wait.current).then(()=>n(r)):n(r)}),v=(0,o.z)((e,t,r)=>{Promise.all(m.current[t].splice(0).map(e=>{let[t,r]=e;return r})).then(()=>{var e;null==(e=p.current.shift())||e()}).then(()=>r(t))});return(0,i.useMemo)(()=>({children:n,register:h,unregister:d,onStart:y,onStop:v,wait:g,chains:m}),[h,d,n,y,v,m,g])}function k(){}E.displayName="NestingContext";let S=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function $(e){var t;let r={};for(let n of S)r[n]=null!=(t=e[n])?t:k;return r}let C=b.AN.RenderStrategy,P=(0,b.yV)(function(e,t){let{show:r,appear:n=!1,unmount:s=!0,...a}=e,u=(0,i.useRef)(null),h=(0,d.T)(u,t);(0,c.H)();let f=(0,m.oJ)();if(void 0===r&&null!==f&&(r=(f&m.ZM.Open)===m.ZM.Open),![!0,!1].includes(r))throw Error("A is used but it is missing a `show={true | false}` prop.");let[p,g]=(0,i.useState)(r?"visible":"hidden"),y=x(()=>{g("hidden")}),[v,_]=(0,i.useState)(!0),k=(0,i.useRef)([r]);(0,l.e)(()=>{!1!==v&&k.current[k.current.length-1]!==r&&(k.current.push(r),_(!1))},[k,r]);let S=(0,i.useMemo)(()=>({show:r,appear:n,initial:v}),[r,n,v]);(0,i.useEffect)(()=>{if(r)g("visible");else if(A(y)){let e=u.current;if(!e)return;let t=e.getBoundingClientRect();0===t.x&&0===t.y&&0===t.width&&0===t.height&&g("hidden")}else g("hidden")},[r,y]);let $={unmount:s},P=(0,o.z)(()=>{var t;v&&_(!1),null==(t=e.beforeEnter)||t.call(e)}),O=(0,o.z)(()=>{var t;v&&_(!1),null==(t=e.beforeLeave)||t.call(e)});return i.createElement(E.Provider,{value:y},i.createElement(w.Provider,{value:S},(0,b.sY)({ourProps:{...$,as:i.Fragment,children:i.createElement(I,{ref:h,...$,...a,beforeEnter:P,beforeLeave:O})},theirProps:{},defaultTag:i.Fragment,features:C,visible:"visible"===p,name:"Transition"})))}),I=(0,b.yV)(function(e,t){var r,n,_;let k;let{beforeEnter:S,afterEnter:P,beforeLeave:I,afterLeave:O,enter:N,enterFrom:M,enterTo:R,entered:T,leave:D,leaveFrom:L,leaveTo:j,...B}=e,F=(0,i.useRef)(null),U=(0,d.T)(F,t),z=null==(r=B.unmount)||r?b.l4.Unmount:b.l4.Hidden,{show:q,appear:H,initial:G}=function(){let e=(0,i.useContext)(w);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),[V,W]=(0,i.useState)(q?"visible":"hidden"),K=function(){let e=(0,i.useContext)(E);if(null===e)throw Error("A is used but it is missing a parent or .");return e}(),{register:Y,unregister:Z}=K;(0,i.useEffect)(()=>Y(F),[Y,F]),(0,i.useEffect)(()=>{if(z===b.l4.Hidden&&F.current){if(q&&"visible"!==V){W("visible");return}return(0,f.E)(V,{hidden:()=>Z(F),visible:()=>Y(F)})}},[V,F,Y,Z,q,z]);let J=(0,u.E)({base:v(B.className),enter:v(N),enterFrom:v(M),enterTo:v(R),entered:v(T),leave:v(D),leaveFrom:v(L),leaveTo:v(j)}),Q=(_={beforeEnter:S,afterEnter:P,beforeLeave:I,afterLeave:O},k=(0,i.useRef)($(_)),(0,i.useEffect)(()=>{k.current=$(_)},[_]),k),X=(0,c.H)();(0,i.useEffect)(()=>{if(X&&"visible"===V&&null===F.current)throw Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[F,V,X]);let ee=H&&q&&G,et=X&&(!G||H)?q?"enter":"leave":"idle",er=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,[t,r]=(0,i.useState)(e),n=(0,a.t)(),s=(0,i.useCallback)(e=>{n.current&&r(t=>t|e)},[t,n]),o=(0,i.useCallback)(e=>!!(t&e),[t]);return{flags:t,addFlag:s,hasFlag:o,removeFlag:(0,i.useCallback)(e=>{n.current&&r(t=>t&~e)},[r,n]),toggleFlag:(0,i.useCallback)(e=>{n.current&&r(t=>t^e)},[r])}}(0),en=(0,o.z)(e=>(0,f.E)(e,{enter:()=>{er.addFlag(m.ZM.Opening),Q.current.beforeEnter()},leave:()=>{er.addFlag(m.ZM.Closing),Q.current.beforeLeave()},idle:()=>{}})),ei=(0,o.z)(e=>(0,f.E)(e,{enter:()=>{er.removeFlag(m.ZM.Opening),Q.current.afterEnter()},leave:()=>{er.removeFlag(m.ZM.Closing),Q.current.afterLeave()},idle:()=>{}})),es=x(()=>{W("hidden"),Z(F)},K),eo=(0,i.useRef)(!1);!function(e){let{immediate:t,container:r,direction:n,classes:i,onStart:o,onStop:c}=e,d=(0,a.t)(),m=(0,s.G)(),y=(0,u.E)(n);(0,l.e)(()=>{t&&(y.current="enter")},[t]),(0,l.e)(()=>{let e=(0,h.k)();m.add(e.dispose);let t=r.current;if(t&&"idle"!==y.current&&d.current){var n,s,a;let r,l,u,d,m,b,v;return e.dispose(),o.current(y.current),e.add((n=i.current,s="enter"===y.current,a=()=>{e.dispose(),c.current(y.current)},l=s?"enter":"leave",u=(0,h.k)(),d=void 0!==a?(r={called:!1},function(){for(var e=arguments.length,t=Array(e),n=0;n{},"enter"===l&&(t.removeAttribute("hidden"),t.style.display=""),m=(0,f.E)(l,{enter:()=>n.enter,leave:()=>n.leave}),b=(0,f.E)(l,{enter:()=>n.enterTo,leave:()=>n.leaveTo}),v=(0,f.E)(l,{enter:()=>n.enterFrom,leave:()=>n.leaveFrom}),g(t,...n.base,...n.enter,...n.enterTo,...n.enterFrom,...n.leave,...n.leaveFrom,...n.leaveTo,...n.entered),p(t,...n.base,...m,...v),u.nextFrame(()=>{g(t,...n.base,...m,...v),p(t,...n.base,...m,...b),function(e,t){let r=(0,h.k)();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:i}=getComputedStyle(e),[s,o]=[n,i].map(e=>{let[t=0]=e.split(",").filter(Boolean).map(e=>e.includes("ms")?parseFloat(e):1e3*parseFloat(e)).sort((e,t)=>t-e);return t}),a=s+o;if(0!==a){r.group(r=>{r.setTimeout(()=>{t(),r.dispose()},a),r.addEventListener(e,"transitionrun",e=>{e.target===e.currentTarget&&r.dispose()})});let n=r.addEventListener(e,"transitionend",e=>{e.target===e.currentTarget&&(t(),n())})}else t();r.add(()=>t()),r.dispose}(t,()=>(g(t,...n.base,...m),p(t,...n.base,...n.entered),d()))}),u.dispose)),e.dispose}},[n])}({immediate:ee,container:F,classes:J,direction:et,onStart:(0,u.E)(e=>{eo.current=!0,es.onStart(F,e,en)}),onStop:(0,u.E)(e=>{eo.current=!1,es.onStop(F,e,ei),"leave"!==e||A(es)||(W("hidden"),Z(F))})});let ea=B;return ee?ea={...ea,className:(0,y.A)(B.className,...J.current.enter,...J.current.enterFrom)}:eo.current&&(ea.className=(0,y.A)(B.className,null==(n=F.current)?void 0:n.className),""===ea.className&&delete ea.className),i.createElement(E.Provider,{value:es},i.createElement(m.up,{value:(0,f.E)(V,{visible:m.ZM.Open,hidden:m.ZM.Closed})|er.flags},(0,b.sY)({ourProps:{ref:U},theirProps:ea,defaultTag:"div",features:C,visible:"visible"===V,name:"Transition.Child"})))}),O=(0,b.yV)(function(e,t){let r=null!==(0,i.useContext)(w),n=null!==(0,m.oJ)();return i.createElement(i.Fragment,null,!r&&n?i.createElement(P,{ref:t,...e}):i.createElement(I,{ref:t,...e}))}),N=Object.assign(P,{Child:O,Root:P})},99299:function(e,t,r){"use strict";r.d(t,{G:function(){return s}});var n=r(2265),i=r(70777);function s(){let[e]=(0,n.useState)(i.k);return(0,n.useEffect)(()=>()=>e.dispose(),[e]),e}},6584:function(e,t,r){"use strict";r.d(t,{z:function(){return s}});var n=r(2265),i=r(88703);let s=function(e){let t=(0,i.E)(e);return n.useCallback(function(){for(var e=arguments.length,r=Array(e),n=0;n(e.current=!0,()=>{e.current=!1}),[]),e}},61463:function(e,t,r){"use strict";r.d(t,{e:function(){return s}});var n=r(2265),i=r(54462);let s=(e,t)=>{i.O.isServer?(0,n.useEffect)(e,t):(0,n.useLayoutEffect)(e,t)}},88703:function(e,t,r){"use strict";r.d(t,{E:function(){return s}});var n=r(2265),i=r(61463);function s(e){let t=(0,n.useRef)(e);return(0,i.e)(()=>{t.current=e},[e]),t}},33856:function(e,t,r){"use strict";r.d(t,{H:function(){return o}});var n,i=r(2265),s=r(54462);function o(){let e;let t=(e="undefined"==typeof document,(0,(n||(n=r.t(i,2))).useSyncExternalStore)(()=>()=>{},()=>!1,()=>!e)),[o,a]=i.useState(s.O.isHandoffComplete);return o&&!1===s.O.isHandoffComplete&&a(!1),i.useEffect(()=>{!0!==o&&a(!0)},[o]),i.useEffect(()=>s.O.handoff(),[]),!t&&o}},41469:function(e,t,r){"use strict";r.d(t,{T:function(){return a},h:function(){return o}});var n=r(2265),i=r(6584);let s=Symbol();function o(e){let t=!(arguments.length>1)||void 0===arguments[1]||arguments[1];return Object.assign(e,{[s]:t})}function a(){for(var e=arguments.length,t=Array(e),r=0;r{o.current=t},[t]);let a=(0,i.z)(e=>{for(let t of o.current)null!=t&&("function"==typeof t?t(e):t.current=e)});return t.every(e=>null==e||(null==e?void 0:e[s]))?void 0:a}},53509:function(e,t,r){"use strict";let n;r.d(t,{ZM:function(){return o},oJ:function(){return a},up:function(){return l}});var i=r(2265);let s=(0,i.createContext)(null);s.displayName="OpenClosedContext";var o=((n=o||{})[n.Open=1]="Open",n[n.Closed=2]="Closed",n[n.Closing=4]="Closing",n[n.Opening=8]="Opening",n);function a(){return(0,i.useContext)(s)}function l(e){let{value:t,children:r}=e;return i.createElement(s.Provider,{value:t},r)}},12585:function(e,t,r){"use strict";function n(){for(var e=arguments.length,t=Array(e),r=0;r"string"==typeof e?e.split(" "):[]))).filter(Boolean).join(" ")}r.d(t,{A:function(){return n}})},70777:function(e,t,r){"use strict";r.d(t,{k:function(){return function e(){let t=[],r={addEventListener:(e,t,n,i)=>(e.addEventListener(t,n,i),r.add(()=>e.removeEventListener(t,n,i))),requestAnimationFrame(){for(var e=arguments.length,t=Array(e),n=0;ncancelAnimationFrame(i))},nextFrame(){for(var e=arguments.length,t=Array(e),n=0;nr.requestAnimationFrame(...t))},setTimeout(){for(var e=arguments.length,t=Array(e),n=0;nclearTimeout(i))},microTask(){for(var e=arguments.length,t=Array(e),i=0;i{s.current&&t[0]()}),r.add(()=>{s.current=!1})},style(e,t,r){let n=e.style.getPropertyValue(t);return Object.assign(e.style,{[t]:r}),this.add(()=>{Object.assign(e.style,{[t]:n})})},group(t){let r=e();return t(r),this.add(()=>r.dispose())},add:e=>(t.push(e),()=>{let r=t.indexOf(e);if(r>=0)for(let e of t.splice(r,1))e()}),dispose(){for(let e of t.splice(0))e()}};return r}}});var n=r(28043)},54462:function(e,t,r){"use strict";r.d(t,{O:function(){return a}});var n=Object.defineProperty,i=(e,t,r)=>t in e?n(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,s=(e,t,r)=>(i(e,"symbol"!=typeof t?t+"":t,r),r);class o{set(e){this.current!==e&&(this.handoffState="pending",this.currentId=0,this.current=e)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return"server"===this.current}get isClient(){return"client"===this.current}detect(){return"undefined"==typeof window||"undefined"==typeof document?"server":"client"}handoff(){"pending"===this.handoffState&&(this.handoffState="complete")}get isHandoffComplete(){return"complete"===this.handoffState}constructor(){s(this,"current",this.detect()),s(this,"handoffState","pending"),s(this,"currentId",0)}}let a=new o},5583:function(e,t,r){"use strict";function n(e,t){for(var r=arguments.length,i=Array(r>2?r-2:0),s=2;s'"'.concat(e,'"')).join(", "),"."));throw Error.captureStackTrace&&Error.captureStackTrace(o,n),o}r.d(t,{E:function(){return n}})},28043:function(e,t,r){"use strict";function n(e){"function"==typeof queueMicrotask?queueMicrotask(e):Promise.resolve().then(e).catch(e=>setTimeout(()=>{throw e}))}r.d(t,{Y:function(){return n}})},3600:function(e,t,r){"use strict";let n,i;r.d(t,{AN:function(){return l},l4:function(){return u},sY:function(){return c},yV:function(){return p}});var s=r(2265),o=r(12585),a=r(5583),l=((n=l||{})[n.None=0]="None",n[n.RenderStrategy=1]="RenderStrategy",n[n.Static=2]="Static",n),u=((i=u||{})[i.Unmount=0]="Unmount",i[i.Hidden=1]="Hidden",i);function c(e){let{ourProps:t,theirProps:r,slot:n,defaultTag:i,features:s,visible:o=!0,name:l,mergeRefs:u}=e;u=null!=u?u:h;let c=f(r,t);if(o)return d(c,n,i,l,u);let p=null!=s?s:0;if(2&p){let{static:e=!1,...t}=c;if(e)return d(t,n,i,l,u)}if(1&p){let{unmount:e=!0,...t}=c;return(0,a.E)(e?0:1,{0:()=>null,1:()=>d({...t,hidden:!0,style:{display:"none"}},n,i,l,u)})}return d(c,n,i,l,u)}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=arguments.length>3?arguments[3]:void 0,i=arguments.length>4?arguments[4]:void 0,{as:a=r,children:l,refName:u="ref",...c}=m(e,["unmount","static"]),d=void 0!==e.ref?{[u]:e.ref}:{},h="function"==typeof l?l(t):l;"className"in c&&c.className&&"function"==typeof c.className&&(c.className=c.className(t));let p={};if(t){let e=!1,r=[];for(let[n,i]of Object.entries(t))"boolean"==typeof i&&(e=!0),!0===i&&r.push(n);e&&(p["data-headlessui-state"]=r.join(" "))}if(a===s.Fragment&&Object.keys(g(c)).length>0){if(!(0,s.isValidElement)(h)||Array.isArray(h)&&h.length>1)throw Error(['Passing props on "Fragment"!',"","The current component <".concat(n,' /> is rendering a "Fragment".'),"However we need to passthrough the following props:",Object.keys(c).map(e=>" - ".concat(e)).join("\n"),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(e=>" - ".concat(e)).join("\n")].join("\n"));let e=h.props,t="function"==typeof(null==e?void 0:e.className)?function(){for(var t=arguments.length,r=Array(t),n=0;nnull==e)?void 0:e=>{for(let r of t)null!=r&&("function"==typeof r?r(e):r.current=e)}}function f(){for(var e=arguments.length,t=Array(e),r=0;r[e,void 0])));for(let e in i)Object.assign(n,{[e](t){for(var r=arguments.length,n=Array(r>1?r-1:0),s=1;s1&&void 0!==arguments[1]?arguments[1]:[],r=Object.assign({},e);for(let e of t)e in r&&delete r[e];return r}},39422:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))});t.Z=i},76218:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"}))});t.Z=i},66514:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"}))});t.Z=i},64728:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.023 9.348h4.992v-.001M2.985 19.644v-4.992m0 0h4.992m-4.993 0 3.181 3.183a8.25 8.25 0 0 0 13.803-3.7M4.031 9.865a8.25 8.25 0 0 1 13.803-3.7l3.181 3.182m0-4.991v4.99"}))});t.Z=i},22091:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 9V5.25A2.25 2.25 0 0 1 10.5 3h6a2.25 2.25 0 0 1 2.25 2.25v13.5A2.25 2.25 0 0 1 16.5 21h-6a2.25 2.25 0 0 1-2.25-2.25V15M12 9l3 3m0 0-3 3m3-3H2.25"}))});t.Z=i},82238:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.5 6H5.25A2.25 2.25 0 0 0 3 8.25v10.5A2.25 2.25 0 0 0 5.25 21h10.5A2.25 2.25 0 0 0 18 18.75V10.5m-10.5 6L21 3m0 0h-5.25M21 3v5.25"}))});t.Z=i},84351:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 3v2.25M17.25 3v2.25M3 18.75V7.5a2.25 2.25 0 0 1 2.25-2.25h13.5A2.25 2.25 0 0 1 21 7.5v11.25m-18 0A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75m-18 0v-7.5A2.25 2.25 0 0 1 5.25 9h13.5A2.25 2.25 0 0 1 21 11.25v7.5"}))});t.Z=i},85130:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))});t.Z=i},68906:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))});t.Z=i},59808:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"}))});t.Z=i},87335:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M11.35 3.836c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m8.9-4.414c.376.023.75.05 1.124.08 1.131.094 1.976 1.057 1.976 2.192V16.5A2.25 2.25 0 0 1 18 18.75h-2.25m-7.5-10.5H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V18.75m-7.5-10.5h6.375c.621 0 1.125.504 1.125 1.125v9.375m-8.25-3 1.5 1.5 3-3.75"}))});t.Z=i},49601:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"}))});t.Z=i},33009:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"}))});t.Z=i},74634:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M10.5 1.5H8.25A2.25 2.25 0 0 0 6 3.75v16.5a2.25 2.25 0 0 0 2.25 2.25h7.5A2.25 2.25 0 0 0 18 20.25V3.75a2.25 2.25 0 0 0-2.25-2.25H13.5m-3 0V3h3V1.5m-3 0h3m-3 18.75h3"}))});t.Z=i},57470:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"}))});t.Z=i},92009:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21.75 6.75v10.5a2.25 2.25 0 0 1-2.25 2.25h-15a2.25 2.25 0 0 1-2.25-2.25V6.75m19.5 0A2.25 2.25 0 0 0 19.5 4.5h-15a2.25 2.25 0 0 0-2.25 2.25m19.5 0v.243a2.25 2.25 0 0 1-1.07 1.916l-7.5 4.615a2.25 2.25 0 0 1-2.36 0L3.32 8.91a2.25 2.25 0 0 1-1.07-1.916V6.75"}))});t.Z=i},99442:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"}))});t.Z=i},11853:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"}))});t.Z=i},52985:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))});t.Z=i},47193:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"}))});t.Z=i},70882:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M7.864 4.243A7.5 7.5 0 0 1 19.5 10.5c0 2.92-.556 5.709-1.568 8.268M5.742 6.364A7.465 7.465 0 0 0 4.5 10.5a7.464 7.464 0 0 1-1.15 3.993m1.989 3.559A11.209 11.209 0 0 0 8.25 10.5a3.75 3.75 0 1 1 7.5 0c0 .527-.021 1.049-.064 1.565M12 10.5a14.94 14.94 0 0 1-3.6 9.75m6.633-4.596a18.666 18.666 0 0 1-2.485 5.33"}))});t.Z=i},93925:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M12 21a9.004 9.004 0 0 0 8.716-6.747M12 21a9.004 9.004 0 0 1-8.716-6.747M12 21c2.485 0 4.5-4.03 4.5-9S14.485 3 12 3m0 18c-2.485 0-4.5-4.03-4.5-9S9.515 3 12 3m0 0a8.997 8.997 0 0 1 7.843 4.582M12 3a8.997 8.997 0 0 0-7.843 4.582m15.686 0A11.953 11.953 0 0 1 12 10.5c-2.998 0-5.74-1.1-7.843-2.918m15.686 0A8.959 8.959 0 0 1 21 12c0 .778-.099 1.533-.284 2.253m0 0A17.919 17.919 0 0 1 12 16.5c-3.162 0-6.133-.815-8.716-2.247m0 0A9.015 9.015 0 0 1 3 12c0-1.605.42-3.113 1.157-4.418"}))});t.Z=i},13934:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"}))});t.Z=i},69992:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M15.75 5.25a3 3 0 0 1 3 3m3 0a6 6 0 0 1-7.029 5.912c-.563-.097-1.159.026-1.563.43L10.5 17.25H8.25v2.25H6v2.25H2.25v-2.818c0-.597.237-1.17.659-1.591l6.499-6.499c.404-.404.527-1 .43-1.563A6 6 0 1 1 21.75 8.25Z"}))});t.Z=i},64954:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M13.19 8.688a4.5 4.5 0 0 1 1.242 7.244l-4.5 4.5a4.5 4.5 0 0 1-6.364-6.364l1.757-1.757m13.35-.622 1.757-1.757a4.5 4.5 0 0 0-6.364-6.364l-4.5 4.5a4.5 4.5 0 0 0 1.242 7.244"}))});t.Z=i},63722:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 10.5V6.75a4.5 4.5 0 1 0-9 0v3.75m-.75 11.25h10.5a2.25 2.25 0 0 0 2.25-2.25v-6.75a2.25 2.25 0 0 0-2.25-2.25H6.75a2.25 2.25 0 0 0-2.25 2.25v6.75a2.25 2.25 0 0 0 2.25 2.25Z"}))});t.Z=i},58900:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"}))});t.Z=i},62957:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"}))});t.Z=i},47899:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M2.25 6.75c0 8.284 6.716 15 15 15h2.25a2.25 2.25 0 0 0 2.25-2.25v-1.372c0-.516-.351-.966-.852-1.091l-4.423-1.106c-.44-.11-.902.055-1.173.417l-.97 1.293c-.282.376-.769.542-1.21.38a12.035 12.035 0 0 1-7.143-7.143c-.162-.441.004-.928.38-1.21l1.293-.97c.363-.271.527-.734.417-1.173L6.963 3.102a1.125 1.125 0 0 0-1.091-.852H4.5A2.25 2.25 0 0 0 2.25 4.5v2.25Z"}))});t.Z=i},44011:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M3.75 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 3.75 9.375v-4.5ZM3.75 14.625c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5a1.125 1.125 0 0 1-1.125-1.125v-4.5ZM13.5 4.875c0-.621.504-1.125 1.125-1.125h4.5c.621 0 1.125.504 1.125 1.125v4.5c0 .621-.504 1.125-1.125 1.125h-4.5A1.125 1.125 0 0 1 13.5 9.375v-4.5Z"}),n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6.75 6.75h.75v.75h-.75v-.75ZM6.75 16.5h.75v.75h-.75v-.75ZM16.5 6.75h.75v.75h-.75v-.75ZM13.5 13.5h.75v.75h-.75v-.75ZM13.5 19.5h.75v.75h-.75v-.75ZM19.5 13.5h.75v.75h-.75v-.75ZM19.5 19.5h.75v.75h-.75v-.75ZM16.5 16.5h.75v.75h-.75v-.75Z"}))});t.Z=i},20402:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"}))});t.Z=i},2825:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"}))});t.Z=i},25032:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M16.5 8.25V6a2.25 2.25 0 0 0-2.25-2.25H6A2.25 2.25 0 0 0 3.75 6v8.25A2.25 2.25 0 0 0 6 16.5h2.25m8.25-8.25H18a2.25 2.25 0 0 1 2.25 2.25V18A2.25 2.25 0 0 1 18 20.25h-7.5A2.25 2.25 0 0 1 8.25 18v-1.5m8.25-8.25h-6a2.25 2.25 0 0 0-2.25 2.25v6"}))});t.Z=i},12560:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))});t.Z=i},89651:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"}))});t.Z=i},54515:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M21 12a2.25 2.25 0 0 0-2.25-2.25H15a3 3 0 1 1-6 0H5.25A2.25 2.25 0 0 0 3 12m18 0v6a2.25 2.25 0 0 1-2.25 2.25H5.25A2.25 2.25 0 0 1 3 18v-6m18 0V9M3 12V9m18 0a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 9m18 0V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v3"}))});t.Z=i},84573:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18 18 6M6 6l12 12"}))});t.Z=i},75752:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M15.97 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1 0 1.06l-4.5 4.5a.75.75 0 1 1-1.06-1.06l3.22-3.22H7.5a.75.75 0 0 1 0-1.5h11.69l-3.22-3.22a.75.75 0 0 1 0-1.06Zm-7.94 9a.75.75 0 0 1 0 1.06l-3.22 3.22H16.5a.75.75 0 0 1 0 1.5H4.81l3.22 3.22a.75.75 0 1 1-1.06 1.06l-4.5-4.5a.75.75 0 0 1 0-1.06l4.5-4.5a.75.75 0 0 1 1.06 0Z",clipRule:"evenodd"}))});t.Z=i},90196:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M8.603 3.799A4.49 4.49 0 0 1 12 2.25c1.357 0 2.573.6 3.397 1.549a4.49 4.49 0 0 1 3.498 1.307 4.491 4.491 0 0 1 1.307 3.497A4.49 4.49 0 0 1 21.75 12a4.49 4.49 0 0 1-1.549 3.397 4.491 4.491 0 0 1-1.307 3.497 4.491 4.491 0 0 1-3.497 1.307A4.49 4.49 0 0 1 12 21.75a4.49 4.49 0 0 1-3.397-1.549 4.49 4.49 0 0 1-3.498-1.306 4.491 4.491 0 0 1-1.307-3.498A4.49 4.49 0 0 1 2.25 12c0-1.357.6-2.573 1.549-3.397a4.49 4.49 0 0 1 1.307-3.497 4.49 4.49 0 0 1 3.497-1.307Zm7.007 6.387a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))});t.Z=i},14340:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm13.36-1.814a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))});t.Z=i},54621:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{d:"M10.5 18.75a.75.75 0 0 0 0 1.5h3a.75.75 0 0 0 0-1.5h-3Z"}),n.createElement("path",{fillRule:"evenodd",d:"M8.625.75A3.375 3.375 0 0 0 5.25 4.125v15.75a3.375 3.375 0 0 0 3.375 3.375h6.75a3.375 3.375 0 0 0 3.375-3.375V4.125A3.375 3.375 0 0 0 15.375.75h-6.75ZM7.5 4.125C7.5 3.504 8.004 3 8.625 3H9.75v.375c0 .621.504 1.125 1.125 1.125h2.25c.621 0 1.125-.504 1.125-1.125V3h1.125c.621 0 1.125.504 1.125 1.125v15.75c0 .621-.504 1.125-1.125 1.125h-6.75A1.125 1.125 0 0 1 7.5 19.875V4.125Z",clipRule:"evenodd"}))});t.Z=i},79314:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M9 1.5H5.625c-1.036 0-1.875.84-1.875 1.875v17.25c0 1.035.84 1.875 1.875 1.875h12.75c1.035 0 1.875-.84 1.875-1.875V12.75A3.75 3.75 0 0 0 16.5 9h-1.875a1.875 1.875 0 0 1-1.875-1.875V5.25A3.75 3.75 0 0 0 9 1.5Zm6.61 10.936a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 14.47a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}),n.createElement("path",{d:"M12.971 1.816A5.23 5.23 0 0 1 14.25 5.25v1.875c0 .207.168.375.375.375H16.5a5.23 5.23 0 0 1 3.434 1.279 9.768 9.768 0 0 0-6.963-6.963Z"}))});t.Z=i},27762:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M4.5 3.75a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h15a3 3 0 0 0 3-3V6.75a3 3 0 0 0-3-3h-15Zm4.125 3a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5Zm-3.873 8.703a4.126 4.126 0 0 1 7.746 0 .75.75 0 0 1-.351.92 7.47 7.47 0 0 1-3.522.877 7.47 7.47 0 0 1-3.522-.877.75.75 0 0 1-.351-.92ZM15 8.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15ZM14.25 12a.75.75 0 0 1 .75-.75h3.75a.75.75 0 0 1 0 1.5H15a.75.75 0 0 1-.75-.75Zm.75 2.25a.75.75 0 0 0 0 1.5h3.75a.75.75 0 0 0 0-1.5H15Z",clipRule:"evenodd"}))});t.Z=i},75514:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 0 0-5.25 5.25v3a3 3 0 0 0-3 3v6.75a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3v-6.75a3 3 0 0 0-3-3v-3c0-2.9-2.35-5.25-5.25-5.25Zm3.75 8.25v-3a3.75 3.75 0 1 0-7.5 0v3h7.5Z",clipRule:"evenodd"}))});t.Z=i},29765:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M1.5 4.5a3 3 0 0 1 3-3h1.372c.86 0 1.61.586 1.819 1.42l1.105 4.423a1.875 1.875 0 0 1-.694 1.955l-1.293.97c-.135.101-.164.249-.126.352a11.285 11.285 0 0 0 6.697 6.697c.103.038.25.009.352-.126l.97-1.293a1.875 1.875 0 0 1 1.955-.694l4.423 1.105c.834.209 1.42.959 1.42 1.82V19.5a3 3 0 0 1-3 3h-2.25C8.552 22.5 1.5 15.448 1.5 6.75V4.5Z",clipRule:"evenodd"}))});t.Z=i},24167:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12Zm11.378-3.917c-.89-.777-2.366-.777-3.255 0a.75.75 0 0 1-.988-1.129c1.454-1.272 3.776-1.272 5.23 0 1.513 1.324 1.513 3.518 0 4.842a3.75 3.75 0 0 1-.837.552c-.676.328-1.028.774-1.028 1.152v.75a.75.75 0 0 1-1.5 0v-.75c0-1.279 1.06-2.107 1.875-2.502.182-.088.351-.199.503-.331.83-.727.83-1.857 0-2.584ZM12 18a.75.75 0 1 0 0-1.5.75.75 0 0 0 0 1.5Z",clipRule:"evenodd"}))});t.Z=i},5620:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M12.516 2.17a.75.75 0 0 0-1.032 0 11.209 11.209 0 0 1-7.877 3.08.75.75 0 0 0-.722.515A12.74 12.74 0 0 0 2.25 9.75c0 5.942 4.064 10.933 9.563 12.348a.749.749 0 0 0 .374 0c5.499-1.415 9.563-6.406 9.563-12.348 0-1.39-.223-2.73-.635-3.985a.75.75 0 0 0-.722-.516l-.143.001c-2.996 0-5.717-1.17-7.734-3.08Zm3.094 8.016a.75.75 0 1 0-1.22-.872l-3.236 4.53L9.53 12.22a.75.75 0 0 0-1.06 1.06l2.25 2.25a.75.75 0 0 0 1.14-.094l3.75-5.25Z",clipRule:"evenodd"}))});t.Z=i},61652:function(e,t,r){"use strict";var n=r(2265);let i=n.forwardRef(function(e,t){let{title:r,titleId:i,...s}=e;return n.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:t,"aria-labelledby":i},s),r?n.createElement("title",{id:i},r):null,n.createElement("path",{fillRule:"evenodd",d:"M12 2.25c-5.385 0-9.75 4.365-9.75 9.75s4.365 9.75 9.75 9.75 9.75-4.365 9.75-9.75S17.385 2.25 12 2.25Zm-1.72 6.97a.75.75 0 1 0-1.06 1.06L10.94 12l-1.72 1.72a.75.75 0 1 0 1.06 1.06L12 13.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L13.06 12l1.72-1.72a.75.75 0 1 0-1.06-1.06L12 10.94l-1.72-1.72Z",clipRule:"evenodd"}))});t.Z=i},59956:function(e,t,r){"use strict";r.d(t,{Nc:function(){return d}});var n=r(57437),i=r(2265);let s=(0,i.forwardRef)((e,t)=>{let{as:r="div",...i}=e;return(0,n.jsx)(r,{...i,ref:t})}),o="cf-turnstile-script",a="onloadTurnstileCallback",l=e=>!!document.getElementById(e),u=e=>{let{render:t="explicit",onLoadCallbackName:r=a,scriptOptions:{nonce:n="",defer:i=!0,async:s=!0,id:u="",appendTo:c,onError:d,crossOrigin:h=""}={}}=e,f=u||o;if(l(f))return;let p=document.createElement("script");p.id=f,p.src="".concat("https://challenges.cloudflare.com/turnstile/v0/api.js","?onload=").concat(r,"&render=").concat(t),document.querySelector('script[src="'.concat(p.src,'"]'))||(p.defer=!!i,p.async=!!s,n&&(p.nonce=n),h&&(p.crossOrigin=h),d&&(p.onerror=d),("body"===c?document.body:document.getElementsByTagName("head")[0]).appendChild(p))},c={normal:{width:300,height:65},compact:{width:130,height:120},invisible:{width:0,height:0,overflow:"hidden"},interactionOnly:{width:"fit-content",height:"auto"}},d=(0,i.forwardRef)((e,t)=>{var r;let{scriptOptions:d,options:h={},siteKey:f,onWidgetLoad:p,onSuccess:g,onExpire:m,onError:y,onBeforeInteractive:b,onAfterInteractive:v,onUnsupported:w,onLoadScript:_,id:E,style:A,as:x="div",injectScript:k=!0,...S}=e,$=null!==(r=h.size)&&void 0!==r?r:"normal",[C,P]=(0,i.useState)("execute"===h.execution?c.invisible:"interaction-only"===h.appearance?c.interactionOnly:c[$]),I=(0,i.useRef)(null),O=(0,i.useRef)(!1),[N,M]=(0,i.useState)(),[R,T]=(0,i.useState)(!1),D=null!=E?E:"cf-turnstile",L=k?(null==d?void 0:d.id)||"".concat(o,"__").concat(D):(null==d?void 0:d.id)||o,j=function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:o,[t,r]=(0,i.useState)(!1);return(0,i.useEffect)(()=>{let t=()=>{l(e)&&r(!0)},n=new MutationObserver(t);return n.observe(document,{childList:!0,subtree:!0}),t(),()=>{n.disconnect()}},[e]),t}(L),B=(null==d?void 0:d.onLoadCallbackName)?"".concat(d.onLoadCallbackName,"__").concat(D):"".concat(a,"__").concat(D),F=(0,i.useMemo)(()=>{var e,t,r,n,i,s,o;let a;return{sitekey:f,action:h.action,cData:h.cData,callback:g,"error-callback":y,"expired-callback":m,"before-interactive-callback":b,"after-interactive-callback":v,"unsupported-callback":w,theme:null!==(e=h.theme)&&void 0!==e?e:"auto",language:null!==(t=h.language)&&void 0!==t?t:"auto",tabindex:h.tabIndex,"response-field":h.responseField,"response-field-name":h.responseFieldName,size:("invisible"!==$&&(a=$),a),retry:null!==(r=h.retry)&&void 0!==r?r:"auto","retry-interval":null!==(n=h.retryInterval)&&void 0!==n?n:8e3,"refresh-expired":null!==(i=h.refreshExpired)&&void 0!==i?i:"auto",execution:null!==(s=h.execution)&&void 0!==s?s:"render",appearance:null!==(o=h.appearance)&&void 0!==o?o:"always"}},[f,h,g,y,m,$,b,v,w]),U=(0,i.useMemo)(()=>JSON.stringify(F),[F]);return(0,i.useImperativeHandle)(t,()=>{if("undefined"==typeof window||!j)return;let{turnstile:e}=window;return{getResponse(){if(!(null==e?void 0:e.getResponse)||!N){console.warn("Turnstile has not been loaded");return}return e.getResponse(N)},reset(){if(!(null==e?void 0:e.reset)||!N){console.warn("Turnstile has not been loaded");return}"execute"===h.execution&&P(c.invisible);try{e.reset(N)}catch(e){console.warn("Failed to reset Turnstile widget ".concat(N),e)}},remove(){if(!(null==e?void 0:e.remove)||!N){console.warn("Turnstile has not been loaded");return}M(""),P(c.invisible),e.remove(N)},render(){if(!(null==e?void 0:e.render)||!I.current||N){console.warn("Turnstile has not been loaded or widget already rendered");return}let t=e.render(I.current,F);return M(t),"execute"!==h.execution&&P(c[$]),t},execute(){if("execute"===h.execution){if(!(null==e?void 0:e.execute)||!I.current||!N){console.warn("Turnstile has not been loaded or widget has not been rendered");return}e.execute(I.current,F),P(c[$])}},isExpired(){if(!(null==e?void 0:e.isExpired)||!N){console.warn("Turnstile has not been loaded");return}return e.isExpired(N)}}},[j,N,h.execution,$,F,I]),(0,i.useEffect)(()=>(window[B]=()=>T(!0),()=>{delete window[B]}),[B]),(0,i.useEffect)(()=>{k&&!R&&u({onLoadCallbackName:B,scriptOptions:{...d,id:L}})},[k,R,B,d,L]),(0,i.useEffect)(()=>{j&&!R&&window.turnstile&&T(!0)},[R,j]),(0,i.useEffect)(()=>{if(!f){console.warn("sitekey was not provided");return}j&&I.current&&R&&!O.current&&(M(window.turnstile.render(I.current,F)),O.current=!0)},[j,f,F,O,R]),(0,i.useEffect)(()=>{window.turnstile&&I.current&&N&&(l(N)&&window.turnstile.remove(N),M(window.turnstile.render(I.current,F)),O.current=!0)},[U,f]),(0,i.useEffect)(()=>{if(window.turnstile&&N&&l(N))return null==p||p(N),()=>{window.turnstile.remove(N)}},[N,p]),(0,i.useEffect)(()=>{P("execute"===h.execution?c.invisible:"interaction-only"===F.appearance?c.interactionOnly:c[$])},[h.execution,$,F.appearance]),(0,i.useEffect)(()=>{j&&"function"==typeof _&&_()},[j,_]),(0,n.jsx)(s,{ref:I,as:x,id:D,style:{...C,...A},...S})});d.displayName="Turnstile"},65376:function(e,t,r){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`positive integer expected, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error(`Uint8Array expected of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)}function o(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.lengthe&t^~e&r,o=(e,t,r)=>e&t^e&r^t&r;class a extends i.kb{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=(0,i.GL)(this.buffer)}update(e){(0,n.Gg)(this);let{view:t,buffer:r,blockLen:s}=this,o=(e=(0,i.O0)(e)).length;for(let n=0;ns-a&&(this.process(r,0),a=0);for(let e=a;e>i&s),a=Number(r&s),l=n?4:0,u=n?0:4;e.setUint32(t+l,o,n),e.setUint32(t+u,a,n)}(r,s-8,BigInt(8*this.length),o),this.process(r,0);let l=(0,i.GL)(e),u=this.outputLen;if(u%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=u/4,d=this.get();if(c>d.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e>>3,s=(0,i.np)(r,17)^(0,i.np)(r,19)^r>>>10;c[e]=s+c[e-7]+n+c[e-16]|0}let{A:r,B:n,C:a,D:u,E:d,F:h,G:f,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.np)(d,6)^(0,i.np)(d,11)^(0,i.np)(d,25))+s(d,h,f)+l[e]+c[e]|0,g=((0,i.np)(r,2)^(0,i.np)(r,13)^(0,i.np)(r,22))+o(r,n,a)|0;p=f,f=h,h=d,d=u+t|0,u=a,a=n,n=r,r=t+g|0}r=r+this.A|0,n=n+this.B|0,a=a+this.C|0,u=u+this.D|0,d=d+this.E|0,h=h+this.F|0,f=f+this.G|0,p=p+this.H|0,this.set(r,n,a,u,d,h,f,p)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let h=(0,i.hE)(()=>new d)},68104:function(e,t,r){"use strict";r.d(t,{kb:function(){return f},l1:function(){return c},eV:function(){return h},GL:function(){return o},iA:function(){return l},O6:function(){return g},np:function(){return a},O0:function(){return d},Jq:function(){return s},hE:function(){return p}});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;var i=r(65376);let s=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),o=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),a=(e,t)=>e<<32-t|e>>>t,l=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],u=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;function c(e){for(let t=0;te().update(d(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function g(e=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}},66862:function(e,t,r){"use strict";function n(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}r.d(t,{xC:function(){return eu},oM:function(){return ep}});var i,s,o="function"==typeof Symbol&&Symbol.observable||"@@observable",a=()=>Math.random().toString(36).substring(7).split("").join("."),l={INIT:`@@redux/INIT${a()}`,REPLACE:`@@redux/REPLACE${a()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${a()}`};function u(e){if("object"!=typeof e||null===e)return!1;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||null===Object.getPrototypeOf(e)}function c(...e){return 0===e.length?e=>e:1===e.length?e[0]:e.reduce((e,t)=>(...r)=>e(t(...r)))}function d(e){return({dispatch:t,getState:r})=>n=>i=>"function"==typeof i?i(t,r,e):n(i)}var h=d(),f=Symbol.for("immer-nothing"),p=Symbol.for("immer-draftable"),g=Symbol.for("immer-state");function m(e,...t){throw Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var y=Object.getPrototypeOf;function b(e){return!!e&&!!e[g]}function v(e){return!!e&&(_(e)||Array.isArray(e)||!!e[p]||!!e.constructor?.[p]||S(e)||$(e))}var w=Object.prototype.constructor.toString();function _(e){if(!e||"object"!=typeof e)return!1;let t=y(e);if(null===t)return!0;let r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;return r===Object||"function"==typeof r&&Function.toString.call(r)===w}function E(e,t){0===A(e)?Reflect.ownKeys(e).forEach(r=>{t(r,e[r],e)}):e.forEach((r,n)=>t(n,r,e))}function A(e){let t=e[g];return t?t.type_:Array.isArray(e)?1:S(e)?2:$(e)?3:0}function x(e,t){return 2===A(e)?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function k(e,t,r){let n=A(e);2===n?e.set(t,r):3===n?e.add(r):e[t]=r}function S(e){return e instanceof Map}function $(e){return e instanceof Set}function C(e){return e.copy_||e.base_}function P(e,t){if(S(e))return new Map(e);if($(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);let r=_(e);if(!0!==t&&("class_only"!==t||r)){let t=y(e);return null!==t&&r?{...e}:Object.assign(Object.create(t),e)}{let t=Object.getOwnPropertyDescriptors(e);delete t[g];let r=Reflect.ownKeys(t);for(let n=0;n1&&(e.set=e.add=e.clear=e.delete=O),Object.freeze(e),t&&Object.entries(e).forEach(([e,t])=>I(t,!0))),e}function O(){m(2)}function N(e){return Object.isFrozen(e)}var M={};function R(e){let t=M[e];return t||m(0,e),t}function T(e,t){t&&(R("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function D(e){L(e),e.drafts_.forEach(B),e.drafts_=null}function L(e){e===s&&(s=e.parent_)}function j(e){return s={drafts_:[],parent_:s,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function B(e){let t=e[g];0===t.type_||1===t.type_?t.revoke_():t.revoked_=!0}function F(e,t){t.unfinalizedDrafts_=t.drafts_.length;let r=t.drafts_[0];return void 0!==e&&e!==r?(r[g].modified_&&(D(t),m(4)),v(e)&&(e=U(t,e),t.parent_||q(t,e)),t.patches_&&R("Patches").generateReplacementPatches_(r[g].base_,e,t.patches_,t.inversePatches_)):e=U(t,r,[]),D(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==f?e:void 0}function U(e,t,r){if(N(t))return t;let n=t[g];if(!n)return E(t,(i,s)=>z(e,n,t,i,s,r)),t;if(n.scope_!==e)return t;if(!n.modified_)return q(e,n.base_,!0),n.base_;if(!n.finalized_){n.finalized_=!0,n.scope_.unfinalizedDrafts_--;let t=n.copy_,i=t,s=!1;3===n.type_&&(i=new Set(t),t.clear(),s=!0),E(i,(i,o)=>z(e,n,t,i,o,r,s)),q(e,t,!1),r&&e.patches_&&R("Patches").generatePatches_(n,r,e.patches_,e.inversePatches_)}return n.copy_}function z(e,t,r,n,i,s,o){if(b(i)){let o=U(e,i,s&&t&&3!==t.type_&&!x(t.assigned_,n)?s.concat(n):void 0);if(k(r,n,o),!b(o))return;e.canAutoFreeze_=!1}else o&&r.add(i);if(v(i)&&!N(i)){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1)return;U(e,i),(!t||!t.scope_.parent_)&&"symbol"!=typeof n&&Object.prototype.propertyIsEnumerable.call(r,n)&&q(e,i)}}function q(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&I(t,r)}var H={get(e,t){if(t===g)return e;let r=C(e);if(!x(r,t))return function(e,t,r){let n=W(t,r);return n?"value"in n?n.value:n.get?.call(e.draft_):void 0}(e,r,t);let n=r[t];return e.finalized_||!v(n)?n:n===V(e.base_,t)?(Y(e),e.copy_[t]=Z(n,e)):n},has:(e,t)=>t in C(e),ownKeys:e=>Reflect.ownKeys(C(e)),set(e,t,r){let n=W(C(e),t);if(n?.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){let n=V(C(e),t),i=n?.[g];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if((r===n?0!==r||1/r==1/n:r!=r&&n!=n)&&(void 0!==r||x(e.base_,t)))return!0;Y(e),K(e)}return!!(e.copy_[t]===r&&(void 0!==r||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t]))||(e.copy_[t]=r,e.assigned_[t]=!0,!0)},deleteProperty:(e,t)=>(void 0!==V(e.base_,t)||t in e.base_?(e.assigned_[t]=!1,Y(e),K(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0),getOwnPropertyDescriptor(e,t){let r=C(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n?{writable:!0,configurable:1!==e.type_||"length"!==t,enumerable:n.enumerable,value:r[t]}:n},defineProperty(){m(11)},getPrototypeOf:e=>y(e.base_),setPrototypeOf(){m(12)}},G={};function V(e,t){let r=e[g];return(r?C(r):e)[t]}function W(e,t){if(!(t in e))return;let r=y(e);for(;r;){let e=Object.getOwnPropertyDescriptor(r,t);if(e)return e;r=y(r)}}function K(e){!e.modified_&&(e.modified_=!0,e.parent_&&K(e.parent_))}function Y(e){e.copy_||(e.copy_=P(e.base_,e.scope_.immer_.useStrictShallowCopy_))}function Z(e,t){let r=S(e)?R("MapSet").proxyMap_(e,t):$(e)?R("MapSet").proxySet_(e,t):function(e,t){let r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:s,modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1},i=n,o=H;r&&(i=[n],o=G);let{revoke:a,proxy:l}=Proxy.revocable(i,o);return n.draft_=l,n.revoke_=a,l}(e,t);return(t?t.scope_:s).drafts_.push(r),r}E(H,(e,t)=>{G[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}}),G.deleteProperty=function(e,t){return G.set.call(this,e,t,void 0)},G.set=function(e,t,r){return H.set.call(this,e[0],t,r,e[0])};var J=new class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.produce=(e,t,r)=>{let n;if("function"==typeof e&&"function"!=typeof t){let r=t;t=e;let n=this;return function(e=r,...i){return n.produce(e,e=>t.call(this,e,...i))}}if("function"!=typeof t&&m(6),void 0!==r&&"function"!=typeof r&&m(7),v(e)){let i=j(this),s=Z(e,void 0),o=!0;try{n=t(s),o=!1}finally{o?D(i):L(i)}return T(i,r),F(n,i)}if(e&&"object"==typeof e)m(1,e);else{if(void 0===(n=t(e))&&(n=e),n===f&&(n=void 0),this.autoFreeze_&&I(n,!0),r){let t=[],i=[];R("Patches").generateReplacementPatches_(e,n,t,i),r(t,i)}return n}},this.produceWithPatches=(e,t)=>{let r,n;return"function"==typeof e?(t,...r)=>this.produceWithPatches(t,t=>e(t,...r)):[this.produce(e,t,(e,t)=>{r=e,n=t}),r,n]},"boolean"==typeof e?.autoFreeze&&this.setAutoFreeze(e.autoFreeze),"boolean"==typeof e?.useStrictShallowCopy&&this.setUseStrictShallowCopy(e.useStrictShallowCopy)}createDraft(e){var t;v(e)||m(8),b(e)&&(b(t=e)||m(10,t),e=function e(t){let r;if(!v(t)||N(t))return t;let n=t[g];if(n){if(!n.modified_)return n.base_;n.finalized_=!0,r=P(t,n.scope_.immer_.useStrictShallowCopy_)}else r=P(t,!0);return E(r,(t,n)=>{k(r,t,e(n))}),n&&(n.finalized_=!1),r}(t));let r=j(this),n=Z(e,void 0);return n[g].isManual_=!0,L(r),n}finishDraft(e,t){let r=e&&e[g];r&&r.isManual_||m(9);let{scope_:n}=r;return T(n,t),F(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){let n=t[r];if(0===n.path.length&&"replace"===n.op){e=n.value;break}}r>-1&&(t=t.slice(r+1));let n=R("Patches").applyPatches_;return b(e)?n(e,t):this.produce(e,e=>n(e,t))}},Q=J.produce;J.produceWithPatches.bind(J),J.setAutoFreeze.bind(J),J.setUseStrictShallowCopy.bind(J),J.applyPatches.bind(J),J.createDraft.bind(J),J.finishDraft.bind(J),r(25566);var X="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(0!=arguments.length)return"object"==typeof arguments[0]?c:c.apply(null,arguments)};"undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__&&window.__REDUX_DEVTOOLS_EXTENSION__;function ee(e,t){function r(...n){if(t){let r=t(...n);if(!r)throw Error(eA(0));return{type:e,payload:r.payload,..."meta"in r&&{meta:r.meta},..."error"in r&&{error:r.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=t=>u(t)&&"type"in t&&"string"==typeof t.type&&t.type===e,r}var et=class e extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,e.prototype)}static get[Symbol.species](){return e}concat(...e){return super.concat.apply(this,e)}prepend(...t){return 1===t.length&&Array.isArray(t[0])?new e(...t[0].concat(this)):new e(...t.concat(this))}};function er(e){return v(e)?Q(e,()=>{}):e}function en(e,t,r){if(e.has(t)){let n=e.get(t);return r.update&&(n=r.update(n,t,e),e.set(t,n)),n}if(!r.insert)throw Error(eA(10));let n=r.insert(t,e);return e.set(t,n),n}var ei=()=>function(e){let{thunk:t=!0,immutableCheck:r=!0,serializableCheck:n=!0,actionCreatorCheck:i=!0}=e??{},s=new et;return t&&("boolean"==typeof t?s.push(h):s.push(d(t.extraArgument))),s},es=e=>t=>{setTimeout(t,e)},eo="undefined"!=typeof window&&window.requestAnimationFrame?window.requestAnimationFrame:es(10),ea=(e={type:"raf"})=>t=>(...r)=>{let n=t(...r),i=!0,s=!1,o=!1,a=new Set,l="tick"===e.type?queueMicrotask:"raf"===e.type?eo:"callback"===e.type?e.queueNotification:es(e.timeout),u=()=>{o=!1,s&&(s=!1,a.forEach(e=>e()))};return Object.assign({},n,{subscribe(e){let t=n.subscribe(()=>i&&e());return a.add(e),()=>{t(),a.delete(e)}},dispatch(e){try{return(s=!(i=!e?.meta?.RTK_autoBatch))&&!o&&(o=!0,l(u)),n.dispatch(e)}finally{i=!0}}})},el=e=>function(t){let{autoBatch:r=!0}=t??{},n=new et(e);return r&&n.push(ea("object"==typeof r?r:void 0)),n};function eu(e){let t,r;let i=ei(),{reducer:s,middleware:a,devTools:d=!0,preloadedState:h,enhancers:f}=e||{};if("function"==typeof s)t=s;else if(u(s))t=function(e){let t;let r=Object.keys(e),i={};for(let t=0;t{let r=e[t];if(void 0===r(void 0,{type:l.INIT}))throw Error(n(12));if(void 0===r(void 0,{type:l.PROBE_UNKNOWN_ACTION()}))throw Error(n(13))})}(i)}catch(e){t=e}return function(e={},r){if(t)throw t;let o=!1,a={};for(let t=0;t(r,i)=>{let s=t(r,i),o=()=>{throw Error(n(15))},a={getState:s.getState,dispatch:(e,...t)=>o(e,...t)};return o=c(...e.map(e=>e(a)))(s.dispatch),{...s,dispatch:o}}}(...r));return function e(t,r,i){if("function"!=typeof t)throw Error(n(2));if("function"==typeof r&&"function"==typeof i||"function"==typeof i&&"function"==typeof arguments[3])throw Error(n(0));if("function"==typeof r&&void 0===i&&(i=r,r=void 0),void 0!==i){if("function"!=typeof i)throw Error(n(1));return i(e)(t,r)}let s=t,a=r,c=new Map,d=c,h=0,f=!1;function p(){d===c&&(d=new Map,c.forEach((e,t)=>{d.set(t,e)}))}function g(){if(f)throw Error(n(3));return a}function m(e){if("function"!=typeof e)throw Error(n(4));if(f)throw Error(n(5));let t=!0;p();let r=h++;return d.set(r,e),function(){if(t){if(f)throw Error(n(6));t=!1,p(),d.delete(r),c=null}}}function y(e){if(!u(e))throw Error(n(7));if(void 0===e.type)throw Error(n(8));if("string"!=typeof e.type)throw Error(n(17));if(f)throw Error(n(9));try{f=!0,a=s(a,e)}finally{f=!1}return(c=d).forEach(e=>{e()}),e}return y({type:l.INIT}),{dispatch:y,subscribe:m,getState:g,replaceReducer:function(e){if("function"!=typeof e)throw Error(n(10));s=e,y({type:l.REPLACE})},[o]:function(){return{subscribe(e){if("object"!=typeof e||null===e)throw Error(n(11));function t(){e.next&&e.next(g())}return t(),{unsubscribe:m(t)}},[o](){return this}}}}}(t,h,p(..."function"==typeof f?f(g):g()))}function ec(e){let t;let r={},n=[],i={addCase(e,t){let n="string"==typeof e?e:e.type;if(!n)throw Error(eA(28));if(n in r)throw Error(eA(29));return r[n]=t,i},addMatcher:(e,t)=>(n.push({matcher:e,reducer:t}),i),addDefaultCase:e=>(t=e,i)};return e(i),[r,n,t]}var ed=(e=21)=>{let t="",r=e;for(;r--;)t+="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW"[64*Math.random()|0];return t},eh=Symbol.for("rtk-slice-createasyncthunk"),ef=((i=ef||{}).reducer="reducer",i.reducerWithPrepare="reducerWithPrepare",i.asyncThunk="asyncThunk",i),ep=function({creators:e}={}){let t=e?.asyncThunk?.[eh];return function(e){let r;let{name:n,reducerPath:i=n}=e;if(!n)throw Error(eA(11));let s=("function"==typeof e.reducers?e.reducers(function(){function e(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return e.withTypes=()=>e,{reducer:e=>Object.assign({[e.name]:(...t)=>e(...t)}[e.name],{_reducerDefinitionType:"reducer"}),preparedReducer:(e,t)=>({_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}),asyncThunk:e}}()):e.reducers)||{},o=Object.keys(s),a={},l={},u={},c=[],d={addCase(e,t){let r="string"==typeof e?e:e.type;if(!r)throw Error(eA(12));if(r in l)throw Error(eA(13));return l[r]=t,d},addMatcher:(e,t)=>(c.push({matcher:e,reducer:t}),d),exposeAction:(e,t)=>(u[e]=t,d),exposeCaseReducer:(e,t)=>(a[e]=t,d)};function h(){let[t={},r=[],n]="function"==typeof e.extraReducers?ec(e.extraReducers):[e.extraReducers],i={...t,...l};return function(e,t){let r;let[n,i,s]=ec(t);if("function"==typeof e)r=()=>er(e());else{let t=er(e);r=()=>t}function o(e=r(),t){let o=[n[t.type],...i.filter(({matcher:e})=>e(t)).map(({reducer:e})=>e)];return 0===o.filter(e=>!!e).length&&(o=[s]),o.reduce((e,r)=>{if(r){if(b(e)){let n=r(e,t);return void 0===n?e:n}if(v(e))return Q(e,e=>r(e,t));{let n=r(e,t);if(void 0===n){if(null===e)return e;throw Error(eA(9))}return n}}return e},e)}return o.getInitialState=r,o}(e.initialState,e=>{for(let t in i)e.addCase(t,i[t]);for(let t of c)e.addMatcher(t.matcher,t.reducer);for(let t of r)e.addMatcher(t.matcher,t.reducer);n&&e.addDefaultCase(n)})}o.forEach(r=>{let i=s[r],o={reducerName:r,type:`${n}/${r}`,createNotation:"function"==typeof e.reducers};"asyncThunk"===i._reducerDefinitionType?function({type:e,reducerName:t},r,n,i){if(!i)throw Error(eA(18));let{payloadCreator:s,fulfilled:o,pending:a,rejected:l,settled:u,options:c}=r,d=i(e,s,c);n.exposeAction(t,d),o&&n.addCase(d.fulfilled,o),a&&n.addCase(d.pending,a),l&&n.addCase(d.rejected,l),u&&n.addMatcher(d.settled,u),n.exposeCaseReducer(t,{fulfilled:o||eg,pending:a||eg,rejected:l||eg,settled:u||eg})}(o,i,d,t):function({type:e,reducerName:t,createNotation:r},n,i){let s,o;if("reducer"in n){if(r&&"reducerWithPrepare"!==n._reducerDefinitionType)throw Error(eA(17));s=n.reducer,o=n.prepare}else s=n;i.addCase(e,s).exposeCaseReducer(t,s).exposeAction(t,o?ee(e,o):ee(e))}(o,i,d)});let f=e=>e,p=new Map;function g(e,t){return r||(r=h()),r(e,t)}function m(){return r||(r=h()),r.getInitialState()}function y(t,r=!1){function n(e){let n=e[t];return void 0===n&&r&&(n=m()),n}function i(t=f){let n=en(p,r,{insert:()=>new WeakMap});return en(n,t,{insert:()=>{let n={};for(let[i,s]of Object.entries(e.selectors??{}))n[i]=function(e,t,r,n){function i(s,...o){let a=t(s);return void 0===a&&n&&(a=r()),e(a,...o)}return i.unwrapped=e,i}(s,t,m,r);return n}})}return{reducerPath:t,getSelectors:i,get selectors(){return i(n)},selectSlice:n}}let w={name:n,reducer:g,actions:u,caseReducers:a,getInitialState:m,...y(i),injectInto(e,{reducerPath:t,...r}={}){let n=t??i;return e.inject({reducerPath:n,reducer:g},r),{...w,...y(n,!0)}}};return w}}();function eg(){}var em=(e,t)=>{if("function"!=typeof e)throw Error(eA(32))},{assign:ey}=Object,eb="listenerMiddleware",ev=e=>{let{type:t,actionCreator:r,matcher:n,predicate:i,effect:s}=e;if(t)i=ee(t).match;else if(r)t=r.type,i=r.match;else if(n)i=n;else if(i);else throw Error(eA(21));return em(s,"options.listener"),{predicate:i,type:t,effect:s}},ew=ey(e=>{let{type:t,predicate:r,effect:n}=ev(e);return{id:ed(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw Error(eA(22))}}},{withTypes:()=>ew}),e_=ey(ee(`${eb}/add`),{withTypes:()=>e_}),eE=ey(ee(`${eb}/remove`),{withTypes:()=>eE});function eA(e){return`Minified Redux Toolkit error #${e}; visit https://redux-toolkit.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}Symbol.for("rtk-state-proxy-original")},43197:function(e,t,r){"use strict";function n(e,t){let r=e.exec(t);return r?.groups}r.d(t,{Zw:function(){return n},cN:function(){return o},eL:function(){return i},lh:function(){return s}});let i=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,s=/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/,o=/^\(.+?\).*?$/},10259:function(e,t,r){"use strict";r.d(t,{ZP:function(){return a}});let n=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,i=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,s=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function o(e,t){if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`);return}return t}function a(e,t={}){if("string"!=typeof e)return e;let r=e.trim();if('"'===e[0]&&e.endsWith('"')&&!e.includes("\\"))return r.slice(1,-1);if(r.length<=9){let e=r.toLowerCase();if("true"===e)return!0;if("false"===e)return!1;if("undefined"===e)return;if("null"===e)return null;if("nan"===e)return Number.NaN;if("infinity"===e)return Number.POSITIVE_INFINITY;if("-infinity"===e)return Number.NEGATIVE_INFINITY}if(!s.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(n.test(e)||i.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,o)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}},36393:function(e,t,r){"use strict";var n=r(37836);t.Z=n},50069:function(e,t,r){"use strict";r.d(t,{g7:function(){return n},xv:function(){return i}});let n=new TextEncoder,i=new TextDecoder},18482:function(e,t,r){"use strict";r.d(t,{J:function(){return a},c:function(){return o}});var n=r(50069);let i=e=>{let t=e;"string"==typeof t&&(t=n.g7.encode(t));let r=[];for(let e=0;e{let t=atob(e),r=new Uint8Array(t.length);for(let e=0;ei(e).replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_"),a=e=>{let t=e;t instanceof Uint8Array&&(t=n.xv.decode(t)),t=t.replace(/-/g,"+").replace(/_/g,"/").replace(/\s/g,"");try{return s(t)}catch(e){throw TypeError("The input to be decoded is not correctly encoded.")}}},9648:function(e,t,r){"use strict";r.d(t,{t:function(){return a}});var n=r(18482),i=r(50069);class s extends Error{static get code(){return"ERR_JOSE_GENERIC"}constructor(e){var t;super(e),this.code="ERR_JOSE_GENERIC",this.name=this.constructor.name,null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,this.constructor)}}class o extends s{constructor(){super(...arguments),this.code="ERR_JWT_INVALID"}static get code(){return"ERR_JWT_INVALID"}}function a(e){let t,r;if("string"!=typeof e)throw new o("JWTs must use Compact JWS serialization, JWT must be a string");let{1:s,length:a}=e.split(".");if(5===a)throw new o("Only JWTs using Compact JWS serialization can be decoded");if(3!==a)throw new o("Invalid JWT");if(!s)throw new o("JWTs must contain a payload");try{t=(0,n.J)(s)}catch(e){throw new o("Failed to base64url decode the payload")}try{r=JSON.parse(i.xv.decode(t))}catch(e){throw new o("Failed to parse the decoded payload as JSON")}if(!function(e){if(!("object"==typeof e&&null!==e)||"[object Object]"!==Object.prototype.toString.call(e))return!1;if(null===Object.getPrototypeOf(e))return!0;let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(r))throw new o("Invalid JWT Claims Set");return r}},44785:function(e,t,r){"use strict";/*! js-cookie v3.0.5 | MIT */function n(e){for(var t=1;te.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e);!(r=n()).done;){var i=r.value;if(i.leadingDigitsPatterns().length>0){var o=i.leadingDigitsPatterns()[i.leadingDigitsPatterns().length-1];if(0!==t.search(o))continue}if((0,s.Z)(t,i.pattern()))return i}}(n.formats(),e);return o?(0,a.Z)(e,o,{useInternationalFormat:"INTERNATIONAL"===r,withNationalPrefix:!o.nationalPrefixIsOptionalWhenFormattingInNationalFormat()||!i||!1!==i.nationalPrefix,carrierCode:t,metadata:n}):e}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function g(e){for(var t=1;t=0}):[])}},{key:"isPossible",value:function(){return(0,i.Z)(this,{v2:!0},this.getMetadata())}},{key:"isValid",value:function(){return function(e,t,r){if(t=t||{},(r=new n.ZP(r)).selectNumberingPlan(e.country,e.countryCallingCode),r.hasTypes())return void 0!==(0,o.Z)(e,t,r.metadata);var i=t.v2?e.nationalNumber:e.phone;return(0,s.Z)(i,r.nationalNumberPattern())}(this,{v2:!0},this.getMetadata())}},{key:"isNonGeographic",value:function(){return new n.ZP(this.getMetadata()).isNonGeographicCallingCode(this.countryCallingCode)}},{key:"isEqual",value:function(e){return this.number===e.number&&this.ext===e.ext}},{key:"getType",value:function(){return(0,o.Z)(this,{v2:!0},this.getMetadata())}},{key:"format",value:function(e,t){return function(e,t,r,i){if(r=r?d(d({},h),r):h,i=new n.ZP(i),e.country&&"001"!==e.country){if(!i.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));i.country(e.country)}else{if(!e.countryCallingCode)return e.phone||"";i.selectNumberingPlan(e.countryCallingCode)}var s,o,a,u,c,p,g,m,y,b,v,w,_,E=i.countryCallingCode(),A=r.v2?e.nationalNumber:e.phone;switch(t){case"NATIONAL":if(!A)return"";return s=_=f(A,e.carrierCode,"NATIONAL",i,r),o=e.ext,a=i,u=r.formatExtension,o?u(s,o,a):s;case"INTERNATIONAL":if(!A)return"+".concat(E);return _=f(A,null,"INTERNATIONAL",i,r),c=_="+".concat(E," ").concat(_),p=e.ext,g=i,m=r.formatExtension,p?m(c,p,g):c;case"E.164":return"+".concat(E).concat(A);case"RFC3966":return function(e){var t=e.number,r=e.ext;if(!t)return"";if("+"!==t[0])throw Error('"formatRFC3966()" expects "number" to be in E.164 format.');return"tel:".concat(t).concat(r?";ext="+r:"")}({number:"+".concat(E).concat(A),ext:e.ext});case"IDD":if(!r.fromCountry)return;return y=function(e,t,r,i,s){if((0,n.Gg)(i,s.metadata)===r){var o,a,u,c=f(e,t,"NATIONAL",s);return"1"===r?r+" "+c:c}var d=(o=void 0,a=s.metadata,((u=new n.ZP(a)).selectNumberingPlan(i,o),u.defaultIDDPrefix())?u.defaultIDDPrefix():l.test(u.IDDPrefix())?u.IDDPrefix():void 0);if(d)return"".concat(d," ").concat(r," ").concat(f(e,null,"INTERNATIONAL",s))}(A,e.carrierCode,E,r.fromCountry,i),b=e.ext,v=i,w=r.formatExtension,b?w(y,b,v):y;default:throw Error('Unknown "format" argument passed to "formatNumber()": "'.concat(t,'"'))}}(this,e,t?g(g({},t),{},{v2:!0}):{v2:!0},this.getMetadata())}},{key:"formatNational",value:function(e){return this.format("NATIONAL",e)}},{key:"formatInternational",value:function(e){return this.format("INTERNATIONAL",e)}},{key:"getURI",value:function(e){return this.format("RFC3966",e)}}],function(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(t);!(r=s()).done;){var o=r.value;0>e.indexOf(o)&&i.push(o)}return i.sort(function(e,t){return e-t})}(o,a.possibleLengths()))}else if(r&&!s)return"INVALID_LENGTH";var l=t.length,u=o[0];return u===l?"IS_POSSIBLE":u>l?"TOO_SHORT":o[o.length-1]=0?"IS_POSSIBLE":"INVALID_LENGTH"}(e,void 0,t)}r.d(t,{Z:function(){return i}})},52586:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(72924),i=r(3238),s=r(31767),o=r(13399);function a(e,t,r,a){if(!e)return{};if("+"!==e[0]){var l,u=(0,n.Z)(e,t,r,a);if(u&&u!==e)l=!0,e="+"+u;else{if(t||r){var c=(0,i.Z)(e,t,r,a),d=c.countryCallingCode,h=c.number;if(d)return{countryCallingCodeSource:"FROM_NUMBER_WITHOUT_PLUS_SIGN",countryCallingCode:d,number:h}}return{number:e}}}if("0"===e[1])return{};a=new s.ZP(a);for(var f=2;f-1<=o.xg&&f<=e.length;){var p=e.slice(1,f);if(a.hasCallingCode(p))return a.selectNumberingPlan(p),{countryCallingCodeSource:l?"FROM_NUMBER_WITH_IDD":"FROM_NUMBER_WITH_PLUS_SIGN",countryCallingCode:p,number:e.slice(f)};f++}return{}}},3238:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(31767),i=r(69496),s=r(11264),o=r(23419);function a(e,t,r,a){var l=t?(0,n.Gg)(t,a):r;if(0===e.indexOf(l)){(a=new n.ZP(a)).selectNumberingPlan(t,r);var u=e.slice(l.length),c=(0,s.Z)(u,a).nationalNumber,d=(0,s.Z)(e,a).nationalNumber;if(!(0,i.Z)(d,a.nationalNumberPattern())&&(0,i.Z)(c,a.nationalNumberPattern())||"TOO_LONG"===(0,o.Z)(d,a))return{countryCallingCode:l,number:u}}return{number:e}}},11264:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(30196),i=r(69496),s=r(23419);function o(e,t){var r=(0,n.Z)(e,t),o=r.carrierCode,a=r.nationalNumber;return a!==e&&(!(!(0,i.Z)(e,t.nationalNumberPattern())||(0,i.Z)(a,t.nationalNumberPattern()))||t.possibleLengths()&&!function(e,t){switch((0,s.Z)(e,t)){case"TOO_SHORT":case"INVALID_LENGTH":return!1;default:return!0}}(a,t))?{nationalNumber:e}:{nationalNumber:a,carrierCode:o}}},30196:function(e,t,r){"use strict";function n(e,t){if(e&&t.numberingPlan.nationalPrefixForParsing()){var r=RegExp("^(?:"+t.numberingPlan.nationalPrefixForParsing()+")"),n=r.exec(e);if(n){var i,s,o,a=n.length-1,l=a>0&&n[a];if(t.nationalPrefixTransformRule()&&l)i=e.replace(r,t.nationalPrefixTransformRule()),a>1&&(s=n[1]);else{var u=n[0];i=e.slice(u.length),l&&(s=n[1])}if(l){var c=e.indexOf(n[1]);e.slice(0,c)===t.numberingPlan.nationalPrefix()&&(o=t.numberingPlan.nationalPrefix())}else o=n[0];return{nationalNumber:i,nationalPrefix:o,carrierCode:s}}}return{nationalNumber:e}}r.d(t,{Z:function(){return n}})},71669:function(e,t,r){"use strict";r.d(t,{Z:function(){return s},i:function(){return i}});var n=r(90263),i=/(\$\d)/;function s(e,t,r){var s=r.useInternationalFormat,o=r.withNationalPrefix;r.carrierCode,r.metadata;var a=e.replace(new RegExp(t.pattern()),s?t.internationalFormat():o&&t.nationalPrefixFormattingRule()?t.format().replace(i,t.nationalPrefixFormattingRule()):t.format());return s?(0,n.Z)(a):a}},81271:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(79092);function i(e,t){var r=t.nationalNumber,i=t.defaultCountry,s=t.metadata,o=s.getCountryCodesForCallingCode(e);return o?1===o.length?o[0]:(0,n.Z)(r,{countries:o,defaultCountry:i,metadata:s.metadata}):void 0}},79092:function(e,t,r){"use strict";r.d(t,{Z:function(){return o}});var n=r(31767),i=r(46587);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r);!(l=c()).done;){var d=l.value;if(a.country(d),a.leadingDigits()){if(e&&0===e.search(a.leadingDigits()))return d}else if((0,i.Z)({phone:e,country:d},void 0,a.metadata)){if(!o||d===o)return d;u.push(d)}}if(u.length>0)return u[0]}},46587:function(e,t,r){"use strict";r.d(t,{Z:function(){return a}});var n=r(31767),i=r(69496);function s(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(o);!(u=c()).done;){var d=u.value;if(l(a,d,r))return d}}}}function l(e,t,r){return!(!(t=r.type(t))||!t.pattern()||t.possibleLengths()&&0>t.possibleLengths().indexOf(e.length))&&(0,i.Z)(e,t.pattern())}},84667:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n={}.constructor;function i(e){return null!=e&&e.constructor===n}},69496:function(e,t,r){"use strict";function n(e,t){return e=e||"",RegExp("^(?:"+t+")$").test(e)}r.d(t,{Z:function(){return n}})},43829:function(e,t,r){"use strict";function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[i++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=s()).done;){var o=i[t.value];o&&(r+=o)}return r}},72924:function(e,t,r){"use strict";r.d(t,{Z:function(){return s}});var n=r(31767),i=RegExp("(["+r(13399).xc+"])");function s(e,t,r,s){if(t){var o=new n.ZP(s);o.selectNumberingPlan(t,r);var a=new RegExp(o.IDDPrefix());if(0===e.search(a)){var l=(e=e.slice(e.match(a)[0].length)).match(i);if(!l||null==l[1]||!(l[1].length>0)||"0"!==l[1])return e}}}},59105:function(e,t,r){"use strict";r.d(t,{D:function(){return o},Z:function(){return s}});var n=r(31767),i=r(23419);function s(e,t,r){if(void 0===t&&(t={}),r=new n.ZP(r),t.v2){if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}else{if(!e.phone)return!1;if(e.country){if(!r.hasCountry(e.country))throw Error("Unknown country: ".concat(e.country));r.country(e.country)}else{if(!e.countryCallingCode)throw Error("Invalid phone number object passed");r.selectNumberingPlan(e.countryCallingCode)}}if(r.possibleLengths())return o(e.phone||e.nationalNumber,r);if(e.countryCallingCode&&r.isNonGeographicCallingCode(e.countryCallingCode))return!0;throw Error('Missing "possibleLengths" in metadata. Perhaps the metadata has been generated before v1.0.18.')}function o(e,t){return"IS_POSSIBLE"===(0,i.Z)(e,t)}},31767:function(e,t,r){"use strict";function n(e,t){e=e.split("-"),t=t.split("-");for(var r=e[0].split("."),n=t[0].split("."),i=0;i<3;i++){var s=Number(r[i]),o=Number(n[i]);if(s>o)return 1;if(o>s)return -1;if(!isNaN(s)&&isNaN(o))return 1;if(isNaN(s)&&!isNaN(o))return -1}return e[1]&&t[1]?e[1]>t[1]?1:e[1]e.length)&&(t=e.length);for(var r=0,n=Array(t);r1;)1&t&&(r+=e),t>>=1,e+=e;return r+e}function c(e,t){return")"===e[t]&&t++,function(e){for(var t=[],r=0;r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function w(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:{},r=t.allowOverflow;if(!e)throw Error("String is required");var n=function e(t,r,n){if("string"==typeof r){var i=t.join("");return 0===r.indexOf(i)?t.length===r.length?{match:!0,matchedChars:t}:{partialMatch:!0}:0===i.indexOf(r)?n&&t.length>r.length?{overflow:!0}:{match:!0,matchedChars:t.slice(0,r.length)}:void 0}if(Array.isArray(r)){for(var s=t.slice(),o=0;o=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function k(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r=0)){var r=this.getTemplateForFormat(e,t);if(r)return this.setNationalNumberTemplate(r,t),!0}}},{key:"getSeparatorAfterNationalPrefix",value:function(e){return this.isNANP||e&&e.nationalPrefixFormattingRule()&&$.test(e.nationalPrefixFormattingRule())?" ":""}},{key:"getInternationalPrefixBeforeCountryCallingCode",value:function(e,t){var r=e.IDDPrefix,n=e.missingPlus;return r?t&&!1===t.spacing?r:r+" ":n?"":"+"}},{key:"getTemplate",value:function(e){if(this.template){for(var t=-1,r=0,n=e.international?this.getInternationalPrefixBeforeCountryCallingCode(e,{spacing:!1}):"";rl.length)){var c=RegExp("^"+a+"$"),d=n.replace(/\d/g,"9");c.test(d)&&(l=d);var p=this.getFormatFormat(e,i);if(this.shouldTryNationalPrefixFormattingRule(e,{international:i,nationalPrefix:s})){var g=p.replace(f.i,e.nationalPrefixFormattingRule());if((0,h.ZP)(e.nationalPrefixFormattingRule())===(s||"")+(0,h.ZP)("$1")&&(p=g,r=!0,s))for(var m=s.length;m>0;)p=p.replace(/\d/,"x"),m--}var y=l.replace(new RegExp(a),p).replace(/9/g,"x");return!r&&(o?y=u("x",o.length)+" "+y:s&&(y=u("x",s.length)+this.getSeparatorAfterNationalPrefix(e)+y)),i&&(y=(0,A.Z)(y)),y}}},{key:"formatNextNationalNumberDigits",value:function(e){var t=function(e,t,r){for(var n,i=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return a(e,void 0);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return a(e,void 0)}}(e))){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(r.split(""));!(n=i()).done;){var s=n.value;if(0>e.slice(t+1).search(l))return;t=e.search(l),e=e.replace(l,s)}return[e,t]}(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition,e);if(!t){this.resetFormat();return}return this.populatedNationalNumberTemplate=t[0],this.populatedNationalNumberTemplatePosition=t[1],c(this.populatedNationalNumberTemplate,this.populatedNationalNumberTemplatePosition+1)}},{key:"shouldTryNationalPrefixFormattingRule",value:function(e,t){var r=t.international,n=t.nationalPrefix;if(e.nationalPrefixFormattingRule()){var i=e.usesNationalPrefix();if(i&&n||!i&&!r)return!0}}}],function(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r=3;if(t.appendDigits(e),n&&this.extractIddPrefix(t),this.isWaitingForCountryCallingCode(t)){if(!this.extractCountryCallingCode(t))return}else t.appendNationalSignificantNumberDigits(e);t.international||this.hasExtractedNationalSignificantNumber||this.extractNationalSignificantNumber(t.getNationalDigits(),function(e){return t.update(e)})}},{key:"isWaitingForCountryCallingCode",value:function(e){var t=e.international,r=e.callingCode;return t&&!r}},{key:"extractCountryCallingCode",value:function(e){var t=(0,I.Z)("+"+e.getDigitsWithoutInternationalPrefix(),this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode,n=t.number;if(r)return e.setCallingCode(r),e.update({nationalSignificantNumber:n}),!0}},{key:"reset",value:function(e){if(e){this.hasSelectedNumberingPlan=!0;var t=e._nationalPrefixForParsing();this.couldPossiblyExtractAnotherNationalSignificantNumber=t&&B.test(t)}else this.hasSelectedNumberingPlan=void 0,this.couldPossiblyExtractAnotherNationalSignificantNumber=void 0}},{key:"extractNationalSignificantNumber",value:function(e,t){if(this.hasSelectedNumberingPlan){var r=(0,N.Z)(e,this.metadata),n=r.nationalPrefix,i=r.nationalNumber,s=r.carrierCode;if(i!==e)return this.onExtractedNationalNumber(n,s,i,e,t),!0}}},{key:"extractAnotherNationalSignificantNumber",value:function(e,t,r){if(!this.hasExtractedNationalSignificantNumber)return this.extractNationalSignificantNumber(e,r);if(this.couldPossiblyExtractAnotherNationalSignificantNumber){var n=(0,N.Z)(e,this.metadata),i=n.nationalPrefix,s=n.nationalNumber,o=n.carrierCode;if(s!==t)return this.onExtractedNationalNumber(i,o,s,e,r),!0}}},{key:"onExtractedNationalNumber",value:function(e,t,r,n,i){var s,o,a=n.lastIndexOf(r);if(a>=0&&a===n.length-r.length){o=!0;var l=n.slice(0,a);l!==e&&(s=l)}i({nationalPrefix:e,carrierCode:t,nationalSignificantNumber:r,nationalSignificantNumberMatchesInput:o,complexPrefixBeforeNationalSignificantNumber:s}),this.hasExtractedNationalSignificantNumber=!0,this.onNationalSignificantNumberChange()}},{key:"reExtractNationalSignificantNumber",value:function(e){return!!this.extractAnotherNationalSignificantNumber(e.getNationalDigits(),e.nationalSignificantNumber,function(t){return e.update(t)})||(this.extractIddPrefix(e)||this.fixMissingPlus(e)?(this.extractCallingCodeAndNationalSignificantNumber(e),!0):void 0)}},{key:"extractIddPrefix",value:function(e){var t=e.international,r=e.IDDPrefix,n=e.digits;if(e.nationalSignificantNumber,!t&&!r){var i=(0,M.Z)(n,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata);if(void 0!==i&&i!==n)return e.update({IDDPrefix:n.slice(0,n.length-i.length)}),this.startInternationalNumber(e,{country:void 0,callingCode:void 0}),!0}}},{key:"fixMissingPlus",value:function(e){if(!e.international){var t=(0,O.Z)(e.digits,this.defaultCountry,this.defaultCallingCode,this.metadata.metadata),r=t.countryCallingCode;if(t.number,r)return e.update({missingPlus:!0}),this.startInternationalNumber(e,{country:e.country,callingCode:r}),!0}}},{key:"startInternationalNumber",value:function(e,t){var r=t.country,n=t.callingCode;e.startInternationalNumber(r,n),e.nationalSignificantNumber&&(e.resetNationalSignificantNumber(),this.onNationalSignificantNumberChange(),this.hasExtractedNationalSignificantNumber=void 0)}},{key:"extractCallingCodeAndNationalSignificantNumber",value:function(e){this.extractCountryCallingCode(e)&&this.extractNationalSignificantNumber(e.getNationalDigits(),function(t){return e.update(t)})}}],function(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r1}},{key:"determineTheCountry",value:function(){this.state.setCountry((0,U.Z)(this.isInternational()?this.state.callingCode:this.defaultCallingCode,{nationalNumber:this.state.nationalSignificantNumber,defaultCountry:this.defaultCountry,metadata:this.metadata}))}},{key:"getNumberValue",value:function(){var e=this.state,t=e.digits,r=e.callingCode,n=e.country,i=e.nationalSignificantNumber;if(t){if(this.isInternational())return r?"+"+r+i:"+"+t;if(n||r)return"+"+(n?this.metadata.countryCallingCode():r)+i}}},{key:"getNumber",value:function(){var e=this.state,t=e.nationalSignificantNumber,r=e.carrierCode,n=e.callingCode,o=this._getCountry();if(t&&(o||n)){if(o&&o===this.defaultCountry){var a=new i.ZP(this.metadata.metadata);a.selectNumberingPlan(o);var l=a.numberingPlan.callingCode(),u=this.metadata.getCountryCodesForCallingCode(l);if(u.length>1){var c=(0,z.Z)(t,{countries:u,defaultCountry:this.defaultCountry,metadata:this.metadata.metadata});c&&(o=c)}}var d=new s.Z(o||n,t,this.metadata.metadata);return r&&(d.carrierCode=r),d}}},{key:"isPossible",value:function(){var e=this.getNumber();return!!e&&e.isPossible()}},{key:"isValid",value:function(){var e=this.getNumber();return!!e&&e.isValid()}},{key:"getNationalNumber",value:function(){return this.state.nationalSignificantNumber}},{key:"getChars",value:function(){return(this.state.international?"+":"")+this.state.digits}},{key:"getTemplate",value:function(){return this.formatter.getTemplate(this.state)||this.getNonFormattedTemplate()||""}}],function(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);re.length)&&(t=e.length);for(var r=0,n=Array(t);r=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(e.split(""));!(t=n()).done;){var i=t.value;r+=function(e,t,r){if("+"===e){if(t)return;return"+"}return(0,x.xh)(e)}(i,r)||""}return r}var $=r(59105),C=r(18822),P=r(69496),I=r(52586),O=r(11264),N=r(81271),M="(["+a.xc+"]|[\\-\\.\\(\\)]?)",R=RegExp("^\\+"+M+"*["+a.xc+"]"+M+"*$","g"),T=a.xc,D=RegExp("^(["+T+"]+((\\-)*["+T+"])*\\.)*[a-zA-Z]+((\\-)*["+T+"])*\\.?$","g"),L="tel:",j=";phone-context=",B=RegExp("["+a.xy+a.xc+"]"),F=RegExp("[^"+a.xc+"#]+$");function U(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function z(e){for(var t=1;t=e.length)return"";var n=e.indexOf(";",r);return n>=0?e.substring(r,n):e.substring(r)}(e);if(!(null===n||0!==n.length&&(R.test(n)||D.test(n))))throw new g("NOT_A_NUMBER");if(null===n)i=r(e)||"";else{i="","+"===n.charAt(0)&&(i+=n);var i,s,o=e.indexOf(L);s=o>=0?o+L.length:0;var a=e.indexOf(j);i+=e.substring(s,a)}var l=i.indexOf(";isub=");if(l>0&&(i=i.substring(0,l)),""!==i)return i}(e,{extractFormattedPhoneNumber:function(e){return function(e,t,r){if(e){if(e.length>250){if(r)throw new g("TOO_LONG");return}if(!1===t)return e;var n=e.search(B);if(!(n<0))return e.slice(n).replace(F,"")}}(e,r,t)}});if(!n)return{};if(!(n.length>=a.ex&&E.test(n)))return _.test(n)?{error:"TOO_SHORT"}:{};var i=function(e){var t=e.search(A);if(t<0)return{};for(var r=e.slice(0,t),n=e.match(A),i=1;ia.sJ){if(t.v2)throw new g("TOO_LONG");return{}}if(t.v2){var y=new C.Z(h,d,r.metadata);return c&&(y.country=c),p&&(y.carrierCode=p),o&&(y.ext=o),y.__countryCallingCodeSource=f,y}var b=(t.extended?!!r.hasSelectedNumberingPlan():!!c)&&(0,P.Z)(d,r.nationalNumberPattern());return t.extended?{country:c,countryCallingCode:h,carrierCode:p,valid:b,possible:!!b||!!(!0===t.extended&&r.possibleLengths()&&(0,$.D)(d,r)),phone:d,ext:o}:b?(n={country:c,phone:d},o&&(n.ext=o),n):{}}(e,z(z({},n),{},{v2:!0}),r)}catch(e){if(e instanceof g);else throw e}}(t,r=V(V({},r),{},{extract:!1}),n);return l&&l.isPossible()||!1}function K(){return(0,n.Z)(W,arguments)}},5038:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(89803);function i(e,t){var r=Array.prototype.slice.call(t);return r.push(n.Z),e.apply(this,r)}},53989:function(e,t,r){"use strict";function n(){let e=new Set,t=[],r=()=>(function(e){if("undefined"==typeof window)return;let t=t=>e(t.detail);return window.addEventListener("eip6963:announceProvider",t),window.dispatchEvent(new CustomEvent("eip6963:requestProvider")),()=>window.removeEventListener("eip6963:announceProvider",t)})(r=>{t.some(({info:e})=>e.uuid===r.info.uuid)||(t=[...t,r],e.forEach(e=>e(t,{added:[r]})))}),n=r();return{_listeners:()=>e,clear(){e.forEach(e=>e([],{removed:[...t]})),t=[]},destroy(){this.clear(),e.clear(),n?.()},findProvider:({rdns:e})=>t.find(t=>t.info.rdns===e),getProviders:()=>t,reset(){this.clear(),n?.(),n=r()},subscribe:(r,{emitImmediately:n}={})=>(e.add(r),n&&r(t,{added:t}),()=>e.delete(r))}}r.d(t,{M:function(){return n}})},79512:function(e,t,r){"use strict";r.d(t,{F:function(){return u},f:function(){return c}});var n=r(2265),i=["light","dark"],s="(prefers-color-scheme: dark)",o="undefined"==typeof window,a=n.createContext(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!=(e=n.useContext(a))?e:l},c=e=>n.useContext(a)?e.children:n.createElement(h,{...e}),d=["light","dark"],h=e=>{let{forcedTheme:t,disableTransitionOnChange:r=!1,enableSystem:o=!0,enableColorScheme:l=!0,storageKey:u="theme",themes:c=d,defaultTheme:h=o?"system":"light",attribute:y="data-theme",value:b,children:v,nonce:w}=e,[_,E]=n.useState(()=>p(u,h)),[A,x]=n.useState(()=>p(u)),k=b?Object.values(b):c,S=n.useCallback(e=>{let t=e;if(!t)return;"system"===e&&o&&(t=m());let n=b?b[t]:t,s=r?g():null,a=document.documentElement;if("class"===y?(a.classList.remove(...k),n&&a.classList.add(n)):n?a.setAttribute(y,n):a.removeAttribute(y),l){let e=i.includes(h)?h:null,r=i.includes(t)?t:e;a.style.colorScheme=r}null==s||s()},[]),$=n.useCallback(e=>{let t="function"==typeof e?e(e):e;E(t);try{localStorage.setItem(u,t)}catch(e){}},[t]),C=n.useCallback(e=>{x(m(e)),"system"===_&&o&&!t&&S("system")},[_,t]);n.useEffect(()=>{let e=window.matchMedia(s);return e.addListener(C),C(e),()=>e.removeListener(C)},[C]),n.useEffect(()=>{let e=e=>{e.key===u&&$(e.newValue||h)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[$]),n.useEffect(()=>{S(null!=t?t:_)},[t,_]);let P=n.useMemo(()=>({theme:_,setTheme:$,forcedTheme:t,resolvedTheme:"system"===_?A:_,themes:o?[...c,"system"]:c,systemTheme:o?A:void 0}),[_,$,t,A,o,c]);return n.createElement(a.Provider,{value:P},n.createElement(f,{forcedTheme:t,disableTransitionOnChange:r,enableSystem:o,enableColorScheme:l,storageKey:u,themes:c,defaultTheme:h,attribute:y,value:b,children:v,attrs:k,nonce:w}),v)},f=n.memo(e=>{let{forcedTheme:t,storageKey:r,attribute:o,enableSystem:a,enableColorScheme:l,defaultTheme:u,value:c,attrs:d,nonce:h}=e,f="system"===u,p="class"===o?"var d=document.documentElement,c=d.classList;".concat("c.remove(".concat(d.map(e=>"'".concat(e,"'")).join(","),")"),";"):"var d=document.documentElement,n='".concat(o,"',s='setAttribute';"),g=l?(i.includes(u)?u:null)?"if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'".concat(u,"'"):"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=function(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=!(arguments.length>2)||void 0===arguments[2]||arguments[2],n=c?c[e]:e,s=t?e+"|| ''":"'".concat(n,"'"),a="";return l&&r&&!t&&i.includes(e)&&(a+="d.style.colorScheme = '".concat(e,"';")),"class"===o?t||n?a+="c.add(".concat(s,")"):a+="null":n&&(a+="d[s](n,".concat(s,")")),a},y=t?"!function(){".concat(p).concat(m(t),"}()"):a?"!function(){try{".concat(p,"var e=localStorage.getItem('").concat(r,"');if('system'===e||(!e&&").concat(f,")){var t='").concat(s,"',m=window.matchMedia(t);if(m.media!==t||m.matches){").concat(m("dark"),"}else{").concat(m("light"),"}}else if(e){").concat(c?"var x=".concat(JSON.stringify(c),";"):"").concat(m(c?"x[e]":"e",!0),"}").concat(f?"":"else{"+m(u,!1,!1)+"}").concat(g,"}catch(e){}}()"):"!function(){try{".concat(p,"var e=localStorage.getItem('").concat(r,"');if(e){").concat(c?"var x=".concat(JSON.stringify(c),";"):"").concat(m(c?"x[e]":"e",!0),"}else{").concat(m(u,!1,!1),";}").concat(g,"}catch(t){}}();");return n.createElement("script",{nonce:h,dangerouslySetInnerHTML:{__html:y}})}),p=(e,t)=>{let r;if(!o){try{r=localStorage.getItem(e)||void 0}catch(e){}return r||t}},g=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},m=e=>(e||(e=window.matchMedia(s)),e.matches?"dark":"light")},58249:function(e,t,r){"use strict";r.d(t,{Wg:function(){return l}});var n=r(99434);let i=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw Error("unable to locate global object")}(),s=i.fetch||(()=>Promise.reject(Error("[ofetch] global.fetch is not supported!"))),o=i.Headers,a=i.AbortController,l=(0,n.c)({fetch:s,Headers:o,AbortController:a})},99434:function(e,t,r){"use strict";r.d(t,{F:function(){return x},c:function(){return function e(t={}){let{fetch:r=globalThis.fetch,Headers:i=globalThis.Headers,AbortController:s=globalThis.AbortController}=t;async function o(e){let t=e.error&&"AbortError"===e.error.name&&!e.options.timeout||!1;if(!1!==e.options.retry&&!t){let t;t="number"==typeof e.options.retry?e.options.retry:S(e.options.method)?0:1;let r=e.response&&e.response.status||500;if(t>0&&(Array.isArray(e.options.retryStatusCodes)?e.options.retryStatusCodes.includes(r):P.has(r))){let r=e.options.retryDelay||0;return r>0&&await new Promise(e=>setTimeout(e,r)),a(e.request,{...e.options,retry:t-1})}}let r=function(e){let t=e.error?.message||e.error?.toString()||"",r=e.request?.method||e.options?.method||"GET",n=e.request?.url||String(e.request)||"/",i=`[${r}] ${JSON.stringify(n)}`,s=e.response?`${e.response.status} ${e.response.statusText}`:"",o=new x(`${i}: ${s}${t?` ${t}`:""}`,e.error?{cause:e.error}:void 0);for(let t of["request","options","response"])Object.defineProperty(o,t,{get:()=>e[t]});for(let[t,r]of[["data","_data"],["status","status"],["statusCode","status"],["statusText","statusText"],["statusMessage","statusText"]])Object.defineProperty(o,t,{get:()=>e.response&&e.response[r]});return o}(e);throw Error.captureStackTrace&&Error.captureStackTrace(r,a),r}let a=async function(e,a={}){let u;let c={request:e,options:function(e,t,r=globalThis.Headers){let n={...t,...e};if(t?.params&&e?.params&&(n.params={...t?.params,...e?.params}),t?.query&&e?.query&&(n.query={...t?.query,...e?.query}),t?.headers&&e?.headers)for(let[i,s]of(n.headers=new r(t?.headers||{}),new r(e?.headers||{})))n.headers.set(i,s);return n}(a,t.defaults,i),response:void 0,error:void 0};if(c.options.method=c.options.method?.toUpperCase(),c.options.onRequest&&await c.options.onRequest(c),"string"==typeof c.request&&(c.options.baseURL&&(c.request=function(e,t){if(!t||"/"===t||_(e))return e;let r=function(e="",t){return(!function(e="",t){return e.endsWith("/")}(e)?e:e.slice(0,-1))||"/"}(t);return e.startsWith(r)?e:function(e,...t){let r=e||"";for(let e of t.filter(e=>e&&"/"!==e))if(r){let t=e.replace(w,"");r=function(e="",t){return e.endsWith("/")?e:e+"/"}(r)+t}else r=e;return r}(r,e)}(c.request,c.options.baseURL)),(c.options.query||c.options.params)&&(c.request=function(e,t){let r=function e(t="",r){let n=t.match(/^[\s\0]*(blob:|data:|javascript:|vbscript:)(.*)/i);if(n){let[,e,t=""]=n;return{protocol:e.toLowerCase(),pathname:t,href:e+t,auth:"",host:"",search:"",hash:""}}if(!_(t,{acceptRelative:!0}))return r?e(r+t):A(t);let[,i="",s,o=""]=t.replace(/\\/g,"/").match(/^[\s\0]*([\w+.-]{2,}:)?\/\/([^/@]+@)?(.*)/)||[],[,a="",l=""]=o.match(/([^#/?]*)(.*)?/)||[];"file:"===i&&(l=l.replace(/\/(?=[A-Za-z]:)/,""));let{pathname:u,search:c,hash:d}=A(l);return{protocol:i.toLowerCase(),auth:s?s.slice(0,Math.max(0,s.length-1)):"",host:a,pathname:u,search:c,hash:d,[E]:!i}}(e),n={...function(e=""){let t={};for(let r of("?"===e[0]&&(e=e.slice(1)),e.split("&"))){let e=r.match(/([^=]+)=?(.*)/)||[];if(e.length<2)continue;let n=g(e[1].replace(l," "));if("__proto__"===n||"constructor"===n)continue;let i=g((e[2]||"").replace(l," "));void 0===t[n]?t[n]=i:Array.isArray(t[n])?t[n].push(i):t[n]=[t[n],i]}return t}(r.search),...t};return r.search=Object.keys(n).filter(e=>void 0!==n[e]).map(e=>{var t;return(("number"==typeof(t=n[e])||"boolean"==typeof t)&&(t=String(t)),t)?Array.isArray(t)?t.map(t=>`${p(e)}=${f(t)}`).join("&"):`${p(e)}=${f(t)}`:p(e)}).filter(Boolean).join("&"),function(e){let t=e.pathname||"",r=e.search?(e.search.startsWith("?")?"":"?")+e.search:"",n=e.hash||"",i=e.auth?e.auth+"@":"",s=e.host||"";return(e.protocol||e[E]?(e.protocol||"")+"//":"")+i+s+t+r+n}(r)}(c.request,{...c.options.params,...c.options.query}))),c.options.body&&S(c.options.method)&&(function(e){if(void 0===e)return!1;let t=typeof e;return"string"===t||"number"===t||"boolean"===t||null===t||"object"===t&&(!!Array.isArray(e)||!e.buffer&&(e.constructor&&"Object"===e.constructor.name||"function"==typeof e.toJSON))}(c.options.body)?(c.options.body="string"==typeof c.options.body?c.options.body:JSON.stringify(c.options.body),c.options.headers=new i(c.options.headers||{}),c.options.headers.has("content-type")||c.options.headers.set("content-type","application/json"),c.options.headers.has("accept")||c.options.headers.set("accept","application/json")):("pipeTo"in c.options.body&&"function"==typeof c.options.body.pipeTo||"function"==typeof c.options.body.pipe)&&!("duplex"in c.options)&&(c.options.duplex="half")),!c.options.signal&&c.options.timeout){let e=new s;u=setTimeout(()=>e.abort(),c.options.timeout),c.options.signal=e.signal}try{c.response=await r(c.request,c.options)}catch(e){return c.error=e,c.options.onRequestError&&await c.options.onRequestError(c),await o(c)}finally{u&&clearTimeout(u)}if(c.response.body&&!I.has(c.response.status)&&"HEAD"!==c.options.method){let e=(c.options.parseResponse?"json":c.options.responseType)||function(e=""){if(!e)return"json";let t=e.split(";").shift()||"";return C.test(t)?"json":$.has(t)||t.startsWith("text/")?"text":"blob"}(c.response.headers.get("content-type")||"");switch(e){case"json":{let e=await c.response.text(),t=c.options.parseResponse||n.ZP;c.response._data=t(e);break}case"stream":c.response._data=c.response.body;break;default:c.response._data=await c.response[e]()}}return(c.options.onResponse&&await c.options.onResponse(c),!c.options.ignoreResponseError&&c.response.status>=400&&c.response.status<600)?(c.options.onResponseError&&await c.options.onResponseError(c),await o(c)):c.response},u=async function(e,t){return(await a(e,t))._data};return u.raw=a,u.native=(...e)=>r(...e),u.create=(r={})=>e({...t,defaults:{...t.defaults,...r}}),u}}});var n=r(10259);let i=/#/g,s=/&/g,o=/\//g,a=/=/g,l=/\+/g,u=/%5e/gi,c=/%60/gi,d=/%7c/gi,h=/%20/gi;function f(e){return encodeURI(""+("string"==typeof e?e:JSON.stringify(e))).replace(d,"|").replace(l,"%2B").replace(h,"+").replace(i,"%23").replace(s,"%26").replace(c,"`").replace(u,"^").replace(o,"%2F")}function p(e){return f(e).replace(a,"%3D")}function g(e=""){try{return decodeURIComponent(""+e)}catch{return""+e}}let m=/^[\s\w\0+.-]{2,}:([/\\]{1,2})/,y=/^[\s\w\0+.-]{2,}:([/\\]{2})?/,b=/^([/\\]\s*){2,}[^/\\]/,v=/\/$|\/\?|\/#/,w=/^\.?\//;function _(e,t={}){return("boolean"==typeof t&&(t={acceptRelative:t}),t.strict)?m.test(e):y.test(e)||!!t.acceptRelative&&b.test(e)}let E=Symbol.for("ufo:protocolRelative");function A(e=""){let[t="",r="",n=""]=(e.match(/([^#?]*)(\?[^#]*)?(#.*)?/)||[]).splice(1);return{pathname:t,search:r,hash:n}}class x extends Error{constructor(e,t){super(e,t),this.name="FetchError",t?.cause&&!this.cause&&(this.cause=t.cause)}}let k=new Set(Object.freeze(["PATCH","POST","PUT","DELETE"]));function S(e="GET"){return k.has(e.toUpperCase())}let $=new Set(["image/svg","application/xml","application/xhtml","application/html"]),C=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i,P=new Set([408,409,425,429,500,502,503,504]),I=new Set([101,204,205,304])},11444:function(e,t,r){"use strict";r.d(t,{I0:function(){return w},v9:function(){return h},zt:function(){return y}});var n=r(2265),i=r(67183),s=Symbol.for("react-redux-context"),o="undefined"!=typeof globalThis?globalThis:{},a=function(){if(!n.createContext)return{};let e=o[s]??(o[s]=new Map),t=e.get(n.createContext);return t||(t=n.createContext(null),e.set(n.createContext,t)),t}();function l(e=a){return function(){return n.useContext(e)}}var u=l(),c=()=>{throw Error("uSES not initialized!")},d=(e,t)=>e===t,h=function(e=a){let t=e===a?u:l(e),r=(e,r={})=>{let{equalityFn:i=d,devModeChecks:s={}}="function"==typeof r?{equalityFn:r}:r,{store:o,subscription:a,getServerState:l,stabilityCheck:u,identityFunctionCheck:h}=t();n.useRef(!0);let f=n.useCallback({[e.name]:t=>e(t)}[e.name],[e,u,s.stabilityCheck]),p=c(a.addNestedSub,o.getState,l||o.getState,f,i);return n.useDebugValue(p),p};return Object.assign(r,{withTypes:()=>r}),r}();Symbol.for("react.element"),Symbol.for("react.portal"),Symbol.for("react.fragment"),Symbol.for("react.strict_mode"),Symbol.for("react.profiler"),Symbol.for("react.provider"),Symbol.for("react.context"),Symbol.for("react.server_context"),Symbol.for("react.forward_ref"),Symbol.for("react.suspense"),Symbol.for("react.suspense_list"),Symbol.for("react.memo"),Symbol.for("react.lazy"),Symbol.for("react.offscreen"),Symbol.for("react.client.reference");var f={notify(){},get:()=>[]},p=!!("undefined"!=typeof window&&void 0!==window.document&&void 0!==window.document.createElement),g="undefined"!=typeof navigator&&"ReactNative"===navigator.product,m=p||g?n.useLayoutEffect:n.useEffect,y=function({store:e,context:t,children:r,serverState:i,stabilityCheck:s="once",identityFunctionCheck:o="once"}){let l=n.useMemo(()=>{let t=function(e,t){let r;let n=f,i=0,s=!1;function o(){u.onStateChange&&u.onStateChange()}function a(){if(i++,!r){let t,i;r=e.subscribe(o),t=null,i=null,n={clear(){t=null,i=null},notify(){(()=>{let e=t;for(;e;)e.callback(),e=e.next})()},get(){let e=[],r=t;for(;r;)e.push(r),r=r.next;return e},subscribe(e){let r=!0,n=i={callback:e,next:null,prev:i};return n.prev?n.prev.next=n:t=n,function(){r&&null!==t&&(r=!1,n.next?n.next.prev=n.prev:i=n.prev,n.prev?n.prev.next=n.next:t=n.next)}}}}}function l(){i--,r&&0===i&&(r(),r=void 0,n.clear(),n=f)}let u={addNestedSub:function(e){a();let t=n.subscribe(e),r=!1;return()=>{r||(r=!0,t(),l())}},notifyNestedSubs:function(){n.notify()},handleChangeWrapper:o,isSubscribed:function(){return s},trySubscribe:function(){s||(s=!0,a())},tryUnsubscribe:function(){s&&(s=!1,l())},getListeners:()=>n};return u}(e);return{store:e,subscription:t,getServerState:i?()=>i:void 0,stabilityCheck:s,identityFunctionCheck:o}},[e,i,s,o]),u=n.useMemo(()=>e.getState(),[e]);return m(()=>{let{subscription:t}=l;return t.onStateChange=t.notifyNestedSubs,t.trySubscribe(),u!==e.getState()&&t.notifyNestedSubs(),()=>{t.tryUnsubscribe(),t.onStateChange=void 0}},[l,u]),n.createElement((t||a).Provider,{value:l},r)};function b(e=a){let t=e===a?u:l(e),r=()=>{let{store:e}=t();return e};return Object.assign(r,{withTypes:()=>r}),r}var v=b(),w=function(e=a){let t=e===a?v:b(e),r=()=>t().dispatch;return Object.assign(r,{withTypes:()=>r}),r}();c=i.useSyncExternalStoreWithSelector,n.useSyncExternalStore},4811:function(e,t,r){"use strict";function n(e){return crypto.getRandomValues(new Uint8Array(e))}function i(){let[e]=n(1);return e}function s(){let[e,t]=n(2);return(e<<8)+t}function o(e,t,r="-"){if("number"!=typeof e||e<1)throw Error("Invalid argument: length argument must be a number greater than or equal to 1");if(!Array.isArray(t)||t.length<2)throw Error("Invalid argument: wordlist argument must be an array with length greater than or equal to 2");if("string"!=typeof r)throw Error("Invalid argument: sep argument must be a string");return(function(e,t,r){if("number"!=typeof e||e<1)throw Error("Invalid argument: length must be a number greater than or equal to 1");if("number"!=typeof r||r>65536)throw Error("Invalid argument: end must be a number less than or equal to 65536");if(r-0<2)throw Error("Invalid range: range must contain at least two values");let n=[];for(let o=0;o65536)throw Error("Invalid number: number must be at least two and at most 65536");let t=e>256,r=t?s:i,n=e*Math.floor((t?65536:256)/e);for(;;){let t=r();if(t{let s=t[n];return e+(0===i?s:r+s)},"")}r.d(t,{OW:function(){return o}})},92861:function(e,t,r){"use strict";r.d(t,{k:function(){return n}});let n=Object.freeze(Object.freeze(["abacus","abdomen","abdominal","abide","abiding","ability","ablaze","able","abnormal","abrasion","abrasive","abreast","abridge","abroad","abruptly","absence","absentee","absently","absinthe","absolute","absolve","abstain","abstract","absurd","accent","acclaim","acclimate","accompany","account","accuracy","accurate","accustom","acetone","achiness","aching","acid","acorn","acquaint","acquire","acre","acrobat","acronym","acting","action","activate","activator","active","activism","activist","activity","actress","acts","acutely","acuteness","aeration","aerobics","aerosol","aerospace","afar","affair","affected","affecting","affection","affidavit","affiliate","affirm","affix","afflicted","affluent","afford","affront","aflame","afloat","aflutter","afoot","afraid","afterglow","afterlife","aftermath","aftermost","afternoon","aged","ageless","agency","agenda","agent","aggregate","aghast","agile","agility","aging","agnostic","agonize","agonizing","agony","agreeable","agreeably","agreed","agreeing","agreement","aground","ahead","ahoy","aide","aids","aim","ajar","alabaster","alarm","albatross","album","alfalfa","algebra","algorithm","alias","alibi","alienable","alienate","aliens","alike","alive","alkaline","alkalize","almanac","almighty","almost","aloe","aloft","aloha","alone","alongside","aloof","alphabet","alright","although","altitude","alto","aluminum","alumni","always","amaretto","amaze","amazingly","amber","ambiance","ambiguity","ambiguous","ambition","ambitious","ambulance","ambush","amendable","amendment","amends","amenity","amiable","amicably","amid","amigo","amino","amiss","ammonia","ammonium","amnesty","amniotic","among","amount","amperage","ample","amplifier","amplify","amply","amuck","amulet","amusable","amused","amusement","amuser","amusing","anaconda","anaerobic","anagram","anatomist","anatomy","anchor","anchovy","ancient","android","anemia","anemic","aneurism","anew","angelfish","angelic","anger","angled","angler","angles","angling","angrily","angriness","anguished","angular","animal","animate","animating","animation","animator","anime","animosity","ankle","annex","annotate","announcer","annoying","annually","annuity","anointer","another","answering","antacid","antarctic","anteater","antelope","antennae","anthem","anthill","anthology","antibody","antics","antidote","antihero","antiquely","antiques","antiquity","antirust","antitoxic","antitrust","antiviral","antivirus","antler","antonym","antsy","anvil","anybody","anyhow","anymore","anyone","anyplace","anything","anytime","anyway","anywhere","aorta","apache","apostle","appealing","appear","appease","appeasing","appendage","appendix","appetite","appetizer","applaud","applause","apple","appliance","applicant","applied","apply","appointee","appraisal","appraiser","apprehend","approach","approval","approve","apricot","april","apron","aptitude","aptly","aqua","aqueduct","arbitrary","arbitrate","ardently","area","arena","arguable","arguably","argue","arise","armadillo","armband","armchair","armed","armful","armhole","arming","armless","armoire","armored","armory","armrest","army","aroma","arose","around","arousal","arrange","array","arrest","arrival","arrive","arrogance","arrogant","arson","art","ascend","ascension","ascent","ascertain","ashamed","ashen","ashes","ashy","aside","askew","asleep","asparagus","aspect","aspirate","aspire","aspirin","astonish","astound","astride","astrology","astronaut","astronomy","astute","atlantic","atlas","atom","atonable","atop","atrium","atrocious","atrophy","attach","attain","attempt","attendant","attendee","attention","attentive","attest","attic","attire","attitude","attractor","attribute","atypical","auction","audacious","audacity","audible","audibly","audience","audio","audition","augmented","august","authentic","author","autism","autistic","autograph","automaker","automated","automatic","autopilot","available","avalanche","avatar","avenge","avenging","avenue","average","aversion","avert","aviation","aviator","avid","avoid","await","awaken","award","aware","awhile","awkward","awning","awoke","awry","axis","babble","babbling","babied","baboon","backache","backboard","backboned","backdrop","backed","backer","backfield","backfire","backhand","backing","backlands","backlash","backless","backlight","backlit","backlog","backpack","backpedal","backrest","backroom","backshift","backside","backslid","backspace","backspin","backstab","backstage","backtalk","backtrack","backup","backward","backwash","backwater","backyard","bacon","bacteria","bacterium","badass","badge","badland","badly","badness","baffle","baffling","bagel","bagful","baggage","bagged","baggie","bagginess","bagging","baggy","bagpipe","baguette","baked","bakery","bakeshop","baking","balance","balancing","balcony","balmy","balsamic","bamboo","banana","banish","banister","banjo","bankable","bankbook","banked","banker","banking","banknote","bankroll","banner","bannister","banshee","banter","barbecue","barbed","barbell","barber","barcode","barge","bargraph","barista","baritone","barley","barmaid","barman","barn","barometer","barrack","barracuda","barrel","barrette","barricade","barrier","barstool","bartender","barterer","bash","basically","basics","basil","basin","basis","basket","batboy","batch","bath","baton","bats","battalion","battered","battering","battery","batting","battle","bauble","bazooka","blabber","bladder","blade","blah","blame","blaming","blanching","blandness","blank","blaspheme","blasphemy","blast","blatancy","blatantly","blazer","blazing","bleach","bleak","bleep","blemish","blend","bless","blighted","blimp","bling","blinked","blinker","blinking","blinks","blip","blissful","blitz","blizzard","bloated","bloating","blob","blog","bloomers","blooming","blooper","blot","blouse","blubber","bluff","bluish","blunderer","blunt","blurb","blurred","blurry","blurt","blush","blustery","boaster","boastful","boasting","boat","bobbed","bobbing","bobble","bobcat","bobsled","bobtail","bodacious","body","bogged","boggle","bogus","boil","bok","bolster","bolt","bonanza","bonded","bonding","bondless","boned","bonehead","boneless","bonelike","boney","bonfire","bonnet","bonsai","bonus","bony","boogeyman","boogieman","book","boondocks","booted","booth","bootie","booting","bootlace","bootleg","boots","boozy","borax","boring","borough","borrower","borrowing","boss","botanical","botanist","botany","botch","both","bottle","bottling","bottom","bounce","bouncing","bouncy","bounding","boundless","bountiful","bovine","boxcar","boxer","boxing","boxlike","boxy","breach","breath","breeches","breeching","breeder","breeding","breeze","breezy","brethren","brewery","brewing","briar","bribe","brick","bride","bridged","brigade","bright","brilliant","brim","bring","brink","brisket","briskly","briskness","bristle","brittle","broadband","broadcast","broaden","broadly","broadness","broadside","broadways","broiler","broiling","broken","broker","bronchial","bronco","bronze","bronzing","brook","broom","brought","browbeat","brownnose","browse","browsing","bruising","brunch","brunette","brunt","brush","brussels","brute","brutishly","bubble","bubbling","bubbly","buccaneer","bucked","bucket","buckle","buckshot","buckskin","bucktooth","buckwheat","buddhism","buddhist","budding","buddy","budget","buffalo","buffed","buffer","buffing","buffoon","buggy","bulb","bulge","bulginess","bulgur","bulk","bulldog","bulldozer","bullfight","bullfrog","bullhorn","bullion","bullish","bullpen","bullring","bullseye","bullwhip","bully","bunch","bundle","bungee","bunion","bunkbed","bunkhouse","bunkmate","bunny","bunt","busboy","bush","busily","busload","bust","busybody","buzz","cabana","cabbage","cabbie","cabdriver","cable","caboose","cache","cackle","cacti","cactus","caddie","caddy","cadet","cadillac","cadmium","cage","cahoots","cake","calamari","calamity","calcium","calculate","calculus","caliber","calibrate","calm","caloric","calorie","calzone","camcorder","cameo","camera","camisole","camper","campfire","camping","campsite","campus","canal","canary","cancel","candied","candle","candy","cane","canine","canister","cannabis","canned","canning","cannon","cannot","canola","canon","canopener","canopy","canteen","canyon","capable","capably","capacity","cape","capillary","capital","capitol","capped","capricorn","capsize","capsule","caption","captivate","captive","captivity","capture","caramel","carat","caravan","carbon","cardboard","carded","cardiac","cardigan","cardinal","cardstock","carefully","caregiver","careless","caress","caretaker","cargo","caring","carless","carload","carmaker","carnage","carnation","carnival","carnivore","carol","carpenter","carpentry","carpool","carport","carried","carrot","carrousel","carry","cartel","cartload","carton","cartoon","cartridge","cartwheel","carve","carving","carwash","cascade","case","cash","casing","casino","casket","cassette","casually","casualty","catacomb","catalog","catalyst","catalyze","catapult","cataract","catatonic","catcall","catchable","catcher","catching","catchy","caterer","catering","catfight","catfish","cathedral","cathouse","catlike","catnap","catnip","catsup","cattail","cattishly","cattle","catty","catwalk","caucasian","caucus","causal","causation","cause","causing","cauterize","caution","cautious","cavalier","cavalry","caviar","cavity","cedar","celery","celestial","celibacy","celibate","celtic","cement","census","ceramics","ceremony","certainly","certainty","certified","certify","cesarean","cesspool","chafe","chaffing","chain","chair","chalice","challenge","chamber","chamomile","champion","chance","change","channel","chant","chaos","chaperone","chaplain","chapped","chaps","chapter","character","charbroil","charcoal","charger","charging","chariot","charity","charm","charred","charter","charting","chase","chasing","chaste","chastise","chastity","chatroom","chatter","chatting","chatty","cheating","cheddar","cheek","cheer","cheese","cheesy","chef","chemicals","chemist","chemo","cherisher","cherub","chess","chest","chevron","chevy","chewable","chewer","chewing","chewy","chief","chihuahua","childcare","childhood","childish","childless","childlike","chili","chill","chimp","chip","chirping","chirpy","chitchat","chivalry","chive","chloride","chlorine","choice","chokehold","choking","chomp","chooser","choosing","choosy","chop","chosen","chowder","chowtime","chrome","chubby","chuck","chug","chummy","chump","chunk","churn","chute","cider","cilantro","cinch","cinema","cinnamon","circle","circling","circular","circulate","circus","citable","citadel","citation","citizen","citric","citrus","city","civic","civil","clad","claim","clambake","clammy","clamor","clamp","clamshell","clang","clanking","clapped","clapper","clapping","clarify","clarinet","clarity","clash","clasp","class","clatter","clause","clavicle","claw","clay","clean","clear","cleat","cleaver","cleft","clench","clergyman","clerical","clerk","clever","clicker","client","climate","climatic","cling","clinic","clinking","clip","clique","cloak","clobber","clock","clone","cloning","closable","closure","clothes","clothing","cloud","clover","clubbed","clubbing","clubhouse","clump","clumsily","clumsy","clunky","clustered","clutch","clutter","coach","coagulant","coastal","coaster","coasting","coastland","coastline","coat","coauthor","cobalt","cobbler","cobweb","cocoa","coconut","cod","coeditor","coerce","coexist","coffee","cofounder","cognition","cognitive","cogwheel","coherence","coherent","cohesive","coil","coke","cola","cold","coleslaw","coliseum","collage","collapse","collar","collected","collector","collide","collie","collision","colonial","colonist","colonize","colony","colossal","colt","coma","come","comfort","comfy","comic","coming","comma","commence","commend","comment","commerce","commode","commodity","commodore","common","commotion","commute","commuting","compacted","compacter","compactly","compactor","companion","company","compare","compel","compile","comply","component","composed","composer","composite","compost","composure","compound","compress","comprised","computer","computing","comrade","concave","conceal","conceded","concept","concerned","concert","conch","concierge","concise","conclude","concrete","concur","condense","condiment","condition","condone","conducive","conductor","conduit","cone","confess","confetti","confidant","confident","confider","confiding","configure","confined","confining","confirm","conflict","conform","confound","confront","confused","confusing","confusion","congenial","congested","congrats","congress","conical","conjoined","conjure","conjuror","connected","connector","consensus","consent","console","consoling","consonant","constable","constant","constrain","constrict","construct","consult","consumer","consuming","contact","container","contempt","contend","contented","contently","contents","contest","context","contort","contour","contrite","control","contusion","convene","convent","copartner","cope","copied","copier","copilot","coping","copious","copper","copy","coral","cork","cornball","cornbread","corncob","cornea","corned","corner","cornfield","cornflake","cornhusk","cornmeal","cornstalk","corny","coronary","coroner","corporal","corporate","corral","correct","corridor","corrode","corroding","corrosive","corsage","corset","cortex","cosigner","cosmetics","cosmic","cosmos","cosponsor","cost","cottage","cotton","couch","cough","could","countable","countdown","counting","countless","country","county","courier","covenant","cover","coveted","coveting","coyness","cozily","coziness","cozy","crabbing","crabgrass","crablike","crabmeat","cradle","cradling","crafter","craftily","craftsman","craftwork","crafty","cramp","cranberry","crane","cranial","cranium","crank","crate","crave","craving","crawfish","crawlers","crawling","crayfish","crayon","crazed","crazily","craziness","crazy","creamed","creamer","creamlike","crease","creasing","creatable","create","creation","creative","creature","credible","credibly","credit","creed","creme","creole","crepe","crept","crescent","crested","cresting","crestless","crevice","crewless","crewman","crewmate","crib","cricket","cried","crier","crimp","crimson","cringe","cringing","crinkle","crinkly","crisped","crisping","crisply","crispness","crispy","criteria","critter","croak","crock","crook","croon","crop","cross","crouch","crouton","crowbar","crowd","crown","crucial","crudely","crudeness","cruelly","cruelness","cruelty","crumb","crummiest","crummy","crumpet","crumpled","cruncher","crunching","crunchy","crusader","crushable","crushed","crusher","crushing","crust","crux","crying","cryptic","crystal","cubbyhole","cube","cubical","cubicle","cucumber","cuddle","cuddly","cufflink","culinary","culminate","culpable","culprit","cultivate","cultural","culture","cupbearer","cupcake","cupid","cupped","cupping","curable","curator","curdle","cure","curfew","curing","curled","curler","curliness","curling","curly","curry","curse","cursive","cursor","curtain","curtly","curtsy","curvature","curve","curvy","cushy","cusp","cussed","custard","custodian","custody","customary","customer","customize","customs","cut","cycle","cyclic","cycling","cyclist","cylinder","cymbal","cytoplasm","cytoplast","dab","dad","daffodil","dagger","daily","daintily","dainty","dairy","daisy","dallying","dance","dancing","dandelion","dander","dandruff","dandy","danger","dangle","dangling","daredevil","dares","daringly","darkened","darkening","darkish","darkness","darkroom","darling","darn","dart","darwinism","dash","dastardly","data","datebook","dating","daughter","daunting","dawdler","dawn","daybed","daybreak","daycare","daydream","daylight","daylong","dayroom","daytime","dazzler","dazzling","deacon","deafening","deafness","dealer","dealing","dealmaker","dealt","dean","debatable","debate","debating","debit","debrief","debtless","debtor","debug","debunk","decade","decaf","decal","decathlon","decay","deceased","deceit","deceiver","deceiving","december","decency","decent","deception","deceptive","decibel","decidable","decimal","decimeter","decipher","deck","declared","decline","decode","decompose","decorated","decorator","decoy","decrease","decree","dedicate","dedicator","deduce","deduct","deed","deem","deepen","deeply","deepness","deface","defacing","defame","default","defeat","defection","defective","defendant","defender","defense","defensive","deferral","deferred","defiance","defiant","defile","defiling","define","definite","deflate","deflation","deflator","deflected","deflector","defog","deforest","defraud","defrost","deftly","defuse","defy","degraded","degrading","degrease","degree","dehydrate","deity","dejected","delay","delegate","delegator","delete","deletion","delicacy","delicate","delicious","delighted","delirious","delirium","deliverer","delivery","delouse","delta","deluge","delusion","deluxe","demanding","demeaning","demeanor","demise","democracy","democrat","demote","demotion","demystify","denatured","deniable","denial","denim","denote","dense","density","dental","dentist","denture","deny","deodorant","deodorize","departed","departure","depict","deplete","depletion","deplored","deploy","deport","depose","depraved","depravity","deprecate","depress","deprive","depth","deputize","deputy","derail","deranged","derby","derived","desecrate","deserve","deserving","designate","designed","designer","designing","deskbound","desktop","deskwork","desolate","despair","despise","despite","destiny","destitute","destruct","detached","detail","detection","detective","detector","detention","detergent","detest","detonate","detonator","detoxify","detract","deuce","devalue","deviancy","deviant","deviate","deviation","deviator","device","devious","devotedly","devotee","devotion","devourer","devouring","devoutly","dexterity","dexterous","diabetes","diabetic","diabolic","diagnoses","diagnosis","diagram","dial","diameter","diaper","diaphragm","diary","dice","dicing","dictate","dictation","dictator","difficult","diffused","diffuser","diffusion","diffusive","dig","dilation","diligence","diligent","dill","dilute","dime","diminish","dimly","dimmed","dimmer","dimness","dimple","diner","dingbat","dinghy","dinginess","dingo","dingy","dining","dinner","diocese","dioxide","diploma","dipped","dipper","dipping","directed","direction","directive","directly","directory","direness","dirtiness","disabled","disagree","disallow","disarm","disarray","disaster","disband","disbelief","disburse","discard","discern","discharge","disclose","discolor","discount","discourse","discover","discuss","disdain","disengage","disfigure","disgrace","dish","disinfect","disjoin","disk","dislike","disliking","dislocate","dislodge","disloyal","dismantle","dismay","dismiss","dismount","disobey","disorder","disown","disparate","disparity","dispatch","dispense","dispersal","dispersed","disperser","displace","display","displease","disposal","dispose","disprove","dispute","disregard","disrupt","dissuade","distance","distant","distaste","distill","distinct","distort","distract","distress","district","distrust","ditch","ditto","ditzy","dividable","divided","dividend","dividers","dividing","divinely","diving","divinity","divisible","divisibly","division","divisive","divorcee","dizziness","dizzy","doable","docile","dock","doctrine","document","dodge","dodgy","doily","doing","dole","dollar","dollhouse","dollop","dolly","dolphin","domain","domelike","domestic","dominion","dominoes","donated","donation","donator","donor","donut","doodle","doorbell","doorframe","doorknob","doorman","doormat","doornail","doorpost","doorstep","doorstop","doorway","doozy","dork","dormitory","dorsal","dosage","dose","dotted","doubling","douche","dove","down","dowry","doze","drab","dragging","dragonfly","dragonish","dragster","drainable","drainage","drained","drainer","drainpipe","dramatic","dramatize","drank","drapery","drastic","draw","dreaded","dreadful","dreadlock","dreamboat","dreamily","dreamland","dreamless","dreamlike","dreamt","dreamy","drearily","dreary","drench","dress","drew","dribble","dried","drier","drift","driller","drilling","drinkable","drinking","dripping","drippy","drivable","driven","driver","driveway","driving","drizzle","drizzly","drone","drool","droop","drop-down","dropbox","dropkick","droplet","dropout","dropper","drove","drown","drowsily","drudge","drum","dry","dubbed","dubiously","duchess","duckbill","ducking","duckling","ducktail","ducky","duct","dude","duffel","dugout","duh","duke","duller","dullness","duly","dumping","dumpling","dumpster","duo","dupe","duplex","duplicate","duplicity","durable","durably","duration","duress","during","dusk","dust","dutiful","duty","duvet","dwarf","dweeb","dwelled","dweller","dwelling","dwindle","dwindling","dynamic","dynamite","dynasty","dyslexia","dyslexic","each","eagle","earache","eardrum","earflap","earful","earlobe","early","earmark","earmuff","earphone","earpiece","earplugs","earring","earshot","earthen","earthlike","earthling","earthly","earthworm","earthy","earwig","easeful","easel","easiest","easily","easiness","easing","eastbound","eastcoast","easter","eastward","eatable","eaten","eatery","eating","eats","ebay","ebony","ebook","ecard","eccentric","echo","eclair","eclipse","ecologist","ecology","economic","economist","economy","ecosphere","ecosystem","edge","edginess","edging","edgy","edition","editor","educated","education","educator","eel","effective","effects","efficient","effort","eggbeater","egging","eggnog","eggplant","eggshell","egomaniac","egotism","egotistic","either","eject","elaborate","elastic","elated","elbow","eldercare","elderly","eldest","electable","election","elective","elephant","elevate","elevating","elevation","elevator","eleven","elf","eligible","eligibly","eliminate","elite","elitism","elixir","elk","ellipse","elliptic","elm","elongated","elope","eloquence","eloquent","elsewhere","elude","elusive","elves","email","embargo","embark","embassy","embattled","embellish","ember","embezzle","emblaze","emblem","embody","embolism","emboss","embroider","emcee","emerald","emergency","emission","emit","emote","emoticon","emotion","empathic","empathy","emperor","emphases","emphasis","emphasize","emphatic","empirical","employed","employee","employer","emporium","empower","emptier","emptiness","empty","emu","enable","enactment","enamel","enchanted","enchilada","encircle","enclose","enclosure","encode","encore","encounter","encourage","encroach","encrust","encrypt","endanger","endeared","endearing","ended","ending","endless","endnote","endocrine","endorphin","endorse","endowment","endpoint","endurable","endurance","enduring","energetic","energize","energy","enforced","enforcer","engaged","engaging","engine","engorge","engraved","engraver","engraving","engross","engulf","enhance","enigmatic","enjoyable","enjoyably","enjoyer","enjoying","enjoyment","enlarged","enlarging","enlighten","enlisted","enquirer","enrage","enrich","enroll","enslave","ensnare","ensure","entail","entangled","entering","entertain","enticing","entire","entitle","entity","entomb","entourage","entrap","entree","entrench","entrust","entryway","entwine","enunciate","envelope","enviable","enviably","envious","envision","envoy","envy","enzyme","epic","epidemic","epidermal","epidermis","epidural","epilepsy","epileptic","epilogue","epiphany","episode","equal","equate","equation","equator","equinox","equipment","equity","equivocal","eradicate","erasable","erased","eraser","erasure","ergonomic","errand","errant","erratic","error","erupt","escalate","escalator","escapable","escapade","escapist","escargot","eskimo","esophagus","espionage","espresso","esquire","essay","essence","essential","establish","estate","esteemed","estimate","estimator","estranged","estrogen","etching","eternal","eternity","ethanol","ether","ethically","ethics","euphemism","evacuate","evacuee","evade","evaluate","evaluator","evaporate","evasion","evasive","even","everglade","evergreen","everybody","everyday","everyone","evict","evidence","evident","evil","evoke","evolution","evolve","exact","exalted","example","excavate","excavator","exceeding","exception","excess","exchange","excitable","exciting","exclaim","exclude","excluding","exclusion","exclusive","excretion","excretory","excursion","excusable","excusably","excuse","exemplary","exemplify","exemption","exerciser","exert","exes","exfoliate","exhale","exhaust","exhume","exile","existing","exit","exodus","exonerate","exorcism","exorcist","expand","expanse","expansion","expansive","expectant","expedited","expediter","expel","expend","expenses","expensive","expert","expire","expiring","explain","expletive","explicit","explode","exploit","explore","exploring","exponent","exporter","exposable","expose","exposure","express","expulsion","exquisite","extended","extending","extent","extenuate","exterior","external","extinct","extortion","extradite","extras","extrovert","extrude","extruding","exuberant","fable","fabric","fabulous","facebook","facecloth","facedown","faceless","facelift","faceplate","faceted","facial","facility","facing","facsimile","faction","factoid","factor","factsheet","factual","faculty","fade","fading","failing","falcon","fall","false","falsify","fame","familiar","family","famine","famished","fanatic","fancied","fanciness","fancy","fanfare","fang","fanning","fantasize","fantastic","fantasy","fascism","fastball","faster","fasting","fastness","faucet","favorable","favorably","favored","favoring","favorite","fax","feast","federal","fedora","feeble","feed","feel","feisty","feline","felt-tip","feminine","feminism","feminist","feminize","femur","fence","fencing","fender","ferment","fernlike","ferocious","ferocity","ferret","ferris","ferry","fervor","fester","festival","festive","festivity","fetal","fetch","fever","fiber","fiction","fiddle","fiddling","fidelity","fidgeting","fidgety","fifteen","fifth","fiftieth","fifty","figment","figure","figurine","filing","filled","filler","filling","film","filter","filth","filtrate","finale","finalist","finalize","finally","finance","financial","finch","fineness","finer","finicky","finished","finisher","finishing","finite","finless","finlike","fiscally","fit","five","flaccid","flagman","flagpole","flagship","flagstick","flagstone","flail","flakily","flaky","flame","flammable","flanked","flanking","flannels","flap","flaring","flashback","flashbulb","flashcard","flashily","flashing","flashy","flask","flatbed","flatfoot","flatly","flatness","flatten","flattered","flatterer","flattery","flattop","flatware","flatworm","flavored","flavorful","flavoring","flaxseed","fled","fleshed","fleshy","flick","flier","flight","flinch","fling","flint","flip","flirt","float","flock","flogging","flop","floral","florist","floss","flounder","flyable","flyaway","flyer","flying","flyover","flypaper","foam","foe","fog","foil","folic","folk","follicle","follow","fondling","fondly","fondness","fondue","font","food","fool","footage","football","footbath","footboard","footer","footgear","foothill","foothold","footing","footless","footman","footnote","footpad","footpath","footprint","footrest","footsie","footsore","footwear","footwork","fossil","foster","founder","founding","fountain","fox","foyer","fraction","fracture","fragile","fragility","fragment","fragrance","fragrant","frail","frame","framing","frantic","fraternal","frayed","fraying","frays","freckled","freckles","freebase","freebee","freebie","freedom","freefall","freehand","freeing","freeload","freely","freemason","freeness","freestyle","freeware","freeway","freewill","freezable","freezing","freight","french","frenzied","frenzy","frequency","frequent","fresh","fretful","fretted","friction","friday","fridge","fried","friend","frighten","frightful","frigidity","frigidly","frill","fringe","frisbee","frisk","fritter","frivolous","frolic","from","front","frostbite","frosted","frostily","frosting","frostlike","frosty","froth","frown","frozen","fructose","frugality","frugally","fruit","frustrate","frying","gab","gaffe","gag","gainfully","gaining","gains","gala","gallantly","galleria","gallery","galley","gallon","gallows","gallstone","galore","galvanize","gambling","game","gaming","gamma","gander","gangly","gangrene","gangway","gap","garage","garbage","garden","gargle","garland","garlic","garment","garnet","garnish","garter","gas","gatherer","gathering","gating","gauging","gauntlet","gauze","gave","gawk","gazing","gear","gecko","geek","geiger","gem","gender","generic","generous","genetics","genre","gentile","gentleman","gently","gents","geography","geologic","geologist","geology","geometric","geometry","geranium","gerbil","geriatric","germicide","germinate","germless","germproof","gestate","gestation","gesture","getaway","getting","getup","giant","gibberish","giblet","giddily","giddiness","giddy","gift","gigabyte","gigahertz","gigantic","giggle","giggling","giggly","gigolo","gilled","gills","gimmick","girdle","giveaway","given","giver","giving","gizmo","gizzard","glacial","glacier","glade","gladiator","gladly","glamorous","glamour","glance","glancing","glandular","glare","glaring","glass","glaucoma","glazing","gleaming","gleeful","glider","gliding","glimmer","glimpse","glisten","glitch","glitter","glitzy","gloater","gloating","gloomily","gloomy","glorified","glorifier","glorify","glorious","glory","gloss","glove","glowing","glowworm","glucose","glue","gluten","glutinous","glutton","gnarly","gnat","goal","goatskin","goes","goggles","going","goldfish","goldmine","goldsmith","golf","goliath","gonad","gondola","gone","gong","good","gooey","goofball","goofiness","goofy","google","goon","gopher","gore","gorged","gorgeous","gory","gosling","gossip","gothic","gotten","gout","gown","grab","graceful","graceless","gracious","gradation","graded","grader","gradient","grading","gradually","graduate","graffiti","grafted","grafting","grain","granddad","grandkid","grandly","grandma","grandpa","grandson","granite","granny","granola","grant","granular","grape","graph","grapple","grappling","grasp","grass","gratified","gratify","grating","gratitude","gratuity","gravel","graveness","graves","graveyard","gravitate","gravity","gravy","gray","grazing","greasily","greedily","greedless","greedy","green","greeter","greeting","grew","greyhound","grid","grief","grievance","grieving","grievous","grill","grimace","grimacing","grime","griminess","grimy","grinch","grinning","grip","gristle","grit","groggily","groggy","groin","groom","groove","grooving","groovy","grope","ground","grouped","grout","grove","grower","growing","growl","grub","grudge","grudging","grueling","gruffly","grumble","grumbling","grumbly","grumpily","grunge","grunt","guacamole","guidable","guidance","guide","guiding","guileless","guise","gulf","gullible","gully","gulp","gumball","gumdrop","gumminess","gumming","gummy","gurgle","gurgling","guru","gush","gusto","gusty","gutless","guts","gutter","guy","guzzler","gyration","habitable","habitant","habitat","habitual","hacked","hacker","hacking","hacksaw","had","haggler","haiku","half","halogen","halt","halved","halves","hamburger","hamlet","hammock","hamper","hamster","hamstring","handbag","handball","handbook","handbrake","handcart","handclap","handclasp","handcraft","handcuff","handed","handful","handgrip","handgun","handheld","handiness","handiwork","handlebar","handled","handler","handling","handmade","handoff","handpick","handprint","handrail","handsaw","handset","handsfree","handshake","handstand","handwash","handwork","handwoven","handwrite","handyman","hangnail","hangout","hangover","hangup","hankering","hankie","hanky","haphazard","happening","happier","happiest","happily","happiness","happy","harbor","hardcopy","hardcore","hardcover","harddisk","hardened","hardener","hardening","hardhat","hardhead","hardiness","hardly","hardness","hardship","hardware","hardwired","hardwood","hardy","harmful","harmless","harmonica","harmonics","harmonize","harmony","harness","harpist","harsh","harvest","hash","hassle","haste","hastily","hastiness","hasty","hatbox","hatchback","hatchery","hatchet","hatching","hatchling","hate","hatless","hatred","haunt","haven","hazard","hazelnut","hazily","haziness","hazing","hazy","headache","headband","headboard","headcount","headdress","headed","header","headfirst","headgear","heading","headlamp","headless","headlock","headphone","headpiece","headrest","headroom","headscarf","headset","headsman","headstand","headstone","headway","headwear","heap","heat","heave","heavily","heaviness","heaving","hedge","hedging","heftiness","hefty","helium","helmet","helper","helpful","helping","helpless","helpline","hemlock","hemstitch","hence","henchman","henna","herald","herbal","herbicide","herbs","heritage","hermit","heroics","heroism","herring","herself","hertz","hesitancy","hesitant","hesitate","hexagon","hexagram","hubcap","huddle","huddling","huff","hug","hula","hulk","hull","human","humble","humbling","humbly","humid","humiliate","humility","humming","hummus","humongous","humorist","humorless","humorous","humpback","humped","humvee","hunchback","hundredth","hunger","hungrily","hungry","hunk","hunter","hunting","huntress","huntsman","hurdle","hurled","hurler","hurling","hurray","hurricane","hurried","hurry","hurt","husband","hush","husked","huskiness","hut","hybrid","hydrant","hydrated","hydration","hydrogen","hydroxide","hyperlink","hypertext","hyphen","hypnoses","hypnosis","hypnotic","hypnotism","hypnotist","hypnotize","hypocrisy","hypocrite","ibuprofen","ice","iciness","icing","icky","icon","icy","idealism","idealist","idealize","ideally","idealness","identical","identify","identity","ideology","idiocy","idiom","idly","igloo","ignition","ignore","iguana","illicitly","illusion","illusive","image","imaginary","imagines","imaging","imbecile","imitate","imitation","immature","immerse","immersion","imminent","immobile","immodest","immorally","immortal","immovable","immovably","immunity","immunize","impaired","impale","impart","impatient","impeach","impeding","impending","imperfect","imperial","impish","implant","implement","implicate","implicit","implode","implosion","implosive","imply","impolite","important","importer","impose","imposing","impotence","impotency","impotent","impound","imprecise","imprint","imprison","impromptu","improper","improve","improving","improvise","imprudent","impulse","impulsive","impure","impurity","iodine","iodize","ion","ipad","iphone","ipod","irate","irk","iron","irregular","irrigate","irritable","irritably","irritant","irritate","islamic","islamist","isolated","isolating","isolation","isotope","issue","issuing","italicize","italics","item","itinerary","itunes","ivory","ivy","jab","jackal","jacket","jackknife","jackpot","jailbird","jailbreak","jailer","jailhouse","jalapeno","jam","janitor","january","jargon","jarring","jasmine","jaundice","jaunt","java","jawed","jawless","jawline","jaws","jaybird","jaywalker","jazz","jeep","jeeringly","jellied","jelly","jersey","jester","jet","jiffy","jigsaw","jimmy","jingle","jingling","jinx","jitters","jittery","job","jockey","jockstrap","jogger","jogging","john","joining","jokester","jokingly","jolliness","jolly","jolt","jot","jovial","joyfully","joylessly","joyous","joyride","joystick","jubilance","jubilant","judge","judgingly","judicial","judiciary","judo","juggle","juggling","jugular","juice","juiciness","juicy","jujitsu","jukebox","july","jumble","jumbo","jump","junction","juncture","june","junior","juniper","junkie","junkman","junkyard","jurist","juror","jury","justice","justifier","justify","justly","justness","juvenile","kabob","kangaroo","karaoke","karate","karma","kebab","keenly","keenness","keep","keg","kelp","kennel","kept","kerchief","kerosene","kettle","kick","kiln","kilobyte","kilogram","kilometer","kilowatt","kilt","kimono","kindle","kindling","kindly","kindness","kindred","kinetic","kinfolk","king","kinship","kinsman","kinswoman","kissable","kisser","kissing","kitchen","kite","kitten","kitty","kiwi","kleenex","knapsack","knee","knelt","knickers","knoll","koala","kooky","kosher","krypton","kudos","kung","labored","laborer","laboring","laborious","labrador","ladder","ladies","ladle","ladybug","ladylike","lagged","lagging","lagoon","lair","lake","lance","landed","landfall","landfill","landing","landlady","landless","landline","landlord","landmark","landmass","landmine","landowner","landscape","landside","landslide","language","lankiness","lanky","lantern","lapdog","lapel","lapped","lapping","laptop","lard","large","lark","lash","lasso","last","latch","late","lather","latitude","latrine","latter","latticed","launch","launder","laundry","laurel","lavender","lavish","laxative","lazily","laziness","lazy","lecturer","left","legacy","legal","legend","legged","leggings","legible","legibly","legislate","lego","legroom","legume","legwarmer","legwork","lemon","lend","length","lens","lent","leotard","lesser","letdown","lethargic","lethargy","letter","lettuce","level","leverage","levers","levitate","levitator","liability","liable","liberty","librarian","library","licking","licorice","lid","life","lifter","lifting","liftoff","ligament","likely","likeness","likewise","liking","lilac","lilly","lily","limb","limeade","limelight","limes","limit","limping","limpness","line","lingo","linguini","linguist","lining","linked","linoleum","linseed","lint","lion","lip","liquefy","liqueur","liquid","lisp","list","litigate","litigator","litmus","litter","little","livable","lived","lively","liver","livestock","lividly","living","lizard","lubricant","lubricate","lucid","luckily","luckiness","luckless","lucrative","ludicrous","lugged","lukewarm","lullaby","lumber","luminance","luminous","lumpiness","lumping","lumpish","lunacy","lunar","lunchbox","luncheon","lunchroom","lunchtime","lung","lurch","lure","luridness","lurk","lushly","lushness","luster","lustfully","lustily","lustiness","lustrous","lusty","luxurious","luxury","lying","lyrically","lyricism","lyricist","lyrics","macarena","macaroni","macaw","mace","machine","machinist","magazine","magenta","maggot","magical","magician","magma","magnesium","magnetic","magnetism","magnetize","magnifier","magnify","magnitude","magnolia","mahogany","maimed","majestic","majesty","majorette","majority","makeover","maker","makeshift","making","malformed","malt","mama","mammal","mammary","mammogram","manager","managing","manatee","mandarin","mandate","mandatory","mandolin","manger","mangle","mango","mangy","manhandle","manhole","manhood","manhunt","manicotti","manicure","manifesto","manila","mankind","manlike","manliness","manly","manmade","manned","mannish","manor","manpower","mantis","mantra","manual","many","map","marathon","marauding","marbled","marbles","marbling","march","mardi","margarine","margarita","margin","marigold","marina","marine","marital","maritime","marlin","marmalade","maroon","married","marrow","marry","marshland","marshy","marsupial","marvelous","marxism","mascot","masculine","mashed","mashing","massager","masses","massive","mastiff","matador","matchbook","matchbox","matcher","matching","matchless","material","maternal","maternity","math","mating","matriarch","matrimony","matrix","matron","matted","matter","maturely","maturing","maturity","mauve","maverick","maximize","maximum","maybe","mayday","mayflower","moaner","moaning","mobile","mobility","mobilize","mobster","mocha","mocker","mockup","modified","modify","modular","modulator","module","moisten","moistness","moisture","molar","molasses","mold","molecular","molecule","molehill","mollusk","mom","monastery","monday","monetary","monetize","moneybags","moneyless","moneywise","mongoose","mongrel","monitor","monkhood","monogamy","monogram","monologue","monopoly","monorail","monotone","monotype","monoxide","monsieur","monsoon","monstrous","monthly","monument","moocher","moodiness","moody","mooing","moonbeam","mooned","moonlight","moonlike","moonlit","moonrise","moonscape","moonshine","moonstone","moonwalk","mop","morale","morality","morally","morbidity","morbidly","morphine","morphing","morse","mortality","mortally","mortician","mortified","mortify","mortuary","mosaic","mossy","most","mothball","mothproof","motion","motivate","motivator","motive","motocross","motor","motto","mountable","mountain","mounted","mounting","mourner","mournful","mouse","mousiness","moustache","mousy","mouth","movable","move","movie","moving","mower","mowing","much","muck","mud","mug","mulberry","mulch","mule","mulled","mullets","multiple","multiply","multitask","multitude","mumble","mumbling","mumbo","mummified","mummify","mummy","mumps","munchkin","mundane","municipal","muppet","mural","murkiness","murky","murmuring","muscular","museum","mushily","mushiness","mushroom","mushy","music","musket","muskiness","musky","mustang","mustard","muster","mustiness","musty","mutable","mutate","mutation","mute","mutilated","mutilator","mutiny","mutt","mutual","muzzle","myself","myspace","mystified","mystify","myth","nacho","nag","nail","name","naming","nanny","nanometer","nape","napkin","napped","napping","nappy","narrow","nastily","nastiness","national","native","nativity","natural","nature","naturist","nautical","navigate","navigator","navy","nearby","nearest","nearly","nearness","neatly","neatness","nebula","nebulizer","nectar","negate","negation","negative","neglector","negligee","negligent","negotiate","nemeses","nemesis","neon","nephew","nerd","nervous","nervy","nest","net","neurology","neuron","neurosis","neurotic","neuter","neutron","never","next","nibble","nickname","nicotine","niece","nifty","nimble","nimbly","nineteen","ninetieth","ninja","nintendo","ninth","nuclear","nuclei","nucleus","nugget","nullify","number","numbing","numbly","numbness","numeral","numerate","numerator","numeric","numerous","nuptials","nursery","nursing","nurture","nutcase","nutlike","nutmeg","nutrient","nutshell","nuttiness","nutty","nuzzle","nylon","oaf","oak","oasis","oat","obedience","obedient","obituary","object","obligate","obliged","oblivion","oblivious","oblong","obnoxious","oboe","obscure","obscurity","observant","observer","observing","obsessed","obsession","obsessive","obsolete","obstacle","obstinate","obstruct","obtain","obtrusive","obtuse","obvious","occultist","occupancy","occupant","occupier","occupy","ocean","ocelot","octagon","octane","october","octopus","ogle","oil","oink","ointment","okay","old","olive","olympics","omega","omen","ominous","omission","omit","omnivore","onboard","oncoming","ongoing","onion","online","onlooker","only","onscreen","onset","onshore","onslaught","onstage","onto","onward","onyx","oops","ooze","oozy","opacity","opal","open","operable","operate","operating","operation","operative","operator","opium","opossum","opponent","oppose","opposing","opposite","oppressed","oppressor","opt","opulently","osmosis","other","otter","ouch","ought","ounce","outage","outback","outbid","outboard","outbound","outbreak","outburst","outcast","outclass","outcome","outdated","outdoors","outer","outfield","outfit","outflank","outgoing","outgrow","outhouse","outing","outlast","outlet","outline","outlook","outlying","outmatch","outmost","outnumber","outplayed","outpost","outpour","output","outrage","outrank","outreach","outright","outscore","outsell","outshine","outshoot","outsider","outskirts","outsmart","outsource","outspoken","outtakes","outthink","outward","outweigh","outwit","oval","ovary","oven","overact","overall","overarch","overbid","overbill","overbite","overblown","overboard","overbook","overbuilt","overcast","overcoat","overcome","overcook","overcrowd","overdraft","overdrawn","overdress","overdrive","overdue","overeager","overeater","overexert","overfed","overfeed","overfill","overflow","overfull","overgrown","overhand","overhang","overhaul","overhead","overhear","overheat","overhung","overjoyed","overkill","overlabor","overlaid","overlap","overlay","overload","overlook","overlord","overlying","overnight","overpass","overpay","overplant","overplay","overpower","overprice","overrate","overreach","overreact","override","overripe","overrule","overrun","overshoot","overshot","oversight","oversized","oversleep","oversold","overspend","overstate","overstay","overstep","overstock","overstuff","oversweet","overtake","overthrow","overtime","overtly","overtone","overture","overturn","overuse","overvalue","overview","overwrite","owl","oxford","oxidant","oxidation","oxidize","oxidizing","oxygen","oxymoron","oyster","ozone","paced","pacemaker","pacific","pacifier","pacifism","pacifist","pacify","padded","padding","paddle","paddling","padlock","pagan","pager","paging","pajamas","palace","palatable","palm","palpable","palpitate","paltry","pampered","pamperer","pampers","pamphlet","panama","pancake","pancreas","panda","pandemic","pang","panhandle","panic","panning","panorama","panoramic","panther","pantomime","pantry","pants","pantyhose","paparazzi","papaya","paper","paprika","papyrus","parabola","parachute","parade","paradox","paragraph","parakeet","paralegal","paralyses","paralysis","paralyze","paramedic","parameter","paramount","parasail","parasite","parasitic","parcel","parched","parchment","pardon","parish","parka","parking","parkway","parlor","parmesan","parole","parrot","parsley","parsnip","partake","parted","parting","partition","partly","partner","partridge","party","passable","passably","passage","passcode","passenger","passerby","passing","passion","passive","passivism","passover","passport","password","pasta","pasted","pastel","pastime","pastor","pastrami","pasture","pasty","patchwork","patchy","paternal","paternity","path","patience","patient","patio","patriarch","patriot","patrol","patronage","patronize","pauper","pavement","paver","pavestone","pavilion","paving","pawing","payable","payback","paycheck","payday","payee","payer","paying","payment","payphone","payroll","pebble","pebbly","pecan","pectin","peculiar","peddling","pediatric","pedicure","pedigree","pedometer","pegboard","pelican","pellet","pelt","pelvis","penalize","penalty","pencil","pendant","pending","penholder","penknife","pennant","penniless","penny","penpal","pension","pentagon","pentagram","pep","perceive","percent","perch","percolate","perennial","perfected","perfectly","perfume","periscope","perish","perjurer","perjury","perkiness","perky","perm","peroxide","perpetual","perplexed","persecute","persevere","persuaded","persuader","pesky","peso","pessimism","pessimist","pester","pesticide","petal","petite","petition","petri","petroleum","petted","petticoat","pettiness","petty","petunia","phantom","phobia","phoenix","phonebook","phoney","phonics","phoniness","phony","phosphate","photo","phrase","phrasing","placard","placate","placidly","plank","planner","plant","plasma","plaster","plastic","plated","platform","plating","platinum","platonic","platter","platypus","plausible","plausibly","playable","playback","player","playful","playgroup","playhouse","playing","playlist","playmaker","playmate","playoff","playpen","playroom","playset","plaything","playtime","plaza","pleading","pleat","pledge","plentiful","plenty","plethora","plexiglas","pliable","plod","plop","plot","plow","ploy","pluck","plug","plunder","plunging","plural","plus","plutonium","plywood","poach","pod","poem","poet","pogo","pointed","pointer","pointing","pointless","pointy","poise","poison","poker","poking","polar","police","policy","polio","polish","politely","polka","polo","polyester","polygon","polygraph","polymer","poncho","pond","pony","popcorn","pope","poplar","popper","poppy","popsicle","populace","popular","populate","porcupine","pork","porous","porridge","portable","portal","portfolio","porthole","portion","portly","portside","poser","posh","posing","possible","possibly","possum","postage","postal","postbox","postcard","posted","poster","posting","postnasal","posture","postwar","pouch","pounce","pouncing","pound","pouring","pout","powdered","powdering","powdery","power","powwow","pox","praising","prance","prancing","pranker","prankish","prankster","prayer","praying","preacher","preaching","preachy","preamble","precinct","precise","precision","precook","precut","predator","predefine","predict","preface","prefix","preflight","preformed","pregame","pregnancy","pregnant","preheated","prelaunch","prelaw","prelude","premiere","premises","premium","prenatal","preoccupy","preorder","prepaid","prepay","preplan","preppy","preschool","prescribe","preseason","preset","preshow","president","presoak","press","presume","presuming","preteen","pretended","pretender","pretense","pretext","pretty","pretzel","prevail","prevalent","prevent","preview","previous","prewar","prewashed","prideful","pried","primal","primarily","primary","primate","primer","primp","princess","print","prior","prism","prison","prissy","pristine","privacy","private","privatize","prize","proactive","probable","probably","probation","probe","probing","probiotic","problem","procedure","process","proclaim","procreate","procurer","prodigal","prodigy","produce","product","profane","profanity","professed","professor","profile","profound","profusely","progeny","prognosis","program","progress","projector","prologue","prolonged","promenade","prominent","promoter","promotion","prompter","promptly","prone","prong","pronounce","pronto","proofing","proofread","proofs","propeller","properly","property","proponent","proposal","propose","props","prorate","protector","protegee","proton","prototype","protozoan","protract","protrude","proud","provable","proved","proven","provided","provider","providing","province","proving","provoke","provoking","provolone","prowess","prowler","prowling","proximity","proxy","prozac","prude","prudishly","prune","pruning","pry","psychic","public","publisher","pucker","pueblo","pug","pull","pulmonary","pulp","pulsate","pulse","pulverize","puma","pumice","pummel","punch","punctual","punctuate","punctured","pungent","punisher","punk","pupil","puppet","puppy","purchase","pureblood","purebred","purely","pureness","purgatory","purge","purging","purifier","purify","purist","puritan","purity","purple","purplish","purposely","purr","purse","pursuable","pursuant","pursuit","purveyor","pushcart","pushchair","pusher","pushiness","pushing","pushover","pushpin","pushup","pushy","putdown","putt","puzzle","puzzling","pyramid","pyromania","python","quack","quadrant","quail","quaintly","quake","quaking","qualified","qualifier","qualify","quality","qualm","quantum","quarrel","quarry","quartered","quarterly","quarters","quartet","quench","query","quicken","quickly","quickness","quicksand","quickstep","quiet","quill","quilt","quintet","quintuple","quirk","quit","quiver","quizzical","quotable","quotation","quote","rabid","race","racing","racism","rack","racoon","radar","radial","radiance","radiantly","radiated","radiation","radiator","radio","radish","raffle","raft","rage","ragged","raging","ragweed","raider","railcar","railing","railroad","railway","raisin","rake","raking","rally","ramble","rambling","ramp","ramrod","ranch","rancidity","random","ranged","ranger","ranging","ranked","ranking","ransack","ranting","rants","rare","rarity","rascal","rash","rasping","ravage","raven","ravine","raving","ravioli","ravishing","reabsorb","reach","reacquire","reaction","reactive","reactor","reaffirm","ream","reanalyze","reappear","reapply","reappoint","reapprove","rearrange","rearview","reason","reassign","reassure","reattach","reawake","rebalance","rebate","rebel","rebirth","reboot","reborn","rebound","rebuff","rebuild","rebuilt","reburial","rebuttal","recall","recant","recapture","recast","recede","recent","recess","recharger","recipient","recital","recite","reckless","reclaim","recliner","reclining","recluse","reclusive","recognize","recoil","recollect","recolor","reconcile","reconfirm","reconvene","recopy","record","recount","recoup","recovery","recreate","rectal","rectangle","rectified","rectify","recycled","recycler","recycling","reemerge","reenact","reenter","reentry","reexamine","referable","referee","reference","refill","refinance","refined","refinery","refining","refinish","reflected","reflector","reflex","reflux","refocus","refold","reforest","reformat","reformed","reformer","reformist","refract","refrain","refreeze","refresh","refried","refueling","refund","refurbish","refurnish","refusal","refuse","refusing","refutable","refute","regain","regalia","regally","reggae","regime","region","register","registrar","registry","regress","regretful","regroup","regular","regulate","regulator","rehab","reheat","rehire","rehydrate","reimburse","reissue","reiterate","rejoice","rejoicing","rejoin","rekindle","relapse","relapsing","relatable","related","relation","relative","relax","relay","relearn","release","relenting","reliable","reliably","reliance","reliant","relic","relieve","relieving","relight","relish","relive","reload","relocate","relock","reluctant","rely","remake","remark","remarry","rematch","remedial","remedy","remember","reminder","remindful","remission","remix","remnant","remodeler","remold","remorse","remote","removable","removal","removed","remover","removing","rename","renderer","rendering","rendition","renegade","renewable","renewably","renewal","renewed","renounce","renovate","renovator","rentable","rental","rented","renter","reoccupy","reoccur","reopen","reorder","repackage","repacking","repaint","repair","repave","repaying","repayment","repeal","repeated","repeater","repent","rephrase","replace","replay","replica","reply","reporter","repose","repossess","repost","repressed","reprimand","reprint","reprise","reproach","reprocess","reproduce","reprogram","reps","reptile","reptilian","repugnant","repulsion","repulsive","repurpose","reputable","reputably","request","require","requisite","reroute","rerun","resale","resample","rescuer","reseal","research","reselect","reseller","resemble","resend","resent","reset","reshape","reshoot","reshuffle","residence","residency","resident","residual","residue","resigned","resilient","resistant","resisting","resize","resolute","resolved","resonant","resonate","resort","resource","respect","resubmit","result","resume","resupply","resurface","resurrect","retail","retainer","retaining","retake","retaliate","retention","rethink","retinal","retired","retiree","retiring","retold","retool","retorted","retouch","retrace","retract","retrain","retread","retreat","retrial","retrieval","retriever","retry","return","retying","retype","reunion","reunite","reusable","reuse","reveal","reveler","revenge","revenue","reverb","revered","reverence","reverend","reversal","reverse","reversing","reversion","revert","revisable","revise","revision","revisit","revivable","revival","reviver","reviving","revocable","revoke","revolt","revolver","revolving","reward","rewash","rewind","rewire","reword","rework","rewrap","rewrite","rhyme","ribbon","ribcage","rice","riches","richly","richness","rickety","ricotta","riddance","ridden","ride","riding","rifling","rift","rigging","rigid","rigor","rimless","rimmed","rind","rink","rinse","rinsing","riot","ripcord","ripeness","ripening","ripping","ripple","rippling","riptide","rise","rising","risk","risotto","ritalin","ritzy","rival","riverbank","riverbed","riverboat","riverside","riveter","riveting","roamer","roaming","roast","robbing","robe","robin","robotics","robust","rockband","rocker","rocket","rockfish","rockiness","rocking","rocklike","rockslide","rockstar","rocky","rogue","roman","romp","rope","roping","roster","rosy","rotten","rotting","rotunda","roulette","rounding","roundish","roundness","roundup","roundworm","routine","routing","rover","roving","royal","rubbed","rubber","rubbing","rubble","rubdown","ruby","ruckus","rudder","rug","ruined","rule","rumble","rumbling","rummage","rumor","runaround","rundown","runner","running","runny","runt","runway","rupture","rural","ruse","rush","rust","rut","sabbath","sabotage","sacrament","sacred","sacrifice","sadden","saddlebag","saddled","saddling","sadly","sadness","safari","safeguard","safehouse","safely","safeness","saffron","saga","sage","sagging","saggy","said","saint","sake","salad","salami","salaried","salary","saline","salon","saloon","salsa","salt","salutary","salute","salvage","salvaging","salvation","same","sample","sampling","sanction","sanctity","sanctuary","sandal","sandbag","sandbank","sandbar","sandblast","sandbox","sanded","sandfish","sanding","sandlot","sandpaper","sandpit","sandstone","sandstorm","sandworm","sandy","sanitary","sanitizer","sank","santa","sapling","sappiness","sappy","sarcasm","sarcastic","sardine","sash","sasquatch","sassy","satchel","satiable","satin","satirical","satisfied","satisfy","saturate","saturday","sauciness","saucy","sauna","savage","savanna","saved","savings","savior","savor","saxophone","say","scabbed","scabby","scalded","scalding","scale","scaling","scallion","scallop","scalping","scam","scandal","scanner","scanning","scant","scapegoat","scarce","scarcity","scarecrow","scared","scarf","scarily","scariness","scarring","scary","scavenger","scenic","schedule","schematic","scheme","scheming","schilling","schnapps","scholar","science","scientist","scion","scoff","scolding","scone","scoop","scooter","scope","scorch","scorebook","scorecard","scored","scoreless","scorer","scoring","scorn","scorpion","scotch","scoundrel","scoured","scouring","scouting","scouts","scowling","scrabble","scraggly","scrambled","scrambler","scrap","scratch","scrawny","screen","scribble","scribe","scribing","scrimmage","script","scroll","scrooge","scrounger","scrubbed","scrubber","scruffy","scrunch","scrutiny","scuba","scuff","sculptor","sculpture","scurvy","scuttle","secluded","secluding","seclusion","second","secrecy","secret","sectional","sector","secular","securely","security","sedan","sedate","sedation","sedative","sediment","seduce","seducing","segment","seismic","seizing","seldom","selected","selection","selective","selector","self","seltzer","semantic","semester","semicolon","semifinal","seminar","semisoft","semisweet","senate","senator","send","senior","senorita","sensation","sensitive","sensitize","sensually","sensuous","sepia","september","septic","septum","sequel","sequence","sequester","series","sermon","serotonin","serpent","serrated","serve","service","serving","sesame","sessions","setback","setting","settle","settling","setup","sevenfold","seventeen","seventh","seventy","severity","shabby","shack","shaded","shadily","shadiness","shading","shadow","shady","shaft","shakable","shakily","shakiness","shaking","shaky","shale","shallot","shallow","shame","shampoo","shamrock","shank","shanty","shape","shaping","share","sharpener","sharper","sharpie","sharply","sharpness","shawl","sheath","shed","sheep","sheet","shelf","shell","shelter","shelve","shelving","sherry","shield","shifter","shifting","shiftless","shifty","shimmer","shimmy","shindig","shine","shingle","shininess","shining","shiny","ship","shirt","shivering","shock","shone","shoplift","shopper","shopping","shoptalk","shore","shortage","shortcake","shortcut","shorten","shorter","shorthand","shortlist","shortly","shortness","shorts","shortwave","shorty","shout","shove","showbiz","showcase","showdown","shower","showgirl","showing","showman","shown","showoff","showpiece","showplace","showroom","showy","shrank","shrapnel","shredder","shredding","shrewdly","shriek","shrill","shrimp","shrine","shrink","shrivel","shrouded","shrubbery","shrubs","shrug","shrunk","shucking","shudder","shuffle","shuffling","shun","shush","shut","shy","siamese","siberian","sibling","siding","sierra","siesta","sift","sighing","silenced","silencer","silent","silica","silicon","silk","silliness","silly","silo","silt","silver","similarly","simile","simmering","simple","simplify","simply","sincere","sincerity","singer","singing","single","singular","sinister","sinless","sinner","sinuous","sip","siren","sister","sitcom","sitter","sitting","situated","situation","sixfold","sixteen","sixth","sixties","sixtieth","sixtyfold","sizable","sizably","size","sizing","sizzle","sizzling","skater","skating","skedaddle","skeletal","skeleton","skeptic","sketch","skewed","skewer","skid","skied","skier","skies","skiing","skilled","skillet","skillful","skimmed","skimmer","skimming","skimpily","skincare","skinhead","skinless","skinning","skinny","skintight","skipper","skipping","skirmish","skirt","skittle","skydiver","skylight","skyline","skype","skyrocket","skyward","slab","slacked","slacker","slacking","slackness","slacks","slain","slam","slander","slang","slapping","slapstick","slashed","slashing","slate","slather","slaw","sled","sleek","sleep","sleet","sleeve","slept","sliceable","sliced","slicer","slicing","slick","slider","slideshow","sliding","slighted","slighting","slightly","slimness","slimy","slinging","slingshot","slinky","slip","slit","sliver","slobbery","slogan","sloped","sloping","sloppily","sloppy","slot","slouching","slouchy","sludge","slug","slum","slurp","slush","sly","small","smartly","smartness","smasher","smashing","smashup","smell","smelting","smile","smilingly","smirk","smite","smith","smitten","smock","smog","smoked","smokeless","smokiness","smoking","smoky","smolder","smooth","smother","smudge","smudgy","smuggler","smuggling","smugly","smugness","snack","snagged","snaking","snap","snare","snarl","snazzy","sneak","sneer","sneeze","sneezing","snide","sniff","snippet","snipping","snitch","snooper","snooze","snore","snoring","snorkel","snort","snout","snowbird","snowboard","snowbound","snowcap","snowdrift","snowdrop","snowfall","snowfield","snowflake","snowiness","snowless","snowman","snowplow","snowshoe","snowstorm","snowsuit","snowy","snub","snuff","snuggle","snugly","snugness","speak","spearfish","spearhead","spearman","spearmint","species","specimen","specked","speckled","specks","spectacle","spectator","spectrum","speculate","speech","speed","spellbind","speller","spelling","spendable","spender","spending","spent","spew","sphere","spherical","sphinx","spider","spied","spiffy","spill","spilt","spinach","spinal","spindle","spinner","spinning","spinout","spinster","spiny","spiral","spirited","spiritism","spirits","spiritual","splashed","splashing","splashy","splatter","spleen","splendid","splendor","splice","splicing","splinter","splotchy","splurge","spoilage","spoiled","spoiler","spoiling","spoils","spoken","spokesman","sponge","spongy","sponsor","spoof","spookily","spooky","spool","spoon","spore","sporting","sports","sporty","spotless","spotlight","spotted","spotter","spotting","spotty","spousal","spouse","spout","sprain","sprang","sprawl","spray","spree","sprig","spring","sprinkled","sprinkler","sprint","sprite","sprout","spruce","sprung","spry","spud","spur","sputter","spyglass","squabble","squad","squall","squander","squash","squatted","squatter","squatting","squeak","squealer","squealing","squeamish","squeegee","squeeze","squeezing","squid","squiggle","squiggly","squint","squire","squirt","squishier","squishy","stability","stabilize","stable","stack","stadium","staff","stage","staging","stagnant","stagnate","stainable","stained","staining","stainless","stalemate","staleness","stalling","stallion","stamina","stammer","stamp","stand","stank","staple","stapling","starboard","starch","stardom","stardust","starfish","stargazer","staring","stark","starless","starlet","starlight","starlit","starring","starry","starship","starter","starting","startle","startling","startup","starved","starving","stash","state","static","statistic","statue","stature","status","statute","statutory","staunch","stays","steadfast","steadier","steadily","steadying","steam","steed","steep","steerable","steering","steersman","stegosaur","stellar","stem","stench","stencil","step","stereo","sterile","sterility","sterilize","sterling","sternness","sternum","stew","stick","stiffen","stiffly","stiffness","stifle","stifling","stillness","stilt","stimulant","stimulate","stimuli","stimulus","stinger","stingily","stinging","stingray","stingy","stinking","stinky","stipend","stipulate","stir","stitch","stock","stoic","stoke","stole","stomp","stonewall","stoneware","stonework","stoning","stony","stood","stooge","stool","stoop","stoplight","stoppable","stoppage","stopped","stopper","stopping","stopwatch","storable","storage","storeroom","storewide","storm","stout","stove","stowaway","stowing","straddle","straggler","strained","strainer","straining","strangely","stranger","strangle","strategic","strategy","stratus","straw","stray","streak","stream","street","strength","strenuous","strep","stress","stretch","strewn","stricken","strict","stride","strife","strike","striking","strive","striving","strobe","strode","stroller","strongbox","strongly","strongman","struck","structure","strudel","struggle","strum","strung","strut","stubbed","stubble","stubbly","stubborn","stucco","stuck","student","studied","studio","study","stuffed","stuffing","stuffy","stumble","stumbling","stump","stung","stunned","stunner","stunning","stunt","stupor","sturdily","sturdy","styling","stylishly","stylist","stylized","stylus","suave","subarctic","subatomic","subdivide","subdued","subduing","subfloor","subgroup","subheader","subject","sublease","sublet","sublevel","sublime","submarine","submerge","submersed","submitter","subpanel","subpar","subplot","subprime","subscribe","subscript","subsector","subside","subsiding","subsidize","subsidy","subsoil","subsonic","substance","subsystem","subtext","subtitle","subtly","subtotal","subtract","subtype","suburb","subway","subwoofer","subzero","succulent","such","suction","sudden","sudoku","suds","sufferer","suffering","suffice","suffix","suffocate","suffrage","sugar","suggest","suing","suitable","suitably","suitcase","suitor","sulfate","sulfide","sulfite","sulfur","sulk","sullen","sulphate","sulphuric","sultry","superbowl","superglue","superhero","superior","superjet","superman","supermom","supernova","supervise","supper","supplier","supply","support","supremacy","supreme","surcharge","surely","sureness","surface","surfacing","surfboard","surfer","surgery","surgical","surging","surname","surpass","surplus","surprise","surreal","surrender","surrogate","surround","survey","survival","survive","surviving","survivor","sushi","suspect","suspend","suspense","sustained","sustainer","swab","swaddling","swagger","swampland","swan","swapping","swarm","sway","swear","sweat","sweep","swell","swept","swerve","swifter","swiftly","swiftness","swimmable","swimmer","swimming","swimsuit","swimwear","swinger","swinging","swipe","swirl","switch","swivel","swizzle","swooned","swoop","swoosh","swore","sworn","swung","sycamore","sympathy","symphonic","symphony","symptom","synapse","syndrome","synergy","synopses","synopsis","synthesis","synthetic","syrup","system","t-shirt","tabasco","tabby","tableful","tables","tablet","tableware","tabloid","tackiness","tacking","tackle","tackling","tacky","taco","tactful","tactical","tactics","tactile","tactless","tadpole","taekwondo","tag","tainted","take","taking","talcum","talisman","tall","talon","tamale","tameness","tamer","tamper","tank","tanned","tannery","tanning","tantrum","tapeless","tapered","tapering","tapestry","tapioca","tapping","taps","tarantula","target","tarmac","tarnish","tarot","tartar","tartly","tartness","task","tassel","taste","tastiness","tasting","tasty","tattered","tattle","tattling","tattoo","taunt","tavern","thank","that","thaw","theater","theatrics","thee","theft","theme","theology","theorize","thermal","thermos","thesaurus","these","thesis","thespian","thicken","thicket","thickness","thieving","thievish","thigh","thimble","thing","think","thinly","thinner","thinness","thinning","thirstily","thirsting","thirsty","thirteen","thirty","thong","thorn","those","thousand","thrash","thread","threaten","threefold","thrift","thrill","thrive","thriving","throat","throbbing","throng","throttle","throwaway","throwback","thrower","throwing","thud","thumb","thumping","thursday","thus","thwarting","thyself","tiara","tibia","tidal","tidbit","tidiness","tidings","tidy","tiger","tighten","tightly","tightness","tightrope","tightwad","tigress","tile","tiling","till","tilt","timid","timing","timothy","tinderbox","tinfoil","tingle","tingling","tingly","tinker","tinkling","tinsel","tinsmith","tint","tinwork","tiny","tipoff","tipped","tipper","tipping","tiptoeing","tiptop","tiring","tissue","trace","tracing","track","traction","tractor","trade","trading","tradition","traffic","tragedy","trailing","trailside","train","traitor","trance","tranquil","transfer","transform","translate","transpire","transport","transpose","trapdoor","trapeze","trapezoid","trapped","trapper","trapping","traps","trash","travel","traverse","travesty","tray","treachery","treading","treadmill","treason","treat","treble","tree","trekker","tremble","trembling","tremor","trench","trend","trespass","triage","trial","triangle","tribesman","tribunal","tribune","tributary","tribute","triceps","trickery","trickily","tricking","trickle","trickster","tricky","tricolor","tricycle","trident","tried","trifle","trifocals","trillion","trilogy","trimester","trimmer","trimming","trimness","trinity","trio","tripod","tripping","triumph","trivial","trodden","trolling","trombone","trophy","tropical","tropics","trouble","troubling","trough","trousers","trout","trowel","truce","truck","truffle","trump","trunks","trustable","trustee","trustful","trusting","trustless","truth","try","tubby","tubeless","tubular","tucking","tuesday","tug","tuition","tulip","tumble","tumbling","tummy","turban","turbine","turbofan","turbojet","turbulent","turf","turkey","turmoil","turret","turtle","tusk","tutor","tutu","tux","tweak","tweed","tweet","tweezers","twelve","twentieth","twenty","twerp","twice","twiddle","twiddling","twig","twilight","twine","twins","twirl","twistable","twisted","twister","twisting","twisty","twitch","twitter","tycoon","tying","tyke","udder","ultimate","ultimatum","ultra","umbilical","umbrella","umpire","unabashed","unable","unadorned","unadvised","unafraid","unaired","unaligned","unaltered","unarmored","unashamed","unaudited","unawake","unaware","unbaked","unbalance","unbeaten","unbend","unbent","unbiased","unbitten","unblended","unblessed","unblock","unbolted","unbounded","unboxed","unbraided","unbridle","unbroken","unbuckled","unbundle","unburned","unbutton","uncanny","uncapped","uncaring","uncertain","unchain","unchanged","uncharted","uncheck","uncivil","unclad","unclaimed","unclamped","unclasp","uncle","unclip","uncloak","unclog","unclothed","uncoated","uncoiled","uncolored","uncombed","uncommon","uncooked","uncork","uncorrupt","uncounted","uncouple","uncouth","uncover","uncross","uncrown","uncrushed","uncured","uncurious","uncurled","uncut","undamaged","undated","undaunted","undead","undecided","undefined","underage","underarm","undercoat","undercook","undercut","underdog","underdone","underfed","underfeed","underfoot","undergo","undergrad","underhand","underline","underling","undermine","undermost","underpaid","underpass","underpay","underrate","undertake","undertone","undertook","undertow","underuse","underwear","underwent","underwire","undesired","undiluted","undivided","undocked","undoing","undone","undrafted","undress","undrilled","undusted","undying","unearned","unearth","unease","uneasily","uneasy","uneatable","uneaten","unedited","unelected","unending","unengaged","unenvied","unequal","unethical","uneven","unexpired","unexposed","unfailing","unfair","unfasten","unfazed","unfeeling","unfiled","unfilled","unfitted","unfitting","unfixable","unfixed","unflawed","unfocused","unfold","unfounded","unframed","unfreeze","unfrosted","unfrozen","unfunded","unglazed","ungloved","unglue","ungodly","ungraded","ungreased","unguarded","unguided","unhappily","unhappy","unharmed","unhealthy","unheard","unhearing","unheated","unhelpful","unhidden","unhinge","unhitched","unholy","unhook","unicorn","unicycle","unified","unifier","uniformed","uniformly","unify","unimpeded","uninjured","uninstall","uninsured","uninvited","union","uniquely","unisexual","unison","unissued","unit","universal","universe","unjustly","unkempt","unkind","unknotted","unknowing","unknown","unlaced","unlatch","unlawful","unleaded","unlearned","unleash","unless","unleveled","unlighted","unlikable","unlimited","unlined","unlinked","unlisted","unlit","unlivable","unloaded","unloader","unlocked","unlocking","unlovable","unloved","unlovely","unloving","unluckily","unlucky","unmade","unmanaged","unmanned","unmapped","unmarked","unmasked","unmasking","unmatched","unmindful","unmixable","unmixed","unmolded","unmoral","unmovable","unmoved","unmoving","unnamable","unnamed","unnatural","unneeded","unnerve","unnerving","unnoticed","unopened","unopposed","unpack","unpadded","unpaid","unpainted","unpaired","unpaved","unpeeled","unpicked","unpiloted","unpinned","unplanned","unplanted","unpleased","unpledged","unplowed","unplug","unpopular","unproven","unquote","unranked","unrated","unraveled","unreached","unread","unreal","unreeling","unrefined","unrelated","unrented","unrest","unretired","unrevised","unrigged","unripe","unrivaled","unroasted","unrobed","unroll","unruffled","unruly","unrushed","unsaddle","unsafe","unsaid","unsalted","unsaved","unsavory","unscathed","unscented","unscrew","unsealed","unseated","unsecured","unseeing","unseemly","unseen","unselect","unselfish","unsent","unsettled","unshackle","unshaken","unshaved","unshaven","unsheathe","unshipped","unsightly","unsigned","unskilled","unsliced","unsmooth","unsnap","unsocial","unsoiled","unsold","unsolved","unsorted","unspoiled","unspoken","unstable","unstaffed","unstamped","unsteady","unsterile","unstirred","unstitch","unstopped","unstuck","unstuffed","unstylish","unsubtle","unsubtly","unsuited","unsure","unsworn","untagged","untainted","untaken","untamed","untangled","untapped","untaxed","unthawed","unthread","untidy","untie","until","untimed","untimely","untitled","untoasted","untold","untouched","untracked","untrained","untreated","untried","untrimmed","untrue","untruth","unturned","untwist","untying","unusable","unused","unusual","unvalued","unvaried","unvarying","unveiled","unveiling","unvented","unviable","unvisited","unvocal","unwanted","unwarlike","unwary","unwashed","unwatched","unweave","unwed","unwelcome","unwell","unwieldy","unwilling","unwind","unwired","unwitting","unwomanly","unworldly","unworn","unworried","unworthy","unwound","unwoven","unwrapped","unwritten","unzip","upbeat","upchuck","upcoming","upcountry","update","upfront","upgrade","upheaval","upheld","uphill","uphold","uplifted","uplifting","upload","upon","upper","upright","uprising","upriver","uproar","uproot","upscale","upside","upstage","upstairs","upstart","upstate","upstream","upstroke","upswing","uptake","uptight","uptown","upturned","upward","upwind","uranium","urban","urchin","urethane","urgency","urgent","urging","urologist","urology","usable","usage","useable","used","uselessly","user","usher","usual","utensil","utility","utilize","utmost","utopia","utter","vacancy","vacant","vacate","vacation","vagabond","vagrancy","vagrantly","vaguely","vagueness","valiant","valid","valium","valley","valuables","value","vanilla","vanish","vanity","vanquish","vantage","vaporizer","variable","variably","varied","variety","various","varmint","varnish","varsity","varying","vascular","vaseline","vastly","vastness","veal","vegan","veggie","vehicular","velcro","velocity","velvet","vendetta","vending","vendor","veneering","vengeful","venomous","ventricle","venture","venue","venus","verbalize","verbally","verbose","verdict","verify","verse","version","versus","vertebrae","vertical","vertigo","very","vessel","vest","veteran","veto","vexingly","viability","viable","vibes","vice","vicinity","victory","video","viewable","viewer","viewing","viewless","viewpoint","vigorous","village","villain","vindicate","vineyard","vintage","violate","violation","violator","violet","violin","viper","viral","virtual","virtuous","virus","visa","viscosity","viscous","viselike","visible","visibly","vision","visiting","visitor","visor","vista","vitality","vitalize","vitally","vitamins","vivacious","vividly","vividness","vixen","vocalist","vocalize","vocally","vocation","voice","voicing","void","volatile","volley","voltage","volumes","voter","voting","voucher","vowed","vowel","voyage","wackiness","wad","wafer","waffle","waged","wager","wages","waggle","wagon","wake","waking","walk","walmart","walnut","walrus","waltz","wand","wannabe","wanted","wanting","wasabi","washable","washbasin","washboard","washbowl","washcloth","washday","washed","washer","washhouse","washing","washout","washroom","washstand","washtub","wasp","wasting","watch","water","waviness","waving","wavy","whacking","whacky","wham","wharf","wheat","whenever","whiff","whimsical","whinny","whiny","whisking","whoever","whole","whomever","whoopee","whooping","whoops","why","wick","widely","widen","widget","widow","width","wieldable","wielder","wife","wifi","wikipedia","wildcard","wildcat","wilder","wildfire","wildfowl","wildland","wildlife","wildly","wildness","willed","willfully","willing","willow","willpower","wilt","wimp","wince","wincing","wind","wing","winking","winner","winnings","winter","wipe","wired","wireless","wiring","wiry","wisdom","wise","wish","wisplike","wispy","wistful","wizard","wobble","wobbling","wobbly","wok","wolf","wolverine","womanhood","womankind","womanless","womanlike","womanly","womb","woof","wooing","wool","woozy","word","work","worried","worrier","worrisome","worry","worsening","worshiper","worst","wound","woven","wow","wrangle","wrath","wreath","wreckage","wrecker","wrecking","wrench","wriggle","wriggly","wrinkle","wrinkly","wrist","writing","written","wrongdoer","wronged","wrongful","wrongly","wrongness","wrought","xbox","xerox","yahoo","yam","yanking","yapping","yard","yarn","yeah","yearbook","yearling","yearly","yearning","yeast","yelling","yelp","yen","yesterday","yiddish","yield","yin","yippee","yo-yo","yodel","yoga","yogurt","yonder","yoyo","yummy","zap","zealous","zebra","zen","zeppelin","zero","zestfully","zesty","zigzagged","zipfile","zipping","zippy","zips","zit","zodiac","zombie","zone","zoning","zookeeper","zoologist","zoology","zoom"]).filter(e=>!e.includes("-")))},27776:function(e,t,r){"use strict";r.d(t,{A:function(){return m},Toaster:function(){return _}});var n=r(2265),i=r(54887),s=e=>{switch(e){case"success":return l;case"info":return c;case"warning":return u;case"error":return d;default:return null}},o=Array(12).fill(0),a=e=>{let{visible:t}=e;return n.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},n.createElement("div",{className:"sonner-spinner"},o.map((e,t)=>n.createElement("div",{className:"sonner-loading-bar",key:"spinner-bar-".concat(t)}))))},l=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),u=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),c=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),d=n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},n.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),h=()=>{let[e,t]=n.useState(document.hidden);return n.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e},f=1,p=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,i="number"==typeof(null==e?void 0:e.id)||(null==(t=e.id)?void 0:t.length)>0?e.id:f++,s=this.toasts.find(e=>e.id===i),o=void 0===e.dismissible||e.dismissible;return s?this.toasts=this.toasts.map(t=>t.id===i?(this.publish({...t,...e,id:i,title:r}),{...t,...e,id:i,dismissible:o,title:r}):t):this.addToast({title:r,...n,dismissible:o,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r;if(!t)return;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let n=e instanceof Promise?e:e(),i=void 0!==r;return n.then(async e=>{if(g(e)&&!e.ok){i=!1;let n="function"==typeof t.error?await t.error("HTTP error! status: ".concat(e.status)):t.error,s="function"==typeof t.description?await t.description("HTTP error! status: ".concat(e.status)):t.description;this.create({id:r,type:"error",message:n,description:s})}else if(void 0!==t.success){i=!1;let n="function"==typeof t.success?await t.success(e):t.success,s="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:s})}}).catch(async e=>{if(void 0!==t.error){i=!1;let n="function"==typeof t.error?await t.error(e):t.error,s="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:s})}}).finally(()=>{var e;i&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),r},this.custom=(e,t)=>{let r=(null==t?void 0:t.id)||f++;return this.create({jsx:e(r),id:r,...t}),r},this.subscribers=[],this.toasts=[]}},g=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,m=Object.assign((e,t)=>{let r=(null==t?void 0:t.id)||f++;return p.addToast({title:e,...t,id:r}),r},{success:p.success,info:p.info,warning:p.warning,error:p.error,custom:p.custom,message:p.message,promise:p.promise,dismiss:p.dismiss,loading:p.loading},{getHistory:()=>p.toasts});function y(e){return void 0!==e.label}function b(){for(var e=arguments.length,t=Array(e),r=0;r1&&void 0!==arguments[1]?arguments[1]:{};if(!e||"undefined"==typeof document)return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(':where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}\n');var v=e=>{var t,r,i,o,l,u,c,d,f,p;let{invert:g,toast:m,unstyled:b,interacting:v,setHeights:w,visibleToasts:_,heights:E,index:A,toasts:x,expanded:k,removeToast:S,defaultRichColors:$,closeButton:C,style:P,cancelButtonStyle:I,actionButtonStyle:O,className:N="",descriptionClassName:M="",duration:R,position:T,gap:D,loadingIcon:L,expandByDefault:j,classNames:B,icons:F,closeButtonAriaLabel:U="Close toast",pauseWhenPageIsHidden:z,cn:q}=e,[H,G]=n.useState(!1),[V,W]=n.useState(!1),[K,Y]=n.useState(!1),[Z,J]=n.useState(!1),[Q,X]=n.useState(0),[ee,et]=n.useState(0),er=n.useRef(null),en=n.useRef(null),ei=0===A,es=A+1<=_,eo=m.type,ea=!1!==m.dismissible,el=m.className||"",eu=m.descriptionClassName||"",ec=n.useMemo(()=>E.findIndex(e=>e.toastId===m.id)||0,[E,m.id]),ed=n.useMemo(()=>{var e;return null!=(e=m.closeButton)?e:C},[m.closeButton,C]),eh=n.useMemo(()=>m.duration||R||4e3,[m.duration,R]),ef=n.useRef(0),ep=n.useRef(0),eg=n.useRef(0),em=n.useRef(null),[ey,eb]=T.split("-"),ev=n.useMemo(()=>E.reduce((e,t,r)=>r>=ec?e:e+t.height,0),[E,ec]),ew=h(),e_=m.invert||g,eE="loading"===eo;ep.current=n.useMemo(()=>ec*D+ev,[ec,ev]),n.useEffect(()=>{G(!0)},[]),n.useLayoutEffect(()=>{if(!H)return;let e=en.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,et(r),w(e=>e.find(e=>e.toastId===m.id)?e.map(e=>e.toastId===m.id?{...e,height:r}:e):[{toastId:m.id,height:r,position:m.position},...e])},[H,m.title,m.description,w,m.id]);let eA=n.useCallback(()=>{W(!0),X(ep.current),w(e=>e.filter(e=>e.toastId!==m.id)),setTimeout(()=>{S(m)},200)},[m,S,w,ep]);return n.useEffect(()=>{if(m.promise&&"loading"===eo||m.duration===1/0||"loading"===m.type)return;let e,t=eh;return k||v||z&&ew?(()=>{if(eg.current{var e;null==(e=m.onAutoClose)||e.call(m,m),eA()},t)),()=>clearTimeout(e)},[k,v,j,m,eh,eA,m.promise,eo,z,ew]),n.useEffect(()=>{let e=en.current;if(e){let t=e.getBoundingClientRect().height;return et(t),w(e=>[{toastId:m.id,height:t,position:m.position},...e]),()=>w(e=>e.filter(e=>e.toastId!==m.id))}},[w,m.id]),n.useEffect(()=>{m.delete&&eA()},[eA,m.delete]),n.createElement("li",{"aria-live":m.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:en,className:q(N,el,null==B?void 0:B.toast,null==(t=null==m?void 0:m.classNames)?void 0:t.toast,null==B?void 0:B.default,null==B?void 0:B[eo],null==(r=null==m?void 0:m.classNames)?void 0:r[eo]),"data-sonner-toast":"","data-rich-colors":null!=(i=m.richColors)?i:$,"data-styled":!(m.jsx||m.unstyled||b),"data-mounted":H,"data-promise":!!m.promise,"data-removed":V,"data-visible":es,"data-y-position":ey,"data-x-position":eb,"data-index":A,"data-front":ei,"data-swiping":K,"data-dismissible":ea,"data-type":eo,"data-invert":e_,"data-swipe-out":Z,"data-expanded":!!(k||j&&H),style:{"--index":A,"--toasts-before":A,"--z-index":x.length-A,"--offset":"".concat(V?Q:ep.current,"px"),"--initial-height":j?"auto":"".concat(ee,"px"),...P,...m.style},onPointerDown:e=>{eE||!ea||(er.current=new Date,X(ep.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(Y(!0),em.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(Z||!ea)return;em.current=null;let i=Number((null==(e=en.current)?void 0:e.style.getPropertyValue("--swipe-amount").replace("px",""))||0),s=new Date().getTime()-(null==(t=er.current)?void 0:t.getTime());if(Math.abs(i)>=20||Math.abs(i)/s>.11){X(ep.current),null==(r=m.onDismiss)||r.call(m,m),eA(),J(!0);return}null==(n=en.current)||n.style.setProperty("--swipe-amount","0px"),Y(!1)},onPointerMove:e=>{var t;if(!em.current||!ea)return;let r=e.clientY-em.current.y,n=e.clientX-em.current.x,i=("top"===ey?Math.min:Math.max)(0,r),s="touch"===e.pointerType?10:2;Math.abs(i)>s?null==(t=en.current)||t.style.setProperty("--swipe-amount","".concat(r,"px")):Math.abs(n)>s&&(em.current=null)}},ed&&!m.jsx?n.createElement("button",{"aria-label":U,"data-disabled":eE,"data-close-button":!0,onClick:eE||!ea?()=>{}:()=>{var e;eA(),null==(e=m.onDismiss)||e.call(m,m)},className:q(null==B?void 0:B.closeButton,null==(o=null==m?void 0:m.classNames)?void 0:o.closeButton)},n.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},n.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),n.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,m.jsx||n.isValidElement(m.title)?m.jsx||m.title:n.createElement(n.Fragment,null,eo||m.icon||m.promise?n.createElement("div",{"data-icon":"",className:q(null==B?void 0:B.icon,null==(l=null==m?void 0:m.classNames)?void 0:l.icon)},m.promise||"loading"===m.type&&!m.icon?m.icon||(null!=F&&F.loading?n.createElement("div",{className:"sonner-loader","data-visible":"loading"===eo},F.loading):L?n.createElement("div",{className:"sonner-loader","data-visible":"loading"===eo},L):n.createElement(a,{visible:"loading"===eo})):null,"loading"!==m.type?m.icon||(null==F?void 0:F[eo])||s(eo):null):null,n.createElement("div",{"data-content":"",className:q(null==B?void 0:B.content,null==(u=null==m?void 0:m.classNames)?void 0:u.content)},n.createElement("div",{"data-title":"",className:q(null==B?void 0:B.title,null==(c=null==m?void 0:m.classNames)?void 0:c.title)},m.title),m.description?n.createElement("div",{"data-description":"",className:q(M,eu,null==B?void 0:B.description,null==(d=null==m?void 0:m.classNames)?void 0:d.description)},m.description):null),n.isValidElement(m.cancel)?m.cancel:m.cancel&&y(m.cancel)?n.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||I,onClick:e=>{var t,r;y(m.cancel)&&ea&&(null==(r=(t=m.cancel).onClick)||r.call(t,e),eA())},className:q(null==B?void 0:B.cancelButton,null==(f=null==m?void 0:m.classNames)?void 0:f.cancelButton)},m.cancel.label):null,n.isValidElement(m.action)?m.action:m.action&&y(m.action)?n.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||O,onClick:e=>{var t,r;y(m.action)&&(e.defaultPrevented||(null==(r=(t=m.action).onClick)||r.call(t,e),eA()))},className:q(null==B?void 0:B.actionButton,null==(p=null==m?void 0:m.classNames)?void 0:p.actionButton)},m.action.label):null))};function w(){if("undefined"==typeof window||"undefined"==typeof document)return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}var _=e=>{let{invert:t,position:r="bottom-right",hotkey:s=["altKey","KeyT"],expand:o,closeButton:a,className:l,offset:u,theme:c="light",richColors:d,duration:h,style:f,visibleToasts:g=3,toastOptions:m,dir:y=w(),gap:_=14,loadingIcon:E,icons:A,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:k,cn:S=b}=e,[$,C]=n.useState([]),P=n.useMemo(()=>Array.from(new Set([r].concat($.filter(e=>e.position).map(e=>e.position)))),[$,r]),[I,O]=n.useState([]),[N,M]=n.useState(!1),[R,T]=n.useState(!1),[D,L]=n.useState("system"!==c?c:"undefined"!=typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),j=n.useRef(null),B=s.join("+").replace(/Key/g,"").replace(/Digit/g,""),F=n.useRef(null),U=n.useRef(!1),z=n.useCallback(e=>{var t;null!=(t=$.find(t=>t.id===e.id))&&t.delete||p.dismiss(e.id),C(t=>t.filter(t=>{let{id:r}=t;return r!==e.id}))},[$]);return n.useEffect(()=>p.subscribe(e=>{if(e.dismiss){C(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t));return}setTimeout(()=>{i.flushSync(()=>{C(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),n.useEffect(()=>{if("system"!==c){L(c);return}"system"===c&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),"undefined"!=typeof window&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",e=>{let{matches:t}=e;L(t?"dark":"light")})},[c]),n.useEffect(()=>{$.length<=1&&M(!1)},[$]),n.useEffect(()=>{let e=e=>{var t,r;s.every(t=>e[t]||e.code===t)&&(M(!0),null==(t=j.current)||t.focus()),"Escape"===e.code&&(document.activeElement===j.current||null!=(r=j.current)&&r.contains(document.activeElement))&&M(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[s]),n.useEffect(()=>{if(j.current)return()=>{F.current&&(F.current.focus({preventScroll:!0}),F.current=null,U.current=!1)}},[j.current]),$.length?n.createElement("section",{"aria-label":"".concat(x," ").concat(B),tabIndex:-1},P.map((e,r)=>{var i;let[s,c]=e.split("-");return n.createElement("ol",{key:e,dir:"auto"===y?w():y,tabIndex:-1,ref:j,className:l,"data-sonner-toaster":!0,"data-theme":D,"data-y-position":s,"data-x-position":c,style:{"--front-toast-height":"".concat((null==(i=I[0])?void 0:i.height)||0,"px"),"--offset":"number"==typeof u?"".concat(u,"px"):u||"32px","--width":"".concat(356,"px"),"--gap":"".concat(_,"px"),...f},onBlur:e=>{U.current&&!e.currentTarget.contains(e.relatedTarget)&&(U.current=!1,F.current&&(F.current.focus({preventScroll:!0}),F.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||U.current||(U.current=!0,F.current=e.relatedTarget)},onMouseEnter:()=>M(!0),onMouseMove:()=>M(!0),onMouseLeave:()=>{R||M(!1)},onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||T(!0)},onPointerUp:()=>T(!1)},$.filter(t=>!t.position&&0===r||t.position===e).map((r,i)=>{var s,l;return n.createElement(v,{key:r.id,icons:A,index:i,toast:r,defaultRichColors:d,duration:null!=(s=null==m?void 0:m.duration)?s:h,className:null==m?void 0:m.className,descriptionClassName:null==m?void 0:m.descriptionClassName,invert:t,visibleToasts:g,closeButton:null!=(l=null==m?void 0:m.closeButton)?l:a,interacting:R,position:e,style:null==m?void 0:m.style,unstyled:null==m?void 0:m.unstyled,classNames:null==m?void 0:m.classNames,cancelButtonStyle:null==m?void 0:m.cancelButtonStyle,actionButtonStyle:null==m?void 0:m.actionButtonStyle,removeToast:z,toasts:$.filter(e=>e.position==r.position),heights:I.filter(e=>e.position==r.position),setHeights:O,expandByDefault:o,gap:_,loadingIcon:E,expanded:N,pauseWhenPageIsHidden:k,cn:S})}))})):null}},13130:function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}r.d(t,{Z:function(){return u}});var i,s,o,a=/^\s+/,l=/\s+$/;function u(e,t){if(t=t||{},(e=e||"")instanceof u)return e;if(!(this instanceof u))return new u(e,t);var r,i,s,o,c,d,h,f,p,g,m,y,b,v,w,_,E,A,x,k,$=(i={r:0,g:0,b:0},s=1,o=null,c=null,d=null,h=!1,f=!1,"string"==typeof(r=e)&&(r=function(e){e=e.replace(a,"").replace(l,"").toLowerCase();var t,r=!1;if(S[e])e=S[e],r=!0;else if("transparent"==e)return{r:0,g:0,b:0,a:0,format:"name"};return(t=T.rgb.exec(e))?{r:t[1],g:t[2],b:t[3]}:(t=T.rgba.exec(e))?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=T.hsl.exec(e))?{h:t[1],s:t[2],l:t[3]}:(t=T.hsla.exec(e))?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=T.hsv.exec(e))?{h:t[1],s:t[2],v:t[3]}:(t=T.hsva.exec(e))?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=T.hex8.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),a:O(t[4])/255,format:r?"name":"hex8"}:(t=T.hex6.exec(e))?{r:O(t[1]),g:O(t[2]),b:O(t[3]),format:r?"name":"hex"}:(t=T.hex4.exec(e))?{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),a:O(t[4]+""+t[4])/255,format:r?"name":"hex8"}:!!(t=T.hex3.exec(e))&&{r:O(t[1]+""+t[1]),g:O(t[2]+""+t[2]),b:O(t[3]+""+t[3]),format:r?"name":"hex"}}(r)),"object"==n(r)&&(D(r.r)&&D(r.g)&&D(r.b)?(p=r.r,g=r.g,m=r.b,i={r:255*P(p,255),g:255*P(g,255),b:255*P(m,255)},h=!0,f="%"===String(r.r).substr(-1)?"prgb":"rgb"):D(r.h)&&D(r.s)&&D(r.v)?(o=M(r.s),c=M(r.v),y=r.h,b=o,v=c,y=6*P(y,360),b=P(b,100),v=P(v,100),w=Math.floor(y),_=y-w,E=v*(1-b),A=v*(1-_*b),x=v*(1-(1-_)*b),i={r:255*[v,A,E,E,x,v][k=w%6],g:255*[x,v,v,A,E,E][k],b:255*[E,E,x,v,v,A][k]},h=!0,f="hsv"):D(r.h)&&D(r.s)&&D(r.l)&&(o=M(r.s),d=M(r.l),i=function(e,t,r){var n,i,s;function o(e,t,r){return(r<0&&(r+=1),r>1&&(r-=1),r<1/6)?e+(t-e)*6*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}if(e=P(e,360),t=P(t,100),r=P(r,100),0===t)n=i=s=r;else{var a=r<.5?r*(1+t):r+t-r*t,l=2*r-a;n=o(l,a,e+1/3),i=o(l,a,e),s=o(l,a,e-1/3)}return{r:255*n,g:255*i,b:255*s}}(r.h,o,d),h=!0,f="hsl"),r.hasOwnProperty("a")&&(s=r.a)),s=C(s),{ok:h,format:r.format||f,r:Math.min(255,Math.max(i.r,0)),g:Math.min(255,Math.max(i.g,0)),b:Math.min(255,Math.max(i.b,0)),a:s});this._originalInput=e,this._r=$.r,this._g=$.g,this._b=$.b,this._a=$.a,this._roundA=Math.round(100*this._a)/100,this._format=t.format||$.format,this._gradientType=t.gradientType,this._r<1&&(this._r=Math.round(this._r)),this._g<1&&(this._g=Math.round(this._g)),this._b<1&&(this._b=Math.round(this._b)),this._ok=$.ok}function c(e,t,r){var n,i,s=Math.max(e=P(e,255),t=P(t,255),r=P(r,255)),o=Math.min(e,t,r),a=(s+o)/2;if(s==o)n=i=0;else{var l=s-o;switch(i=a>.5?l/(2-s-o):l/(s+o),s){case e:n=(t-r)/l+(t>1)+720)%360;--t;)n.h=(n.h+i)%360,s.push(u(n));return s}function k(e,t){t=t||6;for(var r=u(e).toHsv(),n=r.h,i=r.s,s=r.v,o=[],a=1/t;t--;)o.push(u({h:n,s:i,v:s})),s=(s+a)%1;return o}u.prototype={isDark:function(){return 128>this.getBrightness()},isLight:function(){return!this.isDark()},isValid:function(){return this._ok},getOriginalInput:function(){return this._originalInput},getFormat:function(){return this._format},getAlpha:function(){return this._a},getBrightness:function(){var e=this.toRgb();return(299*e.r+587*e.g+114*e.b)/1e3},getLuminance:function(){var e,t,r,n=this.toRgb();return e=n.r/255,.2126*(e<=.03928?e/12.92:Math.pow((e+.055)/1.055,2.4))+.7152*((t=n.g/255)<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.0722*((r=n.b/255)<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))},setAlpha:function(e){return this._a=C(e),this._roundA=Math.round(100*this._a)/100,this},toHsv:function(){var e=d(this._r,this._g,this._b);return{h:360*e.h,s:e.s,v:e.v,a:this._a}},toHsvString:function(){var e=d(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.v);return 1==this._a?"hsv("+t+", "+r+"%, "+n+"%)":"hsva("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHsl:function(){var e=c(this._r,this._g,this._b);return{h:360*e.h,s:e.s,l:e.l,a:this._a}},toHslString:function(){var e=c(this._r,this._g,this._b),t=Math.round(360*e.h),r=Math.round(100*e.s),n=Math.round(100*e.l);return 1==this._a?"hsl("+t+", "+r+"%, "+n+"%)":"hsla("+t+", "+r+"%, "+n+"%, "+this._roundA+")"},toHex:function(e){return h(this._r,this._g,this._b,e)},toHexString:function(e){return"#"+this.toHex(e)},toHex8:function(e){var t,r,n,i,s;return t=this._r,r=this._g,n=this._b,i=this._a,s=[N(Math.round(t).toString(16)),N(Math.round(r).toString(16)),N(Math.round(n).toString(16)),N(R(i))],e&&s[0].charAt(0)==s[0].charAt(1)&&s[1].charAt(0)==s[1].charAt(1)&&s[2].charAt(0)==s[2].charAt(1)&&s[3].charAt(0)==s[3].charAt(1)?s[0].charAt(0)+s[1].charAt(0)+s[2].charAt(0)+s[3].charAt(0):s.join("")},toHex8String:function(e){return"#"+this.toHex8(e)},toRgb:function(){return{r:Math.round(this._r),g:Math.round(this._g),b:Math.round(this._b),a:this._a}},toRgbString:function(){return 1==this._a?"rgb("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+")":"rgba("+Math.round(this._r)+", "+Math.round(this._g)+", "+Math.round(this._b)+", "+this._roundA+")"},toPercentageRgb:function(){return{r:Math.round(100*P(this._r,255))+"%",g:Math.round(100*P(this._g,255))+"%",b:Math.round(100*P(this._b,255))+"%",a:this._a}},toPercentageRgbString:function(){return 1==this._a?"rgb("+Math.round(100*P(this._r,255))+"%, "+Math.round(100*P(this._g,255))+"%, "+Math.round(100*P(this._b,255))+"%)":"rgba("+Math.round(100*P(this._r,255))+"%, "+Math.round(100*P(this._g,255))+"%, "+Math.round(100*P(this._b,255))+"%, "+this._roundA+")"},toName:function(){return 0===this._a?"transparent":!(this._a<1)&&($[h(this._r,this._g,this._b,!0)]||!1)},toFilter:function(e){var t="#"+f(this._r,this._g,this._b,this._a),r=t,n=this._gradientType?"GradientType = 1, ":"";if(e){var i=u(e);r="#"+f(i._r,i._g,i._b,i._a)}return"progid:DXImageTransform.Microsoft.gradient("+n+"startColorstr="+t+",endColorstr="+r+")"},toString:function(e){var t=!!e;e=e||this._format;var r=!1,n=this._a<1&&this._a>=0;return!t&&n&&("hex"===e||"hex6"===e||"hex3"===e||"hex4"===e||"hex8"===e||"name"===e)?"name"===e&&0===this._a?this.toName():this.toRgbString():("rgb"===e&&(r=this.toRgbString()),"prgb"===e&&(r=this.toPercentageRgbString()),("hex"===e||"hex6"===e)&&(r=this.toHexString()),"hex3"===e&&(r=this.toHexString(!0)),"hex4"===e&&(r=this.toHex8String(!0)),"hex8"===e&&(r=this.toHex8String()),"name"===e&&(r=this.toName()),"hsl"===e&&(r=this.toHslString()),"hsv"===e&&(r=this.toHsvString()),r||this.toHexString())},clone:function(){return u(this.toString())},_applyModification:function(e,t){var r=e.apply(null,[this].concat([].slice.call(t)));return this._r=r._r,this._g=r._g,this._b=r._b,this.setAlpha(r._a),this},lighten:function(){return this._applyModification(y,arguments)},brighten:function(){return this._applyModification(b,arguments)},darken:function(){return this._applyModification(v,arguments)},desaturate:function(){return this._applyModification(p,arguments)},saturate:function(){return this._applyModification(g,arguments)},greyscale:function(){return this._applyModification(m,arguments)},spin:function(){return this._applyModification(w,arguments)},_applyCombination:function(e,t){return e.apply(null,[this].concat([].slice.call(t)))},analogous:function(){return this._applyCombination(x,arguments)},complement:function(){return this._applyCombination(_,arguments)},monochromatic:function(){return this._applyCombination(k,arguments)},splitcomplement:function(){return this._applyCombination(A,arguments)},triad:function(){return this._applyCombination(E,[3])},tetrad:function(){return this._applyCombination(E,[4])}},u.fromRatio=function(e,t){if("object"==n(e)){var r={};for(var i in e)e.hasOwnProperty(i)&&("a"===i?r[i]=e[i]:r[i]=M(e[i]));e=r}return u(e,t)},u.equals=function(e,t){return!!e&&!!t&&u(e).toRgbString()==u(t).toRgbString()},u.random=function(){return u.fromRatio({r:Math.random(),g:Math.random(),b:Math.random()})},u.mix=function(e,t,r){r=0===r?0:r||50;var n=u(e).toRgb(),i=u(t).toRgb(),s=r/100;return u({r:(i.r-n.r)*s+n.r,g:(i.g-n.g)*s+n.g,b:(i.b-n.b)*s+n.b,a:(i.a-n.a)*s+n.a})},u.readability=function(e,t){var r=u(e),n=u(t);return(Math.max(r.getLuminance(),n.getLuminance())+.05)/(Math.min(r.getLuminance(),n.getLuminance())+.05)},u.isReadable=function(e,t,r){var n,i,s,o,a,l=u.readability(e,t);switch(a=!1,(i=((n=(n=r)||{level:"AA",size:"small"}).level||"AA").toUpperCase(),s=(n.size||"small").toLowerCase(),"AA"!==i&&"AAA"!==i&&(i="AA"),"small"!==s&&"large"!==s&&(s="small"),o={level:i,size:s}).level+o.size){case"AAsmall":case"AAAlarge":a=l>=4.5;break;case"AAlarge":a=l>=3;break;case"AAAsmall":a=l>=7}return a},u.mostReadable=function(e,t,r){var n,i,s,o,a=null,l=0;i=(r=r||{}).includeFallbackColors,s=r.level,o=r.size;for(var c=0;cl&&(l=n,a=u(t[c]));return u.isReadable(e,a,{level:s,size:o})||!i?a:(r.includeFallbackColors=!1,u.mostReadable(e,["#fff","#000"],r))};var S=u.names={aliceblue:"f0f8ff",antiquewhite:"faebd7",aqua:"0ff",aquamarine:"7fffd4",azure:"f0ffff",beige:"f5f5dc",bisque:"ffe4c4",black:"000",blanchedalmond:"ffebcd",blue:"00f",blueviolet:"8a2be2",brown:"a52a2a",burlywood:"deb887",burntsienna:"ea7e5d",cadetblue:"5f9ea0",chartreuse:"7fff00",chocolate:"d2691e",coral:"ff7f50",cornflowerblue:"6495ed",cornsilk:"fff8dc",crimson:"dc143c",cyan:"0ff",darkblue:"00008b",darkcyan:"008b8b",darkgoldenrod:"b8860b",darkgray:"a9a9a9",darkgreen:"006400",darkgrey:"a9a9a9",darkkhaki:"bdb76b",darkmagenta:"8b008b",darkolivegreen:"556b2f",darkorange:"ff8c00",darkorchid:"9932cc",darkred:"8b0000",darksalmon:"e9967a",darkseagreen:"8fbc8f",darkslateblue:"483d8b",darkslategray:"2f4f4f",darkslategrey:"2f4f4f",darkturquoise:"00ced1",darkviolet:"9400d3",deeppink:"ff1493",deepskyblue:"00bfff",dimgray:"696969",dimgrey:"696969",dodgerblue:"1e90ff",firebrick:"b22222",floralwhite:"fffaf0",forestgreen:"228b22",fuchsia:"f0f",gainsboro:"dcdcdc",ghostwhite:"f8f8ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",grey:"808080",honeydew:"f0fff0",hotpink:"ff69b4",indianred:"cd5c5c",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lavender:"e6e6fa",lavenderblush:"fff0f5",lawngreen:"7cfc00",lemonchiffon:"fffacd",lightblue:"add8e6",lightcoral:"f08080",lightcyan:"e0ffff",lightgoldenrodyellow:"fafad2",lightgray:"d3d3d3",lightgreen:"90ee90",lightgrey:"d3d3d3",lightpink:"ffb6c1",lightsalmon:"ffa07a",lightseagreen:"20b2aa",lightskyblue:"87cefa",lightslategray:"789",lightslategrey:"789",lightsteelblue:"b0c4de",lightyellow:"ffffe0",lime:"0f0",limegreen:"32cd32",linen:"faf0e6",magenta:"f0f",maroon:"800000",mediumaquamarine:"66cdaa",mediumblue:"0000cd",mediumorchid:"ba55d3",mediumpurple:"9370db",mediumseagreen:"3cb371",mediumslateblue:"7b68ee",mediumspringgreen:"00fa9a",mediumturquoise:"48d1cc",mediumvioletred:"c71585",midnightblue:"191970",mintcream:"f5fffa",mistyrose:"ffe4e1",moccasin:"ffe4b5",navajowhite:"ffdead",navy:"000080",oldlace:"fdf5e6",olive:"808000",olivedrab:"6b8e23",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",palegoldenrod:"eee8aa",palegreen:"98fb98",paleturquoise:"afeeee",palevioletred:"db7093",papayawhip:"ffefd5",peachpuff:"ffdab9",peru:"cd853f",pink:"ffc0cb",plum:"dda0dd",powderblue:"b0e0e6",purple:"800080",rebeccapurple:"663399",red:"f00",rosybrown:"bc8f8f",royalblue:"4169e1",saddlebrown:"8b4513",salmon:"fa8072",sandybrown:"f4a460",seagreen:"2e8b57",seashell:"fff5ee",sienna:"a0522d",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",slategrey:"708090",snow:"fffafa",springgreen:"00ff7f",steelblue:"4682b4",tan:"d2b48c",teal:"008080",thistle:"d8bfd8",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"fff",whitesmoke:"f5f5f5",yellow:"ff0",yellowgreen:"9acd32"},$=u.hexNames=function(e){var t={};for(var r in e)e.hasOwnProperty(r)&&(t[e[r]]=r);return t}(S);function C(e){return(isNaN(e=parseFloat(e))||e<0||e>1)&&(e=1),e}function P(e,t){"string"==typeof(r=e)&&-1!=r.indexOf(".")&&1===parseFloat(r)&&(e="100%");var r,n,i="string"==typeof(n=e)&&-1!=n.indexOf("%");return(e=Math.min(t,Math.max(0,parseFloat(e))),i&&(e=parseInt(e*t,10)/100),1e-6>Math.abs(e-t))?1:e%t/parseFloat(t)}function I(e){return Math.min(1,Math.max(0,e))}function O(e){return parseInt(e,16)}function N(e){return 1==e.length?"0"+e:""+e}function M(e){return e<=1&&(e=100*e+"%"),e}function R(e){return Math.round(255*parseFloat(e)).toString(16)}var T=(s="[\\s|\\(]+("+(i="(?:[-\\+]?\\d*\\.\\d+%?)|(?:[-\\+]?\\d+%?)")+")[,|\\s]+("+i+")[,|\\s]+("+i+")\\s*\\)?",o="[\\s|\\(]+("+i+")[,|\\s]+("+i+")[,|\\s]+("+i+")[,|\\s]+("+i+")\\s*\\)?",{CSS_UNIT:new RegExp(i),rgb:RegExp("rgb"+s),rgba:RegExp("rgba"+o),hsl:RegExp("hsl"+s),hsla:RegExp("hsla"+o),hsv:RegExp("hsv"+s),hsva:RegExp("hsva"+o),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/});function D(e){return!!T.CSS_UNIT.exec(e)}},69199:function(e,t,r){"use strict";function n(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}r.d(t,{E:function(){return n}})},69717:function(e,t,r){"use strict";r.d(t,{z:function(){return i}});var n=r(69199);function i(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=(0,n.E)(t),i=0;for(let t of e)r.set(t,i),i+=t.length;return r}},55522:function(e,t,r){"use strict";r.d(t,{m:function(){return i}});var n=r(49112);function i(e,t="utf8"){let r=n.Z[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e,"utf8"):r.decoder.decode(`${r.prefix}${e}`)}},39613:function(e,t,r){"use strict";r.d(t,{BB:function(){return s.B},mL:function(){return i.m},zo:function(){return n.z}});var n=r(69717),i=r(55522),s=r(3767)},3767:function(e,t,r){"use strict";r.d(t,{B:function(){return i}});var n=r(49112);function i(e,t="utf8"){let r=n.Z[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}},49112:function(e,t,r){"use strict";r.d(t,{Z:function(){return eW}});var n={};r.r(n),r.d(n,{identity:function(){return N}});var i={};r.r(i),r.d(i,{base2:function(){return M}});var s={};r.r(s),r.d(s,{base8:function(){return R}});var o={};r.r(o),r.d(o,{base10:function(){return T}});var a={};r.r(a),r.d(a,{base16:function(){return D},base16upper:function(){return L}});var l={};r.r(l),r.d(l,{base32:function(){return j},base32hex:function(){return z},base32hexpad:function(){return H},base32hexpadupper:function(){return G},base32hexupper:function(){return q},base32pad:function(){return F},base32padupper:function(){return U},base32upper:function(){return B},base32z:function(){return V}});var u={};r.r(u),r.d(u,{base36:function(){return W},base36upper:function(){return K}});var c={};r.r(c),r.d(c,{base58btc:function(){return Y},base58flickr:function(){return Z}});var d={};r.r(d),r.d(d,{base64:function(){return J},base64pad:function(){return Q},base64url:function(){return X},base64urlpad:function(){return ee}});var h={};r.r(h),r.d(h,{base256emoji:function(){return ei}});var f={};r.r(f),r.d(f,{sha256:function(){return ey},sha512:function(){return eb}});var p={};r.r(p),r.d(p,{identity:function(){return ev}});var g={};r.r(g),r.d(g,{code:function(){return e_},decode:function(){return eA},encode:function(){return eE},name:function(){return ew}});var m={};r.r(m),r.d(m,{code:function(){return e$},decode:function(){return eP},encode:function(){return eC},name:function(){return eS}});var y=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n>>0,o=new Uint8Array(s);e[t];){var c=r[e.charCodeAt(t)];if(255===c)return;for(var d=0,h=s-1;(0!==c||d>>0,o[h]=c%256>>>0,c=c/256>>>0;if(0!==c)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var f=s-i;f!==s&&0===o[f];)f++;for(var p=new Uint8Array(n+(s-f)),g=n;f!==s;)p[g++]=o[f++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,s=t.length;i!==s&&0===t[i];)i++,r++;for(var o=(s-i)*c+1>>>0,u=new Uint8Array(o);i!==s;){for(var d=t[i],h=0,f=o-1;(0!==d||h>>0,u[f]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=h,i++}for(var p=o-n;p!==o&&0===u[p];)p++;for(var g=l.repeat(r);p{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},w=e=>new TextEncoder().encode(e),_=e=>new TextDecoder().decode(e);class E{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class A{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return k(this,e)}}class x{constructor(e){this.decoders=e}or(e){return k(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let k=(e,t)=>new x({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class S{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new E(e,t,r),this.decoder=new A(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let $=({name:e,prefix:t,encode:r,decode:n})=>new S(e,t,r,n),C=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=y(r,t);return $({prefix:e,name:t,encode:n,decode:e=>v(i(e))})},P=(e,t,r,n)=>{let i={};for(let e=0;e=8&&(a-=8,o[u++]=255&l>>a)}if(a>=r||255&l<<8-a)throw SyntaxError("Unexpected end of data");return o},I=(e,t,r)=>{let n="="===t[t.length-1],i=(1<r;)o-=r,s+=t[i&a>>o];if(o&&(s+=t[i&a<$({prefix:t,name:e,encode:e=>I(e,n,r),decode:t=>P(t,n,r,e)}),N=$({prefix:"\0",name:"identity",encode:e=>_(e),decode:e=>w(e)}),M=O({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),R=O({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),T=C({prefix:"9",name:"base10",alphabet:"0123456789"}),D=O({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),L=O({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),j=O({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),B=O({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),F=O({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),U=O({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),z=O({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),q=O({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),H=O({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),G=O({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),V=O({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),W=C({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),K=C({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Y=C({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Z=C({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),J=O({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Q=O({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),X=O({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),ee=O({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),et=Array.from("\uD83D\uDE80\uD83E\uDE90☄\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09☀\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02❤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09☺\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9E✌✨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2D❣\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33✋\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13⭐✅\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6✔\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90☹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20☝\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2B⚽\uD83E\uDD19☕\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81⚡\uD83C\uDF1E\uD83C\uDF88❌✊\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2C✈\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74▶➡❓\uD83D\uDC8E\uD83D\uDCB8⬇\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7A⚠\uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37☎\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51❄\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),er=et.reduce((e,t,r)=>(e[r]=t,e),[]),en=et.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),ei=$({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=er[t],"")},decode:function(e){let t=[];for(let r of e){let e=en[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var es=function e(t,r,n){r=r||[];for(var i=n=n||0;t>=2147483648;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},eo=function e(t,r){var n,i=0,r=r||0,s=0,o=r,a=t.length;do{if(o>=a)throw e.bytes=0,RangeError("Could not decode varint");n=t[o++],i+=s<28?(127&n)<=128);return e.bytes=o-r,i};let ea=(e,t=0)=>[eo(e,t),eo.bytes],el=(e,t,r=0)=>(es(e,t,r),t),eu=e=>e<128?1:e<16384?2:e<2097152?3:e<268435456?4:e<34359738368?5:e<4398046511104?6:e<562949953421312?7:e<72057594037927940?8:e<0x7fffffffffffffff?9:10,ec=(e,t)=>{let r=t.byteLength,n=eu(e),i=n+eu(r),s=new Uint8Array(i+r);return el(e,s,0),el(r,s,n),s.set(t,i),new ef(e,r,t,s)},ed=e=>{let t=v(e),[r,n]=ea(t),[i,s]=ea(t.subarray(n)),o=t.subarray(n+s);if(o.byteLength!==i)throw Error("Incorrect length");return new ef(r,i,o,t)},eh=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&b(e.bytes,t.bytes);class ef{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let ep=({name:e,code:t,encode:r})=>new eg(e,t,r);class eg{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?ec(this.code,t):t.then(e=>ec(this.code,e))}throw Error("Unknown type, must be binary type")}}let em=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),ey=ep({name:"sha2-256",code:18,encode:em("SHA-256")}),eb=ep({name:"sha2-512",code:19,encode:em("SHA-512")}),ev={code:0,name:"identity",encode:v,digest:e=>ec(0,v(e))},ew="raw",e_=85,eE=e=>v(e),eA=e=>v(e),ex=new TextEncoder,ek=new TextDecoder,eS="json",e$=512,eC=e=>ex.encode(JSON.stringify(e)),eP=e=>JSON.parse(ek.decode(e));class eI{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:eB,byteLength:eB,code:ej,version:ej,multihash:ej,bytes:ej,_baseCache:eB,asCID:eB})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==eR)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==eT)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return eI.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=ec(e,t);return eI.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&eh(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;return 0===r?eN(t,n,e||Y.encoder):eM(t,n,e||j.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return eF(/^0\.0/,eU),!!(e&&(e[eL]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof eI)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:i}=e;return new eI(t,r,n,i||eD(t,r,n.bytes))}if(null==e||!0!==e[eL])return null;{let{version:t,multihash:r,code:n}=e,i=ed(r);return eI.create(t,n,i)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===eR)return new eI(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${eR}) block encoding`);case 1:{let n=eD(e,t,r.bytes);return new eI(e,t,r,n)}default:throw Error("Invalid version")}}static createV0(e){return eI.create(0,eR,e)}static createV1(e,t){return eI.create(1,e,t)}static decode(e){let[t,r]=eI.decodeFirst(e);if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=eI.inspectBytes(e),r=t.size-t.multihashSize,n=v(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),s=new ef(t.multihashCode,t.digestSize,i,n);return[0===t.version?eI.createV0(s):eI.createV1(t.codec,s),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,n]=ea(e.subarray(t));return t+=n,r},n=r(),i=eR;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw RangeError(`Invalid CID version ${n}`);let s=t,o=r(),a=r(),l=t+a;return{version:n,codec:i,multihashCode:o,digestSize:a,multihashSize:l-s,size:l}}static parse(e,t){let[r,n]=eO(e,t),i=eI.decode(n);return i._baseCache.set(r,e),i}}let eO=(e,t)=>{switch(e[0]){case"Q":return[Y.prefix,(t||Y).decode(`${Y.prefix}${e}`)];case Y.prefix:return[Y.prefix,(t||Y).decode(e)];case j.prefix:return[j.prefix,(t||j).decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},eN=(e,t,r)=>{let{prefix:n}=r;if(n!==Y.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(null!=i)return i;{let i=r.encode(e).slice(1);return t.set(n,i),i}},eM=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(null!=i)return i;{let i=r.encode(e);return t.set(n,i),i}},eR=112,eT=18,eD=(e,t,r)=>{let n=eu(e),i=n+eu(t),s=new Uint8Array(i+r.byteLength);return el(e,s,0),el(t,s,n),s.set(r,i),s},eL=Symbol.for("@ipld/js-cid/CID"),ej={writable:!1,configurable:!1,enumerable:!0},eB={writable:!1,enumerable:!1,configurable:!1},eF=(e,t)=>{if(e.test("0.0.0-dev"))console.warn(t);else throw Error(t)},eU=`CID.isCID(v) is deprecated and will be removed in the next major release. Following code pattern: if (CID.isCID(value)) { doSomethingWithCID(value) } Is replaced with: const cid = CID.asCID(value) if (cid) { // Make sure to use cid instead of value doSomethingWithCID(cid) } `,ez={...n,...i,...s,...o,...a,...l,...u,...c,...d,...h};({...f,...p});var eq=r(69199);function eH(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}let eG=eH("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),eV=eH("ascii","a",e=>{let t="a";for(let r=0;r{e=e.substring(1);let t=(0,eq.E)(e.length);for(let r=0;r[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/,s=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/,o=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/,a=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/,l=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/,u=/^fallback\(\) external(?:\s(?payable{1}))?$/,c=/^receive\(\) external payable$/,d=new Set(["indexed"]),h=new Set(["calldata","memory","storage"]);class f extends Error{constructor(e,t={}){let r=t.cause instanceof f?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof f&&t.cause.docsPath||t.docsPath;super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...n?[`Docs: https://abitype.dev${n}`]:[],...r?[`Details: ${r}`]:[],"Version: abitype@1.0.5"].join("\n")),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiTypeError"}),t.cause&&(this.cause=t.cause),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.shortMessage=e}}class p extends f{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type. Perhaps you forgot to include a struct signature?`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownTypeError"})}}class g extends f{constructor({type:e}){super("Unknown type.",{metaMessages:[`Type "${e}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class m extends f{constructor({param:e}){super("Invalid ABI parameter.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class y extends f{constructor({param:e,name:t}){super("Invalid ABI parameter.",{details:e,metaMessages:[`"${t}" is a protected Solidity keyword. More info: https://docs.soliditylang.org/en/latest/cheatsheet.html`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SolidityProtectedKeywordError"})}}class b extends f{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class v extends f{constructor({param:e,type:t,modifier:r}){super("Invalid ABI parameter.",{details:e,metaMessages:[`Modifier "${r}" not allowed${t?` in "${t}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${r}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class w extends f{constructor({abiParameter:e}){super("Invalid ABI parameter.",{details:JSON.stringify(e,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class _ extends f{constructor({signature:e,type:t}){super(`Invalid ${t} signature.`,{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class E extends f{constructor({signature:e}){super("Unknown signature.",{details:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class A extends f{constructor({signature:e}){super("Invalid struct signature.",{details:e,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class x extends f{constructor({type:e}){super("Circular reference detected.",{metaMessages:[`Struct "${e}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class k extends f{constructor({current:e,depth:t}){super("Unbalanced parentheses.",{metaMessages:[`"${e.trim()}" has too many ${t>0?"opening":"closing"} parentheses.`],details:`Depth "${t}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}let S=new Map([["address",{type:"address"}],["bool",{type:"bool"}],["bytes",{type:"bytes"}],["bytes32",{type:"bytes32"}],["int",{type:"int256"}],["int256",{type:"int256"}],["string",{type:"string"}],["uint",{type:"uint256"}],["uint8",{type:"uint8"}],["uint16",{type:"uint16"}],["uint24",{type:"uint24"}],["uint32",{type:"uint32"}],["uint64",{type:"uint64"}],["uint96",{type:"uint96"}],["uint112",{type:"uint112"}],["uint160",{type:"uint160"}],["uint192",{type:"uint192"}],["uint256",{type:"uint256"}],["address owner",{type:"address",name:"owner"}],["address to",{type:"address",name:"to"}],["bool approved",{type:"bool",name:"approved"}],["bytes _data",{type:"bytes",name:"_data"}],["bytes data",{type:"bytes",name:"data"}],["bytes signature",{type:"bytes",name:"signature"}],["bytes32 hash",{type:"bytes32",name:"hash"}],["bytes32 r",{type:"bytes32",name:"r"}],["bytes32 root",{type:"bytes32",name:"root"}],["bytes32 s",{type:"bytes32",name:"s"}],["string name",{type:"string",name:"name"}],["string symbol",{type:"string",name:"symbol"}],["string tokenURI",{type:"string",name:"tokenURI"}],["uint tokenId",{type:"uint256",name:"tokenId"}],["uint8 v",{type:"uint8",name:"v"}],["uint256 balance",{type:"uint256",name:"balance"}],["uint256 tokenId",{type:"uint256",name:"tokenId"}],["uint256 value",{type:"uint256",name:"value"}],["event:address indexed from",{type:"address",name:"from",indexed:!0}],["event:address indexed to",{type:"address",name:"to",indexed:!0}],["event:uint indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}],["event:uint256 indexed tokenId",{type:"uint256",name:"tokenId",indexed:!0}]]),$=/^(?[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,C=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,P=/^u?int$/;function I(e,t){var r,i,s;let o;let a=(r=t?.type)?`${r}:${e}`:e;if(S.has(a))return S.get(a);let l=n.cN.test(e),u=(0,n.Zw)(l?C:$,e);if(!u)throw new m({param:e});if(u.name&&("address"===(i=u.name)||"bool"===i||"function"===i||"string"===i||"tuple"===i||n.eL.test(i)||n.lh.test(i)||M.test(i)))throw new y({param:e,name:u.name});let c=u.name?{name:u.name}:{},d="indexed"===u.modifier?{indexed:!0}:{},f=t?.structs??{},p={};if(l){o="tuple";let e=O(u.type),t=[],r=e.length;for(let n=0;n[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function T(e){let t=function(e){let t={},r=e.length;for(let i=0;ivoid 0!==e).length>0)}({request:c})&&!n)try{return await et(e,{...c,blockNumber:s,blockTag:o})}catch(e){if(!(e instanceof F.pZ)&&!(e instanceof F.mm))throw e}let d=await e.request({method:"eth_call",params:n?[c,r,n]:[c,r]});if("0x"===d)return{data:void 0};return{data:d}}catch(o){let n=function(e){if(!(e instanceof B.G))return;let t=e.walk();return"object"==typeof t?.data?t.data?.data:t.data}(o),{offchainLookup:i,offchainLookupSignature:s}=await r.e(26).then(r.bind(r,35026));if(!1!==e.ccipRead&&n?.slice(0,10)===s&&v)return{data:await i(e,{data:n,to:v})};if(S&&n?.slice(0,10)==="0x101bb98d")throw new U.Mo({factory:d});throw function(e,{docsPath:t,...r}){let n=(()=>{let t=(0,K.k)(e,r);return t instanceof W.cj?e:t})();return new U.cg(n,{docsPath:t,...r})}(o,{...t,account:A,chain:e.chain})}}async function et(e,t){let{batchSize:r=1024,wait:n=0}="object"==typeof e.batch?.multicall?e.batch.multicall:{},{blockNumber:i,blockTag:s="latest",data:o,multicallAddress:a,to:l}=t,u=a;if(!u){if(!e.chain)throw new F.pZ;u=(0,G.L)({blockNumber:i,chain:e.chain,contract:"multicall3"})}let c=(i?(0,V.eC)(i):void 0)||s,{schedule:d}=(0,J.S)({id:`${e.uid}.${c}`,wait:n,shouldSplitBatch:e=>e.reduce((e,{data:t})=>e+(t.length-2),0)>2*r,fn:async t=>{let r=t.map(e=>({allowFailure:!0,callData:e.data,target:e.to})),n=(0,H.R)({abi:L.F8,args:[r],functionName:"aggregate3"}),i=await e.request({method:"eth_call",params:[{data:n,to:u},c]});return(0,z.k)({abi:L.F8,args:[r],functionName:"aggregate3",data:i||"0x"})}}),[{returnData:h,success:f}]=await d({data:o,to:l});if(!f)throw new U.VQ({data:h});return"0x"===h?{data:void 0}:{data:h}}},5:function(e,t,r){"use strict";r.d(t,{v:function(){return tY}});var n=r(96104),i=r(14851),s=r(21620),o=r(97225),a=r(31006),l=r(18543),u=r(77955),c=r(95046),d=r(47807),h=r(48926),f=r(58591);function p(e,t){if(!(e instanceof h.G))return!1;let r=e.walk(e=>e instanceof f.Lu);return r instanceof f.Lu&&(!!(r.data?.errorName==="ResolverNotFound"||r.data?.errorName==="ResolverWildcardNotSupported"||r.data?.errorName==="ResolverNotContract"||r.data?.errorName==="ResolverError"||r.data?.errorName==="HttpError"||r.reason?.includes("Wildcard on non-extended resolvers is not supported"))||"reverse"===t&&r.reason===d.$[50])}var g=r(53932),m=r(82361),y=r(36494),b=r(40369);function v(e){if(66!==e.length||0!==e.indexOf("[")||65!==e.indexOf("]"))return null;let t=`0x${e.slice(1,65)}`;return(0,b.v)(t)?t:null}function w(e){let t=new Uint8Array(32).fill(0);if(!e)return(0,c.ci)(t);let r=e.split(".");for(let e=r.length-1;e>=0;e-=1){let n=v(r[e]),i=n?(0,m.O0)(n):(0,y.w)((0,m.qX)(r[e]),"bytes");t=(0,y.w)((0,g.zo)([t,i]),"bytes")}return(0,c.ci)(t)}function _(e){let t=e.replace(/^\.|\.$/gm,"");if(0===t.length)return new Uint8Array(1);let r=new Uint8Array((0,m.qX)(t).byteLength+2),n=0,i=t.split(".");for(let e=0;e255){var s;t=(0,m.qX)((s=function(e){let t=new Uint8Array(32).fill(0);return e?v(e)||(0,y.w)((0,m.qX)(e)):(0,c.ci)(t)}(i[e]),`[${s.slice(2)}]`))}r[n]=t.length,r.set(t,n+1),n+=t.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}function E(e,t,r){let n=e[t.name];if("function"==typeof n)return n;let i=e[r];return"function"==typeof i?i:r=>t(e,r)}var A=r(52186),x=r(96329);function k(e,{abi:t,address:r,args:n,docsPath:i,functionName:s,sender:o}){let{code:a,data:l,message:u,shortMessage:c}=e instanceof f.VQ?e:e instanceof h.G?e.walk(e=>"data"in e)||e.walk():{},d=e instanceof A.wb?new f.Dk({functionName:s}):[3,x.XS.code].includes(a)&&(l||u||c)?new f.Lu({abi:t,data:"object"==typeof l?l.data:l,functionName:s,message:c??u}):e;return new f.uq(d,{abi:t,args:n,contractAddress:r,docsPath:i,functionName:s,sender:o})}var S=r(12994);async function $(e,t){let{abi:r,address:n,args:i,functionName:s,...l}=t,u=(0,a.R)({abi:r,args:i,functionName:s});try{let{data:t}=await E(e,S.R,"call")({...l,data:u,to:n});return(0,o.k)({abi:r,args:i,functionName:s,data:t||"0x"})}catch(e){throw k(e,{abi:r,address:n,args:i,docsPath:"/docs/contract/readContract",functionName:s})}}async function C(e,{blockNumber:t,blockTag:r,coinType:n,name:i,gatewayUrls:d,strict:h,universalResolverAddress:f}){let g=f;if(!g){if(!e.chain)throw Error("client chain not configured. universalResolverAddress is required.");g=(0,l.L)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{let l=(0,a.R)({abi:s.X$,functionName:"addr",...null!=n?{args:[w(i),BigInt(n)]}:{args:[w(i)]}}),h={address:g,abi:s.k3,functionName:"resolve",args:[(0,c.NC)(_(i)),l],blockNumber:t,blockTag:r},f=E(e,$,"readContract"),p=d?await f({...h,args:[...h.args,d]}):await f(h);if("0x"===p[0])return null;let m=(0,o.k)({abi:s.X$,args:null!=n?[w(i),BigInt(n)]:void 0,functionName:"addr",data:p[0]});if("0x"===m||"0x00"===(0,u.f)(m))return null;return m}catch(e){if(h)throw e;if(p(e,"resolve"))return null;throw e}}class P extends h.G{constructor({data:e}){super("Unable to extract image from metadata. The metadata may be malformed or invalid.",{metaMessages:["- Metadata must be a JSON object with at least an `image`, `image_url` or `image_data` property.","",`Provided data: ${JSON.stringify(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidMetadataError"})}}class I extends h.G{constructor({reason:e}){super(`ENS NFT avatar URI is invalid. ${e}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarInvalidNftUriError"})}}class O extends h.G{constructor({uri:e}){super(`Unable to resolve ENS avatar URI "${e}". The URI may be malformed, invalid, or does not respond with a valid image.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUriResolutionError"})}}class N extends h.G{constructor({namespace:e}){super(`ENS NFT avatar namespace "${e}" is not supported. Must be "erc721" or "erc1155".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EnsAvatarUnsupportedNamespaceError"})}}let M=/(?https?:\/\/[^\/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,R=/^(Qm[1-9A-HJ-NP-Za-km-z]{44,}|b[A-Za-z2-7]{58,}|B[A-Z2-7]{58,}|z[1-9A-HJ-NP-Za-km-z]{48,}|F[0-9A-F]{50,})(\/(?[\w\-.]+))?(?\/.*)?$/,T=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,D=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function L(e){try{let t=await fetch(e,{method:"HEAD"});if(200===t.status){let e=t.headers.get("content-type");return e?.startsWith("image/")}return!1}catch(t){if("object"==typeof t&&void 0!==t.response||!globalThis.hasOwnProperty("Image"))return!1;return new Promise(t=>{let r=new Image;r.onload=()=>{t(!0)},r.onerror=()=>{t(!1)},r.src=e})}}function j(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function B({uri:e,gatewayUrls:t}){let r=T.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};let n=j(t?.ipfs,"https://ipfs.io"),i=j(t?.arweave,"https://arweave.net"),s=e.match(M),{protocol:o,subpath:a,target:l,subtarget:u=""}=s?.groups||{},c="ipns:/"===o||"ipns/"===a,d="ipfs:/"===o||"ipfs/"===a||R.test(e);if(e.startsWith("http")&&!c&&!d){let r=e;return t?.arweave&&(r=e.replace(/https:\/\/arweave.net/g,t?.arweave)),{uri:r,isOnChain:!1,isEncoded:!1}}if((c||d)&&l)return{uri:`${n}/${c?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if("ar:/"===o&&l)return{uri:`${i}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let h=e.replace(D,"");if(h.startsWith("e.json());return await z({gatewayUrls:e,uri:F(r)})}catch{throw new O({uri:t})}}async function z({gatewayUrls:e,uri:t}){let{uri:r,isOnChain:n}=B({uri:t,gatewayUrls:e});if(n||await L(r))return r;throw new O({uri:t})}async function q(e,{nft:t}){if("erc721"===t.namespace)return $(e,{address:t.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(t.tokenID)]});if("erc1155"===t.namespace)return $(e,{address:t.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(t.tokenID)]});throw new N({namespace:t.namespace})}async function H(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?G(e,{gatewayUrls:t,record:r}):z({uri:r,gatewayUrls:t})}async function G(e,{gatewayUrls:t,record:r}){let n=function(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));let[r,n,i]=t.split("/"),[s,o]=r.split(":"),[a,l]=n.split(":");if(!s||"eip155"!==s.toLowerCase())throw new I({reason:"Only EIP-155 supported"});if(!o)throw new I({reason:"Chain ID not found"});if(!l)throw new I({reason:"Contract address not found"});if(!i)throw new I({reason:"Token ID not found"});if(!a)throw new I({reason:"ERC namespace not found"});return{chainID:Number.parseInt(o),namespace:a.toLowerCase(),contractAddress:l,tokenID:i}}(r),{uri:i,isOnChain:s,isEncoded:o}=B({uri:await q(e,{nft:n}),gatewayUrls:t});if(s&&(i.includes("data:application/json;base64,")||i.startsWith("{")))return z({uri:F(JSON.parse(o?atob(i.replace("data:application/json;base64,","")):i)),gatewayUrls:t});let a=n.tokenID;return"erc1155"===n.namespace&&(a=a.replace("0x","").padStart(64,"0")),U({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,a)})}async function V(e,{blockNumber:t,blockTag:r,name:n,key:i,gatewayUrls:u,strict:d,universalResolverAddress:h}){let f=h;if(!f){if(!e.chain)throw Error("client chain not configured. universalResolverAddress is required.");f=(0,l.L)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}try{let l={address:f,abi:s.k3,functionName:"resolve",args:[(0,c.NC)(_(n)),(0,a.R)({abi:s.nZ,functionName:"text",args:[w(n),i]})],blockNumber:t,blockTag:r},d=E(e,$,"readContract"),h=u?await d({...l,args:[...l.args,u]}):await d(l);if("0x"===h[0])return null;let p=(0,o.k)({abi:s.nZ,functionName:"text",data:h[0]});return""===p?null:p}catch(e){if(d)throw e;if(p(e,"resolve"))return null;throw e}}async function W(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:i,gatewayUrls:s,strict:o,universalResolverAddress:a}){let l=await E(e,V,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:i,universalResolverAddress:a,gatewayUrls:s,strict:o});if(!l)return null;try{return await H(e,{record:l,gatewayUrls:n})}catch{return null}}async function K(e,{address:t,blockNumber:r,blockTag:n,gatewayUrls:i,strict:o,universalResolverAddress:a}){let u=a;if(!u){if(!e.chain)throw Error("client chain not configured. universalResolverAddress is required.");u=(0,l.L)({blockNumber:r,chain:e.chain,contract:"ensUniversalResolver"})}let d=`${t.toLowerCase().substring(2)}.addr.reverse`;try{let o={address:u,abi:s.du,functionName:"reverse",args:[(0,c.NC)(_(d))],blockNumber:r,blockTag:n},a=E(e,$,"readContract"),[l,h]=i?await a({...o,args:[...o.args,i]}):await a(o);if(t.toLowerCase()!==h.toLowerCase())return null;return l}catch(e){if(o)throw e;if(p(e,"reverse"))return null;throw e}}async function Y(e,{blockNumber:t,blockTag:r,name:n,universalResolverAddress:i}){let s=i;if(!s){if(!e.chain)throw Error("client chain not configured. universalResolverAddress is required.");s=(0,l.L)({blockNumber:t,chain:e.chain,contract:"ensUniversalResolver"})}let[o]=await E(e,$,"readContract")({address:s,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[(0,c.NC)(_(n))],blockNumber:t,blockTag:r});return o}function Z(e,{method:t}){let r={};return"fallback"===e.transport.type&&e.transport.onResponse?.(({method:e,response:n,status:i,transport:s})=>{"success"===i&&t===e&&(r[n]=s.request)}),t=>r[t]||e.request}async function J(e){let t=Z(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}class Q extends h.G{constructor(e){super(`Filter type "${e}" is not supported.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FilterTypeNotSupportedError"})}}var X=r(53263),ee=r(39480),et=r(20101),er=r(18748);let en="/docs/contract/encodeEventTopics";function ei(e){let{abi:t,eventName:r,args:n}=e,i=t[0];if(r){let e=(0,er.mE)({abi:t,name:r});if(!e)throw new A.mv(r,{docsPath:en});i=e}if("event"!==i.type)throw new A.mv(void 0,{docsPath:en});let s=(0,et.t)(i),o=(0,X.n)(s),a=[];if(n&&"inputs"in i){let e=i.inputs?.filter(e=>"indexed"in e&&e.indexed),t=Array.isArray(n)?n:Object.values(n).length>0?e?.map(e=>n[e.name])??[]:[];t.length>0&&(a=e?.map((e,r)=>Array.isArray(t[r])?t[r].map((n,i)=>es({param:e,value:t[r][i]})):t[r]?es({param:e,value:t[r]}):null)??[])}return[o,...a]}function es({param:e,value:t}){if("string"===e.type||"bytes"===e.type)return(0,y.w)((0,m.O0)(t));if("tuple"===e.type||e.type.match(/^(.*)\[(\d+)?\]$/))throw new Q(e.type);return(0,ee.E)([e],[t])}async function eo(e,t){let{address:r,abi:n,args:i,eventName:s,fromBlock:o,strict:a,toBlock:l}=t,u=Z(e,{method:"eth_newFilter"}),d=s?ei({abi:n,args:i,eventName:s}):void 0,h=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:"bigint"==typeof o?(0,c.eC)(o):o,toBlock:"bigint"==typeof l?(0,c.eC)(l):l,topics:d}]});return{abi:n,args:i,eventName:s,id:h,request:u(h),strict:!!a,type:"event"}}async function ea(e,{address:t,args:r,event:n,events:i,fromBlock:s,strict:o,toBlock:a}={}){let l=i??(n?[n]:void 0),u=Z(e,{method:"eth_newFilter"}),d=[];l&&(d=[l.flatMap(e=>ei({abi:[e],eventName:e.name,args:r}))],n&&(d=d[0]));let h=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:"bigint"==typeof s?(0,c.eC)(s):s,toBlock:"bigint"==typeof a?(0,c.eC)(a):a,...d.length?{topics:d}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:s,id:h,request:u(h),strict:!!o,toBlock:a,type:"event"}}async function el(e){let t=Z(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}var eu=r(85053),ec=r(49268),ed=r(97658);class eh extends h.G{constructor(e,{account:t,docsPath:r,chain:n,data:i,gas:s,gasPrice:o,maxFeePerGas:a,maxPriorityFeePerGas:l,nonce:u,to:c,value:d}){super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Estimate Gas Arguments:",(0,ed.xr)({from:t?.address,to:c,value:void 0!==d&&`${(0,eu.d)(d)} ${n?.nativeCurrency?.symbol||"ETH"}`,data:i,gas:s,gasPrice:void 0!==o&&`${(0,ec.o)(o)} gwei`,maxFeePerGas:void 0!==a&&`${(0,ec.o)(a)} gwei`,maxPriorityFeePerGas:void 0!==l&&`${(0,ec.o)(l)} gwei`,nonce:u})].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EstimateGasExecutionError"}),this.cause=e}}var ef=r(37764),ep=r(43149),eg=r(27031),em=r(37669),ey=r(11667),eb=r(82857);class ev extends h.G{constructor(){super("`baseFeeMultiplier` must be greater than 1."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseFeeScalarError"})}}class ew extends h.G{constructor(){super("Chain does not support EIP-1559 fees."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip1559FeesNotSupportedError"})}}class e_ extends h.G{constructor({maxPriorityFeePerGas:e}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${(0,ec.o)(e)} gwei).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MaxFeePerGasTooLowError"})}}var eE=r(21019);class eA extends h.G{constructor({blockHash:e,blockNumber:t}){let r="Block";e&&(r=`Block at hash "${e}"`),t&&(r=`Block at number "${t}"`),super(`${r} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlockNotFoundError"})}}let ex={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844"};function ek(e){let t={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?(0,eE.ly)(e.chainId):void 0,gas:e.gas?BigInt(e.gas):void 0,gasPrice:e.gasPrice?BigInt(e.gasPrice):void 0,maxFeePerBlobGas:e.maxFeePerBlobGas?BigInt(e.maxFeePerBlobGas):void 0,maxFeePerGas:e.maxFeePerGas?BigInt(e.maxFeePerGas):void 0,maxPriorityFeePerGas:e.maxPriorityFeePerGas?BigInt(e.maxPriorityFeePerGas):void 0,nonce:e.nonce?(0,eE.ly)(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?ex[e.type]:void 0,typeHex:e.type?e.type:void 0,value:e.value?BigInt(e.value):void 0,v:e.v?BigInt(e.v):void 0};return t.yParity=(()=>{if(e.yParity)return Number(e.yParity);if("bigint"==typeof t.v){if(0n===t.v||27n===t.v)return 0;if(1n===t.v||28n===t.v)return 1;if(t.v>=35n)return t.v%2n===0n?1:0}})(),"legacy"===t.type&&(delete t.accessList,delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas,delete t.yParity),"eip2930"===t.type&&(delete t.maxFeePerBlobGas,delete t.maxFeePerGas,delete t.maxPriorityFeePerGas),"eip1559"===t.type&&delete t.maxFeePerBlobGas,t}function eS(e){let t=e.transactions?.map(e=>"string"==typeof e?e:ek(e));return{...e,baseFeePerGas:e.baseFeePerGas?BigInt(e.baseFeePerGas):null,blobGasUsed:e.blobGasUsed?BigInt(e.blobGasUsed):void 0,difficulty:e.difficulty?BigInt(e.difficulty):void 0,excessBlobGas:e.excessBlobGas?BigInt(e.excessBlobGas):void 0,gasLimit:e.gasLimit?BigInt(e.gasLimit):void 0,gasUsed:e.gasUsed?BigInt(e.gasUsed):void 0,hash:e.hash?e.hash:null,logsBloom:e.logsBloom?e.logsBloom:null,nonce:e.nonce?e.nonce:null,number:e.number?BigInt(e.number):null,size:e.size?BigInt(e.size):void 0,timestamp:e.timestamp?BigInt(e.timestamp):void 0,transactions:t,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function e$(e,{blockHash:t,blockNumber:r,blockTag:n,includeTransactions:i}={}){let s=i??!1,o=void 0!==r?(0,c.eC)(r):void 0,a=null;if(!(a=t?await e.request({method:"eth_getBlockByHash",params:[t,s]},{dedupe:!0}):await e.request({method:"eth_getBlockByNumber",params:[o||(n??"latest"),s]},{dedupe:!!o})))throw new eA({blockHash:t,blockNumber:r});return(e.chain?.formatters?.block?.format||eS)(a)}async function eC(e){return BigInt(await e.request({method:"eth_gasPrice"}))}async function eP(e,t){return eI(e,t)}async function eI(e,t){let{block:r,chain:n=e.chain,request:i}=t||{};if("function"==typeof n?.fees?.defaultPriorityFee){let t=r||await E(e,e$,"getBlock")({});return n.fees.defaultPriorityFee({block:t,client:e,request:i})}if(void 0!==n?.fees?.defaultPriorityFee)return n?.fees?.defaultPriorityFee;try{let t=await e.request({method:"eth_maxPriorityFeePerGas"});return(0,eE.y_)(t)}catch{let[t,n]=await Promise.all([r?Promise.resolve(r):E(e,e$,"getBlock")({}),E(e,eC,"getGasPrice")({})]);if("bigint"!=typeof t.baseFeePerGas)throw new ew;let i=n-t.baseFeePerGas;if(i<0n)return 0n;return i}}async function eO(e,t){return eN(e,t)}async function eN(e,t){let{block:r,chain:n=e.chain,request:i,type:s="eip1559"}=t||{},o=await (async()=>"function"==typeof n?.fees?.baseFeeMultiplier?n.fees.baseFeeMultiplier({block:r,client:e,request:i}):n?.fees?.baseFeeMultiplier??1.2)();if(o<1)throw new ev;let a=10**(o.toString().split(".")[1]?.length??0),l=e=>e*BigInt(Math.ceil(o*a))/BigInt(a),u=r||await E(e,e$,"getBlock")({});if("function"==typeof n?.fees?.estimateFeesPerGas){let t=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:l,request:i,type:s});if(null!==t)return t}if("eip1559"===s){if("bigint"!=typeof u.baseFeePerGas)throw new ew;let t="bigint"==typeof i?.maxPriorityFeePerGas?i.maxPriorityFeePerGas:await eI(e,{block:u,chain:n,request:i}),r=l(u.baseFeePerGas);return{maxFeePerGas:i?.maxFeePerGas??r+t,maxPriorityFeePerGas:t}}return{gasPrice:i?.gasPrice??l(await E(e,eC,"getGasPrice")({}))}}async function eM(e,{address:t,blockTag:r="latest",blockNumber:n}){let i=await e.request({method:"eth_getTransactionCount",params:[t,n?(0,c.eC)(n):r]},{dedupe:!!n});return(0,eE.ly)(i)}function eR(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),n="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,m.nr)(e)):e.blobs,i=[];for(let e of n)i.push(Uint8Array.from(t.blobToKzgCommitment(e)));return"bytes"===r?i:i.map(e=>(0,c.ci)(e))}function eT(e){let{kzg:t}=e,r=e.to??("string"==typeof e.blobs[0]?"hex":"bytes"),n="string"==typeof e.blobs[0]?e.blobs.map(e=>(0,m.nr)(e)):e.blobs,i="string"==typeof e.commitments[0]?e.commitments.map(e=>(0,m.nr)(e)):e.commitments,s=[];for(let e=0;e(0,c.ci)(e))}var eD=r(80543);class eL extends h.G{constructor({maxSize:e,size:t}){super("Blob size is too large.",{metaMessages:[`Max: ${e} bytes`,`Given: ${t} bytes`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BlobSizeTooLargeError"})}}class ej extends h.G{constructor(){super("Blob data must not be empty."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"EmptyBlobError"})}}var eB=r(15222),eF=r(7508);async function eU(e){let t=await e.request({method:"eth_chainId"},{dedupe:!0});return(0,eE.ly)(t)}let ez=["blobVersionedHashes","chainId","fees","gas","nonce","type"];async function eq(e,t){let r,i;let{account:s=e.account,blobs:o,chain:a,gas:l,kzg:u,nonce:d,parameters:h=ez,type:f}=t,p=s?(0,n.T)(s):void 0,g={...t,...p?{from:p?.address}:{}};async function y(){return r||(r=await E(e,e$,"getBlock")({blockTag:"latest"}))}async function v(){return i||(a?a.id:void 0!==t.chainId?t.chainId:i=await E(e,eU,"getChainId")({}))}if((h.includes("blobVersionedHashes")||h.includes("sidecars"))&&o&&u){let e=eR({blobs:o,kzg:u});if(h.includes("blobVersionedHashes")){let t=function(e){let{commitments:t,version:r}=e,n=e.to??("string"==typeof t[0]?"hex":"bytes"),i=[];for(let e of t)i.push(function(e){let{commitment:t,version:r=1}=e,n=e.to??("string"==typeof t?"hex":"bytes"),i=function(e,t){let r=(0,eD.J)((0,b.v)(e,{strict:!1})?(0,m.O0)(e):e);return"bytes"===(t||"hex")?r:(0,c.NC)(r)}(t,"bytes");return i.set([r],0),"bytes"===n?i:(0,c.ci)(i)}({commitment:e,to:n,version:r}));return i}({commitments:e,to:"hex"});g.blobVersionedHashes=t}if(h.includes("sidecars")){let t=eT({blobs:o,commitments:e,kzg:u}),r=function(e){let{data:t,kzg:r,to:n}=e,i=e.blobs??function(e){let t=e.to??("string"==typeof e.data?"hex":"bytes"),r="string"==typeof e.data?(0,m.nr)(e.data):e.data,n=(0,eF.d)(r);if(!n)throw new ej;if(n>761855)throw new eL({maxSize:761855,size:n});let i=[],s=!0,o=0;for(;s;){let e=(0,eB.q)(new Uint8Array(131072)),t=0;for(;t<4096;){let n=r.slice(o,o+31);if(e.pushByte(0),e.pushBytes(n),n.length<31){e.pushByte(128),s=!1;break}t++,o+=31}i.push(e)}return"bytes"===t?i.map(e=>e.bytes):i.map(e=>(0,c.ci)(e.bytes))}({data:t,to:n}),s=e.commitments??eR({blobs:i,kzg:r,to:n}),o=e.proofs??eT({blobs:i,commitments:s,kzg:r,to:n}),a=[];for(let e=0;e{let t=(0,ep.k)(e,r);return t instanceof ef.cj?e:t})(),{docsPath:t,...r})}(r,{...t,account:i,chain:e.chain})}}async function eG(e,t){let{abi:r,address:i,args:s,functionName:o,...l}=t,u=(0,a.R)({abi:r,args:s,functionName:o});try{return await E(e,eH,"estimateGas")({data:u,to:i,...l})}catch(t){let e=l.account?(0,n.T)(l.account):void 0;throw k(t,{abi:r,address:i,args:s,docsPath:"/docs/contract/estimateContractGas",functionName:o,sender:e?.address})}}async function eV(e,{address:t,blockNumber:r,blockTag:n="latest"}){let i=r?(0,c.eC)(r):void 0;return BigInt(await e.request({method:"eth_getBalance",params:[t,i||n]}))}async function eW(e){return BigInt(await e.request({method:"eth_blobBaseFee"}))}let eK=new Map,eY=new Map;async function eZ(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){let n=function(e){let t=(e,t)=>({clear:()=>t.delete(e),get:()=>t.get(e),set:r=>t.set(e,r)}),r=t(e,eK),n=t(e,eY);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}(t),i=n.response.get();if(i&&r>0&&new Date().getTime()-i.created.getTime()`blockNumber.${e}`;async function eQ(e,{cacheTime:t=e.cacheTime}={}){return BigInt(await eZ(()=>e.request({method:"eth_blockNumber"}),{cacheKey:eJ(e.uid),cacheTime:t}))}async function eX(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){let i;let s=void 0!==r?(0,c.eC)(r):void 0;return i=t?await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):await e.request({method:"eth_getBlockTransactionCountByNumber",params:[s||n]},{dedupe:!!s}),(0,eE.ly)(i)}async function e0(e,{address:t,blockNumber:r,blockTag:n="latest"}){let i=void 0!==r?(0,c.eC)(r):void 0,s=await e.request({method:"eth_getCode",params:[t,i||n]},{dedupe:!!i});if("0x"!==s)return s}var e1=r(65937),e2=r(19477),e3=r(52998);let e5="/docs/contract/decodeEventLog";function e6(e){let{abi:t,data:r,strict:n,topics:i}=e,s=n??!0,[o,...a]=i;if(!o)throw new A.FM({docsPath:e5});let l=t.find(e=>"event"===e.type&&o===(0,X.n)((0,et.t)(e)));if(!(l&&"name"in l)||"event"!==l.type)throw new A.lC(o,{docsPath:e5});let{name:u,inputs:c}=l,d=c?.some(e=>!("name"in e&&e.name)),h=d?[]:{},f=c.filter(e=>"indexed"in e&&e.indexed);for(let e=0;e!("indexed"in e&&e.indexed));if(p.length>0){if(r&&"0x"!==r)try{let e=(0,e3.r)(p,r);if(e){if(d)h=[...h,...e];else for(let t=0;t0?h:void 0}}function e4(e){let{abi:t,args:r,logs:n,strict:i=!0}=e,s=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})();return n.map(e=>{try{let n=(0,er.mE)({abi:t,name:e.topics[0]});if(!n)return null;let o=e6({...e,abi:[n],strict:i});if(s&&!s.includes(o.eventName)||!function(e){let{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function i(e,t,r){try{if("address"===e.type)return(0,e1.E)(t,r);if("string"===e.type||"bytes"===e.type)return(0,y.w)((0,m.O0)(t))===r;return t===r}catch{return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((e,n)=>{if(!e)return!0;let s=r[n];return!!s&&(Array.isArray(e)?e:[e]).some(e=>i(s,e,t[n]))}):!("object"!=typeof t||Array.isArray(t)||"object"!=typeof n||Array.isArray(n))&&Object.entries(n).every(([e,n])=>{if(!n)return!0;let s=r.find(t=>t.name===e);return!!s&&(Array.isArray(n)?n:[n]).some(r=>i(s,r,t[e]))})}({args:o.args,inputs:n.inputs,matchArgs:r}))return null;return{...o,...e}}catch(n){let t,r;if(n instanceof A.lC)return null;if(n instanceof A.SM||n instanceof A.Gy){if(i)return null;t=n.abiItem.name,r=n.abiItem.inputs?.some(e=>!("name"in e&&e.name))}return{...e,args:r?[]:{},eventName:t}}}).filter(Boolean)}function e8(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,logIndex:e.logIndex?Number(e.logIndex):null,transactionHash:e.transactionHash?e.transactionHash:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,...r?{args:t,eventName:r}:{}}}async function e9(e,{address:t,blockHash:r,fromBlock:n,toBlock:i,event:s,events:o,args:a,strict:l}={}){let u=o??(s?[s]:void 0),d=[];u&&(d=[u.flatMap(e=>ei({abi:[e],eventName:e.name,args:o?void 0:a}))],s&&(d=d[0]));let h=(r?await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:"bigint"==typeof n?(0,c.eC)(n):n,toBlock:"bigint"==typeof i?(0,c.eC)(i):i}]})).map(e=>e8(e));return u?e4({abi:u,args:a,logs:h,strict:l??!1}):h}async function e7(e,t){let{abi:r,address:n,args:i,blockHash:s,eventName:o,fromBlock:a,toBlock:l,strict:u}=t,c=o?(0,er.mE)({abi:r,name:o}):void 0,d=c?void 0:r.filter(e=>"event"===e.type);return E(e,e9,"getLogs")({address:n,args:i,blockHash:s,event:c,events:d,fromBlock:a,toBlock:l,strict:u})}class te extends h.G{constructor({address:e}){super(`No EIP-712 domain found on contract "${e}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${e}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Eip712DomainNotFoundError"})}}async function tt(e,t){let{address:r,factory:n,factoryData:i}=t;try{let[t,s,o,a,l,u,c]=await E(e,$,"readContract")({abi:tr,address:r,functionName:"eip712Domain",factory:n,factoryData:i});return{domain:{name:s,version:o,chainId:Number(a),verifyingContract:l,salt:u},extensions:c,fields:t}}catch(e){if("ContractFunctionExecutionError"===e.name&&"ContractFunctionZeroDataError"===e.cause.name)throw new te({address:r});throw e}}let tr=[{inputs:[],name:"eip712Domain",outputs:[{name:"fields",type:"bytes1"},{name:"name",type:"string"},{name:"version",type:"string"},{name:"chainId",type:"uint256"},{name:"verifyingContract",type:"address"},{name:"salt",type:"bytes32"},{name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"}];async function tn(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:i}){var s;let o=r?(0,c.eC)(r):void 0;return{baseFeePerGas:(s=await e.request({method:"eth_feeHistory",params:[(0,c.eC)(t),o||n,i]},{dedupe:!!o})).baseFeePerGas.map(e=>BigInt(e)),gasUsedRatio:s.gasUsedRatio,oldestBlock:BigInt(s.oldestBlock),reward:s.reward?.map(e=>e.map(e=>BigInt(e)))}}async function ti(e,{filter:t}){let r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if("string"==typeof n[0])return n;let i=n.map(e=>e8(e));return"abi"in t&&t.abi?e4({abi:t.abi,logs:i,strict:r}):i}async function ts(e,{filter:t}){let r=t.strict??!1,n=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(e=>e8(e));return t.abi?e4({abi:t.abi,logs:n,strict:r}):n}async function to(e,{address:t,blockNumber:r,blockTag:n,storageKeys:i}){var s;let o=void 0!==r?(0,c.eC)(r):void 0;return{...s=await e.request({method:"eth_getProof",params:[t,i,o||(n??"latest")]}),balance:s.balance?BigInt(s.balance):void 0,nonce:s.nonce?(0,eE.ly)(s.nonce):void 0,storageProof:s.storageProof?s.storageProof.map(e=>({...e,value:BigInt(e.value)})):void 0}}async function ta(e,{address:t,blockNumber:r,blockTag:n="latest",slot:i}){let s=void 0!==r?(0,c.eC)(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,i,s||n]})}async function tl(e,{blockHash:t,blockNumber:r,blockTag:n,hash:i,index:s}){let o=n||"latest",a=void 0!==r?(0,c.eC)(r):void 0,l=null;if(i?l=await e.request({method:"eth_getTransactionByHash",params:[i]},{dedupe:!0}):t?l=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,(0,c.eC)(s)]},{dedupe:!0}):(a||o)&&(l=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[a||o,(0,c.eC)(s)]},{dedupe:!!a})),!l)throw new ed.Bh({blockHash:t,blockNumber:r,blockTag:o,hash:i,index:s});return(e.chain?.formatters?.transaction?.format||ek)(l)}async function tu(e,{hash:t,transactionReceipt:r}){let[n,i]=await Promise.all([E(e,eQ,"getBlockNumber")({}),t?E(e,tl,"getTransaction")({hash:t}):void 0]),s=r?.blockNumber||i?.blockNumber;return s?n-s+1n:0n}let tc={"0x0":"reverted","0x1":"success"};async function td(e,{hash:t}){let r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new ed.Yb({hash:t});return(e.chain?.formatters?.transactionReceipt?.format||function(e){let t={...e,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,contractAddress:e.contractAddress?e.contractAddress:null,cumulativeGasUsed:e.cumulativeGasUsed?BigInt(e.cumulativeGasUsed):null,effectiveGasPrice:e.effectiveGasPrice?BigInt(e.effectiveGasPrice):null,gasUsed:e.gasUsed?BigInt(e.gasUsed):null,logs:e.logs?e.logs.map(e=>e8(e)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?(0,eE.ly)(e.transactionIndex):null,status:e.status?tc[e.status]:null,type:e.type?ex[e.type]||e.type:null};return e.blobGasPrice&&(t.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(t.blobGasUsed=BigInt(e.blobGasUsed)),t})(r)}async function th(e,t){let{allowFailure:r=!0,batchSize:n,blockNumber:i,blockTag:u,multicallAddress:c,stateOverride:d}=t,p=t.contracts,g=n??("object"==typeof e.batch?.multicall&&e.batch.multicall.batchSize||1024),m=c;if(!m){if(!e.chain)throw Error("client chain not configured. multicallAddress is required.");m=(0,l.L)({blockNumber:i,chain:e.chain,contract:"multicall3"})}let y=[[]],b=0,v=0;for(let e=0;e0&&v>g&&y[b].length>0&&(b++,v=(e.length-2)/2,y[b]=[]),y[b]=[...y[b],{allowFailure:!0,callData:e,target:n}]}catch(o){let e=k(o,{abi:t,address:n,args:i,docsPath:"/docs/contract/multicall",functionName:s});if(!r)throw e;y[b]=[...y[b],{allowFailure:!0,callData:"0x",target:n}]}}let w=await Promise.allSettled(y.map(t=>E(e,$,"readContract")({abi:s.F8,address:m,args:[t],blockNumber:i,blockTag:u,functionName:"aggregate3",stateOverride:d}))),_=[];for(let e=0;e"name"in e&&e.name===t.functionName);return{result:a,request:{abi:f,address:i,args:s,dataSuffix:l,functionName:u,...c,account:d}}}catch(e){throw k(e,{abi:r,address:i,args:s,docsPath:"/docs/contract/simulateContract",functionName:u,sender:d?.address})}}async function tp(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function tg(e,t){return(0,y.w)(function(e){let t="string"==typeof e?(0,c.$G)(e):"string"==typeof e.raw?e.raw:(0,c.ci)(e.raw),r=(0,c.$G)(`\x19Ethereum Signed Message: ${(0,eF.d)(t)}`);return(0,g.zo)([r,t])}(e),t)}var tm=r(13955),ty=r(32637),tb=r(99112),tv=r(38078);let tw="0x6492649264926492649264926492649264926492649264926492649264926492";var t_=r(49014);async function tE({hash:e,signature:t}){let n=(0,b.v)(e)?e:(0,c.NC)(e),{secp256k1:i}=await Promise.resolve().then(r.bind(r,68610)),s=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:r,v:n,yParity:s}=t,o=tA(Number(s??n));return new i.Signature((0,eE.y_)(e),(0,eE.y_)(r)).addRecoveryBit(o)}let e=(0,b.v)(t)?t:(0,c.NC)(t),r=tA((0,eE.ly)(`0x${e.slice(130)}`));return i.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})().recoverPublicKey(n.substring(2)).toHex(!1);return`0x${s}`}function tA(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function tx({hash:e,signature:t}){return function(e){let t=(0,y.w)(`0x${e.substring(4)}`).substring(26);return(0,tb.x)(`0x${t}`)}(await tE({hash:e,signature:t}))}var tk=r(68610);async function tS(e,t){let{address:r,factory:n,factoryData:i,hash:o,signature:a,...l}=t,u=(0,b.v)(a)?a:"object"==typeof a&&"r"in a&&"s"in a?function({r:e,s:t,to:r="hex",v:n,yParity:i}){let s=(()=>{if(0===i||1===i)return i;if(n&&(27n===n||28n===n||n>=35n))return n%2n===0n?1:0;throw Error("Invalid `v` or `yParity` value")})(),o=`0x${new tk.secp256k1.Signature((0,eE.y_)(e),(0,eE.y_)(t)).toCompactHex()}${0===s?"1b":"1c"}`;return"hex"===r?o:(0,m.nr)(o)}(a):(0,c.ci)(a),d=await (async()=>n||i?(0,t_.p5)(u,-32)===tw?u:function(e){let{address:t,data:r,signature:n,to:i="hex"}=e,s=(0,g.SM)([(0,ee.E)([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,r,n]),tw]);return"hex"===i?s:(0,m.nr)(s)}({address:n,data:i,signature:u}):u)();try{let{data:t}=await E(e,S.R,"call")({data:(0,ty.w)({abi:s.$o,args:[r,o,d],bytecode:tm.ST}),...l});return function(e,t){let r=(0,b.v)(e)?(0,m.O0)(e):e,n=(0,b.v)("0x1")?(0,m.O0)("0x1"):"0x1";return(0,tv.Wd)(r,n)}(t??"0x0","0x1")}catch(e){try{if((0,e1.E)((0,tb.K)(r),await tx({hash:o,signature:a})))return!0}catch{}if(e instanceof f.cg)return!1;throw e}}async function t$(e,{address:t,message:r,factory:n,factoryData:i,signature:s,...o}){return tS(e,{address:t,factory:n,factoryData:i,hash:tg(r),signature:s,...o})}var tC=r(51359),tP=r(64113);let tI=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,tO=/^(u?int)(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/;function tN({data:e,primaryType:t,types:r}){let n=function e({data:t,primaryType:r,types:n}){let i=[{type:"bytes32"}],s=[function({primaryType:e,types:t}){let r=(0,c.NC)(function({primaryType:e,types:t}){let r="",n=function e({primaryType:t,types:r},n=new Set){let i=t.match(/^\w*/u),s=i?.[0];if(n.has(s)||void 0===r[s])return n;for(let t of(n.add(s),r[s]))e({primaryType:t.type,types:r},n);return n}({primaryType:e,types:t});for(let i of(n.delete(e),[e,...Array.from(n).sort()]))r+=`${i}(${t[i].map(({name:e,type:t})=>`${t} ${e}`).join(",")})`;return r}({primaryType:e,types:t}));return(0,y.w)(r)}({primaryType:r,types:n})];for(let o of n[r]){let[r,a]=function t({types:r,name:n,type:i,value:s}){if(void 0!==r[i])return[{type:"bytes32"},(0,y.w)(e({data:s,primaryType:i,types:r}))];if("bytes"===i){let e=s.length%2?"0":"";return s=`0x${e+s.slice(2)}`,[{type:"bytes32"},(0,y.w)(s)]}if("string"===i)return[{type:"bytes32"},(0,y.w)((0,c.NC)(s))];if(i.lastIndexOf("]")===i.length-1){let e=i.slice(0,i.lastIndexOf("[")),o=s.map(i=>t({name:n,type:e,types:r,value:i}));return[{type:"bytes32"},(0,y.w)((0,ee.E)(o.map(([e])=>e),o.map(([,e])=>e)))]}return[{type:i},s]}({types:n,name:o.name,type:o.type,value:t[o.name]});i.push(r),s.push(a)}return(0,ee.E)(i,s)}({data:e,primaryType:t,types:r});return(0,y.w)(n)}async function tM(e,t){let{address:r,factory:n,factoryData:i,signature:s,message:o,primaryType:a,types:l,domain:u,...d}=t;return tS(e,{address:r,factory:n,factoryData:i,hash:function(e){let{domain:t={},message:r,primaryType:n}=e,i={EIP712Domain:function({domain:e}){return["string"==typeof e?.name&&{name:"name",type:"string"},e?.version&&{name:"version",type:"string"},"number"==typeof e?.chainId&&{name:"chainId",type:"uint256"},e?.verifyingContract&&{name:"verifyingContract",type:"address"},e?.salt&&{name:"salt",type:"bytes32"}].filter(Boolean)}({domain:t}),...e.types};!function(e){let{domain:t,message:r,primaryType:n,types:i}=e,s=(e,t)=>{for(let r of e){let{name:e,type:n}=r,o=t[e],a=n.match(tO);if(a&&("number"==typeof o||"bigint"==typeof o)){let[e,t,r]=a;(0,c.eC)(o,{signed:"int"===t,size:Number.parseInt(r)/8})}if("address"===n&&"string"==typeof o&&!(0,tP.U)(o))throw new tC.b({address:o});let l=n.match(tI);if(l){let[e,t]=l;if(t&&(0,eF.d)(o)!==Number.parseInt(t))throw new A.KY({expectedSize:Number.parseInt(t),givenSize:(0,eF.d)(o)})}let u=i[n];u&&s(u,o)}};i.EIP712Domain&&t&&s(i.EIP712Domain,t),"EIP712Domain"!==n&&s(i[n],r)}({domain:t,message:r,primaryType:n,types:i});let s=["0x1901"];return t&&s.push(function({domain:e,types:t}){return tN({data:e,primaryType:"EIP712Domain",types:t})}({domain:t,types:i})),"EIP712Domain"!==n&&s.push(tN({data:r,primaryType:n,types:i})),(0,y.w)((0,g.zo)(s))}({message:o,primaryType:a,types:l,domain:u}),signature:s,...d})}let tR=new Map,tT=new Map,tD=0;function tL(e,t,r){let n=++tD,i=()=>tR.get(e)||[],s=()=>{let t=i();tR.set(e,t.filter(e=>e.id!==n))},o=()=>{let t=tT.get(e);1===i().length&&t&&t(),s()},a=i();if(tR.set(e,[...a,{id:n,fns:t}]),a&&a.length>0)return o;let l={};for(let e in t)l[e]=(...t)=>{let r=i();if(0!==r.length)for(let n of r)n.fns[e]?.(...t)};let u=r(l);return"function"==typeof u&&tT.set(e,u),o}var tj=r(55894),tB=r(47499),tF=r(97317);function tU(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let i=!0,s=()=>i=!1;return(async()=>{let o;t&&(o=await e({unpoll:s}));let a=await r?.(o)??n;await (0,tF.D)(a);let l=async()=>{i&&(await e({unpoll:s}),await (0,tF.D)(n),l())};l()})(),s}function tz(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:i,poll:s,pollingInterval:o=e.pollingInterval}){let a;return(void 0!==s?s:"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type))?tL((0,tB.P)(["watchBlockNumber",e.uid,t,r,o]),{onBlockNumber:n,onError:i},n=>tU(async()=>{try{let t=await E(e,eQ,"getBlockNumber")({cacheTime:0});if(a){if(t===a)return;if(t-a>1&&r)for(let e=a+1n;ea)&&(n.onBlockNumber(t,a),a=t)}catch(e){n.onError?.(e)}},{emitOnBegin:t,interval:o})):tL((0,tB.P)(["watchBlockNumber",e.uid,t,r]),{onBlockNumber:n,onError:i},t=>{let r=!0,n=()=>r=!1;return(async()=>{try{let i=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:s}=await i.subscribe({params:["newHeads"],onData(e){if(!r)return;let n=(0,eE.y_)(e.result?.number);t.onBlockNumber(n,a),a=n},onError(e){t.onError?.(e)}});n=s,r||n()}catch(e){i?.(e)}})(),()=>n()})}async function tq(e,{confirmations:t=1,hash:r,onReplaced:n,pollingInterval:i=e.pollingInterval,retryCount:s=6,retryDelay:o=({count:e})=>200*~~(1<{a&&setTimeout(()=>g(new ed.mc({hash:r})),a);let m=tL(d,{onReplaced:n,resolve:p,reject:g},n=>{let a=E(e,tz,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:i,async onBlockNumber(i){let d=e=>{a(),e(),m()},p=i;if(!f){h>s&&d(()=>n.reject(new ed.mc({hash:r})));try{if(c){if(t>1&&(!c.blockNumber||p-c.blockNumber+1nn.resolve(c));return}if(l||(f=!0,await (0,tj.J)(async()=>{(l=await E(e,tl,"getTransaction")({hash:r})).blockNumber&&(p=l.blockNumber)},{delay:o,retryCount:s}),f=!1),c=await E(e,td,"getTransactionReceipt")({hash:r}),t>1&&(!c.blockNumber||p-c.blockNumber+1nn.resolve(c))}catch(r){if(r instanceof ed.Bh||r instanceof ed.Yb){if(!l){f=!1;return}try{u=l,f=!0;let r=await (0,tj.J)(()=>E(e,e$,"getBlock")({blockNumber:p,includeTransactions:!0}),{delay:o,retryCount:s,shouldRetry:({error:e})=>e instanceof eA});f=!1;let i=r.transactions.find(({from:e,nonce:t})=>e===u.from&&t===u.nonce);if(!i||(c=await E(e,td,"getTransactionReceipt")({hash:i.hash}),t>1&&(!c.blockNumber||p-c.blockNumber+1n{n.onReplaced?.({reason:a,replacedTransaction:u,transaction:i,transactionReceipt:c}),n.resolve(c)})}catch(e){d(()=>n.reject(e))}}else d(()=>n.reject(r))}finally{h++}}}})})})}let tH=/^(?:(?[a-zA-Z][a-zA-Z0-9+-.]*):\/\/)?(?[a-zA-Z0-9+-.]*(?::[0-9]{1,5})?) (?:wants you to sign in with your Ethereum account:\n)(?
0x[a-fA-F0-9]{40})\n\n(?:(?.*)\n\n)?/,tG=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;async function tV(e,t){let{address:r,domain:n,message:i,nonce:s,scheme:o,signature:a,time:l=new Date,...u}=t,c=function(e){let{scheme:t,statement:r,...n}=e.match(tH)?.groups??{},{chainId:i,expirationTime:s,issuedAt:o,notBefore:a,requestId:l,...u}=e.match(tG)?.groups??{},c=e.split("Resources:")[1]?.split("\n- ").slice(1);return{...n,...u,...i?{chainId:Number(i)}:{},...s?{expirationTime:new Date(s)}:{},...o?{issuedAt:new Date(o)}:{},...a?{notBefore:new Date(a)}:{},...l?{requestId:l}:{},...c?{resources:c}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}(i);if(!c.address||!function(e){let{address:t,domain:r,message:n,nonce:i,scheme:s,time:o=new Date}=e;if(r&&n.domain!==r||i&&n.nonce!==i||s&&n.scheme!==s||n.expirationTime&&o>=n.expirationTime||n.notBefore&&o(0,S.R)(e,t),createBlockFilter:()=>J(e),createContractEventFilter:t=>eo(e,t),createEventFilter:t=>ea(e,t),createPendingTransactionFilter:()=>el(e),estimateContractGas:t=>eG(e,t),estimateGas:t=>eH(e,t),getBalance:t=>eV(e,t),getBlobBaseFee:()=>eW(e),getBlock:t=>e$(e,t),getBlockNumber:t=>eQ(e,t),getBlockTransactionCount:t=>eX(e,t),getBytecode:t=>e0(e,t),getChainId:()=>eU(e),getCode:t=>e0(e,t),getContractEvents:t=>e7(e,t),getEip712Domain:t=>tt(e,t),getEnsAddress:t=>C(e,t),getEnsAvatar:t=>W(e,t),getEnsName:t=>K(e,t),getEnsResolver:t=>Y(e,t),getEnsText:t=>V(e,t),getFeeHistory:t=>tn(e,t),estimateFeesPerGas:t=>eO(e,t),getFilterChanges:t=>ti(e,t),getFilterLogs:t=>ts(e,t),getGasPrice:()=>eC(e),getLogs:t=>e9(e,t),getProof:t=>to(e,t),estimateMaxPriorityFeePerGas:t=>eP(e,t),getStorageAt:t=>ta(e,t),getTransaction:t=>tl(e,t),getTransactionConfirmations:t=>tu(e,t),getTransactionCount:t=>eM(e,t),getTransactionReceipt:t=>td(e,t),multicall:t=>th(e,t),prepareTransactionRequest:t=>eq(e,t),readContract:t=>$(e,t),sendRawTransaction:t=>tW(e,t),simulateContract:t=>tf(e,t),verifyMessage:t=>t$(e,t),verifySiweMessage:t=>tV(e,t),verifyTypedData:t=>tM(e,t),uninstallFilter:t=>tp(e,t),waitForTransactionReceipt:t=>tq(e,t),watchBlocks:t=>(function(e,{blockTag:t="latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:i,onError:s,includeTransactions:o,poll:a,pollingInterval:l=e.pollingInterval}){let u,c,d;let h=void 0!==a?a:"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type),f=o??!1;return h?tL((0,tB.P)(["watchBlocks",e.uid,t,r,n,f,l]),{onBlock:i,onError:s},i=>tU(async()=>{try{let n=await E(e,e$,"getBlock")({blockTag:t,includeTransactions:f});if(n.number&&u?.number){if(n.number===u.number)return;if(n.number-u.number>1&&r)for(let t=u?.number+1n;tu.number)&&(i.onBlock(n,u),u=n)}catch(e){i.onError?.(e)}},{emitOnBegin:n,interval:l})):(c=!0,d=()=>c=!1,(async()=>{try{let t=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type);return t?t.value:e.transport}return e.transport})(),{unsubscribe:r}=await t.subscribe({params:["newHeads"],onData(t){if(!c)return;let r=(e.chain?.formatters?.block?.format||eS)(t.result);i(r,u),u=r},onError(e){s?.(e)}});d=r,c||d()}catch(e){s?.(e)}})(),()=>d())})(e,t),watchBlockNumber:t=>tz(e,t),watchContractEvent:t=>(function(e,t){let{abi:r,address:n,args:i,batch:s=!0,eventName:o,fromBlock:a,onError:l,onLogs:u,poll:c,pollingInterval:d=e.pollingInterval,strict:h}=t;return(void 0!==c?c:"bigint"==typeof a||"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type))?(()=>{let t=h??!1;return tL((0,tB.P)(["watchContractEvent",n,i,s,e.uid,o,d,t,a]),{onLogs:u,onError:l},l=>{let u,c;void 0!==a&&(u=a-1n);let h=!1,f=tU(async()=>{if(!h){try{c=await E(e,eo,"createContractEventFilter")({abi:r,address:n,args:i,eventName:o,strict:t,fromBlock:a})}catch{}h=!0;return}try{let a;if(c)a=await E(e,ti,"getFilterChanges")({filter:c});else{let s=await E(e,eQ,"getBlockNumber")({});a=u&&u{c&&await E(e,tp,"uninstallFilter")({filter:c}),f()}})})():(()=>{let t=(0,tB.P)(["watchContractEvent",n,i,s,e.uid,o,d,h??!1]),a=!0,c=()=>a=!1;return tL(t,{onLogs:u,onError:l},t=>((async()=>{try{let s=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type);return t?t.value:e.transport}return e.transport})(),l=o?ei({abi:r,eventName:o,args:i}):[],{unsubscribe:u}=await s.subscribe({params:["logs",{address:n,topics:l}],onData(e){if(!a)return;let n=e.result;try{let{eventName:e,args:i}=e6({abi:r,data:n.data,topics:n.topics,strict:h}),s=e8(n,{args:i,eventName:e});t.onLogs([s])}catch(s){let e,r;if(s instanceof A.SM||s instanceof A.Gy){if(h)return;e=s.abiItem.name,r=s.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let i=e8(n,{args:r?[]:{},eventName:e});t.onLogs([i])}},onError(e){t.onError?.(e)}});c=u,a||c()}catch(e){l?.(e)}})(),()=>c()))})()})(e,t),watchEvent:t=>(function(e,{address:t,args:r,batch:n=!0,event:i,events:s,fromBlock:o,onError:a,onLogs:l,poll:u,pollingInterval:c=e.pollingInterval,strict:d}){let h,f;let p=void 0!==u?u:"bigint"==typeof o||"webSocket"!==e.transport.type&&("fallback"!==e.transport.type||"webSocket"!==e.transport.transports[0].config.type),g=d??!1;return p?tL((0,tB.P)(["watchEvent",t,r,n,e.uid,i,c,o]),{onLogs:l,onError:a},a=>{let l,u;void 0!==o&&(l=o-1n);let d=!1,h=tU(async()=>{if(!d){try{u=await E(e,ea,"createEventFilter")({address:t,args:r,event:i,events:s,strict:g,fromBlock:o})}catch{}d=!0;return}try{let o;if(u)o=await E(e,ti,"getFilterChanges")({filter:u});else{let n=await E(e,eQ,"getBlockNumber")({});o=l&&l!==n?await E(e,e9,"getLogs")({address:t,args:r,event:i,events:s,fromBlock:l+1n,toBlock:n}):[],l=n}if(0===o.length)return;if(n)a.onLogs(o);else for(let e of o)a.onLogs([e])}catch(e){u&&e instanceof x.yR&&(d=!1),a.onError?.(e)}},{emitOnBegin:!0,interval:c});return async()=>{u&&await E(e,tp,"uninstallFilter")({filter:u}),h()}}):(h=!0,f=()=>h=!1,(async()=>{try{let n=(()=>{if("fallback"===e.transport.type){let t=e.transport.transports.find(e=>"webSocket"===e.config.type);return t?t.value:e.transport}return e.transport})(),o=s??(i?[i]:void 0),u=[];o&&(u=[o.flatMap(e=>ei({abi:[e],eventName:e.name,args:r}))],i&&(u=u[0]));let{unsubscribe:c}=await n.subscribe({params:["logs",{address:t,topics:u}],onData(e){if(!h)return;let t=e.result;try{let{eventName:e,args:r}=e6({abi:o??[],data:t.data,topics:t.topics,strict:g}),n=e8(t,{args:r,eventName:e});l([n])}catch(i){let e,r;if(i instanceof A.SM||i instanceof A.Gy){if(d)return;e=i.abiItem.name,r=i.abiItem.inputs?.some(e=>!("name"in e&&e.name))}let n=e8(t,{args:r?[]:{},eventName:e});l([n])}},onError(e){a?.(e)}});f=c,h||f()}catch(e){a?.(e)}})(),()=>f())})(e,t),watchPendingTransactions:t=>(function(e,{batch:t=!0,onError:r,onTransactions:n,poll:i,pollingInterval:s=e.pollingInterval}){let o,a;return(void 0!==i?i:"webSocket"!==e.transport.type)?tL((0,tB.P)(["watchPendingTransactions",e.uid,t,s]),{onTransactions:n,onError:r},r=>{let n;let i=tU(async()=>{try{if(!n)try{n=await E(e,el,"createPendingTransactionFilter")({});return}catch(e){throw i(),e}let s=await E(e,ti,"getFilterChanges")({filter:n});if(0===s.length)return;if(t)r.onTransactions(s);else for(let e of s)r.onTransactions([e])}catch(e){r.onError?.(e)}},{emitOnBegin:!0,interval:s});return async()=>{n&&await E(e,tp,"uninstallFilter")({filter:n}),i()}}):(o=!0,a=()=>o=!1,(async()=>{try{let{unsubscribe:t}=await e.transport.subscribe({params:["newPendingTransactions"],onData(e){if(!o)return;let t=e.result;n([t])},onError(e){r?.(e)}});a=t,o||a()}catch(e){r?.(e)}})(),()=>a())})(e,t)}}function tY(e){let{key:t="public",name:r="Public Client"}=e;return(function(e){let{batch:t,cacheTime:r=e.pollingInterval??4e3,ccipRead:s,key:o="base",name:a="Base Client",pollingInterval:l=4e3,type:u="base"}=e,c=e.chain,d=e.account?(0,n.T)(e.account):void 0,{config:h,request:f,value:p}=e.transport({chain:c,pollingInterval:l}),g={account:d,batch:t,cacheTime:r,ccipRead:s,chain:c,key:o,name:a,pollingInterval:l,request:f,transport:{...h,...p},type:u,uid:(0,i.h)()};return Object.assign(g,{extend:function e(t){return r=>{let n=r(t);for(let e in g)delete n[e];let i={...t,...n};return Object.assign(i,{extend:e(i)})}}(g)})})({...e,key:t,name:r,type:"publicClient"}).extend(tK)}},28781:function(e,t,r){"use strict";r.d(t,{d:function(){return g}});var n=r(4456),i=r(48926);class s extends i.G{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro"})}}var o=r(10639),a=r(47499);let l={current:0,take(){return this.current++},reset(){this.current=0}};var u=r(96329),c=r(95046),d=r(36494);let h=new(r(98992)).k(8192);var f=r(55894),p=r(14851);function g(e,t={}){let{batch:r,fetchOptions:g,key:m="http",name:y="HTTP JSON-RPC",onFetchRequest:b,onFetchResponse:v,retryDelay:w}=t;return({chain:_,retryCount:E,timeout:A})=>{let{batchSize:x=1e3,wait:k=0}="object"==typeof r?r:{},S=t.retryCount??E,$=A??t.timeout??1e4,C=e||_?.rpcUrls.default.http[0];if(!C)throw new s;let P=function(e,t={}){return{async request(r){let{body:i,onRequest:s=t.onRequest,onResponse:o=t.onResponse,timeout:u=t.timeout??1e4}=r,c={...t.fetchOptions??{},...r.fetchOptions??{}},{headers:d,method:h,signal:f}=c;try{let t;let r=await function(e,{errorInstance:t=Error("timed out"),timeout:r,signal:n}){return new Promise((i,s)=>{(async()=>{let o;try{let a=new AbortController;r>0&&(o=setTimeout(()=>{n?a.abort():s(t)},r)),i(await e({signal:a?.signal||null}))}catch(e){e?.name==="AbortError"&&s(t),s(e)}finally{clearTimeout(o)}})()})}(async({signal:t})=>{let r={...c,body:Array.isArray(i)?(0,a.P)(i.map(e=>({jsonrpc:"2.0",id:e.id??l.take(),...e}))):(0,a.P)({jsonrpc:"2.0",id:i.id??l.take(),...i}),headers:{"Content-Type":"application/json",...d},method:h||"POST",signal:f||(u>0?t:null)},n=new Request(e,r);return s&&await s(n),await fetch(e,r)},{errorInstance:new n.W5({body:i,url:e}),timeout:u,signal:!0});if(o&&await o(r),r.headers.get("Content-Type")?.startsWith("application/json")?t=await r.json():(t=await r.text(),t=JSON.parse(t||"{}")),!r.ok)throw new n.Gg({body:i,details:(0,a.P)(t.error)||r.statusText,headers:r.headers,status:r.status,url:e});return t}catch(t){if(t instanceof n.Gg||t instanceof n.W5)throw t;throw new n.Gg({body:i,cause:t,url:e})}}}}(C,{fetchOptions:g,onRequest:b,onResponse:v,timeout:$});return function({key:e,name:t,request:r,retryCount:s=3,retryDelay:o=150,timeout:l,type:g},m){return{config:{key:e,name:t,request:r,retryCount:s,retryDelay:o,timeout:l,type:g},request:function(e,t={}){return async(r,s={})=>{let{dedupe:o=!1,retryDelay:l=150,retryCount:p=3,uid:g}={...t,...s},m=o?(0,d.w)((0,c.$G)(`${g}.${(0,a.P)(r)}`)):void 0;return function(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if(h.get(r))return h.get(r);let n=e().finally(()=>h.delete(r));return h.set(r,n),n}(()=>(0,f.J)(async()=>{try{return await e(r)}catch(e){switch(e.code){case u.s7.code:throw new u.s7(e);case u.B.code:throw new u.B(e);case u.LX.code:throw new u.LX(e,{method:r.method});case u.nY.code:throw new u.nY(e);case u.XS.code:throw new u.XS(e);case u.yR.code:throw new u.yR(e);case u.Og.code:throw new u.Og(e);case u.pT.code:throw new u.pT(e);case u.KB.code:throw new u.KB(e);case u.gS.code:throw new u.gS(e,{method:r.method});case u.Pv.code:throw new u.Pv(e);case u.GD.code:throw new u.GD(e);case u.ab.code:throw new u.ab(e);case u.PE.code:throw new u.PE(e);case u.Ts.code:throw new u.Ts(e);case u.u5.code:throw new u.u5(e);case u.I0.code:throw new u.I0(e);case u.x3.code:throw new u.x3(e);case 5e3:throw new u.ab(e);default:if(e instanceof i.G)throw e;throw new u.ir(e)}}},{delay:({count:e,error:t})=>{if(t&&t instanceof n.Gg){let e=t?.headers?.get("Retry-After");if(e?.match(/\d/))return 1e3*Number.parseInt(e)}return~~(1<"code"in e&&"number"==typeof e.code?-1===e.code||e.code===u.Pv.code||e.code===u.XS.code:!(e instanceof n.Gg)||!e.status||403===e.status||408===e.status||413===e.status||429===e.status||500===e.status||502===e.status||503===e.status||504===e.status}),{enabled:o,id:m})}}(r,{retryCount:s,retryDelay:o,uid:(0,p.h)()}),value:m}}({key:m,name:y,async request({method:e,params:t}){let i={method:e,params:t},{schedule:s}=(0,o.S)({id:C,wait:k,shouldSplitBatch:e=>e.length>x,fn:e=>P.request({body:e}),sort:(e,t)=>e.id-t.id}),a=async e=>r?s(e):[await P.request({body:e})],[{error:l,result:u}]=await a(i);if(l)throw new n.bs({body:i,error:l,url:C});return u},retryCount:S,retryDelay:w,timeout:$,type:"http"},{fetchOptions:g,url:C})}}},21620:function(e,t,r){"use strict";r.d(t,{$o:function(){return u},F8:function(){return n},X$:function(){return l},du:function(){return o},k3:function(){return s},nZ:function(){return a}});let n=[{inputs:[{components:[{name:"target",type:"address"},{name:"allowFailure",type:"bool"},{name:"callData",type:"bytes"}],name:"calls",type:"tuple[]"}],name:"aggregate3",outputs:[{components:[{name:"success",type:"bool"},{name:"returnData",type:"bytes"}],name:"returnData",type:"tuple[]"}],stateMutability:"view",type:"function"}],i=[{inputs:[],name:"ResolverNotFound",type:"error"},{inputs:[],name:"ResolverWildcardNotSupported",type:"error"},{inputs:[],name:"ResolverNotContract",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{components:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"errors",type:"tuple[]"}],name:"HttpError",type:"error"}],s=[...i,{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]},{name:"resolve",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes"},{name:"data",type:"bytes"},{name:"gateways",type:"string[]"}],outputs:[{name:"",type:"bytes"},{name:"address",type:"address"}]}],o=[...i,{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]},{name:"reverse",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolvedAddress"},{type:"address",name:"reverseResolver"},{type:"address",name:"resolver"}]}],a=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],l=[{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"}],outputs:[{name:"",type:"address"}]},{name:"addr",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"coinType",type:"uint256"}],outputs:[{name:"",type:"bytes"}]}],u=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"}]},13955:function(e,t,r){"use strict";r.d(t,{NO:function(){return n},ST:function(){return s},pG:function(){return i}});let n="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",i="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",s="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572"},47807:function(e,t,r){"use strict";r.d(t,{$:function(){return n},Up:function(){return i},hZ:function(){return s}});let n={1:"An `assert` condition failed.",17:"Arithmetic operation resulted in underflow or overflow.",18:"Division or modulo by zero (e.g. `5 / 0` or `23 % 0`).",33:"Attempted to convert to an invalid type.",34:"Attempted to access a storage byte array that is incorrectly encoded.",49:"Performed `.pop()` on an empty array",50:"Array index is out of bounds.",65:"Allocated too much memory or created an array which is too large.",81:"Attempted to call a zero-initialized variable of internal function type."},i={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},s={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"}},90408:function(e,t,r){"use strict";r.d(t,{Zn:function(){return i},ez:function(){return n}});let n={gwei:9,wei:18},i={ether:-9,wei:9}},52186:function(e,t,r){"use strict";r.d(t,{CI:function(){return k},FM:function(){return p},Gy:function(){return A},KY:function(){return _},M4:function(){return d},MX:function(){return b},S4:function(){return w},SM:function(){return E},cO:function(){return a},dh:function(){return x},eF:function(){return v},fM:function(){return o},fs:function(){return h},gr:function(){return c},hn:function(){return S},lC:function(){return g},mv:function(){return m},wM:function(){return $},wb:function(){return u},xB:function(){return l},xL:function(){return y},yP:function(){return f}});var n=r(20101),i=r(7508),s=r(48926);class o extends s.G{constructor({docsPath:e}){super("A constructor was not found on the ABI.\nMake sure you are using the correct ABI and that the constructor exists on it.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorNotFoundError"})}}class a extends s.G{constructor({docsPath:e}){super("Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.\nMake sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiConstructorParamsNotFoundError"})}}class l extends s.G{constructor({data:e,params:t,size:r}){super(`Data size of ${r} bytes is too small for given parameters.`,{metaMessages:[`Params: (${(0,n.h)(t,{includeName:!0})})`,`Data: ${e} (${r} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingDataSizeTooSmallError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e,this.params=t,this.size=r}}class u extends s.G{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.'),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiDecodingZeroDataError"})}}class c extends s.G{constructor({expectedLength:e,givenLength:t,type:r}){super(`ABI encoding array length mismatch for type ${r}. Expected length: ${e} Given length: ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingArrayLengthMismatchError"})}}class d extends s.G{constructor({expectedSize:e,value:t}){super(`Size of bytes "${t}" (bytes${(0,i.d)(t)}) does not match expected size (bytes${e}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingBytesSizeMismatchError"})}}class h extends s.G{constructor({expectedLength:e,givenLength:t}){super(`ABI encoding params/values length mismatch. Expected length (params): ${e} Given length (values): ${t}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEncodingLengthMismatchError"})}}class f extends s.G{constructor(e,{docsPath:t}){super(`Encoded error signature "${e}" not found on ABI. Make sure you are using the correct ABI and that the error exists on it. You can look up the decoded signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=e}}class p extends s.G{constructor({docsPath:e}){super("Cannot extract event signature from empty topics.",{docsPath:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureEmptyTopicsError"})}}class g extends s.G{constructor(e,{docsPath:t}){super(`Encoded event signature "${e}" not found on ABI. Make sure you are using the correct ABI and that the event exists on it. You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventSignatureNotFoundError"})}}class m extends s.G{constructor(e,{docsPath:t}={}){super(`Event ${e?`"${e}" `:""}not found on ABI. Make sure you are using the correct ABI and that the event exists on it.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiEventNotFoundError"})}}class y extends s.G{constructor(e,{docsPath:t}={}){super(`Function ${e?`"${e}" `:""}not found on ABI. Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionNotFoundError"})}}class b extends s.G{constructor(e,{docsPath:t}){super(`Function "${e}" does not contain any \`outputs\` on ABI. Cannot decode function result without knowing what the parameter types are. Make sure you are using the correct ABI and that the function exists on it.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionOutputsNotFoundError"})}}class v extends s.G{constructor(e,{docsPath:t}){super(`Encoded function signature "${e}" not found on ABI. Make sure you are using the correct ABI and that the function exists on it. You can look up the signature here: https://openchain.xyz/signatures?query=${e}.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiFunctionSignatureNotFoundError"})}}class w extends s.G{constructor(e,t){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${e.type}\` in \`${(0,n.t)(e.abiItem)}\`, and`,`\`${t.type}\` in \`${(0,n.t)(t.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItemAmbiguityError"})}}class _ extends s.G{constructor({expectedSize:e,givenSize:t}){super(`Expected bytes${e}, got bytes${t}.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BytesSizeMismatchError"})}}class E extends s.G{constructor({abiItem:e,data:t,params:r,size:i}){super(`Data size of ${i} bytes is too small for non-indexed event parameters.`,{metaMessages:[`Params: (${(0,n.h)(r,{includeName:!0})})`,`Data: ${t} (${i} bytes)`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogDataMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"params",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"size",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e,this.data=t,this.params=r,this.size=i}}class A extends s.G{constructor({abiItem:e,param:t}){super(`Expected a topic for indexed event parameter${t.name?` "${t.name}"`:""} on event "${(0,n.t)(e,{includeName:!0})}".`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=e}}class x extends s.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid encoding type. Please provide a valid ABI type.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiEncodingType"})}}class k extends s.G{constructor(e,{docsPath:t}){super(`Type "${e}" is not a valid decoding type. Please provide a valid ABI type.`,{docsPath:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiDecodingType"})}}class S extends s.G{constructor(e){super(`Value "${e}" is not a valid array.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidArrayError"})}}class $ extends s.G{constructor(e){super(`"${e}" is not a valid definition type. Valid types: "function", "event", "error"`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidDefinitionTypeError"})}}},51359:function(e,t,r){"use strict";r.d(t,{b:function(){return i}});var n=r(48926);class i extends n.G{constructor({address:e}){super(`Address "${e}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAddressError"})}}},48926:function(e,t,r){"use strict";r.d(t,{G:function(){return i}});var n=r(94290);class i extends Error{constructor(e,t={}){let r=t.cause instanceof i?t.cause.details:t.cause?.message?t.cause.message:t.details,s=t.cause instanceof i&&t.cause.docsPath||t.docsPath,o=(0,n.bo)();super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...s?[`Docs: ${t.docsBaseUrl??"https://viem.sh"}${s}${t.docsSlug?`#${t.docsSlug}`:""}`]:[],...r?[`Details: ${r}`]:[],`Version: ${o}`].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ViemError"}),this.details=r,this.docsPath=s,this.metaMessages=t.metaMessages,this.shortMessage=e,this.version=o}walk(e){return function e(t,r){return r?.(t)?t:t&&"object"==typeof t&&"cause"in t?e(t.cause,r):r?null:t}(this,e)}}},89045:function(e,t,r){"use strict";r.d(t,{mm:function(){return i},pZ:function(){return s}});var n=r(48926);class i extends n.G{constructor({blockNumber:e,chain:t,contract:r}){super(`Chain "${t.name}" does not support contract "${r.name}".`,{metaMessages:["This could be due to any of the following:",...e&&r.blockCreated&&r.blockCreated>e?[`- The contract "${r.name}" was not deployed until block ${r.blockCreated} (current block ${e}).`]:[`- The chain does not have the contract "${r.name}" configured.`]]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDoesNotSupportContract"})}}class s extends n.G{constructor(){super("No chain was provided to the Client."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ClientChainNotConfiguredError"})}}},58591:function(e,t,r){"use strict";r.d(t,{cg:function(){return y},uq:function(){return b},Lu:function(){return v},Dk:function(){return w},Mo:function(){return _},VQ:function(){return E}});var n=r(96104),i=r(47807),s=r(71108),o=r(20101),a=r(47499);function l({abiItem:e,args:t,includeFunctionName:r=!0,includeName:n=!1}){if("name"in e&&"inputs"in e&&e.inputs)return`${r?e.name:""}(${e.inputs.map((e,r)=>`${n&&e.name?`${e.name}: `:""}${"object"==typeof t[r]?(0,a.P)(t[r]):t[r]}`).join(", ")})`}var u=r(18748),c=r(85053),d=r(49268),h=r(52186),f=r(48926),p=r(75534),g=r(97658),m=r(94290);class y extends f.G{constructor(e,{account:t,docsPath:r,chain:i,data:s,gas:o,gasPrice:a,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:h,to:f,value:m,stateOverride:y}){let b=t?(0,n.T)(t):void 0,v=(0,g.xr)({from:b?.address,to:f,value:void 0!==m&&`${(0,c.d)(m)} ${i?.nativeCurrency?.symbol||"ETH"}`,data:s,gas:o,gasPrice:void 0!==a&&`${(0,d.o)(a)} gwei`,maxFeePerGas:void 0!==l&&`${(0,d.o)(l)} gwei`,maxPriorityFeePerGas:void 0!==u&&`${(0,d.o)(u)} gwei`,nonce:h});y&&(v+=` ${(0,p.Bj)(y)}`),super(e.shortMessage,{cause:e,docsPath:r,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],"Raw Call Arguments:",v].filter(Boolean)}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CallExecutionError"}),this.cause=e}}class b extends f.G{constructor(e,{abi:t,args:r,contractAddress:n,docsPath:i,functionName:s,sender:a}){let c=(0,u.mE)({abi:t,args:r,name:s}),d=c?l({abiItem:c,args:r,includeFunctionName:!1,includeName:!1}):void 0,h=c?(0,o.t)(c,{includeName:!0}):void 0,f=(0,g.xr)({address:n&&(0,m.CR)(n),function:h,args:d&&"()"!==d&&`${[...Array(s?.length??0).keys()].map(()=>" ").join("")}${d}`,sender:a});super(e.shortMessage||`An unknown error occurred while executing the contract function "${s}".`,{cause:e,docsPath:i,metaMessages:[...e.metaMessages?[...e.metaMessages," "]:[],f&&"Contract Call:",f].filter(Boolean)}),Object.defineProperty(this,"abi",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"args",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"contractAddress",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"formattedArgs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"functionName",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"sender",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionExecutionError"}),this.abi=t,this.args=r,this.cause=e,this.contractAddress=n,this.functionName=s,this.sender=a}}class v extends f.G{constructor({abi:e,data:t,functionName:r,message:n}){let a,u,c,d,f;if(t&&"0x"!==t)try{let{abiItem:r,errorName:n,args:a}=f=(0,s.p)({abi:e,data:t});if("Error"===n)c=a[0];else if("Panic"===n){let[e]=a;c=i.$[e]}else{let e=r?(0,o.t)(r,{includeName:!0}):void 0,t=r&&a?l({abiItem:r,args:a,includeFunctionName:!1,includeName:!1}):void 0;u=[e?`Error: ${e}`:"",t&&"()"!==t?` ${[...Array(n?.length??0).keys()].map(()=>" ").join("")}${t}`:""]}}catch(e){a=e}else n&&(c=n);a instanceof h.yP&&(d=a.signature,u=[`Unable to decode signature "${d}" as it was not found on the provided ABI.`,"Make sure you are using the correct ABI and that the error exists on it.",`You can look up the decoded signature here: https://openchain.xyz/signatures?query=${d}.`]),super(c&&"execution reverted"!==c||d?[`The contract function "${r}" reverted with the following ${d?"signature":"reason"}:`,c||d].join("\n"):`The contract function "${r}" reverted.`,{cause:a,metaMessages:u}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reason",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=f,this.reason=c,this.signature=d}}class w extends f.G{constructor({functionName:e}){super(`The contract function "${e}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${e}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ContractFunctionZeroDataError"})}}class _ extends f.G{constructor({factory:e}){super(`Deployment for counterfactual contract call failed${e?` for factory "${e}".`:""}`,{metaMessages:["Please ensure:","- The `factory` is a valid contract deployment factory (ie. Create2 Factory, ERC-4337 Factory, etc).","- The `factoryData` is a valid encoded function call for contract deployment function on the factory."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CounterfactualDeploymentFailedError"})}}class E extends f.G{constructor({data:e,message:t}){super(t||""),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RawContractError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=e}}},19477:function(e,t,r){"use strict";r.d(t,{KD:function(){return o},T_:function(){return i},lQ:function(){return s}});var n=r(48926);class i extends n.G{constructor({offset:e}){super(`Offset \`${e}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NegativeOffsetError"})}}class s extends n.G{constructor({length:e,position:t}){super(`Position \`${t}\` is out of bounds (\`0 < position < ${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"PositionOutOfBoundsError"})}}class o extends n.G{constructor({count:e,limit:t}){super(`Recursive read limit of \`${t}\` exceeded (recursive read count: \`${e}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RecursiveReadLimitExceededError"})}}},75057:function(e,t,r){"use strict";r.d(t,{$s:function(){return s},W_:function(){return o},mV:function(){return i}});var n=r(48926);class i extends n.G{constructor({offset:e,position:t,size:r}){super(`Slice ${"start"===t?"starting":"ending"} at offset "${e}" is out-of-bounds (size: ${r}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SliceOffsetOutOfBoundsError"})}}class s extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeExceedsPaddingSizeError"})}}class o extends n.G{constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} is expected to be ${t} ${r} long, but is ${e} ${r} long.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesLengthError"})}}},74188:function(e,t,r){"use strict";r.d(t,{J5:function(){return i},M6:function(){return o},yr:function(){return s}});var n=r(48926);class i extends n.G{constructor({max:e,min:t,signed:r,size:n,value:i}){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntegerOutOfRangeError"})}}class s extends n.G{constructor(e){super(`Bytes value "${e}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidBytesBooleanError"})}}class o extends n.G{constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SizeOverflowError"})}}},37764:function(e,t,r){"use strict";r.d(t,{C_:function(){return d},G$:function(){return a},Hh:function(){return o},M_:function(){return s},WF:function(){return h},ZI:function(){return l},cj:function(){return m},cs:function(){return g},dR:function(){return f},pZ:function(){return p},se:function(){return c},vU:function(){return u}});var n=r(49268),i=r(48926);class s extends i.G{constructor({cause:e,message:t}={}){let r=t?.replace("execution reverted: ","")?.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ExecutionRevertedError"})}}Object.defineProperty(s,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(s,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class o extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooHigh"})}}Object.defineProperty(o,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas higher than 2\^256-1|fee cap higher than 2\^256-1/});class a extends i.G{constructor({cause:e,maxFeePerGas:t}={}){super(`The fee cap (\`maxFeePerGas\`${t?` = ${(0,n.o)(t)}`:""} gwei) cannot be lower than the block base fee.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeCapTooLow"})}}Object.defineProperty(a,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max fee per gas less than block base fee|fee cap less than block base fee|transaction is outdated/});class l extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is higher than the next one expected.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooHighError"})}}Object.defineProperty(l,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class u extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}is lower than the current nonce of the account. Try increasing the nonce or find the latest nonce with \`getTransactionCount\`.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceTooLowError"})}}Object.defineProperty(u,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class c extends i.G{constructor({cause:e,nonce:t}={}){super(`Nonce provided for the transaction ${t?`(${t}) `:""}exceeds the maximum allowed nonce.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"NonceMaxValueError"})}}Object.defineProperty(c,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class d extends i.G{constructor({cause:e}={}){super("The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.",{cause:e,metaMessages:["This error could arise when the account does not have enough funds to:"," - pay for the total gas fee,"," - pay for the value to send."," ","The cost of the transaction is calculated as `gas * gas fee + value`, where:"," - `gas` is the amount of gas needed for transaction to execute,"," - `gas fee` is the gas fee,"," - `value` is the amount of ether to send to the recipient."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InsufficientFundsError"})}}Object.defineProperty(d,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds/});class h extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooHighError"})}}Object.defineProperty(h,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class f extends i.G{constructor({cause:e,gas:t}={}){super(`The amount of gas ${t?`(${t}) `:""}provided for the transaction is too low.`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"IntrinsicGasTooLowError"})}}Object.defineProperty(f,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class p extends i.G{constructor({cause:e}){super("The transaction type is not supported for this chain.",{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionTypeNotSupportedError"})}}Object.defineProperty(p,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class g extends i.G{constructor({cause:e,maxPriorityFeePerGas:t,maxFeePerGas:r}={}){super(`The provided tip (\`maxPriorityFeePerGas\`${t?` = ${(0,n.o)(t)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${r?` = ${(0,n.o)(r)} gwei`:""}).`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TipAboveFeeCapError"})}}Object.defineProperty(g,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/max priority fee per gas higher than max fee per gas|tip higher than fee cap/});class m extends i.G{constructor({cause:e}){super(`An error occurred while executing: ${e?.shortMessage}`,{cause:e}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownNodeError"})}}},4456:function(e,t,r){"use strict";r.d(t,{Gg:function(){return o},W5:function(){return l},bs:function(){return a}});var n=r(47499),i=r(48926),s=r(94290);class o extends i.G{constructor({body:e,cause:t,details:r,headers:i,status:o,url:a}){super("HTTP request failed.",{cause:t,details:r,metaMessages:[o&&`Status: ${o}`,`URL: ${(0,s.Gr)(a)}`,e&&`Request body: ${(0,n.P)(e)}`].filter(Boolean)}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"HttpRequestError"}),Object.defineProperty(this,"body",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"headers",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.body=e,this.headers=i,this.status=o,this.url=a}}class a extends i.G{constructor({body:e,error:t,url:r}){super("RPC Request failed.",{cause:t,details:t.message,metaMessages:[`URL: ${(0,s.Gr)(r)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcRequestError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=t.code}}class l extends i.G{constructor({body:e,url:t}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${(0,s.Gr)(t)}`,`Request body: ${(0,n.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TimeoutError"})}}},96329:function(e,t,r){"use strict";r.d(t,{B:function(){return l},GD:function(){return b},I0:function(){return A},KB:function(){return g},LX:function(){return u},Og:function(){return f},PE:function(){return w},Pv:function(){return y},Ts:function(){return _},XS:function(){return d},ab:function(){return v},gS:function(){return m},ir:function(){return k},nY:function(){return c},pT:function(){return p},s7:function(){return a},u5:function(){return E},x3:function(){return x},yR:function(){return h}});var n=r(48926),i=r(4456);class s extends n.G{constructor(e,{code:t,docsPath:r,metaMessages:n,shortMessage:s}){super(s,{cause:e,docsPath:r,metaMessages:n||e?.metaMessages}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=e.name,this.code=e instanceof i.bs?e.code:t??-1}}class o extends s{constructor(e,t){super(e,t),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderRpcError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t.data}}class a extends s{constructor(e){super(e,{code:a.code,shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ParseRpcError"})}}Object.defineProperty(a,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class l extends s{constructor(e){super(e,{code:l.code,shortMessage:"JSON is not a valid request object."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidRequestRpcError"})}}Object.defineProperty(l,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class u extends s{constructor(e,{method:t}={}){super(e,{code:u.code,shortMessage:`The method${t?` "${t}"`:""} does not exist / is not available.`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotFoundRpcError"})}}Object.defineProperty(u,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class c extends s{constructor(e){super(e,{code:c.code,shortMessage:"Invalid parameters were provided to the RPC method.\nDouble check you have provided the correct parameters."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParamsRpcError"})}}Object.defineProperty(c,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class d extends s{constructor(e){super(e,{code:d.code,shortMessage:"An internal error was received."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InternalRpcError"})}}Object.defineProperty(d,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class h extends s{constructor(e){super(e,{code:h.code,shortMessage:"Missing or invalid parameters.\nDouble check you have provided the correct parameters."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidInputRpcError"})}}Object.defineProperty(h,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class f extends s{constructor(e){super(e,{code:f.code,shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(f,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class p extends s{constructor(e){super(e,{code:p.code,shortMessage:"Requested resource not available."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceUnavailableRpcError"})}}Object.defineProperty(p,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class g extends s{constructor(e){super(e,{code:g.code,shortMessage:"Transaction creation failed."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionRejectedRpcError"})}}Object.defineProperty(g,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class m extends s{constructor(e,{method:t}={}){super(e,{code:m.code,shortMessage:`Method${t?` "${t}"`:""} is not implemented.`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"MethodNotSupportedRpcError"})}}Object.defineProperty(m,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class y extends s{constructor(e){super(e,{code:y.code,shortMessage:"Request exceeds defined limit."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"LimitExceededRpcError"})}}Object.defineProperty(y,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class b extends s{constructor(e){super(e,{code:b.code,shortMessage:"Version of JSON-RPC protocol is not supported."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"JsonRpcVersionUnsupportedError"})}}Object.defineProperty(b,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class v extends o{constructor(e){super(e,{code:v.code,shortMessage:"User rejected the request."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UserRejectedRequestError"})}}Object.defineProperty(v,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class w extends o{constructor(e){super(e,{code:w.code,shortMessage:"The requested method and/or account has not been authorized by the user."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnauthorizedProviderError"})}}Object.defineProperty(w,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class _ extends o{constructor(e,{method:t}={}){super(e,{code:_.code,shortMessage:`The Provider does not support the requested method${t?` " ${t}"`:""}.`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnsupportedProviderMethodError"})}}Object.defineProperty(_,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class E extends o{constructor(e){super(e,{code:E.code,shortMessage:"The Provider is disconnected from all chains."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ProviderDisconnectedError"})}}Object.defineProperty(E,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class A extends o{constructor(e){super(e,{code:A.code,shortMessage:"The Provider is not connected to the requested chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ChainDisconnectedError"})}}Object.defineProperty(A,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class x extends o{constructor(e){super(e,{code:x.code,shortMessage:"An error occurred when attempting to switch chain."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SwitchChainError"})}}Object.defineProperty(x,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class k extends s{constructor(e){super(e,{shortMessage:"An unknown RPC error occurred."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownRpcError"})}}},75534:function(e,t,r){"use strict";r.d(t,{Bj:function(){return a},Nc:function(){return i},Z8:function(){return s}});var n=r(48926);class i extends n.G{constructor({address:e}){super(`State for account "${e}" is set multiple times.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AccountStateConflictError"})}}class s extends n.G{constructor(){super("state and stateDiff are set on the same account."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"StateAssignmentConflictError"})}}function o(e){return e.reduce((e,{slot:t,value:r})=>`${e} ${t}: ${r} `,"")}function a(e){return e.reduce((e,{address:t,...r})=>{let n=`${e} ${t}: `;return r.nonce&&(n+=` nonce: ${r.nonce} `),r.balance&&(n+=` balance: ${r.balance} `),r.code&&(n+=` code: ${r.code} `),r.state&&(n+=" state:\n"+o(r.state)),r.stateDiff&&(n+=" stateDiff:\n"+o(r.stateDiff)),n}," State Override:\n").slice(0,-1)}},97658:function(e,t,r){"use strict";r.d(t,{Bh:function(){return a},Yb:function(){return l},j3:function(){return o},mc:function(){return u},xY:function(){return s},xr:function(){return i}}),r(85053),r(49268);var n=r(48926);function i(e){let t=Object.entries(e).map(([e,t])=>void 0===t||!1===t?null:[e,t]).filter(Boolean),r=t.reduce((e,[t])=>Math.max(e,t.length),0);return t.map(([e,t])=>` ${`${e}:`.padEnd(r+1)} ${t}`).join("\n")}class s extends n.G{constructor(){super("Cannot specify both a `gasPrice` and a `maxFeePerGas`/`maxPriorityFeePerGas`.\nUse `maxFeePerGas`/`maxPriorityFeePerGas` for EIP-1559 compatible networks, and `gasPrice` for others."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"FeeConflictError"})}}class o extends n.G{constructor({transaction:e}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",i(e),"}","","To infer the type, either provide:","- a `type` to the Transaction, or","- an EIP-1559 Transaction with `maxFeePerGas`, or","- an EIP-2930 Transaction with `gasPrice` & `accessList`, or","- an EIP-4844 Transaction with `blobs`, `blobVersionedHashes`, `sidecars`, or","- a Legacy Transaction with `gasPrice`"]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSerializableTransactionError"})}}class a extends n.G{constructor({blockHash:e,blockNumber:t,blockTag:r,hash:n,index:i}){let s="Transaction";r&&void 0!==i&&(s=`Transaction at block time "${r}" at index "${i}"`),e&&void 0!==i&&(s=`Transaction at block hash "${e}" at index "${i}"`),t&&void 0!==i&&(s=`Transaction at block number "${t}" at index "${i}"`),n&&(s=`Transaction with hash "${n}"`),super(`${s} could not be found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionNotFoundError"})}}class l extends n.G{constructor({hash:e}){super(`Transaction receipt with hash "${e}" could not be found. The Transaction may not be processed on a block yet.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"TransactionReceiptNotFoundError"})}}class u extends n.G{constructor({hash:e}){super(`Timed out while waiting for transaction with hash "${e}" to be confirmed.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"WaitForTransactionReceiptTimeoutError"})}}},94290:function(e,t,r){"use strict";r.d(t,{CR:function(){return n},Gr:function(){return i},bo:function(){return s}});let n=e=>e,i=e=>e,s=()=>"viem@2.18.8"},52998:function(e,t,r){"use strict";r.d(t,{r:function(){return g}});var n=r(52186),i=r(99112),s=r(15222),o=r(7508),a=r(49014),l=r(77955),u=r(74188),c=r(21019),d=r(95046);function h(e,t={}){void 0!==t.size&&(0,c.Yf)(e,{size:t.size});let r=(0,d.ci)(e,t);return(0,c.ly)(r,t)}var f=r(82361),p=r(39480);function g(e,t){let r="string"==typeof t?(0,f.nr)(t):t,g=(0,s.q)(r);if(0===(0,o.d)(r)&&e.length>0)throw new n.wb;if((0,o.d)(t)&&32>(0,o.d)(t))throw new n.xB({data:"string"==typeof t?t:(0,d.ci)(t),params:e,size:(0,o.d)(t)});let y=0,b=[];for(let t=0;t!e),s=i?[]:{},o=0;if(m(r)){let a=n+h(t.readBytes(32));for(let n=0;n1||r[0]>1)throw new u.yr(r);return!!r[0]}(t.readBytes(32),{size:32}),32];if(r.type.startsWith("bytes"))return function(e,t,{staticPosition:r}){let[n,i]=t.type.split("bytes");if(!i){let t=h(e.readBytes(32));e.setPosition(r+t);let n=h(e.readBytes(32));if(0===n)return e.setPosition(r+32),["0x",32];let i=e.readBytes(n);return e.setPosition(r+32),[(0,d.ci)(i),32]}return[(0,d.ci)(e.readBytes(Number.parseInt(i),32)),32]}(t,r,{staticPosition:s});if(r.type.startsWith("uint")||r.type.startsWith("int"))return function(e,t){let r=t.type.startsWith("int"),n=Number.parseInt(t.type.split("int")[1]||"256"),i=e.readBytes(32);return[n>48?function(e,t={}){void 0!==t.size&&(0,c.Yf)(e,{size:t.size});let r=(0,d.ci)(e,t);return(0,c.y_)(r,t)}(i,{signed:r}):h(i,{signed:r}),32]}(t,r);if("string"===r.type)return function(e,{staticPosition:t}){let r=h(e.readBytes(32));e.setPosition(t+r);let n=h(e.readBytes(32));if(0===n)return e.setPosition(t+32),["",32];let i=e.readBytes(n,32),s=function(e,t={}){let r=e;return void 0!==t.size&&((0,c.Yf)(r,{size:t.size}),r=(0,l.f)(r,{dir:"right"})),new TextDecoder().decode(r)}((0,l.f)(i));return e.setPosition(t+32),[s,32]}(t,{staticPosition:s});throw new n.CI(r.type,{docsPath:"/docs/contract/decodeAbiParameters"})}(g,r,{staticPosition:0});y+=o,b.push(s)}return b}function m(e){let{type:t}=e;if("string"===t||"bytes"===t||t.endsWith("[]"))return!0;if("tuple"===t)return e.components?.some(m);let r=(0,p.S)(e.type);return!!(r&&m({...e,type:r[1]}))}},71108:function(e,t,r){"use strict";r.d(t,{p:function(){return u}});var n=r(47807),i=r(52186),s=r(49014),o=r(87522),a=r(52998),l=r(20101);function u(e){let{abi:t,data:r}=e,u=(0,s.tP)(r,0,4);if("0x"===u)throw new i.wb;let c=[...t||[],n.Up,n.hZ].find(e=>"error"===e.type&&u===(0,o.C)((0,l.t)(e)));if(!c)throw new i.yP(u,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:c,args:"inputs"in c&&c.inputs&&c.inputs.length>0?(0,a.r)(c.inputs,(0,s.tP)(r,4)):void 0,errorName:c.name}}},43408:function(e,t,r){"use strict";r.d(t,{p:function(){return l}});var n=r(52186),i=r(49014),s=r(87522),o=r(52998),a=r(20101);function l(e){let{abi:t,data:r}=e,l=(0,i.tP)(r,0,4),u=t.find(e=>"function"===e.type&&l===(0,s.C)((0,a.t)(e)));if(!u)throw new n.eF(l,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:u.name,args:"inputs"in u&&u.inputs&&u.inputs.length>0?(0,o.r)(u.inputs,(0,i.tP)(r,4)):void 0}}},97225:function(e,t,r){"use strict";r.d(t,{k:function(){return a}});var n=r(52186),i=r(52998),s=r(18748);let o="/docs/contract/decodeFunctionResult";function a(e){let{abi:t,args:r,functionName:a,data:l}=e,u=t[0];if(a){let e=(0,s.mE)({abi:t,args:r,name:a});if(!e)throw new n.xL(a,{docsPath:o});u=e}if("function"!==u.type)throw new n.xL(void 0,{docsPath:o});if(!u.outputs)throw new n.MX(u.name,{docsPath:o});let c=(0,i.r)(u.outputs,l);return c&&c.length>1?c:c&&1===c.length?c[0]:void 0}},39480:function(e,t,r){"use strict";r.d(t,{E:function(){return h},S:function(){return p}});var n=r(52186),i=r(51359),s=r(48926),o=r(64113),a=r(53932),l=r(88202),u=r(7508),c=r(49014),d=r(95046);function h(e,t){if(e.length!==t.length)throw new n.fs({expectedLength:e.length,givenLength:t.length});let r=f(function({params:e,values:t}){let r=[];for(let h=0;h0?(0,a.zo)([t,e]):t}}if(o)return{dynamic:!0,encoded:e}}return{dynamic:!1,encoded:(0,a.zo)(l.map(({encoded:e})=>e))}}(r,{length:i,param:{...t,type:s}})}if("tuple"===t.type)return function(t,{param:r}){let n=!1,i=[];for(let s=0;se))}}(r,{param:t});if("address"===t.type)return function(e){if(!(0,o.U)(e))throw new i.b({address:e});return{dynamic:!1,encoded:(0,l.gc)(e.toLowerCase())}}(r);if("bool"===t.type)return function(e){if("boolean"!=typeof e)throw new s.G(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:(0,l.gc)((0,d.C4)(e))}}(r);if(t.type.startsWith("uint")||t.type.startsWith("int"))return function(e,{signed:t}){return{dynamic:!1,encoded:(0,d.eC)(e,{size:32,signed:t})}}(r,{signed:t.type.startsWith("int")});if(t.type.startsWith("bytes"))return function(e,{param:t}){let[,r]=t.type.split("bytes"),i=(0,u.d)(e);if(!r){let t=e;return i%32!=0&&(t=(0,l.gc)(t,{dir:"right",size:32*Math.ceil((e.length-2)/2/32)})),{dynamic:!0,encoded:(0,a.zo)([(0,l.gc)((0,d.eC)(i,{size:32})),t])}}if(i!==Number.parseInt(r))throw new n.M4({expectedSize:Number.parseInt(r),value:e});return{dynamic:!1,encoded:(0,l.gc)(e,{dir:"right"})}}(r,{param:t});if("string"===t.type)return function(e){let t=(0,d.$G)(e),r=Math.ceil((0,u.d)(t)/32),n=[];for(let e=0;e"type"in e&&"constructor"===e.type);if(!l)throw new n.fM({docsPath:o});if(!("inputs"in l)||!l.inputs||0===l.inputs.length)throw new n.cO({docsPath:o});let u=(0,s.E)(l.inputs,r);return(0,i.SM)([a,u])}},31006:function(e,t,r){"use strict";r.d(t,{R:function(){return c}});var n=r(53932),i=r(39480),s=r(52186),o=r(87522),a=r(20101),l=r(18748);let u="/docs/contract/encodeFunctionData";function c(e){let{args:t}=e,{abi:r,functionName:c}=1===e.abi.length&&e.functionName?.startsWith("0x")?e:function(e){let{abi:t,args:r,functionName:n}=e,i=t[0];if(n){let e=(0,l.mE)({abi:t,args:r,name:n});if(!e)throw new s.xL(n,{docsPath:u});i=e}if("function"!==i.type)throw new s.xL(void 0,{docsPath:u});return{abi:[i],functionName:(0,o.C)((0,a.t)(i))}}(e),d=r[0],h="inputs"in d&&d.inputs?(0,i.E)(d.inputs,t??[]):void 0;return(0,n.SM)([c,h??"0x"])}},20101:function(e,t,r){"use strict";r.d(t,{h:function(){return s},t:function(){return i}});var n=r(52186);function i(e,{includeName:t=!1}={}){if("function"!==e.type&&"event"!==e.type&&"error"!==e.type)throw new n.wM(e.type);return`${e.name}(${s(e.inputs,{includeName:t})})`}function s(e,{includeName:t=!1}={}){return e?e.map(e=>(function(e,{includeName:t}){return e.type.startsWith("tuple")?`(${s(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")})(e,{includeName:t})).join(t?", ":","):""}},18748:function(e,t,r){"use strict";r.d(t,{mE:function(){return l}});var n=r(52186),i=r(40369),s=r(64113),o=r(53263),a=r(87522);function l(e){let t;let{abi:r,args:l=[],name:u}=e,c=(0,i.v)(u,{strict:!1}),d=r.filter(e=>c?"function"===e.type?(0,a.C)(e)===u:"event"===e.type&&(0,o.n)(e)===u:"name"in e&&e.name===u);if(0!==d.length){if(1===d.length)return d[0];for(let e of d)if("inputs"in e){if(!l||0===l.length){if(!e.inputs||0===e.inputs.length)return e;continue}if(e.inputs&&0!==e.inputs.length&&e.inputs.length===l.length&&l.every((t,r)=>{let n="inputs"in e&&e.inputs[r];return!!n&&function e(t,r){let n=typeof t,i=r.type;switch(i){case"address":return(0,s.U)(t,{strict:!1});case"bool":return"boolean"===n;case"function":case"string":return"string"===n;default:if("tuple"===i&&"components"in r)return Object.values(r.components).every((r,n)=>e(Object.values(t)[n],r));if(/^u?int(8|16|24|32|40|48|56|64|72|80|88|96|104|112|120|128|136|144|152|160|168|176|184|192|200|208|216|224|232|240|248|256)?$/.test(i))return"number"===n||"bigint"===n;if(/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(i))return"string"===n||t instanceof Uint8Array;if(/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(i))return Array.isArray(t)&&t.every(t=>e(t,{...r,type:i.replace(/(\[[0-9]{0,}\])$/,"")}));return!1}}(t,n)})){if(t&&"inputs"in t&&t.inputs){let r=function e(t,r,n){for(let i in t){let o=t[i],a=r[i];if("tuple"===o.type&&"tuple"===a.type&&"components"in o&&"components"in a)return e(o.components,a.components,n[i]);let l=[o.type,a.type];if(l.includes("address")&&l.includes("bytes20")||(l.includes("address")&&l.includes("string")||l.includes("address")&&l.includes("bytes"))&&(0,s.U)(n[i],{strict:!1}))return l}}(e.inputs,t.inputs,l);if(r)throw new n.S4({abiItem:e,type:r[0]},{abiItem:t,type:r[1]})}t=e}}return t||d[0]}}},99112:function(e,t,r){"use strict";r.d(t,{K:function(){return c},x:function(){return u}});var n=r(51359),i=r(82361),s=r(36494),o=r(98992),a=r(64113);let l=new o.k(8192);function u(e,t){if(l.has(`${e}.${t}`))return l.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=(0,s.w)((0,i.qX)(r),"bytes"),o=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&o[e]&&(o[e]=o[e].toUpperCase()),(15&n[e>>1])>=8&&o[e+1]&&(o[e+1]=o[e+1].toUpperCase());let a=`0x${o.join("")}`;return l.set(`${e}.${t}`,a),a}function c(e,t){if(!(0,a.U)(e,{strict:!1}))throw new n.b({address:e});return u(e,t)}},64113:function(e,t,r){"use strict";r.d(t,{U:function(){return a}});var n=r(98992),i=r(99112);let s=/^0x[a-fA-F0-9]{40}$/,o=new n.k(8192);function a(e,t){let{strict:r=!0}=t??{},n=`${e}.${r}`;if(o.has(n))return o.get(n);let a=!!s.test(e)&&(e.toLowerCase()===e||!r||(0,i.x)(e)===e);return o.set(n,a),a}},65937:function(e,t,r){"use strict";r.d(t,{E:function(){return s}});var n=r(51359),i=r(64113);function s(e,t){if(!(0,i.U)(e,{strict:!1}))throw new n.b({address:e});if(!(0,i.U)(t,{strict:!1}))throw new n.b({address:t});return e.toLowerCase()===t.toLowerCase()}},18543:function(e,t,r){"use strict";r.d(t,{L:function(){return i}});var n=r(89045);function i({blockNumber:e,chain:t,contract:r}){let i=t?.contracts?.[r];if(!i)throw new n.mm({chain:t,contract:{name:r}});if(e&&i.blockCreated&&i.blockCreated>e)throw new n.mm({blockNumber:e,chain:t,contract:{name:r,blockCreated:i.blockCreated}});return i.address}},15222:function(e,t,r){"use strict";r.d(t,{q:function(){return s}});var n=r(19477);let i={bytes:new Uint8Array,dataView:new DataView(new ArrayBuffer(0)),position:0,positionReadCount:new Map,recursiveReadCount:0,recursiveReadLimit:Number.POSITIVE_INFINITY,assertReadLimit(){if(this.recursiveReadCount>=this.recursiveReadLimit)throw new n.KD({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new n.lQ({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new n.T_({offset:e});let t=this.position-e;this.assertPosition(t),this.position=t},getReadCount(e){return this.positionReadCount.get(e||this.position)||0},incrementPosition(e){if(e<0)throw new n.T_({offset:e});let t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){let r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){let t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){let t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){let t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){let t=e??this.position;return this.assertPosition(t+3),this.dataView.getUint32(t)},pushByte(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushBytes(e){this.assertPosition(this.position+e.length-1),this.bytes.set(e,this.position),this.position+=e.length},pushUint8(e){this.assertPosition(this.position),this.bytes[this.position]=e,this.position++},pushUint16(e){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,e),this.position+=2},pushUint24(e){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,e>>8),this.dataView.setUint8(this.position+2,255&e),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();let e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();let r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();let e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();let e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();let e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();let e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){let t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;let e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function s(e,{recursiveReadLimit:t=8192}={}){let r=Object.create(i);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}},53932:function(e,t,r){"use strict";function n(e){return"string"==typeof e[0]?i(e):function(e){let t=0;for(let r of e)t+=r.length;let r=new Uint8Array(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r}(e)}function i(e){return`0x${e.reduce((e,t)=>e+t.replace("0x",""),"")}`}r.d(t,{SM:function(){return i},zo:function(){return n}})},40369:function(e,t,r){"use strict";function n(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}r.d(t,{v:function(){return n}})},88202:function(e,t,r){"use strict";r.d(t,{gc:function(){return s},vk:function(){return i}});var n=r(75057);function i(e,{dir:t,size:r=32}={}){return"string"==typeof e?s(e,{dir:t,size:r}):function(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new n.$s({size:e.length,targetSize:r,type:"bytes"});let i=new Uint8Array(r);for(let n=0;n2*r)throw new n.$s({size:Math.ceil(i.length/2),targetSize:r,type:"hex"});return`0x${i["right"===t?"padEnd":"padStart"](2*r,"0")}`}},7508:function(e,t,r){"use strict";r.d(t,{d:function(){return i}});var n=r(40369);function i(e){return(0,n.v)(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}},49014:function(e,t,r){"use strict";r.d(t,{T4:function(){return u},p5:function(){return c},tP:function(){return o}});var n=r(75057),i=r(40369),s=r(7508);function o(e,t,r,{strict:n}={}){return(0,i.v)(e,{strict:!1})?c(e,t,r,{strict:n}):u(e,t,r,{strict:n})}function a(e,t){if("number"==typeof t&&t>0&&t>(0,s.d)(e)-1)throw new n.mV({offset:t,position:"start",size:(0,s.d)(e)})}function l(e,t,r){if("number"==typeof t&&"number"==typeof r&&(0,s.d)(e)!==r-t)throw new n.mV({offset:r,position:"end",size:(0,s.d)(e)})}function u(e,t,r,{strict:n}={}){a(e,t);let i=e.slice(t,r);return n&&l(i,t,r),i}function c(e,t,r,{strict:n}={}){a(e,t);let i=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&l(i,t,r),i}},77955:function(e,t,r){"use strict";function n(e,{dir:t="left"}={}){let r="string"==typeof e?e.replace("0x",""):e,n=0;for(let e=0;et)throw new n.M6({givenSize:(0,i.d)(e),maxSize:t})}function o(e,t={}){let{signed:r}=t;t.size&&s(e,{size:t.size});let n=BigInt(e);if(!r)return n;let i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function a(e,t={}){return Number(o(e,t))}},82361:function(e,t,r){"use strict";r.d(t,{O0:function(){return u},nr:function(){return h},qX:function(){return f}});var n=r(48926),i=r(40369),s=r(88202),o=r(21019),a=r(95046);let l=new TextEncoder;function u(e,t={}){return"number"==typeof e||"bigint"==typeof e?h((0,a.eC)(e,t)):"boolean"==typeof e?function(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?((0,o.Yf)(r,{size:t.size}),(0,s.vk)(r,{size:t.size})):r}(e,t):(0,i.v)(e)?h(e,t):f(e,t)}let c={zero:48,nine:57,A:65,F:70,a:97,f:102};function d(e){return e>=c.zero&&e<=c.nine?e-c.zero:e>=c.A&&e<=c.F?e-(c.A-10):e>=c.a&&e<=c.f?e-(c.a-10):void 0}function h(e,t={}){let r=e;t.size&&((0,o.Yf)(r,{size:t.size}),r=(0,s.vk)(r,{dir:"right",size:t.size}));let i=r.slice(2);i.length%2&&(i=`0${i}`);let a=i.length/2,l=new Uint8Array(a);for(let e=0,t=0;et.toString(16).padStart(2,"0"));function a(e,t={}){return"number"==typeof e||"bigint"==typeof e?c(e,t):"string"==typeof e?h(e,t):"boolean"==typeof e?l(e,t):u(e,t)}function l(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?((0,s.Yf)(r,{size:t.size}),(0,i.vk)(r,{size:t.size})):r}function u(e,t={}){let r="";for(let t=0;tr||ae.code===i.M_.code):e;return s instanceof n.G?new i.M_({cause:e,message:s.details}):i.M_.nodeMessage.test(r)?new i.M_({cause:e,message:e.details}):i.Hh.nodeMessage.test(r)?new i.Hh({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.G$.nodeMessage.test(r)?new i.G$({cause:e,maxFeePerGas:t?.maxFeePerGas}):i.ZI.nodeMessage.test(r)?new i.ZI({cause:e,nonce:t?.nonce}):i.vU.nodeMessage.test(r)?new i.vU({cause:e,nonce:t?.nonce}):i.se.nodeMessage.test(r)?new i.se({cause:e,nonce:t?.nonce}):i.C_.nodeMessage.test(r)?new i.C_({cause:e}):i.WF.nodeMessage.test(r)?new i.WF({cause:e,gas:t?.gas}):i.dR.nodeMessage.test(r)?new i.dR({cause:e,gas:t?.gas}):i.pZ.nodeMessage.test(r)?new i.pZ({cause:e}):i.cs.nodeMessage.test(r)?new i.cs({cause:e,maxFeePerGas:t?.maxFeePerGas,maxPriorityFeePerGas:t?.maxPriorityFeePerGas}):new i.cj({cause:e})}},27031:function(e,t,r){"use strict";function n(e,{format:t}){if(!t)return{};let r={};return!function t(n){for(let i of Object.keys(n))i in e&&(r[i]=e[i]),n[i]&&"object"==typeof n[i]&&!Array.isArray(n[i])&&t(n[i])}(t(e||{})),r}r.d(t,{K:function(){return n}})},37669:function(e,t,r){"use strict";r.d(t,{tG:function(){return s}});var n=r(95046);let i={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3"};function s(e){let t={};return void 0!==e.accessList&&(t.accessList=e.accessList),void 0!==e.blobVersionedHashes&&(t.blobVersionedHashes=e.blobVersionedHashes),void 0!==e.blobs&&("string"!=typeof e.blobs[0]?t.blobs=e.blobs.map(e=>(0,n.ci)(e)):t.blobs=e.blobs),void 0!==e.data&&(t.data=e.data),void 0!==e.from&&(t.from=e.from),void 0!==e.gas&&(t.gas=(0,n.eC)(e.gas)),void 0!==e.gasPrice&&(t.gasPrice=(0,n.eC)(e.gasPrice)),void 0!==e.maxFeePerBlobGas&&(t.maxFeePerBlobGas=(0,n.eC)(e.maxFeePerBlobGas)),void 0!==e.maxFeePerGas&&(t.maxFeePerGas=(0,n.eC)(e.maxFeePerGas)),void 0!==e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=(0,n.eC)(e.maxPriorityFeePerGas)),void 0!==e.nonce&&(t.nonce=(0,n.eC)(e.nonce)),void 0!==e.to&&(t.to=e.to),void 0!==e.type&&(t.type=i[e.type]),void 0!==e.value&&(t.value=(0,n.eC)(e.value)),t}},36494:function(e,t,r){"use strict";r.d(t,{w:function(){return P}});var n=r(65376);let i=BigInt(4294967296-1),s=BigInt(32),o=(e,t,r)=>e<>>32-r,a=(e,t,r)=>t<>>32-r,l=(e,t,r)=>t<>>64-r,u=(e,t,r)=>e<>>64-r;var c=r(68104);let d=[],h=[],f=[],p=BigInt(0),g=BigInt(1),m=BigInt(2),y=BigInt(7),b=BigInt(256),v=BigInt(113);for(let e=0,t=g,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],d.push(2*(5*n+r)),h.push((e+1)*(e+2)/2%64);let i=p;for(let e=0;e<7;e++)(t=(t<>y)*v)%b)&m&&(i^=g<<(g<>s&i)}:{h:0|Number(e>>s&i),l:0|Number(e&i)}}(e[o],t);[r[o],n[o]]=[a,l]}return[r,n]}(f,!0),E=(e,t,r)=>r>32?l(e,t,r):o(e,t,r),A=(e,t,r)=>r>32?u(e,t,r):a(e,t,r);class x extends c.kb{constructor(e,t,r,i=!1,s=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=i,this.rounds=s,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,(0,n.Rx)(r),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,c.Jq)(this.state)}keccak(){c.iA||(0,c.l1)(this.state32),function(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,s=r[i],o=r[i+1],a=E(s,o,1)^r[n],l=A(s,o,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=l}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=h[r],s=E(t,i,n),o=A(t,i,n),a=d[r];t=e[a],i=e[a+1],e[a]=s,e[a+1]=o}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=w[n],e[1]^=_[n]}r.fill(0)}(this.state32,this.rounds),c.iA||(0,c.l1)(this.state32),this.posOut=0,this.pos=0}update(e){(0,n.Gg)(this);let{blockLen:t,state:r}=this,i=(e=(0,c.O0)(e)).length;for(let n=0;n=r&&this.keccak();let s=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+s),n),this.posOut+=s,n+=s}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,n.Rx)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,n.J8)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:s}=this;return e||(e=new x(t,r,n,s,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=s,e.destroyed=this.destroyed,e}}let k=(0,c.hE)(()=>new x(136,1,32));var S=r(40369),$=r(82361),C=r(95046);function P(e,t){let r=k((0,S.v)(e,{strict:!1})?(0,$.O0)(e):e);return"bytes"===(t||"hex")?r:(0,C.NC)(r)}},53263:function(e,t,r){"use strict";r.d(t,{n:function(){return n}});let n=r(99530).r},87522:function(e,t,r){"use strict";r.d(t,{C:function(){return s}});var n=r(49014),i=r(99530);let s=e=>(0,n.tP)((0,i.r)(e),0,4)},99530:function(e,t,r){"use strict";r.d(t,{r:function(){return d}});var n=r(82361),i=r(36494);let s=e=>(0,i.w)((0,n.O0)(e));var o=r(43197);let a=/^tuple(?(\[(\d*)\])*)$/;function l(e){let t="",r=e.length;for(let n=0;n(function(e){let t=!0,r="",n=0,i="",s=!1;for(let o=0;othis.maxSize&&this.delete(this.keys().next().value),this}}},10639:function(e,t,r){"use strict";r.d(t,{S:function(){return i}});let n=new Map;function i({fn:e,id:t,shouldSplitBatch:r,wait:i=0,sort:s}){let o=async()=>{let t=u();a();let r=t.map(({args:e})=>e);0!==r.length&&e(r).then(e=>{s&&Array.isArray(e)&&e.sort(s);for(let r=0;r{for(let r=0;rn.delete(t),l=()=>u().map(({args:e})=>e),u=()=>n.get(t)||[],c=e=>n.set(t,[...u(),e]);return{flush:a,async schedule(e){let t={},n=new Promise((e,r)=>{t.resolve=e,t.reject=r});return(r?.([...l(),e])&&o(),u().length>0)?c({args:e,pendingPromise:t}):(c({args:e,pendingPromise:t}),setTimeout(o,i)),n}}}},55894:function(e,t,r){"use strict";r.d(t,{J:function(){return i}});var n=r(97317);function i(e,{delay:t=100,retryCount:r=2,shouldRetry:i=()=>!0}={}){return new Promise((s,o)=>{let a=async({count:l=0}={})=>{let u=async({error:e})=>{let r="function"==typeof t?t({count:l,error:e}):t;r&&await (0,n.D)(r),a({count:l+1})};try{let t=await e();s(t)}catch(e){if(l{if(66!==t.length)throw new i.W_({size:t.length,targetSize:66,type:"hex"});if(66!==r.length)throw new i.W_({size:r.length,targetSize:66,type:"hex"});return e[t]=r,e},{})}function u(e){if(!e)return;let t={};for(let{address:r,...i}of e){if(!(0,o.U)(r,{strict:!1}))throw new n.b({address:r});if(t[r])throw new s.Nc({address:r});t[r]=function(e){let{balance:t,nonce:r,state:n,stateDiff:i,code:o}=e,u={};if(void 0!==o&&(u.code=o),void 0!==t&&(u.balance=(0,a.eC)(t)),void 0!==r&&(u.nonce=(0,a.eC)(r)),void 0!==n&&(u.state=l(n)),void 0!==i){if(u.state)throw new s.Z8;u.stateDiff=l(i)}return u}(i)}return t}},47499:function(e,t,r){"use strict";r.d(t,{P:function(){return n}});let n=(e,t,r)=>JSON.stringify(e,(e,r)=>{let n="bigint"==typeof r?r.toString():r;return"function"==typeof t?t(e,n):n},r)},82857:function(e,t,r){"use strict";r.d(t,{F:function(){return l}});var n=r(96104),i=r(51359),s=r(37764),o=r(97658),a=r(64113);function l(e){let{account:t,gasPrice:r,maxFeePerGas:l,maxPriorityFeePerGas:u,to:c}=e,d=t?(0,n.T)(t):void 0;if(d&&!(0,a.U)(d.address))throw new i.b({address:d.address});if(c&&!(0,a.U)(c))throw new i.b({address:c});if(void 0!==r&&(void 0!==l||void 0!==u))throw new o.xY;if(l&&l>2n**256n-1n)throw new s.Hh({maxFeePerGas:l});if(u&&l&&u>l)throw new s.cs({maxFeePerGas:l,maxPriorityFeePerGas:u})}},14851:function(e,t,r){"use strict";let n;r.d(t,{h:function(){return s}});let i=256;function s(e=11){if(!n||i+e>512){n="",i=0;for(let e=0;e<256;e++)n+=(256+256*Math.random()|0).toString(16).substring(1)}return n.substring(i,i+++e)}},85053:function(e,t,r){"use strict";r.d(t,{d:function(){return s}});var n=r(90408),i=r(42921);function s(e,t="wei"){return(0,i.b)(e,n.ez[t])}},49268:function(e,t,r){"use strict";r.d(t,{o:function(){return s}});var n=r(90408),i=r(42921);function s(e,t="wei"){return(0,i.b)(e,n.Zn[t])}},42921:function(e,t,r){"use strict";function n(e,t){let r=e.toString(),n=r.startsWith("-");n&&(r=r.slice(1));let[i,s]=[(r=r.padStart(t,"0")).slice(0,r.length-t),r.slice(r.length-t)];return s=s.replace(/(0+)$/,""),`${n?"-":""}${i||"0"}${s?`.${s}`:""}`}r.d(t,{b:function(){return n}})},97317:function(e,t,r){"use strict";async function n(e){return new Promise(t=>setTimeout(t,e))}r.d(t,{D:function(){return n}})},38078:function(e,t,r){"use strict";r.d(t,{FF:function(){return k},S5:function(){return m},Wd:function(){return v},_t:function(){return s},bytesToNumberBE:function(){return f},ci:function(){return l},dQ:function(){return w},eV:function(){return b},gk:function(){return o},hexToBytes:function(){return h},n$:function(){return A},ql:function(){return y},tL:function(){return g},ty:function(){return p}}),BigInt(0);let n=BigInt(1),i=BigInt(2);function s(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e){if(!s(e))throw Error("Uint8Array expected")}let a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){o(e);let t="";for(let r=0;r=c._0&&e<=c._9?e-c._0:e>=c._A&&e<=c._F?e-(c._A-10):e>=c._a&&e<=c._f?e-(c._a-10):void 0}function h(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t(i<new Uint8Array(e),E=e=>Uint8Array.from(e);function A(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=_(e),i=_(e),s=0,o=()=>{n.fill(1),i.fill(0),s=0},a=(...e)=>r(i,n,...e),l=(e=_())=>{i=a(E([0]),e),n=a(),0!==e.length&&(i=a(E([1]),e),n=a())},u=()=>{if(s++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e{let r;for(o(),l(e);!(r=t(u()));)l();return o(),r}}let x={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||s(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function k(e,t,r={}){let n=(t,r,n)=>{let i=x[r];if("function"!=typeof i)throw Error(`Invalid validator "${r}", expected function`);let s=e[t];if((!n||void 0!==s)&&!i(s,e))throw Error(`Invalid param ${String(t)}=${s} (${typeof s}), expected ${r}`)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}},68610:function(e,t,r){"use strict";r.d(t,{secp256k1:function(){return j}});var n=r(80543),i=r(38078);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let s=BigInt(0),o=BigInt(1),a=BigInt(2),l=BigInt(3),u=BigInt(4),c=BigInt(5),d=BigInt(8);function h(e,t){let r=e%t;return r>=s?r:t+r}function f(e,t,r){let n=e;for(;t-- >s;)n*=n,n%=r;return n}function p(e,t){if(e===s||t<=s)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=h(e,t),n=t,i=s,a=o,l=o,u=s;for(;r!==s;){let e=n/r,t=n%r,s=i-l*e,o=a-u*e;n=r,r=t,i=l,a=u,l=s,u=o}if(n!==o)throw Error("invert: does not exist");return h(i,t)}BigInt(9),BigInt(16);let g=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function m(e,t){let r=void 0!==t?t:e.toString(2).length;return{nBitLength:r,nByteLength:Math.ceil(r/8)}}function y(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function b(e){let t=y(e);return t+Math.ceil(t/2)}var v=r(65376),w=r(68104);class _ extends w.kb{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,(0,v.vp)(e);let r=(0,w.O0)(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;enew _(e,t).update(r).digest();E.create=(e,t)=>new _(e,t);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let A=BigInt(0),x=BigInt(1);function k(e){return!function(e){let t=g.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});(0,i.FF)(e,t)}(e.Fp),(0,i.FF)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...m(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}let{bytesToNumberBE:S,hexToBytes:$}=i,C={Err:class extends Error{constructor(e=""){super(e)}},_parseInt(e){let{Err:t}=C;if(e.length<2||2!==e[0])throw new t("Invalid signature integer tag");let r=e[1],n=e.subarray(2,r+2);if(!r||n.length!==r)throw new t("Invalid signature integer: wrong length");if(128&n[0])throw new t("Invalid signature integer: negative");if(0===n[0]&&!(128&n[1]))throw new t("Invalid signature integer: unnecessary leading zero");return{d:S(n),l:e.subarray(r+2)}},toSig(e){let{Err:t}=C,r="string"==typeof e?$(e):e;i.gk(r);let n=r.length;if(n<2||48!=r[0])throw new t("Invalid signature tag");if(r[1]!==n-2)throw new t("Invalid signature: incorrect length");let{d:s,l:o}=C._parseInt(r.subarray(2)),{d:a,l:l}=C._parseInt(o);if(l.length)throw new t("Invalid signature: left bytes after parsing");return{r:s,s:a}},hexFromSig(e){let t=e=>8&Number.parseInt(e[0],16)?"00"+e:e,r=e=>{let t=e.toString(16);return 1&t.length?`0${t}`:t},n=t(r(e.s)),i=t(r(e.r)),s=n.length/2,o=i.length/2,a=r(s),l=r(o);return`30${r(o+s+4)}02${l}${i}02${a}${n}`}},P=BigInt(0),I=BigInt(1),O=(BigInt(2),BigInt(3));BigInt(4);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */let N=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),M=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),R=BigInt(1),T=BigInt(2),D=(e,t)=>(e+t/T)/t,L=function(e,t,r=!1,n={}){if(e<=s)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:f,nByteLength:g}=m(e,t);if(g>2048)throw Error("Field lengths over 2048 bytes are not supported");let y=function(e){if(e%u===l){let t=(e+o)/u;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%d===c){let t=(e-c)/d;return function(e,r){let n=e.mul(r,a),i=e.pow(n,t),s=e.mul(r,i),o=e.mul(e.mul(s,a),i),l=e.mul(s,e.sub(o,e.ONE));if(!e.eql(e.sqr(l),r))throw Error("Cannot find square root");return l}}return function(e){let t,r,n;let i=(e-o)/a;for(t=e-o,r=0;t%a===s;t/=a,r++);for(n=a;n 0");if(r===o)return s;let n=o;for(;t>s;)t&o&&(n=n*e%r),e=e*e%r,t>>=o;return n}(n,i,e)!==e-o;n++);if(1===r){let t=(e+o)/u;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let l=(t+o)/a;return function(e,s){if(e.pow(s,i)===e.neg(e.ONE))throw Error("Cannot find square root");let a=r,u=e.pow(e.mul(e.ONE,n),t),c=e.pow(s,l),d=e.pow(s,t);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);th(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return s<=t&&te===s,isOdd:e=>(e&o)===o,neg:t=>h(-t,e),eql:(e,t)=>e===t,sqr:t=>h(t*t,e),add:(t,r)=>h(t+r,e),sub:(t,r)=>h(t-r,e),mul:(t,r)=>h(t*r,e),pow:(e,t)=>(function(e,t,r){if(r 0");if(r===s)return e.ONE;if(r===o)return t;let n=e.ONE,i=t;for(;r>s;)r&o&&(n=e.mul(n,i)),i=e.sqr(i),r>>=o;return n})(b,e,t),div:(t,r)=>h(t*p(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>p(t,e),sqrt:n.sqrt||(e=>y(b,e)),invertBatch:e=>(function(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r})(b,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,i.S5)(e,g):(0,i.tL)(e,g),fromBytes:e=>{if(e.length!==g)throw Error(`Fp.fromBytes: expected ${g}, got ${e.length}`);return r?(0,i.ty)(e):(0,i.bytesToNumberBE)(e)}});return Object.freeze(b)}(N,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),s=BigInt(23),o=BigInt(44),a=BigInt(88),l=e*e*e%N,u=l*l*e%N,c=f(u,t,N)*u%N,d=f(c,t,N)*u%N,h=f(d,T,N)*l%N,p=f(h,n,N)*h%N,g=f(p,i,N)*p%N,m=f(g,o,N)*g%N,y=f(m,a,N)*m%N,b=f(y,o,N)*g%N,v=f(b,t,N)*u%N,w=f(v,s,N)*p%N,_=f(w,r,N)*l%N,E=f(_,T,N);if(!L.eql(L.sqr(E),e))throw Error("Cannot find square root");return E}}),j=function(e,t){let r=t=>(function(e){let t=function(e){let t=k(e);return i.FF(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}(e),{Fp:r,n:n}=t,s=r.BYTES+1,a=2*r.BYTES+1;function l(e){return h(e,n)}let{ProjectivePoint:u,normPrivateKeyToScalar:c,weierstrassEquation:d,isWithinCurveOrder:f}=function(e){let t=/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function(e){let t=k(e);i.FF(t,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});let{endo:r,Fp:n,a:s}=t;if(r){if(!n.eql(s,n.ZERO))throw Error("Endomorphism can only be defined for Koblitz curves that have a=0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({...t})}(e),{Fp:r}=t,n=t.toBytes||((e,t,n)=>{let s=t.toAffine();return i.eV(Uint8Array.from([4]),r.toBytes(s.x),r.toBytes(s.y))}),s=t.fromBytes||(e=>{let t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function o(e){let{a:n,b:i}=t,s=r.sqr(e),o=r.mul(s,e);return r.add(r.add(o,r.mul(e,n)),i)}if(!r.eql(r.sqr(t.Gy),o(t.Gx)))throw Error("bad generator point: equation left != right");function a(e){return"bigint"==typeof e&&Pr.eql(e,r.ZERO);return i(t)&&i(n)?f.ZERO:new f(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(f.fromAffine)}static fromHex(e){let t=f.fromAffine(s((0,i.ql)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return f.BASE.multiply(u(e))}_setWindowSize(e){this._WINDOW_SIZE=e,c.delete(this)}assertValidity(){if(this.is0()){if(t.allowInfinityPoint&&!r.is0(this.py))return;throw Error("bad point: ZERO")}let{x:e,y:n}=this.toAffine();if(!r.isValid(e)||!r.isValid(n))throw Error("bad point: x or y not FE");let i=r.sqr(n),s=o(e);if(!r.eql(i,s))throw Error("bad point: equation left != right");if(!this.isTorsionFree())throw Error("bad point: not in prime-order subgroup")}hasEvenY(){let{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){d(e);let{px:t,py:n,pz:i}=this,{px:s,py:o,pz:a}=e,l=r.eql(r.mul(t,a),r.mul(s,i)),u=r.eql(r.mul(n,a),r.mul(o,i));return l&&u}negate(){return new f(this.px,r.neg(this.py),this.pz)}double(){let{a:e,b:n}=t,i=r.mul(n,O),{px:s,py:o,pz:a}=this,l=r.ZERO,u=r.ZERO,c=r.ZERO,d=r.mul(s,s),h=r.mul(o,o),p=r.mul(a,a),g=r.mul(s,o);return g=r.add(g,g),c=r.mul(s,a),c=r.add(c,c),l=r.mul(e,c),u=r.mul(i,p),u=r.add(l,u),l=r.sub(h,u),u=r.add(h,u),u=r.mul(l,u),l=r.mul(g,l),c=r.mul(i,c),p=r.mul(e,p),g=r.sub(d,p),g=r.mul(e,g),g=r.add(g,c),c=r.add(d,d),d=r.add(c,d),d=r.add(d,p),d=r.mul(d,g),u=r.add(u,d),p=r.mul(o,a),p=r.add(p,p),d=r.mul(p,g),l=r.sub(l,d),c=r.mul(p,h),c=r.add(c,c),new f(l,u,c=r.add(c,c))}add(e){d(e);let{px:n,py:i,pz:s}=this,{px:o,py:a,pz:l}=e,u=r.ZERO,c=r.ZERO,h=r.ZERO,p=t.a,g=r.mul(t.b,O),m=r.mul(n,o),y=r.mul(i,a),b=r.mul(s,l),v=r.add(n,i),w=r.add(o,a);v=r.mul(v,w),w=r.add(m,y),v=r.sub(v,w),w=r.add(n,s);let _=r.add(o,l);return w=r.mul(w,_),_=r.add(m,b),w=r.sub(w,_),_=r.add(i,s),u=r.add(a,l),_=r.mul(_,u),u=r.add(y,b),_=r.sub(_,u),h=r.mul(p,w),u=r.mul(g,b),h=r.add(u,h),u=r.sub(y,h),h=r.add(y,h),c=r.mul(u,h),y=r.add(m,m),y=r.add(y,m),b=r.mul(p,b),w=r.mul(g,w),y=r.add(y,b),b=r.sub(m,b),b=r.mul(p,b),w=r.add(w,b),m=r.mul(y,w),c=r.add(c,m),m=r.mul(_,w),u=r.mul(v,u),u=r.sub(u,m),m=r.mul(v,y),h=r.mul(_,h),new f(u,c,h=r.add(h,m))}subtract(e){return this.add(e.negate())}is0(){return this.equals(f.ZERO)}wNAF(e){return g.wNAFCached(this,c,e,e=>{let t=r.invertBatch(e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(f.fromAffine)})}multiplyUnsafe(e){let n=f.ZERO;if(e===P)return n;if(l(e),e===I)return this;let{endo:i}=t;if(!i)return g.unsafeLadder(this,e);let{k1neg:s,k1:o,k2neg:a,k2:u}=i.splitScalar(e),c=n,d=n,h=this;for(;o>P||u>P;)o&I&&(c=c.add(h)),u&I&&(d=d.add(h)),h=h.double(),o>>=I,u>>=I;return s&&(c=c.negate()),a&&(d=d.negate()),d=new f(r.mul(d.px,i.beta),d.py,d.pz),c.add(d)}multiply(e){let n,i;l(e);let{endo:s}=t;if(s){let{k1neg:t,k1:o,k2neg:a,k2:l}=s.splitScalar(e),{p:u,f:c}=this.wNAF(o),{p:d,f:h}=this.wNAF(l);u=g.constTimeNegate(t,u),d=g.constTimeNegate(a,d),d=new f(r.mul(d.px,s.beta),d.py,d.pz),n=u.add(d),i=c.add(h)}else{let{p:t,f:r}=this.wNAF(e);n=t,i=r}return f.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=f.BASE,i=(e,t)=>t!==P&&t!==I&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),s=i(this,t).add(i(e,r));return s.is0()?void 0:s}toAffine(e){let{px:t,py:n,pz:i}=this,s=this.is0();null==e&&(e=s?r.ONE:r.inv(i));let o=r.mul(t,e),a=r.mul(n,e),l=r.mul(i,e);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(l,r.ONE))throw Error("invZ was invalid");return{x:o,y:a}}isTorsionFree(){let{h:e,isTorsionFree:r}=t;if(e===I)return!0;if(r)return r(f,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:r}=t;return e===I?this:r?r(f,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return this.assertValidity(),n(f,this,e)}toHex(e=!0){return i.ci(this.toRawBytes(e))}}f.BASE=new f(t.Gx,t.Gy,r.ONE),f.ZERO=new f(r.ZERO,r.ONE,r.ZERO);let p=t.nBitLength,g=function(e,t){let r=(e,t)=>{let r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;for(;r>A;)r&x&&(n=n.add(i)),i=i.double(),r>>=x;return n},precomputeWindow(e,t){let{windows:r,windowSize:i}=n(t),s=[],o=e,a=o;for(let e=0;e>=h,n>a&&(n-=d,s+=x);let o=t+Math.abs(n)-1,f=e%2!=0,p=n<0;0===n?u=u.add(r(f,i[t])):l=l.add(r(p,i[o]))}return{p:l,f:u}},wNAFCached(e,t,r,n){let i=e._WINDOW_SIZE||1,s=t.get(e);return s||(s=this.precomputeWindow(e,i),1!==i&&t.set(e,n(s))),this.wNAF(i,s,r)}}}(f,t.endo?Math.ceil(p/2):p);return{CURVE:t,ProjectivePoint:f,normPrivateKeyToScalar:u,weierstrassEquation:o,isWithinCurveOrder:a}}({...t,toBytes(e,t,n){let s=t.toAffine(),o=r.toBytes(s.x),a=i.eV;return n?a(Uint8Array.from([t.hasEvenY()?2:3]),o):a(Uint8Array.from([4]),o,r.toBytes(s.y))},fromBytes(e){let t=e.length,n=e[0],o=e.subarray(1);if(t===s&&(2===n||3===n)){let e;let t=i.bytesToNumberBE(o);if(!(Pi.ci(i.tL(e,t.nByteLength)),m=(e,t,r)=>i.bytesToNumberBE(e.slice(t,r));class v{constructor(e,t,r){this.r=e,this.s=t,this.recovery=r,this.assertValidity()}static fromCompact(e){let r=t.nByteLength;return new v(m(e=(0,i.ql)("compactSignature",e,2*r),0,r),m(e,r,2*r))}static fromDER(e){let{r:t,s:r}=C.toSig((0,i.ql)("DER",e));return new v(t,r)}assertValidity(){if(!f(this.r))throw Error("r must be 0 < r < CURVE.n");if(!f(this.s))throw Error("s must be 0 < s < CURVE.n")}addRecoveryBit(e){return new v(this.r,this.s,e)}recoverPublicKey(e){let{r:s,s:o,recovery:a}=this,c=E((0,i.ql)("msgHash",e));if(null==a||![0,1,2,3].includes(a))throw Error("recovery id invalid");let d=2===a||3===a?s+t.n:s;if(d>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let h=(1&a)==0?"02":"03",f=u.fromHex(h+g(d)),m=p(d,n),y=l(-c*m),b=l(o*m),v=u.BASE.multiplyAndAddUnsafe(f,y,b);if(!v)throw Error("point at infinify");return v.assertValidity(),v}hasHighS(){return this.s>n>>I}normalizeS(){return this.hasHighS()?new v(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return i.hexToBytes(this.toDERHex())}toDERHex(){return C.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return i.hexToBytes(this.toCompactHex())}toCompactHex(){return g(this.r)+g(this.s)}}function w(e){let t=i._t(e),r="string"==typeof e,n=(t||r)&&e.length;return t?n===s||n===a:r?n===2*s||n===2*a:e instanceof u}let _=t.bits2int||function(e){let r=i.bytesToNumberBE(e),n=8*e.length-t.nBitLength;return n>0?r>>BigInt(n):r},E=t.bits2int_modN||function(e){return l(_(e))},S=i.dQ(t.nBitLength);function $(e){if("bigint"!=typeof e)throw Error("bigint expected");if(!(P<=e&&ee in o))throw Error("sign() legacy options not supported");let{hash:a,randomBytes:d}=t,{lowS:h,prehash:g,extraEntropy:m}=o;null==h&&(h=!0),e=(0,i.ql)("msgHash",e),g&&(e=(0,i.ql)("prehashed msgHash",a(e)));let y=E(e),b=c(s),w=[$(b),$(y)];if(null!=m&&!1!==m){let e=!0===m?d(r.BYTES):m;w.push((0,i.ql)("extraEntropy",e))}return{seed:i.eV(...w),k2sig:function(e){let t=_(e);if(!f(t))return;let r=p(t,n),i=u.BASE.multiply(t).toAffine(),s=l(i.x);if(s===P)return;let o=l(r*l(y+s*b));if(o===P)return;let a=(i.x===s?0:2)|Number(i.y&I),c=o;if(h&&o>n>>I)c=o>n>>I?l(-o):o,a^=1;return new v(s,c,a)}}}(e,s,o);return i.n$(t.hash.outputLen,t.nByteLength,t.hmac)(a,d)},verify:function(e,r,s,o=M){let a,c;if(r=(0,i.ql)("msgHash",r),s=(0,i.ql)("publicKey",s),"strict"in o)throw Error("options.strict was renamed to lowS");let{lowS:d,prehash:h}=o;try{if("string"==typeof e||i._t(e))try{c=v.fromDER(e)}catch(t){if(!(t instanceof C.Err))throw t;c=v.fromCompact(e)}else if("object"==typeof e&&"bigint"==typeof e.r&&"bigint"==typeof e.s){let{r:t,s:r}=e;c=new v(t,r)}else throw Error("PARSE");a=u.fromHex(s)}catch(e){if("PARSE"===e.message)throw Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(d&&c.hasHighS())return!1;h&&(r=t.hash(r));let{r:f,s:g}=c,m=E(r),y=p(g,n),b=l(m*y),w=l(f*y),_=u.BASE.multiplyAndAddUnsafe(a,b,w)?.toAffine();return!!_&&l(_.x)===f},ProjectivePoint:u,Signature:v,utils:{isValidPrivateKey(e){try{return c(e),!0}catch(e){return!1}},normPrivateKeyToScalar:c,randomPrivateKey:()=>{let e=b(t.n);return function(e,t,r=!1){let n=e.length,s=y(t),a=b(t);if(n<16||n1024)throw Error(`expected ${a}-1024 bytes of input, got ${n}`);let l=h(r?(0,i.bytesToNumberBE)(e):(0,i.ty)(e),t-o)+o;return r?(0,i.S5)(l,s):(0,i.tL)(l,s)}(t.randomBytes(e),t.n)},precompute:(e=8,t=u.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}})({...e,hash:t,hmac:(e,...r)=>E(t,e,(0,w.eV)(...r)),randomBytes:w.O6});return Object.freeze({...r(t),create:r})}({a:BigInt(0),b:BigInt(7),Fp:L,n:M,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-R*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),s=D(t*e,M),o=D(-r*e,M),a=h(e-s*t-o*n,M),l=h(-s*r-o*t,M),u=a>i,c=l>i;if(u&&(a=M-a),c&&(l=M-l),a>i||l>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:u,k1:a,k2neg:c,k2:l}}}},n.J);BigInt(0),j.ProjectivePoint}}]); ================================================ FILE: client/out/_next/static/chunks/23-a2a6d2cb6c50ca8e.js ================================================ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[23],{29492:function(e,t){"use strict";function n(){return""}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getDeploymentIdQueryOrEmptyString",{enumerable:!0,get:function(){return n}})},57108:function(){"trimStart"in String.prototype||(String.prototype.trimStart=String.prototype.trimLeft),"trimEnd"in String.prototype||(String.prototype.trimEnd=String.prototype.trimRight),"description"in Symbol.prototype||Object.defineProperty(Symbol.prototype,"description",{configurable:!0,get:function(){var e=/\((.*)\)/.exec(this.toString());return e?e[1]:void 0}}),Array.prototype.flat||(Array.prototype.flat=function(e,t){return t=this.concat.apply([],this),e>1&&t.some(Array.isArray)?t.flat(e-1):t},Array.prototype.flatMap=function(e,t){return this.map(e,t).flat()}),Promise.prototype.finally||(Promise.prototype.finally=function(e){if("function"!=typeof e)return this.then(e,e);var t=this.constructor||Promise;return this.then(function(n){return t.resolve(e()).then(function(){return n})},function(n){return t.resolve(e()).then(function(){throw n})})}),Object.fromEntries||(Object.fromEntries=function(e){return Array.from(e).reduce(function(e,t){return e[t[0]]=t[1],e},{})}),Array.prototype.at||(Array.prototype.at=function(e){var t=Math.trunc(e)||0;if(t<0&&(t+=this.length),!(t<0||t>=this.length))return this[t]}),Object.hasOwn||(Object.hasOwn=function(e,t){if(null==e)throw TypeError("Cannot convert undefined or null to object");return Object.prototype.hasOwnProperty.call(Object(e),t)})},4897:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addBasePath",{enumerable:!0,get:function(){return u}});let r=n(22707),o=n(18157);function u(e,t){return(0,o.normalizePathTrailingSlash)((0,r.addPathPrefix)(e,""))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75684:function(e,t){"use strict";function n(e){var t,n;t=self.__next_s,n=()=>{e()},t&&t.length?t.reduce((e,t)=>{let[n,r]=t;return e.then(()=>new Promise((e,t)=>{let o=document.createElement("script");if(r)for(let e in r)"children"!==e&&o.setAttribute(e,r[e]);n?(o.src=n,o.onload=()=>e(),o.onerror=t):r&&(o.innerHTML=r.children,setTimeout(e)),document.head.appendChild(o)}))},Promise.resolve()).catch(e=>{console.error(e)}).then(()=>{n()}):n()}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"appBootstrap",{enumerable:!0,get:function(){return n}}),window.next={version:"14.2.5",appDir:!0},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},74590:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"callServer",{enumerable:!0,get:function(){return o}});let r=n(95751);async function o(e,t){let n=(0,r.getServerActionDispatcher)();if(!n)throw Error("Invariant: missing action dispatcher.");return new Promise((r,o)=>{n({actionId:e,actionArgs:t,resolve:r,reject:o})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},10353:function(e,t,n){"use strict";let r,o;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hydrate",{enumerable:!0,get:function(){return x}});let u=n(99920),l=n(41452),a=n(57437);n(57108);let i=u._(n(34040)),c=l._(n(2265)),s=n(6671),f=n(36590),d=u._(n(16124)),p=n(74590),h=n(42128),y=n(21427);n(63243);let _=window.console.error;window.console.error=function(){for(var e=arguments.length,t=Array(e),n=0;n{if((0,h.isNextRouterError)(e.error)){e.preventDefault();return}});let v=document,b=new TextEncoder,g=!1,m=!1,R=null;function P(e){if(0===e[0])r=[];else if(1===e[0]){if(!r)throw Error("Unexpected server data: missing bootstrap script.");o?o.enqueue(b.encode(e[1])):r.push(e[1])}else 2===e[0]&&(R=e[1])}let j=function(){o&&!m&&(o.close(),m=!0,r=void 0),g=!0};"loading"===document.readyState?document.addEventListener("DOMContentLoaded",j,!1):j();let O=self.__next_f=self.__next_f||[];O.forEach(P),O.push=P;let S=new ReadableStream({start(e){r&&(r.forEach(t=>{e.enqueue(b.encode(t))}),g&&!m&&(e.close(),m=!0,r=void 0)),o=e}}),E=(0,s.createFromReadableStream)(S,{callServer:p.callServer});function w(){return(0,c.use)(E)}let T=c.default.Fragment;function M(e){let{children:t}=e;return t}function x(){let e=(0,y.createMutableActionQueue)(),t=(0,a.jsx)(T,{children:(0,a.jsx)(f.HeadManagerContext.Provider,{value:{appDir:!0},children:(0,a.jsx)(y.ActionQueueContext.Provider,{value:e,children:(0,a.jsx)(M,{children:(0,a.jsx)(w,{})})})})}),n=window.__next_root_layout_missing_tags,r=!!(null==n?void 0:n.length),o={onRecoverableError:d.default};"__next_error__"===document.documentElement.id||r?i.default.createRoot(v,o).render(t):c.default.startTransition(()=>i.default.hydrateRoot(v,t,{...o,formState:R}))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},11028:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(65820),(0,n(75684).appBootstrap)(()=>{let{hydrate:e}=n(10353);n(95751),n(39275),e()}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},65820:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(29492);{let e=n.u;n.u=function(){for(var t=arguments.length,n=Array(t),r=0;r(l(function(){var e;let t=document.getElementsByName(u)[0];if(null==t?void 0:null==(e=t.shadowRoot)?void 0:e.childNodes[0])return t.shadowRoot.childNodes[0];{let e=document.createElement(u);e.style.cssText="position:absolute";let t=document.createElement("div");return t.ariaLive="assertive",t.id="__next-route-announcer__",t.role="alert",t.style.cssText="position:absolute;border:0;height:1px;margin:-1px;padding:0;width:1px;clip:rect(0 0 0 0);overflow:hidden;white-space:nowrap;word-wrap:normal",e.attachShadow({mode:"open"}).appendChild(t),document.body.appendChild(e),t}}()),()=>{let e=document.getElementsByTagName(u)[0];(null==e?void 0:e.isConnected)&&document.body.removeChild(e)}),[]);let[a,i]=(0,r.useState)(""),c=(0,r.useRef)();return(0,r.useEffect)(()=>{let e="";if(document.title)e=document.title;else{let t=document.querySelector("h1");t&&(e=t.innerText||t.textContent||"")}void 0!==c.current&&c.current!==e&&i(e),c.current=e},[t]),n?(0,o.createPortal)(a,n):null}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77325:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION:function(){return r},FLIGHT_PARAMETERS:function(){return i},NEXT_DID_POSTPONE_HEADER:function(){return s},NEXT_ROUTER_PREFETCH_HEADER:function(){return u},NEXT_ROUTER_STATE_TREE:function(){return o},NEXT_RSC_UNION_QUERY:function(){return c},NEXT_URL:function(){return l},RSC_CONTENT_TYPE_HEADER:function(){return a},RSC_HEADER:function(){return n}});let n="RSC",r="Next-Action",o="Next-Router-State-Tree",u="Next-Router-Prefetch",l="Next-Url",a="text/x-component",i=[[n],[o],[u]],c="_rsc",s="x-nextjs-postponed";("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},95751:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createEmptyCacheNode:function(){return C},default:function(){return I},getServerActionDispatcher:function(){return E},urlToUrlWithoutFlightMarker:function(){return T}});let r=n(41452),o=n(57437),u=r._(n(2265)),l=n(44467),a=n(51507),i=n(53174),c=n(68056),s=n(42114),f=n(76130),d=n(50322),p=n(74092),h=n(4897),y=n(41012),_=n(36585),v=n(30315),b=n(91108),g=n(77325),m=n(97599),R=n(49404),P=n(8e4),j="undefined"==typeof window,O=j?null:new Map,S=null;function E(){return S}let w={};function T(e){let t=new URL(e,location.origin);if(t.searchParams.delete(g.NEXT_RSC_UNION_QUERY),t.pathname.endsWith(".txt")){let{pathname:e}=t,n=e.endsWith("/index.txt")?10:4;t.pathname=e.slice(0,-n)}return t}function M(e){return e.origin!==window.location.origin}function x(e){let{appRouterState:t,sync:n}=e;return(0,u.useInsertionEffect)(()=>{let{tree:e,pushRef:r,canonicalUrl:o}=t,u={...r.preserveCustomHistoryState?window.history.state:{},__NA:!0,__PRIVATE_NEXTJS_INTERNALS_TREE:e};r.pendingPush&&(0,i.createHrefFromUrl)(new URL(window.location.href))!==o?(r.pendingPush=!1,window.history.pushState(u,"",o)):window.history.replaceState(u,"",o),n(t)},[t,n]),null}function C(){return{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null}}function A(e){null==e&&(e={});let t=window.history.state,n=null==t?void 0:t.__NA;n&&(e.__NA=n);let r=null==t?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;return r&&(e.__PRIVATE_NEXTJS_INTERNALS_TREE=r),e}function N(e){let{headCacheNode:t}=e,n=null!==t?t.head:null,r=null!==t?t.prefetchHead:null,o=null!==r?r:n;return(0,u.useDeferredValue)(n,o)}function D(e){let t,{buildId:n,initialHead:r,initialTree:i,initialCanonicalUrl:f,initialSeedData:g,couldBeIntercepted:E,assetPrefix:T,missingSlots:C}=e,D=(0,u.useMemo)(()=>(0,d.createInitialRouterState)({buildId:n,initialSeedData:g,initialCanonicalUrl:f,initialTree:i,initialParallelRoutes:O,location:j?null:window.location,initialHead:r,couldBeIntercepted:E}),[n,g,f,i,r,E]),[I,U,k]=(0,s.useReducerWithReduxDevtools)(D);(0,u.useEffect)(()=>{O=null},[]);let{canonicalUrl:F}=(0,s.useUnwrapState)(I),{searchParams:L,pathname:H}=(0,u.useMemo)(()=>{let e=new URL(F,"undefined"==typeof window?"http://n":window.location.href);return{searchParams:e.searchParams,pathname:(0,R.hasBasePath)(e.pathname)?(0,m.removeBasePath)(e.pathname):e.pathname}},[F]),$=(0,u.useCallback)(e=>{let{previousTree:t,serverResponse:n}=e;(0,u.startTransition)(()=>{U({type:a.ACTION_SERVER_PATCH,previousTree:t,serverResponse:n})})},[U]),G=(0,u.useCallback)((e,t,n)=>{let r=new URL((0,h.addBasePath)(e),location.href);return U({type:a.ACTION_NAVIGATE,url:r,isExternalUrl:M(r),locationSearch:location.search,shouldScroll:null==n||n,navigateType:t})},[U]);S=(0,u.useCallback)(e=>{(0,u.startTransition)(()=>{U({...e,type:a.ACTION_SERVER_ACTION})})},[U]);let z=(0,u.useMemo)(()=>({back:()=>window.history.back(),forward:()=>window.history.forward(),prefetch:(e,t)=>{let n;if(!(0,p.isBot)(window.navigator.userAgent)){try{n=new URL((0,h.addBasePath)(e),window.location.href)}catch(t){throw Error("Cannot prefetch '"+e+"' because it cannot be converted to a URL.")}M(n)||(0,u.startTransition)(()=>{var e;U({type:a.ACTION_PREFETCH,url:n,kind:null!=(e=null==t?void 0:t.kind)?e:a.PrefetchKind.FULL})})}},replace:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"replace",null==(n=t.scroll)||n)})},push:(e,t)=>{void 0===t&&(t={}),(0,u.startTransition)(()=>{var n;G(e,"push",null==(n=t.scroll)||n)})},refresh:()=>{(0,u.startTransition)(()=>{U({type:a.ACTION_REFRESH,origin:window.location.origin})})},fastRefresh:()=>{throw Error("fastRefresh can only be used in development mode. Please use refresh instead.")}}),[U,G]);(0,u.useEffect)(()=>{window.next&&(window.next.router=z)},[z]),(0,u.useEffect)(()=>{function e(e){var t;e.persisted&&(null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE)&&(w.pendingMpaPath=void 0,U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:window.history.state.__PRIVATE_NEXTJS_INTERNALS_TREE}))}return window.addEventListener("pageshow",e),()=>{window.removeEventListener("pageshow",e)}},[U]);let{pushRef:B}=(0,s.useUnwrapState)(I);if(B.mpaNavigation){if(w.pendingMpaPath!==F){let e=window.location;B.pendingPush?e.assign(F):e.replace(F),w.pendingMpaPath=F}(0,u.use)(b.unresolvedThenable)}(0,u.useEffect)(()=>{let e=window.history.pushState.bind(window.history),t=window.history.replaceState.bind(window.history),n=e=>{var t;let n=window.location.href,r=null==(t=window.history.state)?void 0:t.__PRIVATE_NEXTJS_INTERNALS_TREE;(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(null!=e?e:n,n),tree:r})})};window.history.pushState=function(t,r,o){return(null==t?void 0:t.__NA)||(null==t?void 0:t._N)||(t=A(t),o&&n(o)),e(t,r,o)},window.history.replaceState=function(e,r,o){return(null==e?void 0:e.__NA)||(null==e?void 0:e._N)||(e=A(e),o&&n(o)),t(e,r,o)};let r=e=>{let{state:t}=e;if(t){if(!t.__NA){window.location.reload();return}(0,u.startTransition)(()=>{U({type:a.ACTION_RESTORE,url:new URL(window.location.href),tree:t.__PRIVATE_NEXTJS_INTERNALS_TREE})})}};return window.addEventListener("popstate",r),()=>{window.history.pushState=e,window.history.replaceState=t,window.removeEventListener("popstate",r)}},[U]);let{cache:W,tree:K,nextUrl:V,focusAndScrollRef:Y}=(0,s.useUnwrapState)(I),X=(0,u.useMemo)(()=>(0,v.findHeadInCache)(W,K[1]),[W,K]),q=(0,u.useMemo)(()=>(function e(t,n){for(let r of(void 0===n&&(n={}),Object.values(t[1]))){let t=r[0],o=Array.isArray(t),u=o?t[1]:t;!u||u.startsWith(P.PAGE_SEGMENT_KEY)||(o&&("c"===t[2]||"oc"===t[2])?n[t[0]]=t[1].split("/"):o&&(n[t[0]]=t[1]),n=e(r,n))}return n})(K),[K]);if(null!==X){let[e,n]=X;t=(0,o.jsx)(N,{headCacheNode:e},n)}else t=null;let J=(0,o.jsxs)(_.RedirectBoundary,{children:[t,W.rsc,(0,o.jsx)(y.AppRouterAnnouncer,{tree:K})]});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(x,{appRouterState:(0,s.useUnwrapState)(I),sync:k}),(0,o.jsx)(c.PathParamsContext.Provider,{value:q,children:(0,o.jsx)(c.PathnameContext.Provider,{value:H,children:(0,o.jsx)(c.SearchParamsContext.Provider,{value:L,children:(0,o.jsx)(l.GlobalLayoutRouterContext.Provider,{value:{buildId:n,changeByServerResponse:$,tree:K,focusAndScrollRef:Y,nextUrl:V},children:(0,o.jsx)(l.AppRouterContext.Provider,{value:z,children:(0,o.jsx)(l.LayoutRouterContext.Provider,{value:{childNodes:W.parallelRoutes,tree:K,url:F,loading:W.loading},children:J})})})})})})]})}function I(e){let{globalErrorComponent:t,...n}=e;return(0,o.jsx)(f.ErrorBoundary,{errorComponent:t,children:(0,o.jsx)(D,{...n})})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},24804:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"bailoutToClientRendering",{enumerable:!0,get:function(){return u}});let r=n(55592),o=n(44936);function u(e){let t=o.staticGenerationAsyncStorage.getStore();if((null==t||!t.forceStatic)&&(null==t?void 0:t.isStaticGeneration))throw new r.BailoutToCSRError(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66513:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ClientPageRoot",{enumerable:!0,get:function(){return u}});let r=n(57437),o=n(8897);function u(e){let{Component:t,props:n}=e;return n.searchParams=(0,o.createDynamicallyTrackedSearchParams)(n.searchParams||{}),(0,r.jsx)(t,{...n})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},76130:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ErrorBoundary:function(){return h},ErrorBoundaryHandler:function(){return f},GlobalError:function(){return d},default:function(){return p}});let r=n(99920),o=n(57437),u=r._(n(2265)),l=n(71169),a=n(42128),i=n(44936),c={error:{fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},text:{fontSize:"14px",fontWeight:400,lineHeight:"28px",margin:"0 8px"}};function s(e){let{error:t}=e,n=i.staticGenerationAsyncStorage.getStore();if((null==n?void 0:n.isRevalidate)||(null==n?void 0:n.isStaticGeneration))throw console.error(t),t;return null}class f extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isNextRouterError)(e))throw e;return{error:e}}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.error?{error:null,previousPathname:e.pathname}:{error:t.error,previousPathname:e.pathname}}render(){return this.state.error?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(s,{error:this.state.error}),this.props.errorStyles,this.props.errorScripts,(0,o.jsx)(this.props.errorComponent,{error:this.state.error,reset:this.reset})]}):this.props.children}constructor(e){super(e),this.reset=()=>{this.setState({error:null})},this.state={error:null,previousPathname:this.props.pathname}}}function d(e){let{error:t}=e,n=null==t?void 0:t.digest;return(0,o.jsxs)("html",{id:"__next_error__",children:[(0,o.jsx)("head",{}),(0,o.jsxs)("body",{children:[(0,o.jsx)(s,{error:t}),(0,o.jsx)("div",{style:c.error,children:(0,o.jsxs)("div",{children:[(0,o.jsx)("h2",{style:c.text,children:"Application error: a "+(n?"server":"client")+"-side exception has occurred (see the "+(n?"server logs":"browser console")+" for more information)."}),n?(0,o.jsx)("p",{style:c.text,children:"Digest: "+n}):null]})})]})]})}let p=d;function h(e){let{errorComponent:t,errorStyles:n,errorScripts:r,children:u}=e,a=(0,l.usePathname)();return t?(0,o.jsx)(f,{pathname:a,errorComponent:t,errorStyles:n,errorScripts:r,children:u}):(0,o.jsx)(o.Fragment,{children:u})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},57910:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DynamicServerError:function(){return r},isDynamicServerError:function(){return o}});let n="DYNAMIC_SERVER_USAGE";class r extends Error{constructor(e){super("Dynamic server usage: "+e),this.description=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&"string"==typeof e.digest&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},42128:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNextRouterError",{enumerable:!0,get:function(){return u}});let r=n(52496),o=n(67909);function u(e){return e&&e.digest&&((0,o.isRedirectError)(e)||(0,r.isNotFoundError)(e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},39275:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return S}});let r=n(99920),o=n(41452),u=n(57437),l=o._(n(2265)),a=r._(n(54887)),i=n(44467),c=n(41283),s=n(91108),f=n(76130),d=n(16237),p=n(86180),h=n(36585),y=n(16585),_=n(44640),v=n(81784),b=n(35914),g=["bottom","height","left","right","top","width","x","y"];function m(e,t){let n=e.getBoundingClientRect();return n.top>=0&&n.top<=t}class R extends l.default.Component{componentDidMount(){this.handlePotentialScroll()}componentDidUpdate(){this.props.focusAndScrollRef.apply&&this.handlePotentialScroll()}render(){return this.props.children}constructor(...e){super(...e),this.handlePotentialScroll=()=>{let{focusAndScrollRef:e,segmentPath:t}=this.props;if(e.apply){var n;if(0!==e.segmentPaths.length&&!e.segmentPaths.some(e=>t.every((t,n)=>(0,d.matchSegment)(t,e[n]))))return;let r=null,o=e.hashFragment;if(o&&(r="top"===o?document.body:null!=(n=document.getElementById(o))?n:document.getElementsByName(o)[0]),r||(r="undefined"==typeof window?null:a.default.findDOMNode(this)),!(r instanceof Element))return;for(;!(r instanceof HTMLElement)||function(e){if(["sticky","fixed"].includes(getComputedStyle(e).position))return!0;let t=e.getBoundingClientRect();return g.every(e=>0===t[e])}(r);){if(null===r.nextElementSibling)return;r=r.nextElementSibling}e.apply=!1,e.hashFragment=null,e.segmentPaths=[],(0,p.handleSmoothScroll)(()=>{if(o){r.scrollIntoView();return}let e=document.documentElement,t=e.clientHeight;!m(r,t)&&(e.scrollTop=0,m(r,t)||r.scrollIntoView())},{dontForceLayout:!0,onlyHashChange:e.onlyHashChange}),e.onlyHashChange=!1,r.focus()}}}}function P(e){let{segmentPath:t,children:n}=e,r=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!r)throw Error("invariant global layout router not mounted");return(0,u.jsx)(R,{segmentPath:t,focusAndScrollRef:r.focusAndScrollRef,children:n})}function j(e){let{parallelRouterKey:t,url:n,childNodes:r,segmentPath:o,tree:a,cacheKey:f}=e,p=(0,l.useContext)(i.GlobalLayoutRouterContext);if(!p)throw Error("invariant global layout router not mounted");let{buildId:h,changeByServerResponse:y,tree:_}=p,v=r.get(f);if(void 0===v){let e={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};v=e,r.set(f,e)}let g=null!==v.prefetchRsc?v.prefetchRsc:v.rsc,m=(0,l.useDeferredValue)(v.rsc,g),R="object"==typeof m&&null!==m&&"function"==typeof m.then?(0,l.use)(m):m;if(!R){let e=v.lazyData;if(null===e){let t=function e(t,n){if(t){let[r,o]=t,u=2===t.length;if((0,d.matchSegment)(n[0],r)&&n[1].hasOwnProperty(o)){if(u){let t=e(void 0,n[1][o]);return[n[0],{...n[1],[o]:[t[0],t[1],t[2],"refetch"]}]}return[n[0],{...n[1],[o]:e(t.slice(2),n[1][o])}]}}return n}(["",...o],_),r=(0,b.hasInterceptionRouteInCurrentTree)(_);v.lazyData=e=(0,c.fetchServerResponse)(new URL(n,location.origin),t,r?p.nextUrl:null,h),v.lazyDataResolved=!1}let t=(0,l.use)(e);v.lazyDataResolved||(setTimeout(()=>{(0,l.startTransition)(()=>{y({previousTree:_,serverResponse:t})})}),v.lazyDataResolved=!0),(0,l.use)(s.unresolvedThenable)}return(0,u.jsx)(i.LayoutRouterContext.Provider,{value:{tree:a[1][t],childNodes:v.parallelRoutes,url:n,loading:v.loading},children:R})}function O(e){let{children:t,hasLoading:n,loading:r,loadingStyles:o,loadingScripts:a}=e;return n?(0,u.jsx)(l.Suspense,{fallback:(0,u.jsxs)(u.Fragment,{children:[o,a,r]}),children:t}):(0,u.jsx)(u.Fragment,{children:t})}function S(e){let{parallelRouterKey:t,segmentPath:n,error:r,errorStyles:o,errorScripts:a,templateStyles:c,templateScripts:s,template:d,notFound:p,notFoundStyles:b,styles:g}=e,m=(0,l.useContext)(i.LayoutRouterContext);if(!m)throw Error("invariant expected layout router to be mounted");let{childNodes:R,tree:S,url:E,loading:w}=m,T=R.get(t);T||(T=new Map,R.set(t,T));let M=S[1][t][0],x=(0,_.getSegmentValue)(M),C=[M];return(0,u.jsxs)(u.Fragment,{children:[g,C.map(e=>{let l=(0,_.getSegmentValue)(e),g=(0,v.createRouterCacheKey)(e);return(0,u.jsxs)(i.TemplateContext.Provider,{value:(0,u.jsx)(P,{segmentPath:n,children:(0,u.jsx)(f.ErrorBoundary,{errorComponent:r,errorStyles:o,errorScripts:a,children:(0,u.jsx)(O,{hasLoading:!!w,loading:null==w?void 0:w[0],loadingStyles:null==w?void 0:w[1],loadingScripts:null==w?void 0:w[2],children:(0,u.jsx)(y.NotFoundBoundary,{notFound:p,notFoundStyles:b,children:(0,u.jsx)(h.RedirectBoundary,{children:(0,u.jsx)(j,{parallelRouterKey:t,url:E,tree:S,childNodes:T,segmentPath:n,cacheKey:g,isActive:x===l})})})})})}),children:[c,s,d]},(0,v.createRouterCacheKey)(e,!0))})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16237:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{canSegmentBeOverridden:function(){return u},matchSegment:function(){return o}});let r=n(24286),o=(e,t)=>"string"==typeof e?"string"==typeof t&&e===t:"string"!=typeof t&&e[0]===t[0]&&e[1]===t[1],u=(e,t)=>{var n;return!Array.isArray(e)&&!!Array.isArray(t)&&(null==(n=(0,r.getSegmentParam)(e))?void 0:n.param)===t[0]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},71169:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return i.ReadonlyURLSearchParams},RedirectType:function(){return i.RedirectType},ServerInsertedHTMLContext:function(){return c.ServerInsertedHTMLContext},notFound:function(){return i.notFound},permanentRedirect:function(){return i.permanentRedirect},redirect:function(){return i.redirect},useParams:function(){return p},usePathname:function(){return f},useRouter:function(){return d},useSearchParams:function(){return s},useSelectedLayoutSegment:function(){return y},useSelectedLayoutSegments:function(){return h},useServerInsertedHTML:function(){return c.useServerInsertedHTML}});let r=n(2265),o=n(44467),u=n(68056),l=n(44640),a=n(8e4),i=n(52152),c=n(8005);function s(){let e=(0,r.useContext)(u.SearchParamsContext),t=(0,r.useMemo)(()=>e?new i.ReadonlyURLSearchParams(e):null,[e]);if("undefined"==typeof window){let{bailoutToClientRendering:e}=n(24804);e("useSearchParams()")}return t}function f(){return(0,r.useContext)(u.PathnameContext)}function d(){let e=(0,r.useContext)(o.AppRouterContext);if(null===e)throw Error("invariant expected app router to be mounted");return e}function p(){return(0,r.useContext)(u.PathParamsContext)}function h(e){void 0===e&&(e="children");let t=(0,r.useContext)(o.LayoutRouterContext);return t?function e(t,n,r,o){let u;if(void 0===r&&(r=!0),void 0===o&&(o=[]),r)u=t[1][n];else{var i;let e=t[1];u=null!=(i=e.children)?i:Object.values(e)[0]}if(!u)return o;let c=u[0],s=(0,l.getSegmentValue)(c);return!s||s.startsWith(a.PAGE_SEGMENT_KEY)?o:(o.push(s),e(u,n,!1,o))}(t.tree,e):null}function y(e){void 0===e&&(e="children");let t=h(e);if(!t||0===t.length)return null;let n="children"===e?t[0]:t[t.length-1];return n===a.DEFAULT_SEGMENT_KEY?null:n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52152:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ReadonlyURLSearchParams:function(){return l},RedirectType:function(){return r.RedirectType},notFound:function(){return o.notFound},permanentRedirect:function(){return r.permanentRedirect},redirect:function(){return r.redirect}});let r=n(67909),o=n(52496);class u extends Error{constructor(){super("Method unavailable on `ReadonlyURLSearchParams`. Read more: https://nextjs.org/docs/app/api-reference/functions/use-search-params#updating-searchparams")}}class l extends URLSearchParams{append(){throw new u}delete(){throw new u}set(){throw new u}sort(){throw new u}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16585:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"NotFoundBoundary",{enumerable:!0,get:function(){return s}});let r=n(41452),o=n(57437),u=r._(n(2265)),l=n(71169),a=n(52496);n(72301);let i=n(44467);class c extends u.default.Component{componentDidCatch(){}static getDerivedStateFromError(e){if((0,a.isNotFoundError)(e))return{notFoundTriggered:!0};throw e}static getDerivedStateFromProps(e,t){return e.pathname!==t.previousPathname&&t.notFoundTriggered?{notFoundTriggered:!1,previousPathname:e.pathname}:{notFoundTriggered:t.notFoundTriggered,previousPathname:e.pathname}}render(){return this.state.notFoundTriggered?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)("meta",{name:"robots",content:"noindex"}),!1,this.props.notFoundStyles,this.props.notFound]}):this.props.children}constructor(e){super(e),this.state={notFoundTriggered:!!e.asNotFound,previousPathname:e.pathname}}}function s(e){let{notFound:t,notFoundStyles:n,asNotFound:r,children:a}=e,s=(0,l.usePathname)(),f=(0,u.useContext)(i.MissingSlotContext);return t?(0,o.jsx)(c,{pathname:s,notFound:t,notFoundStyles:n,asNotFound:r,missingSlots:f,children:a}):(0,o.jsx)(o.Fragment,{children:a})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},52496:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{isNotFoundError:function(){return o},notFound:function(){return r}});let n="NEXT_NOT_FOUND";function r(){let e=Error(n);throw e.digest=n,e}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},43858:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"PromiseQueue",{enumerable:!0,get:function(){return c}});let r=n(93449),o=n(57614);var u=o._("_maxConcurrency"),l=o._("_runningCount"),a=o._("_queue"),i=o._("_processNext");class c{enqueue(e){let t,n;let o=new Promise((e,r)=>{t=e,n=r}),u=async()=>{try{r._(this,l)[l]++;let n=await e();t(n)}catch(e){n(e)}finally{r._(this,l)[l]--,r._(this,i)[i]()}};return r._(this,a)[a].push({promiseFn:o,task:u}),r._(this,i)[i](),o}bump(e){let t=r._(this,a)[a].findIndex(t=>t.promiseFn===e);if(t>-1){let e=r._(this,a)[a].splice(t,1)[0];r._(this,a)[a].unshift(e),r._(this,i)[i](!0)}}constructor(e=5){Object.defineProperty(this,i,{value:s}),Object.defineProperty(this,u,{writable:!0,value:void 0}),Object.defineProperty(this,l,{writable:!0,value:void 0}),Object.defineProperty(this,a,{writable:!0,value:void 0}),r._(this,u)[u]=e,r._(this,l)[l]=0,r._(this,a)[a]=[]}}function s(e){if(void 0===e&&(e=!1),(r._(this,l)[l]0){var t;null==(t=r._(this,a)[a].shift())||t.task()}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36585:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectBoundary:function(){return s},RedirectErrorBoundary:function(){return c}});let r=n(41452),o=n(57437),u=r._(n(2265)),l=n(71169),a=n(67909);function i(e){let{redirect:t,reset:n,redirectType:r}=e,o=(0,l.useRouter)();return(0,u.useEffect)(()=>{u.default.startTransition(()=>{r===a.RedirectType.push?o.push(t,{}):o.replace(t,{}),n()})},[t,r,n,o]),null}class c extends u.default.Component{static getDerivedStateFromError(e){if((0,a.isRedirectError)(e))return{redirect:(0,a.getURLFromRedirectError)(e),redirectType:(0,a.getRedirectTypeFromError)(e)};throw e}render(){let{redirect:e,redirectType:t}=this.state;return null!==e&&null!==t?(0,o.jsx)(i,{redirect:e,redirectType:t,reset:()=>this.setState({redirect:null})}):this.props.children}constructor(e){super(e),this.state={redirect:null,redirectType:null}}}function s(e){let{children:t}=e,n=(0,l.useRouter)();return(0,o.jsx)(c,{router:n,children:t})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},84785:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"RedirectStatusCode",{enumerable:!0,get:function(){return n}}),(r=n||(n={}))[r.SeeOther=303]="SeeOther",r[r.TemporaryRedirect=307]="TemporaryRedirect",r[r.PermanentRedirect=308]="PermanentRedirect",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},67909:function(e,t,n){"use strict";var r,o;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{RedirectType:function(){return r},getRedirectError:function(){return c},getRedirectStatusCodeFromError:function(){return y},getRedirectTypeFromError:function(){return h},getURLFromRedirectError:function(){return p},isRedirectError:function(){return d},permanentRedirect:function(){return f},redirect:function(){return s}});let u=n(58512),l=n(99440),a=n(84785),i="NEXT_REDIRECT";function c(e,t,n){void 0===n&&(n=a.RedirectStatusCode.TemporaryRedirect);let r=Error(i);r.digest=i+";"+t+";"+e+";"+n+";";let o=u.requestAsyncStorage.getStore();return o&&(r.mutableCookies=o.mutableCookies),r}function s(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.TemporaryRedirect)}function f(e,t){void 0===t&&(t="replace");let n=l.actionAsyncStorage.getStore();throw c(e,t,(null==n?void 0:n.isAction)?a.RedirectStatusCode.SeeOther:a.RedirectStatusCode.PermanentRedirect)}function d(e){if("object"!=typeof e||null===e||!("digest"in e)||"string"!=typeof e.digest)return!1;let[t,n,r,o]=e.digest.split(";",4),u=Number(o);return t===i&&("replace"===n||"push"===n)&&"string"==typeof r&&!isNaN(u)&&u in a.RedirectStatusCode}function p(e){return d(e)?e.digest.split(";",3)[2]:null}function h(e){if(!d(e))throw Error("Not a redirect error");return e.digest.split(";",2)[1]}function y(e){if(!d(e))throw Error("Not a redirect error");return Number(e.digest.split(";",4)[3])}(o=r||(r={})).push="push",o.replace="replace",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},61343:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return a}});let r=n(41452),o=n(57437),u=r._(n(2265)),l=n(44467);function a(){let e=(0,u.useContext)(l.TemplateContext);return(0,o.jsx)(o.Fragment,{children:e})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},58512:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getExpectedRequestStore:function(){return o},requestAsyncStorage:function(){return r.requestAsyncStorage}});let r=n(70038);function o(e){let t=r.requestAsyncStorage.getStore();if(t)return t;throw Error("`"+e+"` was called outside a request scope. Read more: https://nextjs.org/docs/messages/next-dynamic-api-wrong-context")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},39607:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyFlightData",{enumerable:!0,get:function(){return u}});let r=n(13821),o=n(41133);function u(e,t,n,u){let[l,a,i]=n.slice(-3);if(null===a)return!1;if(3===n.length){let n=a[2],o=a[3];t.loading=o,t.rsc=n,t.prefetchRsc=null,(0,r.fillLazyItemsTillLeafWithHead)(t,e,l,a,i,u)}else t.rsc=e.rsc,t.prefetchRsc=e.prefetchRsc,t.parallelRoutes=new Map(e.parallelRoutes),t.loading=e.loading,(0,o.fillCacheWithNewSubTreeData)(t,e,n,u);return!0}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},69684:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"applyRouterStatePatchToTree",{enumerable:!0,get:function(){return function e(t,n,r,a){let i;let[c,s,f,d,p]=n;if(1===t.length){let e=l(n,r,t);return(0,u.addRefreshMarkerToActiveParallelSegments)(e,a),e}let[h,y]=t;if(!(0,o.matchSegment)(h,c))return null;if(2===t.length)i=l(s[y],r,t);else if(null===(i=e(t.slice(2),s[y],r,a)))return null;let _=[t[0],{...s,[y]:i},f,d];return p&&(_[4]=!0),(0,u.addRefreshMarkerToActiveParallelSegments)(_,a),_}}});let r=n(8e4),o=n(16237),u=n(74922);function l(e,t,n){let[u,a]=e,[i,c]=t;if(i===r.DEFAULT_SEGMENT_KEY&&u!==r.DEFAULT_SEGMENT_KEY)return e;if((0,o.matchSegment)(u,i)){let t={};for(let e in a)void 0!==c[e]?t[e]=l(a[e],c[e],n):t[e]=a[e];for(let e in c)t[e]||(t[e]=c[e]);let r=[u,t];return e[2]&&(r[2]=e[2]),e[3]&&(r[3]=e[3]),e[4]&&(r[4]=e[4]),r}return t}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},99559:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"clearCacheNodeDataForSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l),s=t.parallelRoutes.get(l);s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s));let f=null==c?void 0:c.get(i),d=s.get(i);if(u){d&&d.lazyData&&d!==f||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}if(!d||!f){d||s.set(i,{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null});return}return d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved,loading:d.loading},s.set(i,d)),e(d,f,o.slice(2))}}});let r=n(81784);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},96626:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{computeChangedPath:function(){return s},extractPathFromFlightRouterState:function(){return c}});let r=n(82269),o=n(8e4),u=n(16237),l=e=>"/"===e[0]?e.slice(1):e,a=e=>"string"==typeof e?"children"===e?"":e:e[1];function i(e){return e.reduce((e,t)=>""===(t=l(t))||(0,o.isGroupSegment)(t)?e:e+"/"+t,"")||"/"}function c(e){var t;let n=Array.isArray(e[0])?e[0][1]:e[0];if(n===o.DEFAULT_SEGMENT_KEY||r.INTERCEPTION_ROUTE_MARKERS.some(e=>n.startsWith(e)))return;if(n.startsWith(o.PAGE_SEGMENT_KEY))return"";let u=[a(n)],l=null!=(t=e[1])?t:{},s=l.children?c(l.children):void 0;if(void 0!==s)u.push(s);else for(let[e,t]of Object.entries(l)){if("children"===e)continue;let n=c(t);void 0!==n&&u.push(n)}return i(u)}function s(e,t){let n=function e(t,n){let[o,l]=t,[i,s]=n,f=a(o),d=a(i);if(r.INTERCEPTION_ROUTE_MARKERS.some(e=>f.startsWith(e)||d.startsWith(e)))return"";if(!(0,u.matchSegment)(o,i)){var p;return null!=(p=c(n))?p:""}for(let t in l)if(s[t]){let n=e(l[t],s[t]);if(null!==n)return a(i)+"/"+n}return null}(e,t);return null==n||"/"===n?n:i(n.split("/"))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},53174:function(e,t){"use strict";function n(e,t){return void 0===t&&(t=!0),e.pathname+e.search+(t?e.hash:"")}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createHrefFromUrl",{enumerable:!0,get:function(){return n}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},50322:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createInitialRouterState",{enumerable:!0,get:function(){return c}});let r=n(53174),o=n(13821),u=n(96626),l=n(86004),a=n(51507),i=n(74922);function c(e){var t;let{buildId:n,initialTree:c,initialSeedData:s,initialCanonicalUrl:f,initialParallelRoutes:d,location:p,initialHead:h,couldBeIntercepted:y}=e,_=!p,v={lazyData:null,rsc:s[2],prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:_?new Map:d,lazyDataResolved:!1,loading:s[3]},b=p?(0,r.createHrefFromUrl)(p):f;(0,i.addRefreshMarkerToActiveParallelSegments)(c,b);let g=new Map;(null===d||0===d.size)&&(0,o.fillLazyItemsTillLeafWithHead)(v,void 0,c,s,h);let m={buildId:n,tree:c,cache:v,prefetchCache:g,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:{apply:!1,onlyHashChange:!1,hashFragment:null,segmentPaths:[]},canonicalUrl:b,nextUrl:null!=(t=(0,u.extractPathFromFlightRouterState)(c)||(null==p?void 0:p.pathname))?t:null};if(p){let e=new URL(""+p.pathname+p.search,p.origin),t=[["",c,null,null]];(0,l.createPrefetchCacheEntryForInitialLoad)({url:e,kind:a.PrefetchKind.AUTO,data:[t,void 0,!1,y],tree:m.tree,prefetchCache:m.prefetchCache,nextUrl:m.nextUrl})}return m}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},81784:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createRouterCacheKey",{enumerable:!0,get:function(){return o}});let r=n(8e4);function o(e,t){return(void 0===t&&(t=!1),Array.isArray(e))?e[0]+"|"+e[1]+"|"+e[2]:t&&e.startsWith(r.PAGE_SEGMENT_KEY)?r.PAGE_SEGMENT_KEY:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41283:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fetchServerResponse",{enumerable:!0,get:function(){return s}});let r=n(77325),o=n(95751),u=n(74590),l=n(51507),a=n(54736),{createFromFetch:i}=n(6671);function c(e){return[(0,o.urlToUrlWithoutFlightMarker)(e).toString(),void 0,!1,!1]}async function s(e,t,n,s,f){let d={[r.RSC_HEADER]:"1",[r.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(t))};f===l.PrefetchKind.AUTO&&(d[r.NEXT_ROUTER_PREFETCH_HEADER]="1"),n&&(d[r.NEXT_URL]=n);let p=(0,a.hexHash)([d[r.NEXT_ROUTER_PREFETCH_HEADER]||"0",d[r.NEXT_ROUTER_STATE_TREE],d[r.NEXT_URL]].join(","));try{var h;let t=new URL(e);t.pathname.endsWith("/")?t.pathname+="index.txt":t.pathname+=".txt",t.searchParams.set(r.NEXT_RSC_UNION_QUERY,p);let n=await fetch(t,{credentials:"same-origin",headers:d}),l=(0,o.urlToUrlWithoutFlightMarker)(n.url),a=n.redirected?l:void 0,f=n.headers.get("content-type")||"",y=!!n.headers.get(r.NEXT_DID_POSTPONE_HEADER),_=!!(null==(h=n.headers.get("vary"))?void 0:h.includes(r.NEXT_URL)),v=f===r.RSC_CONTENT_TYPE_HEADER;if(v||(v=f.startsWith("text/plain")),!v||!n.ok)return e.hash&&(l.hash=e.hash),c(l.toString());let[b,g]=await i(Promise.resolve(n),{callServer:u.callServer});if(s!==b)return c(n.url);return[g,a,y,_]}catch(t){return console.error("Failed to fetch RSC payload for "+e+". Falling back to browser navigation.",t),[e.toString(),void 0,!1,!1]}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},41133:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillCacheWithNewSubTreeData",{enumerable:!0,get:function(){return function e(t,n,l,a){let i=l.length<=5,[c,s]=l,f=(0,u.createRouterCacheKey)(s),d=n.parallelRoutes.get(c);if(!d)return;let p=t.parallelRoutes.get(c);p&&p!==d||(p=new Map(d),t.parallelRoutes.set(c,p));let h=d.get(f),y=p.get(f);if(i){if(!y||!y.lazyData||y===h){let e=l[3];y={lazyData:null,rsc:e[2],prefetchRsc:null,head:null,prefetchHead:null,loading:e[3],parallelRoutes:h?new Map(h.parallelRoutes):new Map,lazyDataResolved:!1},h&&(0,r.invalidateCacheByRouterState)(y,h,l[2]),(0,o.fillLazyItemsTillLeafWithHead)(y,h,l[2],e,l[4],a),p.set(f,y)}return}y&&h&&(y===h&&(y={lazyData:y.lazyData,rsc:y.rsc,prefetchRsc:y.prefetchRsc,head:y.head,prefetchHead:y.prefetchHead,parallelRoutes:new Map(y.parallelRoutes),lazyDataResolved:!1,loading:y.loading},p.set(f,y)),e(y,h,l.slice(2),a))}}});let r=n(74213),o=n(13821),u=n(81784);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},13821:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"fillLazyItemsTillLeafWithHead",{enumerable:!0,get:function(){return function e(t,n,u,l,a,i){if(0===Object.keys(u[1]).length){t.head=a;return}for(let c in u[1]){let s;let f=u[1][c],d=f[0],p=(0,r.createRouterCacheKey)(d),h=null!==l&&void 0!==l[1][c]?l[1][c]:null;if(n){let r=n.parallelRoutes.get(c);if(r){let n;let u=(null==i?void 0:i.kind)==="auto"&&i.status===o.PrefetchCacheEntryStatus.reusable,l=new Map(r),s=l.get(p);n=null!==h?{lazyData:null,rsc:h[2],prefetchRsc:null,head:null,prefetchHead:null,loading:h[3],parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1}:u&&s?{lazyData:s.lazyData,rsc:s.rsc,prefetchRsc:s.prefetchRsc,head:s.head,prefetchHead:s.prefetchHead,parallelRoutes:new Map(s.parallelRoutes),lazyDataResolved:s.lazyDataResolved,loading:s.loading}:{lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map(null==s?void 0:s.parallelRoutes),lazyDataResolved:!1,loading:null},l.set(p,n),e(n,s,f,h||null,a,i),t.parallelRoutes.set(c,l);continue}}if(null!==h){let e=h[2],t=h[3];s={lazyData:null,rsc:e,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:t}}else s={lazyData:null,rsc:null,prefetchRsc:null,head:null,prefetchHead:null,parallelRoutes:new Map,lazyDataResolved:!1,loading:null};let y=t.parallelRoutes.get(c);y?y.set(p,s):t.parallelRoutes.set(c,new Map([[p,s]])),e(s,void 0,f,h,a,i)}}}});let r=n(81784),o=n(51507);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},36416:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleMutable",{enumerable:!0,get:function(){return u}});let r=n(96626);function o(e){return void 0!==e}function u(e,t){var n,u,l;let a=null==(u=t.shouldScroll)||u,i=e.nextUrl;if(o(t.patchedTree)){let n=(0,r.computeChangedPath)(e.tree,t.patchedTree);n?i=n:i||(i=e.canonicalUrl)}return{buildId:e.buildId,canonicalUrl:o(t.canonicalUrl)?t.canonicalUrl===e.canonicalUrl?e.canonicalUrl:t.canonicalUrl:e.canonicalUrl,pushRef:{pendingPush:o(t.pendingPush)?t.pendingPush:e.pushRef.pendingPush,mpaNavigation:o(t.mpaNavigation)?t.mpaNavigation:e.pushRef.mpaNavigation,preserveCustomHistoryState:o(t.preserveCustomHistoryState)?t.preserveCustomHistoryState:e.pushRef.preserveCustomHistoryState},focusAndScrollRef:{apply:!!a&&(!!o(null==t?void 0:t.scrollableSegments)||e.focusAndScrollRef.apply),onlyHashChange:!!t.hashFragment&&e.canonicalUrl.split("#",1)[0]===(null==(n=t.canonicalUrl)?void 0:n.split("#",1)[0]),hashFragment:a?t.hashFragment&&""!==t.hashFragment?decodeURIComponent(t.hashFragment.slice(1)):e.focusAndScrollRef.hashFragment:null,segmentPaths:a?null!=(l=null==t?void 0:t.scrollableSegments)?l:e.focusAndScrollRef.segmentPaths:[]},cache:t.cache?t.cache:e.cache,prefetchCache:t.prefetchCache?t.prefetchCache:e.prefetchCache,tree:o(t.patchedTree)?t.patchedTree:e.tree,nextUrl:i}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},40774:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSegmentMismatch",{enumerable:!0,get:function(){return o}});let r=n(51294);function o(e,t,n){return(0,r.handleExternalUrl)(e,{},e.canonicalUrl,!0)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},9863:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheBelowFlightSegmentPath",{enumerable:!0,get:function(){return function e(t,n,o){let u=o.length<=2,[l,a]=o,i=(0,r.createRouterCacheKey)(a),c=n.parallelRoutes.get(l);if(!c)return;let s=t.parallelRoutes.get(l);if(s&&s!==c||(s=new Map(c),t.parallelRoutes.set(l,s)),u){s.delete(i);return}let f=c.get(i),d=s.get(i);d&&f&&(d===f&&(d={lazyData:d.lazyData,rsc:d.rsc,prefetchRsc:d.prefetchRsc,head:d.head,prefetchHead:d.prefetchHead,parallelRoutes:new Map(d.parallelRoutes),lazyDataResolved:d.lazyDataResolved},s.set(i,d)),e(d,f,o.slice(2)))}}});let r=n(81784);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},74213:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"invalidateCacheByRouterState",{enumerable:!0,get:function(){return o}});let r=n(81784);function o(e,t,n){for(let o in n[1]){let u=n[1][o][0],l=(0,r.createRouterCacheKey)(u),a=t.parallelRoutes.get(o);if(a){let t=new Map(a);t.delete(l),e.parallelRoutes.set(o,t)}}}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},10139:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isNavigatingToNewRootLayout",{enumerable:!0,get:function(){return function e(t,n){let r=t[0],o=n[0];if(Array.isArray(r)&&Array.isArray(o)){if(r[0]!==o[0]||r[2]!==o[2])return!0}else if(r!==o)return!0;if(t[4])return!n[4];if(n[4])return!0;let u=Object.values(t[1])[0],l=Object.values(n[1])[0];return!u||!l||e(u,l)}}}),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},93060:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{abortTask:function(){return c},listenForDynamicRequest:function(){return a},updateCacheNodeOnNavigation:function(){return function e(t,n,a,c,s){let f=n[1],d=a[1],p=c[1],h=t.parallelRoutes,y=new Map(h),_={},v=null;for(let t in d){let n;let a=d[t],c=f[t],b=h.get(t),g=p[t],m=a[0],R=(0,u.createRouterCacheKey)(m),P=void 0!==c?c[0]:void 0,j=void 0!==b?b.get(R):void 0;if(null!==(n=m===r.PAGE_SEGMENT_KEY?l(a,void 0!==g?g:null,s):m===r.DEFAULT_SEGMENT_KEY?void 0!==c?{route:c,node:null,children:null}:l(a,void 0!==g?g:null,s):void 0!==P&&(0,o.matchSegment)(m,P)&&void 0!==j&&void 0!==c?null!=g?e(j,c,a,g,s):function(e){let t=i(e,null,null);return{route:e,node:t,children:null}}(a):l(a,void 0!==g?g:null,s))){null===v&&(v=new Map),v.set(t,n);let e=n.node;if(null!==e){let n=new Map(b);n.set(R,e),y.set(t,n)}_[t]=n.route}else _[t]=a}if(null===v)return null;let b={lazyData:null,rsc:t.rsc,prefetchRsc:t.prefetchRsc,head:t.head,prefetchHead:t.prefetchHead,loading:t.loading,parallelRoutes:y,lazyDataResolved:!1};return{route:function(e,t){let n=[e[0],t];return 2 in e&&(n[2]=e[2]),3 in e&&(n[3]=e[3]),4 in e&&(n[4]=e[4]),n}(a,_),node:b,children:v}}},updateCacheNodeOnPopstateRestoration:function(){return function e(t,n){let r=n[1],o=t.parallelRoutes,l=new Map(o);for(let t in r){let n=r[t],a=n[0],i=(0,u.createRouterCacheKey)(a),c=o.get(t);if(void 0!==c){let r=c.get(i);if(void 0!==r){let o=e(r,n),u=new Map(c);u.set(i,o),l.set(t,u)}}}let a=t.rsc,i=d(a)&&"pending"===a.status;return{lazyData:null,rsc:a,head:t.head,prefetchHead:i?t.prefetchHead:null,prefetchRsc:i?t.prefetchRsc:null,loading:i?t.loading:null,parallelRoutes:l,lazyDataResolved:!1}}}});let r=n(8e4),o=n(16237),u=n(81784);function l(e,t,n){let r=i(e,t,n);return{route:e,node:r,children:null}}function a(e,t){t.then(t=>{for(let n of t[0]){let t=n.slice(0,-3),r=n[n.length-3],l=n[n.length-2],a=n[n.length-1];"string"!=typeof t&&function(e,t,n,r,l){let a=e;for(let e=0;e{c(e,t)})}function i(e,t,n){let r=e[1],o=null!==t?t[1]:null,l=new Map;for(let e in r){let t=r[e],a=null!==o?o[e]:null,c=t[0],s=(0,u.createRouterCacheKey)(c),f=i(t,void 0===a?null:a,n),d=new Map;d.set(s,f),l.set(e,d)}let a=0===l.size,c=null!==t?t[2]:null,s=null!==t?t[3]:null;return{lazyData:null,parallelRoutes:l,prefetchRsc:void 0!==c?c:null,prefetchHead:a?n:null,loading:void 0!==s?s:null,rsc:p(),head:a?p():null,lazyDataResolved:!1}}function c(e,t){let n=e.node;if(null===n)return;let r=e.children;if(null===r)s(e.route,n,t);else for(let e of r.values())c(e,t);e.node=null}function s(e,t,n){let r=e[1],o=t.parallelRoutes;for(let e in r){let t=r[e],l=o.get(e);if(void 0===l)continue;let a=t[0],i=(0,u.createRouterCacheKey)(a),c=l.get(i);void 0!==c&&s(t,c,n)}let l=t.rsc;d(l)&&(null===n?l.resolve(null):l.reject(n));let a=t.head;d(a)&&a.resolve(null)}let f=Symbol();function d(e){return e&&e.tag===f}function p(){let e,t;let n=new Promise((n,r)=>{e=n,t=r});return n.status="pending",n.resolve=t=>{"pending"===n.status&&(n.status="fulfilled",n.value=t,e(t))},n.reject=e=>{"pending"===n.status&&(n.status="rejected",n.reason=e,t(e))},n.tag=f,n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},86004:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createPrefetchCacheEntryForInitialLoad:function(){return c},getOrCreatePrefetchCacheEntry:function(){return i},prunePrefetchCache:function(){return f}});let r=n(53174),o=n(41283),u=n(51507),l=n(59218);function a(e,t){let n=(0,r.createHrefFromUrl)(e,!1);return t?t+"%"+n:n}function i(e){let t,{url:n,nextUrl:r,tree:o,buildId:l,prefetchCache:i,kind:c}=e,f=a(n,r),d=i.get(f);if(d)t=d;else{let e=a(n),r=i.get(e);r&&(t=r)}return t?(t.status=h(t),t.kind!==u.PrefetchKind.FULL&&c===u.PrefetchKind.FULL)?s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:null!=c?c:u.PrefetchKind.TEMPORARY}):(c&&t.kind===u.PrefetchKind.TEMPORARY&&(t.kind=c),t):s({tree:o,url:n,buildId:l,nextUrl:r,prefetchCache:i,kind:c||u.PrefetchKind.TEMPORARY})}function c(e){let{nextUrl:t,tree:n,prefetchCache:r,url:o,kind:l,data:i}=e,[,,,c]=i,s=c?a(o,t):a(o),f={treeAtTimeOfPrefetch:n,data:Promise.resolve(i),kind:l,prefetchTime:Date.now(),lastUsedTime:Date.now(),key:s,status:u.PrefetchCacheEntryStatus.fresh};return r.set(s,f),f}function s(e){let{url:t,kind:n,tree:r,nextUrl:i,buildId:c,prefetchCache:s}=e,f=a(t),d=l.prefetchQueue.enqueue(()=>(0,o.fetchServerResponse)(t,r,i,c,n).then(e=>{let[,,,n]=e;return n&&function(e){let{url:t,nextUrl:n,prefetchCache:r}=e,o=a(t),u=r.get(o);if(!u)return;let l=a(t,n);r.set(l,u),r.delete(o)}({url:t,nextUrl:i,prefetchCache:s}),e})),p={treeAtTimeOfPrefetch:r,data:d,kind:n,prefetchTime:Date.now(),lastUsedTime:null,key:f,status:u.PrefetchCacheEntryStatus.fresh};return s.set(f,p),p}function f(e){for(let[t,n]of e)h(n)===u.PrefetchCacheEntryStatus.expired&&e.delete(t)}let d=1e3*Number("30"),p=1e3*Number("300");function h(e){let{kind:t,prefetchTime:n,lastUsedTime:r}=e;return Date.now()<(null!=r?r:n)+d?r?u.PrefetchCacheEntryStatus.reusable:u.PrefetchCacheEntryStatus.fresh:"auto"===t&&Date.now(){let[n,f]=t,h=!1;if(S.lastUsedTime||(S.lastUsedTime=Date.now(),h=!0),"string"==typeof n)return _(e,R,n,O);if(document.getElementById("__next-page-redirect"))return _(e,R,j,O);let b=e.tree,g=e.cache,w=[];for(let t of n){let n=t.slice(0,-4),r=t.slice(-3)[0],c=["",...n],f=(0,u.applyRouterStatePatchToTree)(c,b,r,j);if(null===f&&(f=(0,u.applyRouterStatePatchToTree)(c,E,r,j)),null!==f){if((0,a.isNavigatingToNewRootLayout)(b,f))return _(e,R,j,O);let u=(0,d.createEmptyCacheNode)(),m=!1;for(let e of(S.status!==i.PrefetchCacheEntryStatus.stale||h?m=(0,s.applyFlightData)(g,u,t,S):(m=function(e,t,n,r){let o=!1;for(let u of(e.rsc=t.rsc,e.prefetchRsc=t.prefetchRsc,e.loading=t.loading,e.parallelRoutes=new Map(t.parallelRoutes),v(r).map(e=>[...n,...e])))(0,y.clearCacheNodeDataForSegmentPath)(e,t,u),o=!0;return o}(u,g,n,r),S.lastUsedTime=Date.now()),(0,l.shouldHardNavigate)(c,b)?(u.rsc=g.rsc,u.prefetchRsc=g.prefetchRsc,(0,o.invalidateCacheBelowFlightSegmentPath)(u,g,n),R.cache=u):m&&(R.cache=u,g=u),b=f,v(r))){let t=[...n,...e];t[t.length-1]!==p.DEFAULT_SEGMENT_KEY&&w.push(t)}}}return R.patchedTree=b,R.canonicalUrl=f?(0,r.createHrefFromUrl)(f):j,R.pendingPush=O,R.scrollableSegments=w,R.hashFragment=P,R.shouldScroll=m,(0,c.handleMutable)(e,R)},()=>e)};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},59218:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{prefetchQueue:function(){return l},prefetchReducer:function(){return a}});let r=n(77325),o=n(43858),u=n(86004),l=new o.PromiseQueue(5);function a(e,t){(0,u.prunePrefetchCache)(e.prefetchCache);let{url:n}=t;return n.searchParams.delete(r.NEXT_RSC_UNION_QUERY),(0,u.getOrCreatePrefetchCacheEntry)({url:n,nextUrl:e.nextUrl,prefetchCache:e.prefetchCache,kind:t.kind,tree:e.tree,buildId:e.buildId}),e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},75239:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"refreshReducer",{enumerable:!0,get:function(){return h}});let r=n(41283),o=n(53174),u=n(69684),l=n(10139),a=n(51294),i=n(36416),c=n(13821),s=n(95751),f=n(40774),d=n(35914),p=n(74922);function h(e,t){let{origin:n}=t,h={},y=e.canonicalUrl,_=e.tree;h.preserveCustomHistoryState=!1;let v=(0,s.createEmptyCacheNode)(),b=(0,d.hasInterceptionRouteInCurrentTree)(e.tree);return v.lazyData=(0,r.fetchServerResponse)(new URL(y,n),[_[0],_[1],_[2],"refetch"],b?e.nextUrl:null,e.buildId),v.lazyData.then(async n=>{let[r,s]=n;if("string"==typeof r)return(0,a.handleExternalUrl)(e,h,r,e.pushRef.pendingPush);for(let n of(v.lazyData=null,r)){if(3!==n.length)return console.log("REFRESH FAILED"),e;let[r]=n,i=(0,u.applyRouterStatePatchToTree)([""],_,r,e.canonicalUrl);if(null===i)return(0,f.handleSegmentMismatch)(e,t,r);if((0,l.isNavigatingToNewRootLayout)(_,i))return(0,a.handleExternalUrl)(e,h,y,e.pushRef.pendingPush);let d=s?(0,o.createHrefFromUrl)(s):void 0;s&&(h.canonicalUrl=d);let[g,m]=n.slice(-2);if(null!==g){let e=g[2];v.rsc=e,v.prefetchRsc=null,(0,c.fillLazyItemsTillLeafWithHead)(v,void 0,r,g,m),h.prefetchCache=new Map}await (0,p.refreshInactiveParallelSegments)({state:e,updatedTree:i,updatedCache:v,includeNextUrl:b,canonicalUrl:h.canonicalUrl||e.canonicalUrl}),h.cache=v,h.patchedTree=i,h.canonicalUrl=y,_=i}return(0,i.handleMutable)(e,h)},()=>e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},6131:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"restoreReducer",{enumerable:!0,get:function(){return u}});let r=n(53174),o=n(96626);function u(e,t){var n;let{url:u,tree:l}=t,a=(0,r.createHrefFromUrl)(u),i=l||e.tree,c=e.cache;return{buildId:e.buildId,canonicalUrl:a,pushRef:{pendingPush:!1,mpaNavigation:!1,preserveCustomHistoryState:!0},focusAndScrollRef:e.focusAndScrollRef,cache:c,prefetchCache:e.prefetchCache,tree:i,nextUrl:null!=(n=(0,o.extractPathFromFlightRouterState)(i))?n:u.pathname}}n(93060),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},64549:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverActionReducer",{enumerable:!0,get:function(){return g}});let r=n(74590),o=n(77325),u=n(4897),l=n(53174),a=n(51294),i=n(69684),c=n(10139),s=n(36416),f=n(13821),d=n(95751),p=n(35914),h=n(40774),y=n(74922),{createFromFetch:_,encodeReply:v}=n(6671);async function b(e,t,n){let l,{actionId:a,actionArgs:i}=n,c=await v(i),s=await fetch("",{method:"POST",headers:{Accept:o.RSC_CONTENT_TYPE_HEADER,[o.ACTION]:a,[o.NEXT_ROUTER_STATE_TREE]:encodeURIComponent(JSON.stringify(e.tree)),...t?{[o.NEXT_URL]:t}:{}},body:c}),f=s.headers.get("x-action-redirect");try{let e=JSON.parse(s.headers.get("x-action-revalidated")||"[[],0,0]");l={paths:e[0]||[],tag:!!e[1],cookie:e[2]}}catch(e){l={paths:[],tag:!1,cookie:!1}}let d=f?new URL((0,u.addBasePath)(f),new URL(e.canonicalUrl,window.location.href)):void 0;if(s.headers.get("content-type")===o.RSC_CONTENT_TYPE_HEADER){let e=await _(Promise.resolve(s),{callServer:r.callServer});if(f){let[,t]=null!=e?e:[];return{actionFlightData:t,redirectLocation:d,revalidatedParts:l}}let[t,[,n]]=null!=e?e:[];return{actionResult:t,actionFlightData:n,redirectLocation:d,revalidatedParts:l}}return{redirectLocation:d,revalidatedParts:l}}function g(e,t){let{resolve:n,reject:r}=t,o={},u=e.canonicalUrl,_=e.tree;o.preserveCustomHistoryState=!1;let v=e.nextUrl&&(0,p.hasInterceptionRouteInCurrentTree)(e.tree)?e.nextUrl:null;return o.inFlightServerAction=b(e,v,t),o.inFlightServerAction.then(async r=>{let{actionResult:p,actionFlightData:b,redirectLocation:g}=r;if(g&&(e.pushRef.pendingPush=!0,o.pendingPush=!0),!b)return(n(p),g)?(0,a.handleExternalUrl)(e,o,g.href,e.pushRef.pendingPush):e;if("string"==typeof b)return(0,a.handleExternalUrl)(e,o,b,e.pushRef.pendingPush);if(o.inFlightServerAction=null,g){let e=(0,l.createHrefFromUrl)(g,!1);o.canonicalUrl=e}for(let n of b){if(3!==n.length)return console.log("SERVER ACTION APPLY FAILED"),e;let[r]=n,s=(0,i.applyRouterStatePatchToTree)([""],_,r,g?(0,l.createHrefFromUrl)(g):e.canonicalUrl);if(null===s)return(0,h.handleSegmentMismatch)(e,t,r);if((0,c.isNavigatingToNewRootLayout)(_,s))return(0,a.handleExternalUrl)(e,o,u,e.pushRef.pendingPush);let[p,b]=n.slice(-2),m=null!==p?p[2]:null;if(null!==m){let t=(0,d.createEmptyCacheNode)();t.rsc=m,t.prefetchRsc=null,(0,f.fillLazyItemsTillLeafWithHead)(t,void 0,r,p,b),await (0,y.refreshInactiveParallelSegments)({state:e,updatedTree:s,updatedCache:t,includeNextUrl:!!v,canonicalUrl:o.canonicalUrl||e.canonicalUrl}),o.cache=t,o.prefetchCache=new Map}o.patchedTree=s,_=s}return n(p),(0,s.handleMutable)(e,o)},t=>(r(t),e))}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},98289:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"serverPatchReducer",{enumerable:!0,get:function(){return f}});let r=n(53174),o=n(69684),u=n(10139),l=n(51294),a=n(39607),i=n(36416),c=n(95751),s=n(40774);function f(e,t){let{serverResponse:n}=t,[f,d]=n,p={};if(p.preserveCustomHistoryState=!1,"string"==typeof f)return(0,l.handleExternalUrl)(e,p,f,e.pushRef.pendingPush);let h=e.tree,y=e.cache;for(let n of f){let i=n.slice(0,-4),[f]=n.slice(-3,-2),_=(0,o.applyRouterStatePatchToTree)(["",...i],h,f,e.canonicalUrl);if(null===_)return(0,s.handleSegmentMismatch)(e,t,f);if((0,u.isNavigatingToNewRootLayout)(h,_))return(0,l.handleExternalUrl)(e,p,e.canonicalUrl,e.pushRef.pendingPush);let v=d?(0,r.createHrefFromUrl)(d):void 0;v&&(p.canonicalUrl=v);let b=(0,c.createEmptyCacheNode)();(0,a.applyFlightData)(y,b,n),p.patchedTree=_,p.cache=b,y=b,h=_}return(0,i.handleMutable)(e,p)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},74922:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{addRefreshMarkerToActiveParallelSegments:function(){return function e(t,n){let[r,o,,l]=t;for(let a in r.includes(u.PAGE_SEGMENT_KEY)&&"refresh"!==l&&(t[2]=n,t[3]="refresh"),o)e(o[a],n)}},refreshInactiveParallelSegments:function(){return l}});let r=n(39607),o=n(41283),u=n(8e4);async function l(e){let t=new Set;await a({...e,rootTree:e.updatedTree,fetchedSegments:t})}async function a(e){let{state:t,updatedTree:n,updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c=n,canonicalUrl:s}=e,[,f,d,p]=n,h=[];if(d&&d!==s&&"refresh"===p&&!i.has(d)){i.add(d);let e=(0,o.fetchServerResponse)(new URL(d,location.origin),[c[0],c[1],c[2],"refetch"],l?t.nextUrl:null,t.buildId).then(e=>{let t=e[0];if("string"!=typeof t)for(let e of t)(0,r.applyFlightData)(u,u,e)});h.push(e)}for(let e in f){let n=a({state:t,updatedTree:f[e],updatedCache:u,includeNextUrl:l,fetchedSegments:i,rootTree:c,canonicalUrl:s});h.push(n)}await Promise.all(h)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},51507:function(e,t){"use strict";var n,r,o,u;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ACTION_FAST_REFRESH:function(){return f},ACTION_NAVIGATE:function(){return a},ACTION_PREFETCH:function(){return s},ACTION_REFRESH:function(){return l},ACTION_RESTORE:function(){return i},ACTION_SERVER_ACTION:function(){return d},ACTION_SERVER_PATCH:function(){return c},PrefetchCacheEntryStatus:function(){return r},PrefetchKind:function(){return n},isThenable:function(){return p}});let l="refresh",a="navigate",i="restore",c="server-patch",s="prefetch",f="fast-refresh",d="server-action";function p(e){return e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}(o=n||(n={})).AUTO="auto",o.FULL="full",o.TEMPORARY="temporary",(u=r||(r={})).fresh="fresh",u.reusable="reusable",u.expired="expired",u.stale="stale",("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},80643:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"reducer",{enumerable:!0,get:function(){return f}});let r=n(51507),o=n(51294),u=n(98289),l=n(6131),a=n(75239),i=n(59218),c=n(51129),s=n(64549),f="undefined"==typeof window?function(e,t){return e}:function(e,t){switch(t.type){case r.ACTION_NAVIGATE:return(0,o.navigateReducer)(e,t);case r.ACTION_SERVER_PATCH:return(0,u.serverPatchReducer)(e,t);case r.ACTION_RESTORE:return(0,l.restoreReducer)(e,t);case r.ACTION_REFRESH:return(0,a.refreshReducer)(e,t);case r.ACTION_FAST_REFRESH:return(0,c.fastRefreshReducer)(e,t);case r.ACTION_PREFETCH:return(0,i.prefetchReducer)(e,t);case r.ACTION_SERVER_ACTION:return(0,s.serverActionReducer)(e,t);default:throw Error("Unknown action")}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},54740:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"shouldHardNavigate",{enumerable:!0,get:function(){return function e(t,n){let[o,u]=n,[l,a]=t;return(0,r.matchSegment)(l,o)?!(t.length<=2)&&e(t.slice(2),u[a]):!!Array.isArray(l)}}});let r=n(16237);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8897:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{createDynamicallyTrackedSearchParams:function(){return a},createUntrackedSearchParams:function(){return l}});let r=n(44936),o=n(62441),u=n(67991);function l(e){let t=r.staticGenerationAsyncStorage.getStore();return t&&t.forceStatic?{}:e}function a(e){let t=r.staticGenerationAsyncStorage.getStore();return t?t.forceStatic?{}:t.isStaticGeneration||t.dynamicShouldError?new Proxy({},{get:(e,n,r)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),u.ReflectAdapter.get(e,n,r)),has:(e,n)=>("string"==typeof n&&(0,o.trackDynamicDataAccessed)(t,"searchParams."+n),Reflect.has(e,n)),ownKeys:e=>((0,o.trackDynamicDataAccessed)(t,"searchParams"),Reflect.ownKeys(e))}):e:e}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},44936:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r.staticGenerationAsyncStorage}});let r=n(77685);("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},85108:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{StaticGenBailoutError:function(){return r},isStaticGenBailoutError:function(){return o}});let n="NEXT_STATIC_GEN_BAILOUT";class r extends Error{constructor(...e){super(...e),this.code=n}}function o(e){return"object"==typeof e&&null!==e&&"code"in e&&e.code===n}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},91108:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"unresolvedThenable",{enumerable:!0,get:function(){return n}});let n={then:()=>{}};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},42114:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{useReducerWithReduxDevtools:function(){return i},useUnwrapState:function(){return a}});let r=n(41452)._(n(2265)),o=n(51507),u=n(21427);function l(e){if(e instanceof Map){let t={};for(let[n,r]of e.entries()){if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r._bundlerConfig){t[n]="FlightData";continue}}t[n]=l(r)}return t}if("object"==typeof e&&null!==e){let t={};for(let n in e){let r=e[n];if("function"==typeof r){t[n]="fn()";continue}if("object"==typeof r&&null!==r){if(r.$$typeof){t[n]=r.$$typeof.toString();continue}if(r.hasOwnProperty("_bundlerConfig")){t[n]="FlightData";continue}}t[n]=l(r)}return t}return Array.isArray(e)?e.map(l):e}function a(e){return(0,o.isThenable)(e)?(0,r.use)(e):e}let i="undefined"!=typeof window?function(e){let[t,n]=r.default.useState(e),o=(0,r.useContext)(u.ActionQueueContext);if(!o)throw Error("Invariant: Missing ActionQueueContext");let a=(0,r.useRef)(),i=(0,r.useRef)();return(0,r.useEffect)(()=>{if(!a.current&&!1!==i.current){if(void 0===i.current&&void 0===window.__REDUX_DEVTOOLS_EXTENSION__){i.current=!1;return}return a.current=window.__REDUX_DEVTOOLS_EXTENSION__.connect({instanceId:8e3,name:"next-router"}),a.current&&(a.current.init(l(e)),o&&(o.devToolsInstance=a.current)),()=>{a.current=void 0}}},[e,o]),[t,(0,r.useCallback)(t=>{o.state||(o.state=e),o.dispatch(t,n)},[o,e]),(0,r.useCallback)(e=>{a.current&&a.current.send({type:"RENDER_SYNC"},l(e))},[])]}:function(e){return[e,()=>{},()=>{}]};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},49404:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"hasBasePath",{enumerable:!0,get:function(){return o}});let r=n(55121);function o(e){return(0,r.pathHasPrefix)(e,"")}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},18157:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"normalizePathTrailingSlash",{enumerable:!0,get:function(){return u}});let r=n(67741),o=n(31465),u=e=>{if(!e.startsWith("/"))return e;let{pathname:t,query:n,hash:u}=(0,o.parsePath)(e);return""+(0,r.removeTrailingSlash)(t)+n+u};("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},16124:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return o}});let r=n(55592);function o(e){let t="function"==typeof reportError?reportError:e=>{window.console.error(e)};(0,r.isBailoutToCSRError)(e)||t(e)}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},97599:function(e,t,n){"use strict";function r(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeBasePath",{enumerable:!0,get:function(){return r}}),n(49404),("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},99176:function(e,t){"use strict";function n(e,t){var n=e.length;for(e.push(t);0>>1,o=e[r];if(0>>1;ru(i,n))cu(s,i)?(e[r]=s,e[c]=n,r=c):(e[r]=i,e[a]=n,r=a);else if(cu(s,n))e[r]=s,e[c]=n,r=c;else break}}return t}function u(e,t){var n=e.sortIndex-t.sortIndex;return 0!==n?n:e.id-t.id}if(t.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now){var l,a=performance;t.unstable_now=function(){return a.now()}}else{var i=Date,c=i.now();t.unstable_now=function(){return i.now()-c}}var s=[],f=[],d=1,p=null,h=3,y=!1,_=!1,v=!1,b="function"==typeof setTimeout?setTimeout:null,g="function"==typeof clearTimeout?clearTimeout:null,m="undefined"!=typeof setImmediate?setImmediate:null;function R(e){for(var t=r(f);null!==t;){if(null===t.callback)o(f);else if(t.startTime<=e)o(f),t.sortIndex=t.expirationTime,n(s,t);else break;t=r(f)}}function P(e){if(v=!1,R(e),!_){if(null!==r(s))_=!0,C();else{var t=r(f);null!==t&&A(P,t.startTime-e)}}}"undefined"!=typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var j=!1,O=-1,S=5,E=-1;function w(){return!(t.unstable_now()-Ee&&w());){var a=p.callback;if("function"==typeof a){p.callback=null,h=p.priorityLevel;var i=a(p.expirationTime<=e);if(e=t.unstable_now(),"function"==typeof i){p.callback=i,R(e),n=!0;break t}p===r(s)&&o(s),R(e)}else o(s);p=r(s)}if(null!==p)n=!0;else{var c=r(f);null!==c&&A(P,c.startTime-e),n=!1}}break e}finally{p=null,h=u,y=!1}n=void 0}}finally{n?l():j=!1}}}if("function"==typeof m)l=function(){m(T)};else if("undefined"!=typeof MessageChannel){var M=new MessageChannel,x=M.port2;M.port1.onmessage=T,l=function(){x.postMessage(null)}}else l=function(){b(T,0)};function C(){j||(j=!0,l())}function A(e,n){O=b(function(){e(t.unstable_now())},n)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){_||y||(_=!0,C())},t.unstable_forceFrameRate=function(e){0>e||125l?(e.sortIndex=u,n(f,e),null===r(s)&&e===r(f)&&(v?(g(O),O=-1):v=!0,A(P,u-l))):(e.sortIndex=a,n(s,e),_||y||(_=!0,C())),e},t.unstable_shouldYield=w,t.unstable_wrapCallback=function(e){var t=h;return function(){var n=h;h=t;try{return e.apply(this,arguments)}finally{h=n}}}},85689:function(e,t,n){"use strict";e.exports=n(99176)},11358:function(e,t){"use strict";function n(e){return new URL(e,"http://n").pathname}function r(e){return/https?:\/\//.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{getPathname:function(){return n},isFullStringUrl:function(){return r}})},62441:function(e,t,n){"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{Postpone:function(){return d},createPostponedAbortSignal:function(){return b},createPrerenderState:function(){return c},formatDynamicAPIAccesses:function(){return _},markCurrentScopeAsDynamic:function(){return s},trackDynamicDataAccessed:function(){return f},trackDynamicFetch:function(){return p},usedDynamicAPIs:function(){return y}});let o=(r=n(2265))&&r.__esModule?r:{default:r},u=n(57910),l=n(85108),a=n(11358),i="function"==typeof o.default.unstable_postpone;function c(e){return{isDebugSkeleton:e,dynamicAccesses:[]}}function s(e,t){let n=(0,a.getPathname)(e.urlPathname);if(!e.isUnstableCacheCallback){if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used ${t}. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}}function f(e,t){let n=(0,a.getPathname)(e.urlPathname);if(e.isUnstableCacheCallback)throw Error(`Route ${n} used "${t}" inside a function cached with "unstable_cache(...)". Accessing Dynamic data sources inside a cache scope is not supported. If you need this data inside a cached function use "${t}" outside of the cached function and pass the required dynamic data in as an argument. See more info here: https://nextjs.org/docs/app/api-reference/functions/unstable_cache`);if(e.dynamicShouldError)throw new l.StaticGenBailoutError(`Route ${n} with \`dynamic = "error"\` couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/app/building-your-application/rendering/static-and-dynamic#dynamic-rendering`);if(e.prerenderState)h(e.prerenderState,t,n);else if(e.revalidate=0,e.isStaticGeneration){let r=new u.DynamicServerError(`Route ${n} couldn't be rendered statically because it used \`${t}\`. See more info here: https://nextjs.org/docs/messages/dynamic-server-error`);throw e.dynamicUsageDescription=t,e.dynamicUsageStack=r.stack,r}}function d({reason:e,prerenderState:t,pathname:n}){h(t,e,n)}function p(e,t){e.prerenderState&&h(e.prerenderState,t,e.urlPathname)}function h(e,t,n){v();let r=`Route ${n} needs to bail out of prerendering at this point because it used ${t}. React throws this special object to indicate where. It should not be caught by your own try/catch. Learn more: https://nextjs.org/docs/messages/ppr-caught-error`;e.dynamicAccesses.push({stack:e.isDebugSkeleton?Error().stack:void 0,expression:t}),o.default.unstable_postpone(r)}function y(e){return e.dynamicAccesses.length>0}function _(e){return e.dynamicAccesses.filter(e=>"string"==typeof e.stack&&e.stack.length>0).map(({expression:e,stack:t})=>(t=t.split("\n").slice(4).filter(e=>!(e.includes("node_modules/next/")||e.includes(" ()")||e.includes(" (node:"))).join("\n"),`Dynamic API Usage Debug - ${e}: ${t}`))}function v(){if(!i)throw Error("Invariant: React.unstable_postpone is not defined. This suggests the wrong version of React was loaded. This is a bug in Next.js")}function b(e){v();let t=new AbortController;try{o.default.unstable_postpone(e)}catch(e){t.abort(e)}return t.signal}},24286:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"getSegmentParam",{enumerable:!0,get:function(){return o}});let r=n(82269);function o(e){let t=r.INTERCEPTION_ROUTE_MARKERS.find(t=>e.startsWith(t));return(t&&(e=e.slice(t.length)),e.startsWith("[[...")&&e.endsWith("]]"))?{type:"optional-catchall",param:e.slice(5,-2)}:e.startsWith("[...")&&e.endsWith("]")?{type:t?"catchall-intercepted":"catchall",param:e.slice(4,-1)}:e.startsWith("[")&&e.endsWith("]")?{type:t?"dynamic-intercepted":"dynamic",param:e.slice(1,-1)}:null}},63243:function(e,t){"use strict";var n,r;Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HMR_ACTIONS_SENT_TO_BROWSER",{enumerable:!0,get:function(){return n}}),(r=n||(n={})).ADDED_PAGE="addedPage",r.REMOVED_PAGE="removedPage",r.RELOAD_PAGE="reloadPage",r.SERVER_COMPONENT_CHANGES="serverComponentChanges",r.MIDDLEWARE_CHANGES="middlewareChanges",r.CLIENT_CHANGES="clientChanges",r.SERVER_ONLY_CHANGES="serverOnlyChanges",r.SYNC="sync",r.BUILT="built",r.BUILDING="building",r.DEV_PAGES_MANIFEST_UPDATE="devPagesManifestUpdate",r.TURBOPACK_MESSAGE="turbopack-message",r.SERVER_ERROR="serverError",r.TURBOPACK_CONNECTED="turbopack-connected"},82269:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{INTERCEPTION_ROUTE_MARKERS:function(){return o},extractInterceptionRouteInformation:function(){return l},isInterceptionRouteAppPath:function(){return u}});let r=n(3330),o=["(..)(..)","(.)","(..)","(...)"];function u(e){return void 0!==e.split("/").find(e=>o.find(t=>e.startsWith(t)))}function l(e){let t,n,u;for(let r of e.split("/"))if(n=o.find(e=>r.startsWith(e))){[t,u]=e.split(n,2);break}if(!t||!n||!u)throw Error(`Invalid interception route: ${e}. Must be in the format //(..|...|..)(..)/`);switch(t=(0,r.normalizeAppPath)(t),n){case"(.)":u="/"===t?`/${u}`:t+"/"+u;break;case"(..)":if("/"===t)throw Error(`Invalid interception route: ${e}. Cannot use (..) marker at the root level, use (.) instead.`);u=t.split("/").slice(0,-1).concat(u).join("/");break;case"(...)":u="/"+u;break;case"(..)(..)":let l=t.split("/");if(l.length<=2)throw Error(`Invalid interception route: ${e}. Cannot use (..)(..) marker at the root level or one level up.`);u=l.slice(0,-2).concat(u).join("/");break;default:throw Error("Invariant: unexpected marker")}return{interceptingRoute:t,interceptedRoute:u}}},67991:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ReflectAdapter",{enumerable:!0,get:function(){return n}});class n{static get(e,t,n){let r=Reflect.get(e,t,n);return"function"==typeof r?r.bind(e):r}static set(e,t,n,r){return Reflect.set(e,t,n,r)}static has(e,t){return Reflect.has(e,t)}static deleteProperty(e,t){return Reflect.deleteProperty(e,t)}}},44467:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{AppRouterContext:function(){return o},GlobalLayoutRouterContext:function(){return l},LayoutRouterContext:function(){return u},MissingSlotContext:function(){return i},TemplateContext:function(){return a}});let r=n(99920)._(n(2265)),o=r.default.createContext(null),u=r.default.createContext(null),l=r.default.createContext(null),a=r.default.createContext(null),i=r.default.createContext(new Set)},54736:function(e,t){"use strict";function n(e){let t=5381;for(let n=0;n>>0}function r(e){return n(e).toString(36).slice(0,5)}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{djb2Hash:function(){return n},hexHash:function(){return r}})},36590:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"HeadManagerContext",{enumerable:!0,get:function(){return r}});let r=n(99920)._(n(2265)).default.createContext({})},68056:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{PathParamsContext:function(){return l},PathnameContext:function(){return u},SearchParamsContext:function(){return o}});let r=n(2265),o=(0,r.createContext)(null),u=(0,r.createContext)(null),l=(0,r.createContext)(null)},55592:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{BailoutToCSRError:function(){return r},isBailoutToCSRError:function(){return o}});let n="BAILOUT_TO_CLIENT_SIDE_RENDERING";class r extends Error{constructor(e){super("Bail out to client-side rendering: "+e),this.reason=e,this.digest=n}}function o(e){return"object"==typeof e&&null!==e&&"digest"in e&&e.digest===n}},78558:function(e,t){"use strict";function n(e){return e.startsWith("/")?e:"/"+e}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"ensureLeadingSlash",{enumerable:!0,get:function(){return n}})},21427:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ActionQueueContext:function(){return a},createMutableActionQueue:function(){return s}});let r=n(41452),o=n(51507),u=n(80643),l=r._(n(2265)),a=l.default.createContext(null);function i(e,t){null!==e.pending&&(e.pending=e.pending.next,null!==e.pending?c({actionQueue:e,action:e.pending,setState:t}):e.needsRefresh&&(e.needsRefresh=!1,e.dispatch({type:o.ACTION_REFRESH,origin:window.location.origin},t)))}async function c(e){let{actionQueue:t,action:n,setState:r}=e,u=t.state;if(!u)throw Error("Invariant: Router state not initialized");t.pending=n;let l=n.payload,a=t.action(u,l);function c(e){n.discarded||(t.state=e,t.devToolsInstance&&t.devToolsInstance.send(l,e),i(t,r),n.resolve(e))}(0,o.isThenable)(a)?a.then(c,e=>{i(t,r),n.reject(e)}):c(a)}function s(){let e={state:null,dispatch:(t,n)=>(function(e,t,n){let r={resolve:n,reject:()=>{}};if(t.type!==o.ACTION_RESTORE){let e=new Promise((e,t)=>{r={resolve:e,reject:t}});(0,l.startTransition)(()=>{n(e)})}let u={payload:t,next:null,resolve:r.resolve,reject:r.reject};null===e.pending?(e.last=u,c({actionQueue:e,action:u,setState:n})):t.type===o.ACTION_NAVIGATE||t.type===o.ACTION_RESTORE?(e.pending.discarded=!0,e.last=u,e.pending.payload.type===o.ACTION_SERVER_ACTION&&(e.needsRefresh=!0),c({actionQueue:e,action:u,setState:n})):(null!==e.last&&(e.last.next=u),e.last=u)})(e,t,n),action:async(e,t)=>{if(null===e)throw Error("Invariant: Router state not initialized");return(0,u.reducer)(e,t)},pending:null,last:null};return e}},22707:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"addPathPrefix",{enumerable:!0,get:function(){return o}});let r=n(31465);function o(e,t){if(!e.startsWith("/")||!t)return e;let{pathname:n,query:o,hash:u}=(0,r.parsePath)(e);return""+t+n+o+u}},3330:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{normalizeAppPath:function(){return u},normalizeRscURL:function(){return l}});let r=n(78558),o=n(8e4);function u(e){return(0,r.ensureLeadingSlash)(e.split("/").reduce((e,t,n,r)=>!t||(0,o.isGroupSegment)(t)||"@"===t[0]||("page"===t||"route"===t)&&n===r.length-1?e:e+"/"+t,""))}function l(e){return e.replace(/\.rsc($|\?)/,"$1")}},86180:function(e,t){"use strict";function n(e,t){if(void 0===t&&(t={}),t.onlyHashChange){e();return}let n=document.documentElement,r=n.style.scrollBehavior;n.style.scrollBehavior="auto",t.dontForceLayout||n.getClientRects(),e(),n.style.scrollBehavior=r}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"handleSmoothScroll",{enumerable:!0,get:function(){return n}})},74092:function(e,t){"use strict";function n(e){return/Googlebot|Mediapartners-Google|AdsBot-Google|googleweblight|Storebot-Google|Google-PageRenderer|Bingbot|BingPreview|Slurp|DuckDuckBot|baiduspider|yandex|sogou|LinkedInBot|bitlybot|tumblr|vkShare|quora link preview|facebookexternalhit|facebookcatalog|Twitterbot|applebot|redditbot|Slackbot|Discordbot|WhatsApp|SkypeUriPreview|ia_archiver/i.test(e)}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"isBot",{enumerable:!0,get:function(){return n}})},31465:function(e,t){"use strict";function n(e){let t=e.indexOf("#"),n=e.indexOf("?"),r=n>-1&&(t<0||n-1?{pathname:e.substring(0,r?n:t),query:r?e.substring(n,t>-1?t:void 0):"",hash:t>-1?e.slice(t):""}:{pathname:e,query:"",hash:""}}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"parsePath",{enumerable:!0,get:function(){return n}})},55121:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"pathHasPrefix",{enumerable:!0,get:function(){return o}});let r=n(31465);function o(e,t){if("string"!=typeof e)return!1;let{pathname:n}=(0,r.parsePath)(e);return n===t||n.startsWith(t+"/")}},67741:function(e,t){"use strict";function n(e){return e.replace(/\/$/,"")||"/"}Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"removeTrailingSlash",{enumerable:!0,get:function(){return n}})},8e4:function(e,t){"use strict";function n(e){return"("===e[0]&&e.endsWith(")")}Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{DEFAULT_SEGMENT_KEY:function(){return o},PAGE_SEGMENT_KEY:function(){return r},isGroupSegment:function(){return n}});let r="__PAGE__",o="__DEFAULT__"},8005:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),function(e,t){for(var n in t)Object.defineProperty(e,n,{enumerable:!0,get:t[n]})}(t,{ServerInsertedHTMLContext:function(){return o},useServerInsertedHTML:function(){return u}});let r=n(41452)._(n(2265)),o=r.default.createContext(null);function u(e){let t=(0,r.useContext)(o);t&&t(e)}},72301:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"warnOnce",{enumerable:!0,get:function(){return n}});let n=e=>{}},8293:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"actionAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(66713).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},66713:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"createAsyncLocalStorage",{enumerable:!0,get:function(){return u}});let n=Error("Invariant: AsyncLocalStorage accessed in runtime where it is not available");class r{disable(){throw n}getStore(){}run(){throw n}exit(){throw n}enterWith(){throw n}}let o=globalThis.AsyncLocalStorage;function u(){return o?new o:new r}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},70038:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"requestAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(66713).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},77685:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"staticGenerationAsyncStorage",{enumerable:!0,get:function(){return r}});let r=(0,n(66713).createAsyncLocalStorage)();("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},34040:function(e,t,n){"use strict";var r=n(54887);t.createRoot=r.createRoot,t.hydrateRoot=r.hydrateRoot},54887:function(e,t,n){"use strict";!function e(){if("undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(e){console.error(e)}}(),e.exports=n(84417)},97950:function(e,t,n){"use strict";var r=n(54887),o={stream:!0},u=new Map;function l(e){var t=n(e);return"function"!=typeof t.then||"fulfilled"===t.status?null:(t.then(function(e){t.status="fulfilled",t.value=e},function(e){t.status="rejected",t.reason=e}),t)}function a(){}var i=new Map,c=n.u;n.u=function(e){var t=i.get(e);return void 0!==t?t:c(e)};var s=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.Dispatcher,f=Symbol.for("react.element"),d=Symbol.for("react.lazy"),p=Symbol.iterator,h=Array.isArray,y=Object.getPrototypeOf,_=Object.prototype,v=new WeakMap;function b(e,t,n,r){this.status=e,this.value=t,this.reason=n,this._response=r}function g(e){switch(e.status){case"resolved_model":E(e);break;case"resolved_module":w(e)}switch(e.status){case"fulfilled":return e.value;case"pending":case"blocked":case"cyclic":throw e;default:throw e.reason}}function m(e,t){for(var n=0;nh?(_=h,h=3,p++):(_=0,h=3);continue;case 2:44===(m=d[p++])?h=4:v=v<<4|(96d.length&&(m=-1)}var O=d.byteOffset+p;if(-1` ${(0,o.Gr)(e)}`)],` Sender: ${s}`,` Data: ${a}`,` Callback selector: ${e}`,` Extra data: ${r}`].flat()}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupError"})}}class i extends n.G{constructor({result:e,url:t}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${(0,o.Gr)(t)}`,`Response: ${(0,s.P)(e)}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupResponseMalformedError"})}}class u extends n.G{constructor({sender:e,to:t}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${t}`,`OffchainLookup sender address: ${e}`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"OffchainLookupSenderMismatchError"})}}var l=a(4456),f=a(71108),d=a(39480),p=a(65937),h=a(53932),y=a(40369);let m="0x556f1830",b={name:"OffchainLookup",type:"error",inputs:[{name:"sender",type:"address"},{name:"urls",type:"string[]"},{name:"callData",type:"bytes"},{name:"callbackFunction",type:"bytes4"},{name:"extraData",type:"bytes"}]};async function w(e,{blockNumber:t,blockTag:a,data:s,to:n}){let{args:o}=(0,f.p)({data:s,abi:[b]}),[i,l,y,m,w]=o,{ccipRead:k}=e,O=k&&"function"==typeof k?.request?k.request:g;try{if(!(0,p.E)(n,i))throw new u({sender:i,to:n});let s=await O({data:y,sender:i,urls:l}),{data:o}=await (0,r.R)(e,{blockNumber:t,blockTag:a,data:(0,h.zo)([m,(0,d.E)([{type:"bytes"},{type:"bytes"}],[s,w])]),to:n});return o}catch(e){throw new c({callbackSelector:m,cause:e,data:s,extraData:w,sender:i,urls:l})}}async function g({data:e,sender:t,urls:a}){let r=Error("An unknown error occurred.");for(let n=0;ne&&(a.has(e)?a.get(e):o(e)===Object.prototype||o(e)===Array.prototype),l=e=>n(e)&&e[r]||null,i=(e,t=!0)=>{a.set(e,t)},c=e=>"object"==typeof e&&null!==e,d=new WeakMap,u=new WeakSet,[p]=((e=Object.is,t=(e,t)=>new Proxy(e,t),s=e=>c(e)&&!u.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),r=e=>{switch(e.status){case"fulfilled":return e.value;case"rejected":throw e.reason;default:throw e}},o=new WeakMap,a=(e,t,s=r)=>{let n=o.get(e);if((null==n?void 0:n[0])===t)return n[1];let l=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));return i(l,!0),o.set(e,[t,l]),Reflect.ownKeys(e).forEach(t=>{if(Object.getOwnPropertyDescriptor(l,t))return;let r=Reflect.get(e,t),o={value:r,enumerable:!0,configurable:!0};if(u.has(r))i(r,!1);else if(r instanceof Promise)delete o.value,o.get=()=>s(r);else if(d.has(r)){let[e,t]=d.get(r);o.value=a(e,t(),s)}Object.defineProperty(l,t,o)}),Object.preventExtensions(l)},n=new WeakMap,p=[1,1],f=r=>{if(!c(r))throw Error("object required");let o=n.get(r);if(o)return o;let i=p[0],h=new Set,m=(e,t=++p[0])=>{i!==t&&(i=t,h.forEach(s=>s(e,t)))},g=p[1],b=(e=++p[1])=>(g===e||h.size||(g=e,v.forEach(([t])=>{let s=t[1](e);s>i&&(i=s)})),i),y=e=>(t,s)=>{let r=[...t];r[1]=[e,...r[1]],m(r,s)},v=new Map,w=(e,t)=>{if(v.has(e))throw Error("prop listener already exists");if(h.size){let s=t[3](y(e));v.set(e,[t,s])}else v.set(e,[t])},C=e=>{var t;let s=v.get(e);s&&(v.delete(e),null==(t=s[1])||t.call(s))},I=e=>{h.add(e),1===h.size&&v.forEach(([e,t],s)=>{if(t)throw Error("remove already exists");let r=e[3](y(s));v.set(s,[e,r])});let t=()=>{h.delete(e),0===h.size&&v.forEach(([e,t],s)=>{t&&(t(),v.set(s,[e]))})};return t},O=Array.isArray(r)?[]:Object.create(Object.getPrototypeOf(r)),W={deleteProperty(e,t){let s=Reflect.get(e,t);C(t);let r=Reflect.deleteProperty(e,t);return r&&m(["delete",[t],s]),r},set(t,r,o,a){let i=Reflect.has(t,r),p=Reflect.get(t,r,a);if(i&&(e(p,o)||n.has(o)&&e(p,n.get(o))))return!0;C(r),c(o)&&(o=l(o)||o);let h=o;if(o instanceof Promise)o.then(e=>{o.status="fulfilled",o.value=e,m(["resolve",[r],e])}).catch(e=>{o.status="rejected",o.reason=e,m(["reject",[r],e])});else{!d.has(o)&&s(o)&&(h=f(o));let e=!u.has(h)&&d.get(h);e&&w(r,e)}return Reflect.set(t,r,h,a),m(["set",[r],o,p]),!0}},E=t(O,W);n.set(r,E);let j=[O,b,a,I];return d.set(E,j),Reflect.ownKeys(r).forEach(e=>{let t=Object.getOwnPropertyDescriptor(r,e);"value"in t&&(E[e]=r[e],delete t.value,delete t.writable),Object.defineProperty(O,e,t)}),E})=>[f,d,u,e,t,s,r,o,a,n,p])();function f(e={}){return p(e)}function h(e,t,s){let r;let o=d.get(e);o||console.warn("Please use proxy object");let a=[],n=o[3],l=!1,i=n(e=>{if(a.push(e),s){t(a.splice(0));return}r||(r=Promise.resolve().then(()=>{r=void 0,l&&t(a.splice(0))}))});return l=!0,()=>{l=!1,i()}}let m=f({history:["ConnectWallet"],view:"ConnectWallet",data:void 0}),g={state:m,subscribe:e=>h(m,()=>e(m)),push(e,t){e!==m.view&&(m.view=e,t&&(m.data=t),m.history.push(e))},reset(e){m.view=e,m.history=[e]},replace(e){m.history.length>1&&(m.history[m.history.length-1]=e,m.view=e)},goBack(){if(m.history.length>1){m.history.pop();let[e]=m.history.slice(-1);m.view=e}},setData(e){m.data=e}},b={WALLETCONNECT_DEEPLINK_CHOICE:"WALLETCONNECT_DEEPLINK_CHOICE",WCM_VERSION:"WCM_VERSION",RECOMMENDED_WALLET_AMOUNT:9,isMobile:()=>"u">typeof window&&!!(window.matchMedia("(pointer:coarse)").matches||/Android|webOS|iPhone|iPad|iPod|BlackBerry|Opera Mini/u.test(navigator.userAgent)),isAndroid:()=>b.isMobile()&&navigator.userAgent.toLowerCase().includes("android"),isIos(){let e=navigator.userAgent.toLowerCase();return b.isMobile()&&(e.includes("iphone")||e.includes("ipad"))},isHttpUrl:e=>e.startsWith("http://")||e.startsWith("https://"),isArray:e=>Array.isArray(e)&&e.length>0,formatNativeUrl(e,t,s){if(b.isHttpUrl(e))return this.formatUniversalUrl(e,t,s);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);let o=encodeURIComponent(t);return`${r}wc?uri=${o}`},formatUniversalUrl(e,t,s){if(!b.isHttpUrl(e))return this.formatNativeUrl(e,t,s);let r=e;r.endsWith("/")||(r=`${r}/`),this.setWalletConnectDeepLink(r,s);let o=encodeURIComponent(t);return`${r}wc?uri=${o}`},wait:async e=>new Promise(t=>{setTimeout(t,e)}),openHref(e,t){window.open(e,t,"noreferrer noopener")},setWalletConnectDeepLink(e,t){try{localStorage.setItem(b.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:e,name:t}))}catch{console.info("Unable to set WalletConnect deep link")}},setWalletConnectAndroidDeepLink(e){try{let[t]=e.split("?");localStorage.setItem(b.WALLETCONNECT_DEEPLINK_CHOICE,JSON.stringify({href:t,name:"Android"}))}catch{console.info("Unable to set WalletConnect android deep link")}},removeWalletConnectDeepLink(){try{localStorage.removeItem(b.WALLETCONNECT_DEEPLINK_CHOICE)}catch{console.info("Unable to remove WalletConnect deep link")}},setModalVersionInStorage(){try{"u">typeof localStorage&&localStorage.setItem(b.WCM_VERSION,"2.6.2")}catch{console.info("Unable to set Web3Modal version in storage")}},getWalletRouterData(){var e;let t=null==(e=g.state.data)?void 0:e.Wallet;if(!t)throw Error('Missing "Wallet" view data');return t}},y=f({enabled:"u">typeof location&&(location.hostname.includes("localhost")||location.protocol.includes("https")),userSessionId:"",events:[],connectedWalletId:void 0}),v={state:y,subscribe:e=>h(y.events,()=>e(function(e,t){let s=d.get(e);s||console.warn("Please use proxy object");let[r,o,a]=s;return a(r,o(),void 0)}(y.events[y.events.length-1]))),initialize(){y.enabled&&"u">typeof(null==crypto?void 0:crypto.randomUUID)&&(y.userSessionId=crypto.randomUUID())},setConnectedWalletId(e){y.connectedWalletId=e},click(e){if(y.enabled){let t={type:"CLICK",name:e.name,userSessionId:y.userSessionId,timestamp:Date.now(),data:e};y.events.push(t)}},track(e){if(y.enabled){let t={type:"TRACK",name:e.name,userSessionId:y.userSessionId,timestamp:Date.now(),data:e};y.events.push(t)}},view(e){if(y.enabled){let t={type:"VIEW",name:e.name,userSessionId:y.userSessionId,timestamp:Date.now(),data:e};y.events.push(t)}}},w=f({chains:void 0,walletConnectUri:void 0,isAuth:!1,isCustomDesktop:!1,isCustomMobile:!1,isDataLoaded:!1,isUiLoaded:!1}),C={state:w,subscribe:e=>h(w,()=>e(w)),setChains(e){w.chains=e},setWalletConnectUri(e){w.walletConnectUri=e},setIsCustomDesktop(e){w.isCustomDesktop=e},setIsCustomMobile(e){w.isCustomMobile=e},setIsDataLoaded(e){w.isDataLoaded=e},setIsUiLoaded(e){w.isUiLoaded=e},setIsAuth(e){w.isAuth=e}},I=f({projectId:"",mobileWallets:void 0,desktopWallets:void 0,walletImages:void 0,chains:void 0,enableAuthMode:!1,enableExplorer:!0,explorerExcludedWalletIds:void 0,explorerRecommendedWalletIds:void 0,termsOfServiceUrl:void 0,privacyPolicyUrl:void 0}),O={state:I,subscribe:e=>h(I,()=>e(I)),setConfig(e){var t,s;v.initialize(),C.setChains(e.chains),C.setIsAuth(!!e.enableAuthMode),C.setIsCustomMobile(!!(null==(t=e.mobileWallets)?void 0:t.length)),C.setIsCustomDesktop(!!(null==(s=e.desktopWallets)?void 0:s.length)),b.setModalVersionInStorage(),Object.assign(I,e)}};var W=Object.defineProperty,E=Object.getOwnPropertySymbols,j=Object.prototype.hasOwnProperty,L=Object.prototype.propertyIsEnumerable,A=(e,t,s)=>t in e?W(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,k=(e,t)=>{for(var s in t||(t={}))j.call(t,s)&&A(e,s,t[s]);if(E)for(var s of E(t))L.call(t,s)&&A(e,s,t[s]);return e};let M="https://explorer-api.walletconnect.com",U="js-2.6.2";async function D(e,t){let s=k({sdkType:"wcm",sdkVersion:U},t),r=new URL(e,M);return r.searchParams.append("projectId",O.state.projectId),Object.entries(s).forEach(([e,t])=>{t&&r.searchParams.append(e,String(t))}),(await fetch(r)).json()}let P={getDesktopListings:async e=>D("/w3m/v1/getDesktopListings",e),getMobileListings:async e=>D("/w3m/v1/getMobileListings",e),getAllListings:async e=>D("/w3m/v1/getAllListings",e),getWalletImageUrl:e=>`${M}/w3m/v1/getWalletImage/${e}?projectId=${O.state.projectId}&sdkType=wcm&sdkVersion=${U}`,getAssetImageUrl:e=>`${M}/w3m/v1/getAssetImage/${e}?projectId=${O.state.projectId}&sdkType=wcm&sdkVersion=${U}`};var S=Object.defineProperty,N=Object.getOwnPropertySymbols,T=Object.prototype.hasOwnProperty,x=Object.prototype.propertyIsEnumerable,R=(e,t,s)=>t in e?S(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,_=(e,t)=>{for(var s in t||(t={}))T.call(t,s)&&R(e,s,t[s]);if(N)for(var s of N(t))x.call(t,s)&&R(e,s,t[s]);return e};let $=b.isMobile(),V=f({wallets:{listings:[],total:0,page:1},search:{listings:[],total:0,page:1},recomendedWallets:[]}),H={state:V,async getRecomendedWallets(){let{explorerRecommendedWalletIds:e,explorerExcludedWalletIds:t}=O.state;if("NONE"===e||"ALL"===t&&!e)return V.recomendedWallets;if(b.isArray(e)){let t={recommendedIds:e.join(",")},{listings:s}=await P.getAllListings(t),r=Object.values(s);r.sort((t,s)=>e.indexOf(t.id)-e.indexOf(s.id)),V.recomendedWallets=r}else{let{chains:e,isAuth:s}=C.state,r=e?.join(","),o=b.isArray(t),a={page:1,sdks:s?"auth_v1":void 0,entries:b.RECOMMENDED_WALLET_AMOUNT,chains:r,version:2,excludedIds:o?t.join(","):void 0},{listings:n}=$?await P.getMobileListings(a):await P.getDesktopListings(a);V.recomendedWallets=Object.values(n)}return V.recomendedWallets},async getWallets(e){let t=_({},e),{explorerRecommendedWalletIds:s,explorerExcludedWalletIds:r}=O.state,{recomendedWallets:o}=V;if("ALL"===r)return V.wallets;o.length?t.excludedIds=o.map(e=>e.id).join(","):b.isArray(s)&&(t.excludedIds=s.join(",")),b.isArray(r)&&(t.excludedIds=[t.excludedIds,r].filter(Boolean).join(",")),C.state.isAuth&&(t.sdks="auth_v1");let{page:a,search:n}=e,{listings:l,total:i}=$?await P.getMobileListings(t):await P.getDesktopListings(t),c=Object.values(l),d=n?"search":"wallets";return V[d]={listings:[...V[d].listings,...c],total:i,page:a??1},{listings:c,total:i}},getWalletImageUrl:e=>P.getWalletImageUrl(e),getAssetImageUrl:e=>P.getAssetImageUrl(e),resetSearch(){V.search={listings:[],total:0,page:1}}},K=f({open:!1}),z={state:K,subscribe:e=>h(K,()=>e(K)),open:async e=>new Promise(t=>{let{isUiLoaded:s,isDataLoaded:r}=C.state;if(b.removeWalletConnectDeepLink(),C.setWalletConnectUri(e?.uri),C.setChains(e?.chains),g.reset("ConnectWallet"),s&&r)K.open=!0,t();else{let e=setInterval(()=>{let s=C.state;s.isUiLoaded&&s.isDataLoaded&&(clearInterval(e),K.open=!0,t())},200)}}),close(){K.open=!1}};var B=Object.defineProperty,J=Object.getOwnPropertySymbols,q=Object.prototype.hasOwnProperty,F=Object.prototype.propertyIsEnumerable,G=(e,t,s)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):e[t]=s,Q=(e,t)=>{for(var s in t||(t={}))q.call(t,s)&&G(e,s,t[s]);if(J)for(var s of J(t))F.call(t,s)&&G(e,s,t[s]);return e};let X=f({themeMode:"u">typeof matchMedia&&matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}),Y={state:X,subscribe:e=>h(X,()=>e(X)),setThemeConfig(e){let{themeMode:t,themeVariables:s}=e;t&&(X.themeMode=t),s&&(X.themeVariables=Q({},s))}},Z=f({open:!1,message:"",variant:"success"}),ee={state:Z,subscribe:e=>h(Z,()=>e(Z)),openToast(e,t){Z.open=!0,Z.message=e,Z.variant=t},closeToast(){Z.open=!1}}},55318:function(e,t,s){s.d(t,{WalletConnectModal:function(){return o}});var r=s(11481);class o{constructor(e){this.openModal=r.jb.open,this.closeModal=r.jb.close,this.subscribeModal=r.jb.subscribe,this.setTheme=r.ThemeCtrl.setThemeConfig,r.ThemeCtrl.setThemeConfig(e),r.ConfigCtrl.setConfig(e),this.initUi()}async initUi(){if("u">typeof window){await s.e(866).then(s.bind(s,80866));let e=document.createElement("wcm-modal");document.body.insertAdjacentElement("beforeend",e),r.OptionsCtrl.setIsUiLoaded(!0)}}}}}]); ================================================ FILE: client/out/_next/static/chunks/385cb88d-d4d0cd34753b4b85.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[505],{75027:function(t,c,n){n.d(c,{U6L:function(){return u},t00:function(){return a}});var r=n(91810);function a(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M84.41 106c-15.63.1-27.67 13.8-25.69 29.3 16 124 16 117.4 0 241.4-2.54 19.8 17.33 35 35.79 27.3L361.5 292.9v98.8c0 7.9 8.9 14.2 20 14.3h52c11.1-.1 20-6.4 20-14.3V120.2c-.1-7.8-9-14.1-20-14.2h-52c-11 .1-19.9 6.4-20 14.2v98.9L94.51 108c-3.2-1.3-6.63-2-10.1-2z"},child:[]}]})(t)}function u(t){return(0,r.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M427.6 106c15.6.1 27.7 13.8 25.7 29.3-16 124-16 117.4 0 241.4 2.5 19.8-17.4 35-35.8 27.3l-267-111.1v98.8c0 7.9-8.9 14.2-20 14.3H78.49c-11.1-.1-20-6.4-20-14.3V120.2c.1-7.8 9-14.1 20-14.2h52.01c11 .1 19.9 6.4 20 14.2v98.9l267-111.1c3.2-1.3 6.6-2 10.1-2z"},child:[]}]})(t)}}}]); ================================================ FILE: client/out/_next/static/chunks/3ab9597f-9ca74e94c08af310.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[269],{76437:function(e,t,r){r.d(t,{rB:function(){return sH},rr:function(){return pt},sv:function(){return n$}});var n=r(89005),i=r(68893),a=r(53989),o=r(2265),s=r(63858),l=r(58118),c=r(37786),d=r(3754),h=r(99434),u=r(40739),p=r(18482),m=r(57437),g=r(93925),f=r(20920),y=r(9784),w=r(36393),x=r(86080),v=r(13421),C=r(89649),b=r(13130),_=r(58249),j=r(44785),k=r(9648),E=r(59956),A=r(10506),S=r(20402),T=r(66514),P=r(84573),N=r(82238),R=r(79314),M=r(39422),O=r(92009),I=r(47899),W=r(14340),L=r(61652),F=r(54515),U=r(11853),D=r(25032),Z=r(64728),z=r(52985),$=r(47193),H=r(69992),B=r(94023),q=r.n(B),V=r(4811),G=r(92861),K=r(76218),Y=r(87335),Q=r(57470),X=r(89651),J=r(75514),ee=r(19783),et=r(58789),er=r(85130),en=r(50607),ei=r(22594),ea=r(75752),eo=r(58900),es=r(33009),el=r(12560),ec=r(90196),ed=r(13934),eh=r(44011),eu=r(64954),ep=r(59808),em=r(24609),eg=r(75006),ef=r(24967),ey=r(51834),ew=r(78299),ex=r(26930),ev=r(59488),eC=r(54621),eb=r(27762),e_=r(29765),ej=r(24167),ek=r(5620),eE=r(74634),eA=r(70882),eS=r(22091),eT=r(2825),eP=r(68906),eN=r(84351),eR=r(63722),eM=r(62957),eO=r(49601),eI=r(99442),eW=r(5),eL=r(28781),eF=r(43408),eU=r(28257),eD=r(59226),eZ=r(60943),ez=(e,t,r)=>{if(!t.has(e))throw TypeError("Cannot "+r)},e$=(e,t,r)=>(ez(e,t,"read from private field"),r?r.call(e):t.get(e)),eH=(e,t,r)=>{if(t.has(e))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(e):t.set(e,r)},eB=(e,t,r,n)=>(ez(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),eq=(e,t,r)=>(ez(e,t,"access private method"),r),eV=class extends Error{constructor(e,t,r){super(e),t instanceof Error&&(this.cause=t),this.privyErrorCode=r}toString(){return`${this.type}${this.privyErrorCode?`-${this.privyErrorCode}`:""}: ${this.message}${this.cause?` [cause: ${this.cause}]`:""}`}},eG=class extends eV{constructor(e,t,r,n,i){super(r,n,i),this.type=e,this.status=t}},eK=class extends eV{constructor(e,t,r){super(e,t,r),this.type="client_error"}},eY=class extends eK{constructor(){super("Request timed out",void 0,"client_request_timeout")}},eQ=class extends eV{constructor(e,t,r){super(e,t,r),this.type="connector_error"}},eX=e=>{if(e instanceof eV)return e;if(!(e instanceof h.F))return eJ(e);if(!e.response)return new eG("api_error",null,e.message,e);let{type:t,message:r,error:n,code:i}=e.data;return new eG(t||"ApiError",e.response.status,r||n,e,i)},eJ=e=>e instanceof eV?e:e instanceof Error?new eK(e.message,e):new eK(`Internal error: ${e}`),e0=class extends eK{constructor(){super("Method called before `ready`. Ensure you wait until `ready` is true before calling.")}},e1=class extends eK{constructor(e="Embedded wallet error",t){super(e,t,"unknown_embedded_wallet_error")}},e2=class extends eK{constructor(e="User must be authenticated"){super(e,void 0,"must_be_authenticated")}},e3=class extends eK{constructor(e){super("This application is in development mode and must be upgraded to production to log in new users.",e,"max_accounts_reached")}},e4="/api/v1/sessions",e5="/api/v1/sessions/logout",e6="/api/v1/sessions/fork/recover",e7="/api/v1/oauth/init",e8="/api/v1/oauth/link",e9="/api/v1/analytics_events",te=class{constructor(e){this.meta={token:e}}async authenticate(){if(!this.api)throw new eK("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/custom_jwt_account/authenticate",{token:this.meta.token});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw eX(e)}}async link(){throw Error("Unimplemented")}},tt=class{constructor(e,t){this.meta={email:e,captchaToken:t}}async authenticate(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new eK("Email and email code must be set prior to calling authenticate.");try{let e=await this.api.post("/api/v1/passwordless/authenticate",{email:this.meta.email,code:this.meta.emailCode});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw eX(e)}}async link(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode)throw new eK("Email and email code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless/link",{email:this.meta.email,code:this.meta.emailCode})}catch(e){throw eX(e)}}async sendCodeEmail(e,t){if(!this.api)throw new eK("Auth flow has no API instance");if(e&&(this.meta.email=e),t&&(this.meta.captchaToken=t),!this.meta.email)throw new eK("Email must be set when initialzing authentication.");try{return await this.api.post("/api/v1/passwordless/init",{email:this.meta.email,token:this.meta.captchaToken})}catch(e){throw eX(e)}}},tr=class extends tt{constructor(e,t,r){super(t,r),this.meta={email:t,captchaToken:r,oldAddress:e}}async link(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.email||!this.meta.emailCode||!this.meta.oldAddress)throw new eK("Email, email code, and an old email address must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless/update",{oldAddress:this.meta.oldAddress,newAddress:this.meta.email,code:this.meta.emailCode})}catch(e){throw eX(e)}}},tn=class{constructor(){this._cache={}}get(e){return this._cache[e]}put(e,t){void 0!==t?this._cache[e]=t:this.del(e)}del(e){delete this._cache[e]}getKeys(){return Object.keys(this._cache)}},ti=class{get(e){let t=localStorage.getItem(e);return null===t?void 0:JSON.parse(t)}put(e,t){void 0!==t?localStorage.setItem(e,JSON.stringify(t)):this.del(e)}del(e){localStorage.removeItem(e)}getKeys(){return Object.entries(localStorage).map(([e])=>e)}};function ta(){try{let e="privy:__session_storage__test",t=new ti;return t.put(e,"blobby"),t.del(e),!0}catch{return!1}}var to="u">typeof window&&window.localStorage?new ti:new tn,ts=e=>e.isApexWallet?"Apex Wallet":e.isAvalanche?"Core Wallet":e.isBackpack?"Backpack":e.isBifrost?"Bifrost Wallet":e.isBitKeep?"BitKeep":e.isBitski?"Bitski":e.isBlockWallet?"BlockWallet":e.isBraveWallet?"Brave Wallet":e.isClover?"Clover":e.isCoin98?"Coin98 Wallet":e.isCoinbaseWallet?"Coinbase Wallet":e.isDawn?"Dawn Wallet":e.isDefiant?"Defiant":e.isDesig?"Desig Wallet":e.isEnkrypt?"Enkrypt":e.isExodus?"Exodus":e.isFordefi?"Fordefi":e.isFrame?"Frame":e.isFrontier?"Frontier Wallet":e.isGamestop?"GameStop Wallet":e.isHaqqWallet?"HAQQ Wallet":e.isHyperPay?"HyperPay Wallet":e.isImToken?"ImToken":e.isHaloWallet?"Halo Wallet":e.isKuCoinWallet?"KuCoin Wallet":e.isMathWallet?"MathWallet":e.isNovaWallet?"Nova Wallet":e.isOkxWallet||e.isOKExWallet?"OKX Wallet":e.isOneInchIOSWallet||e.isOneInchAndroidWallet?"1inch Wallet":e.isOneKey?"OneKey Wallet":e.isOpera?"Opera":e.isPhantom?"Phantom":e.isPortal?"Ripio Portal":e.isRabby?"Rabby Wallet":e.isRainbow?"Rainbow":e.isSafePal?"SafePal Wallet":e.isStatus?"Status":e.isSubWallet?"SubWallet":e.isTalisman?"Talisman":e.isTally||e.isTaho?"Taho":e.isTokenPocket?"TokenPocket":e.isTokenary?"Tokenary":e.isTrust||e.isTrustWallet?"Trust Wallet":e.isTTWallet?"TTWallet":e.isXDEFI?"XDEFI Wallet":e.isZeal?"Zeal":e.isZerion?"Zerion":e.isMetaMask?"MetaMask":void 0,tl=(e,t)=>{if(!e.isMetaMask)return!1;if(e.isMetaMask&&!t)return!0;if(e.isBraveWallet&&!e._events&&!e._state||"MetaMask"!==ts(e))return!1;if(e.providers){for(let t of e.providers)if(!tl(t))return!1}return!0},tc=()=>!!("phantom"in window&&window?.phantom?.ethereum?.isPhantom),td=()=>{let e=window;if(!e.ethereum)return!1;if(e.ethereum.isCoinbaseWallet)return!0;if(e.ethereum.providers){for(let t of e.ethereum.providers)if(t&&t.isCoinbaseWallet)return!0}return!1},th=(e,t)=>{let r=[],n=[];for(let[i,a]of e.entries())i!!String(e).toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/),tp=(e,t)=>{let r=e.slice(0),n=[];for(;r.length;)n.push(r.splice(0,t));return n},tm=(e,t=3,r=4)=>{if(!e)return"";if(t+r+2+3>=e.length)return e;let n=e.slice(0,2+t),i=e.slice(e.length-r,e.length);return`${n}...${i}`},tg=e=>new Promise(t=>setTimeout(t,e)),tf=(e,t={})=>{let r=t.delayMs||150,n=t.maxAttempts||270;return new Promise(async(i,a)=>{let o=!1,s=0;for(;!o&&s{o=!0,i(e)},(...e)=>{o=!0,a(...e)}),s+=1,await tg(r)}o||a(Error("Exceeded max attempts before resolving function"))})},ty=(e,t,r={},n={})=>{let i=new URL(t,e);for(let[e,t]of Object.entries(r))void 0!==t&&i.searchParams.set(e,t);let a=Object.entries(n);if(a.length>0){let e=new URLSearchParams;for(let[t,r]of a)e.append(t,r);i.hash=e.toString()}return i.href},tw=e=>e.replace(/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g,""),tx=e=>"string"==typeof e?e:"0x"+e.toString(16);async function tv(e,t,r,n=3e3){let i=!1,a=window;return new Promise(o=>{a.ethereum?s():(window.addEventListener("ethereum#initialized",s,{once:!0}),setTimeout(()=>{s()},n));function s(){if(i)return;i=!0,window.removeEventListener("ethereum#initialized",s);let n=e.getProviders();console.debug("Detected injected providers:",n.map(e=>e.info));let a=[];for(let e of n)t.includes("coinbase_wallet")&&"com.coinbase.wallet"===e.info.rdns||a.push({type:e.info.name.toLowerCase().replace(/\s/g,"_"),eip6963InjectedProvider:e});for(let e of function(){let e=window,t=e.ethereum;if(!t)return[];let r=[];if(t.providers?.length)for(let e of t.providers)e&&r.push(e);return r.push(e.ethereum),r}()){let t=ts(e);if(!n.some(e=>e.info.name===t)){if(tl(e,!0)&&!a.find(e=>"metamask"===e.type)){a.push({type:"metamask",legacyInjectedProvider:e});continue}if("Phantom"===t&&!a.find(e=>"phantom"===e.type)){a.push({type:"phantom",legacyInjectedProvider:e});continue}if("Coinbase Wallet"===t&&!a.find(e=>"coinbase_wallet"===e.type&&r?.coinbaseWallet?.connectionOptions!=="smartWalletOnly")){a.push({type:"coinbase_wallet",legacyInjectedProvider:e});continue}a.find(e=>"unknown_browser_extension"===e.type)||a.push({type:"unknown_browser_extension",legacyInjectedProvider:e})}}o(a)}})}function tC(e){return`eip155:${String(Number(e))}`}var tb=(e,t,r,n)=>{let i=Number(e),a=t.find(e=>e.id===i);if(!a)throw new eQ(`Unsupported chainId ${e}`,4901);return t_(a,r,n)},t_=(e,t,r)=>{let n=e.id,i=Number(e.id),a;if(e.rpcUrls.privyWalletOverride&&e.rpcUrls.privyWalletOverride.http[0])a=e.rpcUrls.privyWalletOverride.http[0];else if(t.rpcUrls&&t.rpcUrls[i])a=t.rpcUrls[i];else if(e.rpcUrls.privy?.http[0]){let t=new URL(e.rpcUrls.privy.http[0]);t.searchParams.append("privyAppId",r),a=t.toString()}else a=e.rpcUrls.public?.http[0]?e.rpcUrls.public.http[0]:e.rpcUrls.default?.http[0];if(!a)throw new eQ(`No RPC url found for ${n}`);return a},tj=(e,t)=>{let r=Number(e),n=t.find(e=>e.id===r);if(!n)throw new eQ(`Unsupported chainId ${e}`,4901);return n.blockExplorers?.default.url},tk=(e,t,r,n)=>{let i=Number(e),a=t.find(e=>e.id===i);if(!a)throw new eQ(`Unsupported chainId ${e}`,4901);return new u.c(a.rpcUrls.privyWalletOverride&&a.rpcUrls.privyWalletOverride.http[0]?a.rpcUrls.privyWalletOverride.http[0]:r.rpcUrls&&r.rpcUrls[i]?r.rpcUrls[i]:a.rpcUrls.privy?.http[0]?{url:a.rpcUrls.privy.http[0],headers:{"privy-app-id":n.appId}}:a.rpcUrls.public?.http[0]?a.rpcUrls.public.http[0]:a.rpcUrls.default?.http[0])},tE=e=>{let t={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},r=e.types.EIP712Domain??Object.entries(e.domain).map(([e,r])=>{if(null!=r&&"string"==typeof e&&e in t)return{name:e,type:t[e]}}).filter(e=>void 0!==e);return{...e,types:{...e.types,EIP712Domain:r}}},tA=e=>{let t;try{t=new URL(e).hostname}catch{return}for(let[e,r]of Object.entries(tS))if(t.includes(r.hostname))return{walletClientType:e,entry:r}},tS={metamask:{id:"c57ca95b47569778a828d19178114f4db188b89b763c899ba0be274e97267d96",displayName:"MetaMask",hostname:"metamask.io",mobile:{native:"metamask://",universal:"https://metamask.app.link"}},trust:{id:"4622a2b2d6af1c9844944291e5e7351a6aa24cd7b23099efac1b2fd875da31a0",displayName:"Trust",hostname:"trustwallet.com",mobile:{universal:"https://link.trustwallet.com"}},safe:{id:"225affb176778569276e484e1b92637ad061b01e13a048b35a9d280c3b58970f",displayName:"Safe",hostname:"safe.global",mobile:{universal:"https://app.safe.global/"}},rainbow:{id:"1ae92b26df02f0abca6304df07debccd18262fdf5fe82daa81593582dac9a369",displayName:"Rainbow",hostname:"rainbow.me",mobile:{native:"rainbow://",universal:"https://rnbwapp.com"}},uniswap:{id:"c03dfee351b6fcc421b4494ea33b9d4b92a984f87aa76d1663bb28705e95034a",displayName:"Uniswap",hostname:"uniswap.org",mobile:{universal:"https://uniswap.org/app",native:"uniswap://"}},zerion:{id:"ecc4036f814562b41a5268adc86270fba1365471402006302e70169465b7ac18",displayName:"Zerion",hostname:"zerion.io",mobile:{native:"zerion://",universal:"https://wallet.zerion.io"}},argent:{id:"bc949c5d968ae81310268bf9193f9c9fb7bb4e1283e1284af8f2bd4992535fd6",displayName:"Argent",hostname:"www.argent.xyz",mobile:{universal:"https://www.argent.xyz/app"}},spot:{id:"74f8092562bd79675e276d8b2062a83601a4106d30202f2d509195e30e19673d",displayName:"Spot",hostname:"www.spot-wallet.com",mobile:{universal:"https://spot.so"}},omni:{id:"afbd95522f4041c71dd4f1a065f971fd32372865b416f95a0b1db759ae33f2a7",displayName:"Omni",hostname:"omni.app",mobile:{universal:"https://links.omni.app"}},cryptocom:{id:"f2436c67184f158d1beda5df53298ee84abfc367581e4505134b5bcf5f46697d",displayName:"Crypto.com",hostname:"crypto.com",mobile:{universal:"https://wallet.crypto.com",native:"dfw://"}},blockchain:{id:"84b43e8ddfcd18e5fcb5d21e7277733f9cccef76f7d92c836d0e481db0c70c04",displayName:"Blockchain",hostname:"www.blockchain.com",mobile:{universal:"https://www.blockchain.com"}},safepal:{id:"0b415a746fb9ee99cce155c2ceca0c6f6061b1dbca2d722b3ba16381d0562150",displayName:"SafePal",hostname:"safepal.com",mobile:{universal:"https://link.safepal.io"}},bitkeep:{id:"38f5d18bd8522c244bdd70cb4a68e0e718865155811c043f052fb9f1c51de662",displayName:"BitKeep",hostname:"bitkeep.com",mobile:{universal:"https://bkapp.vip"}},zengo:{id:"9414d5a85c8f4eabc1b5b15ebe0cd399e1a2a9d35643ab0ad22a6e4a32f596f0",displayName:"ZenGo",hostname:"zengo.com",mobile:{universal:"https://get.zengo.com/"}},"1inch":{id:"c286eebc742a537cd1d6818363e9dc53b21759a1e8e5d9b263d0c03ec7703576",displayName:"1inch",hostname:"wallet.1inch.io",mobile:{universal:"https://wallet.1inch.io/wc/"}},binance:{id:"8a0ee50d1f22f6651afcae7eb4253e52a3310b90af5daef78a8c4929a9bb99d4",displayName:"Binance",hostname:"www.binance.com",mobile:{universal:"https://app.binance.com/cedefi"}},exodus:{id:"e9ff15be73584489ca4a66f64d32c4537711797e30b6660dbcb71ea72a42b1f4",displayName:"Exodus",hostname:"exodus.com",mobile:{universal:"https://exodus.com/m"}},mew_wallet:{id:"f5b4eeb6015d66be3f5940a895cbaa49ef3439e518cd771270e6b553b48f31d2",displayName:"MEW wallet",hostname:"mewwallet.com",mobile:{universal:"https://mewwallet.com"}},alphawallet:{id:"138f51c8d00ac7b9ac9d8dc75344d096a7dfe370a568aa167eabc0a21830ed98",displayName:"AlphaWallet",hostname:"alphawallet.com",mobile:{universal:"https://aw.app"}},keyring_pro:{id:"47bb07617af518642f3413a201ec5859faa63acb1dd175ca95085d35d38afb83",displayName:"KEYRING PRO",hostname:"keyring.app",mobile:{universal:"https://keyring.app/"}},mathwallet:{id:"7674bb4e353bf52886768a3ddc2a4562ce2f4191c80831291218ebd90f5f5e26",displayName:"MathWallet",hostname:"mathwallet.org",mobile:{universal:"https://www.mathwallet.org"}},unstoppable:{id:"8308656f4548bb81b3508afe355cfbb7f0cb6253d1cc7f998080601f838ecee3",displayName:"Unstoppable",hostname:"unstoppabledomains.com",mobile:{universal:"https://unstoppabledomains.com/mobile"}},obvious:{id:"031f0187049b7f96c6f039d1c9c8138ff7a17fd75d38b34350c7182232cc29aa",displayName:"Obvious",hostname:"obvious.technology",mobile:{universal:"https://wallet.obvious.technology"}},ambire:{id:"2c81da3add65899baeac53758a07e652eea46dbb5195b8074772c62a77bbf568",displayName:"Ambire",hostname:"www.ambire.com",mobile:{universal:"https://mobile.ambire.com"}},internet_money_wallet:{id:"dd43441a6368ec9046540c46c5fdc58f79926d17ce61a176444568ca7c970dcd",displayName:"Internet Money Wallet",hostname:"internetmoney.io",mobile:{universal:"https://internetmoney.io"}},coin98:{id:"2a3c89040ac3b723a1972a33a125b1db11e258a6975d3a61252cd64e6ea5ea01",displayName:"Coin98",hostname:"coin98.com",mobile:{universal:"https://coin98.services"}},abc_wallet:{id:"b956da9052132e3dabdcd78feb596d5194c99b7345d8c4bd7a47cabdcb69a25f",displayName:"ABC Wallet",hostname:"myabcwallet.io",mobile:{universal:"https://abcwalletconnect.page.link"}},arculus_wallet:{id:"0e4915107da5b3408b38e248f7a710f4529d54cd30e9d12ff0eb886d45c18e92",displayName:"Arculus Wallet",hostname:"www.getarculus.com",mobile:{universal:"https://gw.arculus.co/app"}},haha:{id:"719bd888109f5e8dd23419b20e749900ce4d2fc6858cf588395f19c82fd036b3",displayName:"HaHa",hostname:"www.haha.me",mobile:{universal:"https://haha.me"}},cling_wallet:{id:"942d0e22a7e6b520b0a03abcafc4dbe156a1fc151876e3c4a842f914277278ef",displayName:"Cling Wallet",hostname:"clingon.io",mobile:{universal:"https://cling.carrieverse.com/apple-app-site-association"}},broearn:{id:"8ff6eccefefa7506339201bc33346f92a43118d6ff7d6e71d499d8187a1c56a2",displayName:"Broearn",hostname:"www.broearn.com",mobile:{universal:"https://www.broearn.com/link/wallet/"}},copiosa:{id:"07f99a5d9849bb049d74830012b286f8b238e72b0337933ef22b84947409db80",displayName:"Copiosa",hostname:"copiosa.io",mobile:{universal:"https://copiosa.io/action/"}},burrito_wallet:{id:"8821748c25de9dbc4f72a691b25a6ddad9d7df12fa23333fd9c8b5fdc14cc819",displayName:"Burrito Wallet",hostname:"burritowallet.com",mobile:{universal:"https://burritowallet.com/wc?uri="}},enjin_wallet:{id:"bdc9433ffdaee55d31737d83b931caa1f17e30666f5b8e03eea794bac960eb4a",displayName:"Enjin Wallet",hostname:"enjin.io",mobile:{universal:"https://deeplink.wallet.enjin.io/"}},plasma_wallet:{id:"cbe13eb482c76f1fa401ff4c84d9acd0b8bc9af311ca0620a0b192fb28359b4e",displayName:"Plasma Wallet",hostname:"plasma-wallet.com",mobile:{universal:"https://plasma-wallet.com"}},avacus:{id:"94f785c0c8fb8c4f38cd9cd704416430bcaa2137f27e1468782d624bcd155a43",displayName:"Avacus",hostname:"avacus.cc",mobile:{universal:"https://avacus.app.link"}},bee:{id:"2cca8c1b0bea04ba37dee4017991d348cdb7b826804ab2bd31073254f345b715",displayName:"Bee",hostname:"www.beewallet.app",mobile:{universal:"https://beewallet.app/wc"}},pitaka:{id:"14e5d957c6eb62d3ee8fc6239703ac2d537d7e3552154836ca0beef775f630bc",displayName:"Pitaka",hostname:"pitaka.io",mobile:{universal:"https://app.pitaka.io"}},pltwallet:{id:"576c90ceaea34f29ff0104837cf2b2e23d201be43be1433feeb18d375430e1fd",displayName:"PLTwallet",hostname:"pltwallet.io",mobile:{universal:"https://pltwallet.io/"}},minerva:{id:"49bb9d698dbdf2c3d4627d66f99dd9fe90bba1eec84b143f56c64a51473c60bd",displayName:"Minerva",hostname:"minerva.digital",mobile:{universal:"https://minerva.digital"}},kryptogo:{id:"19418ecfd44963883e4d6abca1adeb2036f3b5ffb9bee0ec61f267a9641f878b",displayName:"KryptoGO",hostname:"kryptogo.com",mobile:{universal:"https://kryptogo.page.link"}},prema:{id:"5b8e33346dfb2a532748c247876db8d596734da8977905a27b947ba1e2cf465b",displayName:"PREMA",hostname:"premanft.com",mobile:{universal:"https://premanft.com"}},slingshot:{id:"d23de318f0f56038c5edb730a083216ff0cce00c1514e619ab32231cc9ec484b",displayName:"Slingshot",hostname:"slingshot.finance",mobile:{universal:"https://app.slingshot.finance"}},kriptonio:{id:"50df7da345f84e5a79aaf617df5167335a4b6751626df2e8a38f07029b3dde7b",displayName:"Kriptonio",hostname:"kriptonio.com",mobile:{universal:"https://app.kriptonio.com/mobile"}},timeless:{id:"9751385960bca290c13b443155288f892f62ee920337eda8c5a8874135daaea8",displayName:"Timeless",hostname:"timelesswallet.xyz",mobile:{universal:"https://timelesswallet.xyz"}},secux:{id:"6464873279d46030c0b6b005b33da6be5ed57a752be3ef1f857dc10eaf8028aa",displayName:"SecuX",hostname:"secuxtech.com",mobile:{universal:"https://wsweb.secuxtech.com"}},bitizen:{id:"41f20106359ff63cf732adf1f7dc1a157176c9b02fd266b50da6dcc1e9b86071",displayName:"Bitizen",hostname:"bitizen.org",mobile:{universal:"https://bitizen.org/wallet"}},blocto:{id:"14e7176536cb3706e221daaa3cfd7b88b7da8c7dfb64d1d241044164802c6bdd",displayName:"Blocto",hostname:"blocto.io",mobile:{universal:"https://blocto.app"}},safemoon:{id:"a0e04f1086aac204d4ebdd5f985c12ed226cd0006323fd8143715f9324da58d1",displayName:"SafeMoon",hostname:"safemoon.com",mobile:{universal:"https://safemoon.com/wc"}},okx_wallet:{id:"971e689d0a5be527bac79629b4ee9b925e82208e5168b733496a09c0faed0709",displayName:"OKX Wallet",hostname:"okx.com",mobile:{native:"okex://main"}},rabby_wallet:{id:"18388be9ac2d02726dbac9777c96efaac06d744b2f6d580fccdd4127a6d01fd1",displayName:"Rabby Wallet",hostname:"rabby.io",mobile:{}}};function tT(e){return{name:e.displayName||"",universalLink:e.mobile.universal,deepLink:e.mobile.native}}var tP="WALLETCONNECT_DEEPLINK_CHOICE";function tN(e){return e.startsWith("http://")||e.startsWith("https://")}function tR(e,t){if(tN(e))return tM(e,t);let r=e;r.includes("://")||(r=e.replaceAll("/","").replaceAll(":",""),r=`${r}://`),r.endsWith("/")||(r=`${r}/`);let n=encodeURIComponent(t);return{redirect:`${r}wc?uri=${n}`,href:r}}function tM(e,t){if(!tN(e))return tR(e,t);let r=e;r.endsWith("/")||(r=`${r}/`);let n=encodeURIComponent(t);return{redirect:`${r}wc?uri=${n}`,href:r}}function tO(e,t){window.open(e,t,"noreferrer noopener")}var tI=class{constructor(e){this.promise=null,this.fn=e}execute(e){return null===this.promise&&(this.promise=(async()=>{try{return await this.fn(e)}finally{this.promise=null}})()),this.promise}},tW=class{constructor(e){this._meta={},this.captchaToken=e,this.startChannelOnce=new tI(this._startChannelOnce.bind(this)),this.pollForReady=new tI(this._pollForReady.bind(this))}get meta(){return this._meta}async authenticate(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.channelToken)throw new eK("Auth flow must be initialized first");try{let e=await this.api.post("/api/v1/farcaster/authenticate",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid});if(!e)throw new eK("No response from authentication");return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw eX(e)}}async link(){if(!this.api)throw new eK("Auth flow has no API instance");try{return await this.api.post("/api/v1/farcaster/link",{channel_token:this.meta.channelToken,message:this.message,signature:this.signature,fid:this.fid})}catch(e){throw eX(e)}}async _startChannelOnce(){if(!this.api)throw new eK("Auth flow has no API instance");let e=await this.api.post("/api/v1/farcaster/init",{token:this.captchaToken});s.tq&&!s.gn&&e.connect_uri&&tO(e.connect_uri,"_blank"),this._meta={connectUri:e.connect_uri,channelToken:e.channel_token}}async initializeFarcasterConnect(){if(!this.api)throw new eK("Auth flow has no API instance");await this.startChannelOnce.execute()}async _pollForReady(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.channelToken)throw new eK("Auth flow must be initialized first");let e=await this.api.get("/api/v1/farcaster/status",{headers:{"farcaster-channel-token":this.meta.channelToken}});return"completed"===e.state&&(this.message=e.message,this.signature=e.signature,this.fid=e.fid,!0)}},tL="https://auth.privy.io",tF="privy:token",tU="privy-token",tD="privy:refresh_token",tZ="privy:id_token",tz="privy-id-token",t$="privy-session",tH="privy:session_transfer_token",tB="privy:caid",tq=e=>`privy:guest:${e}`,tV=e=>`privy:cross-app:${e}`,tG="privy:state_code",tK="privy:code_verifier",tY="privy:headless_oauth",tQ=e=>`privy:wallet:${e}`,tX="privy:connectors",tJ="privy:connections",t0=1;async function t1(e){let t=new TextEncoder().encode(e);return new Uint8Array(await crypto.subtle.digest("SHA-256",t))}function t2(e){return crypto.getRandomValues(new Uint8Array(e))}var t3=class{constructor(e){this.meta={guestCredential:this.getOrCreateGuestCredential(e)}}getOrCreateGuestCredential(e){let t=tq(e);if(ta()){if(to.get(t))return to.get(t);{let e=p.c(t2(32));return to.put(t,e),e}}return p.c(t2(32))}async authenticate(){if(!this.api)throw new eK("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/guest/authenticate",{guest_credential:this.meta.guestCredential});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw eX(e)}}async link(){throw Error("Linking is not supported for the guest flow")}};function t4(){return p.c(t2(36))}async function t5(e,t="S256"){if("S256"!=t)return e;{let t=await t1(e);return p.c(t)}}function t6(){return!!to.get(tY)}var t7=class{constructor(e){let t="boolean"==typeof e.headless?e.headless:t6();this.meta={...e,headless:t}}addCaptchaToken(e){this.meta.captchaToken=e}isActive(){return!!(this.meta.authorizationCode&&this.meta.stateCode&&this.meta.provider)}async authenticate(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new eK("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenticate.");if("undefined"===this.meta.authorizationCode)throw new eK("User denied confirmation during OAuth flow");let e=function(){let e=to.get(tK);if(!e)throw new eK("Authentication error.");return e}();try{let t=await this.api.post("/api/v1/oauth/authenticate",{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return to.del(tK),this.meta.headless&&to.del(tY),{user:t.user,token:t.token,refresh_token:t.refresh_token,identity_token:t.identity_token,is_new_user:t.is_new_user,oauth_tokens:t.oauth_tokens}}catch(t){let e=eX(t);throw e.privyErrorCode?new eK(e.message||"Invalid code during OAuth flow.",void 0,e.privyErrorCode):"User denied confirmation during OAuth flow"===e.message?new eK("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new eK("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}async link(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.authorizationCode||!this.meta.stateCode)throw new eK("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling link.");if("undefined"===this.meta.authorizationCode)throw new eK("User denied confirmation during OAuth flow");let e=to.get(tK);if(!e)throw new eK("Authentication error.");try{let t=await this.api.post(e8,{authorization_code:this.meta.authorizationCode,state_code:this.meta.stateCode,code_verifier:e});return to.del(tK),t}catch(e){throw eX(e)}}async getAuthorizationUrl(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.provider)throw new eK("Provider must be set when initializing OAuth authentication.");let e=t4();to.put(tK,e);let t=t4();to.put(tG,t);let r=await t5(e);this.meta.headless&&to.put(tY,!0);try{return await this.api.post(e7,{provider:this.meta.provider,redirect_to:window.location.href,token:this.meta.captchaToken,code_challenge:r,state_code:t})}catch(e){throw eX(e)}}},t8=({style:e,...t})=>(0,m.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 24 24",style:{height:"24px",...e},...t,children:[(0,m.jsx)("path",{d:"M17.0722 11.6888C17.0471 8.90571 19.3263 7.56847 19.429 7.50274C18.1466 5.60938 16.153 5.35154 15.4417 5.3212C13.7461 5.14678 12.1306 6.32982 11.269 6.32982C10.4074 6.32982 9.08004 5.34648 7.67246 5.37429C5.82158 5.40209 4.11595 6.45874 3.16171 8.13218C1.24068 11.4942 2.6708 16.4817 4.54423 19.2143C5.46091 20.549 6.55041 22.0531 7.98554 21.9975C9.36803 21.9419 9.88905 21.095 11.5571 21.095C13.2251 21.095 13.696 21.9975 15.1537 21.9697C16.6389 21.9393 17.5806 20.6046 18.4897 19.2648C19.5392 17.7153 19.9725 16.2137 19.9975 16.1354C19.965 16.1228 17.1022 15.0155 17.0722 11.6888Z",fill:"currentColor"}),(0,m.jsx)("path",{d:"M14.3295 3.51373C15.0909 2.58347 15.6043 1.28921 15.4641 0C14.3671 0.0455014 13.0396 0.738135 12.2532 1.66838C11.5494 2.48994 10.9307 3.80695 11.0986 5.07089C12.3183 5.16694 13.5681 4.44145 14.3295 3.51373Z",fill:"currentColor"})]}),t9=({style:e,...t})=>(0,m.jsxs)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"0px",y:"0px",viewBox:"0 0 71 55",style:{height:"24px",...e},...t,children:[(0,m.jsx)("g",{clipPath:"url(#clip0)",children:(0,m.jsx)("path",{d:"M60.1045 4.8978C55.5792 2.8214 50.7265 1.2916 45.6527 0.41542C45.5603 0.39851 45.468 0.440769 45.4204 0.525289C44.7963 1.6353 44.105 3.0834 43.6209 4.2216C38.1637 3.4046 32.7345 3.4046 27.3892 4.2216C26.905 3.0581 26.1886 1.6353 25.5617 0.525289C25.5141 0.443589 25.4218 0.40133 25.3294 0.41542C20.2584 1.2888 15.4057 2.8186 10.8776 4.8978C10.8384 4.9147 10.8048 4.9429 10.7825 4.9795C1.57795 18.7309 -0.943561 32.1443 0.293408 45.3914C0.299005 45.4562 0.335386 45.5182 0.385761 45.5576C6.45866 50.0174 12.3413 52.7249 18.1147 54.5195C18.2071 54.5477 18.305 54.5139 18.3638 54.4378C19.7295 52.5728 20.9469 50.6063 21.9907 48.5383C22.0523 48.4172 21.9935 48.2735 21.8676 48.2256C19.9366 47.4931 18.0979 46.6 16.3292 45.5858C16.1893 45.5041 16.1781 45.304 16.3068 45.2082C16.679 44.9293 17.0513 44.6391 17.4067 44.3461C17.471 44.2926 17.5606 44.2813 17.6362 44.3151C29.2558 49.6202 41.8354 49.6202 53.3179 44.3151C53.3935 44.2785 53.4831 44.2898 53.5502 44.3433C53.9057 44.6363 54.2779 44.9293 54.6529 45.2082C54.7816 45.304 54.7732 45.5041 54.6333 45.5858C52.8646 46.6197 51.0259 47.4931 49.0921 48.2228C48.9662 48.2707 48.9102 48.4172 48.9718 48.5383C50.038 50.6034 51.2554 52.5699 52.5959 54.435C52.6519 54.5139 52.7526 54.5477 52.845 54.5195C58.6464 52.7249 64.529 50.0174 70.6019 45.5576C70.6551 45.5182 70.6887 45.459 70.6943 45.3942C72.1747 30.0791 68.2147 16.7757 60.1968 4.9823C60.1772 4.9429 60.1437 4.9147 60.1045 4.8978ZM23.7259 37.3253C20.2276 37.3253 17.3451 34.1136 17.3451 30.1693C17.3451 26.225 20.1717 23.0133 23.7259 23.0133C27.308 23.0133 30.1626 26.2532 30.1066 30.1693C30.1066 34.1136 27.28 37.3253 23.7259 37.3253ZM47.3178 37.3253C43.8196 37.3253 40.9371 34.1136 40.9371 30.1693C40.9371 26.225 43.7636 23.0133 47.3178 23.0133C50.9 23.0133 53.7545 26.2532 53.6986 30.1693C53.6986 34.1136 50.9 37.3253 47.3178 37.3253Z",fill:"#5865F2"})}),(0,m.jsx)("defs",{children:(0,m.jsx)("clipPath",{id:"clip0",children:(0,m.jsx)("rect",{width:"71",height:"55",fill:"white"})})})]}),re=({style:e,...t})=>(0,m.jsx)("svg",{version:"1.1",xmlns:"http://www.w3.org/2000/svg",x:"24",y:"24",viewBox:"0 0 98 96",style:{height:"24px",...e},...t,children:(0,m.jsx)("path",{d:"M48.854 0C21.839 0 0 22 0 49.217c0 21.756 13.993 40.172 33.405 46.69 2.427.49 3.316-1.059 3.316-2.362 0-1.141-.08-5.052-.08-9.127-13.59 2.934-16.42-5.867-16.42-5.867-2.184-5.704-5.42-7.17-5.42-7.17-4.448-3.015.324-3.015.324-3.015 4.934.326 7.523 5.052 7.523 5.052 4.367 7.496 11.404 5.378 14.235 4.074.404-3.178 1.699-5.378 3.074-6.6-10.839-1.141-22.243-5.378-22.243-24.283 0-5.378 1.94-9.778 5.014-13.2-.485-1.222-2.184-6.275.486-13.038 0 0 4.125-1.304 13.426 5.052a46.97 46.97 0 0 1 12.214-1.63c4.125 0 8.33.571 12.213 1.63 9.302-6.356 13.427-5.052 13.427-5.052 2.67 6.763.97 11.816.485 13.038 3.155 3.422 5.015 7.822 5.015 13.2 0 18.905-11.404 23.06-22.324 24.283 1.78 1.548 3.316 4.481 3.316 9.126 0 6.6-.08 11.897-.08 13.526 0 1.304.89 2.853 3.316 2.364 19.412-6.52 33.405-24.935 33.405-46.691C97.707 22 75.788 0 48.854 0z",fill:"currentColor"})}),rt=({style:e})=>(0,m.jsx)(g.Z,{style:{color:"var(--privy-color-error)",...e}}),rr=({style:e,...t})=>(0,m.jsxs)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,m.jsx)("path",{d:"M22.56 12.25C22.56 11.47 22.49 10.72 22.36 10H12V14.255H17.92C17.665 15.63 16.89 16.795 15.725 17.575V20.335H19.28C21.36 18.42 22.56 15.6 22.56 12.25Z",fill:"#4285F4"}),(0,m.jsx)("path",{d:"M12 23C14.97 23 17.46 22.015 19.28 20.335L15.725 17.575C14.74 18.235 13.48 18.625 12 18.625C9.13504 18.625 6.71004 16.69 5.84504 14.09H2.17004V16.94C3.98004 20.535 7.70004 23 12 23Z",fill:"#34A853"}),(0,m.jsx)("path",{d:"M5.845 14.09C5.625 13.43 5.5 12.725 5.5 12C5.5 11.275 5.625 10.57 5.845 9.91V7.06H2.17C1.4 8.59286 0.999321 10.2846 1 12C1 13.775 1.425 15.455 2.17 16.94L5.845 14.09Z",fill:"#FBBC05"}),(0,m.jsx)("path",{d:"M12 5.375C13.615 5.375 15.065 5.93 16.205 7.02L19.36 3.865C17.455 2.09 14.965 1 12 1C7.70004 1 3.98004 3.465 2.17004 7.06L5.84504 9.91C6.71004 7.31 9.13504 5.375 12 5.375Z",fill:"#EA4335"})]});function rn(e){return(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",width:26,height:26,viewBox:"0 0 140 140",x:"0px",y:"0px",fill:"none",...e,children:[(0,m.jsxs)("defs",{children:[(0,m.jsxs)("linearGradient",{id:"b",children:[(0,m.jsx)("stop",{offset:"0",stopColor:"#3771c8"}),(0,m.jsx)("stop",{stopColor:"#3771c8",offset:".128"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#60f",stopOpacity:"0"})]}),(0,m.jsxs)("linearGradient",{id:"a",children:[(0,m.jsx)("stop",{offset:"0",stopColor:"#fd5"}),(0,m.jsx)("stop",{offset:".1",stopColor:"#fd5"}),(0,m.jsx)("stop",{offset:".5",stopColor:"#ff543e"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#c837ab"})]}),(0,m.jsx)("radialGradient",{id:"c",cx:"158.429",cy:"578.088",r:"65",xlinkHref:"#a",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(0 -1.98198 1.8439 0 -1031.402 454.004)",fx:"158.429",fy:"578.088"}),(0,m.jsx)("radialGradient",{id:"d",cx:"147.694",cy:"473.455",r:"65",xlinkHref:"#b",gradientUnits:"userSpaceOnUse",gradientTransform:"matrix(.17394 .86872 -3.5818 .71718 1648.348 -458.493)",fx:"147.694",fy:"473.455"})]}),(0,m.jsx)("path",{fill:"url(#c)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,m.jsx)("path",{fill:"url(#d)",d:"M65.03 0C37.888 0 29.95.028 28.407.156c-5.57.463-9.036 1.34-12.812 3.22-2.91 1.445-5.205 3.12-7.47 5.468C4 13.126 1.5 18.394.595 24.656c-.44 3.04-.568 3.66-.594 19.188-.01 5.176 0 11.988 0 21.125 0 27.12.03 35.05.16 36.59.45 5.42 1.3 8.83 3.1 12.56 3.44 7.14 10.01 12.5 17.75 14.5 2.68.69 5.64 1.07 9.44 1.25 1.61.07 18.02.12 34.44.12 16.42 0 32.84-.02 34.41-.1 4.4-.207 6.955-.55 9.78-1.28 7.79-2.01 14.24-7.29 17.75-14.53 1.765-3.64 2.66-7.18 3.065-12.317.088-1.12.125-18.977.125-36.81 0-17.836-.04-35.66-.128-36.78-.41-5.22-1.305-8.73-3.127-12.44-1.495-3.037-3.155-5.305-5.565-7.624C116.9 4 111.64 1.5 105.372.596 102.335.157 101.73.027 86.19 0H65.03z",transform:"translate(1.004 1)"}),(0,m.jsx)("path",{fill:"#fff",d:"M66.004 18c-13.036 0-14.672.057-19.792.29-5.11.234-8.598 1.043-11.65 2.23-3.157 1.226-5.835 2.866-8.503 5.535-2.67 2.668-4.31 5.346-5.54 8.502-1.19 3.053-2 6.542-2.23 11.65C18.06 51.327 18 52.964 18 66s.058 14.667.29 19.787c.235 5.11 1.044 8.598 2.23 11.65 1.227 3.157 2.867 5.835 5.536 8.503 2.667 2.67 5.345 4.314 8.5 5.54 3.054 1.187 6.543 1.996 11.652 2.23 5.12.233 6.755.29 19.79.29 13.037 0 14.668-.057 19.788-.29 5.11-.234 8.602-1.043 11.656-2.23 3.156-1.226 5.83-2.87 8.497-5.54 2.67-2.668 4.31-5.346 5.54-8.502 1.18-3.053 1.99-6.542 2.23-11.65.23-5.12.29-6.752.29-19.788 0-13.036-.06-14.672-.29-19.792-.24-5.11-1.05-8.598-2.23-11.65-1.23-3.157-2.87-5.835-5.54-8.503-2.67-2.67-5.34-4.31-8.5-5.535-3.06-1.187-6.55-1.996-11.66-2.23-5.12-.233-6.75-.29-19.79-.29zm-4.306 8.65c1.278-.002 2.704 0 4.306 0 12.816 0 14.335.046 19.396.276 4.68.214 7.22.996 8.912 1.653 2.24.87 3.837 1.91 5.516 3.59 1.68 1.68 2.72 3.28 3.592 5.52.657 1.69 1.44 4.23 1.653 8.91.23 5.06.28 6.58.28 19.39s-.05 14.33-.28 19.39c-.214 4.68-.996 7.22-1.653 8.91-.87 2.24-1.912 3.835-3.592 5.514-1.68 1.68-3.275 2.72-5.516 3.59-1.69.66-4.232 1.44-8.912 1.654-5.06.23-6.58.28-19.396.28-12.817 0-14.336-.05-19.396-.28-4.68-.216-7.22-.998-8.913-1.655-2.24-.87-3.84-1.91-5.52-3.59-1.68-1.68-2.72-3.276-3.592-5.517-.657-1.69-1.44-4.23-1.653-8.91-.23-5.06-.276-6.58-.276-19.398s.046-14.33.276-19.39c.214-4.68.996-7.22 1.653-8.912.87-2.24 1.912-3.84 3.592-5.52 1.68-1.68 3.28-2.72 5.52-3.592 1.692-.66 4.233-1.44 8.913-1.655 4.428-.2 6.144-.26 15.09-.27zm29.928 7.97c-3.18 0-5.76 2.577-5.76 5.758 0 3.18 2.58 5.76 5.76 5.76 3.18 0 5.76-2.58 5.76-5.76 0-3.18-2.58-5.76-5.76-5.76zm-25.622 6.73c-13.613 0-24.65 11.037-24.65 24.65 0 13.613 11.037 24.645 24.65 24.645C79.617 90.645 90.65 79.613 90.65 66S79.616 41.35 66.003 41.35zm0 8.65c8.836 0 16 7.163 16 16 0 8.836-7.164 16-16 16-8.837 0-16-7.164-16-16 0-8.837 7.163-16 16-16z"})]})}function ri({style:e,...t}){return(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0,0,256,256",style:{height:"26px",width:"26px",...e},...t,children:(0,m.jsx)("g",{fill:"#0077b5",strokeWidth:"1",strokeLinecap:"butt",strokeLinejoin:"miter",strokeMiterlimit:"10",style:{mixBlendMode:"normal"},children:(0,m.jsx)("g",{transform:"scale(5.12,5.12)",children:(0,m.jsx)("path",{d:"M41,4h-32c-2.76,0 -5,2.24 -5,5v32c0,2.76 2.24,5 5,5h32c2.76,0 5,-2.24 5,-5v-32c0,-2.76 -2.24,-5 -5,-5zM17,20v19h-6v-19zM11,14.47c0,-1.4 1.2,-2.47 3,-2.47c1.8,0 2.93,1.07 3,2.47c0,1.4 -1.12,2.53 -3,2.53c-1.8,0 -3,-1.13 -3,-2.53zM39,39h-6c0,0 0,-9.26 0,-10c0,-2 -1,-4 -3.5,-4.04h-0.08c-2.42,0 -3.42,2.06 -3.42,4.04c0,0.91 0,10 0,10h-6v-19h6v2.56c0,0 1.93,-2.56 5.81,-2.56c3.97,0 7.19,2.73 7.19,8.26z"})})})})}function ra(e){return(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 496 512",...e,children:[(0,m.jsx)("path",{fill:"#1ed760",d:"M248 8C111.1 8 0 119.1 0 256s111.1 248 248 248 248-111.1 248-248S384.9 8 248 8Z"}),(0,m.jsx)("path",{d:"M406.6 231.1c-5.2 0-8.4-1.3-12.9-3.9-71.2-42.5-198.5-52.7-280.9-29.7-3.6 1-8.1 2.6-12.9 2.6-13.2 0-23.3-10.3-23.3-23.6 0-13.6 8.4-21.3 17.4-23.9 35.2-10.3 74.6-15.2 117.5-15.2 73 0 149.5 15.2 205.4 47.8 7.8 4.5 12.9 10.7 12.9 22.6 0 13.6-11 23.3-23.2 23.3zm-31 76.2c-5.2 0-8.7-2.3-12.3-4.2-62.5-37-155.7-51.9-238.6-29.4-4.8 1.3-7.4 2.6-11.9 2.6-10.7 0-19.4-8.7-19.4-19.4s5.2-17.8 15.5-20.7c27.8-7.8 56.2-13.6 97.8-13.6 64.9 0 127.6 16.1 177 45.5 8.1 4.8 11.3 11 11.3 19.7-.1 10.8-8.5 19.5-19.4 19.5zm-26.9 65.6c-4.2 0-6.8-1.3-10.7-3.6-62.4-37.6-135-39.2-206.7-24.5-3.9 1-9 2.6-11.9 2.6-9.7 0-15.8-7.7-15.8-15.8 0-10.3 6.1-15.2 13.6-16.8 81.9-18.1 165.6-16.5 237 26.2 6.1 3.9 9.7 7.4 9.7 16.5s-7.1 15.4-15.2 15.4z"})]})}function ro(e){return(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fillRule:"evenodd",clipRule:"evenodd",imageRendering:"optimizeQuality",shapeRendering:"geometricPrecision",textRendering:"geometricPrecision",viewBox:"0 0 293768 333327",width:24,height:24,...e,children:[(0,m.jsx)("path",{fill:"#26f4ee",d:"M204958 0c5369 45832 32829 78170 77253 81022v43471l-287 27V87593c-44424-2850-69965-30183-75333-76015l-47060-1v192819c6791 86790-60835 89368-86703 56462 30342 18977 79608 6642 73766-68039V0h58365zM78515 319644c-26591-5471-50770-21358-64969-44588-34496-56437-3401-148418 96651-157884v54345l-164 27v-40773C17274 145544 7961 245185 33650 286633c9906 15984 26169 27227 44864 33011z"}),(0,m.jsx)("path",{fill:"#fb2c53",d:"M218434 11587c3505 29920 15609 55386 35948 70259-27522-10602-43651-34934-47791-70262l11843 3zm63489 82463c3786 804 7734 1348 11844 1611v51530c-25770 2537-48321-5946-74600-21749l4034 88251c0 28460 106 41467-15166 67648-34260 58734-95927 63376-137628 35401 54529 22502 137077-4810 136916-103049v-96320c26279 15803 48830 24286 74600 21748V94050zm-171890 37247c5390-1122 11048-1985 16998-2548v54345c-21666 3569-35427 10222-41862 22528-20267 38754 5827 69491 35017 74111-33931 5638-73721-28750-49999-74111 6434-12304 18180-18959 39846-22528v-51797zm64479-119719h1808-1808z"}),(0,m.jsx)("path",{d:"M206590 11578c5369 45832 30910 73164 75333 76015v51528c-25770 2539-48321-5945-74600-21748v96320c206 125717-135035 135283-173673 72939-25688-41449-16376-141089 76383-155862v52323c-21666 3569-33412 10224-39846 22528-39762 76035 98926 121273 89342-1225V11577l47060 1z",fill:"#000000"})]})}var rs=({style:e,...t})=>(0,m.jsx)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",width:"24px",...e},...t,children:(0,m.jsx)("path",{d:"M 14.285156 10.171875 L 23.222656 0 L 21.105469 0 L 13.34375 8.832031 L 7.148438 0 L 0 0 L 9.371094 13.355469 L 0 24.019531 L 2.117188 24.019531 L 10.308594 14.691406 L 16.851562 24.019531 L 24 24.019531 M 2.878906 1.5625 L 6.132812 1.5625 L 21.101562 22.535156 L 17.851562 22.535156",fill:"currentColor"})}),rl={google:{name:"Google",component:rr},discord:{name:"Discord",component:t9},github:{name:"Github",component:re},linkedin:{name:"LinkedIn",component:ri},twitter:{name:"Twitter",component:rs},spotify:{name:"Spotify",component:ra},instagram:{name:"Instagram",component:rn},tiktok:{name:"Tiktok",component:ro},apple:{name:"Apple",component:t8}},rc=e=>e in rl?rl[e]:{name:"Unknown",component:rt};function rd(){let e=new URL(window.location.href);e.searchParams.delete("privy_oauth_code"),e.searchParams.delete("privy_oauth_provider"),e.searchParams.delete("privy_oauth_state"),to.del(tG),window.history.replaceState({},"",e)}var rh=class{constructor(e){this.initAuthenticateOnce=new tI(this._initAuthenticateOnce.bind(this)),this.initLinkOnce=new tI(this._initLinkOnce.bind(this)),this.meta={captchaToken:e}}async initAuthenticationFlow(){if(!this.api)throw new eK("Auth flow has no API instance");this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute()}async initLinkFlow(){if(!this.api)throw new eK("Auth flow has no API instance");this.meta.initLinkResponse=await this.initLinkOnce.execute()}async authenticate(){let e=await r.e(550).then(r.bind(r,74550));if(!this.api)throw new eK("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new eK("WebAuthn is not supported in this browser");this.meta.initAuthenticateResponse||(this.meta.initAuthenticateResponse=await this.initAuthenticateOnce.execute());try{let t=await e.startAuthentication(this._transformInitAuthenticateOptionsToCamelCase(this.meta.initAuthenticateResponse.options)),r=await this.api.post("/api/v1/passkeys/authenticate",{relying_party:this.meta.initAuthenticateResponse.relying_party,challenge:this.meta.initAuthenticateResponse.options.challenge,authenticator_response:this._transformAuthenticationResponseToSnakeCase(t)});return{user:r.user,token:r.token,refresh_token:r.refresh_token,is_new_user:r.is_new_user}}catch(e){throw"NotAllowedError"===e.name?new eK("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):eX(e)}}async link(){let e=await r.e(550).then(r.bind(r,74550));if(!this.api)throw new eK("Auth flow has no API instance");if(!e.browserSupportsWebAuthn())throw new eK("WebAuthn is not supported in this browser");this.meta.initLinkResponse||(this.meta.initLinkResponse=await this.initLinkOnce.execute());try{let t=this.meta.initLinkResponse.options,r=await e.startRegistration(this._transformInitLinkOptionsToCamelCase(t));return await this.api.post("/api/v1/passkeys/link",{relying_party:this.meta.initLinkResponse.relying_party,authenticator_response:this._transformRegistrationResponseToSnakeCase(r)})}catch(e){throw"NotAllowedError"===e.name?new eK("Passkey request timed out or rejected by user.",void 0,"passkey_not_allowed"):eX(e)}}async _initAuthenticateOnce(){if(!this.api)throw new eK("Auth flow has no API instance");return await this.api.post("/api/v1/passkeys/authenticate/init",{token:this.meta.captchaToken})}async _initLinkOnce(){if(!this.api)throw new eK("Auth flow has no API instance");return await this.api.post("/api/v1/passkeys/link/init",{})}_transformInitLinkOptionsToCamelCase(e){return{rp:e.rp,user:{id:e.user.id,name:e.user.name,displayName:e.user.display_name},challenge:e.challenge,pubKeyCredParams:e.pub_key_cred_params.map(e=>({type:e.type,alg:e.alg})),timeout:e.timeout,excludeCredentials:e.exclude_credentials?.map(e=>({id:e.id,type:e.type,transports:e.transports})),authenticatorSelection:{authenticatorAttachment:e.authenticator_selection?.authenticator_attachment,requireResidentKey:e.authenticator_selection?.require_resident_key,residentKey:e.authenticator_selection?.resident_key,userVerification:e.authenticator_selection?.user_verification},attestation:e.attestation,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props?.rk,hmacCreateSecret:e.extensions?.hmac_create_secret}}}_transformRegistrationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,attestation_object:e.response.attestationObject,authenticator_data:e.response.authenticatorData},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}_transformInitAuthenticateOptionsToCamelCase(e){return{challenge:e.challenge,allowCredentials:e.allow_credentials?.map(e=>({id:e.id,type:e.type,transports:e.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}}_transformAuthenticationResponseToSnakeCase(e){return{id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type}}},ru=({address:e,chainId:t,nonce:r})=>{let n=window.location.host,i=window.location.origin,a=new Date().toISOString();return`${n} wants you to sign in with your Ethereum account: ${e} By signing, you are proving you own this wallet and logging in. This does not initiate a transaction or cost any fees. URI: ${i} Version: 1 Chain ID: ${t} Nonce: ${r} Issued At: ${a} Resources: - https://privy.io`},rp=class{constructor(e,t,r){this.getNonceOnce=new tI(this._getNonceOnce.bind(this)),this.wallet=e,this.captchaToken=r,this.client=t}get meta(){return{connectorType:this.wallet.connectorType,walletClientType:this.wallet.walletClientType}}async authenticate(){if(!this.client)throw new eK("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign(),r=await this.client.authenticateWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType});return{user:r.user,token:r.token,refresh_token:r.refresh_token,identity_token:r.identity_token,is_new_user:r.is_new_user}}catch(e){throw eX(e)}}async link(){if(!this.client)throw new eK("SiweFlow has no client instance");try{let{message:e,signature:t}=await this.sign();return await this.client.linkWithSiweInternal({message:e,signature:t,chainId:this.wallet.chainId,walletClientType:this.wallet.walletClientType,connectorType:this.wallet.connectorType})}catch(e){throw eX(e)}}async sign(){if(!this.client)throw new eK("SiweFlow has no client instance");if(await this.buildSiweMessage(),!this.preparedMessage)throw new eK("Could not prepare SIWE message");let e=await this.wallet.sign(this.preparedMessage);return{message:this.preparedMessage,signature:e}}async _getNonceOnce(){if(!this.client)throw new eK("SiweFlow has no client instance");return await this.client.generateSiweNonce({address:this.wallet.address,captchaToken:this.captchaToken})}async buildSiweMessage(){if(!this.client)throw new eK("SiweFlow has no client instance");let e=this.wallet.address,t=this.wallet.chainId.replace("eip155:","");return this.nonce||(this.nonce=await this.getNonceOnce.execute()),this.preparedMessage=ru({address:e,chainId:t,nonce:this.nonce}),this.preparedMessage}},rm=class{constructor(e,t){this.meta={phoneNumber:e,captchaToken:t}}async authenticate(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new eK("phone number and sms code must be set prior to calling authenticate.");try{let e=await this.api.post("/api/v1/passwordless_sms/authenticate",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw eX(e)}}async link(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode)throw new eK("phone number and sms code must be set prior to calling authenticate.");try{return await this.api.post("/api/v1/passwordless_sms/link",{phoneNumber:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw eX(e)}}async sendSmsCode(e,t){if(!this.api)throw new eK("Auth flow has no API instance");if(e&&(this.meta.phoneNumber=e),t&&(this.meta.captchaToken=t),!this.meta.phoneNumber)throw new eK("phone nNumber must be set when initialzing authentication.");try{return await this.api.post("/api/v1/passwordless_sms/init",{phoneNumber:this.meta.phoneNumber,token:this.meta.captchaToken})}catch(e){throw eX(e)}}},rg=class extends rm{constructor(e,t,r){super(t,r),this.meta={phoneNumber:t,captchaToken:r,oldPhoneNumber:e}}async link(){if(!this.api)throw new eK("Auth flow has no API instance");if(!this.meta.phoneNumber||!this.meta.smsCode||!this.meta.oldPhoneNumber)throw new eK("Phone number, sms code, and an old phone number must be set prior to calling update.");try{return await this.api.post("/api/v1/passwordless_sms/update",{old_phone_number:this.meta.oldPhoneNumber,new_phone_number:this.meta.phoneNumber,code:this.meta.smsCode})}catch(e){throw eX(e)}}},rf=class{constructor(e){this.meta={captchaToken:e}}async authenticate(){if(!this.api)throw new eK("Auth flow has no API instance");try{let e=await this.api.post("/api/v1/telegram/authenticate",{captcha_token:this.meta.captchaToken,telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData});return{user:e.user,token:e.token,refresh_token:e.refresh_token,identity_token:e.identity_token,is_new_user:e.is_new_user}}catch(e){throw eX(e)}}async link(){if(!this.api)throw new eK("Auth flow has no API instance");try{return await this.api.post("/api/v1/telegram/link",{telegram_auth_result:this.meta.telegramAuthResult,telegram_web_app_data:this.meta.telegramWebAppData})}catch(e){throw eX(e)}}};function ry(e){let t={detail:"",retryable:!1};return e?.privyErrorCode==="linked_to_another_user"&&(t.detail="This account has already been linked to another user."),e?.privyErrorCode==="disallowed_login_method"&&(t.detail="Login with Telegram not allowed."),e?.privyErrorCode==="invalid_data"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="cannot_link_more_of_type"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="invalid_credentials"&&(t.retryable=!0,t.detail="Something went wrong. Try again."),e?.privyErrorCode==="too_many_requests"&&(t.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("rate limit")&&(t.detail="Request limit reached for Telegram. Please wait a moment and try again."),t}function rw(){let e=new URL(window.location.href);e.searchParams.delete("id"),e.searchParams.delete("hash"),e.searchParams.delete("auth_date"),e.searchParams.delete("first_name"),e.searchParams.delete("last_name"),e.searchParams.delete("username"),e.searchParams.delete("photo_url"),window.history.replaceState({},"",e)}function rx(e){return e?new Date(1e3*e):null}function rv(e,t){return e.slice().sort((e,t)=>(t.firstVerifiedAt??t.verifiedAt).getTime()-(e.firstVerifiedAt??e.verifiedAt).getTime()).find(e=>e.type===t)}var rC=e=>e?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"ethereum"===e.chainType)||null,rb=e=>e?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&!e.imported&&"solana"===e.chainType)||null,r_=e=>e?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.imported&&"ethereum"===e.chainType)||null,rj=e=>e.linkedAccounts.filter(e=>"wallet"===e.type),rk=(e,t)=>!(rC(e)||rb(e))&&("all-users"===t||"users-without-wallets"===t&&!rj(e)?.length);function rE(e){if(!e)return null;let t=function(e){let t=[];for(let r of e){let e=r.type;switch(r.type){case"wallet":let n={address:r.address,type:r.type,imported:r.imported,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at),chainType:r.chain_type,chainId:r.chain_id,walletClient:"privy"===r.wallet_client_type?"privy":"unknown",walletClientType:r.wallet_client_type,connectorType:r.connector_type,recoveryMethod:r.recovery_method};t.push(n);break;case"cross_app":let i={type:r.type,subject:r.subject,embeddedWallets:r.embedded_wallets,smartWallets:r.smart_wallets,providerApp:{id:r.provider_app_id},verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(i);break;case"email":let a={address:r.address,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(a);break;case"phone":let o={number:r.phoneNumber,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(o);break;case"google_oauth":let s={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(s);break;case"spotify_oauth":let l={subject:r.subject,email:r.email,name:r.name,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(l);break;case"instagram_oauth":let c={subject:r.subject,username:r.username,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(c);break;case"twitter_oauth":let d={subject:r.subject,username:r.username,name:r.name,type:r.type,profilePictureUrl:r.profile_picture_url,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(d);break;case"discord_oauth":let h={subject:r.subject,username:r.username,email:r.email,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(h);break;case"github_oauth":let u={subject:r.subject,username:r.username,name:r.name,email:r.email,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(u);break;case"tiktok_oauth":let p={subject:r.subject,username:r.username,name:r.name,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(p);break;case"linkedin_oauth":let m={subject:r.subject,name:r.name,email:r.email,vanityName:r.vanity_name,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(m);break;case"apple_oauth":let g={subject:r.subject,email:r.email,type:r.type,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(g);break;case"custom_auth":t.push({type:r.type,customUserId:r.custom_user_id,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)});break;case"farcaster":let f={type:r.type,fid:r.fid,ownerAddress:r.owner_address,displayName:r.display_name,username:r.username,bio:r.bio,pfp:r.profile_picture_url,url:r.homepage_url,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at),signerPublicKey:r.signer_public_key};t.push(f);break;case"passkey":let y={type:r.type,enrolledInMfa:r.enrolled_in_mfa,credentialId:r.credential_id,authenticatorName:r.authenticator_name,createdWithDevice:r.created_with_device,createdWithOs:r.created_with_os,createdWithBrowser:r.created_with_browser,verifiedAt:rx(r.verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(y);break;case"telegram":let w={type:r.type,telegramUserId:r.telegram_user_id,firstName:r.first_name,lastName:r.last_name,username:r.username,photoUrl:r.photo_url,verifiedAt:rx(r.first_verified_at),firstVerifiedAt:rx(r.first_verified_at),latestVerifiedAt:rx(r.latest_verified_at)};t.push(w);break;default:console.warn(`Unrecognized account type: ${e}. Please consider upgrading the Privy SDK.`)}}return t}(e.linked_accounts),r=rv(t,"wallet"),n=rv(t,"email"),i=rv(t,"phone"),a=rv(t,"google_oauth"),o=rv(t,"twitter_oauth"),s=rv(t,"discord_oauth"),l=rv(t,"github_oauth"),c=rv(t,"spotify_oauth"),d=rv(t,"instagram_oauth"),h=rv(t,"tiktok_oauth"),u=rv(t,"linkedin_oauth"),p=rv(t,"apple_oauth"),m=rv(t,"farcaster"),g=rv(t,"telegram"),f=e.mfa_methods.map(({type:e,verified_at:t})=>({type:e,verifiedAt:rx(t)}));return{id:e.id,createdAt:rx(e.created_at),linkedAccounts:t,email:n&&{address:n?.address},phone:i&&{number:i?.number},wallet:r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,recoveryMethod:r.recoveryMethod,imported:r.imported},google:a&&{subject:a.subject,email:a.email,name:a.name},twitter:o&&{subject:o.subject,username:o.username,name:o.name,profilePictureUrl:o.profilePictureUrl},discord:s&&{subject:s.subject,username:s.username,email:s.email},github:l&&{subject:l.subject,username:l.username,name:l.name,email:l.email},spotify:c&&{subject:c.subject,email:c.email,name:c.name},instagram:d&&{subject:d.subject,username:d.username},tiktok:h&&{subject:h.subject,username:h.username,name:h.name},linkedin:u&&{subject:u.subject,name:u.name,email:u.email,vanityName:u.vanityName},apple:p&&{subject:p.subject,email:p.email},farcaster:m&&{fid:m.fid,ownerAddress:m.ownerAddress,displayName:m.displayName,username:m.username,bio:m.bio,pfp:m.pfp,url:m.url,signerPublicKey:m.signerPublicKey},telegram:g&&{telegramUserId:g.telegramUserId,firstName:g.firstName,lastName:g.lastName,username:g.username,photoUrl:g.photoUrl},mfaMethods:f.map(e=>e.type),hasAcceptedTerms:e.has_accepted_terms??!1,isGuest:e.is_guest}}var rA,rS,rT=({style:e,...t})=>(0,m.jsxs)("svg",{width:"1024",height:"1024",viewBox:"0 0 1024 1024",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,m.jsx)("rect",{width:"1024",height:"1024",fill:"#0052FF",rx:100,ry:100}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z",fill:"white"})]}),rP=["eth_sign","eth_populateTransactionRequest","eth_signTransaction","personal_sign","eth_signTypedData_v4"],rN=e=>rP.includes(e),rR=class extends eQ{constructor(){super("Wallet timeout"),this.type="wallet_error"}},rM=class extends eQ{constructor(){super("User rejected connection"),this.type="wallet_error"}},rO=e=>{if(e instanceof eQ)return e;if(e?.code&&e?.reason){let t=new rW(e);return e.code===v.jK.ACTION_REJECTED&&(t.details=d.M_.E4001_USER_REJECTED_REQUEST),t}return e?.code?new rW(e):new eQ("Unknown connector error",e)},rI=class extends eV{constructor(e,t,r){super(e),this.type="provider_error",this.code=t,this.data=r}},rW=class extends rI{constructor(e){super(e.message,e.code,e.data);let t=Object.values(d.M_).find(t=>t.eipCode===e.code);this.details=t||d.M_.UNKNOWN_ERROR,-32002===e.code&&(e.message?.includes("already pending for origin")?e.message?.includes("wallet_requestPermissions")?this.details=d.M_.E32002_CONNECTION_ALREADY_PENDING:this.details=d.M_.E32002_REQUEST_ALREADY_PENDING:e.message?.includes("Already processing")&&e.message.includes("eth_requestAccounts")&&(this.details=d.M_.E32002_WALLET_LOCKED))}},rL={ERROR_USER_EXISTS:{message:"User already exists for this address",detail:"Try another address!",retryable:!1},ERROR_TIMED_OUT:{message:"Wallet request timed out",detail:"Please try connecting again.",retryable:!0},ERROR_WALLET_CONNECTION:{message:"Could not log in with wallet",detail:"Please try connecting again.",retryable:!0},ERROR_USER_REJECTED_CONNECTION:{message:"You rejected the request",detail:"Please try connecting again.",retryable:!0},...d.M_},rF=class{constructor(e,t){this.removeListener=(e,t)=>{if(this.walletProvider)try{return this.walletProvider.removeListener(e,t)}catch{console.warn("Unable to remove wallet provider listener")}},this.walletTimeout=(e=new rR,t=this.rpcTimeoutDuration)=>new Promise((r,n)=>setTimeout(()=>{n(e)},t)),this.setWalletProvider=e=>{this.walletProvider&&this._subscriptions.forEach(e=>{this.removeListener(e.eventName,e.listener)}),this.walletProvider=e,this._subscriptions.forEach(e=>{this.walletProvider?.on(e.eventName,e.listener)})},this.walletProvider=e,this.rpcTimeoutDuration=t||12e4,this._subscriptions=[]}on(e,t){if(this.walletProvider)return this.walletProvider.on(e,t);this._subscriptions.push({eventName:e,listener:t})}async request(e){if(!this.walletProvider)throw new eQ(`A wallet request of type ${e.method} was made before setting a wallet provider.`);return Promise.race([this.walletProvider.request(e),this.walletTimeout()]).catch(e=>{throw rO(e)})}},rU=class extends Error{constructor(e,t,r){super(e),this.code=t,this.data=r}},rD=class extends w.Z{constructor(e,t,r,n,i,a=1){super(),this.walletProxy=e,this.address=t,this.chainId=a,this.rpcConfig=r,this.chains=n,this.provider=tk(a,this.chains,r,{appId:i}),this.rpcTimeoutDuration=nC(r,"privy"),this.appId=i}async handleSendTransaction(e){if(!e.params||!Array.isArray(e.params))throw new rU(`Invalid params for ${e.method}`,4200);let t=e.params[0];if(!await uK()||!this.address)throw new rU("Disconnected",4900);return(await u6(t)).hash}handleSwitchEthereumChain(e){let t;if(!e.params||!Array.isArray(e.params))throw new rU(`Invalid params for ${e.method}`,4200);if("string"==typeof e.params[0])t=e.params[0];else if("chainId"in e.params[0]&&"string"==typeof e.params[0].chainId)t=e.params[0].chainId;else throw new rU(`Invalid params for ${e.method}`,4200);this.chainId=Number(t),this.provider=tk(this.chainId,this.chains,this.rpcConfig,{appId:this.appId}),this.emit("chainChanged",t)}async handlePersonalSign(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for personal_sign");let t=e.params[0],r=e.params[1];return await u4(t,void 0,r)}async handleSignedTypedData(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_signTypedData_v4");let t="string"==typeof e.params[1]?JSON.parse(e.params[1]):e.params[1];return await u5(tE(t))}async handleEstimateGas(e){if(!e.params||!Array.isArray(e.params))throw Error("Invalid params for eth_estimateGas");delete e.params[0].gasPrice,delete e.params[0].maxFeePerGas,delete e.params[0].maxPriorityFeePerGas;let t={...e.params[0],chainId:tx(this.chainId)};try{return await this.provider.send("eth_estimateGas",[t])}catch(e){console.warn(`Gas estimation failed with error: ${e}. Retrying gas estimation by omitting the 'from' address`);try{return delete t.from,await this.provider.send("eth_estimateGas",[t])}catch(t){throw console.warn(`Gas estimation failed with error: ${t} when omitting the 'from' address`),e}}}async request(e){switch(console.debug("Embedded1193Provider.request() called with args",e),e.method){case"eth_accounts":case"eth_requestAccounts":return this.address?[this.address]:[];case"eth_chainId":return tx(this.chainId);case"eth_estimateGas":return this.handleEstimateGas(e);case"eth_sendTransaction":return this.handleSendTransaction(e);case"wallet_switchEthereumChain":return this.handleSwitchEthereumChain(e);case"personal_sign":return this.handlePersonalSign(e);case"eth_signTypedData_v4":return this.handleSignedTypedData(e)}if(!rN(e.method))return this.provider.send(e.method,e.params);{let t=await uK();if(await u7(),!t||!this.address)throw new rU("Disconnected",4900);try{return(await this.walletProxy.rpc({address:this.address,accessToken:t,request:{method:e.method,params:e.params}})).response.data}catch(e){throw console.error(e),new rU("Disconnected",4900)}}}async connect(){let e=await uK();if(!e||!this.address)return null;try{return(await this.walletProxy.connect({address:this.address,accessToken:e})).address}catch(e){return console.error(e),null}}},rZ=class extends rF{constructor(e){super(e,e.rpcTimeoutDuration)}},rz=class extends rF{constructor(e){super(e,e.rpcTimeoutDuration)}sendAsync(e,t){throw Error("sendAsync is no longer supported by EIP-1193. Use the request method instead.")}},r$=(e,t)=>"coinbase_wallet"===t?e.message.includes("addEthereumChain"):4902===e.code||e.message?.includes("4902"),rH=class extends w.Z{constructor(e,t,r,n){super(),this.onAccountsChanged=e=>{0===e.length?this.onDisconnect():this.syncAccounts(e)},this.onChainChanged=e=>{this.wallets.forEach(t=>{t.chainId=tC(e),"privy"===this.walletClientType&&to.put(tQ(t.address),e)}),this.emit("walletsUpdated")},this.onDisconnect=()=>{this.connected=!1,this.wallets=[],this.emit("walletsUpdated")},this.onConnect=()=>{this.connected=!0,this.syncAccounts()},this.wallets=[],this.walletClientType=e,this.chains=t,this.defaultChain=r,this.rpcConfig=n,this.rpcTimeoutDuration=nC(n,e),this.connected=!1,this.initialized=!1}buildConnectedWallet(e,t,r,a){let o=async()=>!!this.wallets.find(t=>(0,n.Kn)(t.address)===(0,n.Kn)(e));return{address:(0,n.Kn)(e),chainId:t,meta:r,imported:a,switchChain:async r=>{let i,a;if(!o)throw new eQ("Wallet is not currently connected.");let s=this.wallets.find(t=>n.Kn(t.address)===n.Kn(e))?.chainId;if(!s)throw new eQ("Unable to determine current chainId.");if("number"==typeof r?(i=`0x${r.toString(16)}`,a=r):(i=r,a=Number(r)),s===tC(i))return;let l=this.chains.find(e=>e.id===a);if(!l)throw new eQ(`Unsupported chainId: ${r}`);let c=async()=>{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:i}]})};try{return await c()}catch(e){if(r$(e,this.walletClientType))return await this.proxyProvider.request({method:"wallet_addEthereumChain",params:[{chainId:i,chainName:l.name,nativeCurrency:l.nativeCurrency,rpcUrls:[l.rpcUrls.default?.http[0]??""],blockExplorerUrls:[l.blockExplorers?.default.url??""]}]}),c();throw"rainbow"===this.walletClientType&&e.message?.includes("wallet_switchEthereumChain")?new eQ(`Rainbow does not support the chainId ${t}`):e}},connectedAt:Date.now(),walletClientType:this.walletClientType,connectorType:this.connectorType,isConnected:o,getEthereumProvider:async()=>{if(!await o())throw new eQ("Wallet is not currently connected.");return this.proxyProvider},getEthersProvider:async()=>{if(!await o())throw new eQ("Wallet is not currently connected.");return new i.Q(new rZ(this.proxyProvider))},getWeb3jsProvider:async()=>{if(!await o())throw new eQ("Wallet is not currently connected.");return new rz(this.proxyProvider)},sign:async e=>{if(!await o())throw new eQ("Wallet is not currently connected.");return await this.sign(e)},disconnect:()=>{this.disconnect()}}}async syncAccounts(e){let t=e;try{if(void 0===t){let e=await tf(()=>this.proxyProvider.request({method:"eth_accounts"}),{maxAttempts:10,delayMs:500});console.debug(`eth_accounts for ${this.walletClientType}:`,e),Array.isArray(e)&&(t=e)}}catch(e){console.warn("Wallet did not respond to eth_accounts. Defaulting to prefetched accounts.",e)}if(!t||!Array.isArray(t)||t.length<=0||!t[0])return;let r=t[0],i=(0,n.Kn)(r),a=[],o;if("privy"===this.walletClientType){let e=to.get(tQ(i));this.chains.find(t=>t.id===Number(e))||(to.del(tQ(i)),e=null),o=e||`0x${this.defaultChain.id.toString(16)}`;try{await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[{chainId:o}]})}catch{console.warn(`Unable to switch embedded wallet to chain ID ${o} on initialization`)}}else try{let e=await tf(()=>this.proxyProvider.request({method:"eth_chainId"}),{maxAttempts:10,delayMs:500});if(console.debug(`eth_chainId for ${this.walletClientType}:`,e),"string"==typeof e)o=e;else if("number"==typeof e)o=`0x${e.toString(16)}`;else throw Error("Invalid chainId returned from provider")}catch(e){console.warn("Failed to get chainId from provider, defaulting to 0x1",e),o="0x1"}let s=tC(o);if(!a.find(e=>(0,n.Kn)(e.address)===i)){let e={name:this.walletBranding.name,icon:"string"==typeof this.walletBranding.icon?this.walletBranding.icon:void 0,id:this.walletBranding.id};a.push(this.buildConnectedWallet((0,n.Kn)(r),s,e,"embedded_imported"===this.connectorType))}n_(a,this.wallets)||(this.wallets=a,this.emit("walletsUpdated"))}async getConnectedWallet(){let e=await this.proxyProvider.request({method:"eth_accounts"});return this.wallets.sort((e,t)=>t.connectedAt-e.connectedAt).find(t=>e.find(e=>(0,n.Kn)(e)===(0,n.Kn)(t.address)))||null}async isConnected(){let e=await this.proxyProvider.request({method:"eth_accounts"});return Array.isArray(e)&&e.length>0}async sign(e){return await this.connect({showPrompt:!1}),new i.Q(new rZ(this.proxyProvider)).getSigner().signMessage(e)}subscribeListeners(){this.proxyProvider.on("accountsChanged",this.onAccountsChanged),this.proxyProvider.on("chainChanged",this.onChainChanged),this.proxyProvider.on("disconnect",this.onDisconnect),this.proxyProvider.on("connect",this.onConnect)}unsubscribeListeners(){this.proxyProvider.removeListener("accountsChanged",this.onAccountsChanged),this.proxyProvider.removeListener("chainChanged",this.onChainChanged),this.proxyProvider.removeListener("disconnect",this.onDisconnect),this.proxyProvider.removeListener("connect",this.onConnect)}},rB=[1,11155111,137,10,8453,84532,42161,7777777,43114,56],rq=(e,t)=>e.makeWeb3Provider({options:t}),rV=class extends rH{constructor(e,t,r,n,i,a){if(super("coinbase_wallet",e,t,r),this.connectorType="coinbase_wallet",this.displayName="Coinbase Wallet",this.proxyProvider=new rF(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.connectionOptions=n.coinbaseWallet.connectionOptions??"all",this.walletClientType="smartWalletOnly"===this.connectionOptions?"coinbase_smart_wallet":"coinbase_wallet","coinbase_smart_wallet"===this.walletClientType&&(this.displayName="Coinbase Smart Wallet"),!rA){let r=[t.id].concat(e.map(e=>e.id)),n="eoaOnly"!==this.connectionOptions?r.filter(e=>!rB.includes(e)):[];n.length>0&&console.warn(`The following configured chains are not supported by the Coinbase Smart Wallet: ${n.join(", ")}`),rA=new x.ZP({appName:i,appLogoUrl:a,appChainIds:r})}this.proxyProvider.setWalletProvider(rq(rA,this.connectionOptions))}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}disconnect(){this.proxyProvider.walletProvider.disconnect(),this.onDisconnect()}get walletBranding(){return{name:this.displayName,icon:rT,id:"com.coinbase.wallet"}}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new eQ("Unable to retrieve accounts");this.connected=!0,await this.syncAccounts([e[0]])}catch(e){throw rO(e)}}},rG=({...e})=>(0,m.jsx)("svg",{width:"15",height:"15",viewBox:"0 0 15 15",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M2.37126 11.0323C2.37126 12.696 3.90598 13.4421 5.40654 13.4468C8.91753 13.4468 12.8021 11.2897 12.7819 7.67984C12.7673 5.07728 10.3748 2.86167 7.54357 2.88296C4.8495 2.88296 2.21821 4.6411 2.21803 7.03628C2.21803 7.67951 2.58722 8.30178 3.55231 8.37184C2.74763 9.16826 2.37126 10.1225 2.37126 11.0323ZM7.55283 8.68012C8.11562 8.68012 8.57186 8.13217 8.57186 7.45624C8.57186 6.78032 8.11562 6.23237 7.55283 6.23237C6.99003 6.23237 6.53379 6.78032 6.53379 7.45624C6.53379 8.13217 6.99003 8.68012 7.55283 8.68012ZM10.4747 8.68012C11.0375 8.68012 11.4937 8.13217 11.4937 7.45625C11.4937 6.78032 11.0375 6.23237 10.4747 6.23237C9.91186 6.23237 9.45562 6.78032 9.45562 7.45625C9.45562 8.13217 9.91186 8.68012 10.4747 8.68012Z",fill:e.color||"var(--privy-color-foreground-3)"})}),rK=class extends rH{constructor(e,t,r,n,i=!1){super("privy",t,r,n),this.connectorType="embedded",this.proxyProvider=e,i&&(this.connectorType="embedded_imported"),this.subscribeListeners()}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return await this.isConnected()?(await this.proxyProvider.request({method:"wallet_switchEthereumChain",params:[tx(e?.chainId||"0x1")]}),this.getConnectedWallet()):null}get walletBranding(){return{name:"Privy Wallet",icon:rG,id:"io.privy.wallet"}}disconnect(){this.connected=!1}async promptConnection(){}},rY=({style:e,...t})=>(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",stroke:"currentColor",strokeWidth:1.5,viewBox:"0 0 24 24",style:{...e},...t,children:(0,m.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M9 17.25v1.007a3 3 0 01-.879 2.122L7.5 21h9l-.621-.621A3 3 0 0115 18.257V17.25m6-12V15a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 15V5.25m18 0A2.25 2.25 0 0018.75 3H5.25A2.25 2.25 0 003 5.25m18 0V12a2.25 2.25 0 01-2.25 2.25H5.25A2.25 2.25 0 013 12V5.25"})}),rQ=({style:e,...t})=>(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlSpace:"preserve",x:0,y:0,viewBox:"0 0 318.6 318.6",width:"28",height:"28",style:{height:"28px",width:"28px",...e},...t,children:[(0,m.jsx)("style",{children:".s1{stroke-linecap:round;stroke-linejoin:round}.s2{fill:#e4761b;stroke:#e4761b}.s3{fill:#f6851b;stroke:#f6851b}"}),(0,m.jsx)("path",{fill:"#e2761b",stroke:"#e2761b",className:"s1",d:"m274.1 35.5-99.5 73.9L193 65.8z"}),(0,m.jsx)("path",{d:"m44.4 35.5 98.7 74.6-17.5-44.3zm193.9 171.3-26.5 40.6 56.7 15.6 16.3-55.3zm-204.4.9L50.1 263l56.7-15.6-26.5-40.6z",className:"s1 s2"}),(0,m.jsx)("path",{d:"m103.6 138.2-15.8 23.9 56.3 2.5-2-60.5zm111.3 0-39-34.8-1.3 61.2 56.2-2.5zM106.8 247.4l33.8-16.5-29.2-22.8zm71.1-16.5 33.9 16.5-4.7-39.3z",className:"s1 s2"}),(0,m.jsx)("path",{fill:"#d7c1b3",stroke:"#d7c1b3",className:"s1",d:"m211.8 247.4-33.9-16.5 2.7 22.1-.3 9.3zm-105 0 31.5 14.9-.2-9.3 2.5-22.1z"}),(0,m.jsx)("path",{fill:"#233447",stroke:"#233447",className:"s1",d:"m138.8 193.5-28.2-8.3 19.9-9.1zm40.9 0 8.3-17.4 20 9.1z"}),(0,m.jsx)("path",{fill:"#cd6116",stroke:"#cd6116",className:"s1",d:"m106.8 247.4 4.8-40.6-31.3.9zM207 206.8l4.8 40.6 26.5-39.7zm23.8-44.7-56.2 2.5 5.2 28.9 8.3-17.4 20 9.1zm-120.2 23.1 20-9.1 8.2 17.4 5.3-28.9-56.3-2.5z"}),(0,m.jsx)("path",{fill:"#e4751f",stroke:"#e4751f",className:"s1",d:"m87.8 162.1 23.6 46-.8-22.9zm120.3 23.1-1 22.9 23.7-46zm-64-20.6-5.3 28.9 6.6 34.1 1.5-44.9zm30.5 0-2.7 18 1.2 45 6.7-34.1z"}),(0,m.jsx)("path",{d:"m179.8 193.5-6.7 34.1 4.8 3.3 29.2-22.8 1-22.9zm-69.2-8.3.8 22.9 29.2 22.8 4.8-3.3-6.6-34.1z",className:"s3"}),(0,m.jsx)("path",{fill:"#c0ad9e",stroke:"#c0ad9e",className:"s1",d:"m180.3 262.3.3-9.3-2.5-2.2h-37.7l-2.3 2.2.2 9.3-31.5-14.9 11 9 22.3 15.5h38.3l22.4-15.5 11-9z"}),(0,m.jsx)("path",{fill:"#161616",stroke:"#161616",className:"s1",d:"m177.9 230.9-4.8-3.3h-27.7l-4.8 3.3-2.5 22.1 2.3-2.2h37.7l2.5 2.2z"}),(0,m.jsx)("path",{fill:"#763d16",stroke:"#763d16",className:"s1",d:"m278.3 114.2 8.5-40.8-12.7-37.9-96.2 71.4 37 31.3 52.3 15.3 11.6-13.5-5-3.6 8-7.3-6.2-4.8 8-6.1zM31.8 73.4l8.5 40.8-5.4 4 8 6.1-6.1 4.8 8 7.3-5 3.6 11.5 13.5 52.3-15.3 37-31.3-96.2-71.4z"}),(0,m.jsx)("path",{d:"m267.2 153.5-52.3-15.3 15.9 23.9-23.7 46 31.2-.4h46.5zm-163.6-15.3-52.3 15.3-17.4 54.2h46.4l31.1.4-23.6-46zm71 26.4 3.3-57.7 15.2-41.1h-67.5l15 41.1 3.5 57.7 1.2 18.2.1 44.8h27.7l.2-44.8z",className:"s3"})]}),rX=({style:e,...t})=>(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"108",height:"108",viewBox:"0 0 108 108",fill:"none",style:{height:"28px",width:"28px",...e},...t,children:[(0,m.jsx)("rect",{width:"108",height:"108",rx:"23",fill:"#AB9FF2"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M46.5267 69.9229C42.0054 76.8509 34.4292 85.6182 24.348 85.6182C19.5824 85.6182 15 83.6563 15 75.1342C15 53.4305 44.6326 19.8327 72.1268 19.8327C87.768 19.8327 94 30.6846 94 43.0079C94 58.8258 83.7355 76.9122 73.5321 76.9122C70.2939 76.9122 68.7053 75.1342 68.7053 72.314C68.7053 71.5783 68.8275 70.7812 69.0719 69.9229C65.5893 75.8699 58.8685 81.3878 52.5754 81.3878C47.993 81.3878 45.6713 78.5063 45.6713 74.4598C45.6713 72.9884 45.9768 71.4556 46.5267 69.9229ZM83.6761 42.5794C83.6761 46.1704 81.5575 47.9658 79.1875 47.9658C76.7816 47.9658 74.6989 46.1704 74.6989 42.5794C74.6989 38.9885 76.7816 37.1931 79.1875 37.1931C81.5575 37.1931 83.6761 38.9885 83.6761 42.5794ZM70.2103 42.5795C70.2103 46.1704 68.0916 47.9658 65.7216 47.9658C63.3157 47.9658 61.233 46.1704 61.233 42.5795C61.233 38.9885 63.3157 37.1931 65.7216 37.1931C68.0916 37.1931 70.2103 38.9885 70.2103 42.5795Z",fill:"#FFFDF8"})]}),rJ=class extends rH{constructor(e,t,r,n,i){super(i||"unknown",e,t,r),this.connectorType="injected",this.proxyProvider=new rF(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.providerDetail=n;let a=n.provider;this.proxyProvider.setWalletProvider(a)}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return{name:this.providerDetail.info.name,icon:this.providerDetail.info.icon,id:this.providerDetail.info.rdns}}disconnect(){console.warn(`Programmatic disconnect with ${this.providerDetail.info.name} is not yet supported.`)}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new eQ("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw rO(e)}}},r0=class extends rH{constructor(e,t,r,n,i){super(i??"unknown",e,t,r),this.connectorType="injected",eH(this,rS,void 0),this.proxyProvider=new rF(void 0,this.rpcTimeoutDuration),this.subscribeListeners(),this.proxyProvider.setWalletProvider(n),"metamask"===i?eB(this,rS,{name:"MetaMask",icon:rQ,id:"io.metamask"}):"phantom"===i&&eB(this,rS,{name:"Phantom",icon:rX,id:"phantom"})}async initialize(){await this.syncAccounts(),this.initialized=!0,this.emit("initialized")}async connect(e){return e.showPrompt&&await this.promptConnection(),await this.isConnected()?this.getConnectedWallet():null}get walletBranding(){return e$(this,rS)??{name:"Browser Extension",icon:rY,id:"extension"}}disconnect(){console.warn("Programmatic disconnect with browser wallets is not yet supported.")}async promptConnection(){try{let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new eQ("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw rO(e)}}};rS=new WeakMap;var r1=class extends rJ{disconnect(){console.warn("MetaMask does not support programmatic disconnect.")}async promptConnection(){try{s.tq||await this.proxyProvider.request({method:"wallet_requestPermissions",params:[{eth_accounts:{}}]});let e=await this.proxyProvider.request({method:"eth_requestAccounts"});if(!e||0===e.length||!e[0])throw new eQ("Unable to retrieve accounts");await this.syncAccounts([e[0]])}catch(e){throw rO(e)}}},r2=class extends rH{constructor(e,t){super(e,[],t,{}),this.connectorType="null",this.proxyProvider=new rF(void 0,12e4),this.connectorType=e}get walletBranding(){return{name:"Wallet",id:""}}async initialize(){this.initialized=!0,this.emit("initialized")}async connect(){throw Error("connect called for an uninstalled wallet via the NullConnector")}disconnect(){throw Error("disconnect called for an uninstalled wallet via the NullConnector")}promptConnection(e){throw Error(`promptConnection called for an uninstalled wallet via the NullConnector for ${e}`)}},r3=class extends r2{constructor(e){super("phantom",e)}get walletBranding(){return{name:"Phantom",icon:rX,id:"phantom"}}};function r4({src:e,...t}){return(0,m.jsx)("img",{src:e,...t,style:{display:"none"}})}var r5={appearance:{landingHeader:"Log in or sign up",theme:"light",accentColor:"#676FFF",walletList:["detected_wallets","metamask","coinbase_wallet","rainbow","wallet_connect"]},walletConnectCloudProjectId:"34357d3c125c2bcf2ce2bc3309d98715",rpcConfig:{rpcUrls:{},rpcTimeouts:{}},externalWallets:{coinbaseWallet:{connectionOptions:"all"}},captchaEnabled:!1,_render:{standalone:!1},fundingMethodConfig:{moonpay:{useSandbox:!1}}},r6=({input:e})=>{if(!e||!e.primary[0])return;let t=[e.primary[0]],r=[];for(let r of(e.primary.length>4&&console.warn("You should not specify greater than 4 login methods in `loginMethodsAndOrder.primary`"),e.primary.slice(1)))t.includes(r)?console.warn(`Duplicated login method: ${r}`):t.push(r);for(let n of e.overflow??[])t.includes(n)||r.includes(n)?console.warn(`Duplicated login method: ${n}`):r.push(n);return{primary:t,overflow:r}},r7=new Set(["coinbase_wallet","cryptocom","metamask","okx_wallet","phantom","rainbow","uniswap","zerion","wallet_connect","detected_wallets","rabby_wallet"]),r8=e=>r7.has(e),r9=(e,t,r)=>r.indexOf(e)===t,ne=({input:e,overrides:t})=>t?t.primary.concat(t.overflow??[]).filter(r8).filter(r9):e?e.filter(r8).filter(r9):r5.appearance.walletList,nt={id:1,network:"homestead",name:"Ethereum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://mainnet.rpc.privy.systems"]},alchemy:{http:["https://eth-mainnet.g.alchemy.com/v2"],webSocket:["wss://eth-mainnet.g.alchemy.com/v2"]},infura:{http:["https://mainnet.infura.io/v3"],webSocket:["wss://mainnet.infura.io/ws/v3"]},default:{http:["https://cloudflare-eth.com"]},public:{http:["https://cloudflare-eth.com"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://etherscan.io"},default:{name:"Etherscan",url:"https://etherscan.io"}}},nr=[{id:42161,name:"Arbitrum One",network:"arbitrum",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-mainnet.rpc.privy.systems"]},alchemy:{http:["https://arb-mainnet.g.alchemy.com/v2"],webSocket:["wss://arb-mainnet.g.alchemy.com/v2"]},infura:{http:["https://arbitrum-mainnet.infura.io/v3"],webSocket:["wss://arbitrum-mainnet.infura.io/ws/v3"]},default:{http:["https://arb1.arbitrum.io/rpc"]},public:{http:["https://arb1.arbitrum.io/rpc"]}},blockExplorers:{etherscan:{name:"Arbiscan",url:"https://arbiscan.io"},default:{name:"Arbiscan",url:"https://arbiscan.io"}}},{id:421613,name:"Arbitrum Goerli",network:"arbitrum-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"AGOR",decimals:18},rpcUrls:{default:{http:["https://goerli-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Arbiscan",url:"https://goerli.arbiscan.io/"}},testnet:!0},{id:421614,name:"Arbitrum Sepolia",network:"arbitrum-sepolia",nativeCurrency:{name:"Arbitrum Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://arbitrum-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia-rollup.arbitrum.io/rpc"]},public:{http:["https://sepolia-rollup.arbitrum.io/rpc"]}},blockExplorers:{default:{name:"Blockscout",url:"https://sepolia-explorer.arbitrum.io"}},testnet:!0},{id:5,network:"goerli",name:"Goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/eth_goerli"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.etherscan.io"}},testnet:!0},{id:11155111,network:"sepolia",name:"Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"SEP",decimals:18},rpcUrls:{privy:{http:["https://sepolia.rpc.privy.systems"]},alchemy:{http:["https://eth-sepolia.g.alchemy.com/v2"],webSocket:["wss://eth-sepolia.g.alchemy.com/v2"]},infura:{http:["https://sepolia.infura.io/v3"],webSocket:["wss://sepolia.infura.io/ws/v3"]},default:{http:["https://rpc.sepolia.org"]},public:{http:["https://rpc.sepolia.org"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://sepolia.etherscan.io"},default:{name:"Etherscan",url:"https://sepolia.etherscan.io"}},testnet:!0},nt,{id:10,name:"OP Mainnet",network:"optimism",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-mainnet.rpc.privy.systems"]},alchemy:{http:["https://opt-mainnet.g.alchemy.com/v2"],webSocket:["wss://opt-mainnet.g.alchemy.com/v2"]},infura:{http:["https://optimism-mainnet.infura.io/v3"],webSocket:["wss://optimism-mainnet.infura.io/ws/v3"]},default:{http:["https://mainnet.optimism.io"]},public:{http:["https://mainnet.optimism.io"]}},blockExplorers:{etherscan:{name:"Etherscan",url:"https://optimistic.etherscan.io"},default:{name:"Optimism Explorer",url:"https://explorer.optimism.io"}}},{id:420,name:"Optimism Goerli Testnet",network:"optimism-goerli",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.optimism.io"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli-optimism.etherscan.io"}},testnet:!0},{id:11155420,name:"Optimism Sepolia",network:"optimism-sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://optimism-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.optimism.io"]},public:{http:["https://sepolia.optimism.io"]},infura:{http:["https://optimism-sepolia.infura.io/v3"]}},blockExplorers:{default:{name:"Blockscout",url:"https://optimism-sepolia.blockscout.com"}},testnet:!0},{id:137,name:"Polygon Mainnet",network:"matic",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{privy:{http:["https://polygon-mainnet.rpc.privy.systems"]},alchemy:{http:["https://polygon-mainnet.g.alchemy.com/v2"],webSocket:["wss://polygon-mainnet.g.alchemy.com/v2"]},infura:{http:["https://polygon-mainnet.infura.io/v3"],webSocket:["wss://polygon-mainnet.infura.io/ws/v3"]},default:{http:["https://polygon-rpc.com"]},public:{http:["https://polygon-rpc.com"]}},blockExplorers:{etherscan:{name:"PolygonScan",url:"https://polygonscan.com"},default:{name:"PolygonScan",url:"https://polygonscan.com"}}},{id:80001,name:"Mumbai",network:"maticmum",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://matic-mumbai.chainstacklabs.com"]}},blockExplorers:{default:{name:"PolygonScan",url:"https://mumbai.polygonscan.com"}},testnet:!0},{id:42220,name:"Celo Mainnet",network:"celo",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://forno.celo.org"]},infura:{http:["https://celo-mainnet.infura.io/v3"]},public:{http:["https://forno.celo.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/mainnet"},etherscan:{name:"CeloScan",url:"https://celoscan.io"}},testnet:!1},{id:44787,name:"Celo Alfajores Testnet",network:"celo-alfajores",nativeCurrency:{decimals:18,name:"CELO",symbol:"CELO"},rpcUrls:{default:{http:["https://alfajores-forno.celo-testnet.org"]},infura:{http:["https://celo-alfajores.infura.io/v3"]},public:{http:["https://alfajores-forno.celo-testnet.org"]}},blockExplorers:{default:{name:"Celo Explorer",url:"https://explorer.celo.org/alfajores"},etherscan:{name:"CeloScan",url:"https://alfajores.celoscan.io/"}},testnet:!0},{id:314,name:"Filecoin - Mainnet",network:"filecoin-mainnet",nativeCurrency:{decimals:18,name:"filecoin",symbol:"FIL"},rpcUrls:{default:{http:["https://api.node.glif.io/rpc/v1"]},public:{http:["https://api.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filfox",url:"https://filfox.info/en"},filscan:{name:"Filscan",url:"https://filscan.io"},filscout:{name:"Filscout",url:"https://filscout.io/en"},glif:{name:"Glif",url:"https://explorer.glif.io"}}},{id:314159,name:"Filecoin - Calibration testnet",network:"filecoin-calibration",nativeCurrency:{decimals:18,name:"testnet filecoin",symbol:"tFIL"},rpcUrls:{default:{http:["https://api.calibration.node.glif.io/rpc/v1"]},public:{http:["https://api.calibration.node.glif.io/rpc/v1"]}},blockExplorers:{default:{name:"Filscan",url:"https://calibration.filscan.io"}}},{id:8453,network:"base",name:"Base",nativeCurrency:{name:"Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-mainnet.rpc.privy.systems"]},blast:{http:["https://base-mainnet.blastapi.io"],webSocket:["wss://base-mainnet.blastapi.io"]},default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{etherscan:{name:"Basescan",url:"https://basescan.org"},default:{name:"Basescan",url:"https://basescan.org"}},testnet:!0},{id:84531,network:"base-goerli",name:"Base Goerli Testnet",nativeCurrency:{name:"Goerli Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://goerli.base.org"]}},blockExplorers:{default:{name:"Basescan",url:"https://goerli.basescan.org"}},testnet:!0},{id:84532,network:"base-sepolia",name:"Base Sepolia",nativeCurrency:{name:"Sepolia Ether",symbol:"ETH",decimals:18},rpcUrls:{privy:{http:["https://base-sepolia.rpc.privy.systems"]},default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"Blockscout",url:"https://base-sepolia.blockscout.com"}},testnet:!0},{id:80085,network:"berachain-artio",name:"Berachain Artio",nativeCurrency:{name:"BERA",symbol:"BERA",decimals:18},rpcUrls:{default:{http:["https://berachain-artio.rpc.privy.systems"]},public:{http:["https://berachain-artio.rpc.privy.systems"]}},blockExplorers:{default:{name:"Beratrail",url:"https://artio.beratrail.io"}},testnet:!0},{id:42,network:"lukso",name:"LUKSO",nativeCurrency:{name:"LUKSO",symbol:"LYX",decimals:18},rpcUrls:{default:{http:["https://rpc.mainnet.lukso.network"],webSocket:["wss://ws-rpc.mainnet.lukso.network"]}},blockExplorers:{default:{name:"LUKSO Mainnet Explorer",url:"https://explorer.execution.mainnet.lukso.network"}}},{id:59144,network:"linea-mainnet",name:"Linea Mainnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]},public:{http:["https://rpc.linea.build"],webSocket:["wss://rpc.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://lineascan.build"},etherscan:{name:"Etherscan",url:"https://lineascan.build"}},testnet:!1},{id:59140,network:"linea-testnet",name:"Linea Goerli Testnet",nativeCurrency:{name:"Linea Ether",symbol:"ETH",decimals:18},rpcUrls:{infura:{http:["https://linea-goerli.infura.io/v3"],webSocket:["wss://linea-goerli.infura.io/ws/v3"]},default:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]},public:{http:["https://rpc.goerli.linea.build"],webSocket:["wss://rpc.goerli.linea.build"]}},blockExplorers:{default:{name:"Etherscan",url:"https://goerli.lineascan.build"},etherscan:{name:"Etherscan",url:"https://goerli.lineascan.build"}},testnet:!0},{id:43114,name:"Avalanche",network:"avalanche",nativeCurrency:{decimals:18,name:"Avalanche",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax.network/ext/bc/C/rpc"]},public:{http:["https://api.avax.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://snowtrace.io"},default:{name:"SnowTrace",url:"https://snowtrace.io"}}},{id:43113,name:"Avalanche Fuji",network:"avalanche-fuji",nativeCurrency:{decimals:18,name:"Avalanche Fuji",symbol:"AVAX"},rpcUrls:{default:{http:["https://api.avax-test.network/ext/bc/C/rpc"]},public:{http:["https://api.avax-test.network/ext/bc/C/rpc"]}},blockExplorers:{etherscan:{name:"SnowTrace",url:"https://testnet.snowtrace.io"},default:{name:"SnowTrace",url:"https://testnet.snowtrace.io"}},testnet:!0},{id:7777777,name:"Zora",network:"zora",nativeCurrency:{decimals:18,name:"Ether",symbol:"ETH"},rpcUrls:{default:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]},public:{http:["https://rpc.zora.energy"],webSocket:["wss://rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://explorer.zora.energy"}}},{id:999,name:"Zora Goerli Testnet",network:"zora-testnet",nativeCurrency:{decimals:18,name:"Zora Goerli",symbol:"ETH"},rpcUrls:{default:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]},public:{http:["https://testnet.rpc.zora.energy"],webSocket:["wss://testnet.rpc.zora.energy"]}},blockExplorers:{default:{name:"Explorer",url:"https://testnet.explorer.zora.energy"}},testnet:!0},{id:999999999,name:"Zora Sepolia",network:"zora-sepolia",nativeCurrency:{decimals:18,name:"Zora Sepolia",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]},public:{http:["https://sepolia.rpc.zora.energy"],webSocket:["wss://sepolia.rpc.zora.energy"]}},blockExplorers:{default:{name:"Zora Sepolia Explorer",url:"https://sepolia.explorer.zora.energy/"}},testnet:!0},{id:17e3,name:"Holesky",network:"holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://ethereum-holesky.publicnode.com"]},public:{http:["https://ethereum-holesky.publicnode.com"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://holesky.etherscan.io"},default:{name:"EtherScan",url:"https://holesky.etherscan.io"}}},{id:690,name:"Redstone",network:"redstone",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.redstonechain.com"]},public:{http:["https://rpc.redstonechain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.redstone.xyz/"}}},{id:17069,name:"Garnet Holesky",network:"garnet-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.garnetchain.com"]},public:{http:["https://rpc.garnetchain.com"]}},blockExplorers:{default:{name:"Blockscout",url:"https://explorer.garnetchain.com"}}},{id:17001,name:"Redstone Holesky",network:"redstone-holesky",nativeCurrency:{name:"ETH",symbol:"ETH",decimals:18},rpcUrls:{default:{http:["https://rpc.holesky.redstone.xyz"]},public:{http:["https://rpc.holesky.redstone.xyz"]}},blockExplorers:{etherscan:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"},default:{name:"EtherScan",url:"https://explorer.holesky.redstone.xyz"}}}];nr.map(e=>e.id);var nn="#FFFFFF";function ni(e,t){let r=Math.max(0,Math.min(1,e.toHsl().l+t));return(0,b.Z)({...e.toHsl(),l:r})}function na(e,t,r){let n=r?console.warn:()=>{},i,a,o,s,l,c,d,h,u,p,m,g,f,y,w;t?.loginMethods?(i=t.loginMethods.includes("email"),a=t.loginMethods.includes("sms"),s=t.loginMethods.includes("wallet"),l=t.loginMethods.includes("google"),c=t.loginMethods.includes("twitter"),d=t.loginMethods.includes("discord"),u=t.loginMethods.includes("spotify"),p=t.loginMethods.includes("instagram"),h=t.loginMethods.includes("tiktok"),g=t.loginMethods.includes("github"),m=t.loginMethods.includes("linkedin"),f=t.loginMethods.includes("apple"),y=t.loginMethods.includes("farcaster"),w=t.loginMethods.includes("telegram")):(i=e.emailAuth,a=e.smsAuth,s=e.walletAuth,l=e.googleOAuth,c=e.twitterOAuth,d=e.discordOAuth,g=e.githubOAuth,u=e.spotifyOAuth,p=e.instagramOAuth,h=e.tiktokOAuth,m=e.linkedinOAuth,f=e.appleOAuth,y=e.farcasterAuth,w=e.telegramAuth),"u">typeof window&&"function"!=typeof window.PublicKeyCredential?o=!1:e.passkeyAuth&&(o=!0);let x=[i,a].filter(Boolean),v=[l,c,d,g,u,p,h,m,f,y,w].filter(Boolean),C=[s].filter(Boolean);if(x.length+v.length+C.length===0)throw Error("You must enable at least one login method");let _=t?.appearance?.showWalletLoginFirst!==void 0?t?.appearance?.showWalletLoginFirst:e.showWalletLoginFirst;_&&0===C.length?(n("You should only enable `showWalletLoginFirst` when `wallet` logins are also enabled. `showWalletLoginFirst` has been set to false"),_=!1):_||v.length+x.length!==0||(n("You should only disable `showWalletLoginFirst` when `email`, `sms`, or social logins are also enabled. `showWalletLoginFirst` has been set to true"),_=!0);let j=t?.externalWallets?.walletConnect?.enabled??!0;t?.loginMethods&&t.loginMethodsAndOrder&&n("You should only configure one of `loginMethods` or `loginMethodsAndOrder`");let k=ne({input:t?.appearance?.walletList,overrides:t?.loginMethodsAndOrder}),E=r6({input:t?.loginMethodsAndOrder}),A=t?.intl?.defaultCountry??"US",{chains:S,defaultChain:T}=function({additionalChains:e,supportedChains:t,defaultChainFromConfig:r,hasRpcConfigDefined:n}){let i;if(e&&t&&console.warn("You should only specify one of `additionalChains` or `supportedChains`. Using `supportedChains`."),t){if(0===t.length)throw Error("`supportedChains` must contain at least one chain");t.filter(e=>e.rpcUrls.privyWalletOverride).length>0&&n&&console.warn("You have specified at least one `supportedChain` with `privyWalletOverride` but also have `rpcConfig` defined. The `rpcConfig` will be ignored. `rpcConfig` is deprecated and you should use `privyWalletOverride` in a `supportedChain`."),i=t.map(e=>e.rpcUrls.privyWalletOverride?e:nr.find(t=>t.id===e.id)??e)}else i=nr.concat(e??[]);let a=t?i[0]:nt,o=r??a;if(!i.find(e=>e.id===o.id))throw Error("`defaultChain` must be included in `supportedChains`");return{chains:i,defaultChain:o}}({additionalChains:t?.additionalChains,supportedChains:t?.supportedChains,defaultChainFromConfig:t?.defaultChain,hasRpcConfigDefined:Object.keys(t?.rpcConfig?.rpcUrls??{}).length>0}),P=!!t?.defaultChain,N=t?.customAuth?.getCustomAccessToken&&t?.customAuth?.enabled!==!1,R,M=!(e.enforceWalletUis??!0);if(R=e.legacyWalletUiConfig??!0?N?t?.embeddedWallets?.noPromptOnSignature??!0:t?.embeddedWallets?.noPromptOnSignature??M:M,t?.embeddedWallets?.waitForTransactionConfirmation===!1&&!0!==R)throw Error("Overriding `config.embeddedWallets.waitForTransactionConfirmation` requires that you disable wallet UIs in the dashboard.");let{requireUserPasswordOnCreate:O,...I}=t?.embeddedWallets??{};return{id:e.id,name:e.name,allowlistConfig:e.allowlistConfig,legacyWalletUiConfig:e.legacyWalletUiConfig,appearance:{logo:t?.appearance?.logo??e.logoUrl,landingHeader:t?.appearance?.landingHeader??r5.appearance.landingHeader,loginMessage:"string"==typeof t?.appearance?.loginMessage?t?.appearance?.loginMessage.slice(0,100):t?.appearance?.loginMessage,palette:function({backgroundTheme:e,accentHex:t}){var r;let n;switch(e){case"light":n=nn;break;case"dark":n="#1E1E1D";break;default:n=e}let i=(0,b.Z)(n),a=(0,b.Z)(t),o=(0,b.Z)("#51BA81"),s=(0,b.Z)("#FFB74D"),l=(0,b.Z)("#EC6351"),c=((r=i.getLuminance())<.8&&r>.2&&console.warn("Background color is not light or dark enough, which could lead to accessibility issues."),r>.5?"light":"dark"),d=ni(i,"light"===c?-.04:.11),h=ni(i,"light"===c?-.88:.87),u=ni(i,"light"===c?-.7:.75),p=ni(i,"light"===c?-.43:.45).desaturate("light"===c?60:20),m=ni(i,"light"===c?-.08:.25).desaturate("light"===c?60:20),g=ni(a,.15),f=ni(a,-.06),y=ni(l,.3),w=ni(s,.3),x=(0,b.Z)(a.getLuminance()>.5?"#040217":nn),v=ni(o,-.16),C=ni(o,.4);return{colorScheme:c,background:i.toHslString(),background2:d.toHslString(),foreground:h.toHslString(),foreground2:u.toHslString(),foreground3:p.toHslString(),foreground4:m.toHslString(),accent:a.toHslString(),accentLight:g.toHslString(),accentDark:f.toHslString(),foregroundAccent:x.toHslString(),success:o.toHslString(),successDark:v.toHslString(),successLight:C.toHslString(),error:l.toHslString(),errorLight:y.toHslString(),warn:s.toHslString(),warnLight:w.toHslString()}}({backgroundTheme:t?.appearance?.theme??r5.appearance.theme,accentHex:t?.appearance?.accentColor??e.accentColor??r5.appearance.accentColor}),loginGroupPriority:_?"web3-first":"web2-first",hideDirectWeb2Inputs:!!t?.appearance?.hideDirectWeb2Inputs,walletList:k},loginMethods:{wallet:s,email:i,sms:a,passkey:o,google:l,twitter:c,discord:d,github:g,spotify:u,instagram:p,tiktok:h,linkedin:m,apple:f,farcaster:y,telegram:w},loginMethodsAndOrder:E,legal:{termsAndConditionsUrl:t?.legal?.termsAndConditionsUrl??e.termsAndConditionsUrl,privacyPolicyUrl:t?.legal?.privacyPolicyUrl??e.privacyPolicyUrl,requireUsersAcceptTerms:e.requireUsersAcceptTerms??!1},walletConnectCloudProjectId:t?.walletConnectCloudProjectId??e.walletConnectCloudProjectId??r5.walletConnectCloudProjectId,rpcConfig:{rpcUrls:t?.rpcConfig?.rpcUrls??r5.rpcConfig.rpcUrls,rpcTimeouts:t?.rpcConfig?.rpcTimeouts??r5.rpcConfig.rpcTimeouts},chains:S,defaultChain:T,intl:{defaultCountry:A},shouldEnforceDefaultChainOnConnect:P,captchaEnabled:e.captchaEnabled??r5.captchaEnabled,captchaSiteKey:e.captchaSiteKey,externalWallets:{coinbaseWallet:{connectionOptions:t?.externalWallets?.coinbaseWallet?.connectionOptions??r5.externalWallets.coinbaseWallet.connectionOptions},walletConnect:{enabled:j}},embeddedWallets:{...e.embeddedWalletConfig,..."boolean"==typeof O?{requireUserOwnedRecoveryOnCreate:O}:{},...N?{createOnLogin:"all-users",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]}:{},waitForTransactionConfirmation:!0,priceDisplay:{primary:"fiat-currency",secondary:"native-token"},...I,noPromptOnSignature:R},mfa:{methods:e.mfaMethods??[],noPromptOnMfaRequired:t?.mfa?.noPromptOnMfaRequired??!1},customAuth:N?{enabled:!0,...t.customAuth}:void 0,loginConfig:{twitterOAuthOnMobileEnabled:e.twitterOAuthOnMobileEnabled??!1,telegramAuthConfiguration:e.telegramAuthConfiguration},headless:!!t?.headless,render:{standalone:t?._render?.standalone??r5._render.standalone},fundingConfig:e.fundingConfig,fundingMethodConfig:{...t?.fundingMethodConfig??r5.fundingMethodConfig,moonpay:{...t?.fundingMethodConfig?.moonpay??r5.fundingMethodConfig.moonpay,useSandbox:t?.fundingMethodConfig?.moonpay.useSandbox??t?.fiatOnRamp?.useSandbox??r5.fundingMethodConfig.moonpay.useSandbox}}}}var no=function(e,t=0){let r=3735928559^t,n=1103547991^t;for(let t=0,i;t>>16,2246822507)^Math.imul(n^n>>>13,3266489909),4294967296*(2097151&(n=Math.imul(n^n>>>16,2246822507)^Math.imul(r^r>>>13,3266489909)))+(r>>>0)},ns={showWalletLoginFirst:!0,allowlistConfig:{errorTitle:null,errorDetail:null,errorCtaText:null,errorCtaLink:null},walletAuth:!0,emailAuth:!0,smsAuth:!1,googleOAuth:!1,twitterOAuth:!1,discordOAuth:!1,githubOAuth:!1,linkedinOAuth:!1,appleOAuth:!1,termsAndConditionsUrl:null,privacyPolicyUrl:null,embeddedWalletConfig:{createOnLogin:"off",requireUserOwnedRecoveryOnCreate:!1,userOwnedRecoveryOptions:["user-passcode"]},fiatOnRampEnabled:!1,captchaEnabled:!1,captchaSiteKey:""},nl=na(ns,void 0,!1),nc=(0,o.createContext)({appConfig:nl,isServerConfigLoaded:!1}),nd=({children:e,legacyCreateEmbeddedWalletFlag:t,client:r,clientConfig:n})=>{let[i,a]=(0,o.useState)(null),s=(0,o.useMemo)(()=>na(i??ns,n,!!i),[i,n]);return(0,o.useEffect)(()=>{if(!i)return;let e=function(e,t){if(!e)return{legacyCreateEmbeddedWalletFlag:t};let{appearance:r,additionalChains:n,supportedChains:i,defaultChain:a,...o}=e;return{...o,...n?{additionalChains:n.map(e=>e.id)}:void 0,...i?{supportedChains:i.map(e=>e.id)}:void 0,...a?{defaultChain:a.id}:void 0,legacyCreateEmbeddedWalletFlag:t}}(n,t),a=no(JSON.stringify(e)).toString(),o=`privy:sent:${i.id}:${a}`;localStorage.getItem(o)||(r.createAnalyticsEvent({eventName:"sdk_initialize",payload:e}),localStorage.setItem(o,"t"))},[n,t,i]),(0,o.useEffect)(()=>{i||(async()=>{try{let e=await r.getServerConfig();e.customApiUrl&&r.updateApiUrl(e.customApiUrl),a(e)}catch(e){console.warn("Error generating app config: ",e)}})()},[]),(0,m.jsx)(nc.Provider,{value:{appConfig:s,isServerConfigLoaded:!!i},children:e})},nh=()=>{let{appConfig:e}=(0,o.useContext)(nc);return e},nu=()=>{let{isServerConfigLoaded:e}=(0,o.useContext)(nc);return e},np=()=>{throw Error("You need to wrap your application with the initialized with your app id.")},nm=(0,o.createContext)({ready:!1,app:nl,currentScreen:null,lastScreen:null,navigate:np,navigateBack:np,resetNavigation:np,setModalData:np,onUserCloseViaDialogOrKeybindRef:void 0}),ng=["LANDING","CONNECT_ONLY_LANDING_SCREEN",null],nf=e=>{let t=nh(),r=e.authenticated,[n,i]=(0,o.useState)(e.initialScreen);(0,o.useEffect)(()=>{r||ng.includes(e.initialScreen)||e.setInitialScreen(null)},[r]);let a=(0,o.useRef)(null);(0,o.useEffect)(()=>{e.open||(a.current=null)},[e.open]),(0,o.useEffect)(()=>{a.current=null},[e.initialScreen]);let s={ready:!!t.id,app:t,data:e.data,setModalData:e.setModalData,currentScreen:e.initialScreen,lastScreen:n,navigate:(t,r=!0)=>{e.setInitialScreen(t),r&&i(e.initialScreen)},navigateBack:()=>{e.setInitialScreen(n)},resetNavigation:()=>{e.setInitialScreen(null),i(null)},onUserCloseViaDialogOrKeybindRef:a};return(0,m.jsxs)(nm.Provider,{value:s,children:[("string"==typeof t.appearance.logo||t.appearance.logo?.type==="img")&&(0,m.jsx)(r4,{src:"string"==typeof t.appearance.logo?t.appearance.logo:t.appearance.logo.props.src}),e.children]})},ny=()=>(0,o.useContext)(nm),nw=({style:e,...t})=>{let{app:r}=ny();return(0,m.jsxs)("svg",{width:"28",height:"28",viewBox:"0 0 28 28",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px",...e},...t,children:[(0,m.jsx)("rect",{width:"28",height:"28",rx:"3",fill:r?.appearance.palette.colorScheme==="dark"?"#3396ff":"#141414"}),(0,m.jsx)("g",{clipPath:"url(#clip0_1765_9946)",children:(0,m.jsx)("path",{d:"M8.09448 10.3941C11.3558 7.20196 16.6442 7.20196 19.9055 10.3941L20.2982 10.7782C20.3369 10.8157 20.3677 10.8606 20.3887 10.9102C20.4097 10.9599 20.4206 11.0132 20.4206 11.0671C20.4206 11.121 20.4097 11.1744 20.3887 11.224C20.3677 11.2737 20.3369 11.3186 20.2982 11.3561L18.9554 12.6702C18.9158 12.7086 18.8628 12.7301 18.8077 12.7301C18.7526 12.7301 18.6996 12.7086 18.66 12.6702L18.1198 12.1415C15.8448 9.91503 12.1557 9.91503 9.88015 12.1415L9.30167 12.7075C9.26207 12.7459 9.20909 12.7673 9.15395 12.7673C9.0988 12.7673 9.04582 12.7459 9.00622 12.7075L7.66346 11.3934C7.62475 11.3559 7.59397 11.3109 7.57295 11.2613C7.55193 11.2117 7.5411 11.1583 7.5411 11.1044C7.5411 11.0505 7.55193 10.9971 7.57295 10.9475C7.59397 10.8979 7.62475 10.8529 7.66346 10.8154L8.09448 10.3941ZM22.6829 13.1115L23.8776 14.2814C23.9163 14.319 23.9471 14.3639 23.9681 14.4135C23.9892 14.4632 24 14.5165 24 14.5704C24 14.6243 23.9892 14.6777 23.9681 14.7273C23.9471 14.777 23.9163 14.8219 23.8776 14.8594L18.4893 20.1332C18.4102 20.2101 18.3042 20.2531 18.1938 20.2531C18.0835 20.2531 17.9775 20.2101 17.8984 20.1332L14.0743 16.3901C14.0545 16.3708 14.0279 16.36 14.0003 16.36C13.9726 16.36 13.9461 16.3708 13.9263 16.3901L10.1021 20.1332C10.023 20.2101 9.91703 20.2531 9.8067 20.2531C9.69636 20.2531 9.59038 20.2101 9.51124 20.1332L4.12236 14.8594C4.08365 14.8219 4.05287 14.777 4.03185 14.7273C4.01083 14.6777 4 14.6243 4 14.5704C4 14.5165 4.01083 14.4632 4.03185 14.4135C4.05287 14.3639 4.08365 14.319 4.12236 14.2814L5.31767 13.1115C5.39678 13.0348 5.50265 12.9919 5.61285 12.9919C5.72305 12.9919 5.82892 13.0348 5.90803 13.1115L9.73216 16.8546C9.75194 16.874 9.7785 16.8848 9.80616 16.8848C9.83381 16.8848 9.86037 16.874 9.88015 16.8546L13.7043 13.1115C13.7834 13.0346 13.8894 12.9916 13.9997 12.9916C14.1101 12.9916 14.216 13.0346 14.2952 13.1115L18.1198 16.8546C18.1396 16.874 18.1662 16.8848 18.1938 16.8848C18.2215 16.8848 18.2481 16.874 18.2678 16.8546L22.092 13.1115C22.1711 13.0346 22.2771 12.9916 22.3874 12.9916C22.4977 12.9916 22.6037 13.0346 22.6829 13.1115Z",fill:"white"})}),(0,m.jsx)("defs",{children:(0,m.jsx)("clipPath",{id:"clip0_1765_9946",children:(0,m.jsx)("rect",{width:"20",height:"12.2531",fill:"white",transform:"translate(4 8)"})})})]})},nx=class extends rH{constructor(e,t,r,n,i,a,o,s){super(s||"unknown",r,n,t),this.connectorType="wallet_connect_v2",this.privyAppId=a,this.privyAppName=o,this.walletConnectCloudProjectId=e,this.rpcConfig=t,this.shouldEnforceDefaultChainOnConnect=i,this.proxyProvider=new rF(void 0,this.rpcTimeoutDuration),s&&(this.walletEntry=tS[s],this.walletClientType=s)}async initialize(){let e=await this.createProvider();if(this.provider=e,this.proxyProvider.setWalletProvider(e),this.subscribeListeners(),e.session){if(this.walletProvider?.session?.peer.metadata.url){let e=tA(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}this.connected=!0,await this.syncAccounts()}this.initialized=!0,this.emit("initialized");let{WalletConnectModal:t}=await r.e(318).then(r.bind(r,55318));this.modal=new t({projectId:this.walletConnectCloudProjectId,themeVariables:{"--wcm-z-index":"1000000"}}),this.modal.subscribeModal(e=>{e.open||this.walletProvider?.session||!this.onQrModalClosed||this.onQrModalClosed()})}async connect(e){return e.showPrompt&&await this.promptConnection(),this.getConnectedWallet()}async isConnected(){return!!this.walletProvider?.connected}get walletBranding(){return"metamask"===this.walletClientType?{name:"MetaMask",icon:rQ,id:"io.metamask"}:{name:tw(this.walletProvider?.session?.peer.metadata.name||"")||"WalletConnect",icon:this.walletProvider?.session?.peer.metadata.icons?.[0]||nw,id:this.walletProvider?.session?.peer.metadata.name.toLowerCase()||"wallet_connect_v2"}}async resetConnection(e){this.walletProvider&&this.walletProvider.connected&&(await this.walletProvider.disconnect(),this.walletProvider.signer.session=void 0,this.walletEntry=tS[e],this.walletClientType=e,this.redirectUri=void 0,this.fallbackUniversalRedirectUri=void 0,function(){try{localStorage.removeItem(tP)}catch{}}(),this.onDisconnect())}async promptConnection(){if(this.provider)return new Promise((e,t)=>{this.onQrModalClosed=()=>{t(new rM)},(async()=>{let t="",r=await Promise.race([this.walletProvider?.enable(),this.proxyProvider.walletTimeout()]);if(r?.length&&(t=r[0]),!t||""===t)throw new eQ("Unable to retrieve address");if(this.walletProvider?.session?.peer.metadata.url){let e=tA(this.walletProvider?.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown",this.proxyProvider.rpcTimeoutDuration=nC(this.rpcConfig,this.walletClientType)}this.connected=!0,await this.syncAccounts(r),e()})().catch(e=>{if(e){t(rO(e));return}t(new eQ("Unknown error during connection"))}).finally(()=>this.modal?.closeModal())})}disconnect(){this.walletProvider?.disconnect().then(()=>this.onDisconnect()).catch(()=>console.warn("Unable to disconnect Wallet Connect provider"))}get walletProvider(){return this.proxyProvider.walletProvider}setWalletProvider(e){this.proxyProvider.setWalletProvider(e)}async createProvider(){let e={};for(let t of this.chains){let r=tb(t.id,this.chains,this.rpcConfig,this.privyAppId);r&&(e[t.id]=r)}let t=this.shouldEnforceDefaultChainOnConnect?[this.defaultChain.id]:[],r=this.chains.map(e=>e.id),n=await C.Gn.init({projectId:this.walletConnectCloudProjectId,chains:t,optionalChains:r,optionalEvents:C.gy,optionalMethods:C.lI,rpcMap:e,showQrModal:!1,metadata:{description:this.privyAppName,name:this.privyAppName,url:window.location.toString(),icons:[]}});return n.on("display_uri",e=>{if(n.signer.abortPairingAttempt(),s.tq&&this.walletEntry){let{redirect:t,href:r}=function(e,t){let r=tT(t);if(r.deepLink)return tR(r.deepLink,e);if(r.universalLink)return tM(r.universalLink,e);throw new eK(`Unsupported wallet ${t.id}`)}(e,this.walletEntry);(function({href:e,name:t}){try{localStorage.setItem(tP,JSON.stringify({href:e,name:t}))}catch{}})({href:r,name:this.walletEntry.displayName}),this.redirectUri=t;let n=function(e,t){let r=tT(t);if(r.universalLink)return tM(r.universalLink,e)}(e,this.walletEntry);n?.redirect&&(this.fallbackUniversalRedirectUri=n.redirect),tO(t,"_self")}else this.modal?.openModal({uri:e,chains:[this.defaultChain.id]})}),n.on("connect",()=>{if(this.modal?.closeModal(),n.session?.peer.metadata.url){let e=tA(n.session?.peer.metadata.url);this.walletEntry=e?.entry,this.walletClientType=e?.walletClientType||"unknown"}}),n}async enableProvider(){return this.walletProvider?.connected?Promise.resolve(this.walletProvider.accounts):await this.walletProvider?.enable()}},nv=e=>{let t=localStorage.getItem("-walletlink:https://www.walletlink.org:Addresses")?.split(" ").filter(e=>y.A7(e)).map(e=>n.Kn(e));return!!t?.length&&!!e?.linkedAccounts.filter(e=>"wallet"==e.type&&t.includes(e.address)).length},nC=(e,t)=>e.rpcTimeouts&&e.rpcTimeouts[t]||12e4,nb=class extends w.Z{constructor(e,t,r,n,i,a,o,s,l,c,d){super(),this.getEthereumProvider=()=>{let e=this.wallets[0],t=this.walletConnectors.find(t=>t.wallets.find(t=>t.address===e?.address));return e&&t?t.proxyProvider:new rF},this.privyAppId=e,this.walletConnectCloudProjectId=t,this.rpcConfig=r,this.chains=n,this.defaultChain=i,this.walletConnectors=[],this.initialized=!1,this.store=a,this.walletList=o,this.shouldEnforceDefaultChainOnConnect=s,this.externalWalletConfig=l,this.privyAppName=c,this.privyAppLogo=d,this.storedConnections=nS()}get wallets(){let e=new Set,t=this.walletConnectors.flatMap(e=>e.wallets).sort((e,t)=>e.connectedAt&&t.connectedAt?t.connectedAt-e.connectedAt:0).filter(t=>{let r=`${t.address}${t.walletClientType}${t.connectorType}`;return!e.has(r)&&(e.add(r),!0)}),r=t.findIndex(e=>e.address===(this.activeWallet?this.activeWallet:"unknown"));return r>=0&&t.unshift(t.splice(r,1)[0]),t}async initialize(){if(this.initialized)return;to.get(tX)&&(to.getKeys().forEach(e=>{e.startsWith("walletconnect")&&to.del(e)}),to.del(tX));let e=tv(this.store,this.walletList,this.externalWalletConfig).then(e=>{e.forEach(({type:e,eip6963InjectedProvider:t,legacyInjectedProvider:r})=>{this.createWalletConnector("injected",e,{eip6963InjectedProvider:t,legacyInjectedProvider:r})})});this.walletList.includes("coinbase_wallet")&&this.createWalletConnector("coinbase_wallet","coinbase_wallet"),!tc()&&this.walletList.includes("phantom")&&this.createWalletConnector("phantom","phantom"),this.externalWalletConfig.walletConnect.enabled&&this.createWalletConnector("wallet_connect_v2","unknown"),await e,this.initialized=!0}findWalletConnector(e,t){return"wallet_connect_v2"===e?this.walletConnectors.find(t=>t.connectorType===e)??null:this.walletConnectors.find(r=>r.connectorType===e&&r.walletClientType===t)??null}onInitialized(e){e.wallets.forEach(e=>{let t=this.storedConnections.find(t=>t.address===e.address&&t.connectorType===e.connectorType&&t.walletClientType===e.walletClientType);t&&(e.connectedAt=t.connectedAt)}),this.saveConnectionHistory(),this.emit("walletsUpdated"),this.emit("connectorInitialized")}onWalletsUpdated(e){e.initialized&&(this.saveConnectionHistory(),this.emit("walletsUpdated"))}addEmbeddedWalletConnector(e,t,r,n){let i=this.findWalletConnector("embedded","privy");if(i)i.proxyProvider.walletProxy=e;else{let i=new rK(new rD(e,t,this.rpcConfig,this.chains,n,r.id),this.chains,r,this.rpcConfig);this.addWalletConnector(i)}}addImportedWalletConnector(e,t,r,n){let i=this.findWalletConnector("embedded_imported","privy");if(i)i.proxyProvider.walletProxy=e;else{let i=new rK(new rD(e,t,this.rpcConfig,this.chains,n,r.id),this.chains,r,this.rpcConfig,!0);this.addWalletConnector(i)}}removeEmbeddedWalletConnector(){let e=this.findWalletConnector("embedded","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=nS(),this.emit("walletsUpdated")}}removeImportedWalletConnector(){let e=this.findWalletConnector("embedded_imported","privy");if(e){let t=this.walletConnectors.indexOf(e);this.walletConnectors.splice(t,1),this.saveConnectionHistory(),this.storedConnections=nS(),this.emit("walletsUpdated")}}async createWalletConnector(e,t,r){let n=this.findWalletConnector(e,t);if(n)return n instanceof nx&&n.resetConnection(t),n;let i="injected"!==e?"coinbase_wallet"===e?new rV(this.chains,this.defaultChain,this.rpcConfig,this.externalWalletConfig,this.privyAppName,this.privyAppLogo):"phantom"===e?new r3(this.defaultChain):new nx(this.walletConnectCloudProjectId,this.rpcConfig,this.chains,this.defaultChain,this.shouldEnforceDefaultChainOnConnect,this.privyAppId,this.privyAppName,t):"metamask"===t&&r?.eip6963InjectedProvider?new r1(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,"metamask"):"metamask"===t&&r?.legacyInjectedProvider?new r0(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"metamask"):"phantom"===t&&r?.legacyInjectedProvider?new r0(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider,"phantom"):r?.legacyInjectedProvider&&"unknown_browser_extension"===t?new r0(this.chains,this.defaultChain,this.rpcConfig,r?.legacyInjectedProvider):r?.eip6963InjectedProvider?new rJ(this.chains,this.defaultChain,this.rpcConfig,r?.eip6963InjectedProvider,t):void 0;return i&&this.addWalletConnector(i),i||null}addWalletConnector(e){this.walletConnectors.push(e),e.on("initialized",()=>this.onInitialized(e)),e.on("walletsUpdated",()=>this.onWalletsUpdated(e)),e.initialize().catch(e=>{console.debug("Failed to initialize connector",e)})}saveConnectionHistory(){let e=this.wallets.map(e=>({address:e.address,connectorType:e.connectorType,walletClientType:e.walletClientType,connectedAt:e.connectedAt}));to.put(tJ,e)}async activeWalletSign(e){let t=this.wallets,r=t.length>0?t[0]:null;return r?r.sign(e):null}setActiveWallet(e){this.activeWallet=(0,n.Kn)(e),this.emit("walletsUpdated")}};function n_(e,t){if(e.length!==t.length)return!1;for(let r=0;re&&"string"==typeof e.address&&"string"==typeof e.connectorType&&"string"==typeof e.walletClientType&&"number"==typeof e.connectedAt,nS=()=>{let e=to.get(tJ);return e&&Array.isArray(e)&&e.map(e=>nA(e)).every(Boolean)?e:[]},nT=[e4,e6,e5,e9],nP=class{constructor({appId:e,appClientId:t,client:r,defaults:n}){this.appId=e,this.appClientId=t,this.clientAnalyticsId=r.clientAnalyticsId,this.sdkVersion="1.77.0",this.client=r,this.defaults=n,this.fallbackApiUrl=r.fallbackApiUrl,this.baseFetch=_.Wg.create({baseURL:this.defaults.baseURL,timeout:this.defaults.timeout,retry:3,retryDelay:500,retryStatusCodes:[408,409,425,500,502,503,504],credentials:"include",onRequest:async({request:e,options:t})=>{let r=new Headers(t.headers);r.set("privy-app-id",this.appId),this.appClientId&&r.set("privy-client-id",this.appClientId),r.set("privy-ca-id",this.clientAnalyticsId||""),r.set("privy-client",`react-auth:${this.sdkVersion}`);let n=nT.includes(e.toString());if(!r.has("authorization")){let e=await this.client.getAccessToken({disableAutoRefresh:n});null!==e&&r.set("authorization",`Bearer ${e}`)}t.headers=r,t.retryDelay&&(t.retryDelay=3*t.retryDelay)},onRequestError:({error:e})=>{if(e instanceof DOMException&&"AbortError"===e.name)throw new eY}})}async get(e,t){try{return await this.baseFetch(e,t)}catch(e){throw eX(e)}}async post(e,t,r){try{return await this.baseFetch(e,{method:"POST",...t?{body:t}:{},...r})}catch(e){throw eX(e)}}async delete(e,t){try{return await this.baseFetch(e,{method:"DELETE",...t})}catch(e){throw eX(e)}}},nN=e=>({challenge:e.challenge,allowCredentials:e.allow_credentials?.map(e=>({id:e.id,type:e.type,transports:e.transports}))||[],timeout:e.timeout,extensions:{appid:e.extensions?.app_id,credProps:e.extensions?.cred_props,hmacCreateSecret:e.extensions?.hmac_create_secret},userVerification:e.user_verification}),nR=class{static parse(e){try{return new nR(e)}catch{return null}}constructor(e){this.value=e,this._decoded=k.t(e)}get subject(){return this._decoded.sub}get expiration(){return this._decoded.exp}get issuer(){return this._decoded.iss}get audience(){return this._decoded.aud}isExpired(e=0){return Date.now()>=(this.expiration-e)*1e3}},nM=class{constructor(){this.authenticateOnce=new tI(async e=>this._authenticate(e)),this.linkOnce=new tI(async e=>this._link(e)),this.refreshOnce=new tI(this._refresh.bind(this)),this.destroyOnce=new tI(this._destroy.bind(this)),this.forkSessionOnce=new tI(this._forkSession.bind(this))}get token(){try{let e=to.get(tF);return"string"==typeof e?new nR(e).value:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get refreshToken(){try{let e=to.get(tD);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}get forkedToken(){try{let e=to.get(tH);return"string"==typeof e?e:null}catch(e){return console.error(e),this.destroyLocalState(),null}}getProviderAccessToken(e){try{let t=to.get(tV(e));if("string"!=typeof t)return null;{let r=new nR(t);return r.isExpired()?(to.del(tV(e)),null):r.value}}catch(e){return console.error(e),null}}get mightHaveServerCookies(){try{let e=j.Z.get(t$);return void 0!==e&&e.length>0}catch(e){console.error(e)}return!1}hasRefreshCredentials(){return this.mightHaveServerCookies||"string"==typeof this.token&&"string"==typeof this.refreshToken&&"deprecated"!==this.refreshToken}hasRecoveryCredentials(){return"string"==typeof this.forkedToken}hasActiveToken(){let e=nR.parse(this.token);return null!==e&&!e.isExpired(30)}authenticate(e){return this.authenticateOnce.execute(e)}link(e){return this.linkOnce.execute(e)}refresh(){return this.refreshOnce.execute()}forkSession(){return this.forkSessionOnce.execute()}destroy(){return this.destroyOnce.execute()}storeProviderAccessToken(e,t){"string"==typeof t?to.put(tV(e),t):to.del(tV(e))}async _authenticate(e){try{let t=await e.authenticate(),{user:r,is_new_user:n,oauth_tokens:i}=t;this.handleTokenResponse(t);let a=i?{provider:i.provider,accessToken:i.access_token,accessTokenExpiresInSeconds:i.access_token_expires_in_seconds,refreshToken:i.refresh_token,refreshTokenExpiresInSeconds:i.refresh_token_expires_in_seconds,scopes:i.scopes}:void 0,o=e instanceof tt?"email":e instanceof rm?"sms":e instanceof rp?"siwe":e instanceof t3?"guest":e instanceof te?"custom_auth":e instanceof t7?e.meta.provider:null;return o&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate",payload:{method:o,isNewUser:n}}),"siwe"===o&&this.client&&this.client.createAnalyticsEvent({eventName:"sdk_authenticate_siwe",payload:{connectorType:e.meta.connectorType,walletClientType:e.meta.walletClientType}}),{user:rE(r),isNewUser:n,oAuthTokens:a}}catch(e){throw console.warn("Error authenticating session"),eJ(e)}}async _link(e){try{let t=await e.link(),r=t.oauth_tokens,n=r?{provider:r.provider,accessToken:r.access_token,accessTokenExpiresInSeconds:r.access_token_expires_in_seconds,refreshToken:r.refresh_token,refreshTokenExpiresInSeconds:r.refresh_token_expires_in_seconds,scopes:r.scopes}:void 0;return{user:rE(t),oAuthTokens:n}}catch(e){throw console.warn("Error linking account"),eJ(e)}}async _refresh(){if(!this.api)throw new eK("Session has no API instance");if(!this.client)throw new eK("Session has no PrivyClient instance");await this.client.getAccessToken({disableAutoRefresh:!0});let e=this.token,t=this.refreshToken,r=this.forkedToken;if(this.client.useServerCookies&&!this.mightHaveServerCookies&&this.token&&window.location.origin===this.client.apiUrl)return this.destroyLocalState(),null;try{let n;if(e&&t||this.mightHaveServerCookies){let i={};e&&(i.authorization=`Bearer ${e}`),n=await this.api.post(e4,t?{refresh_token:t}:{},{headers:i}),r&&this.clearForkedToken()}else{if(!r)return null;n=await this.api.post(e6,{refresh_token:r}),this.clearForkedToken()}return this.handleTokenResponse(n),rE(n.user)}catch(e){if(e instanceof eG&&"missing_or_invalid_token"===e.privyErrorCode)return console.warn("Unable to refresh tokens - token is missing or no longer valid"),this.destroyLocalState(),null;throw eJ(e)}}handleTokenResponse(e){e.session_update_action?"set"===e.session_update_action?(this.storeRefreshToken(e.refresh_token),this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token)):"clear"===e.session_update_action?this.destroyLocalState():"ignore"===e.session_update_action&&e.token&&(this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token)):(this.storeRefreshToken(e.refresh_token),this.storeToken(e.token),e.identity_token&&this.storeIdentityToken(e.identity_token))}async _destroy(){try{await this.api?.post(e5,{refresh_token:this.refreshToken})}catch{console.warn("Error destroying session")}this.destroyLocalState()}async _forkSession(){if(!this.api)throw new eK("Session has no API instance");let e=this.refreshToken;try{let t=await this.api.post("/api/v1/sessions/fork",{refresh_token:e});return this.storeRefreshToken(t.refresh_token),this.storeToken(t.token),t.new_session_refresh_token}catch(e){throw eJ(e)}}destroyLocalState(){this.storeRefreshToken(null),this.storeToken(null),this.clearIdentityToken(),this.clearForkedToken()}storeToken(e){if("string"==typeof e){let t=to.get(tF);if(to.put(tF,e),!this.client?.useServerCookies){let t=nR.parse(e)?.expiration;j.Z.set(tU,e,{sameSite:"Strict",secure:!0,expires:t?new Date(1e3*t):void 0})}t!==e&&this.client?.onStoreToken?.(e)}else to.del(tF),j.Z.remove(tU),this.client?.onDeleteToken?.()}storeRefreshToken(e){"string"==typeof e?(to.put(tD,e),this.client?.useServerCookies||j.Z.set(t$,"t",{sameSite:"Strict",secure:!0,expires:30})):(to.del(tD),j.Z.remove("privy-refresh-token"),j.Z.remove(t$))}storeIdentityToken(e){if(this.client?.useServerCookies)return;to.put(tZ,e);let t=nR.parse(e)?.expiration;j.Z.set(tz,e,{sameSite:"Strict",secure:!0,expires:t?new Date(1e3*t):void 0})}clearIdentityToken(){to.del(tZ),j.Z.remove(tz)}clearForkedToken(){to.del(tH)}},nO=class{constructor(e){eH(this,nk),this.apiUrl=e.apiUrl||tL,this.fallbackApiUrl=this.apiUrl,this.useServerCookies=!!e.apiUrl&&e.apiUrl.startsWith("https://privy."),this.timeout=e.timeout||2e4,this.appId=e.appId,this.appClientId=e.appClientId,this.clientAnalyticsId=eq(this,nk,nE).call(this),nj||(nj=new nM),this.session=nj,this.api=this.generateApi(),this.session.client=this}initializeConnectorManager({walletConnectCloudProjectId:e,rpcConfig:t,chains:r,defaultChain:n,store:i,walletList:a,shouldEnforceDefaultChainOnConnect:o,externalWalletConfig:s,appName:l}){this.connectors||(this.connectors=new nb(this.appId,e,t,r,n,i,a,o,s,l))}sessionHasActiveToken(){return this.session.hasActiveToken()}generateApi(){let e=new nP({appId:this.appId,appClientId:this.appClientId,client:this,defaults:{baseURL:this.apiUrl,timeout:this.timeout}});return this.session.api=e,e}updateApiUrl(e){this.apiUrl=e||this.fallbackApiUrl,this.api=this.generateApi(),e&&(this.useServerCookies=!0)}authenticate(){if(!this.authFlow)throw new eK("No auth flow in progress.");return this.session.authenticate(this.authFlow)}async link(){if(!this.authFlow)throw new eK("No auth flow in progress.");let{oAuthTokens:e}=await this.session.link(this.authFlow);return{user:await this.getAuthenticatedUser(),oAuthTokens:e}}storeProviderAccessToken(e,t){this.session.storeProviderAccessToken(e,t)}getProviderAccessToken(e){return this.session.getProviderAccessToken(e)}async logout(){await this.session.destroy(),this.authFlow=void 0}clearProviderAcccessTokens(e){e.linkedAccounts.filter(e=>"cross_app"===e.type).forEach(e=>{this.storeProviderAccessToken(e.providerApp.id,null)})}startAuthFlow(e){return e.api=this.api,this.authFlow=e,this.authFlow}async initMfaSmsVerification(){try{await this.api.post("/api/v1/mfa/passwordless_sms/init",{action:"verify"})}catch(e){throw eX(e)}}async initMfaPasskeyVerification(){try{let e=await this.api.post("/api/v1/mfa/passkeys/init",{});return nN(e.options)}catch(e){throw eX(e)}}async acceptTerms(){try{let e=await this.api.post("/api/v1/users/me/accept_terms",{});return rE(e)}catch(e){throw eJ(e)}}async unlinkEmail(e){try{let t=await this.api.post("/api/v1/passwordless/unlink",{address:e});return await this.getAuthenticatedUser()??rE(t)}catch(e){throw eJ(e)}}async unlinkPhone(e){try{let t=await this.api.post("/api/v1/passwordless_sms/unlink",{phoneNumber:e});return await this.getAuthenticatedUser()??rE(t)}catch(e){throw eJ(e)}}async unlinkWallet(e){try{let t=await this.api.post("/api/v1/siwe/unlink",{address:e});return await this.getAuthenticatedUser()??rE(t)}catch(e){throw eJ(e)}}async unlinkOAuth(e,t){try{let r=await this.api.post("/api/v1/oauth/unlink",{provider:e,subject:t});return await this.getAuthenticatedUser()??rE(r)}catch(e){throw eJ(e)}}async unlinkFarcaster(e){try{let t=await this.api.post("/api/v1/farcaster/unlink",{fid:e});return await this.getAuthenticatedUser()??rE(t)}catch(e){throw eJ(e)}}async unlinkTelegram(e){try{let t=await this.api.post("/api/v1/telegram/unlink",{telegram_user_id:e});return await this.getAuthenticatedUser()??rE(t)}catch(e){throw eJ(e)}}async unlinkPasskey(e){try{let t=await this.api.post("/api/v1/passkeys/unlink",{credential_id:e});return await this.getAuthenticatedUser()??rE(t)}catch(e){throw eJ(e)}}async createAnalyticsEvent({eventName:e,payload:t,timestamp:r,options:n}){if(!(typeof window>"u"))try{this.clientAnalyticsId||console.warn("No client analytics id set, refusing to send analytics event"),await this.api.post(e9,{event_name:e,client_id:this.clientAnalyticsId,payload:{...t||{},clientTimestamp:r?r.toISOString():new Date().toISOString()}},{retry:-1,keepalive:n?.keepAlive??!1})}catch{}}async signMoonpayOnRampUrl(e){try{return this.api.post("/api/v1/plugins/moonpay_on_ramp/sign",e)}catch(e){throw eJ(e)}}async initCoinbaseOnRamp(e){try{return this.api.post("/api/v1/funding/coinbase_on_ramp/init",e)}catch(e){throw eJ(e)}}async getCoinbaseOnRampStatus({partnerUserId:e}){try{return this.api.get(`/api/v1/funding/coinbase_on_ramp/status?partnerUserId=${e}`)}catch(e){throw eJ(e)}}async getAuthenticatedUser(){return this.session.hasRefreshCredentials()||this.session.hasRecoveryCredentials()?this.session.refresh():null}async getAccessToken(e){return this.session.hasActiveToken()?nR.parse(this.session.token)?.audience!==this.appId?(await this.logout(),null):this.session.token:!e?.disableAutoRefresh&&this.session.hasRefreshCredentials()?(await this.session.refresh(),this.session.token):null}async getServerConfig(){try{let e={},t=this.session.token;t&&(e.authorization=`Bearer ${t}`);let r=await this.api.get(`/api/v1/apps/${this.appId}`,{baseURL:this.fallbackApiUrl,headers:e}),n=r.telegram_auth_config?{botId:r.telegram_auth_config.bot_id,botName:r.telegram_auth_config.bot_name,linkEnabled:r.telegram_auth_config.link_enabled,seamlessAuthEnabled:r.telegram_auth_config.seamless_auth_enabled}:void 0,i=r.funding_config?{methods:r.funding_config.methods,defaultRecommendedAmount:r.funding_config.default_recommended_amount,defaultRecommendedCurrency:r.funding_config.default_recommended_currency,promptFundingOnWalletCreation:r.funding_config.prompt_funding_on_wallet_creation}:void 0;return{id:r.id,name:r.name,verificationKey:r.verification_key,logoUrl:r.logo_url||void 0,accentColor:r.accent_color||void 0,showWalletLoginFirst:r.show_wallet_login_first,allowlistConfig:{errorTitle:r.allowlist_config.error_title,errorDetail:r.allowlist_config.error_detail,errorCtaText:r.allowlist_config.cta_text,errorCtaLink:r.allowlist_config.cta_link},walletAuth:r.wallet_auth,emailAuth:r.email_auth,smsAuth:r.sms_auth,googleOAuth:r.google_oauth,twitterOAuth:r.twitter_oauth,discordOAuth:r.discord_oauth,githubOAuth:r.github_oauth,spotifyOAuth:r.spotify_oauth,instagramOAuth:r.instagram_oauth,tiktokOAuth:r.tiktok_oauth,linkedinOAuth:r.linkedin_oauth,appleOAuth:r.apple_oauth,farcasterAuth:r.farcaster_auth,passkeyAuth:r.passkey_auth,telegramAuth:r.telegram_auth,termsAndConditionsUrl:r.terms_and_conditions_url,embeddedWalletConfig:{createOnLogin:r.embedded_wallet_config?.create_on_login,userOwnedRecoveryOptions:r.embedded_wallet_config.user_owned_recovery_options,requireUserOwnedRecoveryOnCreate:r.embedded_wallet_config.require_user_owned_recovery_on_create},privacyPolicyUrl:r.privacy_policy_url,requireUsersAcceptTerms:r.require_users_accept_terms,customApiUrl:r.custom_api_url,walletConnectCloudProjectId:r.wallet_connect_cloud_project_id,fiatOnRampEnabled:r.fiat_on_ramp_enabled,captchaEnabled:r.captcha_enabled,captchaSiteKey:r.captcha_site_key,twitterOAuthOnMobileEnabled:r.twitter_oauth_on_mobile_enabled,createdAt:new Date(1e3*r.created_at),updatedAt:new Date(1e3*r.updated_at),mfaMethods:r.mfa_methods,enforceWalletUis:r.enforce_wallet_uis,legacyWalletUiConfig:r.legacy_wallet_ui_config,telegramAuthConfiguration:n,fundingConfig:i}}catch(e){throw eJ(e)}}async getUsdTokenPrice(e){try{return(await this.api.get(`/api/v1/token_price?chainId=${e.id}&tokenSymbol=${e.nativeCurrency.symbol}`)).usd}catch{console.error(`Unable to fetch token price for chain with id ${e.id}`);return}}async requestFarcasterSignerStatus(e){try{return await this.api.post("/api/v1/farcaster/signer/status",{ed25519_public_key:e})}catch(e){throw console.error("Unable to fetch Farcaster signer status"),e}}async forkSession(){return await this.session.forkSession()}async generateSiweNonce({address:e,captchaToken:t}){try{return(await this.api.post("/api/v1/siwe/init",{address:e,token:t})).nonce}catch(e){throw eJ(e)}}async authenticateWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){return await this.api.post("/api/v1/siwe/authenticate",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})}async linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){return await this.api.post("/api/v1/siwe/link",{message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})}async linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i}){try{let a=await this.linkWithSiweInternal({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i});return rE(a)}catch(e){throw eJ(e)}}};nk=new WeakSet,nE=function(){if(typeof window>"u")return null;try{let e=to.get(tB);if("string"==typeof e&&e.length>0)return e}catch{}let e=(0,f.Z)();try{return to.put(tB,e),e}catch{return e}};var nI=(0,o.createContext)({siteKey:"",enabled:!1,appId:void 0,token:void 0,error:void 0,status:"disabled",setToken:np,setError:np,setExecuting:np,waitForResult:()=>Promise.resolve(""),ref:{current:null},remove:np,reset:np,execute:np}),nW=class extends eV{constructor(e,t,r){super(e||"Captcha failed"),this.type="Captcha",t instanceof Error&&(this.cause=t),this.privyErrorCode=r}},nL=({children:e,id:t,captchaSiteKey:r,captchaEnabled:n})=>{let i=(0,o.useRef)(null),[a,s]=(0,o.useState)(),[l,c]=(0,o.useState)(),[d,h]=(0,o.useState)(!1),u=(0,o.useMemo)(()=>n?d||a||l?!d||a||l?a&&!l?{status:"success",token:a}:l?{status:"error",error:l}:{status:"ready"}:{status:"loading"}:{status:"ready"}:{status:"disabled"},[n,a,l,d]);return(0,m.jsx)(nI.Provider,{value:{...u,ref:i,enabled:n,siteKey:r,appId:t,setToken:s,setError:c,setExecuting:h,remove(){n&&(i.current?.remove(),h(!1),c(void 0),s(void 0))},reset(){n&&(i.current?.reset(),h(!1),c(void 0),s(void 0))},execute(){n&&(h(!0),i.current?.execute())},async waitForResult(){if(!n)return"";try{return await function(e,{interval:t=100,timeout:r=5e3}={}){return new Promise((n,i)=>{let a=0,o,s=()=>{if(a>=r){i("Max attempts reached without result");return}if(o=e(),a+=t,null!=o){n(o);return}setTimeout(s,t)};s()})}(()=>i.current?.getResponse(),{interval:200,timeout:2e4})}catch{throw new nW("Captcha failed",null,"captcha_timeout")}}},children:e})},nF=()=>(0,o.useContext)(nI),nU=e=>{let{enabled:t,siteKey:r,appId:n,setError:i,setToken:a,setExecuting:s,ref:l}=nF(),[,c]=(0,o.useMemo)(()=>r?.split("t:")||[],[r]);if((0,o.useEffect)(()=>l.current?.remove,[]),!t)return null;if(!c)throw Error("Unsupported captcha site key");return(0,m.jsx)("div",{className:"hidden h-0 w-0",children:(0,m.jsx)(E.Nc,{...e,ref:l,siteKey:c,options:{action:n,size:"invisible",...e.delayedExecution?{appearance:"execute",execution:"execute"}:{appearance:"always",execution:"render"}},onUnsupported:()=>{e.onUnsupported?.(),console.warn("Browser does not support Turnstile.")},onError:()=>{e.onError?.(),i("Captcha failed"),s(!1)},onSuccess:t=>{e.onSuccess?.(t),a(t),s(!1)},onExpire:()=>{e.onExpire?.();try{l.current?.reset(),i(void 0),a(void 0)}catch{i("expired_and_failed_reset")}}})})},nD=(0,o.createContext)({isNewUserThisSession:!1,linkingOrConnectingHint:null,walletConnectionStatus:null,connectors:[],rpcConfig:{rpcUrls:{}},showFiatPrices:!0,chains:[],clientAnalyticsId:null,pendingTransaction:null,appId:"notAdded",nativeTokenSymbolForChainId:np,initializeWalletProxy:np,getAuthMeta:np,getAuthFlow:np,closePrivyModal:np,openPrivyModal:np,connectWallet:np,initLoginWithWallet:np,loginWithWallet:np,initLoginWithFarcaster:np,loginWithFarcaster:np,loginWithCode:np,initLoginWithEmail:np,initLoginWithSms:np,initUpdateEmail:np,initUpdatePhone:np,resendEmailCode:np,resendSmsCode:np,initLoginWithHeadlessOAuth:np,loginWithHeadlessOAuth:np,crossAppAuthFlow:np,initLoginWithOAuth:np,recoveryOAuthFlow:np,loginWithOAuth:np,initLoginWithPasskey:np,loginWithPasskey:np,initLinkWithPasskey:np,linkWithPasskey:np,refreshUser:np,loginWithGuestAccountFlow:np,walletProxy:null,createAnalyticsEvent:np,acceptTerms:np,getUsdTokenPrice:np,recoverEmbeddedEthereumWallet:np,getMoonpaySignedUrl:np,initCoinbaseOnRamp:np,getCoinbaseOnRampStatus:np,updateWallets:np,fundWallet:np,setReadyToTrue:np,requestFarcasterSignerStatus:np,initLoginWithTelegram:np,loginWithTelegram:np,generateSiweMessage:np,linkWithSiwe:np,embeddedSolanaWallet:null,createEmbeddedSolanaWallet:np,recoverEmbeddedSolanaWallet:np,solanaSignMessage:np}),nZ=()=>(0,o.useContext)(nD),nz=(0,o.createContext)({ready:!1,authenticated:!1,user:null,walletConnectors:null,connectWallet:np,login:np,connectOrCreateWallet:np,linkEmail:np,linkPhone:np,linkFarcaster:np,linkWallet:np,linkCrossAppAccount:np,linkGoogle:np,linkTwitter:np,linkDiscord:np,linkGithub:np,linkSpotify:np,linkInstagram:np,linkTelegram:np,linkTiktok:np,linkLinkedIn:np,linkApple:np,linkPasskey:np,updateEmail:np,updatePhone:np,logout:np,getAccessToken:np,getEthereumProvider:np,getEthersProvider:np,getWeb3jsProvider:np,unlinkEmail:np,unlinkPhone:np,unlinkWallet:np,unlinkGoogle:np,unlinkTwitter:np,unlinkDiscord:np,unlinkGithub:np,unlinkSpotify:np,unlinkInstagram:np,unlinkTiktok:np,unlinkLinkedIn:np,unlinkApple:np,unlinkCrossAppAccount:np,unlinkFarcaster:np,unlinkTelegram:np,unlinkPasskey:np,setActiveWallet:np,forkSession:np,createWallet:np,importWallet:np,signMessage:np,signTypedData:np,enrollInMfa:np,initEnrollmentWithSms:np,initEnrollmentWithTotp:np,initEnrollmentWithPasskey:np,promptMfa:np,init:np,submitEnrollmentWithSms:np,submitEnrollmentWithTotp:np,submitEnrollmentWithPasskey:np,unenroll:np,submit:np,cancel:np,sendTransaction:np,exportWallet:np,setWalletPassword:np,setWalletRecovery:np,requestFarcasterSignerFromWarpcast:np,getFarcasterSignerPublicKey:np,signFarcasterMessage:np,createGuestAccount:np,initLoginWithEmail:np,initLoginWithSms:np,otpState:{status:"initial"},loginWithCode:np,fundWallet:np,initLoginWithHeadlessOAuth:np,loginWithHeadlessOAuth:np,generateSiweMessage:np,linkWithSiwe:np,signMessageWithCrossAppWallet:np,signTypedDataWithCrossAppWallet:np,sendTransactionWithCrossAppWallet:np,isHeadlessOAuthLoading:!1,isModalOpen:!1,mfaMethods:[]}),n$=()=>(0,o.useContext)(nz),nH=e=>{let[t,r]=(0,o.useState)("auto");return(0,o.useEffect)(()=>{let t=new ResizeObserver(e=>{r(e[0]?.contentRect.height??"auto")});return e.current&&t.observe(e.current),()=>{e.current&&t.unobserve(e.current)}},[e.current]),t},nB={login:{onComplete:[],onError:[],onOAuthLoginComplete:[]},logout:{onSuccess:[]},connectWallet:{onSuccess:[],onError:[]},createWallet:{onSuccess:[],onError:[]},linkAccount:{onSuccess:[],onError:[]},configureMfa:{onMfaRequired:[]},setWalletPassword:{onSuccess:[],onError:[]},setWalletRecovery:{onSuccess:[],onError:[]},signMessage:{onSuccess:[],onError:[]},signTypedData:{onSuccess:[],onError:[]},sendTransaction:{onSuccess:[],onError:[]},accessToken:{onAccessTokenGranted:[],onAccessTokenRemoved:[]},oAuthAuthorization:{onOAuthTokenGrant:[]},fundWallet:{onUserExited:[]}},nq=(0,o.createContext)(void 0),nV=()=>(0,o.useContext)(nq);function nG(e,t){if(!t)return;let r=nV().current[e];return(0,o.useEffect)(()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]?.push(i);return()=>{for(let[n,i]of Object.entries(t))r.hasOwnProperty(n)||console.warn(`Invalid event type "${n}" for action "${e}"`),r[n]=r[n]?.filter(e=>e!==i)}},[t])}function nK(e,t,r,...n){for(let i of e.current[t][r])i(...n)}function nY(){let e=nV();return(t,r,...n)=>nK(e,t,r,...n)}var nQ=({success:e,fail:t})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(nX,{className:e?"success":t?"fail":""}),(0,m.jsx)(nJ,{className:e?"success":t?"fail":""})]}),nX=A.ZP.span` && { width: 82px; height: 82px; border-width: 4px; border-style: solid; border-color: ${e=>e.color??"var(--privy-color-accent)"}; border-bottom-color: transparent; border-radius: 50%; display: inline-block; box-sizing: border-box; animation: rotation 1.2s linear infinite; transition: border-color 800ms; } @keyframes rotation { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } } &&&.success { border-color: var(--privy-color-success); border-bottom-color: var(--privy-color-success); } &&&.fail { border-color: var(--privy-color-error); border-bottom-color: var(--privy-color-error); } `,nJ=(0,A.ZP)(nX)` && { border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"}; animation: none; opacity: 0.5; } `,n0=e=>(0,m.jsx)(n1,{color:e.color||"var(--privy-color-foreground-3)"}),n1=(0,A.ZP)(nX)` && { height: 1rem; width: 1rem; margin: 2px 0; border-width: 1.5px; /* Override default Loader to match button transitions */ transition: border-color 200ms ease; } `,n2=A.ZP.button` display: flex; flex-direction: row; align-items: center; justify-content: center; user-select: none; & { width: 100%; cursor: pointer; border-radius: var(--privy-border-radius-md); font-size: 1rem; font-style: normal; font-weight: 500; line-height: 22px; /* 137.5% */ letter-spacing: -0.016px; } && { padding: 12px 16px; } `,n3=({children:e,loading:t,disabled:r,loadingText:n="Loading...",...i})=>(0,m.jsx)(n7,{disabled:t||r,...i,children:t?(0,m.jsxs)("span",{children:[(0,m.jsx)(n0,{}),n?(0,m.jsx)("span",{children:n}):null]}):e}),n4=({children:e,loading:t,disabled:r,...n})=>(0,m.jsx)(n5,{disabled:r,...n,children:t?(0,m.jsx)(n0,{color:"var(--privy-color-foreground-accent)"}):e}),n5=(0,A.ZP)(n2)` position: relative; && { background-color: var(--privy-color-accent); color: var(--privy-color-foreground-accent); transition: background-color 200ms ease; } &:hover { background-color: var(--privy-color-accent-dark); } &:active { background-color: var(--privy-color-accent-dark); } &:disabled, &:hover:disabled, &:active:disabled { cursor: not-allowed; pointer-events: none; color: var(--privy-color-foreground-accent); background-color: var(--privy-color-accent-dark); } `,n6=({children:e,loading:t,disabled:r,loadingText:n="Loading...",...i})=>(0,m.jsx)(n7,{as:"a",disabled:t||r,...i,children:t?(0,m.jsxs)("span",{children:[(0,m.jsx)(n0,{}),n?(0,m.jsx)("span",{children:n}):null]}):e}),n7=(0,A.ZP)(n2)` position: relative; && { background-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-accent)"}; color: var(--privy-color-foreground-accent); transition: background-color 200ms ease; } &:hover { background-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-accent-dark)"}; } &:active { background-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-accent-dark)"}; } &:hover:disabled, &:active:disabled { background-color: var(--privy-color-background-2); color: var(--privy-color-foreground-3); cursor: not-allowed; } /* If an anchor tag, :disabled isn't a thing, so manually set state */ ${e=>e.disabled?(0,A.iv)` &&&, &&&:hover, &&&:active { background-color: var(--privy-color-background-2); color: var(--privy-color-foreground-3); cursor: not-allowed; pointer-events: none; } `:""} > span { display: flex; align-items: center; gap: 8px; opacity: 1; animation: fadein 200ms ease; } `,n8=({children:e,loading:t,disabled:r,loadingText:n="Loading...",...i})=>(0,m.jsx)(n9,{disabled:t||r,...i,children:t?(0,m.jsxs)("span",{children:[(0,m.jsx)(n0,{}),n?(0,m.jsx)("span",{children:n}):null]}):e}),n9=(0,A.ZP)(n2)` && { border-width: 1px; border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-4)"}; color: var(--privy-color-foreground); transition: border-color 200ms ease; } &:hover, &:active { border-color: ${e=>e.warn?"var(--privy-color-error)":"var(--privy-color-foreground-3)"}; } &:hover:disabled, &:active:disabled { border-color: var(--privy-color-foreground-accent); color: var(--privy-color-foreground-3); cursor: not-allowed; } > span { display: flex; align-items: center; gap: 8px; opacity: 1; animation: fadein 200ms ease; } `,ie=A.ZP.button` && { padding: 12px 16px; font-weight: 500; text-align: center; color: var(--privy-color-foreground-accent); background-color: var(--privy-color-accent); border-radius: var(--privy-border-radius-sm); min-width: 144px; opacity: ${e=>e.invisible?"0":"1"}; transition: opacity 200ms ease, background-color 200ms ease, color 200ms ease; user-select: none; ${e=>e.invisible&&(0,A.iv)` pointer-events: none; `} &:hover { background-color: var(--privy-color-accent-dark); } &:active { background-color: var(--privy-color-accent-dark); } &:hover:disabled, &:active:disabled { background-color: var(--privy-color-background-2); color: var(--privy-color-foreground-3); cursor: not-allowed; } } `,it=(A.ZP.div` /* Set to match height of SoftCtaButton to avoid reflow if conditionally rendered */ height: 44px; `,({children:e,onClick:t,disabled:r,isSubmitting:n,...i})=>(0,m.jsxs)(ir,{isSubmitting:n,onClick:t,disabled:r,...i,children:[(0,m.jsx)("span",{children:e}),(0,m.jsx)("span",{children:(0,m.jsx)(n0,{})})]})),ir=A.ZP.button` && { color: var(--privy-color-accent); font-size: 16px; font-style: normal; font-weight: 500; line-height: 24px; cursor: pointer; border-radius: 0px var(--privy-border-radius-mdlg) var(--privy-border-radius-mdlg) 0px; border: none; transition: color 200ms ease; /* Tablet and Up */ @media (min-width: 441px) { font-size: 14px; } :hover { color: var(--privy-color-accent-dark); } && > :first-child { opacity: ${e=>e.isSubmitting?0:1}; } && > :last-child { position: absolute; display: flex; top: 50%; left: 50%; transform: translate3d(-50%, -50%, 0); /** Will map to the opposite of first span */ opacity: ${e=>e.isSubmitting?1:0}; } :disabled, :hover:disabled { color: var(--privy-color-foreground-3); cursor: not-allowed; } } `,ii=A.ZP.span` && { width: 82px; height: 82px; border-width: 4px; border-style: solid; border-color: ${e=>e.color??"var(--privy-color-accent)"}; background-color: ${e=>e.color??"var(--privy-color-accent)"}; border-radius: 50%; display: inline-block; box-sizing: border-box; } `,ia=({backFn:e})=>(0,m.jsx)("div",{children:(0,m.jsx)(ic,{onClick:e,children:(0,m.jsx)(T.Z,{height:"16px",width:"16px",strokeWidth:2})})}),io=({infoFn:e})=>(0,m.jsx)("div",{children:(0,m.jsx)(id,{"aria-label":"info",onClick:e,children:(0,m.jsx)(S.Z,{height:"22px",width:"22px",strokeWidth:2})})}),is=e=>(0,m.jsx)("div",{children:(0,m.jsx)(ic,{"aria-label":"close modal",onClick:e.onClose,children:(0,m.jsx)(P.Z,{height:"16px",width:"16px",strokeWidth:2})})}),il=({backFn:e,infoFn:t,onClose:r,title:n,closeable:i=!0})=>{let{closePrivyModal:a}=nZ(),o=nh();return(0,m.jsxs)(ih,{children:[(0,m.jsxs)(iu,{children:[e&&(0,m.jsx)(ia,{backFn:e}),t&&(0,m.jsx)(io,{infoFn:t})]}),n&&(0,m.jsx)(im,{id:"privy-dialog-title",children:n}),(0,m.jsx)(ip,{children:!o.render.standalone&&i&&(0,m.jsx)(is,{onClose:r||(()=>a())})})]})},ic=A.ZP.button` && { cursor: pointer; display: flex; opacity: 0.6; background-color: var(--privy-color-background-2); border-radius: var(--privy-border-radius-full); padding: 4px; > svg { margin: auto; color: var(--privy-color-foreground); } :hover { opacity: 1; } } `,id=(0,A.ZP)(ic)` && { background-color: transparent; } `,ih=A.ZP.div` padding: 16px 0; display: flex; align-items: center; justify-content: space-between; h2 { font-size: 16px; line-height: 24px; font-weight: 600; color: var(--privy-color-foreground); } `,iu=A.ZP.div` flex: 1; align-items: center; display: flex; gap: 8px; `,ip=A.ZP.div` flex: 1; display: flex; justify-content: flex-end; `,im=A.ZP.div` overflow: hidden; white-space: nowrap; max-width: 100%; text-overflow: ellipsis; text-align: center; color: var(--privy-color-foreground-2); `,ig=A.ZP.div` display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; height: 82px; > div { position: relative; } > div > span { position: absolute; left: -41px; top: -41px; } > div > :last-child { position: absolute; left: -19px; top: -19px; } `,iy=A.ZP.div` text-align: left; flex-grow: 1; `,iw=A.ZP.div` display: flex; flex-direction: column; justify-content: flex-end; flex-grow: 1; `,ix=A.ZP.div` display: flex; flex-direction: column; gap: 12px; /* for Internet Explorer, Edge */ -ms-overflow-style: none; /* for Firefox */ scrollbar-width: none; /* for Chrome, Safari, and Opera */ &::-webkit-scrollbar { display: none; } `,iv=(0,A.ZP)(ix)` ${e=>"light"===e.colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(0, 0, 0, 0) 20%, rgba(0, 0, 0, 0.06)) bottom;":"dark"===e.colorScheme?"background: linear-gradient(var(--privy-color-background), var(--privy-color-background) 70%) bottom, linear-gradient(rgba(255, 255, 255, 0) 20%, rgba(255, 255, 255, 0.06)) bottom;":void 0} background-repeat: no-repeat; background-size: 100% 32px, 100% 16px; background-attachment: local, scroll; `,iC=(0,A.iv)` && { width: 100%; font-size: 16px; line-height: 24px; /* Tablet and Up */ @media (min-width: 440px) { font-size: 14px; } display: flex; gap: 12px; align-items: center; padding: 12px 16px; border: 1px solid var(--privy-color-foreground-4) !important; border-radius: var(--privy-border-radius-mdlg); transition: background-color 200ms ease; cursor: pointer; &:hover { background-color: var(--privy-color-background-2); } &:disabled { cursor: pointer; background-color: var(--privy-color-background-2); } svg { height: 24px; max-height: 24px; max-width: 24px; } } `,ib=A.ZP.div` text-align: center; font-size: 14px; margin-bottom: 24px; `,i_=A.ZP.button` ${iC} `,ij=A.ZP.a` ${iC} `,ik=A.ZP.div` width: 100%; height: 100%; min-height: inherit; display: flex; flex-direction: column; ${e=>e.if?"display: none;":""} `,iE=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; padding-bottom: 16px; margin-top: 24px; `,iA=A.ZP.div` display: flex; flex-direction: column; gap: 8px; `,iS=A.ZP.div` margin-top: 16px; font-size: 13px; text-align: center; color: var(--privy-color-foreground-3); && > a { color: var(--privy-color-accent); } `;function iT(e){let{legal:{privacyPolicyUrl:t,termsAndConditionsUrl:r,requireUsersAcceptTerms:n}}=e.app;if(n&&!e.alwaysShowImplicitConsent||!r&&!t)return(0,m.jsx)(iS,{});let i=!!(t&&r);return(0,m.jsxs)(iS,{children:["By logging in I agree to the"," ",r&&(0,m.jsx)("a",{href:r,target:"_blank",children:i?"Terms":"Terms of Service"}),i&&" & ",t&&(0,m.jsx)("a",{href:t,target:"_blank",children:"Privacy Policy"})]})}var iP=()=>(0,m.jsxs)(iN,{children:[(0,m.jsx)(rG,{}),(0,m.jsx)("a",{href:"https://www.privy.io/",target:"_blank",children:"Protected by Privy"})]}),iN=A.ZP.div` display: flex; align-items: center; justify-content: center; padding-top: 8px; padding-bottom: 12px; gap: 2px; font-size: 13px; && svg { height: 14px; width: 14px; margin-bottom: 2px; opacity: 0.5; } && a { color: var(--privy-color-foreground-3); &:hover { text-decoration: underline; } } @media all and (display-mode: standalone) { padding-bottom: 30px; } `,iR=A.ZP.div` display: flex; flex-direction: column; align-items: center; padding: 0px 0px 30px; @media (max-width: 440px) { padding: 10px 10px 20px; } `,iM=A.ZP.div` font-size: 18px; line-height: 30px; text-align: center; font-weight: 600; margin-bottom: 10px; `,iO=A.ZP.div` font-size: 0.875rem; text-align: center; `,iI=A.ZP.div` display: flex; flex-direction: column; align-items: center; gap: 10px; flex-grow: 1; padding: 20px 0; @media (max-width: 440px) { padding: 10px 10px 20px; } `,iW=A.ZP.div` display: flex; flex-direction: column; align-items: stretch; gap: 0.75rem; padding: 1rem 0rem 0rem; flex-grow: 1; width: 100%; `,iL=A.ZP.div` width: 25px; display: flex; align-items: center; justify-content: flex-start; > svg { z-index: 2; height: 25px !important; width: 25px !important; color: var(--privy-color-accent); } `,iF=A.ZP.div` display: flex; align-items: center; gap: 10px; font-size: 0.875rem; line-height: 1rem; text-align: left; `,iU=A.ZP.div` display: flex; flex-direction: column; gap: 10px; padding-top: 20px; `,iD=A.ZP.div` display: flex; flex-direction: column; align-items: stretch; gap: 1rem; padding: 1rem 0rem 0rem; flex-grow: 1; width: 100%; `,iZ=A.ZP.div` display: flex; gap: 5px; width: 100%; `,iz=A.ZP.button` && { background-color: transparent; color: var(--privy-color-foreground-3); padding: 0 10px; display: flex; align-items: center; > svg { z-index: 2; height: 20px !important; width: 20px !important; } } &&:hover { color: var(--privy-color-error); } `,i$=A.ZP.div` display: flex; align-items: center; gap: 0.5rem; > svg { z-index: 2; height: 20px !important; width: 20px !important; } `,iH=A.ZP.div` display: flex; align-items: center; gap: 6px; font-weight: 400 !important; color: ${e=>e.isAccent?"var(--privy-color-accent)":"var(--privy-color-foreground-3)"}; > svg { z-index: 2; height: 18px !important; width: 18px !important; display: flex !important; align-items: flex-end; } `,iB=A.ZP.div` width: 100%; display: flex; justify-content: space-between; `,iq=A.ZP.p` text-align: left; width: 100%; color: var(--privy-color-foreground-3) !important; `,iV=A.ZP.button` display: flex; flex-direction: row; align-items: center; justify-content: center; user-select: none; & { width: 100%; cursor: pointer; border-radius: var(--privy-border-radius-md); font-size: 0.875rem; line-height: 1rem; font-style: normal; font-weight: 500; line-height: 22px; /* 137.5% */ letter-spacing: -0.016px; } && { color: ${e=>"dark"===e.theme?"var(--privy-color-foreground-2)":"var(--privy-color-accent)"}; background-color: transparent; padding: 0.5rem 0px; } &:hover { text-decoration: underline; } `,iG=A.ZP.div` display: flex; align-items: center; justify-content: center; width: 90px; height: 90px; border-radius: 50%; background-color: ${({status:e})=>"success"===e?"var(--privy-color-success)":"var(--privy-color-accent)"}; > svg { z-index: 2; height: 50px !important; width: auto !important; color: white; } `,iK=A.ZP.div` color: var(--privy-color-error); `,iY=({termsAndConditionsUrl:e,privacyPolicyUrl:t,onAccept:r,onDecline:n})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{closeable:!1}),(0,m.jsx)(R.Z,{width:56,height:56,fill:"var(--privy-color-accent)",style:{margin:"auto"}}),(0,m.jsx)(iM,{style:{marginTop:24},children:"One last step"}),(0,m.jsx)(iO,{children:"By signing up, you agree to our terms and privacy policy."}),(0,m.jsxs)(ix,{style:{marginTop:24},children:[e&&(0,m.jsxs)(ij,{target:"_blank",href:e,children:["View Terms ",(0,m.jsx)(N.Z,{style:{marginLeft:"auto"}})]}),t&&(0,m.jsxs)(ij,{target:"_blank",href:t,children:["View Privacy Policy ",(0,m.jsx)(N.Z,{style:{marginLeft:"auto"}})]})]}),(0,m.jsxs)(iQ,{style:{marginTop:24},children:[(0,m.jsx)(n8,{onClick:n,children:"No thanks"}),(0,m.jsx)(n3,{onClick:r,children:"Accept"})]}),(0,m.jsx)(iP,{})]}),iQ=A.ZP.div` display: flex; gap: 10px; `,iX=A.ZP.span` && { width: 82px; height: 82px; border-width: 4px; border-style: solid; border-color: ${e=>e.color??"var(--privy-color-accent)"}; border-bottom-color: transparent; border-radius: 50%; display: inline-block; box-sizing: border-box; animation: rotation 1.2s linear infinite; transition: border-color 800ms; border-bottom-color: ${e=>e.color??"var(--privy-color-accent)"}; } `,iJ=({style:e,...t})=>(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...t,children:(0,m.jsx)("path",{fillRule:"evenodd",d:"M12 1.5a5.25 5.25 0 00-5.25 5.25v3a3 3 0 00-3 3v6.75a3 3 0 003 3h10.5a3 3 0 003-3v-6.75a3 3 0 00-3-3v-3c0-2.9-2.35-5.25-5.25-5.25zm3.75 8.25v-3a3.75 3.75 0 10-7.5 0v3h7.5z",clipRule:"evenodd"})}),i0=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; padding-bottom: 16px; `,i1=A.ZP.div` display: flex; flex-direction: column; gap: 8px; `,i2=A.ZP.div` display: flex; flex-direction: column; align-items: flex-start; justify-content: flex-end; margin-top: auto; gap: 16px; flex-grow: 100; `,i3=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; flex-grow: 1; width: 100%; `,i4=A.ZP.div` display: flex; flex-direction: column; align-items: center; width: 100%; `,i5=(0,A.ZP)(i3)` padding: 20px 0; `,i6=(0,A.ZP)(i3)` gap: 16px; `,i7=A.ZP.div` display: flex; flex-direction: column; width: 100%; `,i8=A.ZP.div` display: flex; flex-direction: column; gap: 8px; `,i9=(A.ZP.div` display: flex; flex-direction: column; justify-content: space-between; height: 100%; `,A.ZP.div` display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; text-align: left; gap: 8px; padding: 16px; margin-top: 16px; margin-bottom: 16px; width: 100%; background: var(--privy-color-background-2); border-radius: var(--privy-border-radius-md); && h4 { color: var(--privy-color-foreground-3); font-size: 14px; text-decoration: underline; font-weight: medium; } && p { color: var(--privy-color-foreground-3); font-size: 14px; } `),ae=A.ZP.div` height: 16px; `,at=A.ZP.div` height: 12px; `,ar=A.ZP.div` position: relative; `,an=A.ZP.div` height: ${e=>e.height??"12"}px; `,ai=A.ZP.div` background-color: var(--privy-color-accent); display: flex; justify-content: center; align-items: center; border-radius: 50%; border-color: white; border-width: 2px !important; `,aa=({title:e,description:t,children:r,...n})=>(0,m.jsx)(al,{...n,children:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("h3",{children:e}),"string"==typeof t?(0,m.jsx)("p",{children:t}):t,r]})}),ao=(0,A.ZP)(aa)` margin-bottom: 24px; `,as=({title:e,description:t,icon:r,children:n,...i})=>(0,m.jsxs)(ac,{...i,children:[r||null,(0,m.jsx)("h3",{children:e}),t&&"string"==typeof t?(0,m.jsx)("p",{children:t}):t,n]}),al=A.ZP.div` display: flex; flex-direction: column; justify-content: flex-start; align-items: flex-start; text-align: left; gap: 8px; width: 100%; margin-bottom: 24px; && h3 { font-size: 17px; color: var(--privy-color-foreground); } /* Sugar assuming children are paragraphs. Otherwise, handling styling on your own */ && p { color: var(--privy-color-foreground-2); font-size: 14px; } `,ac=(0,A.ZP)(al)` align-items: center; text-align: center; gap: 16px; h3 { margin-bottom: 24px; } `,ad=Array(6).fill(""),ah=A.ZP.div` display: flex; flex-direction: column; align-items: flex-start; justify-content: center; margin: auto; gap: 16px; flex-grow: 1; `,au=A.ZP.div` display: flex; flex-direction: column; width: 100%; gap: 8px; > div:last-child { display: flex; justify-content: center; gap: 0.5rem; width: 100%; border-radius: var(--privy-border-radius-md); > input { border: 1px solid var(--privy-color-foreground-4); background: var(--privy-color-background); border-radius: var(--privy-border-radius-md); padding: 8px 10px; height: 58px; width: 46px; text-align: center; font-size: 18px; } > input:focus { border: 1px solid var(--privy-color-accent); } > input:invalid { border: 1px solid var(--privy-color-error); } > input.success { border: 1px solid var(--privy-color-success); } > input.fail { border: 1px solid var(--privy-color-error); animation: shake 180ms; animation-iteration-count: 2; } } @keyframes shake { 0% { transform: translate(1px, 0px); } 33% { transform: translate(-1px, 0px); } 67% { transform: translate(-1px, 0px); } 100% { transform: translate(1px, 0px); } } `,ap=A.ZP.div` line-height: 20px; height: 20px; font-size: 13px; color: ${e=>e.success?"var(--privy-color-success)":e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"}; display: flex; justify-content: flex-end; width: 100%; `,am=A.ZP.div` font-size: 13px; color: var(--privy-color-foreground); display: flex; gap: 8px; align-items: center; width: 100%; margin-top: 16px; // Equal opposing size buffer to account for auto margining when the // success/fail text does not show up padding-bottom: 32px; `,ag=A.ZP.div` color: var(--privy-color-accent); padding: 2px 0; > button { text-decoration: underline; } `,af=A.ZP.div` display: flex; align-items: center; justify-content: center; border-radius: var(--privy-border-radius-sm); padding: 2px 8px; gap: 4px; background: var(--privy-color-background-2); color: var(--privy-color-foreground-2); `,ay=A.ZP.span` font-weight: 500; word-break: break-all; `,aw=({icon:e})=>(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(ax,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{}),"string"==typeof e?(0,m.jsx)("span",{style:{background:`url('${e}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):e?(0,m.jsx)(e,{style:{width:"38px",height:"38px"}}):(0,m.jsx)("span",{})]})})}),ax=A.ZP.div` display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; height: 82px; > div { position: relative; } > div > span { position: absolute; left: -41px; top: -41px; } > div > :last-child { position: absolute; left: -19px; top: -19px; } `,av=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; `,aC=({icon:e,name:t})=>"string"==typeof e?(0,m.jsx)("img",{alt:`${t||"wallet"} logo`,src:e,style:{height:24,width:24,borderRadius:4}}):e?(0,m.jsx)(e,{}):null,ab=(0,A.F4)` from, to { background: var(--privy-color-foreground-4); color: var(--privy-color-foreground-4); } 50% { background: var(--privy-color-foreground-accent); color: var(--privy-color-foreground-accent); } `,a_=(0,A.iv)` ${e=>e.$isLoading?(0,A.iv)` width: 35%; animation: ${ab} 2s linear infinite; border-radius: var(--privy-border-radius-sm); `:""} `,aj=({children:e,color:t,isLoading:r,isPulsing:n,className:i})=>(0,m.jsx)(ak,{$color:t,$isLoading:r,$isPulsing:n,className:i,children:e}),ak=A.ZP.span` padding: 0.125rem 0.5rem; font-size: 0.75rem; font-weight: 500; line-height: 1.125rem; /* 150% */ border-radius: var(--privy-border-radius-sm); ${e=>{let t,r;"green"===e.$color&&(t="var(--privy-color-success-dark)",r="var(--privy-color-success-light)"),"red"===e.$color&&(t="var(--privy-color-error)",r="var(--privy-color-error-light)"),"gray"===e.$color&&(t="var(--privy-color-foreground-2)",r="var(--privy-color-background-2)");let n=(0,A.F4)` from, to { background-color: ${r}; } 50% { background-color: rgba(${r}, 0.8); } `;return(0,A.iv)` color: ${t}; background-color: ${r}; ${e.$isPulsing&&(0,A.iv)` animation: ${n} 3s linear infinite; `}; `}} ${a_} `,aE=({...e})=>(0,m.jsxs)("svg",{width:"146",height:"146",viewBox:"0 0 146 146",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,m.jsx)("circle",{cx:"73",cy:"73",r:"73",fill:"#0052FF"}),(0,m.jsx)("path",{d:"M73.323 123.729C101.617 123.729 124.553 100.832 124.553 72.5875C124.553 44.343 101.617 21.4463 73.323 21.4463C46.4795 21.4463 24.4581 42.0558 22.271 68.2887H89.9859V76.8864H22.271C24.4581 103.119 46.4795 123.729 73.323 123.729Z",fill:"white"})]}),aA={coinbase_wallet:{logo:rT,displayName:"Coinbase Wallet",rdns:"com.coinbase.wallet"},coinbase_smart_wallet:{logo:rT,displayName:"Coinbase Smart Wallet",rdns:"com.coinbase.wallet"},metamask:{logo:rQ,displayName:"MetaMask",rdns:"io.metamask"},phantom:{logo:rX,displayName:"Phantom"},rainbow:{logo:({style:e,...t})=>(0,m.jsxs)("svg",{width:"120",height:"120",viewBox:"0 0 120 120",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,m.jsx)("g",{clipPath:"url(#clip0_5_32)",children:(0,m.jsxs)("g",{clipPath:"url(#clip1_5_32)",children:[(0,m.jsx)("mask",{id:"mask0_5_32",style:{maskType:"alpha"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"120",height:"120",children:(0,m.jsx)("path",{d:"M78.163 0H41.837C29.79 0 23.767 0 17.283 2.04999C10.203 4.62701 4.627 10.203 2.05 17.283C0 23.767 0 29.791 0 41.837V78.163C0 90.21 0 96.232 2.05 102.717C4.627 109.797 10.203 115.373 17.283 117.949C23.767 120 29.79 120 41.837 120H78.163C90.21 120 96.232 120 102.717 117.949C109.797 115.373 115.373 109.797 117.95 102.717C120 96.232 120 90.21 120 78.163V41.837C120 29.791 120 23.767 117.95 17.283C115.373 10.203 109.797 4.62701 102.717 2.04999C96.232 0 90.21 0 78.163 0Z",fill:"black"})}),(0,m.jsx)("g",{mask:"url(#mask0_5_32)",children:(0,m.jsx)("rect",{width:"120",height:"120",fill:"url(#paint0_linear_5_32)"})}),(0,m.jsx)("path",{d:"M20 38H26C56.9279 38 82 63.0721 82 94V100H94C97.3137 100 100 97.3137 100 94C100 53.1309 66.8691 20 26 20C22.6863 20 20 22.6863 20 26V38Z",fill:"url(#paint1_radial_5_32)"}),(0,m.jsx)("path",{d:"M84 94H100C100 97.3137 97.3137 100 94 100H84V94Z",fill:"url(#paint2_linear_5_32)"}),(0,m.jsx)("path",{d:"M26 20L26 36H20L20 26C20 22.6863 22.6863 20 26 20Z",fill:"url(#paint3_linear_5_32)"}),(0,m.jsx)("path",{d:"M20 36H26C58.0325 36 84 61.9675 84 94V100H66V94C66 71.9086 48.0914 54 26 54H20V36Z",fill:"url(#paint4_radial_5_32)"}),(0,m.jsx)("path",{d:"M68 94H84V100H68V94Z",fill:"url(#paint5_linear_5_32)"}),(0,m.jsx)("path",{d:"M20 52L20 36L26 36L26 52H20Z",fill:"url(#paint6_linear_5_32)"}),(0,m.jsx)("path",{d:"M20 62C20 65.3137 22.6863 68 26 68C40.3594 68 52 79.6406 52 94C52 97.3137 54.6863 100 58 100H68V94C68 70.804 49.196 52 26 52H20V62Z",fill:"url(#paint7_radial_5_32)"}),(0,m.jsx)("path",{d:"M52 94H68V100H58C54.6863 100 52 97.3137 52 94Z",fill:"url(#paint8_radial_5_32)"}),(0,m.jsx)("path",{d:"M26 68C22.6863 68 20 65.3137 20 62L20 52L26 52L26 68Z",fill:"url(#paint9_radial_5_32)"})]})}),(0,m.jsxs)("defs",{children:[(0,m.jsxs)("linearGradient",{id:"paint0_linear_5_32",x1:"60",y1:"0",x2:"60",y2:"120",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#174299"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#001E59"})]}),(0,m.jsxs)("radialGradient",{id:"paint1_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(74)",children:[(0,m.jsx)("stop",{offset:"0.770277",stopColor:"#FF4000"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,m.jsxs)("linearGradient",{id:"paint2_linear_5_32",x1:"83",y1:"97",x2:"100",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#FF4000"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#8754C9"})]}),(0,m.jsxs)("linearGradient",{id:"paint3_linear_5_32",x1:"23",y1:"20",x2:"23",y2:"37",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#8754C9"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#FF4000"})]}),(0,m.jsxs)("radialGradient",{id:"paint4_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(58)",children:[(0,m.jsx)("stop",{offset:"0.723929",stopColor:"#FFF700"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,m.jsxs)("linearGradient",{id:"paint5_linear_5_32",x1:"68",y1:"97",x2:"84",y2:"97",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#FFF700"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,m.jsxs)("linearGradient",{id:"paint6_linear_5_32",x1:"23",y1:"52",x2:"23",y2:"36",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#FFF700"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#FF9901"})]}),(0,m.jsxs)("radialGradient",{id:"paint7_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(26 94) rotate(-90) scale(42)",children:[(0,m.jsx)("stop",{offset:"0.59513",stopColor:"#00AAFF"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,m.jsxs)("radialGradient",{id:"paint8_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(51 97) scale(17 45.3333)",children:[(0,m.jsx)("stop",{stopColor:"#00AAFF"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,m.jsxs)("radialGradient",{id:"paint9_radial_5_32",cx:"0",cy:"0",r:"1",gradientUnits:"userSpaceOnUse",gradientTransform:"translate(23 69) rotate(-90) scale(17 322.37)",children:[(0,m.jsx)("stop",{stopColor:"#00AAFF"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#01DA40"})]}),(0,m.jsx)("clipPath",{id:"clip0_5_32",children:(0,m.jsx)("rect",{width:"120",height:"120",fill:"white"})}),(0,m.jsx)("clipPath",{id:"clip1_5_32",children:(0,m.jsx)("rect",{width:"120",height:"120",fill:"white"})})]})]}),displayName:"Rainbow",rdns:"me.rainbow"},wallet_connect:{logo:nw,displayName:"WalletConnect"},zerion:{logo:({style:e,...t})=>(0,m.jsxs)("svg",{width:"176",height:"176",viewBox:"0 0 176 176",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,m.jsxs)("g",{clipPath:"url(#clip0_1704_1423)",children:[(0,m.jsx)("path",{d:"M126.233 176H49.7672C22.287 176 0 153.723 0 126.233V49.7673C0 22.287 22.2769 0 49.7672 0H126.233C153.713 0 176 22.277 176 49.7673V126.233C176 153.723 153.713 176 126.233 176Z",fill:"#2461ED"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M100.667 85.6591C83.4133 76.3353 62.4196 64.2443 46.6192 54.3891C41.9573 51.0306 44.3234 43.9023 49.9578 43.9023H128.138C132.499 43.9023 135.416 48.7648 133.231 52.4442C127.977 61.5174 120.308 73.0368 113.901 82.1702C110.462 87.0727 104.858 87.9149 100.667 85.6591ZM75.5031 88.6867C92.1858 97.5795 115.566 111.104 132.178 121.33C137.311 124.498 135.266 132.098 129.271 132.098C119.46 132.098 103.518 132.1 87.6592 132.103C71.9639 132.105 56.3497 132.108 46.8398 132.108C42.0476 132.108 39.5913 127.135 41.6265 123.666C48.5041 111.946 56.2338 100.116 62.6603 91.2834C65.5176 87.3433 71.3325 86.461 75.5031 88.6867Z",fill:"white"})]}),(0,m.jsx)("defs",{children:(0,m.jsx)("clipPath",{id:"clip0_1704_1423",children:(0,m.jsx)("rect",{width:"176",height:"176",fill:"white"})})})]}),displayName:"Zerion",rdns:"io.zerion.wallet"},brave_wallet:{logo:({...e})=>(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 436.49 511.97",height:"24",width:"24",...e,children:[(0,m.jsx)("defs",{children:(0,m.jsxs)("linearGradient",{id:"brave-linear-gradient",x1:"-18.79",y1:"359.73",x2:"194.32",y2:"359.73",gradientTransform:"matrix(2.05, 0, 0, -2.05, 38.49, 992.77)",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{offset:"0",stopColor:"#f1562b"}),(0,m.jsx)("stop",{offset:"0.3",stopColor:"#f1542b"}),(0,m.jsx)("stop",{offset:"0.41",stopColor:"#f04d2a"}),(0,m.jsx)("stop",{offset:"0.49",stopColor:"#ef4229"}),(0,m.jsx)("stop",{offset:"0.5",stopColor:"#ef4029"}),(0,m.jsx)("stop",{offset:"0.56",stopColor:"#e83e28"}),(0,m.jsx)("stop",{offset:"0.67",stopColor:"#e13c26"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#df3c26"})]})}),(0,m.jsx)("path",{style:{fill:"url(#brave-linear-gradient)"},d:"M436.49,165.63,420.7,122.75l11-24.6A8.47,8.47,0,0,0,430,88.78L400.11,58.6a48.16,48.16,0,0,0-50.23-11.66l-8.19,2.89L296.09.43,218.25,0,140.4.61,94.85,50.41l-8.11-2.87A48.33,48.33,0,0,0,36.19,59.3L5.62,90.05a6.73,6.73,0,0,0-1.36,7.47l11.47,25.56L0,165.92,56.47,380.64a89.7,89.7,0,0,0,34.7,50.23l111.68,75.69a24.73,24.73,0,0,0,30.89,0l111.62-75.8A88.86,88.86,0,0,0,380,380.53l46.07-176.14Z"}),(0,m.jsx)("path",{style:{fill:"#fff"},d:"M231,317.33a65.61,65.61,0,0,0-9.11-3.3h-5.49a66.08,66.08,0,0,0-9.11,3.3l-13.81,5.74-15.6,7.18-25.4,13.24a4.84,4.84,0,0,0-.62,9l22.06,15.49q7,5,13.55,10.76l6.21,5.35,13,11.37,5.89,5.2a10.15,10.15,0,0,0,12.95,0l25.39-22.18,13.6-10.77,22.06-15.79a4.8,4.8,0,0,0-.68-8.93l-25.36-12.8L244.84,323ZM387.4,175.2l.8-2.3a61.26,61.26,0,0,0-.57-9.18,73.51,73.51,0,0,0-8.19-15.44l-14.35-21.06-10.22-13.88-19.23-24a69.65,69.65,0,0,0-5.7-6.67h-.4L321,84.25l-42.27,8.14a33.49,33.49,0,0,1-12.59-1.84l-23.21-7.5-16.61-4.59a70.52,70.52,0,0,0-14.67,0L195,83.1l-23.21,7.54a33.89,33.89,0,0,1-12.59,1.84l-42.22-8-8.54-1.58h-.4a65.79,65.79,0,0,0-5.7,6.67l-19.2,24Q77.81,120.32,73,127.45L58.61,148.51l-6.78,11.31a51,51,0,0,0-1.94,13.35l.8,2.3A34.51,34.51,0,0,0,52,179.81l11.33,13,50.23,53.39a14.31,14.31,0,0,1,2.55,14.34L107.68,280a25.23,25.23,0,0,0-.39,16l1.64,4.52a43.58,43.58,0,0,0,13.39,18.76l7.89,6.43a15,15,0,0,0,14.35,1.72L172.62,314A70.38,70.38,0,0,0,187,304.52l22.46-20.27a9,9,0,0,0,3-6.36,9.08,9.08,0,0,0-2.5-6.56L159.2,237.18a9.83,9.83,0,0,1-3.09-12.45l19.66-36.95a19.21,19.21,0,0,0,1-14.67A22.37,22.37,0,0,0,165.58,163L103.94,139.8c-4.44-1.6-4.2-3.6.51-3.88l36.2-3.59a55.9,55.9,0,0,1,16.9,1.5l31.5,8.8a9.64,9.64,0,0,1,6.74,10.76L183.42,221a34.72,34.72,0,0,0-.61,11.41c.5,1.61,4.73,3.6,9.36,4.73l19.19,4a46.38,46.38,0,0,0,16.86,0l17.26-4c4.64-1,8.82-3.23,9.35-4.85a34.94,34.94,0,0,0-.63-11.4l-12.45-67.59a9.66,9.66,0,0,1,6.74-10.76l31.5-8.83a55.87,55.87,0,0,1,16.9-1.5l36.2,3.37c4.74.44,5,2.2.54,3.88L272,162.79a22.08,22.08,0,0,0-11.16,10.12,19.3,19.3,0,0,0,1,14.67l19.69,36.95A9.84,9.84,0,0,1,278.45,237l-50.66,34.23a9,9,0,0,0,.32,12.78l.15.14,22.49,20.27a71.46,71.46,0,0,0,14.35,9.47l28.06,13.35a14.89,14.89,0,0,0,14.34-1.76l7.9-6.45a43.53,43.53,0,0,0,13.38-18.8l1.65-4.52a25.27,25.27,0,0,0-.39-16l-8.26-19.49a14.4,14.4,0,0,1,2.55-14.35l50.23-53.45,11.3-13a35.8,35.8,0,0,0,1.54-4.24Z"})]}),displayName:"Brave Wallet",rdns:"com.brave.wallet"},cryptocom:{logo:({style:e,...t})=>(0,m.jsxs)("svg",{width:"400",height:"400",viewBox:"0 0 400 400",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"}),(0,m.jsx)("mask",{id:"mask0_16909_31415",style:{maskType:"luminance"},maskUnits:"userSpaceOnUse",x:"0",y:"0",width:"400",height:"400",children:(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M260.543 0C300.7 0 320.773 0 342.39 6.83333C365.99 15.4233 384.577 34.01 393.167 57.61C400 79.2233 400 99.3033 400 139.457V260.543C400 300.7 400 320.773 393.167 342.39C384.577 365.99 365.99 384.577 342.39 393.163C320.773 400 300.7 400 260.543 400H139.457C99.3 400 79.2233 400 57.61 393.163C34.01 384.577 15.4233 365.99 6.83333 342.39C0 320.773 0 300.7 0 260.543V139.457C0 99.3033 0 79.2233 6.83333 57.61C15.4233 34.01 34.01 15.4233 57.61 6.83333C79.2233 0 99.3 0 139.457 0H260.543Z",fill:"white"})}),(0,m.jsxs)("g",{mask:"url(#mask0_16909_31415)",children:[(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501Z",fill:"#FEFEFE"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M199.804 39.8501L59.3756 119.957V280.18L199.804 360.297L340.23 280.18V119.957L199.804 39.8501ZM144.359 109.116H254.873L268.197 164.788H131.538L144.359 109.116ZM176.201 204.291L164.148 173.197H235.711L223.913 204.291L227.339 239.028L199.804 239.154H172.522L176.201 204.291ZM211.354 275.892V264.862L236.093 241.414V204.417L268.451 183.607L305.376 211.066L255.119 297.589H235.203L211.354 275.892ZM94.2395 211.066L131.282 183.857L164.021 204.417V241.414L188.76 264.862V275.892L164.913 297.84H144.734L94.2395 211.066Z",fill:"#002D72"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M255.12 297.589H235.202L211.355 275.892V264.862L236.094 241.414V204.417L268.45 183.607L305.377 211.066L255.12 297.589ZM199.803 39.8498V109.117H254.872L268.198 164.789H199.803V173.199H235.712L223.914 204.291L227.338 239.028L199.803 239.153V360.296L340.231 280.181V119.957L199.803 39.8498Z",fill:"url(#paint0_linear_16909_31415)",style:{mixBlendMode:"multiply"}}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M188.761 275.892L164.912 297.84H144.734L94.2389 211.066L131.283 183.858L164.022 204.417V241.414L188.761 264.862V275.892ZM172.522 239.153L176.2 204.291L164.149 173.199H199.803V164.789H131.537L144.36 109.117H199.803V39.8498L59.375 119.957V280.181L199.803 360.296V239.153H172.522Z",fill:"url(#paint1_linear_16909_31415)",style:{mixBlendMode:"multiply"}})]}),(0,m.jsxs)("defs",{children:[(0,m.jsxs)("linearGradient",{id:"paint0_linear_16909_31415",x1:"325.255",y1:"325.727",x2:"325.255",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#002D72"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#002D72",stopOpacity:"0.01"})]}),(0,m.jsxs)("linearGradient",{id:"paint1_linear_16909_31415",x1:"184.827",y1:"325.727",x2:"184.827",y2:"73.6291",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#002D72",stopOpacity:"0.01"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#002D72"})]})]})]}),displayName:"Crypto.com DeFi Wallet",rdns:"com.crypto.wallet"},uniswap:{logo:({style:e,...t})=>(0,m.jsxs)("svg",{width:"96",height:"96",viewBox:"0 0 96 96",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:24,width:24,...e},...t,children:[(0,m.jsx)("rect",{width:"96",height:"96",rx:"18",fill:"#FEF4FF"}),(0,m.jsxs)("g",{children:[(0,m.jsx)("path",{d:"M71.9367 18.39C72.0482 16.4526 72.3145 15.1746 72.8497 14.0075C73.0616 13.5456 73.2601 13.1675 73.2907 13.1675C73.3214 13.1675 73.2293 13.5085 73.086 13.9252C72.6969 15.0578 72.633 16.607 72.901 18.4094C73.2413 20.6963 73.4348 21.0263 75.8841 23.4967C77.0329 24.6554 78.3692 26.1168 78.8536 26.7443L79.7343 27.8851L78.8536 27.0698C77.7764 26.0728 75.2992 24.1283 74.7521 23.8503C74.3852 23.6639 74.3306 23.6671 74.1043 23.8894C73.8958 24.0943 73.8519 24.4021 73.8229 25.8572C73.7778 28.125 73.4646 29.5807 72.7087 31.0362C72.2998 31.8234 72.2354 31.6554 72.6053 30.7668C72.8816 30.1034 72.9096 29.8117 72.9076 27.6163C72.9033 23.2052 72.3727 22.1447 69.2607 20.3281C68.4724 19.8678 67.1734 19.2041 66.3742 18.8531C65.575 18.502 64.9401 18.1962 64.9633 18.1734C65.0514 18.0868 68.0863 18.961 69.3077 19.4247C71.1247 20.1145 71.4247 20.2039 71.6454 20.1207C71.7933 20.0649 71.8648 19.6398 71.9367 18.39Z",fill:"#F50DB4"}),(0,m.jsx)("path",{d:"M33.5466 11.9727C32.4688 11.808 32.4233 11.7887 32.9306 11.7119C33.9026 11.5647 36.1979 11.7653 37.7796 12.1358C41.4722 13.0004 44.8322 15.2153 48.4188 19.1488L49.3717 20.1938L50.7348 19.978C56.4773 19.0689 62.3192 19.7914 67.2054 22.0148C68.5495 22.6265 70.6689 23.8441 70.9337 24.157C71.018 24.2568 71.173 24.8987 71.2779 25.5837C71.6408 27.9534 71.4591 29.7699 70.7234 31.1265C70.3229 31.8648 70.3006 32.0988 70.5698 32.7306C70.7847 33.2348 71.3838 33.608 71.9771 33.6072C73.1913 33.6056 74.4983 31.6721 75.1038 28.9818L75.3443 27.9131L75.8209 28.4448C78.4346 31.3619 80.4876 35.34 80.8403 38.1716L80.9321 38.9099L80.4928 38.2387C79.7366 37.0838 78.9769 36.2976 78.0041 35.6635C76.2504 34.5205 74.3961 34.1315 69.4853 33.8766C65.0501 33.6464 62.5399 33.2732 60.0509 32.4737C55.816 31.1137 53.6812 29.3023 48.6508 22.8012C46.4164 19.9135 45.0354 18.3159 43.6616 17.0293C40.5401 14.1058 37.4729 12.5726 33.5466 11.9727Z",fill:"#F50DB4"}),(0,m.jsx)("path",{d:"M35.6404 25.9564C33.4522 22.9889 32.0983 18.4391 32.3914 15.0379L32.482 13.9854L32.9801 14.0749C33.9155 14.243 35.5283 14.8343 36.2835 15.2861C38.3559 16.5259 39.253 18.1582 40.1658 22.3496C40.4332 23.5773 40.7839 24.9666 40.9454 25.437C41.2052 26.194 42.1871 27.9624 42.9854 29.1109C43.5605 29.938 43.1785 30.33 41.9074 30.217C39.9662 30.0444 37.3367 28.2568 35.6404 25.9564Z",fill:"#F50DB4"}),(0,m.jsx)("path",{d:"M69.2799 48.0419C59.0538 43.9862 55.4521 40.4658 55.4521 34.5259C55.4521 33.6517 55.4827 32.9365 55.5199 32.9365C55.5572 32.9365 55.9528 33.225 56.3991 33.5776C58.4728 35.216 60.7949 35.9157 67.2233 36.8395C71.0061 37.3831 73.1349 37.8222 75.0986 38.4637C81.3402 40.5027 85.2018 44.6406 86.1227 50.2766C86.3903 51.9143 86.2334 54.9854 85.7995 56.6039C85.457 57.8824 84.4118 60.1868 84.1346 60.2751C84.0578 60.2996 83.9824 60.0094 83.9626 59.6147C83.8575 57.4983 82.7718 55.438 80.9485 53.8946C78.8754 52.1399 76.0901 50.7428 69.2799 48.0419Z",fill:"#F50DB4"}),(0,m.jsx)("path",{d:"M62.1008 49.7268C61.9727 48.9758 61.7505 48.0167 61.607 47.5954L61.3461 46.8296L61.8307 47.3655C62.5014 48.107 63.0314 49.0559 63.4806 50.3197C63.8234 51.2843 63.862 51.5711 63.8594 53.1386C63.8568 54.6774 63.814 55 63.4974 55.8682C62.9983 57.2373 62.3788 58.208 61.3392 59.2501C59.4712 61.1228 57.0696 62.1596 53.6039 62.5896C53.0015 62.6643 51.2456 62.7902 49.7019 62.8693C45.8118 63.0686 43.2515 63.4803 40.9508 64.276C40.6201 64.3905 40.3247 64.4601 40.2948 64.4305C40.2017 64.3393 41.768 63.4195 43.0618 62.8056C44.8862 61.94 46.7021 61.4676 50.7709 60.8002C52.7809 60.4704 54.8566 60.0704 55.3837 59.9112C60.3612 58.4079 62.9197 54.5286 62.1008 49.7268Z",fill:"#F50DB4"}),(0,m.jsx)("path",{d:"M66.7886 57.9275C65.4299 55.0505 65.1179 52.2726 65.8623 49.6821C65.942 49.4053 66.07 49.1787 66.1471 49.1787C66.224 49.1787 66.5447 49.3495 66.8594 49.5581C67.4855 49.9732 68.7412 50.6725 72.0866 52.4692C76.2612 54.7111 78.6414 56.4472 80.2599 58.4306C81.6775 60.1677 82.5547 62.1459 82.9769 64.5583C83.2159 65.9248 83.0759 69.2128 82.7199 70.5889C81.5975 74.9275 78.9889 78.3356 75.2682 80.3242C74.7231 80.6155 74.2337 80.8547 74.1807 80.8558C74.1278 80.8569 74.3264 80.3594 74.6222 79.7503C75.8738 77.173 76.0163 74.6661 75.07 71.8756C74.4906 70.1671 73.3092 68.0823 70.924 64.5588C68.1507 60.4623 67.4708 59.3721 66.7886 57.9275Z",fill:"#F50DB4"}),(0,m.jsx)("path",{d:"M28.3782 73.4506C32.173 70.2943 36.8948 68.0521 41.1958 67.3639C43.0494 67.0672 46.1372 67.185 47.8537 67.6178C50.605 68.3113 53.0662 69.8648 54.3462 71.7156C55.5971 73.5245 56.1338 75.1008 56.6925 78.6081C56.913 79.9916 57.1527 81.3809 57.2252 81.6954C57.6449 83.5131 58.4614 84.966 59.4733 85.6957C61.0805 86.8544 63.8479 86.9265 66.5704 85.8804C67.0325 85.7028 67.4336 85.5801 67.4618 85.6078C67.5605 85.7044 66.1896 86.6083 65.2225 87.0842C63.9212 87.7245 62.8864 87.972 61.5115 87.972C59.0181 87.972 56.948 86.7226 55.2206 84.175C54.8807 83.6736 54.1167 82.1718 53.5228 80.8378C51.699 76.7403 50.7984 75.4921 48.6809 74.126C46.8381 72.9374 44.4615 72.7245 42.6736 73.588C40.325 74.7223 39.6698 77.6786 41.3518 79.5521C42.0204 80.2967 43.2671 80.939 44.2865 81.0638C46.1936 81.2975 47.8326 79.8684 47.8326 77.9717C47.8326 76.7402 47.352 76.0374 46.1423 75.4996C44.4901 74.7652 42.7141 75.6237 42.7226 77.1526C42.7263 77.8045 43.0145 78.214 43.6779 78.5097C44.1036 78.6994 44.1134 78.7144 43.7664 78.6434C42.2504 78.3337 41.8952 76.5335 43.1141 75.3383C44.5776 73.9036 47.6037 74.5367 48.6428 76.4951C49.0794 77.3177 49.1301 78.956 48.7495 79.9452C47.8976 82.1593 45.4138 83.3237 42.8941 82.6901C41.1787 82.2587 40.4801 81.7915 38.4119 79.6931C34.8179 76.0462 33.4226 75.3396 28.2413 74.5428L27.2484 74.3902L28.3782 73.4506Z",fill:"#F50DB4"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M11.5147 8.18128C23.517 22.5305 31.7835 28.4507 32.7022 29.7015C33.4607 30.7343 33.1752 31.6628 31.8758 32.3905C31.1532 32.7951 29.6676 33.205 28.9238 33.205C28.0825 33.205 27.7936 32.8853 27.7936 32.8853C27.3058 32.4296 27.0311 32.5093 24.5261 28.1293C21.0483 22.8137 18.1379 18.4041 18.0585 18.3303C17.8749 18.1596 17.878 18.1653 24.1715 29.2574C25.1883 31.5693 24.3737 32.4179 24.3737 32.7471C24.3737 33.417 24.1882 33.7691 23.3494 34.6907C21.951 36.2274 21.3259 37.954 20.8746 41.5274C20.3687 45.5332 18.9462 48.3629 15.0041 53.2057C12.6965 56.0406 12.3189 56.5602 11.7366 57.7028C11.0032 59.1416 10.8015 59.9475 10.7198 61.7645C10.6334 63.6855 10.8016 64.9265 11.3975 66.7632C11.9191 68.3712 12.4636 69.433 13.8555 71.5567C15.0568 73.3894 15.7484 74.7513 15.7484 75.2841C15.7484 75.708 15.8306 75.7085 17.692 75.2945C22.1466 74.3036 25.7638 72.5609 27.7981 70.4252C29.0571 69.1033 29.3527 68.3733 29.3623 66.5619C29.3686 65.377 29.3263 65.1289 29.0011 64.4473C28.4718 63.3379 27.5083 62.4154 25.3845 60.9853C22.6019 59.1115 21.4133 57.603 21.085 55.5285C20.8157 53.8263 21.1282 52.6253 22.6676 49.4472C24.2609 46.1575 24.6558 44.7557 24.9229 41.4399C25.0954 39.2977 25.3343 38.4528 25.9591 37.7747C26.6108 37.0676 27.1975 36.8281 28.8103 36.611C31.4396 36.2572 33.1139 35.5871 34.4901 34.3379C35.6839 33.2543 36.1835 32.2101 36.2602 30.6382L36.3184 29.4468L35.6512 28.6806C33.2352 25.9057 9.89667 6 9.74799 6C9.71623 6 10.5113 6.98164 11.5147 8.18128ZM17.1047 63.9381C17.6509 62.9852 17.3607 61.7601 16.447 61.1617C15.5836 60.5962 14.2424 60.8625 14.2424 61.5994C14.2424 61.8243 14.3687 61.9879 14.6532 62.1322C15.1322 62.375 15.167 62.648 14.7901 63.2061C14.4084 63.7712 14.4392 64.2681 14.877 64.6057C15.5826 65.15 16.5815 64.8507 17.1047 63.9381Z",fill:"#F50DB4"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M37.9777 37.236C36.7433 37.6095 35.5435 38.8981 35.172 40.2493C34.9454 41.0736 35.074 42.5196 35.4134 42.9662C35.9617 43.6874 36.492 43.8774 37.9277 43.8675C40.7388 43.8482 43.1825 42.6606 43.4666 41.176C43.6994 39.9591 42.6262 38.2726 41.1478 37.5321C40.385 37.1502 38.7626 36.9987 37.9777 37.236ZM41.2638 39.7671C41.6973 39.1604 41.5076 38.5047 40.7704 38.0611C39.3664 37.2167 37.2432 37.9155 37.2432 39.222C37.2432 39.8724 38.3504 40.5819 39.3653 40.5819C40.0408 40.5819 40.9652 40.1851 41.2638 39.7671Z",fill:"#F50DB4"})]})]}),displayName:"Uniswap Wallet",rdns:"org.uniswap.app"},okx_wallet:{displayName:"OKX Wallet",rdns:"com.okex.wallet",logo:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAJDSURBVHgB7Zq9jtpAEMfHlhEgQLiioXEkoAGECwoKxMcTRHmC5E3IoyRPkPAEkI7unJYmTgEFTYwA8a3NTKScLnCHN6c9r1e3P2llWQy7M/s1Gv1twCP0ej37dDq9x+Zut1t3t9vZjDEHIiSRSPg4ZpDL5fxkMvn1cDh8m0wmfugfO53OoFQq/crn8wxfY9EymQyrVCqMfHvScZx1p9ls3pFxXBy/bKlUipGPrVbLuQqAfsCliq3zl0H84zwtjQrOw4Mt1W63P5LvBm2d+Xz+YzqdgkqUy+WgWCy+Mc/nc282m4FqLBYL+3g8fjDxenq72WxANZbLJeA13zDX67UDioL5ybXwafMYu64Ltn3bdDweQ5R97fd7GyhBQMipx4POeEDHIu2LfDdBIGGz+hJ9CQ1ABjoA2egAZPM6AgiCAEQhsi/C4jHyPA/6/f5NG3Ks2+3CYDC4aTccDrn6ojG54MnEvG00GoVmWLIRNZ7wTCwDHYBsdACy0QHIhiuRETxlICWpMMhGZHmqS8qH6JLyGegAZKMDkI0uKf8X4SWlaZo+Pp1bRrwlJU8ZKLIvUjKh0WiQ3sRUbNVq9c5Ebew7KEo2m/1p4jJ4qAmDaqDQBzj5XyiAT4VCQezJigAU+IDU+z8vJFnGWeC+bKQV/5VZ71FV6L7PA3gg3tXrdQ+DgLhC+75Wq3no69P3MC0NFQpx2lL04Ql9gHK1bRDjsSBIvScBnDTk1WrlGIZBorIDEYJj+rhdgnQ67VmWRe0zlplXl81vcyEt0rSoYDUAAAAASUVORK5CYII="},rabby_wallet:{logo:e=>(0,m.jsxs)("svg",{width:"52",height:"52",viewBox:"0 0 52 52",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[(0,m.jsx)("rect",{width:"52",height:"52",rx:"26",fill:"#7084FF"}),(0,m.jsx)("path",{d:"M43.6781 28.2954C45.1053 25.0988 38.0498 16.168 31.3094 12.4472C27.0608 9.56481 22.6337 9.96081 21.737 11.2264C19.7693 14.0039 28.2527 16.3574 33.9263 19.1037C32.7067 19.6348 31.5574 20.5879 30.8816 21.8067C28.7664 19.4915 24.1239 17.4977 18.6765 19.1037C15.0056 20.186 11.9547 22.7374 10.7756 26.5911C10.4891 26.4635 10.1719 26.3925 9.83814 26.3925C8.56192 26.3925 7.52734 27.4298 7.52734 28.7094C7.52734 29.989 8.56192 31.0263 9.83814 31.0263C10.0747 31.0263 10.8143 30.8672 10.8143 30.8672L22.6337 30.953C17.9068 38.4713 14.1713 39.5704 14.1713 40.8729C14.1713 42.1754 17.7455 41.8224 19.0876 41.3369C25.5121 39.0127 32.4123 31.7692 33.5964 29.6841C38.5688 30.3061 42.7476 30.3796 43.6781 28.2954Z",fill:"url(#paint0_linear_81034_11443)"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M33.8741 19.076C33.8926 19.084 33.911 19.092 33.9294 19.1001C34.1923 18.9962 34.1498 18.6068 34.0776 18.301C33.9116 17.5981 31.0479 14.7629 28.3588 13.493C24.6934 11.762 21.9946 11.8518 21.5972 12.65C22.3407 14.1849 25.8031 15.6258 29.4193 17.1308C30.9407 17.7639 32.4893 18.4084 33.8741 19.076Z",fill:"url(#paint1_linear_81034_11443)"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M29.272 34.5374C28.5323 34.2543 27.697 33.9945 26.7477 33.7587C27.7625 31.9382 27.9754 29.2432 27.0171 27.5392C25.6721 25.1478 23.9838 23.875 20.0605 23.875C17.9027 23.875 12.093 24.6037 11.9899 29.4663C11.9791 29.9743 11.9895 30.44 12.026 30.8685L22.6335 30.9456C21.2017 33.2229 19.8609 34.9113 18.6873 36.1947C20.0979 36.5571 21.2615 36.8612 22.3297 37.1404C23.3394 37.4043 24.2638 37.646 25.2309 37.8934C26.6941 36.8249 28.0698 35.6597 29.272 34.5374Z",fill:"url(#paint2_linear_81034_11443)"}),(0,m.jsx)("path",{d:"M10.6324 30.3712C11.0658 34.065 13.1596 35.5127 17.4381 35.9411C21.7166 36.3695 24.1708 36.0821 27.4381 36.3801C30.167 36.6291 32.6036 38.0233 33.5075 37.5415C34.321 37.1079 33.8659 35.5412 32.7774 34.5361C31.3663 33.2333 29.4135 32.3274 25.9773 32.006C26.6621 30.1261 26.4702 27.4903 25.4067 26.0562C23.8689 23.9827 21.0305 23.0453 17.4381 23.4549C13.6848 23.8828 10.0885 25.7354 10.6324 30.3712Z",fill:"url(#paint3_linear_81034_11443)"}),(0,m.jsxs)("defs",{children:[(0,m.jsxs)("linearGradient",{id:"paint0_linear_81034_11443",x1:"18.249",y1:"25.4646",x2:"43.3806",y2:"32.5728",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"white"}),(0,m.jsx)("stop",{offset:"1",stopColor:"white"})]}),(0,m.jsxs)("linearGradient",{id:"paint1_linear_81034_11443",x1:"39.1432",y1:"24.9813",x2:"20.9691",y2:"6.81008",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#8697FF"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,m.jsxs)("linearGradient",{id:"paint2_linear_81034_11443",x1:"29.7761",y1:"35.1727",x2:"12.345",y2:"25.1792",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#8697FF"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#8697FF",stopOpacity:"0"})]}),(0,m.jsxs)("linearGradient",{id:"paint3_linear_81034_11443",x1:"19.7472",y1:"25.2716",x2:"31.5549",y2:"40.2352",gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"white"}),(0,m.jsx)("stop",{offset:"0.983895",stopColor:"#D1D8FF"})]})]})]}),displayName:"Rabby Wallet",rdns:"io.rabby.wallet"}},aS=(e,t,r)=>aA[e]?.displayName?"coinbase_wallet"===e?aA[r].displayName:aA[e].displayName:"wallet_connect_v2"===t&&"wallet_connect"===e?"Wallet Connect":void 0,aT=(e,t,r)=>aA[e]?.logo?"coinbase_wallet"===e?aA[r].logo:aA[e].logo:"wallet_connect_v2"===t&&"wallet_connect"===e?nw:void 0,aP=(e,t)=>{let r=t?.height||16,n=t?.width||16;return 8453===e?(0,m.jsx)(aE,{height:r,width:n}):(0,m.jsx)(g.Z,{height:r,width:n})};function aN(e){let t=e.toLowerCase();return!!window?.webkit?.messageHandlers?.ReactNativeWebView||!!window?.ReactNativeWebView||["fbav","fban","instagram","snapchat","linkedinapp"].some(e=>t.includes(e))}var aR=(0,o.createContext)({}),aM=({children:e})=>{let t=nh(),[r,n]=(0,o.useState)({});return nG("login",{onComplete:(e,r,i,a,o)=>{o&&"passkey"!==o.type&&"cross_app"!==o.type&&("wallet"!==o.type||"privy"!==o.walletClientType)&&(to.put(aO(t.id),o.type),"wallet"===o.type?(to.put(aI(t.id),o.walletClientType),n({accountType:o.type,walletClientType:o.walletClientType})):(to.del(aI(t.id)),n({accountType:o.type})))}}),(0,o.useEffect)(()=>{if(!t.id)return;let e=to.get(aO(t.id)),r=to.get(aI(t.id));e&&n("wallet"===e?{accountType:e,walletClientType:r}:{accountType:e})},[t.id]),(0,m.jsx)(aR.Provider,{value:r,children:e})},aO=e=>`privy:${e}:recent-login-method`,aI=e=>`privy:${e}:recent-login-wallet-client`,aW=()=>(0,o.useContext)(aR),aL=({provider:e,displayName:t,logo:r,connectOnly:n,connector:i})=>{let{navigate:a}=ny(),{connectWallet:o}=nZ(),l=aW(),c="wallet_connect_v2"===i.connectorType?e:i.walletClientType,d=window.matchMedia("(display-mode: standalone)").matches,h;return h="phantom"===i.connectorType?()=>{tc()?(o(i,c),a(n?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION")):a(s.tq?"PHANTOM_INTERSTITIAL_SCREEN":"INSTALL_PHANTOM_SCREEN")}:"coinbase_wallet"!==i.connectorType||"eoaOnly"!==i.connectionOptions||!s.tq||d||td()?()=>{aN(window.navigator.userAgent)&&!event?.isTrusted||(o(i,c),a(n?"AWAITING_CONNECT_ONLY_CONNECTION":"AWAITING_CONNECTION"))}:()=>{window.location.href=`https://go.cb-w.com/dapp?cb_url=${encodeURI(window.location.href)}`},(0,m.jsxs)(aF,{onClick:h,children:[(0,m.jsx)(aC,{icon:aT(e,i.connectorType,i.walletClientType)??r,name:i.walletClientType}),(0,m.jsx)("span",{children:aS(e,i.connectorType,i.walletClientType)||t||i.walletClientType}),l?.walletClientType===c?(0,m.jsx)(aU,{color:"gray",children:"Recent"}):(0,m.jsx)("span",{id:"connect-text",children:"Connect"})]})},aF=(0,A.ZP)(i_)` /* Show "Connect" on hover */ > #connect-text { font-weight: 500; text-align: right; flex: none; order: 2; flex-grow: 1; color: var(--privy-color-accent); opacity: 0; transition: opacity 0.1s ease-out; } :hover > #connect-text { opacity: 1; } @media (max-width: 440px) { > #connect-text { display: none; } } `,aU=(0,A.ZP)(aj)` margin-left: auto; `,aD=["coinbase_wallet"],aZ=["metamask","okx_wallet","rainbow","uniswap","zerion","rabby_wallet","cryptocom"],az=[],a$=["phantom"],aH=({connectOnly:e})=>{let{connectors:t}=nZ(),{app:r}=ny(),n=aB(r.appearance.walletList,t,e,r.appearance.walletList,r.externalWallets.walletConnect.enabled);return(0,m.jsxs)(m.Fragment,{children:[...n]})},aB=(e,t,r,n,i)=>{let a=[],o=[],s=[],l=t.find(e=>"wallet_connect_v2"===e.connectorType);for(let c of e)if("detected_wallets"===c)for(let e of t.filter(({connectorType:e,walletClientType:t})=>"uniswap_wallet_extension"===t?!n.includes("uniswap"):"crypto.com_wallet_extension"===t?!n.includes("cryptocom"):"injected"===e&&!n.includes(t))){let{walletClientType:t,walletBranding:n}=e;("unknown"===t?o:a).push((0,m.jsx)(aL,{connectOnly:r,provider:t,logo:n.icon,displayName:n.name,connector:e},`${c}-${t}`))}else if(a$.includes(c)){let e=t.find(e=>"injected"===e.connectorType&&e.walletClientType===c||e.connectorType===c);e&&a.push((0,m.jsx)(aL,{connectOnly:r,provider:c,connector:e},c))}else if(aZ.includes(c)){let e=t.find(e=>"uniswap"===c?"uniswap_wallet_extension"===e.walletClientType:"cryptocom"===c?"crypto.com_wallet_extension"===e.walletClientType:"injected"===e.connectorType&&e.walletClientType===c);i&&!e&&(e=l),e&&a.push((0,m.jsx)(aL,{connectOnly:r,provider:c,connector:e},c))}else if(aD.includes(c)){let e=t.find(({connectorType:e})=>e===c);e&&a.push((0,m.jsx)(aL,{connectOnly:r,provider:c,connector:e},c))}else az.includes(c)?l&&s.push((0,m.jsx)(aL,{connectOnly:r,provider:c,connector:l},c)):"wallet_connect"===c&&l&&s.push((0,m.jsx)(aL,{connectOnly:r,provider:c,connector:l},c));return[...o,...a,...s]},aq=(e,t)=>{let r=(0,o.useRef)(()=>{});(0,o.useEffect)(()=>{r.current=e}),(0,o.useEffect)(()=>{if(null!==t){let e=setInterval(()=>r.current(),t||0);return()=>clearInterval(e)}},[t])},aV=e=>e?.privyErrorCode==="linked_to_another_user"?rL.ERROR_USER_EXISTS:e instanceof rW&&!e.details.default?e.details:e instanceof rR?rL.ERROR_TIMED_OUT:e instanceof rM?rL.ERROR_USER_REJECTED_CONNECTION:rL.ERROR_WALLET_CONNECTION,aG=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; `,aK=A.ZP.div` display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; height: 82px; > div { position: relative; } > div > span { position: absolute; left: -41px; top: -41px; } > div > :last-child { position: absolute; left: -19px; top: -19px; } `,aY=e=>{let t=e.walletLogo;return(0,m.jsx)(m.Fragment,{children:(0,m.jsx)(aK,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:e.success,fail:e.fail}),"string"==typeof t?(0,m.jsx)("span",{style:{background:`url('${t}')`,height:"38px",width:"38px",borderRadius:"6px",margin:"auto",backgroundSize:"cover"}}):(0,m.jsx)(t,{style:{width:"38px",height:"38px"}})]})})})},aQ=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; `,aX=({name:e,logoUrl:t})=>{let r=`${e??"Provider app"} logo`;return"string"==typeof t?(0,m.jsx)("img",{src:t,alt:r,style:{width:"38px",height:"38px",maxHeight:"90px",maxWidth:"180px",borderRadius:"8px"}}):(0,m.jsx)("span",{})},aJ=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 27px; margin-right: 27px; gap: 24px; `,a0=()=>(0,m.jsx)(a1,{children:(0,m.jsxs)(a2,{children:[(0,m.jsx)(a3,{}),(0,m.jsx)(a4,{})]})}),a1=A.ZP.div` display: flex; justify-content: center; align-items: center; flex-grow: 1; margin: 12px; padding: 16px; @media all and (display-mode: standalone) { margin-bottom: 30px; } `,a2=A.ZP.div` position: relative; height: 140px; width: 140px; opacity: 1; animation: fadein 200ms ease; `,a3=A.ZP.div` position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 140px; height: 140px; && { border: 4px solid var(--privy-color-accent-light); border-radius: 50%; } `,a4=A.ZP.div` position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 140px; height: 140px; animation: spin 1200ms linear infinite; && { border: 4px solid; border-color: var(--privy-color-accent) transparent transparent transparent; border-radius: 50%; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } `,a5=["error","invalid_request_arguments","wallet_not_on_device","invalid_recovery_pin","insufficient_funds","missing_or_invalid_mfa","mfa_verification_max_attempts_reached","mfa_timeout","twilio_verification_failed"],a6=class extends Error{constructor(e,t){super(t),this.type=e}};function a7(e){let t=e.type;return"string"==typeof t&&a5.includes(t)}function a8(e){return a7(e)&&"wallet_not_on_device"===e.type}function a9(e){return!!(a7(e)&&"mfa_timeout"===e.type)}function oe(e){return!!(a7(e)&&"missing_or_invalid_mfa"===e.type)}function ot(e){return!!(a7(e)&&e.message.includes("code 429"))}function or(e){let t;return!!("string"==typeof(t=e.type)&&"client_error"===t&&"MFA canceled"===e.message)}function on({isCreatingWallet:e,skipSplashScreen:t}){return e?"EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN":t?"EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN":"EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN"}function oi({walletAction:e,availableRecoveryMethods:t,legacySetWalletPasswordFlow:r,isResettingPassword:n,showAutomaticRecovery:i}){return i?"EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN":r||1===t.length?on({isCreatingWallet:"create"===e,skipSplashScreen:n}):"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"}function oa(e){switch(e){case"user-passcode":return"EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN";case"google-drive":case"icloud":return"EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN";default:throw Error("Recovery method not supported")}}async function oo({api:e,provider:t}){let r=t4(),n=t4(),i=await t5(r);try{return"icloud"===t?{url:(await e.post("/api/v1/recovery/oauth/init_icloud",{client_type:"web"})).url}:{url:(await e.post("/api/v1/recovery/oauth/init",{redirect_to:window.location.href,code_challenge:i,state_code:n})).url,codeVerifier:r,stateCode:n,provider:t}}catch(e){throw eX(e)}}async function os({api:e,provider:t,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new eK("[OAuth AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===i)throw new eK("User denied confirmation during OAuth flow");try{return(await e.post("/api/v1/recovery/oauth/authenticate",{authorization_code:i,state_code:r,code_verifier:n,provider:t})).access_token}catch(t){let e=eX(t);throw e.privyErrorCode?new eK(e.message||"Invalid code during OAuth flow.",void 0,e.privyErrorCode):"User denied confirmation during OAuth flow"===e.message?new eK("Invalid code during oauth flow.",void 0,"oauth_user_denied"):new eK("Invalid code during OAuth flow.",void 0,"unknown_auth_error")}}var ol=A.ZP.div` height: 44px; `,oc=A.ZP.div` display: flex; flex-direction: column; `,od=A.ZP.span` color: var(--privy-color-foreground-3); font-size: 0.875rem; font-weight: 400; line-height: 1.375rem; /* 157.143% */ `;function oh(e){let[t,r]=(0,o.useState)(!1);return t?(0,m.jsxs)("div",{className:"gap-1.75 flex items-center",children:[(0,m.jsx)(M.Z,{color:"var(--privy-color-success)"}),(0,m.jsx)("span",{children:"Copied Address"})]}):(0,m.jsx)(D.Z,{color:"var(--privy-color-foreground-3)",onClick:async()=>{await navigator.clipboard.writeText(e.address),r(!0),setTimeout(()=>r(!1),2500)}})}function ou(e){let[t,r]=(0,o.useState)(e.dimensions.width),[n,i]=(0,o.useState)(void 0),a=(0,o.useRef)(null);return(0,o.useEffect)(()=>{if(a.current&&void 0===t){let{width:e}=a.current.getBoundingClientRect();r(e)}let e=getComputedStyle(document.documentElement);i({background:e.getPropertyValue("--privy-color-background"),background2:e.getPropertyValue("--privy-color-background-2"),foreground3:e.getPropertyValue("--privy-color-foreground-3"),foregroundAccent:e.getPropertyValue("--privy-color-foreground-accent"),accent:e.getPropertyValue("--privy-color-accent"),accentDark:e.getPropertyValue("--privy-color-accent-dark"),success:e.getPropertyValue("--privy-color-success")})},[]),(0,m.jsx)("div",{ref:a,children:t&&(0,m.jsxs)(ox,{children:[(0,m.jsx)("iframe",{style:{position:"absolute",zIndex:1},width:t,height:e.dimensions.height,allow:"clipboard-write self *",src:ty(e.origin,`/apps/${e.appId}/embedded-wallets/export`,{client_id:e.appClientId,address:e.wallet.address,width:`${t}px`,caid:e.clientAnalyticsId,phrase_export:!0,...n},{token:e.accessToken})}),(0,m.jsx)(ov,{children:"Loading..."}),!e.wallet.imported&&(0,m.jsx)(ov,{children:"Loading..."})]})})}var op=A.ZP.div` display: flex; flex-direction: column; text-align: left; `,om=A.ZP.span` && a { color: var(--privy-color-accent); text-decoration: underline; } `,og=A.ZP.div` background: var(--privy-color-warn-light); display: flex; align-items: start; gap: 0.625rem; padding: 0.75rem; border-radius: 8px; && svg { width: 1.25rem; height: 1.25rem; } `,of=A.ZP.div` && > div { border-radius: var(--privy-border-radius-md); border-width: 1px; border-color: var(--privy-color-foreground-4); } `,oy=A.ZP.div` display: flex; align-items: center; gap: 0.625rem; && svg { width: 0.875rem; height: 0.875rem; cursor: pointer; } `,ow=A.ZP.div` display: flex; margin-top: 1.5rem; margin-bottom: 1rem; padding: 0.75rem 1rem; `,ox=A.ZP.div` overflow: visible; position: relative; overflow: none; height: 44px; display: flex; gap: 12px; `,ov=A.ZP.div` display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 16px; font-weight: 500; border-radius: var(--privy-border-radius-md); background-color: var(--privy-color-background-2); color: var(--privy-color-foreground-3); `;function oC(){let{refreshUser:e,createAnalyticsEvent:t,initializeWalletProxy:r}=nZ(),n=(0,o.useRef)(!1);return{createWallet:(0,o.useCallback)(async i=>{let a=await uK();if(!a)throw t({eventName:"embedded_wallet_creation_failed",payload:{error:"Missing access token for user."}}),Error("An error has occured, please login again.");try{t({eventName:"embedded_wallet_creation_started"});let o=await r(3e4);if(!o)throw Error("walletProxy does not exist.");let s=new Promise((e,t)=>{setTimeout(()=>{t(Error("walletProxy.create timed out."))},2e4)});if(!await Promise.race([o.create({accessToken:a,recoveryPassword:i}),s]))throw Error("walletProxy.create did not send a response.");let l=await e();if(!l)throw Error("Failed to refresh user.");let c=rC(l);if(!c)throw Error("Updated user is missing embedded wallet.");return t({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:c.address}}),n.current=!0,c}catch(e){if(n.current)return;throw t({eventName:"embedded_wallet_creation_failed",payload:{error:e.toString()}}),console.warn(e),e}},[])}}var ob=A.ZP.div` height: 44px; `,o_=(0,A.iv)` font-size: 14px; font-style: normal; font-weight: 400; line-height: 20px; letter-spacing: -0.008px; text-align: left; transition: color 0.1s ease-in; `,oj=A.ZP.span` ${o_} transition: color 0.1s ease-in; color: ${({error:e})=>e?"var(--privy-color-error)":"var(--privy-color-foreground-3)"}; text-transform: ${({error:e})=>e?"":"capitalize"}; &[aria-hidden='true'] { visibility: hidden; } `,ok=A.ZP.div` display: flex; flex-direction: column; justify-content: center; flex-grow: 1; `,oE=(0,A.ZP)(n3)` ${e=>e.hideAnimations&&(0,A.iv)` && { transition: none; } `} `,oA=(0,A.iv)` && { width: 100%; border-width: 1px; border-radius: var(--privy-border-radius-md); border-color: var(--privy-color-foreground-3); background: var(--privy-color-background); color: var(--privy-color-foreground); padding: 12px; font-size: 16px; font-style: normal; font-weight: 300; line-height: 22px; /* 137.5% */ } `,oS=A.ZP.input` ${oA} &::placeholder { color: var(--privy-color-foreground-3); font-style: italic; font-size: 14px; } overflow: hidden; text-overflow: ellipsis; white-space: nowrap; `,oT=A.ZP.div` ${oA} `,oP=A.ZP.div` position: relative; width: 100%; display: flex; align-items: center; justify-content: ${({centered:e})=>e?"center":"space-between"}; `,oN=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 32px 0; gap: 4px; & h3 { font-size: 18px; font-style: normal; font-weight: 600; line-height: 24px; } & p { max-width: 300px; font-size: 14px; font-style: normal; font-weight: 400; line-height: 20px; } `,oR=A.ZP.div` display: flex; flex-direction: column; gap: 10px; padding-bottom: 1rem; `,oM=A.ZP.div` display: flex; text-align: left; align-items: center; gap: 8px; max-width: 300px; font-size: 14px; font-style: normal; font-weight: 400; line-height: 20px; letter-spacing: -0.008px; margin: 0 8px; color: var(--privy-color-foreground-2); > :first-child { min-width: 24px; } `,oO=(A.ZP.div` height: var(--privy-height-modal-full); @media (max-width: 440px) { height: var(--privy-height-modal-compact); } `,(0,A.ZP)(n2)` display: flex; flex: 1; gap: 4px; justify-content: center; && { background: var(--privy-color-background); border-radius: var(--privy-border-radius-md); border-color: var(--privy-color-foreground-3); border-width: 1px; } `),oI=A.ZP.div` position: absolute; right: 0.5rem; display: flex; flex-direction: row; justify-content: space-around; align-items: center; `,oW=(0,A.ZP)(Z.Z)` height: 1.25rem; width: 1.25rem; stroke: var(--privy-color-accent); cursor: pointer; :active { stroke: var(--privy-color-accent-light); } `,oL=(0,A.ZP)($.Z)` height: 1.25rem; width: 1.25rem; stroke: var(--privy-color-accent); cursor: pointer; :active { stroke: var(--privy-color-accent-light); } `,oF=(0,A.ZP)(z.Z)` height: 1.25rem; width: 1.25rem; stroke: var(--privy-color-accent); cursor: pointer; :active { stroke: var(--privy-color-accent-light); } `,oU=A.ZP.progress` height: 4px; width: 100%; margin: 8px 0; /* border-radius: 9999px; */ ::-webkit-progress-bar { border-radius: 8px; background: var(--privy-color-foreground-4); } ::-webkit-progress-value { border-radius: 8px; transition: all 0.1s ease-out; background: ${({label:e})=>"Strong"===e&&"#78dca6"||"Medium"===e&&"var(--privy-color-warn)"||"var(--privy-color-error)"}; } `,oD=({buttonHideAnimations:e,buttonLoading:t,password:r,onSubmit:n,onBack:i})=>{let[a,s]=(0,o.useState)(!0),[l,c]=(0,o.useState)(!1),[d,h]=(0,o.useState)(""),u=r===d;return(0,o.useEffect)(()=>{d&&!l&&c(!0)},[d]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{closeable:!1,backFn:i}),(0,m.jsx)(ae,{}),(0,m.jsxs)(ok,{children:[(0,m.jsxs)(oN,{children:[(0,m.jsx)(U.Z,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,m.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm your password"}),(0,m.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please re-enter your password below to continue."})]}),(0,m.jsxs)(oP,{children:[(0,m.jsx)(oS,{value:d,onChange:e=>h(e.target.value),onBlur:()=>c(!0),placeholder:"confirm your password",type:a?"password":"text",style:{paddingRight:"2.3rem"}}),(0,m.jsx)(oI,{style:{right:"0.75rem"},children:a?(0,m.jsx)(oL,{onClick:()=>s(!1)}):(0,m.jsx)(oF,{onClick:()=>s(!0)})})]}),(0,m.jsx)(oj,{"aria-hidden":!l||u,error:!0,children:"Passwords do not match"})]}),(0,m.jsx)(oE,{onClick:n,loading:t,disabled:!u,hideAnimations:e,children:"Continue"}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},oZ=({className:e,checked:t,color:r="var(--privy-color-accent)",...n})=>(0,m.jsx)("label",{children:(0,m.jsxs)(oz,{className:e,children:[(0,m.jsx)(oH,{checked:t,...n}),(0,m.jsx)(oB,{color:r,checked:t,children:(0,m.jsx)(o$,{viewBox:"0 0 24 24",children:(0,m.jsx)("polyline",{points:"20 6 9 17 4 12"})})})]})});A.ZP.label` && { cursor: pointer; display: flex; align-items: center; gap: 0.75rem; padding: 0.75rem 1rem; text-align: left; border-radius: 0.5rem; border: 1px solid var(--privy-color-foreground-4); width: 100%; } `;var oz=A.ZP.div` display: inline-block; vertical-align: middle; `,o$=A.ZP.svg` fill: none; stroke: white; stroke-width: 3px; `,oH=A.ZP.input.attrs({type:"checkbox"})` border: 0; clip: rect(0 0 0 0); clippath: inset(50%); height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; white-space: nowrap; width: 1px; `,oB=A.ZP.div` display: inline-block; width: 18px; height: 18px; transition: all 150ms; cursor: pointer; border-color: ${e=>e.color}; border-radius: 3px; background: ${e=>e.checked?e.color:"var(--privy-color-background)"}; && { /* This is necessary to override css reset for border width */ border-width: 1px; } ${oH}:focus + & { box-shadow: 0 0 0 1px ${e=>e.color}; } ${o$} { visibility: ${e=>e.checked?"visible":"hidden"}; } `,oq=({buttonHideAnimations:e,buttonLoading:t,onSubmit:r,onBack:n,config:i})=>{let[a,s]=(0,o.useState)(!1);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{closeable:!1,backFn:n}),(0,m.jsx)(ae,{}),(0,m.jsxs)(ok,{children:[(0,m.jsxs)(oN,{children:[(0,m.jsx)(U.Z,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-error)"}),(0,m.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Confirm you have saved"}),(0,m.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Losing access to your password means you will lose access to your account."})]}),(0,m.jsx)(oR,{children:(0,m.jsxs)(oM,{style:{color:"var(--privy-color-error)",cursor:"pointer"},onClick:e=>{e.preventDefault(),s(e=>!e)},children:[(0,m.jsx)(oZ,{color:"var(--privy-color-error)",readOnly:!0,checked:a}),(0,m.jsx)(m.Fragment,{children:"I understand that if I lose my password and device, I will lose access to my account and my assets."})]})})]}),(0,m.jsxs)(oV,{children:["user"===i.initiatedBy&&(0,m.jsx)(n8,{onClick:i.onCancel,disabled:t,children:"Cancel"}),(0,m.jsx)(oE,{onClick:r,loading:t,hideAnimations:e,disabled:!a,children:"Set Password"})]}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},oV=A.ZP.div` display: flex; gap: 10px; `,oG=/[a-z]/,oK=/[A-Z]/,oY=/[0-9]/,oQ="!@#$%^&*()\\-_+.",oX=`a-zA-Z0-9${oQ}`,oJ=RegExp(`[${oQ}]`),o0=RegExp(`[${oX}]`),o1=RegExp(`^[${oX}]{6,}$`),o2=(e="")=>[...new Set(e.split("").filter(e=>!o0.test(e)).map(e=>e.replace(" ","SPACE")))],o3=()=>V.OW(4,G.k),o4=({buttonHideAnimations:e,buttonLoading:t,password:r="",config:n,isResettingPassword:i,onSubmit:a,onClose:s,onBack:l,onPasswordChange:c,onPasswordGenerate:d})=>{let[h,u]=(0,o.useState)(!1),[p,g]=(0,o.useState)(!1);(0,o.useEffect)(()=>{r&&!p&&g(!0)},[r]);let f=(0,o.useMemo)(()=>p?6>(r?.length||0)?"Password must be at least 6 characters":o1.test(r||"")?null:`Invalid characters used ( ${o2(r).join(" ")} )`:null,[r,p]),y=(0,o.useMemo)(()=>f?{value:0,label:"Weak"}:function(e=""){let t=function(e=""){return(.3*function(e){if(e.length<8)return 0;let t=0;return oG.test(e)&&(t+=1),oK.test(e)&&(t+=1),oY.test(e)&&(t+=1),oJ.test(e)&&(t+=1),Math.max(0,Math.min(1,t/3))}(e)+q()(e)/95)/2}(e);return{value:t,label:t>.9?"Strong":t>.5?"Medium":"Weak"}}(r),[r,f]),w=(0,o.useMemo)(()=>!!(!r?.length||f),[f,r]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:s,closeable:"user"===n.initiatedBy,backFn:l}),(0,m.jsx)(ae,{}),(0,m.jsxs)(ok,{children:[(0,m.jsxs)(oN,{children:[(0,m.jsx)(H.Z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,m.jsxs)("h3",{style:{color:"var(--privy-color-foreground)"},children:[i?"Reset":"Set"," your password"]}),(0,m.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Select a strong, memorable password to secure your account."})]}),(0,m.jsxs)(oP,{children:[(0,m.jsx)(oS,{value:r,onChange:e=>c(e.target.value),placeholder:"enter or generate a strong password",type:h?"password":"text",style:{paddingRight:"3.8rem"}}),(0,m.jsxs)(oI,{style:{width:"3.5rem"},children:[h?(0,m.jsx)(oL,{onClick:()=>u(!1)}):(0,m.jsx)(oF,{onClick:()=>u(!0)}),(0,m.jsx)(oW,{onClick:d})]})]}),(0,m.jsx)(oU,{value:0===y.value?.01:y.value,label:y.label}),(0,m.jsx)(oj,{error:!!f,children:f||`Password Strength: ${p?y.label:"--"}`}),(0,m.jsxs)(o6,{children:[(0,m.jsx)(o5,{children:(0,m.jsxs)(oR,{children:[(0,m.jsxs)(oM,{children:[(0,m.jsx)(W.Z,{width:24,height:24,fill:"var(--privy-color-accent)"}),"This password is used to secure your account."]}),(0,m.jsxs)(oM,{children:[(0,m.jsx)(W.Z,{width:24,height:24,fill:"var(--privy-color-accent)"}),"Use it to log in on a new environment, like another browser or device."]})]})}),(0,m.jsx)(oE,{onClick:a,loading:t,disabled:w,hideAnimations:e,children:"Continue"})]})]}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},o5=(0,A.ZP)(oR)` flex: 1; padding-top: 1rem; `,o6=A.ZP.div` display: flex; flex-direction: column; height: 100%; `,o7=({buttonHideAnimations:e,buttonLoading:t,appName:r,password:n,onSubmit:i,onBack:a})=>{let[s,l]=(0,o.useState)(!1),c=(0,o.useCallback)(()=>{l(!0),n&&navigator.clipboard.writeText(n)},[n]),d=(0,o.useCallback)(()=>{let e=document.createElement("a"),t=r.toLowerCase().replace(/[^a-z\s]/g,"").replace(/\s/g,"-"),i=new Blob([o8(r,n)],{type:"text/plain"}),a=URL.createObjectURL(i);e.href=a,e.target="_blank",e.download=`${t}-privy-wallet-recovery.txt`,document.body.appendChild(e),e.click(),setTimeout(()=>{e.remove(),URL.revokeObjectURL(a)},5e3)},[n]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:a,closeable:!1}),(0,m.jsx)(ae,{}),(0,m.jsxs)(ok,{children:[(0,m.jsxs)(oN,{children:[(0,m.jsx)(U.Z,{height:48,width:48,stroke:"var(--privy-color-background)",fill:"var(--privy-color-accent)"}),(0,m.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Save your password"}),(0,m.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"For your security, this password cannot be reset, so keep it somewhere safe."})]}),(0,m.jsx)(oP,{centered:!0,children:(0,m.jsx)(oT,{children:n})}),(0,m.jsxs)("div",{style:{display:"flex",margin:"12px 0",gap:"12px"},children:[(0,m.jsx)(oO,{onClick:c,children:s?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Y.Z,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copied"]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(Q.Z,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Copy"]})}),(0,m.jsxs)(oO,{onClick:d,children:[(0,m.jsx)(K.Z,{style:{width:24,height:24},stroke:"var(--privy-color-accent)"}),"Download"]})]})]}),(0,m.jsx)(oE,{onClick:i,loading:t,hideAnimations:e,children:"Continue"}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},o8=(e,t)=>`Your wallet recovery password for ${e} is ${t} You will need this password to access your ${e} wallet on a new device. Please keep it somewhere safe.`,o9=({error:e,onClose:t})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{closeable:!1}),(0,m.jsx)(ae,{}),e?(0,m.jsxs)(i6,{children:[(0,m.jsx)(L.Z,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,m.jsx)(as,{title:"Something went wrong",description:e})]}):(0,m.jsxs)(i6,{children:[(0,m.jsx)(W.Z,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,m.jsx)(as,{title:"Success"})]}),(0,m.jsx)(n3,{onClick:t,children:"Close"}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]}),se=(e,t)=>{switch(e){case"creating":return"back"===t?e:"saving";case"saving":return"back"===t?"creating":"confirming";case"confirming":return"back"===t?"saving":"finalizing";case"finalizing":return"back"===t?"confirming":"done";default:return e}},st=()=>{let[e,t]=(0,o.useReducer)(se,"creating");return{send:t,state:e}},sr=({onSubmit:e,...t})=>{let{lastScreen:r,navigate:n}=ny(),{send:i,state:a}=st(),s=(0,o.useCallback)(async()=>{"finalizing"===a&&await e(),i("next")},[a,i,e]);(0,o.useEffect)(()=>{let e;return"done"===a&&"automatic"===t.config.initiatedBy&&(e=setTimeout(()=>t.onClose?.(),1400)),()=>{e&&clearTimeout(e)}},[a,t.config.initiatedBy,t.onClose]);let l=(0,o.useCallback)(()=>{i("back")},[i]),c=(0,o.useCallback)(()=>{n("EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN")},[r,n]);return"creating"===a?(0,m.jsx)(o4,{...t,onSubmit:s,onBack:"EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN"===r?c:void 0}):"saving"===a?(0,m.jsx)(o7,{...t,onSubmit:s,onBack:l}):"confirming"===a?(0,m.jsx)(oD,{...t,onSubmit:s,onBack:l}):"finalizing"===a?(0,m.jsx)(oq,{...t,onSubmit:s,onBack:l}):"done"===a?(0,m.jsx)(o9,{...t,onSubmit:s}):null},sn=e=>{let t=(0,m.jsx)(U.Z,{height:38,width:38,stroke:"var(--privy-color-error)"});if(e instanceof eK)switch(e.privyErrorCode){case"client_request_timeout":return{title:"Timed out",detail:e.message,ctaText:"Try again",icon:t};case"insufficient_balance":return{title:"Insufficient balance",detail:e.message,ctaText:"Try again",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}else{if(e instanceof a6&&"twilio_verification_failed"===e.type)return{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:(0,m.jsx)(I.Z,{height:38,width:38,stroke:"var(--privy-color-error)"})};if(!(e instanceof eV))return e instanceof eG&&422===e.status?{title:"Something went wrong",detail:e.message,ctaText:"Try again",icon:t}:{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t};switch(e.privyErrorCode){case"invalid_captcha":return{title:"Something went wrong",detail:"Please try again.",ctaText:"Try again",icon:t};case"disallowed_login_method":return{title:"Not allowed",detail:e.message,ctaText:"Try another method",icon:t};case"allowlist_rejected":return{title:"You don't have access to this app",detail:"Have you been invited?",ctaText:"Try another account",icon:(0,m.jsx)(iJ,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})};case"captcha_failure":return{title:"Something went wrong",detail:"You did not pass CAPTCHA. Please try again.",ctaText:"Try again",icon:(0,m.jsx)("span",{})};case"captcha_timeout":return{title:"Something went wrong",detail:"Something went wrong! Please try again later.",ctaText:"Try again",icon:(0,m.jsx)("span",{})};case"linked_to_another_user":return{title:"Authentication failed",detail:"This account has already been linked to another user.",ctaText:"Try again",icon:t};case"not_supported":return{title:"This region is not supported",detail:"SMS authentication from this region is not available",ctaText:"Try another method",icon:t};case"too_many_requests":return{title:"Request failed",detail:"Too many attempts.",ctaText:"Try again later",icon:t};default:return{title:"Something went wrong",detail:"Try again later",ctaText:"Try again",icon:t}}}},si=({error:e,backFn:t,onClick:r})=>{let{reset:n}=nF(),i=sn(e);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:t}),(0,m.jsxs)(sa,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(iX,{color:"var(--privy-color-error)"}),i.icon]})}),(0,m.jsxs)(so,{children:[(0,m.jsx)("h3",{children:i.title}),(0,m.jsx)("p",{children:i.detail})]}),(0,m.jsx)(n3,{color:"var(--privy-color-error)",onClick:()=>{e instanceof eV&&"invalid_captcha"===e.privyErrorCode&&n(),r?.()},children:i.ctaText})]})]})},sa=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; padding-bottom: 16px; `,so=A.ZP.div` display: flex; flex-direction: column; gap: 8px; `,ss=({style:e,color:t,...r})=>(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:"1.5",stroke:t||"currentColor",style:{height:"1.5rem",width:"1.5rem",...e},...r,children:(0,m.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M4.5 12.75l6 6 9-13.5"})}),sl=({color:e,...t})=>(0,m.jsx)("svg",{version:"1.1",id:"Layer_1",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",x:"0px",y:"0px",viewBox:"0 0 115.77 122.88",xmlSpace:"preserve",...t,children:(0,m.jsx)("g",{children:(0,m.jsx)("path",{fill:e||"currentColor",className:"st0",d:"M89.62,13.96v7.73h12.19h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02v0.02 v73.27v0.01h-0.02c-0.01,3.84-1.57,7.33-4.1,9.86c-2.51,2.5-5.98,4.06-9.82,4.07v0.02h-0.02h-61.7H40.1v-0.02 c-3.84-0.01-7.34-1.57-9.86-4.1c-2.5-2.51-4.06-5.98-4.07-9.82h-0.02v-0.02V92.51H13.96h-0.01v-0.02c-3.84-0.01-7.34-1.57-9.86-4.1 c-2.5-2.51-4.06-5.98-4.07-9.82H0v-0.02V13.96v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07V0h0.02h61.7 h0.01v0.02c3.85,0.01,7.34,1.57,9.86,4.1c2.5,2.51,4.06,5.98,4.07,9.82h0.02V13.96L89.62,13.96z M79.04,21.69v-7.73v-0.02h0.02 c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v64.59v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h12.19V35.65 v-0.01h0.02c0.01-3.85,1.58-7.34,4.1-9.86c2.51-2.5,5.98-4.06,9.82-4.07v-0.02h0.02H79.04L79.04,21.69z M105.18,108.92V35.65v-0.02 h0.02c0-0.91-0.39-1.75-1.01-2.37c-0.61-0.61-1.46-1-2.37-1v0.02h-0.01h-61.7h-0.02v-0.02c-0.91,0-1.75,0.39-2.37,1.01 c-0.61,0.61-1,1.46-1,2.37h0.02v0.01v73.27v0.02h-0.02c0,0.91,0.39,1.75,1.01,2.37c0.61,0.61,1.46,1,2.37,1v-0.02h0.01h61.7h0.02 v0.02c0.91,0,1.75-0.39,2.37-1.01c0.61-0.61,1-1.46,1-2.37h-0.02V108.92L105.18,108.92z"})})}),sc=e=>{let[t,r]=(0,o.useState)(!1);return(0,m.jsxs)(sd,{color:e.color,onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},justCopied:t,children:[t?(0,m.jsx)(ss,{style:{height:"14px",width:"14px"},strokeWidth:"2"}):(0,m.jsx)(sl,{style:{height:"14px",width:"14px"}}),t?"Copied":"Copy"," ",e.itemName?e.itemName:"to Clipboard"]})},sd=A.ZP.button` display: flex; align-items: center; gap: 6px; && { margin: 8px 2px; font-size: 14px; color: ${e=>e.justCopied?"var(--privy-color-foreground)":e.color||"var(--privy-color-foreground-3)"}; font-weight: ${e=>e.justCopied?"medium":"normal"}; transition: color 350ms ease; :focus, :active { background-color: transparent; border: none; outline: none; box-shadow: none; } :hover { color: ${e=>e.justCopied?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"}; } :active { color: 'var(--privy-color-foreground)'; font-weight: medium; } @media (max-width: 440px) { margin: 12px 2px; } } svg { width: 14px; height: 14px; } `,sh=e=>{let[t,r]=(0,o.useState)(!1);return(0,m.jsx)(su,{color:e.color,href:e.url,target:"_blank",rel:"noreferrer noopener",onClick:()=>{r(!0),setTimeout(()=>r(!1),1500)},justOpened:t,children:e.text})},su=A.ZP.a` display: flex; align-items: center; gap: 6px; && { margin: 8px 2px; font-size: 14px; color: ${e=>e.justOpened?"var(--privy-color-foreground)":e.color||"var(--privy-color-foreground-3)"}; font-weight: ${e=>e.justOpened?"medium":"normal"}; transition: color 350ms ease; :focus, :active { background-color: transparent; border: none; outline: none; box-shadow: none; } :hover { color: ${e=>e.justOpened?"var(--privy-color-foreground)":"var(--privy-color-foreground-2)"}; } :active { color: 'var(--privy-color-foreground)'; font-weight: medium; } @media (max-width: 440px) { margin: 12px 2px; } } svg { width: 14px; height: 14px; } `,sp=()=>(0,m.jsx)("svg",{width:"200",height:"200",viewBox:"-77 -77 200 200",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"28px",width:"28px"},children:(0,m.jsx)("rect",{width:"50",height:"50",fill:"black",rx:10,ry:10})}),sm=(e,t,r,n,i)=>{for(let a=t;a{let r=ee.create(e,{errorCorrectionLevel:t}).modules,n=tp(Array.from(r.data),r.size);return n=sm(n,0,0,7,7),n=sm(n,n.length-7,0,7,7),n=sm(n,0,n.length-7,7,7)},sf=({x:e,y:t,cellSize:r,bgColor:n,fgColor:i})=>(0,m.jsx)(m.Fragment,{children:[0,1,2].map(a=>(0,m.jsx)("circle",{r:r*(7-2*a)/2,cx:e+7*r/2,cy:t+7*r/2,fill:a%2!=0?n:i},`finder-${e}-${t}-${a}`))}),sy=({cellSize:e,matrixSize:t,bgColor:r,fgColor:n})=>{let i=[[0,0],[(t-7)*e,0],[0,(t-7)*e]];return(0,m.jsx)(m.Fragment,{children:i.map(([t,i])=>(0,m.jsx)(sf,{x:t,y:i,cellSize:e,bgColor:r,fgColor:n},`finder-${t}-${i}`))})},sw=({matrix:e,cellSize:t,color:r})=>(0,m.jsx)(m.Fragment,{children:e.map((e,n)=>e.map((e,i)=>e?(0,m.jsx)("rect",{height:t-.4,width:t-.4,x:n*t+.1*t,y:i*t+.1*t,rx:.5*t,ry:.5*t,fill:r},`cell-${n}-${i}`):(0,m.jsx)(o.Fragment,{},`circle-${n}-${i}`)))}),sx=({cellSize:e,matrixSize:t,element:r,sizePercentage:n,bgColor:i})=>{if(!r)return(0,m.jsx)(m.Fragment,{});let a=t*(n||.14),o=Math.floor(t/2-a/2),s=Math.floor(t/2+a/2);(s-o)%2!=t%2&&(s+=1);let l=(s-o)*e,c=l-.2*l,d=o*e;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("rect",{x:o*e,y:o*e,width:l,height:l,fill:i}),(0,m.jsx)(r,{x:d+.1*l,y:d+.1*l,height:c,width:c})]})},sv=e=>{let t=e.outputSize,r=sg(e.url,e.errorCorrectionLevel),n=t/r.length,i=function(e,{min:t,max:r}){return Math.min(Math.max(e,t),r)}(2*n,{min:.025*t,max:.036*t});return(0,m.jsxs)("svg",{height:e.outputSize,width:e.outputSize,viewBox:`0 0 ${e.outputSize} ${e.outputSize}`,style:{height:"100%",width:"100%",padding:`${i}px`},children:[(0,m.jsx)(sw,{matrix:r,cellSize:n,color:e.fgColor}),(0,m.jsx)(sy,{cellSize:n,matrixSize:r.length,fgColor:e.fgColor,bgColor:e.bgColor}),(0,m.jsx)(sx,{cellSize:n,element:e.logo?.element,bgColor:e.bgColor,matrixSize:r.length})]})},sC=A.ZP.div` display: flex; justify-content: center; align-items: center; height: ${e=>`${e.size}px`}; width: ${e=>`${e.size}px`}; margin: auto; background-color: ${e=>e.bgColor}; && { border-width: 2px; border-color: ${e=>e.borderColor}; border-radius: var(--privy-border-radius-md); } `,sb=e=>{let{appearance:t}=nh(),r=e.bgColor||"#FFFFFF",n=e.fgColor||"#000000",i=e.size||160,a="dark"===t.palette.colorScheme?r:n;return(0,m.jsx)(sC,{size:i,bgColor:r,fgColor:n,borderColor:a,children:(0,m.jsx)(sv,{url:e.url,logo:{element:e.squareLogoElement??sp},outputSize:i,bgColor:r,fgColor:n,errorCorrectionLevel:e.errorCorrectionLevel||"Q"})})},s_=({style:e,...t})=>(0,m.jsxs)("svg",{width:"1000",height:"1000",viewBox:"0 0 1000 1000",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"24px",...e},...t,children:[(0,m.jsx)("rect",{width:"1000",height:"1000",rx:"200",fill:"#855DCD"}),(0,m.jsx)("path",{d:"M257.778 155.556H742.222V844.444H671.111V528.889H670.414C662.554 441.677 589.258 373.333 500 373.333C410.742 373.333 337.446 441.677 329.586 528.889H328.889V844.444H257.778V155.556Z",fill:"white"}),(0,m.jsx)("path",{d:"M128.889 253.333L157.778 351.111H182.222V746.667C169.949 746.667 160 756.616 160 768.889V795.556H155.556C143.283 795.556 133.333 805.505 133.333 817.778V844.444H382.222V817.778C382.222 805.505 372.273 795.556 360 795.556H355.556V768.889C355.556 756.616 345.606 746.667 333.333 746.667H306.667V253.333H128.889Z",fill:"white"}),(0,m.jsx)("path",{d:"M675.556 746.667C663.283 746.667 653.333 756.616 653.333 768.889V795.556H648.889C636.616 795.556 626.667 805.505 626.667 817.778V844.444H875.556V817.778C875.556 805.505 865.606 795.556 853.333 795.556H848.889V768.889C848.889 756.616 838.94 746.667 826.667 746.667V351.111H851.111L880 253.333H702.222V746.667H675.556Z",fill:"white"})]}),sj="#8a63d2",sk=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 27px; margin-right: 27px; gap: 24px; `,sE=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; `,sA="#8a63d2",sS=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 27px; margin-right: 27px; gap: 24px; `,sT=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; `;function sP({title:e}){let{currentScreen:t,navigateBack:r,navigate:n,data:i}=ny(),a;return a="FUNDING_MANUAL_TRANSFER_SCREEN"===t?r:t===i?.funding?.methodScreen?i.funding.comingFromSendTransactionScreen?()=>n("EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN"):void 0:i?.funding?.methodScreen?()=>n(i.funding.methodScreen):void 0,(0,m.jsx)(il,{title:e,backFn:a})}var sN=()=>(0,m.jsx)(sR,{children:(0,m.jsxs)(sM,{children:[(0,m.jsx)(sO,{}),(0,m.jsx)(sI,{})]})}),sR=A.ZP.div` display: flex; justify-content: center; align-items: center; flex-grow: 1; @media all and (display-mode: standalone) { margin-bottom: 30px; } `,sM=A.ZP.div` position: relative; height: 96px; width: 96px; opacity: 1; animation: fadein 200ms ease; `,sO=A.ZP.div` position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 96px; height: 96px; && { border: 4px solid #f1f2f9; border-radius: 50%; } `,sI=A.ZP.div` position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 96px; height: 96px; animation: spin 1200ms linear infinite; && { border: 4px solid; border-color: #cbcde1 transparent transparent transparent; border-radius: 50%; } @keyframes spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } } `,sW=A.ZP.span` display: flex; flex-direction: column; gap: 0.35rem; width: 100%; `,sL=A.ZP.span` display: flex; width: 100%; justify-content: space-between; `,sF=A.ZP.span` color: var(--privy-color-foreground); font-size: 0.875rem; font-weight: 500; line-height: 1.375rem; /* 157.143% */ ${a_} `;async function sU(e,t,r,n,i,a){!function(e){for(let t of["gasLimit","gasPrice","value","maxPriorityFeePerGas","maxFeePerGas"]){let r=e[t];if(!(typeof r>"u")&&!function(e){let t="number"==typeof e,r="bigint"==typeof e,n="string"==typeof e&&/^-?0x[a-f0-9]+$/i.test(e);return t||r||n}(r))throw Error(`Transaction request property '${t}' must be a valid number, bigint, or hex string representing a quantity`)}if("number"!=typeof e.chainId)throw Error("Transaction request property 'chainId' must be a number")}(n=Object.assign({chainId:t0},n));let o=(await r.rpc({address:t,accessToken:e,requesterAppId:a,request:{method:"eth_signTransaction",params:[n]}})).response.data;return await i.sendTransaction(o)}async function sD(e,t,r,n){let i=await n.getBalance(e),a=t.value||0,o=!i.sub((0,en.uq)(a)).sub(r).isNegative();return{balance:i,hasSufficientFunds:o}}function sZ(e){return{to:e.to,from:e.from,contractAddress:e.contractAddress,transactionIndex:e.transactionIndex,root:e.root,logsBloom:e.logsBloom,blockHash:e.blockHash,transactionHash:e.transactionHash,logs:e.logs,blockNumber:e.blockNumber,confirmations:e.confirmations,byzantium:e.byzantium,type:e.type,status:e.status,gasUsed:e.gasUsed.toHexString(),cumulativeGasUsed:e.cumulativeGasUsed.toHexString(),effectiveGasPrice:e.effectiveGasPrice?e.effectiveGasPrice.toHexString():void 0}}var sz=e=>{let{showFiatPrices:t,getUsdTokenPrice:r,chains:n}=nZ(),[i,a]=(0,o.useState)(!0),[s,l]=(0,o.useState)(void 0),[c,d]=(0,o.useState)(void 0);return(0,o.useEffect)(()=>{let i=e.chainId||t0,o=n.find(e=>e.id===Number(i));if(!o)throw new eQ(`Unsupported chain: ${i}`);(async()=>{if(!t){a(!1);return}try{a(!0);let e=await r(o);e?d(e):l(Error(`Unable to fetch token price on chain id ${o.id}`))}catch(e){l(e)}finally{a(!1)}})()},[e.chainId]),{tokenPrice:c,isTokenPriceLoading:i,tokenPriceError:s}},s$=(0,o.createContext)(null);function sH(){let e=(0,o.useContext)(s$);if(null===e)throw Error("`useWallets` was called outside the PrivyProvider component");return e}function sB(e){let t=new RegExp(/^eip155:(?\d+)$/gm).exec(e)?.groups?.chainId;if(t)return parseInt(t);throw Error("Chain ID not compatible with CAIP-2 format.")}var sq=new Intl.NumberFormat(void 0,{style:"currency",currency:"USD",maximumFractionDigits:2}),sV=e=>sq.format(e),sG=(e,t)=>{let r=sV(t*parseFloat(e));return"$0.00"!==r?r:"<$0.01"},sK=(e,t)=>{let r=sV(t*parseFloat((0,et.dF)(e)));return"$0.00"===r?"<$0.01":r},sY=(e,t,r=6,n=!1)=>{let i=parseFloat((0,et.dF)(e)).toFixed(r).replace(/0+$/,"").replace(/\.$/,"");return n?`${i} ${t}`:`${"0"===i?"<0.001":i} ${t}`},sQ=e=>e.map(en.uq).reduce((e,t)=>e.add(t),ei.O$.from(0)).toHexString(),sX=(e,t)=>{let{chains:r}=nZ(),n=`https://etherscan.io/address/${t}`,i=`${tj(e,r)}/address/${t}`;if(!i)return n;try{new URL(i)}catch{return n}return i},sJ=A.ZP.div` display: flex; flex-direction: row; align-items: center; gap: 4px; `;async function s0({api:e,requesterAppId:t,providerAppId:r}){let n=(await e.get(`/api/v1/apps/${t}/cross-app/connections`)).connections.find(e=>e.provider_app_id===r);if(!n)throw new eK("Invalid connected app");return{name:n.provider_app_name,logoUrl:n.provider_app_icon_url||void 0,apiUrl:n.provider_app_custom_api_url,readOnly:n.read_only}}async function s1({api:e,appId:t}){let r=t4(),n=t4(),i=await t5(r);try{let{url:a}=await e.post(e7,{provider:`privy:${t}`,redirect_to:window.location.href,code_challenge:i,state_code:n});return{url:a,stateCode:n,codeVerifier:r}}catch(e){throw eX(e)}}async function s2({api:e,appId:t,stateCode:r,codeVerifier:n,authorizationCode:i}){if(!i||!r)throw new eK("[Cross-App AuthFlow] Authorization and state codes code must be set prior to calling authenicate.");if("undefined"===i)throw new eK("User denied confirmation during cross-app auth flow");try{return(await e.post(e8,{authorization_code:i,state_code:r,code_verifier:n,provider:`privy:${t}`})).oauth_tokens?.access_token}catch(t){let e=eX(t);throw e.privyErrorCode?new eK(e.message||"Invalid code during cross-app auth flow.",void 0,e.privyErrorCode):"User denied confirmation during cross-app auth flow"===e.message?new eK("Invalid code during cross-app auth flow.",void 0,"oauth_user_denied"):new eK("Invalid code during cross-app auth flow.",void 0,"unknown_auth_error")}}var s3=async({user:e,address:t,client:r,request:n,requesterAppId:i,reconnect:a})=>{r.createAnalyticsEvent({eventName:"cross_app_request_started",payload:{address:t,method:n.method}});let o=e?.linkedAccounts.find(e=>!!("cross_app"===e.type&&e.embeddedWallets.find(e=>e.address===t)));if(!e||!o)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Cannot request a signature with this wallet address",address:t}}),new eK("Cannot request a signature with this wallet address");let s=r.getProviderAccessToken(o.providerApp.id),l=await s0({api:r.api,requesterAppId:i,providerAppId:o.providerApp.id});if(!s){if(l.readOnly)throw console.error("cannot transact against a read-only provider app"),new eK("Cannot transact against a read-only provider app");await a({appId:o.providerApp.id})&&(s=r.getProviderAccessToken(o.providerApp.id))}if(!s)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Transactions require a valid token",address:t}}),new eK("Transactions require a valid token");let c=window.open(void 0,void 0,s5({w:400,h:680}));if(!c)throw r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Missing token",address:t}}),new eK("Failed to initialize signature request");let d=new URL(`${l.apiUrl}/oauth/transact`);return d.searchParams.set("token",s||""),d.searchParams.set("request",s4(n)),c.location=d.href,new Promise((e,i)=>{let a=setTimeout(()=>{d(),i(new eK("Request timeout")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"Request timeout",address:t}})},12e4),s=setInterval(()=>{c.closed&&(d(),i(new eK("User rejected request")),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:"User rejected request",address:t}}))},300),l=a=>{a.data&&(a.data.token?.action==="set"&&a.data.token?.value!==void 0?r.storeProviderAccessToken(o.providerApp.id,a.data.token.value):a.data.token?.action==="clear"&&r.storeProviderAccessToken(o.providerApp.id,null),"PRIVY_CROSS_APP_ACTION_RESPONSE"===a.data.type&&a.data.result&&(d(),e(a.data.result),r.createAnalyticsEvent({eventName:"cross_app_request_success",payload:{address:t,method:n.method}})),"PRIVY_CROSS_APP_ACTION_ERROR"===a.data.type&&a.data.error&&(d(),i(a.data.error),r.createAnalyticsEvent({eventName:"cross_app_request_error",payload:{error:a.data.error,address:t}})))};window.addEventListener("message",l);let d=()=>{c.close(),clearInterval(s),clearTimeout(a),window.removeEventListener("message",l)}})},s4=e=>JSON.stringify({content:{request:{request:e}},timestamp:Date.now(),callbackUrl:window.origin}),s5=({w:e,h:t})=>{let r=void 0!==window.screenLeft?window.screenLeft:window.screenX,n=void 0!==window.screenTop?window.screenTop:window.screenY,i=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:screen.width,a=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:screen.height,o=i/window.screen.availWidth,s=a/window.screen.availHeight;return`toolbar=0,location=0,menubar=0,height=${t},width=${e},popup=1,left=${(i-e)/2/o+r},top=${(a-t)/2/s+n}`},s6="sdk_fiat_on_ramp_completed_with_status",s7={1:"ethereum",8453:"base",10:"optimism",137:"polygon",42161:"arbitrum"},s8=e=>!!s7[e],s9=({input:e,amount:t,blockchain:r})=>{let n=new URL("https://pay.coinbase.com/buy/select-asset");return n.searchParams.set("appId",e.app_id),n.searchParams.set("sessionToken",e.session_token),n.searchParams.set("defaultExperience","buy"),n.searchParams.set("presetCryptoAmount",t),n.searchParams.set("defaultNetwork",r),n.searchParams.set("partnerUserId",e.partner_user_id),{url:n}},le=Math.floor(160),lt=e=>e?{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"}:{title:"In Progress",body:"Go back to Coinbase Onramp to finish funding your account.",cta:""},lr=({isSucccess:e,onClickCta:t})=>{let{title:r,body:n,cta:i}=(0,o.useMemo)(()=>lt(e),[e]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(ls,{children:[(0,m.jsx)(la,{isSucccess:e}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:r}),(0,m.jsx)(lo,{children:n})]})]}),i&&(0,m.jsx)(n3,{onClick:t,children:i})]})},ln=e=>e?"var(--privy-color-success)":"var(--privy-color-foreground-4)",li=e=>e?W.Z:()=>(0,m.jsx)(ea.Z,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}}),la=({isSucccess:e})=>{if(!e){let e="var(--privy-color-foreground-4)";return(0,m.jsxs)("div",{style:{position:"relative"},children:[(0,m.jsx)(nX,{color:e,style:{position:"absolute"}}),(0,m.jsx)(nJ,{color:e}),(0,m.jsx)(rT,{style:{position:"absolute",width:"2.8rem",height:"2.8rem",top:"1.2rem",left:"1.2rem"}})]})}let t=li(e),r=ln(e);return(0,m.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,m.jsx)(t,{width:"4rem",height:"4rem",color:r})})},lo=A.ZP.p` font-size: 1rem; color: var(--privy-color-foreground-3); margin-bottom: 1rem; display: flex; flex-direction: column; gap: 1rem; `,ls=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 1.75rem; margin-right: 1.75rem; padding: 2rem 0; `,ll=({children:e})=>(0,m.jsxs)(lc,{children:[(0,m.jsx)(U.Z,{width:"3rem",color:"var(--privy-color-error)"}),e]}),lc=A.ZP.div` display: flex; gap: 0.5rem; background-color: var(--privy-color-error-light); align-items: flex-start; text-align: left; padding: 0.5rem 0.75rem; font-size: 0.75rem; font-weight: 400; line-height: 1.125rem; /* 150% */ padding: 0.5rem 0.75rem; && { border: 1px solid var(--privy-color-error); border-radius: var(--privy-border-radius-sm); } `,ld=({size:e=61,...t})=>(0,m.jsx)("svg",{width:e,height:e,viewBox:"0 0 61 61",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,m.jsxs)("g",{id:"moonpay_symbol_wht 2",children:[(0,m.jsx)("rect",{x:"1.3374",y:"1",width:"59",height:"59",rx:"11.5",fill:"#7715F5"}),(0,m.jsx)("path",{id:"Vector",d:"M43.8884 23.3258C45.0203 23.3258 46.1268 22.9901 47.068 22.3613C48.0091 21.7324 48.7427 20.8386 49.1759 19.7928C49.6091 18.747 49.7224 17.5962 49.5016 16.4861C49.2807 15.3759 48.7357 14.3561 47.9353 13.5557C47.1349 12.7553 46.1151 12.2102 45.0049 11.9893C43.8947 11.7685 42.7439 11.8819 41.6982 12.3151C40.6524 12.7482 39.7585 13.4818 39.1297 14.423C38.5008 15.3641 38.1651 16.4707 38.1651 17.6026C38.165 18.3542 38.3131 19.0985 38.6007 19.7929C38.8883 20.4873 39.3098 21.1182 39.8413 21.6496C40.3728 22.1811 41.0037 22.6027 41.6981 22.8903C42.3925 23.1778 43.1367 23.3259 43.8884 23.3258ZM26.3395 49.1017C23.5804 49.1017 20.8832 48.2836 18.5891 46.7507C16.295 45.2178 14.5069 43.039 13.4511 40.49C12.3952 37.9409 12.1189 35.1359 12.6572 32.4298C13.1955 29.7237 14.5241 27.238 16.4751 25.287C18.4262 23.336 20.9118 22.0074 23.6179 21.4691C26.324 20.9308 29.129 21.2071 31.6781 22.2629C34.2272 23.3189 36.406 25.1069 37.9389 27.401C39.4717 29.6952 40.2899 32.3923 40.2899 35.1514C40.2899 36.9835 39.9291 38.7975 39.2281 40.49C38.527 42.1826 37.4994 43.7205 36.204 45.0159C34.9086 46.3113 33.3707 47.3389 31.6781 48.04C29.9856 48.741 28.1715 49.1018 26.3395 49.1017Z",fill:"white"})]})}),lh=({style:e,...t})=>(0,m.jsx)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...t,children:(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M3.71369 17.5625V10.375C3.71369 6.44625 6.85845 3.25 10.7238 3.25H17.7953C18.6783 3.25 19.3941 2.52244 19.3941 1.625C19.3941 0.727562 18.6783 0 17.7953 0H10.7238C5.09529 0 0.516113 4.65419 0.516113 10.375V17.5625C0.516113 18.4599 1.23194 19.1875 2.1149 19.1875C2.99787 19.1875 3.71369 18.4599 3.71369 17.5625ZM17.7953 60.7501C18.6783 60.7501 19.3941 61.4777 19.3941 62.3751C19.3941 63.2726 18.6783 64.0001 17.7953 64.0001H10.7238C5.09529 64.0001 0.516113 59.3459 0.516113 53.6251V46.4376C0.516113 45.5402 1.23194 44.8126 2.1149 44.8126C2.99787 44.8126 3.71369 45.5402 3.71369 46.4376V53.6251C3.71369 57.5538 6.85845 60.7501 10.7238 60.7501H17.7953ZM63.4839 46.4376V53.6251C63.4839 59.3459 58.9048 64.0001 53.2763 64.0001H46.2047C45.3217 64.0001 44.6059 63.2726 44.6059 62.3751C44.6059 61.4777 45.3217 60.7501 46.2047 60.7501H53.2763C57.1416 60.7501 60.2864 57.5538 60.2864 53.6251V46.4376C60.2864 45.5402 61.0022 44.8126 61.8851 44.8126C62.7681 44.8126 63.4839 45.5402 63.4839 46.4376ZM63.4839 10.375V17.5625C63.4839 18.4599 62.7681 19.1875 61.8851 19.1875C61.0022 19.1875 60.2864 18.4599 60.2864 17.5625V10.375C60.2864 6.44625 57.1416 3.25 53.2763 3.25H46.2047C45.3217 3.25 44.6059 2.52244 44.6059 1.625C44.6059 0.727562 45.3217 0 46.2047 0H53.2763C58.9048 0 63.4839 4.65419 63.4839 10.375ZM43.0331 47.3022C43.7067 46.6698 43.7483 45.6022 43.1262 44.9176C42.5039 44.233 41.4536 44.1906 40.78 44.823C38.3832 47.0732 35.265 48.3125 31.9997 48.3125C28.7344 48.3125 25.6162 47.0732 23.2194 44.823C22.5457 44.1906 21.4955 44.233 20.8732 44.9176C20.251 45.6022 20.2927 46.6698 20.9663 47.3022C23.9784 50.1301 27.8968 51.6875 31.9997 51.6875C36.1026 51.6875 40.021 50.1301 43.0331 47.3022ZM35.3207 24.1249V36.1249C35.3207 38.5029 33.4173 40.4374 31.0777 40.4374H29.7249C28.8079 40.4374 28.0646 39.6819 28.0646 38.7499C28.0646 37.8179 28.8079 37.0624 29.7249 37.0624H31.0777C31.5863 37.0624 32.0001 36.6419 32.0001 36.1249V24.1249C32.0001 23.1929 32.7434 22.4374 33.6604 22.4374C34.5774 22.4374 35.3207 23.1929 35.3207 24.1249ZM46.7581 28.8437V24.0312C46.7581 23.151 46.056 22.4374 45.19 22.4374C44.324 22.4374 43.622 23.151 43.622 24.0312V28.8437C43.622 29.7239 44.324 30.4374 45.19 30.4374C46.056 30.4374 46.7581 29.7239 46.7581 28.8437ZM17.6109 28.8437C17.6109 29.7239 18.313 30.4374 19.1789 30.4374C20.0449 30.4374 20.747 29.7239 20.747 28.8437V24.0312C20.747 23.151 20.0449 22.4374 19.1789 22.4374C18.313 22.4374 17.6109 23.151 17.6109 24.0312V28.8437Z"})}),lu=({style:e,...t})=>(0,m.jsxs)("svg",{x:0,y:0,width:"65",height:"64",viewBox:"0 0 65 64",style:{height:"64px",width:"65px",...e},xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,m.jsxs)("g",{clipPath:"url(#clip0_113_33841)",children:[(0,m.jsx)("path",{d:"M39.1193 0.943398C34.636 -0.174912 29.9185 -0.334713 25.328 0.656273C24.9732 0.732859 24.7477 1.08253 24.8243 1.43729C24.9009 1.79205 25.2506 2.01756 25.6053 1.94097C30.0015 0.991934 34.53 1.14842 38.8375 2.22802C49.1385 4.80983 57.7129 12.5548 60.9786 22.6718C62.2416 26.5843 62.7781 30.7505 62.8855 35.1167C62.8945 35.4795 63.1958 35.7664 63.5586 35.7575C63.9215 35.7485 64.2083 35.4472 64.1994 35.0843C64.0905 30.6582 63.5477 26.3849 62.2536 22.3432C58.8621 11.7515 49.9005 3.63265 39.1193 0.943398Z"}),(0,m.jsx)("path",{d:"M21.9931 2.93163C22.343 2.83511 22.5484 2.47325 22.4518 2.12339C22.3553 1.77352 21.9935 1.56815 21.6436 1.66466C16.8429 2.98903 10.0898 7.56519 5.91628 13.6786C5.91465 13.681 5.91304 13.6834 5.91145 13.6858C2.24684 19.2083 -0.0503572 26.1484 0.591012 32.8828C0.591623 32.8892 0.592328 32.8956 0.593127 32.902C0.746837 34.1317 1.00488 35.3591 1.26323 36.5879C1.80735 39.1761 2.35282 41.7706 1.92765 44.4064C1.86986 44.7647 2.11347 45.102 2.47177 45.1598C2.83007 45.2176 3.16738 44.974 3.22518 44.6157C3.66961 41.8605 3.11776 39.173 2.56581 36.4851C2.31054 35.2419 2.05525 33.9987 1.89847 32.7486C1.29525 26.3851 3.46802 19.7466 7.00418 14.416C11.0189 8.5373 17.5201 4.16562 21.9931 2.93163Z"}),(0,m.jsx)("path",{d:"M30.6166 4.39985C38.8671 3.89603 47.1159 7.26314 52.6556 13.7139C52.8921 13.9893 52.8605 14.4042 52.5852 14.6406C52.3099 14.8771 51.895 14.8455 51.6585 14.5702C46.3904 8.43576 38.541 5.23144 30.6927 5.71195C30.6899 5.71212 30.6871 5.71227 30.6843 5.71241C20.7592 6.19265 11.4643 12.9257 8.04547 22.3603C7.92183 22.7016 7.54498 22.8779 7.20375 22.7543C6.86253 22.6306 6.68616 22.2538 6.80981 21.9126C10.4114 11.9735 20.1717 4.90702 30.6166 4.39985Z"}),(0,m.jsx)("path",{d:"M54.6576 16.5848C54.4553 16.2836 54.047 16.2033 53.7457 16.4057C53.4444 16.608 53.3642 17.0163 53.5665 17.3176C56.6376 21.8904 57.9074 26.8665 58.4094 32.7717C58.4401 33.1333 58.7582 33.4016 59.1199 33.3708C59.4815 33.3401 59.7497 33.022 59.719 32.6604C59.206 26.6261 57.8965 21.4076 54.6576 16.5848Z"}),(0,m.jsx)("path",{d:"M59.2796 35.4504C59.6419 35.4277 59.9539 35.703 59.9765 36.0653C60.2242 40.0279 60.2265 44.5112 59.7881 47.8243C59.7405 48.1841 59.4102 48.4372 59.0504 48.3896C58.6906 48.342 58.4376 48.0117 58.4852 47.6519C58.9077 44.4586 58.91 40.0704 58.6648 36.1473C58.6421 35.785 58.9174 35.473 59.2796 35.4504Z"}),(0,m.jsx)("path",{d:"M7.05311 25.5432C7.13829 25.1904 6.92135 24.8354 6.56855 24.7502C6.21576 24.665 5.86071 24.882 5.77553 25.2348C5.2932 27.2325 5.0428 29.2847 5.03288 31.3388C5.02266 33.4559 5.41742 35.5225 5.81234 37.5899C6.1354 39.2811 6.45855 40.9728 6.5602 42.6932C6.69373 44.9531 6.21839 47.2163 5.39698 49.3703C5.26766 49.7094 5.43774 50.0891 5.77685 50.2184C6.11596 50.3477 6.4957 50.1777 6.62502 49.8386C7.49325 47.5617 8.01954 45.1092 7.87221 42.6157C7.77126 40.9071 7.44813 39.2252 7.12512 37.5439C6.73099 35.4925 6.33704 33.442 6.34716 31.3451C6.35659 29.3933 6.59455 27.4425 7.05311 25.5432Z"}),(0,m.jsx)("path",{d:"M24.2964 10.94C24.4317 11.2768 24.2683 11.6595 23.9315 11.7947C17.1187 14.5307 12.0027 20.7047 10.959 27.9852C10.523 31.0269 10.9941 34.0398 11.465 37.052C11.7303 38.7483 11.9954 40.4443 12.0985 42.1451C12.3221 45.833 11.902 49.8839 9.50192 53.5696C9.30387 53.8737 8.89677 53.9597 8.59264 53.7617C8.28851 53.5636 8.20251 53.1565 8.40056 52.8524C10.5873 49.4944 11.0012 45.7644 10.7867 42.2246C10.6821 40.499 10.4185 38.7833 10.1552 37.0686C9.68265 33.9923 9.21067 30.9195 9.65804 27.7987C10.7724 20.025 16.221 13.4748 23.4417 10.5751C23.7785 10.4399 24.1612 10.6032 24.2964 10.94Z"}),(0,m.jsx)("path",{d:"M47.3662 14.6814C41.9915 9.64741 34.2017 7.89046 27.122 9.4433C26.7675 9.52105 26.5432 9.87147 26.6209 10.226C26.6987 10.5805 27.0491 10.8048 27.4036 10.7271C34.1075 9.25665 41.4426 10.934 46.4677 15.6406C50.7033 19.6077 53.1628 25.38 53.8066 31.6779C53.8435 32.0389 54.1661 32.3017 54.5272 32.2648C54.8883 32.2279 55.151 31.9053 55.1141 31.5442C54.4456 25.0047 51.8822 18.9111 47.3662 14.6814Z"}),(0,m.jsx)("path",{d:"M54.9766 34.6738C55.3376 34.6368 55.6604 34.8994 55.6975 35.2604C56.3216 41.337 56.0526 47.9003 55.1104 54.2496C55.0571 54.6086 54.7229 54.8565 54.3639 54.8032C54.0049 54.7499 53.7571 54.4157 53.8103 54.0567C54.7394 47.7957 55.001 41.3439 54.39 35.3947C54.353 35.0336 54.6156 34.7109 54.9766 34.6738Z"}),(0,m.jsx)("path",{d:"M32.0659 13.3553C21.9959 13.3553 13.814 21.3892 13.814 31.3219C13.814 32.3829 13.9081 33.4225 14.0876 34.4334C14.1511 34.7907 14.4922 35.029 14.8495 34.9655C15.2069 34.9021 15.4451 34.561 15.3817 34.2036C15.2155 33.2677 15.1283 32.305 15.1283 31.3219C15.1283 22.1352 22.7014 14.6696 32.0659 14.6696C36.2978 14.6696 40.1642 16.1949 43.1319 18.7152C43.4086 18.9501 43.8233 18.9163 44.0582 18.6396C44.2931 18.363 44.2593 17.9483 43.9827 17.7134C40.7847 14.9975 36.6188 13.3553 32.0659 13.3553Z"}),(0,m.jsx)("path",{d:"M45.455 20.1635C45.717 19.9123 46.133 19.921 46.3842 20.183C49.2843 23.2072 50.2126 27.9605 50.8269 31.9494C51.5188 36.4426 51.6244 40.826 51.6244 42.8585C51.6244 43.2214 51.3302 43.5156 50.9673 43.5156C50.6044 43.5156 50.3101 43.2214 50.3101 42.8585C50.3101 40.8589 50.2055 36.5497 49.5279 32.1494C48.9577 28.4462 48.1356 23.9082 45.4356 21.0927C45.1844 20.8307 45.1931 20.4147 45.455 20.1635Z"}),(0,m.jsx)("path",{d:"M51.4576 46.6219C51.4864 46.2601 51.2165 45.9435 50.8547 45.9146C50.493 45.8858 50.1763 46.1557 50.1474 46.5175C49.8247 50.5654 49.403 54.6088 48.5474 58.3439C48.4663 58.6977 48.6874 59.0502 49.0412 59.1312C49.3949 59.2123 49.7474 58.9912 49.8285 58.6374C50.7067 54.8039 51.134 50.6806 51.4576 46.6219Z"}),(0,m.jsx)("path",{d:"M15.1454 36.852C15.5015 36.7819 15.847 37.0137 15.9171 37.3698C17.3066 44.4257 16.3467 50.8355 12.6672 56.4502C12.4682 56.7537 12.0609 56.8385 11.7573 56.6396C11.4538 56.4407 11.369 56.0333 11.5679 55.7298C15.0299 50.4469 15.9617 44.3985 14.6276 37.6238C14.5575 37.2677 14.7893 36.9221 15.1454 36.852Z"}),(0,m.jsx)("path",{d:"M32.0659 17.631C25.5291 17.631 19.1165 22.691 18.462 29.0504C18.1754 31.8345 18.578 34.5769 18.9807 37.3204C19.3323 39.7159 19.684 42.1124 19.5772 44.5381C19.3328 50.0898 17.7039 54.6726 14.905 58.4471C14.6888 58.7386 14.7499 59.1502 15.0414 59.3663C15.333 59.5825 15.7445 59.5214 15.9607 59.2299C18.9293 55.2266 20.6354 50.386 20.8903 44.5959C20.9966 42.1811 20.6438 39.7923 20.2912 37.4051C19.888 34.6752 19.4851 31.9473 19.7694 29.1849C20.3444 23.5983 26.0946 18.9453 32.0659 18.9453C34.851 18.9453 42.057 20.4534 44.3492 27.9205C45.7856 32.5998 46.1774 38.9326 45.8295 45.0849C45.4816 51.2364 44.3994 57.12 42.9442 60.8928C42.8136 61.2314 42.9822 61.6118 43.3208 61.7424C43.6594 61.873 44.0398 61.7044 44.1704 61.3658C45.6929 57.4186 46.7895 51.386 47.1417 45.1591C47.4938 38.9329 47.1068 32.4249 45.6056 27.5348C43.0612 19.2461 35.0851 17.631 32.0659 17.631Z"}),(0,m.jsx)("path",{d:"M21.9529 56.4512C22.2569 56.6494 22.3426 57.0566 22.1444 57.3606C21.7369 57.9854 21.3784 58.6391 21.0199 59.2928C20.6614 59.9465 20.3028 60.6004 19.8953 61.2253C19.697 61.5293 19.2898 61.615 18.9858 61.4167C18.6819 61.2184 18.5962 60.8113 18.7944 60.5073C19.2019 59.8825 19.5604 59.2288 19.9189 58.5751C20.2774 57.9213 20.636 57.2675 21.0435 56.6426C21.2418 56.3386 21.649 56.2529 21.9529 56.4512Z"}),(0,m.jsx)("path",{d:"M27.5799 24.4525C27.8816 24.2508 27.9625 23.8426 27.7608 23.541C27.559 23.2393 27.1509 23.1583 26.8492 23.3601C24.247 25.1006 22.6505 27.494 22.6505 31.0002C22.6505 33.088 23.0203 34.7946 23.3997 36.5449C23.9674 39.1641 24.3524 41.7777 24.2832 44.468C24.1992 47.7349 23.56 50.7201 22.3313 53.564C22.1873 53.8971 22.3407 54.2839 22.6739 54.4278C23.0071 54.5718 23.3938 54.4184 23.5378 54.0852C24.8369 51.0784 25.509 47.9266 25.5971 44.5018C25.6689 41.7062 25.2732 38.9892 24.6845 36.267C24.3042 34.509 23.9648 32.9394 23.9648 31.0002C23.9648 27.9961 25.2863 25.9866 27.5799 24.4525Z"}),(0,m.jsx)("path",{d:"M30.1447 22.1436C32.8717 21.5877 35.8061 22.2746 37.966 24.0228C41.8241 27.1455 42.3372 32.8403 42.753 37.4549L42.7742 37.69C43.3115 43.6385 42.6964 49.4163 41.4575 55.2186C41.3817 55.5736 41.0326 55.7999 40.6776 55.7241C40.3227 55.6483 40.0964 55.2991 40.1722 54.9442C41.3926 49.2288 41.9873 43.5885 41.4652 37.8082C41.4479 37.6169 41.4307 37.4228 41.4133 37.2264L41.4131 37.2235C41.0438 33.0534 40.5812 27.8304 37.1392 25.0444C35.2926 23.5498 32.7599 22.9518 30.4073 23.4314C30.0517 23.5039 29.7046 23.2744 29.6321 22.9188C29.5596 22.5632 29.7891 22.2161 30.1447 22.1436Z"}),(0,m.jsx)("path",{d:"M40.5287 58.4885C40.6183 58.1368 40.4057 57.7791 40.054 57.6896C39.7023 57.6 39.3446 57.8126 39.2551 58.1643C38.8578 59.7247 38.2456 61.1333 37.4695 62.4301C37.2831 62.7415 37.3844 63.145 37.6958 63.3314C38.0072 63.5178 38.4108 63.4165 38.5972 63.1051C39.4336 61.7075 40.0977 60.1816 40.5287 58.4885Z"}),(0,m.jsx)("path",{d:"M37.3152 48.9521C37.6756 48.9948 37.9332 49.3215 37.8906 49.682C37.2699 54.9267 35.8688 59.6042 33.6205 63.6613C33.4446 63.9787 33.0446 64.0934 32.7272 63.9175C32.4097 63.7416 32.295 63.3417 32.4709 63.0242C34.6226 59.1416 35.9811 54.6339 36.5854 49.5275C36.6281 49.1671 36.9548 48.9095 37.3152 48.9521Z"}),(0,m.jsx)("path",{d:"M37.1798 30.6556C36.7242 28.2212 34.6349 26.3591 32.0985 26.3591C28.6638 26.3591 26.254 29.8212 27.1032 33.0422C28.54 38.7279 28.7759 44.2077 27.8032 49.4855L27.8025 49.4893C26.9584 54.228 25.3374 58.4908 23.1263 62.1031C22.9368 62.4127 23.0342 62.8172 23.3437 63.0067C23.6533 63.1962 24.0578 63.0988 24.2473 62.7893C26.5488 59.0292 28.2249 54.6109 29.0961 49.7218C30.106 44.2403 29.8558 38.5684 28.3765 32.7168L28.3748 32.7099C27.7378 30.3005 29.5133 27.6734 32.0985 27.6734C33.9641 27.6734 35.5393 29.0459 35.8871 30.8929C36.8436 36.4411 37.3418 41.5862 36.9871 46.016C36.9581 46.3778 37.2279 46.6945 37.5897 46.7235C37.9515 46.7525 38.2682 46.4827 38.2972 46.1209C38.6649 41.5294 38.1459 36.2576 37.1815 30.6648C37.1809 30.6617 37.1804 30.6586 37.1798 30.6556Z"}),(0,m.jsx)("path",{d:"M30.1376 59.1171C30.4604 59.283 30.5876 59.6792 30.4217 60.002L28.6804 63.3906C28.5145 63.7134 28.1184 63.8406 27.7956 63.6747C27.4728 63.5088 27.3456 63.1127 27.5114 62.7899L29.2527 59.4013C29.4186 59.0785 29.8147 58.9513 30.1376 59.1171Z"}),(0,m.jsx)("path",{d:"M32.5872 31.2892C32.5042 30.9359 32.1505 30.7168 31.7972 30.7998C31.4439 30.8828 31.2247 31.2365 31.3077 31.5898C33.5238 41.0232 33.2194 49.3066 30.5201 56.363C30.3905 56.702 30.5602 57.0819 30.8991 57.2115C31.2381 57.3412 31.618 57.1715 31.7477 56.8326C34.5622 49.475 34.8483 40.9141 32.5872 31.2892Z"})]}),(0,m.jsx)("defs",{children:(0,m.jsx)("clipPath",{id:"clip0_113_33841",children:(0,m.jsx)("rect",{width:"64",height:"64",fill:"white",transform:"translate(0.483887)"})})})]}),lp=({passkeys:e,expanded:t,onUnlink:r,onExpand:n})=>{let[i,a]=(0,o.useState)([]),s=t?e.length:2,l=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",c=async e=>{a(t=>t.concat([e])),await r(e),a(t=>t.filter(t=>t!==e))};return(0,m.jsxs)("div",{children:[(0,m.jsx)(l_,{children:"Your passkeys"}),(0,m.jsxs)(lx,{children:[e.slice(0,s).map(e=>(0,m.jsxs)(lE,{children:[(0,m.jsxs)("div",{children:[(0,m.jsx)(lj,{children:l(e)}),(0,m.jsxs)(lk,{children:["Last used: ",(e.latestVerifiedAt??e.verifiedAt).toLocaleString()]})]}),(0,m.jsx)(lS,{disabled:i.includes(e.credentialId),onClick:()=>c(e.credentialId),children:i.includes(e.credentialId)?(0,m.jsx)(n0,{}):(0,m.jsx)(el.Z,{height:"1.6em"})})]},e.credentialId)),e.length>2&&!t&&(0,m.jsx)(lw,{onClick:n,children:"View all"})]})]})},lm=()=>(0,m.jsxs)(lx,{children:[(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(ec.Z,{})}),"Log in with Touch ID, Face ID, or a security key."]}),(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(J.Z,{})}),"More secure than a password."]}),(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(es.Z,{})}),"Takes seconds to set up and use."]})]}),lg=A.ZP.div` display: flex; align-items: center; justify-content: center; width: 180px; height: 90px; border-radius: 50%; svg + svg { margin-left: 12px; } > svg { z-index: 2; color: var(--privy-color-accent) !important; stroke: var(--privy-color-accent) !important; fill: var(--privy-color-accent) !important; } `,lf=A.ZP.div` line-height: 20px; height: 20px; font-size: 13px; color: ${e=>e.success?"var(--privy-color-success)":e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"}; display: flex; justify-content: flex-beginngin; width: 100%; `,ly=(0,A.iv)` && { width: 100%; font-size: 0.875rem; line-height: 1rem; /* Tablet and Up */ @media (min-width: 440px) { font-size: 14px; } display: flex; gap: 12px; justify-content: center; padding: 6px 8px; background-color: var(--privy-color-background); transition: background-color 200ms ease; color: var(--privy-color-accent) !important; :focus { outline: none; box-shadow: none; } } `,lw=A.ZP.button` ${ly} `,lx=A.ZP.div` display: flex; flex-direction: column; align-items: stretch; gap: 0.8rem; padding: 0.5rem 0rem 0rem; flex-grow: 1; width: 100%; `,lv=A.ZP.div` font-size: 18px; line-height: 18px; text-align: center; font-weight: 600; `,lC=A.ZP.div` font-size: 0.875rem; text-align: center; margin-top: 10px; `,lb=A.ZP.div` height: 32px; `,l_=A.ZP.div` line-height: 20px; height: 20px; font-size: 1em; font-weight: 450; display: flex; justify-content: flex-beginning; width: 100%; `,lj=A.ZP.div` font-size: 1em; line-height: 1.3em; font-weight: 500; color: var(--privy-color-foreground-2); padding: 0.2em 0; `,lk=A.ZP.div` font-size: 0.875rem; line-height: 1rem; color: #64668b; padding: 0.2em 0; `,lE=A.ZP.div` display: flex; align-items: center; justify-content: space-between; padding: 1em; gap: 10px; font-size: 0.875rem; line-height: 1rem; text-align: left; border-radius: 8px; border: 1px solid #e2e3f0 !important; width: 100%; height: 5em; `,lA=(0,A.iv)` :focus, :hover, :active { outline: none; } display: flex; width: 2em; height: 2em; justify-content: center; align-items: center; svg { color: var(--privy-color-error); } svg:hover { color: var(--privy-color-foreground-3); } `,lS=A.ZP.button` ${lA} `,lT=A.ZP.div` display: flex; flex-direction: column; gap: 12px; padding-top: 24px; padding-bottom: 24px; `,lP=A.ZP.div` width: 24px; height: 24px; display: flex; justify-content: center; align-items: center; svg { border-radius: var(--privy-border-radius-sm); } `,lN=A.ZP.div` display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 8px; `,lR=A.ZP.div` display: flex; align-items: baseline; gap: 4px; `,lM=A.ZP.div` font-size: 42px !important; `,lO=A.ZP.input` font-size: 42px !important; text-align: right; background-color: var(--privy-color-background); // HACK: The only way this is centerable is to set a content-based width. // The --funding-input-length is updated via the component. // Note that 'ch' has 98.25% global browser adoption width: calc(1ch * var(--funding-input-length)); &:focus { outline: none !important; border: none !important; box-shadow: none !important; } `,lI=A.ZP.div` cursor: pointer; padding-left: 4px; `,lW=A.ZP.div` font-size: 18px; `,lL=A.ZP.div` font-size: 12px; color: var(--privy-color-foreground-3); // we need this container to maintain a static height if there's no content height: 20px; `,lF=A.ZP.div` display: flex; flex-direction: row; line-height: 22px; font-size: 16px; text-align: center; svg { margin-right: 6px; margin: auto; } `,lU=(0,A.ZP)(lw)` margin-top: 16px; `,lD=(0,A.F4)` from { opacity: 0; } to { opacity: 1; } `,lZ=(0,A.ZP)(ie)` border-radius: var(--privy-border-radius-md) !important; animation: ${lD} 0.3s ease-in-out; `,lz=A.ZP.span` text-align: left; font-size: 0.75rem; font-weight: 500; line-height: 1.125rem; /* 150% */ color: var(--privy-color-error); `,l$=A.ZP.span` color: var(--privy-color-foreground-3); font-size: 0.75rem; font-weight: 500; line-height: 1.125rem; /* 150% */ `,lH=({address:e,showCopyIcon:t,url:r,className:n})=>r?(0,m.jsx)("a",{title:e,className:n,href:`${r}/address/${e}`,target:"_blank",children:tm(e)}):(0,m.jsxs)("button",{title:e,className:n,onClick:()=>navigator.clipboard.writeText(e).catch(console.error),children:[tm(e),t&&(0,m.jsx)(lB,{})]}),lB=(0,A.ZP)(D.Z)` && { display: inline; } stroke-width: 2; height: 0.875rem; width: 0.875rem; margin-left: 0.125rem; color: var(--privy-color-foreground-3); `,lq=({errMsg:e,balance:t,address:r,isLoading:n,className:i,title:a,isPulsing:o,statusColor:s="green"})=>{let l;return l=s||(e?"red":"green"),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(lV,{className:i,$state:e?"error":void 0,children:[(0,m.jsxs)(oc,{children:[(0,m.jsx)(l$,{children:a||"Pay with"}),(0,m.jsx)(lH,{address:r,showCopyIcon:!!e})]}),(0,m.jsx)(aj,{isLoading:n,isPulsing:o,color:l,children:t})]}),e&&(0,m.jsx)(lz,{style:{marginTop:"0.25rem"},children:e})]})},lV=A.ZP.div` && { border-width: 1px; } text-align: left; border: solid 1px var(--privy-color-foreground-4); border-radius: var(--privy-border-radius-md); padding: 0.5rem 1rem; display: flex; justify-content: space-between; align-items: center; ${e=>"error"===e.$state?"border-color: var(--privy-color-error);":""} `,lG=({...e})=>(0,m.jsx)(rG,{color:"black",...e}),lK=e=>{let[t,r]=(0,o.useState)(!1);return(0,m.jsx)(l1,{onClick:()=>{r(!0),navigator.clipboard.writeText(e.text),setTimeout(()=>r(!1),1500)},children:(0,m.jsxs)(l0,{children:[t?(0,m.jsx)(ss,{style:{height:"16px",width:"16px"},strokeWidth:"2"}):(0,m.jsx)(Q.Z,{style:{height:"16px",width:"16px"}}),t?"Copied":"Copy address"]})})},lY=A.ZP.div` display: flex; flex-direction: row; gap: 8px; `,lQ=A.ZP.div` display: flex; flex-direction: row; padding: 8px; background-color: var(--privy-color-background-2); border-radius: var(--privy-border-radius-md); svg { margin-right: 12px; } `,lX=A.ZP.div` line-height: 20px; font-size: 18px text-align: center; `,lJ=A.ZP.div` display: flex; flex-direction: column; background-color: var(--privy-color-background-2); border-radius: var(--privy-border-radius-md); svg { margin-right: 6px; } padding: 16px; gap: 8px; `,l0=A.ZP.span` display: flex; align-items: center; margin: auto; `,l1=A.ZP.button` display: flex; align-items: center; width: 100%; && { border-radius: var(--privy-border-radius-md); border: 1px solid var(--privy-color-foreground-4); background-color: white; line-height: 18px; text-align: center; padding: 8px; font-size: 14px; background-color: var(--privy-color-background); color: ${e=>e.justCopied?"var(--privy-color-foreground-2)":"var(--privy-color-foreground-accent-dark)"}; font-weight: ${e=>e.justCopied?"medium":"normal"}; transition: color 350ms ease; :active { outline: none; box-shadow: none; } :hover { color: ${e=>e.justCopied?"var(--privy-color-foreground-2)":"var(--privy-color-foreground-accent-dark)"}; } :active { color: 'var(--privy-color-foreground-accent-dark)'; font-weight: medium; } } svg { width: 18px; height: 18px; } `,l2=({title:e,desc:t,icon:r})=>(0,m.jsxs)(l9,{children:[(0,m.jsx)(ct,{children:r}),(0,m.jsxs)(ce,{children:[(0,m.jsx)(l7,{children:e}),(0,m.jsx)(l8,{children:t})]})]}),l3=({app:e,signedUrl:t,onContinue:r})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(l5,{children:[(0,m.jsx)(ld,{size:"3.75rem"}),(0,m.jsxs)(l6,{children:[e?.name," uses ",(0,m.jsx)("span",{style:{fontWeight:"bold"},children:"Moonpay"})," to fund your account"]}),(0,m.jsxs)(cr,{children:[(0,m.jsx)(l2,{icon:(0,m.jsx)(eu.Z,{width:"1rem"}),title:"Purchase assets to fund your account",desc:(0,m.jsxs)(m.Fragment,{children:["Connect a payment method (",(0,m.jsx)("strong",{children:"debit card recommended"}),") to purchase digital assets."]})}),(0,m.jsx)(l2,{icon:(0,m.jsx)(es.Z,{width:"1rem"}),title:"Compliance takes time",desc:"Funding a new account may take a few hours. You'll be good to go thereafter."}),(0,m.jsx)(l2,{icon:(0,m.jsx)($.Z,{width:"1rem"}),title:"Your data belongs to you",desc:"MoonPay does not sell your data and will only use it with your permission."})]}),(0,m.jsx)(cn,{className:"mobile-only"})]}),(0,m.jsx)(l4,{children:"By clicking continue, you will be taken to MoonPay in a new tab."}),(0,m.jsx)(n6,{disabled:!t,href:t??"#",target:"_blank",rel:"noopener noreferrer",onClick:r,children:"Continue to Moonpay"})]}),l4=A.ZP.span` display: inline-block; color: var(--privy-color-foreground-3); text-align: center; font-size: 0.625rem; font-style: normal; font-weight: 400; line-height: 140%; /* 0.875rem */ margin-bottom: 0.25rem; `,l5=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 1.5rem 0; `,l6=A.ZP.span` color: var(--privy-color-foreground); text-align: center; font-size: 1.125rem; font-weight: 500; line-height: 1.25rem; /* 111.111% */ margin: 1.5rem 0; text-align: center; max-width: 19.5rem; `,l7=A.ZP.span` color: var(--privy-color-foreground); font-size: 0.875rem; font-weight: 500; line-height: 1.225rem; width: 100%; `,l8=A.ZP.span` color: var(--privy-color-foreground-2); font-size: 0.875rem; font-weight: 400; line-height: 1.225rem; `,l9=A.ZP.div` display: flex; align-items: flex-start; gap: 0.5rem; align-self: stretch; `,ce=A.ZP.div` display: flex; flex-direction: column; gap: 0.25rem; align-items: flex-start; text-align: left; flex: 1 0 0; `,ct=A.ZP.div` padding-top: 2px; `,cr=A.ZP.div` display: flex; flex-direction: column; gap: 1.25rem; margin: 0 0.5rem; `,cn=A.ZP.div` margin: 30px 0; `,ci="moonpay";function ca(e){return!!e&&(void 0!==e.chain||void 0!==e.amount)}async function co(e,t,r,n,i=!1){let a=r.currencyCode?{}:{defaultCurrencyCode:"ETH_ETHEREUM"},o=r.uiConfig||{accentColor:n.accent,theme:n.colorScheme};return e.signMoonpayOnRampUrl({address:t,useSandbox:i,config:{...r,...a,...o}})}async function cs(e,t){return(0,_.Wg)(`https://api.moonpay.com/v1/transactions/ext/${e}`,{query:{apiKey:t?"pk_test_fqWjXZMSFwloh7orvJsRfjiUHXJqFzI":"pk_live_hirbpu0cVcLHrjktC9l7fbc9ctjv0SL"}})}var cl=e=>{switch(e){case"completed":return{title:"You've funded your account!",body:"It may take a few minutes for the assets to appear.",cta:"Continue"};case"waitingAuthorization":return{title:"Processing payment",body:"This may take up to a few hours. You will receive an email when the purchase is complete.",cta:"Continue"};default:return{title:"In Progress",body:"Go back to MoonPay to finish funding your account.",cta:""}}},cc=({status:e,onClickCta:t})=>{let{title:r,body:n,cta:i}=(0,o.useMemo)(()=>cl(e),[e]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(cm,{children:[(0,m.jsx)(cu,{status:e}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:r}),(0,m.jsx)(cp,{children:n})]})]}),i&&(0,m.jsx)(n3,{onClick:t,children:i})]})},cd=e=>e?({completed:"var(--privy-color-success)",failed:"var(--privy-color-error)",serviceFailure:"var(--privy-color-error)",waitingAuthorization:"var(--privy-color-accent)",pending:"var(--privy-color-foreground-4)"})[e]:"var(--privy-color-foreground-4)",ch=e=>{switch(e){case"completed":return W.Z;case"waitingAuthorization":return()=>(0,m.jsx)(ea.Z,{width:"3rem",height:"3rem",style:{backgroundColor:"var(--privy-color-foreground-4)",color:"var(--privy-color-background)",borderRadius:"100%",padding:"0.5rem",margin:"0.5rem"}});default:return}},cu=({status:e})=>{if(!e||"pending"===e){let e="var(--privy-color-foreground-4)";return(0,m.jsxs)("div",{style:{position:"relative"},children:[(0,m.jsx)(nX,{color:e,style:{position:"absolute"}}),(0,m.jsx)(nJ,{color:e}),(0,m.jsx)(ld,{size:"3rem",style:{position:"absolute",top:"1rem",left:"1rem"}})]})}let t=ch(e),r=cd(e);return(0,m.jsx)("div",{style:{borderColor:r,display:"flex",justifyContent:"center",alignItems:"center",borderRadius:"100%",borderWidth:2,padding:"0.5rem",marginBottom:"0.5rem"},children:t&&(0,m.jsx)(t,{width:"4rem",height:"4rem",color:r})})},cp=A.ZP.p` font-size: 1rem; color: var(--privy-color-foreground-3); margin-bottom: 1rem; display: flex; flex-direction: column; gap: 1rem; `,cm=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 1.75rem; margin-right: 1.75rem; padding: 2rem 0; `,cg=A.ZP.span` margin-top: 4px; color: var(--privy-color-foreground); text-align: center; font-size: 0.875rem; font-weight: 400; line-height: 1.375rem; /* 157.143% */ `,cf=()=>{let{enabled:e,token:t}=nF(),{navigate:r,setModalData:n}=ny(),{initLoginWithPasskey:i}=nZ();return(0,m.jsx)(cw,{onClick:async()=>{e&&!t?(n({captchaModalData:{callback:e=>i(e),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSKEY_SYSTEM_DIALOGUE",onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN")):(await i(),r("AWAITING_PASSKEY_SYSTEM_DIALOGUE"))},children:"I have a passkey"})},cy=(0,A.iv)` && { width: 100%; font-size: 0.875rem; line-height: 1rem; /* Tablet and Up */ @media (min-width: 440px) { font-size: 14px; } display: flex; gap: 12px; justify-content: center; padding: 6px 8px; background-color: var(--privy-color-background); transition: background-color 200ms ease; color: var(--privy-color-accent) !important; :focus { outline: none; box-shadow: none; } } `,cw=A.ZP.button` ${cy} `,cx=({onClick:e,text:t})=>(0,m.jsxs)(i_,{onClick:e,children:[(0,m.jsx)(F.Z,{}),(0,m.jsx)(iy,{children:t}),(0,m.jsx)(ep.Z,{})]}),cv=A.ZP.div` border-radius: 50%; height: 68px; width: 68px; display: flex; align-items: center; justify-content: center; background-color: var(--privy-color-accent); color: white; margin: 0 auto 24px auto; `,cC=({style:e,...t})=>(0,m.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"17",height:"17",viewBox:"0 0 17 17",style:{height:"1.25rem",width:"1.25rem",...e},...t,children:(0,m.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",fillRule:"evenodd",clipRule:"evenodd",d:"M16.5 8.67993C16.5 9.82986 15.853 10.8287 14.9032 11.3322C15.2188 12.3599 14.97 13.5237 14.1569 14.3368C13.3437 15.1499 12.18 15.3987 11.1523 15.0831C10.6488 16.0329 9.64993 16.6799 8.5 16.6799C7.35007 16.6799 6.35126 16.0329 5.84771 15.0831C4.82003 15.3987 3.65627 15.1499 2.84314 14.3368C2.03001 13.5237 1.78124 12.3599 2.09681 11.3322C1.14699 10.8287 0.5 9.82986 0.5 8.67993C0.5 7.53 1.14699 6.53119 2.0968 6.02764C1.78125 4.99996 2.03003 3.83621 2.84315 3.02309C3.65627 2.20997 4.82002 1.96119 5.8477 2.27675C6.35125 1.32692 7.35007 0.679932 8.5 0.679932C9.64992 0.679932 10.6487 1.32691 11.1523 2.27672C12.18 1.96115 13.3437 2.20993 14.1569 3.02305C14.97 3.83618 15.2188 4.99996 14.9032 6.02764C15.853 6.53119 16.5 7.53 16.5 8.67993ZM12.2659 6.68856C12.5654 6.40238 12.5761 5.92763 12.29 5.62818C12.0038 5.32873 11.529 5.31797 11.2296 5.60416C9.73022 7.03711 8.40877 8.65489 7.3018 10.4211L5.78033 8.89963C5.48744 8.60673 5.01256 8.60673 4.71967 8.89963C4.42678 9.19252 4.42678 9.66739 4.71967 9.96029L6.92031 12.1609C7.08544 12.3261 7.31807 12.4048 7.54957 12.374C7.78106 12.3432 7.98499 12.2064 8.1012 12.0038C9.23027 10.0356 10.6362 8.24613 12.2659 6.68856Z",fill:"var(--privy-color-accent)"})}),cb=A.ZP.div` display: flex; flex-direction: column; justify-content: flex-start; gap: 4px; `,c_=A.ZP.div` &&& { margin-left: 7px; /* TODO: This is a total hack */ border-left: 2px solid var(--privy-color-foreground-4); height: 12px; } `,cj=({children:e})=>(0,m.jsxs)(ck,{children:[(0,m.jsx)(cC,{style:{width:"16px",height:"16px"}}),e]}),ck=A.ZP.div` display: flex; justify-content: flex-start; justify-items: center; text-align: left; gap: 8px; && { a { text-decoration: underline; color: var(--privy-color-accent); } svg { margin-top: auto; margin-bottom: auto; } } `,cE=()=>(0,m.jsxs)(cA,{children:[(0,m.jsx)(aa,{title:"Create a Phantom wallet",description:"Follow the instructions below to get started."}),(0,m.jsx)(i3,{children:(0,m.jsx)(rX,{style:{width:"152px",height:"152px"}})}),(0,m.jsxs)(cb,{children:[(0,m.jsx)(cj,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)("span",{children:"Install the "}),(0,m.jsx)("a",{href:s.vU?"https://addons.mozilla.org/en-US/firefox/addon/phantom-app/":"https://chrome.google.com/webstore/detail/phantom/bfnaelmomeimhlpmgjnjophhpkkoljpa?hl=en",target:"_blank",children:"Phantom browser extension"})]})}),(0,m.jsx)(c_,{}),(0,m.jsx)(cj,{children:"Set up your first wallet"}),(0,m.jsx)(c_,{}),(0,m.jsx)(cj,{children:"Store your recovery phrase in a safe place!"})]}),(0,m.jsx)(ie,{onClick:()=>window.location.reload(),children:"Reload the page to use your wallet"})]}),cA=(0,A.ZP)(i3)` gap: 30px; > :first-child > svg { margin-top: 20px; } `,cS={apple_oauth:"apple",custom_auth:"custom",discord_oauth:"discord",email:"email",farcaster:"farcaster",github_oauth:"github",google_oauth:"google",instagram_oauth:"instagram",linkedin_oauth:"linkedin",passkey:"passkey",phone:"sms",spotify_oauth:"spotify",telegram:"telegram",tiktok_oauth:"tiktok",twitter_oauth:"twitter",wallet:"siwe",cross_app:"privy:",guest:"guest"},cT=e=>{let t=cS[e];return"wallet"===e||"phone"===e?{displayName:e,loginMethod:t}:{displayName:t,loginMethod:t}},cP=()=>{let{app:e}=ny(),t=e?.appearance?.logo,r=`${e?.name} logo`,n={maxHeight:"90px",maxWidth:"180px"};return t?"string"==typeof t?(0,m.jsx)("img",{src:t,alt:r,style:n}):"svg"===t.type||"img"===t.type?o.cloneElement(t,{alt:r,style:n}):(console.warn("`config.appearance.logo` must be a string, or an SVG / IMG element. Nothing will be rendered."),null):null},cN=e=>{let{app:t}=ny();return t?.appearance.logo?(0,m.jsx)(cR,{...e,children:(0,m.jsx)(cP,{})}):null},cR=A.ZP.div` display: flex; flex-direction: column; align-items: center; padding: 24px 0; flex-grow: 1; justify-content: center; `,cM=(0,o.forwardRef)((e,t)=>{let[r,n]=(0,o.useState)(""),[i,a]=(0,o.useState)(!1),{authenticated:s}=n$(),{initLoginWithEmail:l}=nZ(),{navigate:c,setModalData:d,currentScreen:h}=ny(),{enabled:u,token:p}=nF(),[g,f]=(0,o.useState)(!1),{accountType:y}=aW(),w=tu(r),x=i||!w,v=e=>{a(!0),l(r,e).then(()=>{c("AWAITING_PASSWORDLESS_CODE")}).catch(e=>{d({errorModalData:{error:e,previousScreen:h||"LANDING"}}),c("ERROR_SCREEN")}).finally(()=>{a(!1)})},C=()=>{!u||p||s?v(p):(d({captchaModalData:{callback:e=>l(r,e),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),c("CAPTCHA_SCREEN"))};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(cO,{children:(0,m.jsxs)(cI,{stacked:e.stacked,children:[(0,m.jsx)(O.Z,{}),(0,m.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onFocus:()=>f(!0),onChange:e=>n(e.target.value),onKeyUp:e=>{"Enter"===e.key&&C()},value:r,autoComplete:"email"}),"email"!==y||g?e.stacked?(0,m.jsx)("span",{}):(0,m.jsx)(it,{isSubmitting:i,onClick:C,disabled:x,children:"Submit"}):(0,m.jsx)(aj,{color:"gray",children:"Recent"})]})}),e.stacked?(0,m.jsx)(n3,{loadingText:null,loading:i,disabled:x,onClick:C,children:"Submit"}):null]})}),cO=A.ZP.div` width: 100%; `,cI=A.ZP.label` display: block; position: relative; width: 100%; > svg { position: absolute; margin: 13px 17px; height: 24px; width: 24px; color: var(--privy-color-foreground-3); } && > input { font-size: 16px; line-height: 24px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; padding: 12px 88px 12px 52px; padding-right: ${e=>e.stacked?"16px":"88px"}; flex-grow: 1; background: var(--privy-color-background); border: 1px solid var(--privy-color-foreground-4); border-radius: var(--privy-border-radius-mdlg); width: 100%; /* Tablet and Up */ @media (min-width: 441px) { font-size: 14px; padding-right: 78px; } :focus { outline: none; border-color: var(--privy-color-accent); } :autofill, :-webkit-autofill { background: var(--privy-color-background); } } && > :last-child { right: 16px; position: absolute; top: 50%; transform: translate(0, -50%); } && > button:last-child { right: 0px; line-height: 24px; padding: 13px 17px; :focus { outline: none; border-color: var(--privy-color-accent); } } && > input::placeholder { color: var(--privy-color-foreground-3); } `,cW=({isEditable:e,setIsEditable:t})=>{let r=(0,o.useRef)(null);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ik,{if:!e,children:(0,m.jsx)(cM,{ref:r})}),(0,m.jsx)(ik,{if:e,children:(0,m.jsxs)(i_,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,m.jsx)(O.Z,{})," Continue with Email"]})})]})},cL=()=>{let[e,t]=(0,o.useState)(!1),{currentScreen:r,navigate:n,setModalData:i}=ny(),{enabled:a,token:s}=nF(),{initLoginWithFarcaster:l}=nZ(),{accountType:c}=aW();return(0,m.jsxs)(i_,{onClick:async()=>{t(!0);try{a&&!s?(i({captchaModalData:{callback:e=>l(e),userIntentRequired:!0,onSuccessNavigateTo:"AWAITING_FARCASTER_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN")):(await l(s),n("AWAITING_FARCASTER_CONNECTION"))}catch(e){i({errorModalData:{error:e,previousScreen:r||"LANDING"}}),n("ERROR_SCREEN")}finally{t(!1)}},disabled:!1,children:[(0,m.jsx)(s_,{})," Farcaster",e&&(0,m.jsx)("span",{children:(0,m.jsx)(n0,{})}),"farcaster"===c&&(0,m.jsx)(cF,{color:"gray",children:"Recent"})]})},cF=(0,A.ZP)(aj)` margin-left: auto; `,cU=(e,t)=>(0,eg.t)(String(e),t),cD=(e,t)=>`+${(0,ef.G)(t)} ${e}`,cZ=e=>`*${e.replaceAll("-","").slice(-4)}`,cz=e=>new ey.R(e),c$=(0,ew.o)().map(e=>({code:e,callCode:(0,ef.G)(e)})),cH=e=>{let t=ex.L(e,em.Z)?.formatInternational();return t?.substring(t.indexOf(" ")+1)},cB=({value:e,onChange:t})=>(0,m.jsx)("select",{value:e,onChange:t,children:c$.map(e=>(0,m.jsxs)("option",{value:e.code,children:[e.code," +",e.callCode]},e.code))}),cq=(0,o.forwardRef)((e,t)=>{let{app:r}=ny(),[n,i]=(0,o.useState)(!1),{accountType:a}=aW(),[s,l]=(0,o.useState)(""),[c,d]=(0,o.useState)(r?.intl.defaultCountry??"US"),h=cU(s,c),u=cz(c),p=cH(c),g=(0,ef.G)(c),f=!h,[y,w]=(0,o.useState)(!1),x=g.length,v=t=>{try{let r=t.replace(/\D/g,""),n=s.replace(/\D/g,""),i=r===n?t:u.input(t);l(i),e.onChange&&e.onChange({rawPhoneNumber:i,qualifiedPhoneNumber:cD(t,c),countryCode:c,isValid:cU(t,c)})}catch(e){console.error("Error processing phone number:",e)}},C=()=>{w(!0);let t=cD(s,c);e.onSubmit({rawPhoneNumber:s,qualifiedPhoneNumber:t,countryCode:c,isValid:cU(s,c)}).finally(()=>w(!1))};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(cV,{children:(0,m.jsxs)(cG,{callingCodeLength:x,stacked:e.stacked,children:[(0,m.jsx)(cB,{value:c,onChange:t=>{let r=t.target.value;d(r),l(""),e.onChange&&e.onChange({rawPhoneNumber:s,qualifiedPhoneNumber:cD(s,r),countryCode:r,isValid:cU(s,c)})}}),(0,m.jsx)("input",{ref:t,id:"phone-number-input",type:"tel",placeholder:p,onFocus:()=>i(!0),onChange:e=>{v(e.target.value)},onKeyUp:e=>{"Enter"===e.key&&C()},value:s,autoComplete:"tel"}),"phone"!==a||n||e.hideRecent?e.stacked||e.noIncludeSubmitButton?(0,m.jsx)("span",{}):(0,m.jsx)(it,{isSubmitting:y,onClick:C,disabled:f,children:"Submit"}):(0,m.jsx)(aj,{color:"gray",children:"Recent"})]})}),e.stacked&&!e.noIncludeSubmitButton?(0,m.jsx)(n3,{loading:y,loadingText:null,onClick:C,disabled:f,children:"Submit"}):null]})}),cV=A.ZP.div` width: 100%; `,cG=A.ZP.label` --country-code-dropdown-width: calc(54px + calc(12 * ${e=>e.callingCodeLength}px)); --phone-input-extra-padding-left: calc(12px + calc(3 * ${e=>e.callingCodeLength}px)); display: block; position: relative; width: 100%; /* Tablet and Up */ @media (min-width: 441px) { --country-code-dropdown-width: calc(52px + calc(10 * ${e=>e.callingCodeLength}px)); } && > select { font-size: 16px; height: 24px; position: absolute; margin: 13px calc(var(--country-code-dropdown-width) / 4); line-height: 24px; width: var(--country-code-dropdown-width); background-color: var(--privy-color-background); background-size: auto; background-position-x: right; cursor: pointer; /* Tablet and Up */ @media (min-width: 441px) { font-size: 14px; width: var(--country-code-dropdown-width); } :focus { outline: none; box-shadow: none; } } && > input { font-size: 16px; line-height: 24px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; width: calc(100% - var(--country-code-dropdown-width)); padding: 12px 88px 12px calc(var(--country-code-dropdown-width) + var(--phone-input-extra-padding-left)); padding-right: ${e=>e.stacked?"16px":"88px"}; flex-grow: 1; background: var(--privy-color-background); border: 1px solid var(--privy-color-foreground-4); border-radius: var(--privy-border-radius-mdlg); width: 100%; :focus { outline: none; border-color: var(--privy-color-accent); } :autofill, :-webkit-autofill { background: var(--privy-color-background); } /* Tablet and Up */ @media (min-width: 441px) { font-size: 14px; padding-right: 78px; } } && > :last-child { right: 16px; position: absolute; top: 50%; transform: translate(0, -50%); } && > button:last-child { right: 0px; line-height: 24px; padding: 13px 17px; :focus { outline: none; border-color: var(--privy-color-accent); } } && > input::placeholder { color: var(--privy-color-foreground-3); } `,cK=({isEditable:e,setIsEditable:t})=>{let r=(0,o.useRef)(null),{authenticated:n}=n$(),{navigate:i,setModalData:a,currentScreen:s}=ny(),{initLoginWithSms:l}=nZ(),{enabled:c,token:d}=nF();async function h({qualifiedPhoneNumber:e}){if(!c||d||n)try{await l(e,d),i("AWAITING_PASSWORDLESS_CODE")}catch(e){a({errorModalData:{error:e,previousScreen:s||"LANDING"}}),i("ERROR_SCREEN")}else a({captchaModalData:{callback:t=>l(e,t),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),i("CAPTCHA_SCREEN")}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ik,{if:!e,children:(0,m.jsx)(cq,{ref:r,onSubmit:h})}),(0,m.jsx)(ik,{if:e,children:(0,m.jsxs)(i_,{onClick:()=>{t(),setTimeout(()=>{r.current?.focus()},0)},children:[(0,m.jsx)(I.Z,{})," Continue with SMS"]})})]})},cY={apple:{logo:(0,m.jsx)(t8,{}),displayName:"Apple"},discord:{logo:(0,m.jsx)(t9,{}),displayName:"Discord"},github:{logo:(0,m.jsx)(re,{}),displayName:"GitHub"},google:{logo:(0,m.jsx)(rr,{}),displayName:"Google"},linkedin:{logo:(0,m.jsx)(ri,{}),displayName:"LinkedIn"},spotify:{logo:(0,m.jsx)(ra,{}),displayName:"Spotify"},instagram:{logo:(0,m.jsx)(rn,{}),displayName:"Instagram"},twitter:{logo:(0,m.jsx)(rs,{}),displayName:"Twitter"},tiktok:{logo:(0,m.jsx)(ro,{}),displayName:"TikTok"}},cQ=({provider:e})=>{let{enabled:t,token:r}=nF(),{navigate:n,setModalData:i}=ny(),[a,s]=(0,o.useState)(!1),{initLoginWithOAuth:l}=nZ(),{accountType:c}=aW(),d=c?cT(c):null,{displayName:h,logo:u}=cY[e];return(0,m.jsxs)(i_,{onClick:()=>{s(!0),t&&!r?(i({captchaModalData:{callback:t=>l(e,t),userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),n("CAPTCHA_SCREEN")):l(e)},disabled:a,children:[u," ",h,d?.loginMethod===e&&(0,m.jsx)(cX,{color:"gray",children:"Recent"})]})},cX=(0,A.ZP)(aj)` margin-left: auto; `;function cJ(e){return(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",viewBox:"0 0 240 240",...e,children:[(0,m.jsx)("defs",{children:(0,m.jsxs)("linearGradient",{x1:"120",y1:"240",x2:"120",gradientUnits:"userSpaceOnUse",id:"telegram-linear-gradient",children:[(0,m.jsx)("stop",{offset:"0",stopColor:"#1d93d2"}),(0,m.jsx)("stop",{offset:"1",stopColor:"#38b0e3"})]})}),(0,m.jsx)("title",{children:"Telegram_logo"}),(0,m.jsx)("circle",{cx:"120",cy:"120",r:"120",fill:"url(#telegram-linear-gradient)"}),(0,m.jsx)("path",{d:"M81.229,128.772l14.237,39.406s1.78,3.687,3.686,3.687,30.255-29.492,30.255-29.492l31.525-60.89L81.737,118.6Z",fill:"#c8daea"}),(0,m.jsx)("path",{d:"M100.106,138.878l-2.733,29.046s-1.144,8.9,7.754,0,17.415-15.763,17.415-15.763",fill:"#a9c6d8"}),(0,m.jsx)("path",{d:"M81.486,130.178,52.2,120.636s-3.5-1.42-2.373-4.64c.232-.664.7-1.229,2.1-2.2,6.489-4.523,120.106-45.36,120.106-45.36s3.208-1.081,5.1-.362a2.766,2.766,0,0,1,1.885,2.055,9.357,9.357,0,0,1,.254,2.585c-.009.752-.1,1.449-.169,2.542-.692,11.165-21.4,94.493-21.4,94.493s-1.239,4.876-5.678,5.043A8.13,8.13,0,0,1,146.1,172.5c-8.711-7.493-38.819-27.727-45.472-32.177a1.27,1.27,0,0,1-.546-.9c-.093-.469.417-1.05.417-1.05s52.426-46.6,53.821-51.492c.108-.379-.3-.566-.848-.4-3.482,1.281-63.844,39.4-70.506,43.607A3.21,3.21,0,0,1,81.486,130.178Z",fill:"#fff"})]})}var c0=()=>{let{enabled:e,token:t}=nF(),{navigate:r,setModalData:n}=ny(),[i,a]=(0,o.useState)(!1),{initLoginWithTelegram:s}=nZ(),{accountType:l}=aW();async function c(e){try{await s(e),r("TELEGRAM_AUTH_SCREEN")}catch(e){console.error(e),a(!1)}}async function d(){if(a(!0),e&&!t){n({captchaModalData:{callback:c,userIntentRequired:!0,onSuccessNavigateTo:null,onErrorNavigateTo:"ERROR_SCREEN"}}),r("CAPTCHA_SCREEN");return}await c()}return(0,m.jsxs)(i_,{onClick:d,disabled:i,children:[(0,m.jsx)(cJ,{}),"Telegram","telegram"===l&&(0,m.jsx)(c1,{color:"gray",children:"Recent"})]})},c1=(0,A.ZP)(aj)` margin-left: auto; `,c2=({onClick:e,text:t,icon:r})=>(0,m.jsxs)(i_,{onClick:e,children:[r,(0,m.jsx)(iy,{children:t}),(0,m.jsx)(ep.Z,{})]}),c3=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=nZ(),{app:n,onUserCloseViaDialogOrKeybindRef:i}=ny(),{appearance:{palette:{colorScheme:a}}}=nh(),{accountType:l,walletClientType:c}=aW(),d=l?cT(l):null,h=n.loginMethodsAndOrder?.primary??[],u=n.loginMethodsAndOrder?.overflow??[],p=[...h,...u],g=n.loginMethods.passkey,f=[];c&&p.includes(c)?f.push(c):l&&p.includes(d?.loginMethod)&&f.push(d?.loginMethod);let[y,w]=(0,o.useState)("default"),[x,v]=(0,o.useState)("phone"===l?"sms":"email");(0,o.useEffect)(()=>{"phone"===l&&v("sms");let e=p.indexOf("sms"),t=p.indexOf("email");e>-1&&e{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{w("default")},150)};i.current=C;let b=t=>"email"===t?(0,m.jsx)(cW,{isEditable:"email"===x,setIsEditable:()=>{v("email")}},t):"sms"===t?(0,m.jsx)(cK,{isEditable:"sms"===x,setIsEditable:()=>{v("sms")}},t):"apple"===t?(0,m.jsx)(cQ,{provider:"apple"},t):"discord"===t?(0,m.jsx)(cQ,{provider:"discord"},t):"farcaster"===t?(0,m.jsx)(cL,{},t):"github"===t?(0,m.jsx)(cQ,{provider:"github"},t):"google"===t?(0,m.jsx)(cQ,{provider:"google"},t):"linkedin"===t?(0,m.jsx)(cQ,{provider:"linkedin"},t):"tiktok"===t?(0,m.jsx)(cQ,{provider:"tiktok"},t):"twitter"===t&&(!s.tq||n?.loginConfig.twitterOAuthOnMobileEnabled)?(0,m.jsx)(cQ,{provider:"twitter"},t):"telegram"===t?(0,m.jsx)(c0,{},t):aB([t],r,e,p,n.externalWallets.walletConnect.enabled),_=f.flatMap(b),j=h.filter(e=>e!==c&&e!==d?.loginMethod).flatMap(b),k=u.filter(e=>e!==c&&e!==d?.loginMethod).flatMap(b),[E,A]=th([..._,...j,...k],c4({primary:j.length+_.length,overflow:k.length}));return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{title:n.appearance.landingHeader,onClose:C,backFn:"default"===y?void 0:()=>{w("default")}}),"default"===y&&(0,m.jsx)(c5,{}),"default"===y&&("string"==typeof n.appearance.loginMessage?(0,m.jsx)(ib,{children:n.appearance.loginMessage}):n.appearance.loginMessage),(0,m.jsx)(iw,{style:{overflow:"hidden"},children:(0,m.jsxs)(iv,{colorScheme:a,style:{maxHeight:400,overflowY:"scroll",padding:2},children:["default"===y&&(0,m.jsxs)(m.Fragment,{children:[...E,A.length>0&&(0,m.jsx)(c2,{text:"More options",icon:(0,m.jsx)(X.Z,{}),onClick:()=>w("overflow")})]}),"overflow"===y&&(0,m.jsxs)(m.Fragment,{children:[...A]}),g&&"default"===y&&(0,m.jsx)(cf,{})]})}),n&&(0,m.jsx)(iT,{app:n}),(0,m.jsx)(iP,{})]})},c4=({primary:e,overflow:t})=>e<5?e:5===e&&0===t?5:4,c5=(0,A.ZP)(cN)` margin-bottom: 16px; `,c6=({...e})=>(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"25",height:"25",viewBox:"0 0 25 25",fill:"none",...e,children:[(0,m.jsxs)("g",{clipPath:"url(#clip0_2856_1743)",children:[(0,m.jsx)("path",{d:"M22.1673 8.24075V16.3642C22.1673 17.3256 21.3421 18.105 20.3241 18.105H17.0028M22.1673 8.24075C22.1673 7.27936 21.3421 6.5 20.3241 6.5H11.5302M22.1673 8.24075V8.42852C22.1673 9.03302 21.8352 9.59423 21.2901 9.91105L15.1463 13.4818C14.5539 13.8261 13.8067 13.8261 13.2143 13.4818L10.1621 11.5401",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"}),(0,m.jsx)("path",{d:"M3.12913 6.64816C0.508085 12.9507 3.49251 20.1847 9.79504 22.8057L11.5068 23.5176C12.4522 23.9108 13.7783 23.2222 14.1714 22.2768L14.6054 21.2333C14.7687 20.8406 14.6438 20.3871 14.3024 20.1334L11.2872 17.8927C10.9878 17.6702 10.5843 17.6488 10.2632 17.8384L9.11575 18.5156C8.78274 18.7121 8.3597 18.6844 8.07552 18.4221C5.94293 16.4542 4.77629 13.6264 4.90096 10.7273C4.91757 10.3409 5.19796 10.023 5.57269 9.92753L6.86381 9.59869C7.22522 9.50664 7.49627 9.20696 7.55169 8.83815L8.10986 5.12321C8.17306 4.70259 7.94188 4.29293 7.54915 4.1296L6.50564 3.69564C5.56026 3.30248 4.23416 3.99103 3.84101 4.9364L3.12913 6.64816Z",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),(0,m.jsx)("defs",{children:(0,m.jsx)("clipPath",{id:"clip0_2856_1743",children:(0,m.jsx)("rect",{x:"0.5",y:"0.5",width:"24",height:"24",rx:"6",fill:"white"})})})]}),c7=({connectOnly:e})=>{let{closePrivyModal:t,connectors:r}=nZ(),{data:n,onUserCloseViaDialogOrKeybindRef:i}=ny(),a=nh(),{accountType:l,walletClientType:c}=aW(),d=l?cT(l):null,h=n?.login,{email:u,sms:p,google:g,twitter:f,discord:y,github:w,spotify:x,instagram:v,tiktok:C,linkedin:b,apple:_,wallet:j,farcaster:k,telegram:E}=(0,o.useMemo)(()=>h?.loginMethods?(0,ev.W)(h.loginMethods,!0):null,[h])??a.loginMethods,{passkey:A}=a.loginMethods,S=[u&&"email",p&&"sms",g&&"google",f&&"twitter",y&&"discord",w&&"github",x&&"spotify",v&&"instagram",C&&"tiktok",b&&"linkedin",_&&"apple",k&&"farcaster",E&&"telegram"].filter(e=>!!e),T=S.length>0,P=(0,o.useMemo)(()=>j&&!T?"web3-first":j&&a?.appearance.loginGroupPriority||"web2-first",[j,T,a?.appearance.loginGroupPriority]),N=a?.appearance.hideDirectWeb2Inputs,[R,M]=(0,o.useState)("default"),[O,I]=(0,o.useState)(dr({accountType:l,sms:p,email:u}));(0,o.useEffect)(()=>{I(dr({accountType:l,sms:p,email:u}))},[u,p,l]);let W=()=>{t({shouldCallAuthOnSuccess:!0}),setTimeout(()=>{M("default")},150)};i.current=W;let L=[];c&&j?L.push(c):d?.loginMethod&&S.includes(d.loginMethod)&&L.push(d.loginMethod);let F=t=>"email"===t?(0,m.jsx)(cW,{isEditable:"email"===O,setIsEditable:()=>{I("email")}},t):"sms"===t?(0,m.jsx)(cK,{isEditable:"sms"===O,setIsEditable:()=>{I("sms")}},t):"apple"===t?(0,m.jsx)(cQ,{provider:"apple"},t):"discord"===t?(0,m.jsx)(cQ,{provider:"discord"},t):"farcaster"===t?(0,m.jsx)(cL,{},t):"github"===t?(0,m.jsx)(cQ,{provider:"github"},t):"google"===t?(0,m.jsx)(cQ,{provider:"google"},t):"linkedin"===t?(0,m.jsx)(cQ,{provider:"linkedin"},t):"tiktok"===t?(0,m.jsx)(cQ,{provider:"tiktok"},t):"twitter"===t&&(!s.tq||a?.loginConfig.twitterOAuthOnMobileEnabled)?(0,m.jsx)(cQ,{provider:"twitter"},t):"telegram"===t?(0,m.jsx)(c0,{},t):aB([t],r,e,[],a.externalWallets.walletConnect.enabled),U=aB(a.appearance.walletList.filter(e=>e!==c),r,e,[...a.appearance.walletList,c],a.externalWallets.walletConnect.enabled),D=S.filter(e=>e!==d?.loginMethod).flatMap(F),Z=L.flatMap(F);"web3-first"===P&&"default"===R?U.unshift(...Z):"web2-first"===P&&D.unshift(...Z);let z=S.filter(e=>"email"!==e&&"sms"!==e),$=c9({priority:P,email:u,sms:p,social:z}),H=de({priority:P,email:u,sms:p,social:z}),B=dt({priority:P}),q=(0,m.jsx)(cx,{text:B,onClick:()=>M("web3-overflow")}),V=(0,m.jsx)(c2,{text:$,icon:H,onClick:()=>M("web2-overflow")}),G=N?0:1;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{title:a.appearance.landingHeader,onClose:W,backFn:"default"===R?void 0:()=>{M("default")}}),"default"===R&&(0,m.jsx)(c8,{}),"default"===R&&("string"==typeof a.appearance.loginMessage?(0,m.jsx)(ib,{children:a.appearance.loginMessage}):a.appearance.loginMessage),(0,m.jsx)(iw,{style:{overflow:"hidden",padding:2},children:(0,m.jsxs)(ix,{children:["default"===R&&"web2-first"===P&&(0,m.jsxs)(m.Fragment,{children:[...D.length>4?D.slice(0,3):D,D.length>4&&V,j&&q]}),"default"===R&&"web3-first"===P&&(0,m.jsxs)(m.Fragment,{children:[j&&(0,m.jsxs)(m.Fragment,{children:[...U.length>4?U.slice(0,3):U,U.length>4&&q]}),D.length>G&&V,D.length===G&&D[0]]}),"web2-overflow"===R&&(0,m.jsxs)(m.Fragment,{children:[..."web3-first"===P?D:D.slice(3)]}),..."web3-overflow"===R?U:[],A&&"default"===R&&(0,m.jsx)(cf,{})]})}),a&&(0,m.jsx)(iT,{app:a}),(0,m.jsx)(iP,{})]})},c8=(0,A.ZP)(cN)` margin-bottom: 16px; `,c9=({priority:e,email:t,sms:r,social:n})=>"web2-first"===e?"Other socials":t&&r&&n.length>0||t&&n.length>0?"Log in with email or socials":r&&n.length>0?"Log in with sms or socials":t&&r?"Continue with email or sms":t?"Continue with email":r?"Continue with sms":"Log in with a social account",de=({priority:e,email:t,sms:r,social:n})=>"web2-first"===e||n.length>0?(0,m.jsx)(X.Z,{}):t&&r?(0,m.jsx)(c6,{}):t?(0,m.jsx)(O.Z,{}):r?(0,m.jsx)(I.Z,{}):null,dt=({priority:e})=>"web2-first"===e?"Continue with a wallet":"Other wallets",dr=({accountType:e,sms:t,email:r})=>"email"===e&&r?"email":"phone"===e&&t||t&&!r?"sms":"email",dn=({style:e,...t})=>(0,m.jsxs)("svg",{width:"164",height:"164",viewBox:"0 0 164 164",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"26px",width:"26px",...e},...t,children:[(0,m.jsx)("circle",{cx:"82",cy:"82",r:"80",stroke:"#EC6351","stroke-width":"4","stroke-linecap":"round"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M81.9999 100.788C93.3288 100.788 102.513 91.6043 102.513 80.2754C102.513 68.9465 93.3288 59.7626 81.9999 59.7626C70.671 59.7626 61.4871 68.9465 61.4871 80.2754C61.4871 91.6043 70.671 100.788 81.9999 100.788ZM88.3236 71.8304C88.9093 71.2446 89.8591 71.2446 90.4449 71.8304C91.0307 72.4161 91.0307 73.3659 90.4449 73.9517L84.121 80.2756L90.445 86.5996C91.0308 87.1854 91.0308 88.1351 90.445 88.7209C89.8592 89.3067 88.9095 89.3067 88.3237 88.7209L81.9997 82.3969L75.6756 88.7209C75.0899 89.3067 74.1401 89.3067 73.5543 88.7209C72.9685 88.1351 72.9685 87.1854 73.5543 86.5996L79.8783 80.2756L73.5544 73.9517C72.9686 73.3659 72.9686 72.4161 73.5544 71.8304C74.1402 71.2446 75.09 71.2446 75.6758 71.8304L81.9997 78.1543L88.3236 71.8304Z",fill:"#EC6351"})]});function di(){let{promptMfa:e,init:t,submit:r,cancel:n,mfaMethods:i}=(0,o.useContext)(nz);return{promptMfa:e,init:t,submit:r,cancel:n,mfaMethods:i}}function da(){let{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:a,unenroll:s,enrollInMfa:l}=(0,o.useContext)(nz);return{initEnrollmentWithSms:e,initEnrollmentWithTotp:t,initEnrollmentWithPasskey:r,submitEnrollmentWithSms:n,submitEnrollmentWithTotp:i,submitEnrollmentWithPasskey:a,unenrollWithSms:()=>s("sms"),unenrollWithTotp:()=>s("totp"),unenrollWithPasskey:()=>s("passkey"),showMfaEnrollmentModal:()=>l(!0),closeMfaEnrollmentModal:()=>l(!1)}}var ds=e=>(0,m.jsxs)(dl,{xmlns:"http://www.w3.org/2000/svg",fill:"none",width:"88",height:"89",viewBox:"0 0 88 89",...e,children:[(0,m.jsx)("rect",{y:"0.666016",width:"88",height:"88",rx:"44"}),(0,m.jsx)("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M45.2463 20.9106C44.5473 20.2486 43.4527 20.2486 42.7537 20.9106C37.8798 25.5263 31.3034 28.3546 24.0625 28.3546C23.9473 28.3546 23.8323 28.3539 23.7174 28.3525C22.9263 28.3427 22.2202 28.8471 21.9731 29.5987C20.9761 32.6311 20.4375 35.8693 20.4375 39.2297C20.4375 53.5896 30.259 65.651 43.5482 69.0714C43.8446 69.1477 44.1554 69.1477 44.4518 69.0714C57.741 65.651 67.5625 53.5896 67.5625 39.2297C67.5625 35.8693 67.0239 32.6311 66.0269 29.5987C65.7798 28.8471 65.0737 28.3427 64.2826 28.3525C64.1677 28.3539 64.0527 28.3546 63.9375 28.3546C56.6966 28.3546 50.1202 25.5263 45.2463 20.9106ZM52.7249 40.2829C53.3067 39.4683 53.1181 38.3363 52.3035 37.7545C51.4889 37.1726 50.3569 37.3613 49.7751 38.1759L41.9562 49.1223L38.0316 45.1977C37.3238 44.4899 36.1762 44.4899 35.4684 45.1977C34.7605 45.9056 34.7605 47.0532 35.4684 47.761L40.9059 53.1985C41.2826 53.5752 41.806 53.7671 42.337 53.7232C42.868 53.6792 43.3527 53.4039 43.6624 52.9704L52.7249 40.2829Z"})]}),dl=A.ZP.svg` height: 90px; width: 90px; > rect { ${e=>"success"===e.color?"fill: var(--privy-color-success);":"fill: var(--privy-color-accent);"} } > path { fill: white; } `,dc=({showIntro:e,userMfaMethods:t,appMfaMethods:r,userHasAuthSms:n,isTotpLoading:i,isPasskeyLoading:a,error:o,onClose:s,onBackToIntro:l,handleSelectMethod:c,setRemovingMfaMethod:d})=>{let h=t.reduce((e,t)=>({...e,[t]:!0}),{}),u=r.reduce((e,t)=>({...e,[t]:!0}),{});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:e?l:void 0,onClose:s},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(ek.Z,{})})}),(0,m.jsx)(iM,{children:"Choose a verification method"}),t.length>0?(0,m.jsx)(iO,{children:"To add or delete verification methods, verification is required."}):(0,m.jsx)(iO,{children:"How would you like to verify your identity? You can change this later."}),o&&(0,m.jsx)(iK,{style:{marginTop:"1.25rem"},children:o.message}),(0,m.jsxs)(iD,{children:[(u.totp||h.totp)&&(0,m.jsxs)(iZ,{children:[(0,m.jsx)(i_,{style:{justifyContent:"center"},disabled:h.totp||i,onClick:()=>c("totp"),children:i?(0,m.jsx)(nX,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,m.jsxs)(iB,{children:[(0,m.jsxs)(i$,{children:[(0,m.jsx)(eE.Z,{}),"Authenticator App"]}),h.totp?(0,m.jsxs)(iH,{children:[(0,m.jsx)(M.Z,{}),"Added"]}):(0,m.jsx)(iH,{children:"Recommended"})]})}),h.totp&&(0,m.jsx)(iz,{onClick:()=>d("totp"),children:(0,m.jsx)(el.Z,{})})]},"totp"),(u.sms||h.sms)&&(0,m.jsxs)(iZ,{children:[(0,m.jsx)(i_,{disabled:h.sms||n,onClick:()=>c("sms"),children:(0,m.jsxs)(iB,{children:[(0,m.jsxs)(i$,{children:[(0,m.jsx)(I.Z,{}),"SMS"]}),h.sms&&(0,m.jsxs)(iH,{children:[(0,m.jsx)(M.Z,{}),"Added"]}),n&&(0,m.jsx)(iH,{children:"Disabled"})]})}),h.sms&&(0,m.jsx)(iz,{onClick:()=>d("sms"),children:(0,m.jsx)(el.Z,{})})]},"sms"),(u.passkey||h.passkey)&&(0,m.jsxs)(iZ,{children:[(0,m.jsx)(i_,{style:{justifyContent:"center"},onClick:()=>c("passkey"),disabled:h.passkey||a,children:a?(0,m.jsx)(nX,{style:{height:24,width:24,borderWidth:2},color:"var(--privy-color-foreground-3)"}):(0,m.jsxs)(iB,{children:[(0,m.jsxs)(i$,{children:[(0,m.jsx)(eA.Z,{}),"Passkey"]}),h.passkey?(0,m.jsxs)(iH,{children:[(0,m.jsx)(M.Z,{}),"Added"]}):(0,m.jsx)(iH,{isAccent:!0,children:(0,m.jsx)(ep.Z,{})})]})}),h.passkey&&(0,m.jsx)(iz,{onClick:()=>d("passkey"),children:(0,m.jsx)(el.Z,{})})]},"passkey")]}),(0,m.jsx)(iN,{})]})},dd=({onComplete:e,onClose:t,onReset:r})=>{let{user:n}=n$(),{data:i}=ny(),{initLinkWithPasskey:a,linkWithPasskey:s}=nZ(),{initEnrollmentWithPasskey:l,submitEnrollmentWithPasskey:c}=da(),[d,h]=(0,o.useState)(!1),[u,p]=(0,o.useState)(!1),[g,f]=(0,o.useState)(!1),[y,w]=(0,o.useState)(null),x=(0,o.useMemo)(()=>n?.linkedAccounts.filter(e=>"passkey"===e.type)??[],[n]),v=()=>{i?.mfaEnrollmentFlow?.onSuccess(),e()},C=async e=>{h(!0);try{await l(),await c({credentialIds:e}),f(!0)}catch(e){w(e)}finally{h(!1)}},b=async()=>{p(!0),w(null);try{await a();let e=(await s())?.linkedAccounts.filter(e=>"passkey"===e.type).map(e=>e.credentialId)??[];await C(e)}catch(e){w(e)}finally{p(!1)}};return 0===x.length||u?(0,m.jsx)(dh,{onReset:r,onClose:t,onClick:b,isCreating:u}):g?(0,m.jsx)(dp,{onClick:v,onClose:v}):y?(0,m.jsx)(si,{error:y,backFn:()=>w(null),onClick:()=>w(null)}):(0,m.jsx)(du,{passkeys:x,isSubmitting:d,isCreating:u,onReset:r,onClose:t,onSubmitEnrollment:()=>C(x.map(e=>e.credentialId)),onAddPasskey:b})},dh=({onReset:e,onClose:t,onClick:r,isCreating:n})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:e,onClose:t},"header"),(0,m.jsx)(iR,{children:(0,m.jsxs)(lg,{children:[(0,m.jsx)(lh,{}),(0,m.jsx)(lu,{})]})}),(0,m.jsx)(iM,{children:"Set up passkey verification"}),(0,m.jsxs)(iW,{children:[(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(eT.Z,{})}),"Verify with Touch ID, Face ID, PIN, or hardware key"]}),(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(es.Z,{})}),"Takes seconds to set up and use"]}),(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(eS.Z,{})}),"Use your passkey to verify transactions and login to your account"]})]}),(0,m.jsx)(n3,{style:{marginTop:"2.25rem"},onClick:r,loading:n,children:"Add a new passkey"}),(0,m.jsx)(iN,{})]}),du=({onReset:e,onClose:t,onAddPasskey:r,onSubmitEnrollment:n,passkeys:i,isSubmitting:a,isCreating:s})=>{let[l,c]=(0,o.useState)(!1),d=l?i.length:i.length>3?2:3;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:l?()=>c(!1):e,onClose:t},"header"),!l&&(0,m.jsx)(iR,{children:(0,m.jsxs)(lg,{children:[(0,m.jsx)(lh,{}),(0,m.jsx)(lu,{})]})}),(0,m.jsx)(iM,{children:"Enable your passkeys for verification"}),(0,m.jsxs)(iW,{children:[i.slice(0,d).map(e=>(0,m.jsxs)(dm,{children:[(0,m.jsx)(dg,{children:dy(e)}),(0,m.jsxs)(df,{children:["Last used: ",e.latestVerifiedAt?.toLocaleString()]})]},e.credentialId)),!l&&i.length>3&&(0,m.jsx)(dw,{onClick:()=>c(!0),children:"View All"})]}),(0,m.jsx)(n3,{style:{marginTop:"1.5rem"},onClick:n,loading:a,children:"Enable passkeys"}),i.length<5&&(0,m.jsx)(dw,{style:{marginTop:"0.5rem"},onClick:r,disabled:s,children:s?(0,m.jsx)(nX,{style:{height:"1rem",width:"1rem",borderWidth:2}}):"Add new passkey"}),(0,m.jsx)(iN,{})]})},dp=({onClick:e,onClose:t})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:t},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{status:"success",children:(0,m.jsx)(W.Z,{})})}),(0,m.jsx)(iM,{children:"Passkey verification added"}),(0,m.jsx)(iO,{children:"From now on, you'll use the passkey whenever you use your Privy wallet."}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{onClick:e,children:"Done"})}),(0,m.jsx)(iN,{})]}),dm=A.ZP.div` && { padding: 0.75rem 1rem; text-align: left; border-radius: 0.5rem; border: 1px solid var(--privy-color-foreground-4); width: 100%; } `,dg=A.ZP.div` font-size: 0.875rem; line-height: 1.375rem; font-weight: 500; color: var(--privy-color-foreground-1); `,df=A.ZP.div` font-size: 0.75rem; font-weight: 400; line-height: 1.125rem; color: var(--privy-color-foreground-2); `,dy=e=>e.authenticatorName?e.createdWithBrowser?`${e.authenticatorName} on ${e.createdWithBrowser}`:e.authenticatorName:e.createdWithBrowser?e.createdWithOs?`${e.createdWithBrowser} on ${e.createdWithOs}`:`${e.createdWithBrowser}`:"Unknown device",dw=A.ZP.button` && { width: 100%; font-size: 0.875rem; line-height: 1rem; /* Tablet and Up */ @media (min-width: 440px) { font-size: 14px; } display: flex; gap: 12px; justify-content: center; padding: 0.75rem 1rem; background-color: var(--privy-color-background); transition: background-color 200ms ease; color: var(--privy-color-accent); :focus { outline: none; box-shadow: none; } } `,dx=Array(6).fill("");function dv(e){return/^[0-9]{1}$/.test(e)}function dC(e){return 6===e.length&&e.every(dv)}var db=({onChange:e,disabled:t,errorReasonOverride:r,success:n})=>{let[i,a]=(0,o.useState)(dx),[l,c]=(0,o.useState)(null),[d,h]=(0,o.useState)(null),u=async t=>{t.preventDefault();let r=t.currentTarget.value.replace(/\s+/g,"");if(""===r)return;let n=i.reduce((e,t)=>e+Number(dv(t)),0),o=r.split(""),s=!o.every(dv),l=o.length+n>6;if(s){c("Passcode can only be numbers"),h(1);return}if(l){c("Passcode must be exactly 6 numbers"),h(1);return}c(null),h(null);let d=Number(t.currentTarget.name?.charAt(4)),u=[...r||[""]].slice(0,6-d),p=[...i.slice(0,d),...u,...i.slice(d+u.length)];a(p);let m=Math.min(Math.max(d+u.length,0),5);if(document.querySelector(`input[name=pin-${m}]`)?.focus(),dC(p))try{await e(p.join("")),document.querySelector(`input[name=pin-${m}]`)?.blur()}catch(e){h(1),c(e.message)}else try{await e(null)}catch(e){h(1),c(e.message)}},p=t=>{1===d&&(c(null),h(null));let r=[...i.slice(0,t),"",...i.slice(t+1)];a(r),t>0&&document.querySelector(`input[name=pin-${t-1}]`)?.focus(),dC(r)?e(r.join("")):e(null)},g=n?"success":r||l?"fail":"";return(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(d_,{children:[(0,m.jsx)("div",{children:i.map((e,r)=>(0,m.jsx)("input",{name:`pin-${r}`,type:"text",value:i[r],onChange:u,onKeyUp:e=>{"Backspace"===e.key&&p(r)},inputMode:"numeric",autoFocus:0===r,pattern:"[0-9]",className:g,autoComplete:s.tq?"one-time-code":"off",disabled:t},r))}),(0,m.jsx)("div",{children:(0,m.jsx)(dj,{fail:!!r||!!l,children:r||l})})]})})},d_=A.ZP.div` display: flex; flex-direction: column; width: 100%; gap: 8px; @media (max-width: 440px) { margin-top: 8px; margin-bottom: 8px; } > div:nth-child(1) { display: flex; justify-content: center; gap: 0.5rem; width: 100%; border-radius: var(--privy-border-radius-md); > input { border: 1px solid var(--privy-color-foreground-4); background: var(--privy-color-background); border-radius: var(--privy-border-radius-md); padding: 8px 10px; height: 58px; width: 46px; text-align: center; font-size: 18px; } > input:disabled { /* Use light-theme-bg-2 instead of disabled-bg for consistency with the callout bubble */ background: var(--privy-color-background-2); } > input:focus { border: 1px solid var(--privy-color-accent); } > input:invalid { border: 1px solid var(--privy-color-error); } > input.success { border: 1px solid var(--privy-color-success); } > input.fail { border: 1px solid var(--privy-color-error); animation: shake 180ms; animation-iteration-count: 2; } } @keyframes shake { 0% { transform: translate(1px, 0px); } 33% { transform: translate(-1px, 0px); } 67% { transform: translate(-1px, 0px); } 100% { transform: translate(1px, 0px); } } `,dj=A.ZP.div` line-height: 20px; font-size: 13px; display: flex; justify-content: flex-start; width: 100%; color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"}; `,dk=({onComplete:e,onReset:t,onClose:r})=>{let[n,i]=(0,o.useState)(""),[a,s]=(0,o.useState)(!1),[l,c]=(0,o.useState)(null),[d,h]=(0,o.useState)("enroll"),{initEnrollmentWithSms:u,submitEnrollmentWithSms:p}=da(),{app:g,data:f}=ny();function y(){f?.mfaEnrollmentFlow?.onSuccess(),e()}async function w({qualifiedPhoneNumber:e}){try{await u({phoneNumber:e}),i(e),h("verify")}catch(e){c(e)}}async function x(e){try{if(!e)return;await p({phoneNumber:n,mfaCode:e}),s(!0)}catch(e){throw ot(e)?Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):oe(e)?Error("The code you entered is not valid"):a9(e)?Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):or(e)?Error("Verification canceled"):Error("Unknown error")}}return l?(0,m.jsx)(si,{error:l,backFn:()=>c(null),onClick:()=>c(null)}):"enroll"===d?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:t,onClose:r},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(e_.Z,{})})}),(0,m.jsx)(iM,{children:"Set up SMS verification"}),(0,m.jsx)(iO,{children:"We'll text a verification code to this mobile device whenever you use your Privy wallet."}),(0,m.jsxs)(iI,{children:[(0,m.jsx)(cq,{onSubmit:w,hideRecent:!0}),(0,m.jsxs)(iq,{children:["By providing your mobile number, you agree to receive text messages from ",g?.name,". Some carrier charges may apply"]})]}),(0,m.jsx)(iN,{})]}):a?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:y},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{status:"success",children:(0,m.jsx)(W.Z,{})})}),(0,m.jsx)(iM,{children:"SMS verification added"}),(0,m.jsx)(iO,{children:"From now on, you'll enter the verification code sent to your mobile device whenever you use your Privy wallet."}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{onClick:y,children:"Done"})}),(0,m.jsx)(iN,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:function(){"verify"===d?h("enroll"):t()},onClose:r},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(e_.Z,{})})}),(0,m.jsx)(iM,{children:"Enter enrollment code"}),(0,m.jsxs)(iI,{children:[(0,m.jsx)(db,{onChange:x}),(0,m.jsxs)(iO,{children:["To continue, enter the 6-digit code sent to ",(0,m.jsx)("strong",{children:cZ(n)})]})]}),(0,m.jsx)(iN,{})]})},dE=({size:e,authUrl:t})=>(0,m.jsx)(sb,{url:t,squareLogoElement:ek.Z,size:e,fgColor:"#1F1F1F"}),dA=({onComplete:e,onClose:t,onReset:r,totpInfo:n})=>{let[i,a]=(0,o.useState)("enroll"),[s,l]=(0,o.useState)(!1),{submitEnrollmentWithTotp:c}=da(),{data:d}=ny();function h(){d?.mfaEnrollmentFlow?.onSuccess(),e()}async function u(e){try{if(!e)return;await c({mfaCode:e}),l(!0)}catch(e){throw ot(e)?Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds."):oe(e)?Error("The code you entered is not valid"):a9(e)?Error("You have exceeded the time limit for code entry. Please try again in 30 seconds."):or(e)?Error("Verification canceled"):Error("Unknown error")}}return"enroll"===i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:r,onClose:t},"header"),(0,m.jsx)(iM,{children:"Scan QR code"}),(0,m.jsx)(iO,{children:"Open your authenticator app and scan the QR code to continue."}),(0,m.jsx)(i5,{children:(0,m.jsx)(dE,{authUrl:n.authUrl,size:200})}),(0,m.jsxs)(iU,{children:[(0,m.jsx)(i3,{children:(0,m.jsx)(sc,{itemName:"secret",text:n.secret})}),(0,m.jsx)(n3,{onClick:function(){a("verify")},children:"Continue"})]}),(0,m.jsx)(iN,{})]}):s?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:h},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{status:"success",children:(0,m.jsx)(W.Z,{})})}),(0,m.jsx)(iM,{children:"Authenticator app verification added"}),(0,m.jsx)(iO,{children:"From now on, you'll enter the verification code generated by your authenticator app whenever you use your Privy wallet."}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{onClick:h,children:"Done"})}),(0,m.jsx)(iN,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:function(){"verify"===i?a("enroll"):r()},onClose:t},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(eC.Z,{})})}),(0,m.jsx)(iM,{children:"Enter enrollment code"}),(0,m.jsx)(iI,{children:(0,m.jsx)(db,{onChange:u})}),(0,m.jsxs)(iO,{children:["To continue, enter the 6-digit code generated from your ",(0,m.jsx)("strong",{children:"authenticator app"})]}),(0,m.jsx)(iN,{})]})},dS=({label:e,children:t,valueStyles:r})=>(0,m.jsxs)(dT,{children:[(0,m.jsx)("div",{children:e}),(0,m.jsx)(dP,{style:{...r},children:t})]}),dT=A.ZP.div` display: flex; align-items: center; justify-content: space-between; width: 100%; > :first-child { color: var(--privy-color-foreground-3); text-align: left; } > :last-child { color: var(--privy-color-foreground-2); text-align: right; } `,dP=A.ZP.div` font-size: 14px; line-height: 100%; display: flex; align-items: center; justify-content: center; border-radius: var(--privy-border-radius-full); background-color: var(--privy-color-background-2); padding: 4px 8px; `,dN=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let n=sQ(e),i=t?sK(n,t):void 0,a=sY(n,r);return(0,m.jsx)(dM,{children:i||a})},dR=({weiQuantities:e,tokenPrice:t,tokenSymbol:r})=>{let n=sQ(e),i=t?sK(n,t):void 0,a=sY(n,r);return(0,m.jsx)(dM,{children:i?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(dO,{children:"USD"}),"<$0.01"===i?(0,m.jsxs)(dW,{children:[(0,m.jsx)(dI,{children:"<"}),"$0.01"]}):i]}):a})},dM=A.ZP.span` font-size: 14px; line-height: 140%; display: flex; gap: 4px; align-items: center; `,dO=A.ZP.span` font-size: 12px; line-height: 12px; color: var(--privy-color-foreground-3); `,dI=A.ZP.span` font-size: 10px; `,dW=A.ZP.span` display: flex; align-items: center; `,dL=({gas:e,tokenPrice:t,tokenSymbol:r})=>(0,m.jsxs)(i7,{style:{paddingBottom:"12px"},children:[(0,m.jsxs)(dU,{children:[(0,m.jsx)(dZ,{children:"Est. Fees"}),(0,m.jsx)("div",{children:(0,m.jsx)(dR,{weiQuantities:[e],tokenPrice:t,tokenSymbol:r})})]}),t&&(0,m.jsx)(dD,{children:`${sY(e,r)}`})]}),dF=({transactionData:e,gas:t,tokenPrice:r,tokenSymbol:n})=>{let i=(0,en.uq)(e.value||0).add((0,en.uq)(t)).toHexString();return(0,m.jsxs)(i7,{children:[(0,m.jsxs)(dU,{children:[(0,m.jsx)(dZ,{children:"Total (including fees)"}),(0,m.jsx)("div",{children:(0,m.jsx)(dR,{weiQuantities:[e.value||0,t],tokenPrice:r,tokenSymbol:n})})]}),r&&(0,m.jsx)(dD,{children:sY(i,n)})]})},dU=A.ZP.div` display: flex; flex-direction: row; justify-content: space-between; align-items: center; padding-top: 4px; `,dD=A.ZP.div` display: flex; flex-direction: row; height: 12px; font-size: 12px; line-height: 12px; color: var(--privy-color-foreground-3); font-weight: 400; `,dZ=A.ZP.div` font-size: 14px; line-height: 22.4px; font-weight: 400; `,dz=(0,o.createContext)(void 0),d$=(0,o.createContext)(void 0),dH=({defaultValue:e,children:t})=>{let[r,n]=(0,o.useState)(e||null);return(0,m.jsx)(dz.Provider,{value:{activePanel:r,togglePanel:e=>{n(r===e?null:e)}},children:(0,m.jsx)(dK,{children:t})})},dB=({value:e,children:t})=>{let{activePanel:r,togglePanel:n}=(0,o.useContext)(dz),i=r===e;return(0,m.jsx)(d$.Provider,{value:{onToggle:()=>n(e),value:e},children:(0,m.jsx)(dJ,{isActive:i,"data-open":i,children:t})})},dq=({children:e})=>{let{activePanel:t}=(0,o.useContext)(dz),{onToggle:r,value:n}=(0,o.useContext)(d$),i=t===n;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(dY,{onClick:r,"data-open":i,children:[(0,m.jsx)(dX,{children:e}),(0,m.jsx)(d2,{isactive:i,children:(0,m.jsx)(eP.Z,{height:"16px",width:"16px",strokeWidth:"2"})})]}),(0,m.jsx)(dQ,{})]})},dV=({children:e})=>{let{activePanel:t}=(0,o.useContext)(dz),{value:r}=(0,o.useContext)(d$);return(0,m.jsx)(d0,{"data-open":t===r,children:(0,m.jsx)(d1,{children:e})})},dG=({children:e})=>{let{activePanel:t}=(0,o.useContext)(dz),{value:r}=(0,o.useContext)(d$);return(0,m.jsx)(d1,{children:"function"==typeof e?e({isActive:t===r}):e})},dK=A.ZP.div` display: flex; flex-direction: column; width: 100%; gap: 8px; `,dY=A.ZP.div` display: flex; justify-content: space-between; align-items: center; width: 100%; cursor: pointer; padding-bottom: 8px; `,dQ=A.ZP.div` width: 100%; && { border-top: 1px solid; border-color: var(--privy-color-foreground-4); } padding-bottom: 12px; `,dX=A.ZP.div` font-size: 14px; font-weight: 500; line-height: 19.6px; width: 100%; padding-right: 8px; `,dJ=A.ZP.div` display: flex; flex-direction: column; width: 100%; overflow: hidden; padding: 12px; && { border: 1px solid; border-color: var(--privy-color-foreground-4); border-radius: var(--privy-border-radius-md); } `,d0=A.ZP.div` position: relative; overflow: hidden; transition: max-height 25ms ease-out; &[data-open='true'] { max-height: 700px; } &[data-open='false'] { max-height: 0; } `,d1=A.ZP.div` display: flex; flex-direction: column; gap: 12px; flex: 1 1 auto; min-height: 1px; `,d2=A.ZP.div` transform: ${e=>e.isactive?"rotate(180deg)":"rotate(0deg)"}; `,d3=({walletAddress:e,chainId:t=t0})=>(0,m.jsx)(d4,{href:sX(t,e),target:"_blank",children:tm(e)}),d4=A.ZP.a` &:hover { text-decoration: underline; } `,d5=({from:e,to:t,txn:r,transactionInfo:n,tokenPrice:i,gas:a,tokenSymbol:o})=>{let s=r?.value||0,l=nh();return(0,m.jsx)(dH,{...l.render.standalone?{defaultValue:"details"}:{},children:(0,m.jsxs)(dB,{value:"details",children:[(0,m.jsx)(dq,{children:(0,m.jsxs)(d6,{children:[(0,m.jsx)("div",{children:n?.title||n?.actionDescription||"Details"}),(0,m.jsx)(d7,{children:(0,m.jsx)(dN,{weiQuantities:[s],tokenPrice:i,tokenSymbol:o})})]})}),(0,m.jsxs)(dV,{children:[(0,m.jsx)(dS,{label:"From",children:(0,m.jsx)(d3,{walletAddress:e,chainId:r.chainId||t0})}),(0,m.jsx)(dS,{label:"To",children:(0,m.jsx)(d3,{walletAddress:t,chainId:r.chainId||t0})}),n&&n.action&&(0,m.jsx)(dS,{label:"Action",children:n.action}),a&&(0,m.jsx)(dL,{transactionData:r,gas:a,tokenPrice:i,tokenSymbol:o})]}),(0,m.jsx)(dG,{children:({isActive:e})=>(0,m.jsx)(dF,{transactionData:r,displayFee:e,gas:a||"0x0",tokenPrice:i,tokenSymbol:o})})]})})},d6=A.ZP.div` display: flex; flex-direction: row; justify-content: space-between; `,d7=A.ZP.div` flex-shrink: 0; padding-left: 8px; `,d8=A.ZP.img` && { height: ${e=>"sm"===e.size?"65px":"140px"}; width: ${e=>"sm"===e.size?"65px":"140px"}; border-radius: 16px; margin-bottom: 12px; } `,d9=({pendingTransaction:e})=>{let{getAccessToken:t}=n$(),{wallets:r}=sH(),{walletProxy:n,rpcConfig:i,chains:a,appId:s,nativeTokenSymbolForChainId:d}=nZ(),[h,u]=(0,o.useState)(null),[p,g]=(0,o.useState)(e),{tokenPrice:f}=sz(p),y=d(e.chainId)||"ETH",w=(0,o.useMemo)(()=>r.find(e=>"privy"===e.walletClientType),[r]);return(0,o.useEffect)(()=>{(async function(){if(!await t()||!n||!w)return p;let e=tk(p.chainId,a,i,{appId:s}),r=await (0,l.vT)(w.address,p,e),{totalGasEstimate:o}=await (0,c.gM)(r,e);return u(o.toHexString()),r})().then(g).catch(console.error)},[n]),w?(0,m.jsx)(he,{children:(0,m.jsx)(d5,{from:w.address,to:p.to,txn:p,gas:h??void 0,tokenPrice:f,tokenSymbol:y})}):null},he=A.ZP.div` width: 100%; padding: 1rem 0; `,ht=({hasBlockingError:e,error:t,onClose:r,onBack:n,handleSubmit:i,account:a,submitSuccess:o})=>{let{pendingTransaction:s}=nZ();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:r},"header"),(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:o,fail:!!t}),t?(0,m.jsx)(U.Z,{style:{width:"38px",height:"38px"}}):(0,m.jsx)(lh,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsx)(iM,{style:{marginTop:"1rem"},children:"Verifying with passkey"}),(0,m.jsxs)(iW,{children:[(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(eT.Z,{})}),"Approve this action using your touch, face, PIN, or hardware key."]}),(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(eN.Z,{})}),"You last added a passkey on"," ",a?.firstVerifiedAt?.toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"}),"."]})]}),s&&(0,m.jsx)(iI,{children:(0,m.jsx)(d9,{pendingTransaction:s})}),t&&(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(iK,{style:{marginTop:"1.25rem"},children:t.message}),(0,m.jsx)(n3,{disabled:e,onClick:i,style:{marginTop:"1.25rem"},children:"Try again"})]}),n&&(0,m.jsx)(iV,{style:{marginTop:"1rem"},onClick:n,children:"Choose another method"}),(0,m.jsx)(iN,{})]})},hr=({open:e,onClose:t})=>{let{user:r}=n$(),[n,i]=(0,o.useState)(null),{init:a,cancel:s,submit:l}=di(),[c,d]=(0,o.useState)(!1),[h,u]=(0,o.useState)(!1),[p,g]=(0,o.useState)(null),[f,y]=(0,o.useState)(null);(0,o.useEffect)(()=>{e&&r?.mfaMethods&&r.mfaMethods.length>0?v(r.mfaMethods[0]):i(null)},[r?.mfaMethods,e]);let w=e=>a7(e)&&"mfa_verification_max_attempts_reached"===e.type?(d(!0),Error("You have exceeded the maximum number of attempts. Please close this window and try again in 10 seconds.")):oe(e)?(d(!1),Error("The code you entered is not valid")):a9(e)?(d(!0),Error("You have exceeded the time limit for code entry. Please try again in 30 seconds.")):(console.error(e),d(!1),Error("Something went wrong."));async function x(e){y(null);try{if(!e||!n)return;await l(n,e),u(!0),d(!1),t()}catch(e){throw w(e)}}async function v(e){if("passkey"===e){try{i(e);let r=await a(e);if(!r)throw Error("something went wrong");g(r),await l(e,r),u(!0),d(!1),t()}catch(e){y(w(e))}return}try{i(e),await a(e)}catch(e){console.error(e)}}let C=()=>{i(null),y(null),s(),t()};if(!e||!r)return null;if("passkey"===n){let e=r.linkedAccounts.filter(e=>"passkey"===e.type&&e.enrolledInMfa).sort((e,t)=>t.firstVerifiedAt.valueOf()-e.firstVerifiedAt.valueOf())[0];return(0,m.jsx)(ht,{account:e,selectedMethod:n,submitSuccess:h,hasBlockingError:c,error:f,onClose:C,onBack:()=>{i(null),y(null)},handleSubmit:()=>x(p).catch(y)})}return n?(0,m.jsx)(hn,{submitSuccess:h,hasBlockingError:c,handleSubmitCode:x,selectedMethod:n,onClose:C,onBack:r.mfaMethods.length>1?()=>i(null):void 0}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:C},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(eT.Z,{})})}),(0,m.jsx)(iM,{children:"Verify your identity"}),(0,m.jsx)(iO,{children:"Choose a verification method"}),(0,m.jsxs)(iD,{children:[r.mfaMethods.includes("totp")&&(0,m.jsxs)(i_,{onClick:()=>v("totp"),children:[(0,m.jsx)(eE.Z,{}),"Authenticator App"]},"totp"),r.mfaMethods.includes("sms")&&(0,m.jsxs)(i_,{onClick:()=>v("sms"),children:[(0,m.jsx)(I.Z,{}),"SMS"]},"sms"),r.mfaMethods.includes("passkey")&&(0,m.jsxs)(i_,{onClick:()=>v("passkey"),children:[(0,m.jsx)(eA.Z,{}),"Passkey"]},"passkey")]}),(0,m.jsx)(iN,{})]})},hn=({selectedMethod:e,submitSuccess:t,hasBlockingError:r,onClose:n,onBack:i,handleSubmitCode:a})=>{let{app:o}=ny(),{pendingTransaction:s}=nZ();switch(e){case"sms":return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:n},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(e_.Z,{})})}),(0,m.jsx)(iM,{children:"Enter verification code"}),(0,m.jsxs)(iI,{children:[(0,m.jsx)(db,{success:t,disabled:r,onChange:a}),(0,m.jsxs)(iO,{children:["To continue, please enter the 6-digit code sent to your ",(0,m.jsx)("strong",{children:"mobile device"})]}),s&&(0,m.jsx)(d9,{pendingTransaction:s})]}),i&&(0,m.jsx)(iV,{theme:o?.appearance.palette.colorScheme,onClick:i,children:"Choose another method"}),(0,m.jsx)(n8,{onClick:n,children:"Not now"}),(0,m.jsx)(iN,{})]});case"totp":return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:n},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(eC.Z,{})})}),(0,m.jsx)(iM,{children:"Enter verification code"}),(0,m.jsxs)(iI,{children:[(0,m.jsx)(db,{success:t,disabled:r,onChange:a}),(0,m.jsxs)(iO,{children:["To continue, please enter the 6-digit code generated from your"," ",(0,m.jsx)("strong",{children:"authenticator app"})]}),s&&(0,m.jsx)(d9,{pendingTransaction:s})]}),i&&(0,m.jsx)(iV,{theme:o?.appearance.palette.colorScheme,onClick:i,children:"Choose another method"}),(0,m.jsx)(n8,{onClick:n,children:"Not now"}),(0,m.jsx)(iN,{})]});default:return null}},hi=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 27px; margin-right: 27px; gap: 24px; `,ha=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; `;A.ZP.div` display: flex; align-items: center; justify-content: center; width: 180px; height: 90px; border-radius: 50%; svg + svg { margin-left: 12px; } > svg { z-index: 2; color: var(--privy-color-accent) !important; stroke: var(--privy-color-accent) !important; fill: var(--privy-color-accent) !important; } `;var ho=(e,t)=>{let r=encodeURIComponent(new URL(window.location.href).href.replace(/\/$/g,"")+`?privy_token=${e}&privy_connector=injected&privy_wallet_client=phantom`);if(!tc()&&s.tq)return`${t?"phantom://":"https://phantom.app/ul/"}browse/${r}?ref=${r}`},hs=(0,A.ZP)(i3)` margin: 16px auto; `,hl=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin: 20px 0; gap: 4px; & h3 { font-size: 18px; font-style: normal; font-weight: 600; line-height: 24px; } & p { max-width: 300px; font-size: 14px; font-style: normal; font-weight: 400; line-height: 20px; } `,hc=A.ZP.div` display: flex; flex-direction: column; justify-content: space-between; `,hd=A.ZP.div` line-height: 20px; height: 20px; font-size: 13px; color: var(--privy-color-error); text-align: left; margin-top: 0.5rem; `,hh=(0,A.ZP)(n3)` ${e=>e.hideAnimations&&(0,A.iv)` && { // Remove animations because the recoverWallet task on the iframe partially // blocks the renderer, so the animation stutters and doesn't look good transition: none; } `} `,hu=e=>(0,m.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 21 20",...e,children:[(0,m.jsx)("path",{fill:"url(#icloud-gradient)",d:"M12.34 7.315a4.26 4.26 0 0 0-3.707 2.18 2.336 2.336 0 0 0-1.02-.236 2.336 2.336 0 0 0-2.3 1.963 3.217 3.217 0 0 0 1.244 6.181c.135-.001.27-.01.404-.029h8.943c.047.004.094.006.141.007.045-.001.09-.004.135-.007h.214v-.016a2.99 2.99 0 0 0 1.887-.988c.487-.55.757-1.261.757-1.998v-.006a3.017 3.017 0 0 0-.69-1.915 2.992 2.992 0 0 0-1.748-1.034 4.26 4.26 0 0 0-4.26-4.102Z"}),(0,m.jsx)("defs",{children:(0,m.jsxs)("linearGradient",{id:"icloud-gradient",x1:19.086,x2:3.333,y1:14.38,y2:14.163,gradientUnits:"userSpaceOnUse",children:[(0,m.jsx)("stop",{stopColor:"#3E82F4"}),(0,m.jsx)("stop",{offset:1,stopColor:"#93DCF7"})]})})]}),hp=({style:e,...t})=>(0,m.jsxs)("svg",{width:"16",height:"14",style:e,viewBox:"0 0 16 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,m.jsxs)("g",{clipPath:"url(#clip0_2115_829)",children:[(0,m.jsx)("path",{d:"M2.34709 12.9404L2.3471 12.9404L2.34565 12.938L1.64031 11.7448L1.64004 11.7444L0.651257 10.0677C0.640723 10.0496 0.630746 10.0314 0.621325 10.0129H4.16461L2.39424 13.0139C2.3775 12.9901 2.36178 12.9656 2.34709 12.9404Z",fill:"#0066DA",stroke:"#6366F1"}),(0,m.jsx)("path",{d:"M8 4.48713L5.47995 0.215332C5.23253 0.358922 5.02176 0.556358 4.87514 0.80764L0.219931 8.70508C0.076007 8.95094 0.000191627 9.22937 0 9.51277H5.04009L8 4.48713Z",fill:"#00AC47"}),(0,m.jsx)("path",{d:"M13.48 13.7847C13.7274 13.6411 13.9382 13.4437 14.0848 13.1924L14.3781 12.6988L15.7801 10.3206C15.9267 10.0693 16.0001 9.79114 16.0001 9.51294H10.9596L12.0321 11.577L13.48 13.7847Z",fill:"#EA4335"}),(0,m.jsx)("path",{d:"M8.00003 4.48718L10.5201 0.215385C10.2726 0.0717949 9.98857 0 9.69533 0H6.30472C6.01148 0 5.7274 0.0807692 5.47998 0.215385L8.00003 4.48718Z",fill:"#00832D"}),(0,m.jsx)("path",{d:"M10.9599 9.51294H5.04007L2.52002 13.7847C2.76744 13.9283 3.05152 14.0001 3.34476 14.0001H12.6552C12.9484 14.0001 13.2325 13.9194 13.4799 13.7847L10.9599 9.51294Z",fill:"#2684FC"}),(0,m.jsx)("path",{d:"M13.4525 4.75636L11.1249 0.80764C10.9782 0.556358 10.7675 0.358922 10.52 0.215332L8 4.48713L10.9599 9.51277H15.9908C15.9908 9.23456 15.9175 8.95636 15.7709 8.70508L13.4525 4.75636Z",fill:"#FFBA00"})]}),(0,m.jsx)("defs",{children:(0,m.jsx)("clipPath",{id:"clip0_2115_829",children:(0,m.jsx)("rect",{width:"16",height:"14",fill:"white"})})})]}),hm=A.ZP.div` display: flex; flex-direction: column; gap: 12px; padding-top: 24px; padding-bottom: 24px; `,hg=A.ZP.div` padding-bottom: 24px; `,hf={"google-drive":{name:"Google Drive",component:hp},icloud:{name:"iCloud",component:hu}},hy=A.ZP.div` width: 24px; height: 24px; display: flex; justify-content: center; align-items: center; `,hw={"google-drive":"Google Drive",icloud:"iCloud","user-passcode":"password",privy:"Privy"},hx=({onClose:e})=>(0,m.jsxs)(hg,{children:[(0,m.jsx)(as,{title:"Why do I need to secure my account?",icon:(0,m.jsx)(S.Z,{width:48}),description:(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)("p",{children:"Your app uses cryptography to secure your account. App secrets are split and encrypted so only you can access them."}),(0,m.jsx)("p",{children:"To use this app on new devices, secure account secrets using a password, your Google or your Apple account. It’s important you don’t lose access to the method you choose."})]})}),(0,m.jsx)(n3,{onClick:e,children:"Select backup method"})]}),hv=A.ZP.div` && { border-width: 4px; } display: flex; justify-content: center; align-items: center; padding: 1rem; aspect-ratio: 1; border-style: solid; border-color: ${e=>e.$color??"var(--privy-color-accent)"}; border-radius: 50%; `,hC=A.ZP.span` color: var(--privy-color-foreground); font-size: 1.125rem; font-weight: 600; line-height: 1.875rem; /* 166.667% */ text-align: center; `,hb=["FUNDING_METHOD_SELECTION_SCREEN","FUNDING_TRANSFER_FROM_WALLET_SCREEN","FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN","FUNDING_MANUAL_TRANSFER_SCREEN","MOONPAY_PROMPT_SCREEN","MOONPAY_STATUS_SCREEN"],h_={FUNDING_METHOD_SELECTION_SCREEN:null,FUNDING_TRANSFER_FROM_WALLET_SCREEN:"external",FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN:"external",FUNDING_MANUAL_TRANSFER_SCREEN:"manual",MOONPAY_PROMPT_SCREEN:"moonpay",MOONPAY_STATUS_SCREEN:"moonpay"},hj={moonpay:"MOONPAY_PROMPT_SCREEN","coinbase-onramp":"COINBASE_ONRAMP_STATUS_SCREEN",external:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"};function hk({fundingMethods:e}){if(0===e.length)throw Error("Wallet funding is not enabled");return 1===e.length?hj[e[0]]:"FUNDING_METHOD_SELECTION_SCREEN"}var hE=({img:e,submitError:t,prepareError:r,onClose:n,action:i,amount:a,title:o,subtitle:s,total:l,to:c,network:d,hasFunds:h,fee:u,from:p,cta:g,chain:f,isSubmitting:y,isPreparing:w,isTokenPriceLoading:x,isTokenContractInfoLoading:v,symbol:C,balance:b,onClick:_,spender:j})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:n}),e&&(0,m.jsx)(hP,{children:e}),(0,m.jsx)(hC,{style:{marginTop:e?"1.5rem":0},children:o}),(0,m.jsx)(cg,{children:s}),(0,m.jsxs)(sW,{style:{marginTop:"2rem"},children:[l&&(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Total"}),(0,m.jsx)(sF,{$isLoading:w||x,children:l})]}),i&&"transaction"!==i&&(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Action"}),(0,m.jsx)(sF,{children:i})]}),a?(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Amount"}),(0,m.jsxs)(sF,{$isLoading:v,children:[hT(a)," ",C]})]}):null,j?(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Spender"}),(0,m.jsx)(sF,{children:(0,m.jsx)(lH,{address:j,url:f?.blockExplorers?.default?.url,showCopyIcon:!1})})]}):null,c&&(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"To"}),(0,m.jsx)(sF,{children:(0,m.jsx)(lH,{address:c,url:f?.blockExplorers?.default?.url,showCopyIcon:!1})})]}),(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Network"}),(0,m.jsx)(sF,{children:d})]}),(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Estimated fee"}),(0,m.jsx)(sF,{$isLoading:w||x,children:u})]})]}),(0,m.jsx)(iy,{}),t?(0,m.jsx)(lz,{style:{marginTop:"2rem"},children:t.message}):r?(0,m.jsx)(lz,{style:{marginTop:"2rem"},children:hS}):null,(0,m.jsx)(hA,{$useSmallMargins:!!(r||t),address:p,balance:b,isLoading:w||x,errMsg:w||r||t||h?void 0:`Add funds on ${f?.name} to complete transaction.`}),(0,m.jsx)(n4,{style:{marginTop:"1rem"},loading:y,onClick:_,children:g}),(0,m.jsx)(iP,{})]}),hA=(0,A.ZP)(lq)` ${e=>e.$useSmallMargins?"margin-top: 0.5rem;":"margin-top: 2rem;"} `,hS="There was an error preparing your transaction. Your transaction request will likely fail.",hT=e=>e.toLocaleString(),hP=A.ZP.div` display: flex; width: 100%; justify-content: center; max-height: 40px; > img { object-fit: contain; border-radius: var(--privy-border-radius-sm); } `,hN=new Set([v.jK.CALL_EXCEPTION,v.jK.NONCE_EXPIRED,v.jK.REPLACEMENT_UNDERPRICED,v.jK.TRANSACTION_REPLACED]),hR=e=>{let t;return e.code&&-32e3!==e.code&&hN.has(e.code)&&(t=e.transactionHash),t},hM=e=>"SERVER_ERROR"===e.code?e.error?.message??e.reason??e.message??"unknown error":e.error?.code==="SERVER_ERROR"?e.error?.error?.message??e.reason??e.message??"unknown error":e.reason??e.message??"unknown error",hO=e=>({errorCode:e.code?e.code?.toString().charAt(0)+e.code?.toString().slice(1).replace("_"," ").toLowerCase():"Something went wrong.",transactionHash:hR(e),errorMessage:hM(e)}),hI=()=>(0,m.jsxs)(hD,{children:[(0,m.jsx)(hz,{}),(0,m.jsx)(hZ,{})]}),hW=({transactionError:e,chainId:t,onClose:r,onRetry:n})=>{let{chains:i}=nZ(),[a,s]=(0,o.useState)(!1),{errorCode:l,transactionHash:c,errorMessage:d}=hO(e),h=i.find(e=>e.id===t)?.blockExplorers?.default.url??"https://etherscan.io";return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:r}),(0,m.jsxs)(hL,{children:[(0,m.jsx)(hI,{}),(0,m.jsx)(hF,{children:l}),(0,m.jsx)(hU,{children:"Please try again."}),(0,m.jsxs)(hB,{children:[(0,m.jsx)(hH,{children:"Error message"}),(0,m.jsx)(hV,{clickable:!1,children:d})]}),c&&(0,m.jsxs)(hB,{children:[(0,m.jsx)(hH,{children:"Transaction hash"}),(0,m.jsxs)(hq,{children:["Copy this hash to view details about the transaction on a"," ",(0,m.jsx)("u",{children:(0,m.jsx)("a",{href:h,children:"block explorer"})}),"."]}),(0,m.jsxs)(hV,{clickable:!0,onClick:async()=>{await navigator.clipboard.writeText(c),s(!0)},children:[c,(0,m.jsx)(hY,{clicked:a})]})]}),(0,m.jsx)(h$,{onClick:()=>n({resetNonce:!!c}),children:"Retry transaction"})]}),(0,m.jsx)(iN,{})]})},hL=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; `,hF=A.ZP.span` color: var(--privy-color-foreground); text-align: center; font-size: 1.125rem; font-weight: 500; line-height: 1.25rem; /* 111.111% */ text-align: center; margin: 10px; `,hU=A.ZP.span` margin-top: 4px; margin-bottom: 10px; color: var(--privy-color-foreground-3); text-align: center; font-size: 0.875rem; font-style: normal; font-weight: 400; line-height: 20px; /* 142.857% */ letter-spacing: -0.008px; `,hD=A.ZP.div` position: relative; width: 60px; height: 60px; margin: 10px; display: flex; justify-content: center; align-items: center; `,hZ=(0,A.ZP)(eI.Z)` position: absolute; width: 35px; height: 35px; color: var(--privy-color-error); `,hz=A.ZP.div` position: absolute; width: 60px; height: 60px; border-radius: 50%; background-color: var(--privy-color-error); opacity: 0.1; `,h$=(0,A.ZP)(n3)` && { margin-top: 24px; } transition: color 350ms ease, background-color 350ms ease; `,hH=A.ZP.span` width: 100%; text-align: left; font-size: 0.825rem; color: var(--privy-color-foreground); padding: 4px; `,hB=A.ZP.div` width: 100%; margin: 5px; display: flex; flex-direction: column; justify-content: center; align-items: center; `,hq=A.ZP.text` position: relative; width: 100%; padding: 5px; font-size: 0.8rem; color: var(--privy-color-foreground-3); text-align: left; word-wrap: break-word; `,hV=A.ZP.span` position: relative; width: 100%; background-color: var(--privy-color-background-2); padding: 8px 12px; border-radius: 10px; margin-top: 5px; font-size: 14px; color: var(--privy-color-foreground-3); text-align: left; word-wrap: break-word; ${e=>e.clickable&&`cursor: pointer; transition: background-color 0.3s; padding-right: 45px; &:hover { background-color: var(--privy-color-foreground-4); }`} `,hG=(0,A.ZP)(eO.Z)` position: absolute; top: 13px; right: 13px; width: 24px; height: 24px; `,hK=(0,A.ZP)(Y.Z)` position: absolute; top: 13px; right: 13px; width: 24px; height: 24px; `,hY=({clicked:e})=>e?(0,m.jsx)(hK,{}):(0,m.jsx)(hG,{}),hQ=(e,t)=>{if(e.gasUsed&&e.effectiveGasPrice)try{let r=ei.O$.from(e.gasUsed),n=ei.O$.from(e.effectiveGasPrice),i=r.mul(n);if(t){let e=ei.O$.from(t);i=i.add(e)}return i.toString()}catch{return}},hX=({txn:e,receipt:t,transactionInfo:r,onClose:n,tokenPrice:i,tokenSymbol:a,l1GasEstimate:o,receiptHeader:s,receiptDescription:l})=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:n}),(0,m.jsx)(aa,{title:s??"Transaction complete!",description:l??"You're all set."}),(0,m.jsx)(d5,{tokenPrice:i,from:t.from,to:t.to,gas:hQ(t,o),txn:e,transactionInfo:r,tokenSymbol:a}),(0,m.jsx)(iy,{}),(0,m.jsx)(hJ,{loading:!1,onClick:n,children:"All Done"}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]}),hJ=(0,A.ZP)(n3)` && { margin-top: 24px; } transition: color 350ms ease, background-color 350ms ease; `,h0=(e,t)=>Intl.NumberFormat(void 0,{maximumFractionDigits:t}).format(e/Math.pow(10,t)),h1=[{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}],h2=async({address:e,chain:t,amount:r,rpcConfig:n,privyAppId:i})=>{if(!r)return{value:"",symbol:""};try{let a=(0,eW.v)({chain:t,transport:(0,eL.d)(t_(t,n,i))}),[o,s]=await Promise.all([a.readContract({abi:h1,address:e,functionName:"symbol"}),a.readContract({abi:h1,address:e,functionName:"decimals"})]);return{value:h0(parseFloat(r.toString()),s),symbol:o}}catch(e){return console.log(e),{value:r.toString(),symbol:""}}},h3=e=>{let t=h5(e);if(t)return{action:"approve",isErc20Ish:!0,functionName:t.functionName,spender:t.args[0],amount:t.args[1]};let r=h7(e);return r?{action:"transfer",isErc20Ish:!0,functionName:r.functionName,amount:r.args[1]}:{action:"transaction",isErc20Ish:!1}},h4=[{constant:!1,inputs:[{name:"spender",type:"address"},{name:"value",type:"uint256"}],name:"approve",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],h5=e=>{try{return(0,eF.p)({abi:h4,data:e})}catch{return null}},h6=[{constant:!1,inputs:[{name:"to",type:"address"},{name:"value",type:"uint256"}],name:"transfer",outputs:[{name:"",type:"bool"}],payable:!1,stateMutability:"nonpayable",type:"function"}],h7=e=>{try{return(0,eF.p)({abi:h6,data:e})}catch{return null}},h8=(e,t)=>{let[r,n]=(0,o.useState)(null),{getAccessToken:i,user:a}=n$(),{walletProxy:s}=nZ(),d=rC(a),h=async()=>{if(!await i()||!s||!d)return null;let r=[],n=await (0,l.vT)(d.address,e,t).catch(t=>(r.push(t),e)),{totalGasEstimate:a,l1ExecutionFeeEstimate:o}=await (0,c.gM)(n,t).catch(e=>(r.push(e),{totalGasEstimate:null,l1ExecutionFeeEstimate:null})),{balance:h,hasSufficientFunds:u}=await sD(d.address,n,a??ei.O$.from(0),t).catch(e=>(r.push(e),{balance:null,hasSufficientFunds:!1}));return{tx:n,totalGasEstimate:a,l1ExecutionFeeEstimate:o,balance:h,hasFunds:u,errors:r}};return(0,o.useEffect)(()=>{r&&n(null),h().then(n)},[e]),r},h9=new rW(new rI("There was an issue preparing your transaction",d.M_.E32603_DEFAULT_INTERNAL_ERROR.eipCode)),ue=e=>{if(!(0,y.A7)(e))return e;try{return(0,eU.ZN)(e)}catch{return e}},ut=e=>JSON.stringify(e,null,2),ur=({data:e})=>{let t=e=>"object"==typeof e&&null!==e?(0,m.jsx)(ua,{children:Object.entries(e).map(([e,r])=>(0,m.jsxs)("li",{children:[(0,m.jsxs)("strong",{children:[e,":"]})," ",t(r)]},e))}):(0,m.jsx)("span",{children:String(e)});return(0,m.jsx)("div",{children:t(e)})},un=e=>{let{types:t,primaryType:r,...n}=e.typedData;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ui,{children:(0,m.jsx)(ur,{data:n})}),(0,m.jsx)(sc,{text:ut(e.typedData),itemName:"full payload to clipboard"})," "]})},ui=A.ZP.div` margin-top: 1.5rem; background-color: var(--privy-color-background-2); border-radius: var(--privy-border-radius-md); padding: 12px; text-align: left; max-height: 310px; overflow: scroll; white-space: pre-wrap; width: 100%; // hide the scrollbars -ms-overflow-style: none; /* Internet Explorer 10+ */ scrollbar-width: none; /* Firefox */ &::-webkit-scrollbar { display: none; /* Safari and Chrome */ } } `,ua=A.ZP.ul` margin-left: 12px !important; white-space: nowrap; &:first-child { margin-left: 0 !important; } strong { font-weight: 500 !important; } } `,uo=A.ZP.div` line-height: 20px; height: 20px; font-size: 13px; color: ${e=>e.fail?"var(--privy-color-error)":"var(--privy-color-foreground-3)"}; display: flex; justify-content: flex-start; width: 100%; margin-top: 16px; margin-bottom: 4px; `,us=A.ZP.span` display: flex; align-items: center; gap: 8px; `,ul=A.ZP.div` display: flex; flex-direction: column; justify-content: center; align-items: center; width: 100%; height: 82px; `,uc=A.ZP.div` flex-grow: 1; `,ud=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; margin-left: 27px; margin-right: 27px; gap: 24px; `,uh=(0,o.forwardRef)((e,t)=>{let[r,n]=(0,o.useState)(""),[i,a]=(0,o.useState)(!1),{authenticated:s,user:l}=n$(),{initUpdateEmail:c}=nZ(),{navigate:d,setModalData:h,currentScreen:u}=ny(),{enabled:p,token:g}=nF(),f=tu(r),y=i||!f,w=async e=>{if(!l?.email)throw Error("User is required to have an email address to update it.");a(!0);try{await c(l.email.address,r,e),d("AWAITING_PASSWORDLESS_CODE")}catch(e){h({errorModalData:{error:e,previousScreen:u||"LANDING"}})}a(!1)},x=()=>{!p||g||s?w(g):(h({captchaModalData:{callback:e=>{if(!l?.email)throw Error("User is required to have an email address to update it.");return c(l.email.address,r,e)},userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_PASSWORDLESS_CODE",onErrorNavigateTo:"ERROR_SCREEN"}}),d("CAPTCHA_SCREEN"))};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(uu,{children:(0,m.jsxs)(up,{children:[(0,m.jsx)(O.Z,{}),(0,m.jsx)("input",{ref:t,id:"email-input",type:"email",placeholder:"your@email.com",onChange:e=>n(e.target.value),onKeyUp:e=>{"Enter"===e.key&&x()},value:r,autoComplete:"email"}),e.stacked?null:(0,m.jsx)(it,{isSubmitting:i,onClick:x,disabled:y,children:"Submit"})]})}),e.stacked?(0,m.jsx)(n3,{loadingText:null,loading:i,disabled:y,onClick:x,children:"Submit"}):null]})}),uu=A.ZP.div` width: 100%; `,up=A.ZP.label` display: block; position: relative; width: 100%; background-color: var(--privy-color-background); transition: background-color 200ms ease; > svg { position: absolute; margin: 13px 17px; height: 24px; width: 24px; color: var(--privy-color-foreground-3); } && > input { font-size: 16px; line-height: 24px; padding: 12px 88px 12px 52px; flex-grow: 1; background: var(--privy-color-background); border: 1px solid var(--privy-color-foreground-4); border-radius: var(--privy-border-radius-mdlg); width: 100%; /* Tablet and Up */ @media (min-width: 441px) { font-size: 14px; padding-right: 78px; } :focus { outline: none; border-color: var(--privy-color-accent); } :autofill, :-webkit-autofill { background: var(--privy-color-background); } } && > button { right: 0; line-height: 24px; position: absolute; padding: 13px 17px; :focus { outline: none; border-color: var(--privy-color-accent); } } && > input::placeholder { color: var(--privy-color-foreground-3); } `,um=({style:e,...t})=>(0,m.jsx)("svg",{width:"40",height:"40",viewBox:"0 0 40 40",fill:"none",xmlns:"http://www.w3.org/2000/svg",style:{height:"38px",width:"38px",...e},...t,children:(0,m.jsx)("path",{d:"M20 13.6V20M20 26.4H20.016M36 20C36 28.8365 28.8366 36 20 36C11.1635 36 4.00001 28.8365 4.00001 20C4.00001 11.1634 11.1635 3.99999 20 3.99999C28.8366 3.99999 36 11.1634 36 20Z",stroke:"currentColor",strokeWidth:"3.2",strokeLinecap:"round",strokeLinejoin:"round"})}),ug=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px; width: 100%; padding-top: 8px; padding-bottom: 32px; `,uf=A.ZP.div` display: flex; align-items: center; justify-content: center; height: 72px; aspect-ratio: 1; color: var(--privy-color-error); background-color: var(--privy-color-error-light); border-radius: 50%; `,uy=A.ZP.div` display: flex; flex-direction: column; gap: 8px; `,uw=` *, ::before, ::after { box-sizing: border-box; border-width: 0; border-style: solid; } line-height: 1.15; -webkit-text-size-adjust: 100%; -moz-tab-size: 4; tab-size: 4; font-feature-settings: normal; margin: 0; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; hr { height: 0; color: inherit; border-top-width: 1px; } abbr:where([title]) { text-decoration: underline dotted; } h1, h2, h3, h4, h5, h6 { font-size: inherit; font-weight: inherit; font-family: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'; display: inline; } a { color: inherit; text-decoration: inherit; } b, strong { font-weight: bolder; } code, kbd, samp, pre { font-family: ui-monospace, SFMono-Regular, Consolas, 'Liberation Mono', Menlo, monospace; font-size: 1em; } small { font-size: 80%; } sub, sup { font-size: 75%; line-height: 0; position: relative; vertical-align: baseline; } sub { bottom: -0.25em; } sup { top: -0.5em; } table { text-indent: 0; border-color: inherit; border-collapse: collapse; } button, input, optgroup, select, textarea { font-family: inherit; font-size: 100%; font-weight: inherit; line-height: inherit; color: inherit; margin: 0; padding: 0; } button, select { text-transform: none; } button, [type='button'], [type='reset'], [type='submit'] { -webkit-appearance: button; background-color: transparent; background-image: none; } ::-moz-focus-inner { border-style: none; padding: 0; } :-moz-focusring { outline: 1px dotted ButtonText; } :-moz-ui-invalid { box-shadow: none; } legend { padding: 0; } progress { vertical-align: baseline; } ::-webkit-inner-spin-button, ::-webkit-outer-spin-button { height: auto; } [type='search'] { -webkit-appearance: textfield; outline-offset: -2px; } ::-webkit-search-decoration { -webkit-appearance: none; } ::-webkit-file-upload-button { -webkit-appearance: button; font: inherit; } summary { display: list-item; } blockquote, dl, dd, h1, h2, h3, h4, h5, h6, hr, figure, p, pre { margin: 0; } fieldset { margin: 0; padding: 0; } legend { padding: 0; } ol, ul, menu { list-style: none; margin: 0; padding: 0; } textarea { resize: vertical; } input::placeholder, textarea::placeholder { opacity: 1; color: #9ca3af; } button, [role='button'] { cursor: pointer; } :disabled { cursor: default; } img, svg, video, canvas, audio, iframe, embed, object { display: block; } img, video { max-width: 100%; height: auto; } [hidden] { display: none; } `,ux=(0,A.vJ)` :root { // Borders --privy-border-radius-sm: 6px; --privy-border-radius-md: 12px; --privy-border-radius-mdlg: 16px; --privy-border-radius-lg: 24px; --privy-border-radius-full: 9999px; // Colors --privy-color-background: ${e=>e.theme.background}; --privy-color-background-2: ${e=>e.theme.background2}; --privy-color-foreground: ${e=>e.theme.foreground}; --privy-color-foreground-2: ${e=>e.theme.foreground2}; --privy-color-foreground-3: ${e=>e.theme.foreground3}; --privy-color-foreground-4: ${e=>e.theme.foreground4}; --privy-color-foreground-accent: ${e=>e.theme.foregroundAccent}; --privy-color-accent: ${e=>e.theme.accent}; --privy-color-accent-light: ${e=>e.theme.accentLight}; --privy-color-accent-dark: ${e=>e.theme.accentDark}; --privy-color-success: ${e=>e.theme.success}; --privy-color-success-dark: ${e=>e.theme.successDark}; --privy-color-success-light: ${e=>e.theme.successLight}; --privy-color-error: ${e=>e.theme.error}; --privy-color-error-light: ${e=>e.theme.errorLight}; --privy-color-warn: ${e=>e.theme.warn}; --privy-color-warn-light: ${e=>e.theme.warnLight}; // Space --privy-height-modal-full: 620px; --privy-height-modal-compact: 480px; }; `,uv=A.ZP.div` // css normalize only the privy application to avoid conflicts // with consuming application ${uw} // Privy styles color: var(--privy-color-foreground-2); h3 { font-size: 16px; line-height: 24px; font-weight: 500; color: var(--privy-color-foreground-2); } h4 { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--privy-color-foreground); } p { font-size: 13px; line-height: 20px; color: var(--privy-color-foreground-2); } button:focus, input:focus, optgroup:focus, select:focus, textarea:focus { outline: none; border-color: var(--privy-color-accent-light); box-shadow: 0 0 0 1px var(--privy-color-accent-light); } .mobile-only { @media (min-width: 441px) { display: none; } } /* Animations */ @keyframes fadein { 0% { opacity: 0; } 100% { opacity: 1; } } `,uC=({children:e,open:t,onClick:r,...n})=>(0,m.jsx)(eD.u,{show:t,as:o.Fragment,children:(0,m.jsxs)(eZ.V,{onClose:r,...n,as:u_,children:[(0,m.jsx)(eD.u.Child,{as:o.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,m.jsx)(ub,{id:"privy-dialog-backdrop","aria-hidden":"true"})}),(0,m.jsx)(uj,{children:(0,m.jsx)(eD.u.Child,{as:o.Fragment,enterFrom:"entering",leaveTo:"leaving",children:(0,m.jsx)(eZ.V.Panel,{as:uk,children:e})})})]})}),ub=A.ZP.div` position: fixed; inset: 0; transition: backdrop-filter 100ms ease; backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); &.entering, &.leaving { backdrop-filter: unset; -webkit-backdrop-filter: unset; } `,u_=A.ZP.div` position: relative; z-index: 999999; `,uj=A.ZP.div` position: fixed; inset: 0; display: flex; align-items: center; justify-content: center; width: 100vw; min-height: 100vh; `,uk=A.ZP.div` // reset some default dialog styles padding: 0; background: transparent; border: none; width: 100%; pointer-events: auto; outline: none; display: block; /* * Normally it is bad to mix media queries like this We are doing * this here specifically for animations to avoid weird jank. */ /* Mobile animation is a bottom drawer */ @media (max-width: 440px) { opacity: 1; transform: translate3d(0, 0, 0); transition: transform 200ms ease-in; position: fixed; bottom: 0; &.entering, &.leaving { opacity: 0; transform: translate3d(0, 100%, 0); transition: transform 150ms ease-in 0ms, opacity 0ms ease 150ms; } } /* Tablet/Desktop animation is a fade in */ @media (min-width: 441px) { opacity: 1; transition: opacity 100ms ease-in; &.entering, &.leaving { opacity: 0; transition-delay: 5ms; } margin: auto; width: 360px; box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15); border-radius: var(--privy-border-radius-lg); } `,uE=A.ZP.div` display: flex; flex-direction: column; align-items: center; justify-content: center; height: 100%; `,uA={LANDING:()=>{let{app:e}=ny();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,m.jsx)(c3,{connectOnly:!1}):(0,m.jsx)(c7,{connectOnly:!1})},CONNECT_OR_CREATE:()=>{let{app:e}=ny();return e.loginMethodsAndOrder&&e.loginMethodsAndOrder.primary.length>0?(0,m.jsx)(c3,{connectOnly:!0}):(0,m.jsx)(c7,{connectOnly:!0})},AWAITING_PASSWORDLESS_CODE:()=>{let{app:e,navigate:t,lastScreen:r,navigateBack:n,setModalData:i,onUserCloseViaDialogOrKeybindRef:a}=ny(),{closePrivyModal:l,resendEmailCode:c,resendSmsCode:d,getAuthMeta:h,loginWithCode:u,updateWallets:p,createAnalyticsEvent:g}=nZ(),{authenticated:f,logout:y,user:w}=n$(),[x,v]=(0,o.useState)(ad),[C,b]=(0,o.useState)(!1),[_,j]=(0,o.useState)(null),[k,E]=(0,o.useState)(null),[A,S]=(0,o.useState)(0);a.current=()=>null;let T=h()?.email?0:1;(0,o.useEffect)(()=>{if(A){let e=setTimeout(()=>{S(A-1)},1e3);return()=>clearTimeout(e)}},[A]),(0,o.useEffect)(()=>{if(f&&C&&w){if(e?.legal.requireUsersAcceptTerms&&!w.hasAcceptedTerms){let e=setTimeout(()=>{t("AFFIRMATIVE_CONSENT_SCREEN")},900);return()=>clearTimeout(e)}if(rk(w,e?.embeddedWallets?.createOnLogin)){let e=setTimeout(()=>{i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AwaitingPasswordlessCodeScreen"}}),y()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},900);return()=>clearTimeout(e)}{p();let e=setTimeout(()=>l({shouldCallAuthOnSuccess:!0,isSuccess:!0}),1400);return()=>clearTimeout(e)}}},[f,C,w]),(0,o.useEffect)(()=>{if(_&&0===k){let e=setTimeout(()=>{v(ad),j(null),document.querySelector("input[name=code-0]")?.focus()},1400);return()=>clearTimeout(e)}},[_]);let P=e=>{e.preventDefault();let n=e.currentTarget.value.replace(" ","");if(""===n)return;if(isNaN(Number(n))){j("Code should be numeric"),E(1);return}j(null),E(null);let a=Number(e.currentTarget.name?.charAt(5)),o=[...n||[""]].slice(0,6-a),s=[...x.slice(0,a),...o,...x.slice(a+o.length)];v(s);let l=Math.min(Math.max(a+o.length,0),5);isNaN(Number(e.currentTarget.value))||document.querySelector(`input[name=code-${l}]`)?.focus(),s.every(e=>e&&!isNaN(+e))&&(document.querySelector(`input[name=code-${l}]`)?.blur(),u(s.join("")).then(()=>b(!0)).catch(e=>{if(e?.status===422)j("Invalid or expired verification code");else if(e instanceof eG&&"cannot_link_more_of_type"===e.privyErrorCode)j(e.message);else if(e instanceof eG&&"max_accounts_reached"===e.privyErrorCode){console.error(new e3(e).toString()),t("USER_LIMIT_REACHED_SCREEN");return}else if(e instanceof eG&&"user_does_not_exist"===e.privyErrorCode){t("ACCOUNT_NOT_FOUND_SCREEN");return}else if(e instanceof eG&&"linked_to_another_user"===e.privyErrorCode){i({errorModalData:{error:e,previousScreen:r??"AWAITING_PASSWORDLESS_CODE"}}),t("ERROR_SCREEN",!1);return}else j("Issue verifying code");E(0)}))},N=e=>{1===k&&(j(null),E(null)),v([...x.slice(0,e),"",...x.slice(e+1)]),e>0&&document.querySelector(`input[name=code-${e-1}]`)?.focus()},R=0==T?(0,m.jsx)(O.Z,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"}):(0,m.jsx)(I.Z,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"}),W=0==T?(0,m.jsxs)("p",{children:["Please check ",(0,m.jsx)(ay,{children:h()?.email})," for an email from privy.io and enter your code below."]}):(0,m.jsxs)("p",{children:["Please check ",(0,m.jsx)(ay,{children:h()?.phoneNumber})," for a message from ",e?.name||"Privy"," and enter your code below."]});return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:()=>n()},"header"),(0,m.jsxs)(ah,{children:[(0,m.jsx)(as,{title:"Enter confirmation code",description:W,icon:R}),(0,m.jsxs)(i4,{children:[(0,m.jsxs)(au,{children:[(0,m.jsx)(ap,{fail:!!_,success:C,children:(0,m.jsx)("span",{children:_||(C?"Success!":"")})}),(0,m.jsx)("div",{children:x.map((e,t)=>(0,m.jsx)("input",{name:`code-${t}`,type:"text",value:x[t],onChange:P,onKeyUp:e=>{"Backspace"===e.key&&N(t)},inputMode:"numeric",autoFocus:0===t,pattern:"[0-9]",className:`${C?"success":""} ${_?"fail":""}`,autoComplete:s.tq?"one-time-code":"off"},t))})]}),(0,m.jsxs)(am,{children:[(0,m.jsxs)("span",{children:["Didn't get ",0==T?"an email":"a message","?"]}),A?(0,m.jsxs)(af,{children:[(0,m.jsx)(M.Z,{color:"var(--privy-color-foreground)",strokeWidth:1.33,height:"12px",width:"12px"}),(0,m.jsx)("span",{children:"Code sent"})]}):(0,m.jsx)(ag,{children:(0,m.jsx)("button",{onClick:async()=>{S(30),0==T?await c():await d()},children:"Resend code"})})]})]})]}),(0,m.jsx)(iP,{})]})},AWAITING_CONNECTION:()=>{let[e,t]=(0,o.useState)(!1),[r,n]=(0,o.useState)(!1),[i,a]=(0,o.useState)(void 0),{authenticated:l,logout:c}=n$(),{app:d,navigate:h,navigateBack:u,lastScreen:p,currentScreen:g,setModalData:f}=ny(),{getAuthFlow:y,walletConnectionStatus:w,closePrivyModal:x,initLoginWithWallet:v,loginWithWallet:C,updateWallets:b,createAnalyticsEvent:_}=nZ(),{walletConnectors:j}=n$(),[k,E]=(0,o.useState)(0),{user:A}=n$(),[S]=(0,o.useState)(A?.linkedAccounts.length||0),[T,P]=(0,o.useState)(""),[N,R]=(0,o.useState)(""),[M,O]=(0,o.useState)(!1),{hasTabbedAway:I}=function(){let[e,t]=(0,o.useState)(!1),r=(0,o.useCallback)(()=>{document.hidden&&t(!0)},[]);return(0,o.useEffect)(()=>(document.addEventListener("visibilitychange",r),()=>document.removeEventListener("visibilitychange",r)),[r]),{hasTabbedAway:e,reset:()=>t(!1)}}(),{enabled:W,token:L}=nF(),F=s.tq&&w?.connector?.connectorType==="wallet_connect_v2"||s.tq&&w?.connector?.connectorType==="coinbase_wallet"||s.tq&&w?.connector?.connectorType==="injected"&&w?.connector?.walletClientType==="phantom",U=w?.status==="connected",D=w?.status==="switching_to_supported_chain";(0,o.useEffect)(()=>{let e=y(),t=e instanceof rp?e:void 0;if(U&&!t&&(!W||L||l?v(w.connectedWallet,L).then(()=>{O(!0)}):(f({captchaModalData:{callback:e=>v(w.connectedWallet,e).then(()=>{O(!0)}),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),h("CAPTCHA_SCREEN",!1))),t&&F&&U&&!t.preparedMessage){t.buildSiweMessage();return}!t||F||!U||r||(async()=>{n(!0),a(void 0);try{w?.connector?.connectorType==="wallet_connect_v2"&&w?.connector?.walletClientType==="metamask"&&await tg(2500),await z()}catch(e){console.warn("Auto-prompted signature failed",e)}finally{n(!1)}})()},[k,U,M]),(0,o.useEffect)(()=>{if(A&&e){if(d?.legal.requireUsersAcceptTerms&&!A.hasAcceptedTerms){let e=setTimeout(()=>{h("AFFIRMATIVE_CONSENT_SCREEN")},900);return()=>clearTimeout(e)}if(rk(A,d?.embeddedWallets?.createOnLogin)){let e=setTimeout(()=>{f({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),_({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"ConnectionStatusScreen"}}),c()},callAuthOnSuccessOnClose:!0}}),h("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},900);return()=>clearTimeout(e)}b();let e=setTimeout(()=>x({shouldCallAuthOnSuccess:!0,isSuccess:!0}),1400);return()=>clearTimeout(e)}},[A,e]);let Z=e=>{if(e?.privyErrorCode==="allowlist_rejected"){h("ALLOWLIST_REJECTION_SCREEN");return}if(e?.privyErrorCode==="max_accounts_reached"){console.error(new e3(e).toString()),h("USER_LIMIT_REACHED_SCREEN");return}if(e?.privyErrorCode==="user_does_not_exist"){h("ACCOUNT_NOT_FOUND_SCREEN");return}a(aV(e))};async function z(){try{await C(),t(!0)}catch(e){Z(e)}finally{n(!1)}}(0,o.useEffect)(()=>{w?.connectError&&Z(w?.connectError)},[w]),aq(()=>{let e="wallet_connect_v2"===$&&w?.connector instanceof nx?w.connector.redirectUri:void 0;e&&P(e);let t="wallet_connect_v2"===$&&w?.connector instanceof nx?w.connector.fallbackUniversalRedirectUri:void 0;t&&R(t)},w?.connector instanceof nx&&!T?500:null);let $=w?.connector?.connectorType||"injected",H=w?.connector?.walletClientType||"unknown",B=aA[H]?.displayName||w?.connector?.walletBranding.name||"Browser Extension",q=aA[H]?.logo||w?.connector?.walletBranding.icon||(e=>(0,m.jsx)(rY,{...e})),V="Browser Extension"===B?B.toLowerCase():B,G;G=e?`Successfully connected with ${V}`:i?i.message:D?"Switching networks":U?r&&F?"Signing":"Sign to verify":`Waiting for ${V}`;let K="Don’t see your wallet? Check your other browser windows.";e?K=S===(A?.linkedAccounts.length||0)?"Wallet was already linked.":"You’re good to go!":k>=2&&i?K="Unable to connect wallet":i?K=i.detail:D?K="Switch your wallet to the requested network.":U&&F?K="Sign the message in your wallet to verify it belongs to you.":"metamask"===H&&s.tq?K="Click continue to open and connect MetaMask.":"metamask"===H?K="For the best experience, connect only one wallet at a time.":"wallet_connect"===$?K="Open your mobile wallet app to continue":"coinbase_wallet"===$&&(td()||(K=nv(A)?"Continue with the Coinbase app. Not the right wallet? Reset your connection below.":"Open the Coinbase app on your phone to continue."));let Y=j?.walletConnectors?.find(e=>"coinbase_wallet"===e.walletClientType),Q="coinbase_wallet"===H&&(nv(A)||i===rL.ERROR_USER_EXISTS);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:p&&g!==p?u:void 0}),(0,m.jsxs)(aG,{children:[(0,m.jsx)(aY,{walletLogo:q,success:e,fail:!!i}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:G}),(0,m.jsx)("p",{children:K}),U||!T||I?null:(0,m.jsxs)("p",{children:["Still here?"," ",(0,m.jsx)("a",{href:T,target:"_blank",style:{textDecoration:"underline"},children:"Try connecting again"}),N&&(0,m.jsxs)(m.Fragment,{children:[" ","or"," ",(0,m.jsx)("a",{href:N,target:"_blank",style:{textDecoration:"underline"},children:"use this different link"})]})]})]}),Q?(0,m.jsx)(n3,{onClick:()=>Y&&Y?.disconnect(),disabled:e,children:"Use a different wallet"}):i==rL.ERROR_USER_EXISTS&&g!==p?(0,m.jsx)(n3,{onClick:u,children:"Use a different wallet"}):U&&!e&&F?(0,m.jsx)(n3,{onClick:()=>{n(!0),z()},disabled:r,children:r?"Signing":"Sign with your wallet"}):!e&&i?.retryable&&k<2?(0,m.jsx)(n3,{onClick:()=>{E(k+1),a(void 0),U?(n(!0),z()):w?.connectRetry()},disabled:!e&&(!i?.retryable||k>=2),children:"Retry"}):e||i?null:(0,m.jsx)(n3,{onClick:()=>{},disabled:!0,children:"Connecting"})]}),(0,m.jsx)(iN,{})]})},AWAITING_CONNECT_ONLY_CONNECTION:()=>{let{navigateBack:e,navigate:t,lastScreen:r,currentScreen:n,data:i}=ny(),{walletConnectionStatus:a,closePrivyModal:l}=nZ(),[c,d]=(0,o.useState)(void 0),[h,u]=(0,o.useState)(0),p=a?.status==="connected",g=a?.status==="switching_to_supported_chain";(0,o.useEffect)(()=>{if(p){let e;if(i?.externalConnectWallet?.onCompleteNavigateTo){let r=i.externalConnectWallet.onCompleteNavigateTo;e=setTimeout(()=>{t(r)},1400)}else e=setTimeout(l,1400);return()=>clearTimeout(e)}},[p]);let f=e=>{d(aV(e))};(0,o.useEffect)(()=>{a?.connectError&&f(a?.connectError)},[a]);let y=a?.connector?.connectorType||"injected",w=a?.connector?.walletClientType||"unknown",x=aA[w]?.displayName||a?.connector?.walletBranding.name||"Browser Extension",v=aA[w]?.logo||a?.connector?.walletBranding.icon||(e=>(0,m.jsx)(rY,{...e})),C="Browser Extension"===x?x.toLowerCase():x,b;b=p?`Successfully connected with ${C}`:c?c.message:g?"Switching networks":`Waiting for ${C}`;let _="Don’t see your wallet? Check your other browser windows.";return p?_="You’re good to go!":h>=2&&c?_="Unable to connect wallet":c?_=c.detail:g?_="Switch your wallet to the requested network.":"metamask"===w&&s.tq?_="Click to continue to open and connect MetaMask.":"metamask"===w?_="For the best experience, connect only one wallet at a time.":"wallet_connect_v2"===y?_="Open your mobile wallet app to continue":"coinbase_wallet"===y&&(_="Open the Coinbase app on your phone to continue."),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:n===r?void 0:e}),(0,m.jsxs)(aQ,{children:[(0,m.jsx)(aY,{walletLogo:v,success:p,fail:!!c}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:b}),(0,m.jsx)("p",{children:_})]}),c==rL.ERROR_USER_EXISTS?(0,m.jsx)(n3,{onClick:e,children:"Use a different wallet"}):!p&&c?.retryable&&h<2?(0,m.jsx)(n3,{onClick:()=>{u(h+1),d(void 0),a?.connectRetry()},disabled:!p&&(!c?.retryable||h>=2),children:"Retry"}):!p&&c&&h>=2?(0,m.jsx)(n3,{onClick:e,children:"Use a different wallet"}):null]}),(0,m.jsx)(iN,{})]})},AWAITING_FARCASTER_CONNECTION:()=>{let{authenticated:e,logout:t,ready:r,user:n}=n$(),{lastScreen:i,navigate:a,navigateBack:l,setModalData:c,app:d}=ny(),{getAuthFlow:h,loginWithFarcaster:u,closePrivyModal:p,createAnalyticsEvent:g}=nZ(),[f,y]=(0,o.useState)(void 0),[w,x]=(0,o.useState)(!1),[v,C]=(0,o.useState)(!1),b=(0,o.useRef)([]),_=h(),j=_?.meta.connectUri;return(0,o.useEffect)(()=>{let e=Date.now(),t=setInterval(async()=>{let r=await _.pollForReady.execute(),n=Date.now()-e;if(r){clearInterval(t),x(!0);try{await u(),C(!0)}catch(t){let e={retryable:!1,message:"Authentication failed"};if(t?.privyErrorCode==="allowlist_rejected"){a("ALLOWLIST_REJECTION_SCREEN");return}if(t?.privyErrorCode==="max_accounts_reached"){console.error(new e3(t).toString()),a("USER_LIMIT_REACHED_SCREEN");return}if(t?.privyErrorCode==="user_does_not_exist"){a("ACCOUNT_NOT_FOUND_SCREEN");return}t?.privyErrorCode==="linked_to_another_user"?e.detail="This account has already been linked to another user.":t?.privyErrorCode==="invalid_credentials"?(e.retryable=!0,e.detail="Something went wrong. Try again."):t?.privyErrorCode==="too_many_requests"&&(e.detail="Too many requests. Please wait before trying again.");y(e)}}else n>12e4&&(clearInterval(t),y({retryable:!0,message:"Authentication failed",detail:"The request timed out. Try again."}))},2e3);return()=>{clearInterval(t),b.current.forEach(e=>clearTimeout(e))}},[]),(0,o.useEffect)(()=>{if(r&&e&&v&&n){if(d?.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let e=setTimeout(()=>{a("AFFIRMATIVE_CONSENT_SCREEN")},1400);return()=>clearTimeout(e)}v&&(rk(n,d?.embeddedWallets.createOnLogin)?b.current.push(setTimeout(()=>{c({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"FarcasterConnectStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},1400)):b.current.push(setTimeout(()=>p({shouldCallAuthOnSuccess:!0,isSuccess:!0}),1400)))}},[v,r,e,n]),s.tq||w?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:i?l:void 0,onClose:p},"header"),(0,m.jsx)(ae,{}),s.gn?(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(sE,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:v,fail:!!f}),(0,m.jsx)(s_,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)(iM,{children:f?f.message:"Sign in with Farcaster"}),(0,m.jsx)(iO,{children:f?f.detail:"To sign in with Farcaster, please open the Warpcast app."})]}),j&&(0,m.jsx)(n3,{onClick:e=>{e.preventDefault(),window.location.href=j},children:"Open Warpcast app"})]})}):(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(sk,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:v,fail:!!f}),(0,m.jsx)(s_,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)(iM,{children:f?f.message:"Signing in with Farcaster"}),(0,m.jsx)(iO,{children:f?f.detail:"This should only take a moment"}),(0,m.jsx)(i3,{children:j&&s.tq&&(0,m.jsx)(sh,{text:"Take me to Warpcast",url:j,color:sj})})]})]})}),(0,m.jsx)(iN,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:i?l:void 0,onClose:p},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(sk,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(iM,{children:"Sign in with Farcaster"}),(0,m.jsx)(iO,{children:"Scan with your phone's camera to continue."}),(0,m.jsx)(i5,{children:j?(0,m.jsx)(sb,{url:j,size:275,squareLogoElement:s_}):(0,m.jsx)(nX,{})}),(0,m.jsxs)(i3,{children:[(0,m.jsx)(iO,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),j&&(0,m.jsx)(sc,{text:j,itemName:"link",color:sj})]})]})}),(0,m.jsx)(iN,{})]})},AWAITING_FARCASTER_SIGNER:()=>{let{lastScreen:e,navigateBack:t,data:r,app:n}=ny(),{requestFarcasterSignerStatus:i,closePrivyModal:a}=nZ(),[l,c]=(0,o.useState)(void 0),[d,h]=(0,o.useState)(!1),[u,p]=(0,o.useState)(!1),g=(0,o.useRef)([]),f=r?.farcasterSigner;(0,o.useEffect)(()=>{let e=Date.now(),t=setInterval(async()=>{if(!f?.public_key){clearInterval(t),c({retryable:!0,message:"Connect failed",detail:"Something went wrong. Please try again."});return}"approved"===f.status&&(clearInterval(t),h(!1),p(!0),g.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),1400)));let r=await i(f?.public_key),n=Date.now()-e;"approved"===r.status?(clearInterval(t),h(!1),p(!0),g.current.push(setTimeout(()=>a({shouldCallAuthOnSuccess:!1,isSuccess:!0}),1400))):n>3e5?(clearInterval(t),c({retryable:!0,message:"Connect failed",detail:"The request timed out. Try again."})):"revoked"===r.status&&(clearInterval(t),c({retryable:!0,message:"Request rejected",detail:"The request was rejected. Please try again."}))},2e3);return()=>{clearInterval(t),g.current.forEach(e=>clearTimeout(e))}},[]);let y=f?.status==="pending_approval"?f.signer_approval_url:void 0;return s.tq||d?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:e?t:void 0,onClose:a},"header"),(0,m.jsx)(ae,{}),s.gn?(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(sT,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:u,fail:!!l}),(0,m.jsx)(s_,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)(iM,{children:l?l.message:"Add a signer to Farcaster"}),(0,m.jsx)(iO,{children:l?l.detail:"This will allow "+n.name+" to add casts, likes, follows, and more on your behalf."})]}),y&&(0,m.jsx)(n3,{onClick:e=>{e.preventDefault(),window.location.href=y},children:"Open Warpcast app"})]})}):(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(sS,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:u,fail:!!l}),(0,m.jsx)(s_,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)(iM,{children:l?l.message:"Requesting signer from Farcaster"}),(0,m.jsx)(iO,{children:l?l.detail:"This should only take a moment"}),(0,m.jsx)(i3,{children:y&&s.tq&&(0,m.jsx)(sh,{text:"Take me to Warpcast",url:y,color:sA})})]})]})}),(0,m.jsx)(iN,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:e?t:void 0,onClose:a},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(sS,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(iM,{children:"Add a signer to Farcaster"}),(0,m.jsxs)(iO,{children:["This will allow ",n.name," to add casts, likes, follows, and more on your behalf."]}),(0,m.jsx)(i5,{children:f?.status==="pending_approval"?(0,m.jsx)(sb,{url:f.signer_approval_url,size:275,squareLogoElement:s_}):(0,m.jsx)(nX,{})}),(0,m.jsxs)(i3,{children:[(0,m.jsx)(iO,{children:"Or copy this link and paste it into a phone browser to open the Warpcast app."}),f?.status==="pending_approval"&&(0,m.jsx)(sc,{text:f.signer_approval_url,itemName:"link",color:sA})]})]})}),(0,m.jsx)(iN,{})]})},AWAITING_PASSKEY_SYSTEM_DIALOGUE:()=>{let{lastScreen:e,currentScreen:t,navigateBack:r}=ny(),{loginWithPasskey:n,closePrivyModal:i}=nZ(),[a,s]=(0,o.useState)("loading"),[l,c]=(0,o.useState)(null),d=(0,o.useRef)([]),h=e=>{d.current=[e,...d.current]};(0,o.useEffect)(()=>()=>{d.current.forEach(e=>clearTimeout(e)),d.current=[]},[]);let u=async()=>{s("loading");try{await n(),s("success")}catch(e){c(e),s("error")}};return(0,o.useEffect)(()=>{"success"===a&&h(setTimeout(()=>{i({shouldCallAuthOnSuccess:!0,isSuccess:!0})},1400))},[a]),(0,o.useEffect)(()=>{u()},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:e&&t!==e?r:void 0}),(0,m.jsxs)(ha,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:"success"===a,fail:"error"===a}),(0,m.jsx)(lu,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:(()=>{switch(a){case"loading":return"Waiting for passkey";case"success":return"Success";case"error":return"Something went wrong"}})()}),(0,m.jsx)("p",{style:{whiteSpace:"pre-wrap"},children:(()=>{switch(a){case"loading":return`Please follow prompts to verify your passkey. You will have to sign up with another method first to register a passkey for your account.`;case"success":return"You've successfully logged in with your passkey.";case"error":if(l instanceof eV){if("cannot_link_more_of_type"===l.privyErrorCode)return"Cannot link more passkeys to account.";if("passkey_not_allowed"===l.privyErrorCode)return`Passkey request timed out or rejected by user. You will have to sign up with another method first to register a passkey for your account.`}return`An unknown error occurred. You will have to sign up with another method first to register a passkey for your account.`}})()})]}),(()=>{switch(a){case"loading":case"success":return(0,m.jsx)(n3,{onClick:()=>{},disabled:!0,children:"Continue"});case"error":return(0,m.jsx)(n3,{onClick:u,disabled:!1,children:"Retry"})}})()]}),(0,m.jsx)(iN,{})]})},PHANTOM_INTERSTITIAL_SCREEN:()=>{let{forkSession:e,ready:t,authenticated:r}=n$(),[n,i]=(0,o.useState)(""),[a,s]=(0,o.useState)(!1);(0,o.useEffect)(()=>{t&&r&&e().then(i)},[t,r]);let l=ho(n,!a),c={title:"Redirecting to Phantom Mobile Wallet",description:"We'll take you to the Phantom Mobile Wallet app to continue your login experience.",footnote:""};return t&&(c.description="For the best experience, we'll automatically log you into the Phantom Mobile Wallet in-app browser.",c.footnote="Once you're done, you can always return here and refresh to view your updated account."),a&&(c.title="Still here?",c.description="You may need to install the Phantom mobile app.",c.footnote="Once you're done, you can return here or connect via Phantom's in-app browser."),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(ao,{title:c.title,description:c.description}),(0,m.jsxs)(i2,{children:[(0,m.jsx)(hs,{children:(0,m.jsx)(rX,{style:{width:"72px",height:"72px"}})}),(0,m.jsx)(n6,{href:l,onClick:()=>{setTimeout(()=>s(!0),1e3)},loading:t&&!l,children:a?"Go to App Store":"Continue"}),c.footnote?(0,m.jsx)("p",{children:c.footnote}):null]}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},LOGIN_FAILED_SCREEN:()=>{let{closePrivyModal:e}=nZ(),{navigate:t}=ny();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(dn,{style:{width:"160px",height:"160px",margin:"0 auto 20px"}}),(0,m.jsx)(ao,{title:"Could not connect with wallet",description:"Please check that Phantom multichain is enabled and try again.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,m.jsxs)(i2,{children:[(0,m.jsx)(n3,{onClick:()=>t("LANDING"),children:"Try again"}),(0,m.jsx)(n8,{onClick:()=>e(),children:"Cancel"})]}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},AWAITING_OAUTH_SCREEN:()=>{let{authenticated:e,logout:t,ready:r,user:n}=n$(),{app:i,setModalData:a,navigate:s,resetNavigation:l}=ny(),{getAuthMeta:c,initLoginWithOAuth:d,loginWithOAuth:h,updateWallets:u,setReadyToTrue:p,closePrivyModal:g,createAnalyticsEvent:f}=nZ(),[y,w]=(0,o.useState)(!1),[x,v]=(0,o.useState)(void 0),C=c()?.provider||"google",{name:b,component:_}=rc(C),j=nY();(0,o.useEffect)(()=>{h(C).then(e=>{w(!0),p(!0),e&&j("login","onOAuthLoginComplete",e)}).catch(e=>{if(p(!1),e?.privyErrorCode==="allowlist_rejected"){v(void 0),l(),s("ALLOWLIST_REJECTION_SCREEN");return}if(e?.privyErrorCode==="max_accounts_reached"){console.error(new e3(e).toString()),v(void 0),l(),s("USER_LIMIT_REACHED_SCREEN");return}if(e?.privyErrorCode==="user_does_not_exist"){v(void 0),l(),s("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:t,detail:r}=function(e,t){let r={detail:"",retryable:!1},n=t.charAt(0).toUpperCase()+t.slice(1);if(e?.privyErrorCode==="linked_to_another_user"&&(r.detail="This account has already been linked to another user."),e?.privyErrorCode==="invalid_credentials"&&(r.retryable=!0,r.detail="Something went wrong. Try again."),"oauth_user_denied"===e.privyErrorCode&&(r.detail=`Retry and check ${n} to finish connecting your account.`,r.retryable=!0),e?.privyErrorCode==="too_many_requests"&&(r.detail="Too many requests. Please wait before trying again."),e?.privyErrorCode==="too_many_requests"&&e.message.includes("provider rate limit")){let e=rc(t).name;r.detail=`Request limit reached for ${e}. Please wait a moment and try again.`}if(e?.privyErrorCode==="oauth_account_suspended"){let e=rc(t).name;r.detail=`Your ${e} account is suspended. Please try another login method.`}return e?.privyErrorCode==="cannot_link_more_of_type"&&(r.detail="You cannot authorize more than one account for this user."),e?.privyErrorCode==="oauth_unexpected"&&t.startsWith("privy:")&&(r.detail="Something went wrong. Please try again."),r}(e,C);v({retryable:t,detail:r,message:"Authentication failed"})}).finally(()=>{rd()})},[b,C]),(0,o.useEffect)(()=>{if(r&&e&&y&&n){if(i?.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let e=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},1400);return()=>clearTimeout(e)}if(rk(n,i?.embeddedWallets?.createOnLogin)){let e=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),f({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:C,screen:"OAuthStatusScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},1400);return()=>clearTimeout(e)}{let e=setTimeout(()=>g({shouldCallAuthOnSuccess:!0,isSuccess:!0}),1400);return u(),()=>clearTimeout(e)}}},[r,e,y,n]);let k=y?`Successfully connected with ${b}`:x?x.message:`Verifying connection to ${b}`,E="";return E=y?"You’re good to go!":x?x.detail:"Just a few moments more",(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{}),(0,m.jsx)(ae,{}),(0,m.jsxs)(hi,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:y,fail:!!x}),(0,m.jsx)(_,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:k}),(0,m.jsx)("p",{children:E})]}),x&&x?.retryable?(0,m.jsx)(ie,{onClick:()=>{rd(),d(C),v(void 0)},disabled:!y&&!x?.retryable,children:"Retry"}):null]}),(0,m.jsx)(at,{}),(0,m.jsx)(iN,{})]})},CROSS_APP_AUTH_SCREEN:()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t}=ny(),{crossAppAuthFlow:r,updateWallets:n,closePrivyModal:i}=nZ(),[a,s]=(0,o.useState)({}),l={id:e?.crossAppAuth?.appId??"",name:e?.crossAppAuth?.name??"app",logoUrl:e?.crossAppAuth?.logoUrl},c=new eK(`There was an issue connecting your ${l.name} account. Please try again.`),d=new tI(async t=>{if(!e?.crossAppAuth?.popup){s({error:c});return}try{let n=await r({appId:t,popup:e.crossAppAuth.popup});s({data:n})}catch(t){t instanceof eK?s({error:t}):(t instanceof eG&&e?.crossAppAuth?.popup&&e.crossAppAuth.popup.close(),s({error:c}))}}),h=()=>{a.data&&(n(),e?.crossAppAuth?.onSuccess(a.data),i({shouldCallAuthOnSuccess:!0,isSuccess:!0})),e?.crossAppAuth?.onError(a.error??new eK("User canceled flow")),i({shouldCallAuthOnSuccess:!1,isSuccess:!1})};t.current=h,(0,o.useEffect)(()=>{l.id.length&&d.execute(l.id)},[l.id]),(0,o.useEffect)(()=>{if(!a.data)return;let e=setTimeout(h,1400);return()=>clearTimeout(e)},[a.data]);let{title:u,subtitle:p}=(0,o.useMemo)(()=>a.data?{title:`Successfully connected with ${l.name}`,subtitle:"You're good to go!"}:a.error?{title:"Authentication failed",subtitle:a.error.message}:{title:`Connecting to ${l.name}`,subtitle:`Please check the pop-up from ${l.name} to continue`},[a,l.name]);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:h}),(0,m.jsx)(ae,{}),(0,m.jsxs)(aJ,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:!!a.data,fail:!!a.error}),(0,m.jsx)(aX,{name:l.name,logoUrl:l.logoUrl})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:u}),(0,m.jsx)("p",{children:p})]})]}),(0,m.jsx)(at,{}),(0,m.jsx)(iN,{})]})},ALLOWLIST_REJECTION_SCREEN:()=>{let{navigate:e,app:t}=ny(),r=t?.allowlistConfig.errorTitle||"You don't have access to this app",n=t?.allowlistConfig.errorDetail||"Have you been invited?",i=t?.allowlistConfig.errorCtaText||"Try another account";return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{}),(0,m.jsxs)(i0,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(iX,{}),(0,m.jsx)(iJ,{style:{width:"38px",height:"38px",strokeWidth:"1",stroke:"var(--privy-color-accent)",fill:"var(--privy-color-accent)"}})]})}),(0,m.jsxs)(i1,{children:["string"==typeof r?(0,m.jsx)("h3",{children:r}):(0,m.jsx)(m.Fragment,{children:r}),"string"==typeof n?(0,m.jsx)("p",{children:n}):(0,m.jsx)(m.Fragment,{children:n})]}),t?.allowlistConfig.errorCtaLink?(0,m.jsx)(n3,{as:"a",href:t.allowlistConfig.errorCtaLink,children:i}):(0,m.jsx)(n3,{onClick:()=>{e("LANDING")},children:i})]})]})},ACCOUNT_NOT_FOUND_SCREEN:()=>{let{navigate:e,app:t}=ny();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{}),(0,m.jsxs)(iE,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(ii,{color:"var(--privy-color-warn-light)"}),(0,m.jsx)(S.Z,{height:38,width:38,strokeWidth:2,stroke:"var(--privy-color-warn)"})]})}),(0,m.jsxs)(iA,{children:[(0,m.jsx)("h3",{children:"Account not found"}),(0,m.jsxs)("p",{children:["Please try logging in again or go to ",t.name," to create an account."]})]}),(0,m.jsx)(iy,{}),(0,m.jsx)(n3,{onClick:()=>e("LANDING"),children:"Try logging in again"})]})]})},USER_LIMIT_REACHED_SCREEN:()=>{let{navigate:e}=ny();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{}),(0,m.jsxs)(ug,{children:[(0,m.jsx)(uf,{children:(0,m.jsx)(um,{})}),(0,m.jsxs)(uy,{children:[(0,m.jsx)("h3",{children:"Unable to sign in"}),(0,m.jsx)("p",{children:"This application has reached its user limit and cannot sign in new users."})]}),(0,m.jsx)(n3,{onClick:()=>{e("LANDING")},children:"Go back"})]}),(0,m.jsx)(iP,{})]})},INSTALL_PHANTOM_SCREEN:()=>{let{navigateBack:e}=ny();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:e},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(cE,{}),(0,m.jsx)(at,{}),(0,m.jsxs)(iN,{children:[(0,m.jsx)("span",{children:"Still not sure? "}),(0,m.jsx)("a",{target:"_blank",href:"https://ethereum.org/en/wallets/",children:"Learn more"})]})]})},LINK_EMAIL_SCREEN:()=>{let{app:e}=ny();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(as,{title:"Connect your email",description:`Add your email to your ${e?.name} account`,icon:(0,m.jsx)(O.Z,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,m.jsx)(i2,{children:(0,m.jsx)(cM,{stacked:!0})}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},LINK_PHONE_SCREEN:()=>{let{app:e,currentScreen:t,data:r,navigate:n,setModalData:i}=ny(),{initLoginWithSms:a}=nZ();async function o({qualifiedPhoneNumber:e}){try{await a(e),n("AWAITING_PASSWORDLESS_CODE")}catch(e){i({errorModalData:{error:e,previousScreen:r?.errorModalData?.previousScreen||t||"LINK_PHONE_SCREEN"}}),n("ERROR_SCREEN")}}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(as,{title:"Connect your phone",description:`Add your number to your ${e?.name} account`,icon:(0,m.jsx)(I.Z,{color:"var(--privy-color-accent)",strokeWidth:2,height:"40px",width:"40px"})}),(0,m.jsx)(i2,{children:(0,m.jsx)(cq,{stacked:!0,onSubmit:o,hideRecent:!0})}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},LINK_WALLET_SCREEN:()=>{let{linkingOrConnectingHint:e}=nZ(),{app:t}=ny(),r=e?`Link the wallet with address ${tm(e)} ${t?.name?`to ${t.name}.`:"."}`:`Link a wallet to your ${t?.name} account`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ao,{title:"Link your wallet",description:r}),(0,m.jsx)(ix,{children:(0,m.jsx)(aH,{connectOnly:!1})}),(0,m.jsx)(iP,{})]})},LINK_PASSKEY_SCREEN:()=>{let{user:e,unlinkPasskey:t}=n$(),{linkWithPasskey:r,closePrivyModal:n}=nZ(),i=e?.linkedAccounts.filter(e=>"passkey"===e.type),[a,s]=(0,o.useState)(!1),[l,c]=(0,o.useState)(""),[d,h]=(0,o.useState)(!1),[u,p]=(0,o.useState)(!1);(0,o.useEffect)(()=>{0===i.length&&p(!1)},[i.length]);let g=async e=>(s(!0),await t(e).then(()=>h(!0)).catch(e=>{if(e instanceof eV&&"missing_or_invalid_mfa"===e.privyErrorCode){c("Cannot unlink a passkey enrolled in MFA");return}c("Unknown error occurred.")}).finally(()=>{s(!1)}));return d?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:()=>n()},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{status:"success",children:(0,m.jsx)(W.Z,{})})}),(0,m.jsx)(lv,{children:"Passkey added"}),(0,m.jsx)(lC,{children:"From now on, you can use your passkey to log in."}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{onClick:()=>n(),children:"Done"})}),(0,m.jsx)(iN,{})]}):u?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:()=>p(!1),onClose:()=>n()},"header"),(0,m.jsx)(lp,{passkeys:i,expanded:u,onUnlink:g,onExpand:()=>p(!0)}),(0,m.jsx)(iN,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:()=>n()},"header"),(0,m.jsx)(iR,{children:(0,m.jsxs)(lg,{children:[(0,m.jsx)(lh,{}),(0,m.jsx)(lu,{})]})}),(0,m.jsx)(lv,{children:"Secure your account with a passkey"}),(0,m.jsx)(lb,{}),0===i.length?(0,m.jsx)(lm,{}):(0,m.jsx)(lp,{passkeys:i,expanded:u,onUnlink:g,onExpand:()=>p(!0)}),(0,m.jsxs)(iU,{style:{marginTop:"12px"},children:[l&&(0,m.jsx)(lf,{fail:!0,children:l}),(0,m.jsx)(n3,{onClick:()=>{s(!0),r().then(()=>h(!0)).catch(e=>{if(e instanceof eV){if("cannot_link_more_of_type"===e.privyErrorCode){c("Cannot link more passkeys to account.");return}if("passkey_not_allowed"===e.privyErrorCode){c("Passkey request timed out or rejected by user.");return}}c("Unknown error occurred.")}).finally(()=>{s(!1)})},loading:a,children:"Add new passkey"})]}),(0,m.jsx)(iN,{})]})},UPDATE_EMAIL_SCREEN:()=>(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(as,{title:"Update your email",description:"Add the email address you'd like to use going forward. We'll send you a confirmation code",icon:(0,m.jsx)(O.Z,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,m.jsx)(i2,{children:(0,m.jsx)(uh,{stacked:!0})}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]}),UPDATE_PHONE_SCREEN:()=>{let{currentScreen:e,data:t,navigate:r,setModalData:n}=ny(),{user:i}=n$(),{initUpdatePhone:a}=nZ();async function o({qualifiedPhoneNumber:o}){try{if(!i?.phone?.number)throw Error("User is required to have an phone number to update it.");await a(i?.phone?.number,o),r("AWAITING_PASSWORDLESS_CODE")}catch(i){n({errorModalData:{error:i,previousScreen:t?.errorModalData?.previousScreen||e||"LINK_PHONE_SCREEN"}}),r("ERROR_SCREEN")}}return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ae,{}),(0,m.jsx)(as,{title:"Update your phone number",description:"Add the phone number you'd like to use going forward. We'll send you a confirmation code",icon:(0,m.jsx)(I.Z,{color:"var(--privy-color-accent)",strokeWidth:2,height:"48px",width:"48px"})}),(0,m.jsx)(i2,{children:(0,m.jsx)(cq,{stacked:!0,onSubmit:o,hideRecent:!0})}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},CONNECT_ONLY_LANDING_SCREEN:()=>{let{app:e}=ny(),{linkingOrConnectingHint:t}=nZ(),r=t?`Connect the wallet with address ${tm(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(aa,{title:"Connect your wallet",description:r}),(0,m.jsx)(ix,{children:(0,m.jsx)(aH,{connectOnly:!0})}),e&&(0,m.jsx)(iT,{app:e,alwaysShowImplicitConsent:!0}),(0,m.jsx)(iP,{})]})},CONNECT_ONLY_AUTHENTICATED_SCREEN:()=>{let{app:e}=ny(),{linkingOrConnectingHint:t}=nZ(),r=t?`Connect the wallet with address ${tm(t)} ${e?.name?`to ${e.name}.`:"."}`:`Connect a wallet to ${e?.name}`;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(ao,{title:"Connect your wallet",description:r}),(0,m.jsx)(ix,{children:(0,m.jsx)(aH,{connectOnly:!0})}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN:()=>{let{app:e,setModalData:t,navigate:r,data:n,onUserCloseViaDialogOrKeybindRef:i}=ny(),[a,s]=(0,o.useState)(""),{embeddedWallets:l}=nh(),{authenticated:c}=n$(),{closePrivyModal:d}=nZ(),{onSuccess:h,onFailure:u,callAuthOnSuccessOnClose:p}=n.createWallet,g=e?.embeddedWallets.requireUserOwnedRecoveryOnCreate===!0,{createWallet:f}=oC(),[y,w]=(0,o.useState)(null),x=new tI(async()=>{try{let e=await f();if(!e)return;w(e),r("EMBEDDED_WALLET_CREATED_SCREEN")}catch(e){s(e.message)}});return(0,o.useEffect)(()=>{if(!c){r("LANDING"),u(Error("User must be authenticated before creating a Privy wallet"));return}if(g)return t({...n,recoverySelection:{...n?.recoverySelection,isInAccountCreateFlow:!0}}),r(oi({walletAction:"create",showAutomaticRecovery:!1,availableRecoveryMethods:l.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:!1}));x.execute()},[g,c]),i.current=()=>null,a?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{closeable:!1}),(0,m.jsxs)(i6,{children:[(0,m.jsx)(L.Z,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,m.jsx)(as,{title:"Something went wrong",description:a})]}),(0,m.jsx)(n3,{onClick:()=>{y?(h(y),d({shouldCallAuthOnSuccess:p})):(u(new e1("User wallet creation failed")),d({shouldCallAuthOnSuccess:!1}))},children:"Close"}),(0,m.jsx)(ob,{})]}):(0,m.jsx)(a0,{})},EMBEDDED_WALLET_CREATED_SCREEN:()=>{let{user:e}=n$(),{closePrivyModal:t,isNewUserThisSession:r,updateWallets:n}=nZ(),{app:i,data:a,onUserCloseViaDialogOrKeybindRef:s}=ny(),{onSuccess:l,onFailure:c,callAuthOnSuccessOnClose:d}=a.createWallet,h=()=>{let r=rC(e);r?(n(),l(r)):c(Error("Failed to create wallet")),t({shouldCallAuthOnSuccess:d})};return(0,o.useEffect)(()=>{let e=setTimeout(h,2500);return()=>clearTimeout(e)},[]),s.current=h,(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:h}),(0,m.jsx)(ae,{}),(0,m.jsxs)(i6,{children:[(0,m.jsx)(W.Z,{fill:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,m.jsx)(as,{title:r?`Welcome${i?.name?` to ${i?.name}`:""}`:"All set!",description:r?"You’ve successfully created an account.":"Your account is secured."})]}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_CONNECTING_SCREEN:()=>{let{authenticated:e,user:t,getAccessToken:r}=n$(),{closePrivyModal:n,createAnalyticsEvent:i,walletProxy:a}=nZ(),{navigate:s,data:l,setModalData:c,onUserCloseViaDialogOrKeybindRef:d}=ny(),h=(0,o.useMemo)(()=>Date.now(),[]),[u,p]=(0,o.useState)(!1),{onCompleteNavigateTo:g,onFailure:f,shouldForceMFA:y,address:w}=l?.connectWallet,x=e=>{u||(p(!0),f("string"==typeof e?Error(e):e))};(0,o.useEffect)(()=>{let o=w?t?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&e.address===w):rC(t),d;return e&&o?a?((async()=>{let e=await r();if(!e)return x("User must be authenticated and have a Privy wallet before it can be connected");try{await a.connect({accessToken:e,address:o.address}),y&&await a.verifyMfa({accessToken:e});let t=(Date.now()-h)/1e3;"EMBEDDED_WALLET_KEY_EXPORT_SCREEN"===g&&t<1?d=setTimeout(()=>{s(g,!1)},(1-t)*1e3):s(g,!1)}catch(e){if(a8(e)&&"privy"===o.recoveryMethod){let e=await r();if(!e)return x("User must be authenticated and have a Privy wallet before it can be recovered");try{i({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:o.address}}),(await a?.recover({address:o.address,accessToken:e,recoveryMethod:o.recoveryMethod}))?.address||x(Error("Unable to recover wallet")),g?s(g):n({shouldCallAuthOnSuccess:!1}),i({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:o.address}}),s(g)}catch{x("An error has occurred, please try again.")}}else a8(e)&&"privy"!==o.recoveryMethod?(c({...l,recoverWallet:{privyWallet:o,onCompleteNavigateTo:g,onFailure:f},recoveryOAuthStatus:{provider:o.recoveryMethod,action:"recover",isInAccountCreateFlow:!1}}),s(oa(o.recoveryMethod))):x(e)}})(),()=>clearTimeout(d)):void 0:x("User must be authenticated and have a Privy wallet before it can be connected")},[e,t,a]);let v=()=>{x("User exited before wallet could be connected"),n({shouldCallAuthOnSuccess:!1})};return d.current=v,(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:v}),u?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsxs)(i6,{children:[(0,m.jsx)(L.Z,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}),(0,m.jsx)(as,{title:"Something went wrong",description:"We’re on it. Please try again later."})]}),(0,m.jsx)(n3,{onClick:()=>n({shouldCallAuthOnSuccess:!1}),children:"Close"})]}):(0,m.jsx)(a0,{}),(0,m.jsx)(ol,{})]})},EMBEDDED_WALLET_PASSWORD_RECOVERY_SCREEN:()=>{let[e,t]=(0,o.useState)(!0),{authenticated:r,getAccessToken:n}=n$(),{walletProxy:i,closePrivyModal:a,createAnalyticsEvent:s}=nZ(),{navigate:l,data:c,onUserCloseViaDialogOrKeybindRef:d}=ny(),[h,u]=(0,o.useState)(void 0),[p,g]=(0,o.useState)(""),[f,y]=(0,o.useState)(!1),{privyWallet:w,onCompleteNavigateTo:x,onSuccess:v,onFailure:C}=c.recoverWallet,b=(e="User exited before their wallet could be recovered")=>{a({shouldCallAuthOnSuccess:!1}),C("string"==typeof e?new e1(e):e)};d.current=b,(0,o.useEffect)(()=>{if(!r||!w)return b("User must be authenticated and have a Privy wallet before it can be recovered")},[r]);let _=e=>{e&&u(e)};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:b}),(0,m.jsx)(ae,{}),(0,m.jsxs)(hc,{children:[(0,m.jsxs)(hl,{children:[(0,m.jsx)(eT.Z,{height:48,width:48,stroke:"var(--privy-color-accent)"}),(0,m.jsx)("h3",{style:{color:"var(--privy-color-foreground)"},children:"Enter your password"}),(0,m.jsx)("p",{style:{color:"var(--privy-color-foreground-2)"},children:"Please provision your account on this new device. To continue, enter your recovery password."})]}),(0,m.jsxs)("div",{children:[(0,m.jsxs)(oP,{children:[(0,m.jsx)(oS,{type:e?"password":"text",onChange:e=>_(e.target.value),disabled:f,style:{paddingRight:"2.3rem"}}),(0,m.jsx)(oI,{style:{right:"0.75rem"},children:e?(0,m.jsx)(oL,{onClick:()=>t(!1)}):(0,m.jsx)(oF,{onClick:()=>t(!0)})})]}),!!p&&(0,m.jsx)(hd,{children:p})]}),(0,m.jsxs)("div",{children:[(0,m.jsxs)(i9,{children:[(0,m.jsx)("h4",{children:"Why is this necessary?"}),(0,m.jsx)("p",{children:"You previously set a password for this wallet. This helps ensure only you can access it"})]}),(0,m.jsx)(hh,{loading:f||!i,disabled:!h,onClick:async()=>{y(!0);let e=await n();if(!e||!w||null===h)return b("User must be authenticated and have a Privy wallet before it can be recovered");try{s({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:w.address}}),await i?.recover({address:w.address,accessToken:e,recoveryPin:h,recoveryMethod:w.recoveryMethod}),g(""),x?l(x):a({shouldCallAuthOnSuccess:!1}),v?.(w),s({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:w.address}})}catch(e){a7(e)&&("invalid_recovery_pin"===e.type||"invalid_request_arguments"===e.type)?g("Invalid recovery password, please try again."):g("An error has occurred, please try again.")}finally{y(!1)}},warn:!1,hideAnimations:!w&&f,children:"Recover your account"})]})]}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_RECOVERY_SELECTION_SCREEN:()=>{let[e,t]=(0,o.useState)(!1),{navigate:r,lastScreen:n,navigateBack:i,setModalData:a,data:s,onUserCloseViaDialogOrKeybindRef:l}=ny(),{user:c}=n$(),{embeddedWallets:d}=nh(),{closePrivyModal:h}=nZ(),u=rC(c),p=null===u,{isInAccountCreateFlow:g,isResettingPassword:f}=s.recoverySelection,y=u&&"privy"!==u.recoveryMethod,w=y?(0,m.jsxs)("span",{children:["Your account is currently secured using"," ",(0,m.jsx)("strong",{children:hw[u?.recoveryMethod||"user-passcode"]}),"."]}):"Select a method for logging in on new devices and recovering your account.";function x(e){a({recoveryOAuthStatus:{provider:e,action:p?"create-wallet":"set-recovery",isInAccountCreateFlow:g}}),r("EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN")}function v(){s?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),h({shouldCallAuthOnSuccess:s?.setWalletPassword?.callAuthOnSuccessOnClose??!1})}return l.current=v,(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:v,backFn:e?()=>t(!1):n?i:void 0,infoFn:n||e?void 0:()=>t(!0)},"header"),e?(0,m.jsx)(hx,{onClose:()=>t(!1)}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(as,{title:y?"Update backup method":"Secure your account",icon:(0,m.jsx)(eR.Z,{width:48}),description:w}),(0,m.jsx)(hm,{children:d.userOwnedRecoveryOptions.filter(e=>!["icloud","google-drive"].includes(u?.recoveryMethod||"")||e!==u?.recoveryMethod).sort().map(e=>{switch(e){case"google-drive":return(0,m.jsxs)(i_,{onClick:()=>x("google-drive"),children:[(0,m.jsx)(hy,{children:(0,m.jsx)(hp,{style:{width:18}})}),"Back up to Google Drive"]},e);case"icloud":return(0,m.jsxs)(i_,{onClick:()=>x("icloud"),children:[(0,m.jsx)(hy,{children:(0,m.jsx)(hu,{style:{width:24}})}),"Back up to Apple iCloud"]},e);case"user-passcode":return(0,m.jsxs)(i_,{onClick:()=>{r(on({isCreatingWallet:p,skipSplashScreen:!0}))},children:[(0,m.jsx)(hy,{children:(0,m.jsx)(eM.Z,{style:{width:18}})}),f?"Reset your":"Set a"," password"]},e);default:return null}})})]}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_SET_AUTOMATIC_RECOVERY_SCREEN:()=>{let{user:e,getAccessToken:t}=n$(),r=rC(e),{walletProxy:n,refreshUser:i,closePrivyModal:a}=nZ(),s=nh(),l=ny(),[c,d]=(0,o.useState)(!1),[h,u]=(0,o.useState)(null),[p,g]=(0,o.useState)(null);function f(){if(!c){if(p){l.data?.setWalletPassword?.onFailure(p),a();return}if(!h){l.data?.setWalletPassword?.onFailure(Error("User exited set recovery flow")),a();return}}}async function y(){d(!0);try{let e=await t();if(!e||!n||!r)return;if(!(await n.setRecovery({recoveryMethod:"privy",address:r.address,accessToken:e})).address)throw Error("Unable to set recovery on wallet");let o=await i();if(!o)throw Error("Unable to set recovery on wallet");let s=rC(o);if(!s)throw Error("Unabled to set recovery on wallet");u(!!o),setTimeout(()=>{l.data?.setWalletPassword?.onSuccess(s),a()},1400)}catch(e){g(e)}finally{d(!1)}}l.onUserCloseViaDialogOrKeybindRef.current=f;let w=!!(c||h);return p?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:f},"header"),(0,m.jsx)(hv,{$color:"var(--privy-color-error)",style:{alignSelf:"center"},children:(0,m.jsx)(U.Z,{height:38,width:38,stroke:"var(--privy-color-error)"})}),(0,m.jsx)(hC,{style:{marginTop:"0.5rem"},children:"Something went wrong"}),(0,m.jsx)(iy,{style:{minHeight:"2rem"}}),(0,m.jsx)(n4,{onClick:()=>g(null),children:"Try again"}),(0,m.jsx)(iP,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:f},"header"),(0,m.jsx)(eR.Z,{style:{width:"3rem",height:"3rem",alignSelf:"center"}}),(0,m.jsx)(hC,{style:{marginTop:"0.5rem"},children:"Automatically secure your account"}),(0,m.jsx)(cg,{style:{marginTop:"1rem"},children:"When you log into a new device, you’ll only need to authenticate to access your account. Never get logged out if you forget your password."}),(0,m.jsx)(iy,{style:{minHeight:"2rem"}}),(0,m.jsx)(n4,{loading:c,disabled:w,onClick:()=>y(),children:h?"Success":"Confirm"}),(0,m.jsx)(n2,{disabled:w,onClick:()=>{let e=oi({walletAction:"update",availableRecoveryMethods:s.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:!1,isResettingPassword:r?.recoveryMethod==="user-passcode",showAutomaticRecovery:!1});l.navigate(e)},style:{marginTop:"0.5rem"},children:"More recovery options"}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_RECOVERY_OAUTH_SCREEN:()=>{let{logout:e}=n$(),{navigate:t,setModalData:r,data:n}=ny(),{recoveryOAuthFlow:i,closePrivyModal:a,createAnalyticsEvent:s}=nZ(),[l,c]=(0,o.useState)(!1),{provider:d,action:h,isInAccountCreateFlow:u}=n?.recoveryOAuthStatus,[p,g]=(0,o.useState)(void 0),[f,y]=(0,o.useState)("create-wallet"===h);if("user-passcode"===d)throw Error("RecoveryOAuthScreen should never be called with a wallet that specifies recoveryMethod: `user-passcode`");let w=hf[d].name,x=hf[d].component,v=n?.recoverWallet?.onCompleteNavigateTo,C=new tI(async(e="create-wallet")=>(y(!0),new Promise((t,r)=>{setTimeout(async()=>{try{let r=window.open();await i(d,e,r),c(!0),t()}catch{g({message:`${"recover"===e?"Recovery":"Back up"} with ${w} unsuccessful`,detail:"recover"===h?`Please verify that you are selecting the ${w} account associated with your backup.`:"",retryable:!0}),r()}},0)})));(0,o.useEffect)(()=>{"recover"!==h&&C.execute(u?"create-wallet":"set-recovery")},[]),(0,o.useEffect)(()=>{if(!l)return;let n=setTimeout(()=>{u?(r({createWallet:{onSuccess:()=>{},onFailure:t=>{s({eventName:"embedded_wallet_creation_failure_logout",payload:{error:t,screen:"RecoveryOAuthScreen"}}),e()},callAuthOnSuccessOnClose:!0}}),t("EMBEDDED_WALLET_CREATED_SCREEN")):a({shouldCallAuthOnSuccess:!1})},1400);return()=>clearTimeout(n)},[l]);let b=(0,o.useCallback)(async()=>{await C.execute("recover"),v?t(v):c(!0)},[]),_="google-drive"===d?"Google Drive":"Apple iCloud",j=l&&`Successfully ${"recover"===h?"recovered":"backed up"} with ${_}.`||p&&p.message||`${"recover"===h?"Recovering":"Backing up"} with ${_}...`,k=p?p.detail:"";return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{}),f?(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(hm,{children:[(0,m.jsx)(as,{title:j,icon:(0,m.jsx)(x,{style:{width:"38px",height:"38px"}}),description:k}),p&&p?.retryable?(0,m.jsx)(n3,{onClick:()=>{rd(),g(void 0),"create-wallet"===h?C.execute("create-wallet"):b()},disabled:!l&&!p?.retryable,children:"Try again"}):null]})}):(0,m.jsxs)(hm,{children:[(0,m.jsx)(as,{title:"Confirm it's really you",icon:(0,m.jsx)(x,{style:{height:42,width:48}}),description:`To confirm your identity, please log in to ${_} where your account is backed up.`}),(0,m.jsxs)(n3,{onClick:b,children:["Confirm with ",_]})]}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_KEY_EXPORT_SCREEN:()=>{let[e,t]=(0,o.useState)(null),{authenticated:r,user:n,getAccessToken:i}=n$(),{closePrivyModal:a,createAnalyticsEvent:s,clientAnalyticsId:l}=nZ(),{data:c,onUserCloseViaDialogOrKeybindRef:d}=ny(),h=rC(n),{onFailure:u,onSuccess:p,origin:g,appId:f,appClientId:y}=c.keyExport,w=e=>{a({shouldCallAuthOnSuccess:!1}),u("string"==typeof e?Error(e):e)},x=()=>{a({shouldCallAuthOnSuccess:!1}),p(),s({eventName:"embedded_wallet_key_export_completed",payload:{walletAddress:h?.address}})};return(0,o.useEffect)(()=>{if(!r||!h)return w("User must be authenticated before exporting their wallet");i().then(t,w)},[r,n]),d.current=x,(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:x}),(0,m.jsxs)(op,{children:[(0,m.jsx)(as,{title:"Transfer wallet",description:(0,m.jsxs)(om,{children:["Either copy your private key or seed phrase to transfer your wallet."," ",(0,m.jsx)("a",{href:"https://privy-io.notion.site/Transferring-your-account-9dab9e16c6034a7ab1ff7fa479b02828",target:"blank",rel:"noopener noreferrer",children:"Learn more"})]})}),(0,m.jsxs)(og,{children:[(0,m.jsx)(U.Z,{color:"var(--privy-color-warn)"}),(0,m.jsx)("p",{children:"Never share your private key or seed phrase with anyone."})]}),(0,m.jsx)(of,{children:(0,m.jsx)(ow,{children:(0,m.jsxs)(oc,{children:[(0,m.jsx)(od,{children:"Your wallet"}),(0,m.jsxs)(oy,{children:[tm(h?.address,4,4),(0,m.jsx)(oh,{address:h?.address??""})]})]})})}),(0,m.jsx)("div",{style:{width:"100%"},children:e&&!!h&&(0,m.jsx)(ou,{origin:g,appId:f,appClientId:y,accessToken:e,clientAnalyticsId:l,wallet:h,dimensions:{height:"44px"}})})]}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_SIGN_REQUEST_SCREEN:()=>{let{authenticated:e}=n$(),{initializeWalletProxy:t,closePrivyModal:r}=nZ(),{navigate:n,data:i,onUserCloseViaDialogOrKeybindRef:a}=ny(),[s,l]=(0,o.useState)(!0),[c,h]=(0,o.useState)(""),[u,p]=(0,o.useState)(),[g,f]=(0,o.useState)(null),[y,w]=(0,o.useState)(!1),x=null!==g;(0,o.useEffect)(()=>{e||n("LANDING")},[e]),(0,o.useEffect)(()=>{t(3e4).then(e=>{l(!1),e||(h("An error has occurred, please try again."),p(new rW(new rI(c,d.M_.E32603_DEFAULT_INTERNAL_ERROR.eipCode))))})},[]);let{method:v,data:C,confirmAndSign:b,onSuccess:_,onFailure:j,uiOptions:k}=i.signMessage,E={title:k.title||"Sign message",description:k.description||"Signing this message will not cost you any fees.",buttonText:k.buttonText||"Sign and continue"},A=e=>{e?_(e):j(u||new rW(new rI("The user rejected the request.",d.M_.E4001_USER_REJECTED_REQUEST.eipCode))),r({shouldCallAuthOnSuccess:!1}),setTimeout(()=>{f(null),h(""),p(void 0)},200)};return a.current=()=>{A(g)},(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:()=>A(g)}),(0,m.jsx)(ae,{}),k.iconUrl&&"string"==typeof k.iconUrl?(0,m.jsx)(ul,{children:(0,m.jsx)(d8,{size:"sm",src:k.iconUrl,alt:"app image"})}):null,(0,m.jsx)(hC,{children:E.title}),(0,m.jsx)(cg,{children:E.description}),"personal_sign"===v&&(0,m.jsx)(ui,{children:ue(C)}),"eth_signTypedData_v4"===v&&(0,m.jsx)(un,{typedData:C}),"solana_signMessage"===v&&(0,m.jsx)(ui,{children:C}),(0,m.jsx)(uc,{}),(0,m.jsx)(uo,{fail:!0,children:c}),(0,m.jsx)(n4,{disabled:y||x||s,loading:y,onClick:async()=>{w(!0),h("");try{let e=await b();f(e),w(!1),setTimeout(()=>{A(e)},1400)}catch(e){console.error(e),h("An error has occurred, please try again."),p(new rW(new rI(c,d.M_.E32603_DEFAULT_INTERNAL_ERROR.eipCode))),w(!1)}},children:y?"Signing...":x?(0,m.jsxs)(us,{children:[(0,m.jsx)(ss,{style:{height:"0.9rem",width:"0.9rem"},strokeWidth:2})," ",(0,m.jsx)("span",{children:"Success"})]}):E.buttonText}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN:()=>{let{data:e,onUserCloseViaDialogOrKeybindRef:t,setModalData:r,navigate:i}=ny(),{rpcConfig:a,chains:s,closePrivyModal:l,walletProxy:c}=nZ(),{getAccessToken:h,user:u}=n$(),{wallets:p}=sH(),g=nh(),[f,y]=(0,o.useState)(e?.sendTransaction?.transactionRequest),[w,x]=(0,o.useState)(null),[v,C]=(0,o.useState)(!1),[b,_]=(0,o.useState)(null),[j,k]=(0,o.useState)(null);if(!f||!e?.sendTransaction)return(0,m.jsx)(si,{error:Error("Invalid transaction request"),onClick:()=>{e?.sendTransaction?.onFailure(h9),l({shouldCallAuthOnSuccess:!1})}});let E=(0,o.useMemo)(()=>f.from?p.find(e=>(0,n.Kn)(e.address)===(0,n.Kn)(f.from)):rC(u),[f.from]),A=(0,o.useMemo)(()=>s.find(e=>Number(e.id)===Number(f.chainId)),[f.chainId]),S=A?.nativeCurrency.symbol??"ETH",{action:T,amount:P,spender:N,isErc20Ish:R}=(0,o.useMemo)(()=>h3(f.data),[f.data]);(0,o.useEffect)(()=>{f.to&&A&&R&&h2({amount:P,address:f.to,chain:A,rpcConfig:g.rpcConfig,privyAppId:g.id}).then(x).catch(console.error)},[f.to,P,A]);let{tokenPrice:M,isTokenPriceLoading:O}=sz(f),I=(0,o.useMemo)(()=>tk(Number(f.chainId),s,a,{appId:g.id}),[f.chainId,a]),W=h8(f,I),L=()=>{if(!v)return b?e?.sendTransaction?.onSuccess(b.response):j||W?.errors[0]?e?.sendTransaction?.onFailure(j??W?.errors[0]??h9):e?.sendTransaction?.onFailure(new rW(new rI("The user rejected the request",d.M_.E4001_USER_REJECTED_REQUEST.eipCode))),l({shouldCallAuthOnSuccess:!1})};t.current=L;let F=async()=>{C(!0);try{let t=await h();if(v||!t||!E||!c)return;let r=await sU(t,E.address,c,W?.tx??f,I,e.sendTransaction?.requesterAppId),n=await r.wait();_({receipt:sZ(n),response:r})}catch(e){console.warn({transaction:W?.tx??f,error:e}),k(e)}finally{C(!1)}},U=async()=>{if(!rC(u))return;if(!g.fundingConfig||0===g.fundingConfig.methods.length||!e.funding)throw Error("Funding wallet is not enabled");let t=hk({fundingMethods:g.fundingConfig?.methods});r({...e,funding:{...e?.funding,methodScreen:t}}),i(t)},D="fiat-currency"===g.embeddedWallets.priceDisplay.primary,Z=(0,en.uq)(W?.tx.value??0).add((0,en.uq)(W?.totalGasEstimate?.toBigInt()??0)).toHexString(),z=sY(Z,S),$=D&&M?sK(Z,M):void 0,H=sY(W?.totalGasEstimate?.toString()??0,S),B=D&&M?sK(W?.totalGasEstimate?.toString()??0,M):void 0,q=sY(W?.balance?.toString()??0,S,void 0,!0),V=D&&M?sK(W?.balance?.toString()??0,M):void 0,G=e.sendTransaction?.uiOptions?.transactionInfo?.title||("approve"===T?"Confirm address":`Approve ${T}`),K=e.sendTransaction?.uiOptions?.description||`${g.name} wants your permission to approve the following transaction.`,Y=e.sendTransaction?.uiOptions?.transactionInfo?.contractInfo?.imgUrl?(0,m.jsx)("img",{src:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgUrl,alt:e.sendTransaction.uiOptions.transactionInfo.contractInfo.imgAltText}):null,Q=W&&!W.errors[0]&&!W.hasFunds&&g.fundingConfig&&g.fundingConfig.methods.length>0,X=Q?"Add funds":e.sendTransaction?.uiOptions?.buttonText||"Approve";return b?.receipt?(0,m.jsx)(hX,{txn:W?.tx??f,onClose:L,receipt:b.receipt,transactionInfo:e.sendTransaction?.uiOptions.transactionInfo,tokenPrice:M,tokenSymbol:S,l1GasEstimate:W?.l1ExecutionFeeEstimate?.toString(),receiptHeader:e.sendTransaction?.uiOptions.successHeader,receiptDescription:e.sendTransaction?.uiOptions.successDescription}):j?(0,m.jsx)(hW,{transactionError:j,chainId:W?.tx.chainId??f.chainId,onClose:L,onRetry:({resetNonce:e})=>{k(null);let t={...W?.tx??f};e&&(t.nonce=void 0),y(t)}}):(0,m.jsx)(hE,{isSubmitting:v,submitError:j,isPreparing:!W,isTokenPriceLoading:O,isTokenContractInfoLoading:!w,prepareError:W?.errors[0],symbol:w?.symbol,chain:A,img:Y,title:G,subtitle:K,spender:N,total:f.value?$??z:void 0,fee:B??H,to:f.to,network:g.chains.find(e=>e.id===f.chainId)?.name??"",from:E?.address??"",cta:X,hasFunds:W?.hasFunds,action:T,balance:V??q,amount:w?.value??P,onClose:L,onClick:Q?U:F})},FUNDING_METHOD_SELECTION_SCREEN:()=>{let{wallets:e}=sH(),{app:t,navigate:r,data:i,setModalData:a}=ny(),s=i?.funding,l=(0,o.useRef)(null),[c,d]=(0,o.useState)(!1);(0,o.useEffect)(()=>{l.current&&l.current.style.setProperty("--funding-input-length",Math.max(s.amount.length,1).toString())},[s.amount]);let h=t.fundingConfig?.methods.slice()??[],{tokenPrice:u}=sz({chainId:s.chain.id}),p=u?sG(s.amount,u):void 0,g=e.find(e=>(0,n.Kn)(e.address)===(0,n.Kn)(s.address)),f=g&&"privy"!==g.walletClientType?aS(g.walletClientType,g.connectorType,g.walletClientType):t.name,y=parseFloat(s.amount),w=!isNaN(y)&&y>0;return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sP,{}),(0,m.jsxs)("h3",{children:["Add funds to your"," ",f?.toLowerCase().endsWith("wallet")?f:f+" wallet"]}),(0,m.jsx)(i7,{style:{marginTop:"32px"},children:(0,m.jsxs)(lN,{children:[(0,m.jsxs)(lR,{onClick:()=>l.current?.focus(),children:[(0,m.jsx)(lO,{ref:l,value:s.amount,onFocus:()=>d(!0),onBlur:()=>d(!1),onChange:e=>{let t=e.target.value;/^[0-9.]*$/.test(t)&&t.split(".").length-1<=1&&a({...i,funding:{...s,amount:t}})}}),(0,m.jsx)(lW,{children:s.chain.nativeCurrency.symbol}),!c&&(0,m.jsx)(lI,{children:(0,m.jsx)(eo.Z,{width:12,height:12})})]}),(0,m.jsx)(lL,{children:p&&w?p:""})]})}),(0,m.jsxs)(lT,{children:[s.errorMessage&&(0,m.jsx)(ll,{children:s.errorMessage}),h.sort().map(e=>{switch(e){case"moonpay":return(0,m.jsxs)(i_,{disabled:!w,onClick:()=>{r("MOONPAY_PROMPT_SCREEN")},children:[(0,m.jsx)(lP,{children:(0,m.jsx)(ld,{style:{width:24}})}),"Moonpay"]},e);case"coinbase-onramp":return s8(Number(s.chain.id))?(0,m.jsxs)(i_,{disabled:!w,onClick:()=>{r("COINBASE_ONRAMP_STATUS_SCREEN")},children:[(0,m.jsx)(lP,{children:(0,m.jsx)(rT,{style:{width:24}})}),"Coinbase Onramp"]},e):null;case"external":return(0,m.jsxs)(i_,{disabled:!w,onClick:()=>{r("FUNDING_TRANSFER_FROM_WALLET_SCREEN")},children:[(0,m.jsx)(lP,{children:(0,m.jsx)(F.Z,{style:{width:24}})}),"Transfer from wallet"]},e)}}),(0,m.jsx)(lU,{disabled:!w,onClick:()=>r("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,m.jsx)(iP,{})]})},MOONPAY_PROMPT_SCREEN:()=>{let{app:e,data:t,navigate:r,setModalData:n}=ny(),{createAnalyticsEvent:i,getMoonpaySignedUrl:a}=nZ(),[s,l]=(0,o.useState)(null),c=t?.funding;return(0,o.useEffect)(()=>{!s&&c&&r();async function r(){if(!e.fundingConfig)return;let{signedUrl:r,externalTransactionId:i}=await a(c.address,{...e.fundingMethodConfig.moonpay,...c.moonpayConfigOverride,currencyCode:c.moonpayConfigOverride?.currencyCode??function(e){switch(e){case"eip155:42161":return"ETH_ARBITRUM";case"eip155:43114":return"AVAX_CCHAIN";case"eip155:8453":return"ETH_BASE";case"eip155:42220":return"CELO_CELO";case"eip155:137":return"MATIC_POLYGON";case"eip155:1":return"ETH_ETHEREUM";default:return console.warn(`Chain ${e} not supported by Moonpay, defaulting to Ethereum mainnet`),"ETH_ETHEREUM"}}(`eip155:${c.chain.id}`),quoteCurrencyAmount:c.moonpayConfigOverride?.quoteCurrencyAmount??parseFloat(c.amount)});l(r),n({moonpayStatus:{externalTransactionId:i},funding:t?.funding})}},[s,c]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sP,{}),(0,m.jsx)(l3,{app:e,signedUrl:s,onContinue:()=>{i({eventName:"sdk_fiat_on_ramp_started",payload:{provider:ci}}),r("MOONPAY_STATUS_SCREEN")}}),(0,m.jsx)(iP,{})]})},MOONPAY_STATUS_SCREEN:()=>{let{app:e,data:t}=ny(),{closePrivyModal:r}=nZ(),{externalTransactionId:n}=t?.moonpayStatus,i=function(e,t=!1){let[r,n]=(0,o.useState)(null),{createAnalyticsEvent:i}=nZ(),{data:a,navigate:s,setModalData:l}=ny(),c=a?.funding,d=(0,o.useRef)(0);return(0,o.useEffect)(()=>{let r=setInterval(async()=>{if(e)try{let[a]=await cs(e,t),o="waitingAuthorization"===a.status&&"credit_debit_card"===a.paymentMethod?"pending":a.status;if(["failed","completed","awaitingAuthorization"].includes(o)&&(i({eventName:s6,payload:{status:o,provider:ci,paymentMethod:a.paymentMethod,cardPaymentType:a.cardPaymentType,currency:a.currency?.code,baseCurrencyAmount:a.baseCurrencyAmount,quoteCurrencyAmount:a.quoteCurrencyAmount,feeAmount:a.feeAmount,extraFeeAmount:a.extraFeeAmount,networkFeeAmount:a.networkFeeAmount}}),clearInterval(r)),"failed"===o||"serviceFailure"===o){l({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),s("FUNDING_METHOD_SELECTION_SCREEN");return}n(o)}catch(e){e.response?.status!==404&&(d.current+=1),d.current>=3&&(i({eventName:s6,payload:{status:"serviceFailure",provider:ci}}),clearInterval(r),l({funding:{...c,errorMessage:"Something went wrong adding funds from Moonpay. Please try again or use another method to fund your wallet."}}),s("FUNDING_METHOD_SELECTION_SCREEN"))}},3e3);return()=>clearInterval(r)},[e,d]),r}(n||null,e.fundingMethodConfig.moonpay.useSandbox??!1);return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{title:"Fund account"},"header"),(0,m.jsx)(cc,{status:i,onClickCta:r}),(0,m.jsx)(iP,{})]})},COINBASE_ONRAMP_STATUS_SCREEN:()=>{let{data:e,setModalData:t,navigate:r}=ny(),{closePrivyModal:n,createAnalyticsEvent:i,initCoinbaseOnRamp:a,getCoinbaseOnRampStatus:s}=nZ(),l=e?.funding,[c,d]=(0,o.useState)(!1),[h,u]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{if(c)return;d(!0);let e=async()=>{try{i({eventName:"sdk_fiat_on_ramp_started",payload:{provider:"coinbase-onramp"}});let e=window.open(void 0,void 0,s5({w:440,h:680})),t=function(e){let t=s7[e];if(!t)throw new eK(`Unsupported chainId: ${e} for Coinbase Onramp`);return t}(l.chain.id),r=await a({addresses:[{address:l.address,blockchains:[t]}]}),{url:n}=s9({input:r,amount:l.amount,blockchain:t});if(!e)throw Error("Unable to initiate Coinbase Onramp flow.");e.location=n.toString();let o=0,c=!1;for(;osetTimeout(e,1500))}if(!c)throw Error("Timed out waiting for transaction response from Coinbase Onramp.");i({eventName:s6,payload:{status:"success",provider:"coinbase-onramp"}}),u(!0)}catch(e){console.error(e),i({eventName:s6,payload:{status:"failure",provider:"coinbase-onramp",error:e.message}}),t({funding:{...l,errorMessage:"Something went wrong adding funds from Coinbase Onramp. Please try again or use another method to fund your wallet."}}),r("FUNDING_METHOD_SELECTION_SCREEN")}finally{d(!1)}},n=setTimeout(()=>void e(),500);return()=>clearTimeout(n)},[]),(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{title:"Fund account"},"header"),(0,m.jsx)(lr,{isSucccess:h,onClickCta:n}),(0,m.jsx)(iP,{})]})},FUNDING_TRANSFER_FROM_WALLET_SCREEN:()=>{let{connectors:e}=nZ(),{app:t,setModalData:r,data:n,navigate:i}=ny(),[a,s]=(0,o.useState)("default"),l=aB(t.appearance.walletList,e,!0,t.appearance.walletList,t.externalWallets.walletConnect.enabled),c=(0,m.jsx)(cx,{text:"More wallets",onClick:()=>s("overflow")});return(0,o.useEffect)(()=>{r({...n,externalConnectWallet:{onCompleteNavigateTo:"FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN"}})},[]),"overflow"===a?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:()=>s("default")},"header"),(0,m.jsxs)(ix,{children:[(0,m.jsx)(cg,{style:{color:"var(--privy-color-foreground-3)",textAlign:"left"},children:"More wallets"}),l]}),(0,m.jsx)(iP,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sP,{}),(0,m.jsx)(as,{title:"Transfer from wallet",description:"Connect a wallet to deposit funds or send funds manually to your wallet address."}),(0,m.jsxs)(ix,{children:[...l.length>3?l.slice(0,2):l,l.length>3&&c,(0,m.jsx)(cw,{onClick:()=>i("FUNDING_MANUAL_TRANSFER_SCREEN"),children:"Send funds manually"})]}),(0,m.jsx)(iP,{})]})},FUNDING_AWAITING_TRANSFER_FROM_EXTERNAL_WALLET_SCREEN:()=>{let{chains:e,rpcConfig:t,appId:r,closePrivyModal:n}=nZ(),{navigate:i,setModalData:a,app:s,data:d}=ny(),[h,u]=(0,o.useState)(null),[p,g]=(0,o.useState)(null),[f,y]=(0,o.useState)(null),[w,x]=(0,o.useState)(null),[v,C]=(0,o.useState)(!1),b=d?.funding&&(0,et.vz)(d.funding.amount,"ether").toHexString(),_=d?.funding&&d.funding.chain.id,{wallets:j}=sH(),{tokenPrice:k,isTokenPriceLoading:E}=sz({chainId:h?.chainId&&sB(h.chainId)?sB(h.chainId):void 0}),A=async e=>{for(let t of e)_&&sB(t.chainId)!==_&&await t.switchChain(_)},S=new tI(async()=>{let n=j[0];if(!n){console.error("Connected wallet wasn't found."),i("ERROR_SCREEN",!1);return}if(u(n),!_){console.error(`Chain ID not found for input ${d?.funding?.chain.id}.`),i("ERROR_SCREEN",!1);return}let a=d?.funding?.address;if(!a){console.error("Address to fund not found."),i("ERROR_SCREEN",!1);return}g(a);let o=tk(_,e,t,{appId:r}),s={from:n.address,to:p||void 0,value:b,chainId:_},h=await (0,l.vT)(n.address,s,o),{totalGasEstimate:m}=await (0,c.gM)(h,o),{balance:f,hasSufficientFunds:w}=await sD(n.address,h,m,o);if(x({gas:m.toHexString(),balance:f.toHexString()}),!w){y(new eK(`Wallet ${tm(n.address)} does not have enough funds.`,void 0,"insufficient_balance"));return}await A([n]);try{let e=await (await n.getEthersProvider()).getSigner(),{wait:t}=await e.sendTransaction(h);await t(1),C(!0)}catch(e){y(e)}});(0,o.useEffect)(()=>{S.execute()},[]),(0,o.useEffect)(()=>{f&&(a({funding:d?.funding,sendTransaction:d?.sendTransaction,errorModalData:{error:f,previousScreen:"FUNDING_TRANSFER_FROM_WALLET_SCREEN"}}),i("ERROR_SCREEN",!1))},[f]);let T=h?aS(h.walletClientType,h.connectorType,h.walletClientType)||"wallet":null,P=!h||!w||E||!d?.funding||!b,N=P?void 0:sQ([w.gas,b]),R=N&&k?sK(N,k):void 0,M=N?sY(N,"ETH"):void 0,O=w&&k?sK(w.gas,k):void 0,I=w?sY(w.gas,"ETH"):void 0;return(0,o.useEffect)(()=>{if(!v)return;let e=setTimeout(n,2500);return()=>clearTimeout(e)},[v]),P?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sP,{}),(0,m.jsx)(sN,{}),(0,m.jsx)("div",{style:{marginTop:"1rem"}}),(0,m.jsx)(iP,{})]}):v?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sP,{}),(0,m.jsx)(ae,{}),(0,m.jsxs)(i6,{children:[(0,m.jsx)(er.Z,{color:"var(--privy-color-success)",width:"64px",height:"64px"}),(0,m.jsx)(as,{title:"Success!",description:`You\u2019ve successfully added ${(0,et.bM)(b,"ether")} ETH to your ${s.name} wallet. It may take a minute before the funds are available to use.`})]}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sP,{}),(0,m.jsx)(sN,{}),(0,m.jsx)(i3,{style:{marginTop:"16px"},children:(0,m.jsx)(aC,{icon:aT(h.walletClientType,h.connectorType,h.walletClientType),name:h.walletClientType})}),(0,m.jsx)(as,{style:{marginTop:"8px",marginBottom:"12px"},title:`Confirming with ${T}`}),w&&p&&(0,m.jsx)(m.Fragment,{children:(0,m.jsxs)(sW,{children:[(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Total"}),(0,m.jsx)(sF,{children:R||M})]}),(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"To"}),(0,m.jsx)(sF,{children:tm(p)})]}),(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Network"}),(0,m.jsx)(sF,{children:(0,m.jsxs)(sJ,{children:[aP(d.funding.chain.id)," ",d.funding.chain.name]})})]}),(0,m.jsxs)(sL,{children:[(0,m.jsx)(od,{children:"Estimated fee"}),(0,m.jsx)(sF,{children:O||I})]})]})}),(0,m.jsx)(an,{height:24}),(0,m.jsx)(iP,{})]})},FUNDING_MANUAL_TRANSFER_SCREEN:()=>{let{wallets:e}=sH(),{app:t,data:r,setModalData:n,navigate:i,lastScreen:a}=ny(),{chains:s,rpcConfig:l,appId:c,closePrivyModal:d}=nZ(),[h,u]=(0,o.useState)("default"),[p,g]=(0,o.useState)(void 0),f=r?.funding,{tokenPrice:y}=sz({chainId:f.chain.id}),w=y?sG(f.amount,y):void 0,x=e.find(e=>tm(e.address)===tm(f.address)),v=x&&"privy"!==x.walletClientType?aS(x.walletClientType,x.connectorType,x.walletClientType):t.name;if(!f)return n({errorModalData:{error:Error("Couldn't find funding config"),previousScreen:a||"FUNDING_METHOD_SELECTION_SCREEN"},funding:r?.funding,sendTransaction:r?.sendTransaction}),i("ERROR_SCREEN"),(0,m.jsx)(m.Fragment,{});(0,o.useEffect)(()=>{let e=tk(f.chain.id,s,l,{appId:c});function t(){e.getBalance(f.address).then(e=>g(parseFloat((0,et.bM)(e,"ether")))).catch(()=>g(void 0))}let r=setInterval(t,2e3);return t(),()=>clearInterval(r)},[]);let C=(0,o.useMemo)(()=>void 0!==p&&p>=parseFloat(f.amount),[p,f.amount]),b=(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(lq,{title:"Your wallet",errMsg:void 0,isLoading:!f||void 0===p,isPulsing:!C,balance:`${void 0!==p?p.toPrecision(2):""} ETH`,address:f.address,statusColor:C?"green":"gray"}),C&&(0,m.jsx)(lZ,{onClick:()=>d(),children:"Close"})]});return"qr-code"===h?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:()=>u("default")}),(0,m.jsxs)(i7,{style:{gap:"24px",marginBottom:"24px"},children:[(0,m.jsxs)("div",{children:[(0,m.jsx)(iM,{children:"Scan QR code"}),(0,m.jsxs)(iO,{children:["Scan this code using your mobile wallet to send funds to your ",v," ","wallet."]})]}),(0,m.jsx)(sb,{url:f.address,size:200,squareLogoElement:lG}),b]}),(0,m.jsx)(iP,{})]}):(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(sP,{}),(0,m.jsx)(as,{title:"Send funds",description:"Send funds directly to your wallet by copying your wallet address or scanning a QR code."}),(0,m.jsxs)(i7,{style:{gap:"16px"},children:[(0,m.jsxs)(lQ,{children:[(0,m.jsx)(ed.Z,{height:"20px",width:"20px",color:"var(--privy-color-accent-light)"}),(0,m.jsxs)(lX,{children:["Make sure to send on ",f.chain.name,"."]})]}),(0,m.jsxs)(lJ,{children:[(0,m.jsx)(an,{height:16}),(0,m.jsxs)(lN,{children:[(0,m.jsxs)(lR,{children:[(0,m.jsx)(lM,{children:f.amount}),(0,m.jsx)(lW,{children:f.chain.nativeCurrency.symbol})]}),(0,m.jsx)(lL,{children:w?`${w} USD`:"..."}),(0,m.jsxs)(lF,{children:[aP(f.chain.id),f.chain.name]})]}),(0,m.jsx)(an,{height:8}),(0,m.jsxs)(lY,{children:[(0,m.jsx)(lK,{text:f.address}),(0,m.jsx)(l1,{onClick:()=>u("qr-code"),children:(0,m.jsxs)(l0,{children:[(0,m.jsx)(eh.Z,{height:"16px",width:"16px"}),"Scan code"]})})]})]}),b]}),(0,m.jsx)(an,{height:16}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_PASSWORD_UPDATE_SPLASH_SCREEN:()=>{let{closePrivyModal:e}=nZ(),{data:t,setModalData:r,navigate:n,onUserCloseViaDialogOrKeybindRef:i}=ny(),{onSuccess:a,onFailure:o}=t.setWalletPassword,s=()=>{o(new e1("Exited before password was added to wallet")),e({shouldCallAuthOnSuccess:!1})};return i.current=s,(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:s}),(0,m.jsx)(ae,{}),(0,m.jsxs)(i6,{children:[(0,m.jsxs)(ar,{children:[(0,m.jsx)(X.Z,{stroke:"var(--privy-color-accent)",width:"64px",height:"64px"}),(0,m.jsx)(ai,{style:{width:24,height:24,position:"absolute",bottom:0,right:0},children:(0,m.jsx)(J.Z,{width:"12px",height:"12px",fill:"white"})})]}),(0,m.jsxs)(as,{title:"Secure Your Account",children:["Please set a password to secure your account.",(0,m.jsx)("p",{children:"Losing access to this password and this device will make your account inaccessible."})]})]}),(0,m.jsx)(n3,{onClick:()=>{r({createWallet:{onFailure:o,onSuccess:a,callAuthOnSuccessOnClose:!1,addPasswordToExistingWallet:!0}}),n("EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN")},children:"Add password"}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},EMBEDDED_WALLET_PASSWORD_UPDATE_SCREEN:()=>{let[e,t]=(0,o.useState)(null),[r,n]=(0,o.useState)(!1),[i,a]=(0,o.useState)(null),[s,l]=(0,o.useState)(""),{authenticated:c,getAccessToken:d,user:h}=n$(),{walletProxy:u,refreshUser:p,closePrivyModal:g,createAnalyticsEvent:f}=nZ(),{app:y,navigate:w,data:x,onUserCloseViaDialogOrKeybindRef:v}=ny(),{onSuccess:C,onFailure:b}=x.createWallet,_=rC(h),j=e?.recoveryMethod==="user-passcode",k=_?.recoveryMethod==="user-passcode";(0,o.useEffect)(()=>{c||(w("LANDING"),b(new e2("User must be authenticated before setting a password on a Privy wallet")))},[c]);let E=()=>{if(i){b(i),g({shouldCallAuthOnSuccess:!1});return}if(!j){b(new e1("Exited before password was added to wallet")),g({shouldCallAuthOnSuccess:!1});return}C(e),g({shouldCallAuthOnSuccess:!1})};v.current=E;let A=async()=>{let e=await d();if(e&&_?.address&&s&&u)try{if(f({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:_.address,existingRecoveryMethod:_.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k}}),!(await u.setRecovery({accessToken:e,address:_.address,recoveryPassword:s,recoveryMethod:"user-passcode"})).address){a(new e1("Error setting password on privy wallet")),f({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:_.address,existingRecoveryMethod:_.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k,reason:"error setting password"}});return}let r=await p(),n=rC(r);if(!n){a(new e1("Error setting password on privy wallet")),f({eventName:"embedded_wallet_set_recovery_failed",payload:{walletAddress:_.address,existingRecoveryMethod:_.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k,reason:"wallet disconnected"}});return}t(n),f({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:_.address,existingRecoveryMethod:_.recoveryMethod,targetRecoveryMethod:"user-passcode",isResettingPassword:k}})}catch(e){console.warn(e),a(e instanceof Error?e:Error("Error setting password on privy wallet")),f({eventName:"embedded_wallet_set_password_failed",payload:{walletAddress:_.address,reason:e}})}},S=async()=>{j?(C(e),g({shouldCallAuthOnSuccess:!1})):(n(!0),a(null),await A(),n(!1))};return(0,m.jsx)(sr,{appName:y?.name||"privy",config:{initiatedBy:"user",onCancel:E},error:i?"An error has occurred, please try again.":void 0,buttonLoading:r,buttonHideAnimations:!1,password:s,isResettingPassword:k,onPasswordGenerate:()=>l(o3()),onPasswordChange:l,onSubmit:S,onClose:E})},EMBEDDED_WALLET_PASSWORD_CREATE_SCREEN:()=>{let{app:e,navigate:t,data:r,onUserCloseViaDialogOrKeybindRef:n}=ny(),[i,a]=(0,o.useState)(""),[s,l]=(0,o.useState)(!1),[c,d]=(0,o.useState)(),[h,u]=(0,o.useState)(null),{authenticated:p}=n$(),{closePrivyModal:g,isNewUserThisSession:f,initializeWalletProxy:y}=nZ(),{onSuccess:w,onFailure:x,callAuthOnSuccessOnClose:v}=r.createWallet,{createWallet:C}=oC(),[b,_]=(0,o.useState)(null),j=new tI(async()=>{try{let e=await C(c);if(!e)return;_(e),f?t("EMBEDDED_WALLET_CREATED_SCREEN"):(w(e),g({shouldCallAuthOnSuccess:v}))}catch(e){a(e.message)}});(0,o.useEffect)(()=>{h||y(3e4).then(e=>u(e))},[h]),(0,o.useEffect)(()=>{if(!p){t("LANDING"),x(Error("User must be authenticated before creating a Privy wallet"));return}},[p]),n.current=()=>null;let k=async()=>(l(!0),j.execute().then(()=>new Promise(e=>setTimeout(e,250))).finally(()=>l(!1)));return(0,m.jsx)(sr,{config:{initiatedBy:"automatic"},appName:e?.name||"privy",loading:!h,buttonLoading:s,buttonHideAnimations:!b&&s,isResettingPassword:!1,error:i,password:c||"",onClose:()=>{b&&b?.recoveryMethod!=="user-passcode"?(x(new e1("User created a wallet but failed to set a password for it")),g({shouldCallAuthOnSuccess:!1})):b?(w(b),g({shouldCallAuthOnSuccess:v})):(x(new e1("User wallet creation failed")),g({shouldCallAuthOnSuccess:!1}))},onPasswordChange:d,onPasswordGenerate:()=>d(o3()),onSubmit:k})},MFA_ENROLLMENT_FLOW_SCREEN:()=>{let{user:e,enrollInMfa:t}=n$(),[r,n]=(0,o.useState)(null),{unenrollWithSms:i,unenrollWithTotp:a,unenrollWithPasskey:s}=da(),{app:l,ready:c,data:d,onUserCloseViaDialogOrKeybindRef:h}=ny(),{closePrivyModal:u}=nZ(),{promptMfa:p}=di(),{initEnrollmentWithTotp:g}=da(),[f,y]=(0,o.useState)(!1),[w,x]=(0,o.useState)(null),[v,C]=(0,o.useState)(null),b=()=>{u({shouldCallAuthOnSuccess:!0}),t(!1),setTimeout(()=>{n(null),x(null)},500)},{initEnrollmentWithPasskey:_,submitEnrollmentWithPasskey:j}=da(),[k,E]=(0,o.useState)(!1),[A,S]=(0,o.useState)(null);h.current=b;let T=e?.mfaMethods.includes("sms"),P=!!e?.phone,N=e?.mfaMethods.includes("totp"),R=e?.mfaMethods.includes("passkey"),M=T||N||R,O=e?.linkedAccounts.filter(e=>"passkey"===e.type).map(e=>e.credentialId)??[];function I(){n(null),x(null)}async function W(){E(!0);try{await _(),await j({credentialIds:O})}catch(e){S(e)}finally{E(!1)}}async function L(e){if(await p().catch(S),"totp"===e){x(e),C(null),g().then(e=>{C(e)}).catch(()=>{C(null),I()});return}if("passkey"===e&&1===O.length)return await W();x(e)}if((0,o.useEffect)(()=>{M&&y(!0)},[M]),!c||!e||!l)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:b},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(ds,{})}),(0,m.jsx)(iI,{children:(0,m.jsx)(nX,{})}),(0,m.jsx)(iN,{})]});async function F(){n(null);try{await i()}catch{n(null)}}async function U(){n(null);try{await a()}catch{n(null)}}async function D(){n(null);try{await p(),await s()}catch{n(null)}}if("sms"===r)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:I,onClose:b},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(e_.Z,{})})}),(0,m.jsx)(iM,{children:"Remove SMS verification?"}),(0,m.jsxs)(iO,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{warn:!0,onClick:F,children:"Remove SMS for MFA"})}),(0,m.jsx)(iN,{})]});if("totp"===r)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:I,onClose:b},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(eC.Z,{})})}),(0,m.jsx)(iM,{children:"Remove Authenticator App verification?"}),(0,m.jsxs)(iO,{children:["MFA adds an extra layer of security to your ",l?.name," account. Make sure you have other methods to secure your account."]}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{warn:!0,onClick:U,children:"Remove Authenticator App for MFA"})}),(0,m.jsx)(iN,{})]});if("passkey"===r)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:I,onClose:b},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(ej.Z,{})})}),(0,m.jsx)(iM,{children:"Are you sure you want to remove passkey verification?"}),(0,m.jsx)(iO,{children:"This will disable any passkeys you have set up for verification. You’ll still be able to login with your passkeys if you’ve set up passkey login."}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{warn:!0,onClick:D,children:"Yes, remove"})}),(0,m.jsx)(iN,{})]});if(0===d.mfaEnrollmentFlow.mfaMethods.length&&!M)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:b},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(ek.Z,{})})}),(0,m.jsx)(iM,{children:"Add more security"}),(0,m.jsxs)(iO,{children:[l?.name," does not have any verification methods enabled."]}),(0,m.jsx)(iU,{children:(0,m.jsx)(n3,{onClick:b,children:"Close"})}),(0,m.jsx)(iN,{})]});let Z=!M&&!f;return Z?(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{onClose:b},"header"),(0,m.jsx)(iR,{children:(0,m.jsx)(iG,{children:(0,m.jsx)(ek.Z,{})})}),(0,m.jsx)(iM,{children:"Transaction Protection"}),(0,m.jsx)(iO,{children:"Set up transaction protection to add an extra layer of security to your account"}),(0,m.jsxs)(iW,{children:[(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(ec.Z,{})}),"Enable 2-Step verification for your ",l?.name," wallet."]}),(0,m.jsxs)(iF,{children:[(0,m.jsx)(iL,{children:(0,m.jsx)(eb.Z,{})}),"You'll be prompted to authenticate to complete transactions."]})]}),(0,m.jsxs)(iU,{children:[(0,m.jsx)(n3,{onClick:()=>y(!0),children:"Continue"}),(0,m.jsx)(n8,{onClick:b,children:"Not now"})]}),(0,m.jsx)(iN,{})]}):"sms"===w?(0,m.jsx)(dk,{onComplete:b,onReset:I,onClose:b}):"totp"===w&&v?(0,m.jsx)(dA,{onComplete:b,onClose:b,onReset:I,totpInfo:v}):"passkey"===w?(0,m.jsx)(dd,{onComplete:b,onReset:I,onClose:b}):(0,m.jsx)(dc,{showIntro:Z,userMfaMethods:e.mfaMethods,appMfaMethods:l.mfa.methods,userHasAuthSms:P,onBackToIntro:function(){y(!1)},handleSelectMethod:L,isTotpLoading:"totp"===w&&!v,isPasskeyLoading:k,error:A,onClose:b,setRemovingMfaMethod:n})},CAPTCHA_SCREEN:()=>{let{lastScreen:e,currentScreen:t,data:r,navigateBack:n,navigate:i,setModalData:a}=ny(),{status:s,token:l,waitForResult:c,reset:d,execute:h}=nF(),u=(0,o.useRef)([]),p=e=>{u.current=[e,...u.current]},[g,f]=(0,o.useState)(!0);(0,o.useEffect)(()=>(p(setTimeout(f,1e3,!1)),()=>{u.current.forEach(e=>clearTimeout(e)),u.current=[]}),[]);let[y,w]=(0,o.useState)(""),[x,v]=(0,o.useState)("Checking that you are a human..."),[C,b]=(0,o.useState)((0,m.jsx)(n3,{onClick:()=>{},disabled:!0,children:"Continue"})),[_,j]=(0,o.useState)(!1),[k,E]=(0,o.useState)(3),A=r?.captchaModalData,S=async t=>{try{await A?.callback(t),A?.onSuccessNavigateTo&&i(A?.onSuccessNavigateTo,!1)}catch(t){if(t instanceof nW)return;a({errorModalData:{error:t,previousScreen:e||"LANDING"}}),i(A?.onErrorNavigateTo||"ERROR_SCREEN",!1)}};(0,o.useEffect)(()=>{"success"===s?p(setTimeout(async()=>{let e=await c();!e||A?.userIntentRequired||S(e)},1e3)):"ready"===s&&p(setTimeout(()=>{"ready"===s&&h()},500))},[s]),(0,o.useEffect)(()=>{if(!g)switch(s){case"success":w("Success!"),v("CAPTCHA passed successfully."),b((0,m.jsx)(n3,{onClick:()=>{j(!0),S(l)},disabled:!A?.userIntentRequired,loading:_,children:A?.userIntentRequired?"Continue":"Continuing..."}));break;case"loading":w(""),v("Checking that you are a human..."),b((0,m.jsx)(n3,{onClick:()=>{},disabled:!0,children:"Continue"}));break;case"error":w("Something went wrong"),k<=0?(v("If you use an adblocker or VPN, try disabling and re-attempting."),b(null)):(v("You did not pass CAPTCHA. Please try again."),b((0,m.jsx)(n3,{onClick:T,children:"Retry"})))}},[s,g,_]);let T=async()=>{if(k<=0)return;E(e=>e-1),d(),h();let e=await c();!e||A?.userIntentRequired||S(e)};return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{backFn:e&&t!==e?n:void 0}),(0,m.jsxs)(av,{children:["success"===s?(0,m.jsx)(W.Z,{fill:"var(--privy-color-success)",width:"64px",height:"64px"}):"error"===s?(0,m.jsx)(L.Z,{fill:"var(--privy-color-error)",width:"64px",height:"64px"}):(0,m.jsx)(aw,{}),(0,m.jsxs)(i8,{children:[y?(0,m.jsx)("h3",{children:y}):null,(0,m.jsx)("p",{children:x})]}),C]}),(0,m.jsx)(iN,{})]})},ERROR_SCREEN:()=>{let{navigate:e,navigateBack:t,data:r,lastScreen:n,currentScreen:i}=ny(),a=r?.errorModalData?.previousScreen||(n===i?void 0:n);return(0,m.jsx)(si,{error:r?.errorModalData?.error||Error(),backFn:()=>a?e(a,!1):t(),onClick:()=>e(a||"LANDING",!1)})},IN_APP_BROWSER_LOGIN_NOT_POSSIBLE:()=>{let{closePrivyModal:e}=nZ();return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{},"header"),(0,m.jsx)(cv,{children:(0,m.jsx)(N.Z,{style:{width:32,height:32}})}),(0,m.jsx)(ao,{title:"Could not log in with provider",description:"It looks like you're using an in-app browser. To log in, please try again using an external browser.",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",textAlign:"center"}}),(0,m.jsx)(i2,{children:(0,m.jsx)(n3,{onClick:()=>e(),children:"Close"})}),(0,m.jsx)(at,{}),(0,m.jsx)(iP,{})]})},AFFIRMATIVE_CONSENT_SCREEN:()=>{let{user:e,logout:t}=n$(),{app:r,onUserCloseViaDialogOrKeybindRef:n,setModalData:i,navigate:a}=ny(),{acceptTerms:o,closePrivyModal:s,createAnalyticsEvent:l}=nZ(),c=e=>{e?.preventDefault(),s({shouldCallAuthOnSuccess:!1}),t()};n.current=c;let d=async n=>{n.preventDefault(),await o(),e&&rk(e,r?.embeddedWallets?.createOnLogin)?(i({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),l({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,screen:"AffirmativeConsentScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),a("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")):s()};return(0,m.jsx)(iY,{termsAndConditionsUrl:r?.legal.termsAndConditionsUrl,privacyPolicyUrl:r?.legal.privacyPolicyUrl,onAccept:d,onDecline:c})},TELEGRAM_AUTH_SCREEN:()=>{let{authenticated:e,logout:t,ready:r,user:n}=n$(),{app:i,setModalData:a,navigate:s,resetNavigation:l}=ny(),{initLoginWithTelegram:c,loginWithTelegram:d,updateWallets:h,setReadyToTrue:u,closePrivyModal:p,createAnalyticsEvent:g}=nZ(),[f,y]=(0,o.useState)(!1),[w,x]=(0,o.useState)(void 0);async function v(){try{await d(),y(!0),u(!0)}catch(r){if(r?.privyErrorCode==="allowlist_rejected"){x(void 0),l(),s("ALLOWLIST_REJECTION_SCREEN");return}if(r?.privyErrorCode==="max_accounts_reached"){console.error(new e3(r).toString()),x(void 0),l(),s("USER_LIMIT_REACHED_SCREEN");return}if(r?.privyErrorCode==="user_does_not_exist"){x(void 0),l(),s("ACCOUNT_NOT_FOUND_SCREEN");return}let{retryable:e,detail:t}=ry(r);x({retryable:e,detail:t,message:"Authentication failed"})}}(0,o.useEffect)(()=>{v()},[]),(0,o.useEffect)(()=>{if(!(r&&e&&f&&n))return;if(i?.legal.requireUsersAcceptTerms&&!n.hasAcceptedTerms){let e=setTimeout(()=>{s("AFFIRMATIVE_CONSENT_SCREEN")},1400);return()=>clearTimeout(e)}if(rk(n,i?.embeddedWallets?.createOnLogin)){let e=setTimeout(()=>{a({createWallet:{onSuccess:()=>{},onFailure:e=>{console.error(e),g({eventName:"embedded_wallet_creation_failure_logout",payload:{error:e,provider:"telegram",screen:"TelegramAuthScreen"}}),t()},callAuthOnSuccessOnClose:!0}}),s("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")},1400);return()=>clearTimeout(e)}h();let o=setTimeout(()=>p({shouldCallAuthOnSuccess:!0,isSuccess:!0}),1400);return()=>clearTimeout(o)},[r,e,f,n]);let C=f?"Successfully connected with Telegram":w?w.message:"Verifying connection to Telegram",b="";return b=f?"You’re good to go!":w?w.detail:"Just a few moments more",(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{}),(0,m.jsx)(ae,{}),(0,m.jsxs)(ud,{children:[(0,m.jsx)(ig,{children:(0,m.jsxs)("div",{children:[(0,m.jsx)(nQ,{success:f,fail:!!w}),(0,m.jsx)(cJ,{style:{width:"38px",height:"38px"}})]})}),(0,m.jsxs)(i8,{children:[(0,m.jsx)("h3",{children:C}),(0,m.jsx)("p",{children:b})]}),w&&w?.retryable?(0,m.jsx)(ie,{onClick:()=>{c().then(async()=>v()).catch(e=>{let{retryable:t,detail:r}=ry(e);x({retryable:t,detail:r,message:"Authentication failed"})}),x(void 0)},disabled:!f&&!w?.retryable,children:"Retry"}):null]}),(0,m.jsx)(at,{}),(0,m.jsx)(iN,{})]})}},uS=["LANDING","AWAITING_CONNECTION"],uT=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let{ready:r,isModalOpen:n}=n$(),{headless:i}=nh(),{ready:a,currentScreen:s}=ny(),{status:l,execute:c,reset:d,enabled:h}=nF(),u=n&&s&&uS.includes(s)&&!i&&"ready"===l;if((0,o.useEffect)(()=>{u&&c()},[u]),(0,o.useEffect)(()=>{!n&&h&&d()},[n,h]),(!r||!a)&&"AWAITING_OAUTH_SCREEN"!==s&&"CROSS_APP_AUTH_SCREEN"!==s&&"TELEGRAM_AUTH_SCREEN"!==s)return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(il,{}),(0,m.jsx)(ae,{}),(0,m.jsx)(uE,{children:(0,m.jsx)(nX,{})}),(0,m.jsx)(at,{}),(0,m.jsx)(iN,{})]});if(!s&&e)return(0,m.jsx)(hr,{open:e,onClose:t});if(!s)return null;let p=uA[s];return(0,m.jsxs)(m.Fragment,{children:[(0,m.jsx)(ik,{if:!!e,children:(0,m.jsx)(p,{})}),(0,m.jsx)(ik,{if:!e,children:(0,m.jsx)(hr,{open:e,onClose:t})})]})},uP=({isMfaVerifying:e,onMfaVerificationComplete:t})=>{let r=(0,o.useRef)(null),n=nH(r);return(0,m.jsx)(uO,{style:{height:n},id:"privy-modal-content",children:(0,m.jsx)("div",{ref:r,children:(0,m.jsx)(uT,{isMfaVerifying:e,onMfaVerificationComplete:t})})})},uN=()=>{let{closePrivyModal:e}=nZ(),{onUserCloseViaDialogOrKeybindRef:t}=ny();return{gracefulClosePrivyModal:(0,o.useCallback)(()=>{if(!t?.current)return e({shouldCallAuthOnSuccess:!1});t.current()},[e])}},uR=({open:e})=>{let{app:t}=ny(),{gracefulClosePrivyModal:r}=uN(),[n,i]=(0,o.useState)(!1);nG("configureMfa",{onMfaRequired:()=>{t?.mfa.noPromptOnMfaRequired||i(!0)}});let a=e||n;return t.render.standalone?(0,m.jsx)(uv,{children:(0,m.jsx)(uM,{id:"privy-modal-content",children:(0,m.jsx)(uT,{isMfaVerifying:n,onMfaVerificationComplete:()=>i(!1)})})}):(0,m.jsx)(uC,{open:a,id:"privy-dialog","aria-label":"log in or sign up","aria-labelledby":"privy-dialog-title",onClick:()=>r(),children:(0,m.jsx)(uv,{children:(0,m.jsx)(uP,{isMfaVerifying:n,onMfaVerificationComplete:()=>i(!1)})})})},uM=A.ZP.div` display: flex; flex-direction: column; text-align: center; font-size: 14px; line-height: 20px; width: 100%; background: var(--privy-color-background); padding: 0 16px; `,uO=(0,A.ZP)(uM)` transition: height 150ms ease-out; overflow: hidden; // Ensure the modal gets pinned to the top if it ever gets too tall max-height: calc(100svh - 48px); border-radius: var(--privy-border-radius-lg) var(--privy-border-radius-lg) 0 0; box-shadow: 0px 0px 36px rgba(55, 65, 81, 0.15); @media (min-width: 441px) { box-shadow: 0px 8px 36px rgba(55, 65, 81, 0.15); border-radius: var(--privy-border-radius-lg); } `;function uI(e){let t=(0,o.useRef)(null),r=(0,o.useRef)();return(0,o.useEffect)(()=>{r.current?.remove(),r.current=function({botUsername:e,scriptHost:t}){let r=document.createElement("script"),{origin:n}=new URL(t);return r.async=!0,r.src=`${n}/js/telegram-login.js`,r.setAttribute("data-telegram-login",e),r.setAttribute("data-request-access","write"),r.setAttribute("data-lang","en"),r}(e),t.current?.after(r.current)},[e]),(0,m.jsx)("div",{ref:t,hidden:!0})}async function uW(e,t,r,n,i,a=!1){let o=a,s=async s=>{if(o&&t&&t.length>0){s===(a?0:1)?i("configureMfa","onMfaRequired",t):n.current?.reject(new a6("missing_or_invalid_mfa","MFA verification failed, retry."));let o=await new Promise((e,t)=>{r.current={resolve:e,reject:t},setTimeout(()=>{let e=new a6("mfa_timeout","Timed out waiting for MFA code");n.current?.reject(e),t(e)},3e5)});return await e(o)}return await e()},l=null;for(let e=0;e<4;e++)try{l=await s(e),n.current?.resolve(void 0);break}catch(e){if("missing_or_invalid_mfa"===e.type)o=!0;else throw n.current?.resolve(void 0),e}if(null===l){let e=new a6("mfa_verification_max_attempts_reached","Max MFA verification attempts reached");throw n.current?.reject(e),e}return l}var uL=(uY=0,()=>`id-${uY++}`);function uF(e){return void 0!==e.error}var uU=new class{constructor(){this.callbacks={}}enqueue(e,t){this.callbacks[e]=t}dequeue(e,t){let r=this.callbacks[t];if(!r)throw Error(`cannot dequeue ${e} event: no event found for id ${t}`);switch(delete this.callbacks[t],e){case"privy:iframe:ready":case"privy:wallet:create":case"privy:wallet:import":case"privy:wallet:connect":case"privy:wallet:recover":case"privy:wallet:rpc":case"privy:wallet:set-recovery":case"privy:mfa:verify":case"privy:mfa:init-enrollment":case"privy:mfa:submit-enrollment":case"privy:mfa:unenroll":case"privy:mfa:clear":case"privy:farcaster:init-signer":case"privy:farcaster:sign":case"privy:solana-wallet:create":case"privy:solana-wallet:connect":case"privy:solana-wallet:recover":case"privy:solana-wallet:rpc":return r;default:throw Error(`invalid wallet event type ${e}`)}}},uD=new Map,uZ=(e,t)=>"bigint"==typeof t?t.toString():t,uz=(e,t)=>`${e}${JSON.stringify(t,uZ)}`;function u$(e,t,r,n){let i=r.contentWindow;if(!i)throw Error("iframe not initialized");let a=uz(e,t);if("privy:wallet:create"===e){let e=uD.get(a);if(e)return e}let o=new Promise((r,a)=>{let o=uL();uU.enqueue(o,{resolve:r,reject:a}),i.postMessage({id:o,event:e,data:t},n)}).finally(()=>{uD.delete(a)});return uD.set(a,o),o}function uH(e){let t=(0,o.useRef)(null),r=(0,o.useRef)(e.mfaMethods),n=nY(),[i,a]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{r.current=e.mfaMethods},[e.mfaMethods]),(0,o.useEffect)(()=>{if(!i)return;let a=t.current;if(!a)return;function o(t){var r;t&&t.origin===e.origin&&"string"==typeof(r=t.data).event&&/^privy:.+/.test(r.event)&&function(e){switch(e.event){case"privy:iframe:ready":let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data);case"privy:wallet:create":let r=uU.dequeue(e.event,e.id);return uF(e)?r.reject(new a6(e.error.type,e.error.message)):r.resolve(e.data);case"privy:wallet:import":let n=uU.dequeue(e.event,e.id);return uF(e)?n.reject(new a6(e.error.type,e.error.message)):n.resolve(e.data);case"privy:wallet:connect":let i=uU.dequeue(e.event,e.id);return uF(e)?i.reject(new a6(e.error.type,e.error.message)):i.resolve(e.data);case"privy:wallet:recover":let a=uU.dequeue(e.event,e.id);return uF(e)?a.reject(new a6(e.error.type,e.error.message)):a.resolve(e.data);case"privy:wallet:rpc":let o=uU.dequeue(e.event,e.id);return uF(e)?o.reject(new a6(e.error.type,e.error.message)):o.resolve(e.data);case"privy:wallet:set-recovery":let s=uU.dequeue(e.event,e.id);return uF(e)?s.reject(new a6(e.error.type,e.error.message)):s.resolve(e.data);case"privy:mfa:verify":let l=uU.dequeue(e.event,e.id);return uF(e)?l.reject(new a6(e.error.type,e.error.message)):l.resolve(e.data);case"privy:mfa:init-enrollment":{let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:submit-enrollment":{let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:unenroll":{let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:mfa:clear":{let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:init-signer":{let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:farcaster:sign":{let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data)}case"privy:solana-wallet:create":let c=uU.dequeue(e.event,e.id);return uF(e)?c.reject(new a6(e.error.type,e.error.message)):c.resolve(e.data);case"privy:solana-wallet:connect":let d=uU.dequeue(e.event,e.id);return uF(e)?d.reject(new a6(e.error.type,e.error.message)):d.resolve(e.data);case"privy:solana-wallet:recover":let h=uU.dequeue(e.event,e.id);return uF(e)?h.reject(new a6(e.error.type,e.error.message)):h.resolve(e.data);case"privy:solana-wallet:rpc":{let t=uU.dequeue(e.event,e.id);return uF(e)?t.reject(new a6(e.error.type,e.error.message)):t.resolve(e.data)}default:console.warn("Unsupported wallet proxy method:",e)}}(t.data)}let s={create:t=>u$("privy:wallet:create",t,a,e.origin),import:t=>u$("privy:wallet:import",t,a,e.origin),connect:t=>u$("privy:wallet:connect",t,a,e.origin),recover:t=>uW(r=>u$("privy:wallet:recover",{...t,...r},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,n,!t.recoveryMethod||"privy"===t.recoveryMethod),rpc:t=>uW(r=>u$("privy:wallet:rpc",{...t,...r},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,n),createSolana:t=>u$("privy:solana-wallet:create",t,a,e.origin),connectSolana:t=>u$("privy:solana-wallet:connect",t,a,e.origin),recoverSolana:t=>u$("privy:solana-wallet:recover",t,a,e.origin),rpcSolana:t=>u$("privy:solana-wallet:rpc",t,a,e.origin),setRecovery:t=>uW(r=>u$("privy:wallet:set-recovery",{...t,...r},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,n),verifyMfa:t=>uW(r=>u$("privy:mfa:verify",{...t,...r},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,n,!0),initEnrollMfa:t=>uW(r=>u$("privy:mfa:init-enrollment",{...t,...r},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,n),submitEnrollMfa:t=>uW(r=>u$("privy:mfa:submit-enrollment",{...t,...r},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,n),unenrollMfa:t=>uW(r=>u$("privy:mfa:unenroll",{...t,...r},a,e.origin),r.current,e.mfaPromise,e.mfaSubmitPromise,n,!0),clearMfa:t=>u$("privy:mfa:clear",t,a,e.origin),initFarcasterSigner:t=>u$("privy:farcaster:init-signer",t,a,e.origin),signFarcasterMessage:t=>u$("privy:farcaster:sign",t,a,e.origin)};window.addEventListener("message",o);let l=new AbortController;return tf(()=>u$("privy:iframe:ready",{},a,e.origin),{abortSignal:l.signal}).then(()=>e.onLoad(s),(...t)=>{console.warn("Privy iframe failed to load: ",...t),e.onLoadFailed()}),()=>{window.removeEventListener("message",o),l.abort()}},[i]),(0,m.jsx)("iframe",{ref:t,width:"0",height:"0",style:{display:"none",height:"0px",width:"0px"},onLoad:()=>a(!0),src:ty(e.origin,`/apps/${e.appId}/embedded-wallets`,{caid:e.clientAnalyticsId,client_id:e.appClientId})})}var uB=class{constructor(e,t){this.walletProxy=e,this.address=t}async handleSignMessage(e){if(!e.params||"string"!=typeof e.params.message)throw Error("Message must be provided as a string for Solana signMessage RPC");return await u9({message:e.params.message})}async request(e){if(console.debug("EmbeddedSolanaProvider.request() called with args",e),!await uK())throw Error("User must be authenticated to use embedded Solana wallet");if(!await u8())throw new eK("Unable to connect to Solana embedded wallet");if("signMessage"===e.method)return await this.handleSignMessage(e);throw Error("Embedded Solana provider does not yet support this RPC method.")}};async function uq({url:e,popup:t}){return t.location=e,new Promise((e,r)=>{let n=setTimeout(()=>{r(new eK("Authorization request timed out after 2 minutes.")),i()},12e4);function i(){t?.close(),window.removeEventListener("message",s)}let a,o=setInterval(()=>{t?.closed&&!a&&(i(),clearInterval(o),clearTimeout(n),r(new eK("User rejected request")))},300);function s(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(clearTimeout(n),e(t.data),i()),"PRIVY_OAUTH_ERROR"===t.data.type&&(clearTimeout(n),r(new eK(t.data.error)),i()),"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"===t.data.type&&((a=new BroadcastChannel("popup-privy-oauth")).onmessage=s))}window.addEventListener("message",s)})}async function uV({url:e,popup:t,provider:r}){return t.location=e,new Promise((e,r)=>{function n(){t?.close(),window.removeEventListener("message",i)}function i(t){t.data&&("PRIVY_OAUTH_RESPONSE"===t.data.type&&t.data.stateCode&&t.data.authorizationCode&&(e(t.data),n()),"https://cdn.apple-cloudkit.com"===t.origin&&t.data.ckSession&&(e({type:"PRIVY_OAUTH_RESPONSE",ckWebAuthToken:t.data.ckSession}),n()),"PRIVY_OAUTH_ERROR"===t.data.type&&(r(t.data.error),n()))}window.addEventListener("message",i)})}var uG=e=>({id:e.id,raw_id:e.rawId,response:{client_data_json:e.response.clientDataJSON,authenticator_data:e.response.authenticatorData,signature:e.response.signature,user_handle:e.response.userHandle},authenticator_attachment:e.authenticatorAttachment,client_extension_results:{app_id:e.clientExtensionResults.appid,cred_props:e.clientExtensionResults.credProps,hmac_create_secret:e.clientExtensionResults.hmacCreateSecret},type:e.type});function uK(){return uQ?uQ.getAccessToken():Promise.resolve(to.get(tF)||null)}var uY,uQ,uX,uJ,u0,u1,u2,u3,u4=(e,t,r)=>uX(e,t,r),u5=(e,t)=>uJ(e,t),u6=(e,t)=>u0(e,t),u7=()=>u1(),u8=()=>u2(),u9=({message:e})=>u3({message:e}),pe=()=>{let e=new URLSearchParams(window.location.search).get("privy_token");if(!e)return;to.put(tH,e);let t=new URL(window.location.href);t.searchParams.delete("privy_token"),window.history.pushState({},"",t)},pt=({config:e,...t})=>{var r;if(!("string"==typeof(r=t.appId)&&25===r.length))throw new eK("Cannot initialize the Privy provider with an invalid Privy app ID");uQ||(uQ=new nO({appId:t.appId,appClientId:t.clientId,apiUrl:t.apiUrl}));let n=Object.assign({},e);return void 0!==t.createPrivyWalletOnLogin&&n.embeddedWallets?.createOnLogin===void 0&&(n.embeddedWallets||(n.embeddedWallets={}),n.embeddedWallets.createOnLogin=t.createPrivyWalletOnLogin?"users-without-wallets":"off"),void 0!==t.createPrivyWalletOnLogin&&e?.embeddedWallets?.createOnLogin&&console.warn("Both `createPrivyWalletOnLogin` and `config.embeddedWallets.createOnLogin` are set. `createPrivyWalletOnLogin` is deprecated and should be removed."),(0,m.jsx)(nd,{client:uQ,clientConfig:n,legacyCreateEmbeddedWalletFlag:t.createPrivyWalletOnLogin,children:(0,m.jsx)(pr,{...t,client:uQ})})},pr=e=>{let t=e.client,[h,u]=(0,o.useState)(!1),[p,g]=(0,o.useState)(!1),[f,y]=(0,o.useState)(!1),[w,x]=(0,o.useState)(null),[v,C]=(0,o.useState)([]),[b,_]=(0,o.useState)(null),j=(0,o.useRef)(v),[k,E]=(0,o.useState)(!1),[A,S]=(0,o.useState)(null),[T,P]=(0,o.useState)(!1),[N,R]=(0,o.useState)({status:"disconnected",connectedWallet:null,connectError:null,connector:null,connectRetry:np}),[M,O]=(0,o.useState)({status:"initial"}),[I,W]=(0,o.useState)(null),[L,F]=(0,o.useState)(null),U=nh(),D=nu(),[Z,z]=(0,o.useState)(!0),[$,H]=(0,o.useState)({}),[B,q]=(0,o.useState)(null),[V,G]=(0,o.useState)(null),[K,Y]=(0,o.useState)(!1),[Q,X]=(0,o.useState)(!1),J=(0,o.useRef)(null),ee=(0,o.useRef)(null),et=(0,o.useRef)(nB),[er,en]=(0,o.useState)(!1);t.onStoreToken=e=>{e&&nK(et,"accessToken","onAccessTokenGranted",e)},t.onDeleteToken=()=>{x(null),y(!1),nK(et,"accessToken","onAccessTokenRemoved")};let ei=(0,o.useRef)(null),ea=(0,o.useRef)(null),eo=e=>{S(e),setTimeout(()=>{u(!0)},15),t.createAnalyticsEvent({eventName:"modal_open",payload:{initialScreen:e}})},es=e=>{"off"!==U.embeddedWallets.createOnLogin&&z(!0),eo(e)};(0,o.useEffect)(()=>{let e=rb(w);e&&L&&_({address:e.address,connectedAt:Date.now(),walletClientType:"privy",connectorType:"embedded",meta:{name:"Privy Wallet",icon:rG,id:"io.privy.solana.wallet"},getProvider:async()=>new uB(L,e.address)})},[L,w]),(0,o.useEffect)(()=>{if(!w){t.connectors?.removeEmbeddedWalletConnector();return}let r=rC(w),n=r_(w);if(r||t.connectors?.removeEmbeddedWalletConnector(),n||t.connectors?.removeImportedWalletConnector(),!t.connectors){console.debug("Failed to add embedded wallet connector: Client connectors not initialized");return}if(!L){console.debug("Failed to add embedded wallet connector: Wallet proxy not initialized");return}r&&t.connectors.addEmbeddedWalletConnector(L,r.address,U.defaultChain,e.appId),n&&t.connectors.addImportedWalletConnector(L,n.address,U.defaultChain,e.appId)},[L,w]),(0,o.useEffect)(()=>{L&&V?.(L)},[L]),(0,o.useEffect)(()=>{(async()=>{if(!U.customAuth?.enabled)return;z(!0);let{getCustomAccessToken:e,isLoading:r}=U.customAuth;if(!(!p||r))try{let r=await e();if(!r&&f){await eP.logout();return}if(!r||f)return;t.startAuthFlow(new te(r));let{user:n,isNewUser:i}=await t.authenticate();if(!n){await eP.logout();return}x(n||null),E(i||!1),y(!0),X(!0)}catch(e){console.warn(e),f&&await eP.logout()}})()},[U.customAuth?.enabled,U.customAuth?.getCustomAccessToken,U.customAuth?.isLoading,p,f]),(0,o.useEffect)(()=>{Q&&L&&w&&rk(w,U.embeddedWallets.createOnLogin)&&(X(!1),ev(w,3e4).catch(console.error))},[Q&&L&&w]),(0,o.useEffect)(()=>{async function e(){let e,r=el(),n=ec();pe();let i=(0,a.M)();t.initializeConnectorManager({walletConnectCloudProjectId:U.walletConnectCloudProjectId,rpcConfig:U.rpcConfig,chains:U.chains,defaultChain:U.defaultChain,store:i,walletList:U.appearance.walletList,shouldEnforceDefaultChainOnConnect:U.shouldEnforceDefaultChainOnConnect,externalWalletConfig:U.externalWallets,appName:U.name??"Privy"}),t.connectors?.on("connectorInitialized",()=>{e&&clearTimeout(e);let r=t.connectors.walletConnectors.length,n=t.connectors.walletConnectors.reduce((e,t)=>e+(t.initialized?1:0),0);n===r?en(!0):e=setTimeout(()=>{console.debug({message:"Unable to initialize all expected connectors before timeout",initialized:n,expected:r}),en(!0)},1500)}),t.connectors?.initialize().then(()=>{ep()});let o=await t.getAuthenticatedUser(),s=!!o;if(U.customAuth?.enabled||(y(!!o),o&&nK(et,"login","onComplete",o,!1,!0,null,null),x(o)),r){ea.current=s?"link":"login";return}if(n&&!s){ea.current="login",es("TELEGRAM_AUTH_SCREEN");return}eN.setReadyToTrue(!!o)}!p&&D&&e()},[t,B,p,D]),(0,o.useEffect)(()=>{if(p){if(!w||!w.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType)){Y(!0);return}Y(!!v.find(e=>"privy"===e.walletClientType))}},[p,w,v]);let el=()=>{let e=function(){let e=new URLSearchParams(window.location.search),t=e.get("privy_oauth_code"),r=e.get("privy_oauth_state"),n=e.get("privy_oauth_provider");if(!t||!r||!n)return{inProgress:!1};let i=!1;try{i=!!window.opener.location.origin}catch{}return{inProgress:!0,authorizationCode:t,stateCode:r,provider:n,headless:t6(),popupFlow:null!==window.opener&&i}}();if(e.inProgress&&e.popupFlow){if(window.opener.location.origin!==window.location.origin){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Origins between parent and child windows do not match."});return}if("error"===e.authorizationCode){window.opener.postMessage({type:"PRIVY_OAUTH_ERROR",error:"Something went wrong. Try again."});return}window.opener.postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode});return}return e.inProgress&&e.provider.startsWith("privy:")&&!e.popupFlow&&(new BroadcastChannel("popup-privy-oauth").postMessage({type:"PRIVY_OAUTH_RESPONSE",stateCode:e.stateCode,authorizationCode:e.authorizationCode}),window.close()),!!e.inProgress&&!e.headless&&(t.startAuthFlow(new t7(e)),es("AWAITING_OAUTH_SCREEN"),!0)},ec=()=>{let e;let r=(e=function(){let e=new URLSearchParams(window.location.search),t=Number(e.get("id")||""),r=e.get("hash"),n=Number(e.get("auth_date")||""),i=e.get("first_name"),a=e.get("last_name")||void 0,o=e.get("username")||void 0,s=e.get("photo_url")||void 0;if(!(!t||!i||!n||!r))return{id:t,first_name:i,last_name:a,username:o,photo_url:s,auth_date:n,hash:r}}())?(rw(),{...e,flowType:"login-url"}):(e=function(){let e=window.location.hash;if(!e||!e.startsWith("#tgWebAppData"))return;let t=new URLSearchParams(decodeURIComponent(e.replace("#tgWebAppData=",""))),r=t.get("query_id"),n=t.get("user"),i=Number(t.get("auth_date")||""),a=t.get("hash");if(!(!r||!n||!i||!a))return{query_id:r,user:n,auth_date:i,hash:a}}())?(rw(),{...e,flowType:"web-app"}):void 0;if(!r||!U.loginMethods.telegram||!U.loginConfig.telegramAuthConfiguration?.seamlessAuthEnabled)return;let n=new rf;return t.startAuthFlow(n),"login-url"===r.flowType&&(n.meta.telegramWebAppData=void 0,n.meta.telegramAuthResult={id:r.id,first_name:r.first_name,last_name:r.last_name,auth_date:r.auth_date,username:r.username,photo_url:r.photo_url,hash:r.hash}),"web-app"===r.flowType&&(n.meta.telegramAuthResult=void 0,n.meta.telegramWebAppData={query_id:r.query_id,user:r.user,auth_date:r.auth_date,hash:r.hash}),!0},ed=async(e,r,n,i)=>{eh(await t.connectors?.createWalletConnector(e,r)||null,r,n,i)};async function eh(e,t,r,n){if(!e)return R({status:"disconnected",connectedWallet:null,connectError:new eQ("Unable to connect to wallet."),connector:null,connectRetry:np}),n?.(null,r);R({status:"disconnected",connectedWallet:null,connectError:null,connector:e,connectRetry:np}),e instanceof nx&&t&&await e.resetConnection(t),R({connector:e,status:"connecting",connectedWallet:null,connectError:null,connectRetry:()=>eh(e,t,r,n)});try{let t=await e.connect({showPrompt:!0});if(U.shouldEnforceDefaultChainOnConnect&&!U.chains.find(e=>e.id===Number(t?.chainId.replace("eip155:","")))&&!(t?.connectorType==="wallet_connect_v2"&&t?.walletClientType==="metamask")){R(t=>({...t,connector:e,status:"switching_to_supported_chain",connectedWallet:null,connectError:null,connectRetry:np}));try{await t?.switchChain(U.defaultChain.id),t&&(t.chainId=tC(tx(U.defaultChain.id)))}catch{console.warn(`Unable to switch to default chain: ${U.defaultChain.id}`)}}return R(e=>({...e,status:"connected",connectedWallet:t,connectError:null,connectRetry:np})),t&&nK(et,"connectWallet","onSuccess",t),n?.(t,r)}catch(e){return e instanceof eV?(console.warn(e.cause?e.cause:e.message),nK(et,"connectWallet","onError",e.privyErrorCode||"generic_connect_wallet_error")):(console.warn(e),nK(et,"connectWallet","onError","unknown_connect_wallet_error")),R(t=>({...t,status:"disconnected",connectedWallet:null,connectError:e})),n?.(null,r)}}let eu=async(e,r)=>{if(null===e)return;let n=new rp(e,t,r);t.startAuthFlow(n)},ep=()=>{let e=new URLSearchParams(window.location.search),r=e.get("privy_connector"),n=e.get("privy_wallet_client");if(!r||!n)return;if("phantom"!==n||tc()||es("LOGIN_FAILED_SCREEN"),!t.connectors)throw new eK("Connector not initialized");eo("AWAITING_CONNECTION");let i=new URL(window.location.href);i.searchParams.delete("privy_connector"),i.searchParams.delete("privy_wallet_client"),window.history.pushState({},"",i),ed(r,n,void 0,eu)};(0,o.useEffect)(()=>{p&&f&&null===w&&t.getAuthenticatedUser().then(x)},[p,f,w,t]);let em=e=>{if(!f)throw nK(et,"linkAccount","onError","must_be_authenticated",{linkMethod:e}),new eK("User must be authenticated before linking an account.")},eg=()=>{em("siwe"),ei.current="siwe",ea.current="link",eo("LINK_WALLET_SCREEN")},ef=e=>{if(!f||!w)return!1;if("privy"===e.walletClientType)return!0;for(let t of w.linkedAccounts)if("wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType)return!0;return!1},ey=async e=>{if(!t.connectors)throw new eK("Connector not initialized");let r=t.connectors.findWalletConnector(e.connectorType,e.walletClientType)||null;(R(t=>({...t,connector:r,status:"connected",connectedWallet:e,connectError:null,connectRetry:np})),U.captchaEnabled&&!f)?(H({captchaModalData:{callback:t=>eu(e,t),userIntentRequired:!1,onSuccessNavigateTo:"AWAITING_CONNECTION",onErrorNavigateTo:"ERROR_SCREEN"}}),es("CAPTCHA_SCREEN")):(await eu(e),es("AWAITING_CONNECTION"))},ew=async(e,r)=>{let{signedUrl:n,externalTransactionId:i}=await co(t,e,r??{},U.appearance.palette,U.fundingMethodConfig?.moonpay.useSandbox??!1);return{signedUrl:n,externalTransactionId:i}},ex=()=>{C(e=>{let r=t.connectors?.wallets.map(e=>({...e,linked:ef(e),loginOrLink:async()=>{if(!await e.isConnected())throw new eK("Wallet is not connected");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new eK("Cannot link or login with embedded wallet");ey(e)},fund:async t=>{await eN.fundWallet(e.address,t)},unlink:async()=>{if(!f)throw new eK("User is not authenticated.");if("embedded"===e.connectorType&&"privy"===e.walletClientType)throw new eK("Cannot unlink an embedded wallet");x(await t.unlinkWallet(e.address))}}))||[];return n_(e,r)?e:r})};(0,o.useEffect)(()=>{ex()},[w?.linkedAccounts,f,p]),(0,o.useEffect)(()=>{if(p){if(!t.connectors)throw new eK("Connector not initialized");ex(),t.connectors.on("walletsUpdated",ex)}},[p]),(0,o.useEffect)(()=>{if(!v[0])return;let e=v[0],t=j.current.find(t=>t.address===e.address),r;if(r="privy"===e.walletClientType?w?.linkedAccounts.find(t=>"wallet"===t.type&&t.address===e.address&&"privy"===t.walletClientType):w?.linkedAccounts.find(t=>"wallet"===t.type&&t.address===e.address&&"privy"!==t.walletClientType),!t&&r){let e=Object.assign({},w);e.wallet=r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,imported:r.imported},x(e)}j.current=v},[v]);let ev=async(e,t)=>{if(rC(e))throw nK(et,"createWallet","onError","embedded_wallet_already_exists"),Error("Only one Privy wallet per user is currently allowed");let[r,n]=await Promise.all([eN.initializeWalletProxy(t),uK()]);if(!r&&U.customAuth?.enabled)throw nK(et,"createWallet","onError","unknown_embedded_wallet_error"),Error("Failed to connect to wallet proxy");if(!r||!n||U.embeddedWallets?.requireUserOwnedRecoveryOnCreate)return new Promise((e,t)=>{z(!0),H({createWallet:{onSuccess:t=>{nK(et,"createWallet","onSuccess",t),e(t)},onFailure:e=>{nK(et,"createWallet","onError","unknown_embedded_wallet_error"),t(e)},callAuthOnSuccessOnClose:!1}}),eo("EMBEDDED_WALLET_ON_ACCOUNT_CREATE_SCREEN")});{await r.create({accessToken:n});let e=rC(await eN.refreshUser());if(!e)throw nK(et,"createWallet","onError","unknown_embedded_wallet_error"),Error("Failed to create wallet");return nK(et,"createWallet","onSuccess",e),e}},eC=e=>{if(!U.chains.map(e=>e.id).includes(e))throw new eQ(`Chain ID ${e} is not supported. It must be added to the config.supportedChains property of the PrivyProvider.`,"unsupported_chain_id")},eb=(r,i,a)=>new Promise(async(o,s)=>{let{requesterAppId:h}=i||{};if(!f||!w){nK(et,"sendTransaction","onError","must_be_authenticated"),s(Error("User must be authenticated before signing with a Privy wallet"));return}let u=r.from,p=u?w?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&n.Kn(e.address)===n.Kn(u)):rC(w);if(!p){nK(et,"sendTransaction","onError","embedded_wallet_not_found"),s(Error("Must have a Privy wallet before signing"));return}z(!0);let m=t.connectors?.findWalletConnector("embedded","privy")?.proxyProvider,g=r.chainId?Number(r.chainId):m.chainId;eC(g);let y=Object.assign({},r,{chainId:g}),x=async()=>{let t=await uK();if(!t||!L){nK(et,"sendTransaction","onError","embedded_wallet_not_found"),s(Error("Must have valid access token and Privy wallet to send transaction"));return}try{if(!await eN.recoverEmbeddedEthereumWallet()){nK(et,"sendTransaction","onError","unknown_connect_wallet_error"),s(Error("Unable to connect to wallet"));return}let r=tk(y.chainId,U.chains,U.rpcConfig,{appId:e.appId}),n=await (0,l.vT)(p.address,y,r);if(U.embeddedWallets.noPromptOnSignature){let{totalGasEstimate:e}=await (0,c.gM)(n,r),{hasSufficientFunds:t}=await sD(p.address,n,e,r);if(!t)throw new rW(new rI("Wallet has insufficient funds for this transaction.",d.M_.E32603_DEFAULT_INTERNAL_ERROR.eipCode))}let i=await sU(t,p.address,L,n,r,h);nK(et,"sendTransaction","onSuccess",i),o(i)}catch(e){nK(et,"sendTransaction","onError","transaction_failure"),s(e)}};if(U.embeddedWallets.noPromptOnSignature)i&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config"),x();else{let e=eA({address:p.address,fundWalletConfig:a,chainIdOverride:y.chainId,comingFromSendTransactionScreen:!0});H({connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SEND_TRANSACTION_SCREEN",onFailure:e=>{nK(et,"sendTransaction","onError","unknown_connect_wallet_error"),s(e)}},sendTransaction:{transactionRequest:y,onSuccess:e=>{nK(et,"sendTransaction","onSuccess",e),o(e)},onFailure:e=>{nK(et,"sendTransaction","onError","transaction_failure"),s(e)},uiOptions:i||{},fundWalletConfig:a,requesterAppId:h},funding:e}),eo("EMBEDDED_WALLET_CONNECTING_SCREEN")}});function e_(){return new Promise(async(e,t)=>{let r=await uK();if(!r||!L)throw Error("Must have valid access token to enroll in MFA");try{await L.verifyMfa({accessToken:r}),e()}catch(e){t(e)}})}let ej=e=>e?.linkedAccounts.filter(e=>null!==e.latestVerifiedAt&&!("wallet"===e.type&&"privy"===e.walletClientType)).sort((e,t)=>t.latestVerifiedAt.getTime()-e.latestVerifiedAt.getTime())[0],ek=e=>{let t=w?.linkedAccounts.filter(t=>t.type===e).length??0,{displayName:r,loginMethod:n}=cT(e);if("passkey"===e&&t>=5||"passkey"!==e&&t>=1)throw nK(et,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:n}),new eK(`User already has an account of type ${r} linked.`)},eE=()=>{if(!U.loginConfig.telegramAuthConfiguration?.linkEnabled)throw nK(et,"linkAccount","onError","cannot_link_more_of_type",{linkMethod:"telegram"}),new eK("User can't link an account because Telegram linking is disabled.")},eA=({address:e,fundWalletConfig:t,methodScreen:r,chainIdOverride:n=null,comingFromSendTransactionScreen:i=!1})=>{if(!U.fundingConfig||0===U.fundingConfig.methods.length)return;let a=ca(t)&&t.amount?t.amount:U.fundingConfig.defaultRecommendedAmount,o=ca(t)&&t.chain?t.chain.id:sB(U.fundingConfig.defaultRecommendedCurrency.chain),s=ca(t)&&t.chain?t.chain:U.chains.find(e=>e.id===o);if(n&&U.chains.find(e=>e.id===n)&&(s=U.chains.find(e=>e.id===n)),!s)throw new eK("Funding chain is not in PrivyProvider chains list");return{address:e,amount:a,chain:s,methodScreen:r,comingFromSendTransactionScreen:i,...t&&void 0!==t.config&&void 0!==t.provider?{moonpayConfigOverride:t.config}:{}}};async function eS({showAutomaticRecovery:e=!1,legacySetWalletPasswordFlow:t=!1}){S(null);let r=t?"setWalletPassword":"setWalletRecovery";if(!f||!w)throw nK(et,r,"onError","must_be_authenticated"),Error("User must be authenticated before adding recovery method to Privy wallet");let n=rC(w);if(!n||!L)throw nK(et,r,"onError","embedded_wallet_not_found"),Error("Must have a Privy wallet to add a recovery method");if(rb(w))throw Error("Cannot set user-controlled recovery for user with Solana.");try{await e_()}catch(e){throw nK(et,r,"onError","missing_or_invalid_mfa"),e}return new Promise((i,a)=>{z(!0);let o={onSuccess:e=>{nK(et,r,"onSuccess","user-passcode",e),i(e)},onFailure:e=>{nK(et,r,"onError","user_exited_set_password_flow"),a(e)},callAuthOnSuccessOnClose:!1},s="user-passcode"===n.recoveryMethod;H({setWalletPassword:o,createWallet:o,connectWallet:{onCompleteNavigateTo:oi({walletAction:"update",availableRecoveryMethods:U.embeddedWallets.userOwnedRecoveryOptions,legacySetWalletPasswordFlow:t,isResettingPassword:s,showAutomaticRecovery:e}),shouldForceMFA:!1,onFailure:e=>{nK(et,r,"onError","unknown_connect_wallet_error"),a(e)}},recoverySelection:{isInAccountCreateFlow:!1,isResettingPassword:s}}),eo("EMBEDDED_WALLET_CONNECTING_SCREEN")})}async function eT({appId:e}){em(`privy:${e}`),ei.current=`privy:${e}`,ea.current="link";let r=window.open(void 0,void 0,s5({w:440,h:680}));return t.createAnalyticsEvent({eventName:"cross_app_auth_started",payload:{appId:e}}),new Promise(async(n,i)=>{let{name:a,logoUrl:o}=await s0({api:t.api,providerAppId:e,requesterAppId:U.id});H({crossAppAuth:{appId:e,name:a,logoUrl:o,popup:r,onSuccess:n,onError:i}}),es("CROSS_APP_AUTH_SCREEN")})}let eP={ready:p,authenticated:f,user:w,walletConnectors:t.connectors||null,connectWallet:e=>{e&&"suggestedAddress"in e&&e.suggestedAddress&&W((0,n.Kn)(e.suggestedAddress)),eo(f?"CONNECT_ONLY_AUTHENTICATED_SCREEN":"CONNECT_ONLY_LANDING_SCREEN")},importWallet:async({privateKey:e})=>{em("siwe");let[t,r]=await Promise.all([eN.initializeWalletProxy(15e3),uK()]);if(t&&r){await t.import({privateKey:e,accessToken:r});let n=r_(await eN.refreshUser());if(!n)throw nK(et,"createWallet","onError","unknown_embedded_wallet_error"),Error("Failed to import wallet");return nK(et,"createWallet","onSuccess",n),n}throw new eK("User is not authenticated")},linkWallet:eg,linkCrossAppAccount:eT,linkEmail:()=>{em("email"),ek("email"),ei.current="email",ea.current="link",eo("LINK_EMAIL_SCREEN")},linkPhone:()=>{em("sms"),ek("phone"),ei.current="sms",ea.current="link",eo("LINK_PHONE_SCREEN")},linkGoogle:async()=>{em("google"),ek("google_oauth"),ea.current="link",await eN.initLoginWithOAuth("google")},linkTwitter:async()=>{em("twitter"),ek("twitter_oauth"),ea.current="link",await eN.initLoginWithOAuth("twitter")},linkDiscord:async()=>{em("discord"),ek("discord_oauth"),ea.current="link",await eN.initLoginWithOAuth("discord")},linkGithub:async()=>{em("github"),ek("github_oauth"),ea.current="link",await eN.initLoginWithOAuth("github")},linkSpotify:async()=>{em("spotify"),ek("spotify_oauth"),ea.current="link",await eN.initLoginWithOAuth("spotify")},linkInstagram:async()=>{em("instagram"),ek("instagram_oauth"),ea.current="link",await eN.initLoginWithOAuth("instagram")},linkTiktok:async()=>{em("tiktok"),ek("tiktok_oauth"),ea.current="link",await eN.initLoginWithOAuth("tiktok")},linkLinkedIn:async()=>{em("linkedin"),ek("linkedin_oauth"),ea.current="link",await eN.initLoginWithOAuth("linkedin")},linkApple:async()=>{em("apple"),ek("apple_oauth"),ea.current="link",await eN.initLoginWithOAuth("apple")},linkPasskey:async()=>{em("passkey"),ek("passkey"),await eN.initLinkWithPasskey(),eo("LINK_PASSKEY_SCREEN")},linkTelegram:async()=>{em("telegram"),ek("telegram"),eE(),ea.current="link",ei.current="telegram",await eN.initLoginWithTelegram(),eo("TELEGRAM_AUTH_SCREEN")},linkFarcaster:async()=>{em("farcaster"),ek("farcaster"),await eN.initLoginWithFarcaster(),ea.current="link",ei.current="farcaster",eo("AWAITING_FARCASTER_CONNECTION")},updateEmail:()=>{if(em("email"),!w?.email)throw new eK("User does not have an email linked to their account.");ea.current="link",ei.current="email",eo("UPDATE_EMAIL_SCREEN")},updatePhone:()=>{if(em("sms"),!w?.phone)throw new eK("User does not have a phone number linked to their account.");ea.current="link",ei.current="sms",eo("UPDATE_PHONE_SCREEN")},login:async e=>{e&&"target"in e&&e&&(e=void 0);let t="Attempted to log in, but user is already logged in. Use a `link` helper instead.";if(!p){let e=await new Promise(e=>{q(t=>e.bind(t))});if(q(null),e){console.warn(t);return}}if(w&&!w.isGuest){console.warn(t);return}ea.current="login",H({login:e}),es("LANDING")},connectOrCreateWallet:async()=>{if(p||(await new Promise(e=>{q(()=>e)}),q(null)),f){console.warn("User must be unauthenticated to `connectOrCreateWallet`");return}if(v[0]){console.warn("User must have no connected wallets to `connectOrCreateWallet`");return}es("CONNECT_OR_CREATE")},logout:async()=>{if(w&&t.clearProviderAcccessTokens(w),S(null),await t.logout(),w&&L)try{await L.clearMfa({userId:w.id})}catch{}x(null),y(!1),nK(et,"logout","onSuccess"),ea.current=null,ei.current=null,u(!1),to.del(tB),to.del(tq(U.id))},getAccessToken:()=>t.getAccessToken(),getEthereumProvider:()=>{if(!w||!w.wallet)return new rF;let e=v.find(e=>w.wallet&&e.address===w.wallet.address),r=t.connectors?.walletConnectors.find(t=>t.wallets.find(t=>t.address===e?.address));return e&&r?r.proxyProvider:new rF},getEthersProvider:()=>{if(!w||!w.wallet)return new i.Q(new rZ(new rF));let e=v.find(e=>w.wallet&&e.address===w.wallet.address),r=t.connectors?.walletConnectors.find(t=>t.wallets.find(t=>t.address===e?.address));return new i.Q(new rZ(e&&r?r.proxyProvider:new rF))},getWeb3jsProvider:()=>{if(!w||!w.wallet)return new rz(new rF);let e=v.find(e=>w.wallet&&e.address===w.wallet.address),r=t.connectors?.walletConnectors.find(t=>t.wallets.find(t=>t.address===e?.address));return new rz(e&&r?r.proxyProvider:new rF)},unlinkWallet:async e=>{let r=await t.unlinkWallet(e);return x(r),r},unlinkEmail:async e=>{let r=await t.unlinkEmail(e);return x(r),r},unlinkPhone:async e=>{let r=await t.unlinkPhone(e);return x(r),r},unlinkGoogle:async e=>{let r=await t.unlinkOAuth("google",e);return x(r),r},unlinkTwitter:async e=>{let r=await t.unlinkOAuth("twitter",e);return x(r),r},unlinkDiscord:async e=>{let r=await t.unlinkOAuth("discord",e);return x(r),r},unlinkGithub:async e=>{let r=await t.unlinkOAuth("github",e);return x(r),r},unlinkSpotify:async e=>{let r=await t.unlinkOAuth("spotify",e);return x(r),r},unlinkInstagram:async e=>{let r=await t.unlinkOAuth("instagram",e);return x(r),r},unlinkTiktok:async e=>{let r=await t.unlinkOAuth("tiktok",e);return x(r),r},unlinkLinkedIn:async e=>{let r=await t.unlinkOAuth("linkedin",e);return x(r),r},unlinkApple:async e=>{let r=await t.unlinkOAuth("apple",e);return x(r),r},unlinkFarcaster:async e=>{let r=await t.unlinkFarcaster(e);return x(r),r},unlinkTelegram:async e=>{let r=await t.unlinkTelegram(e);return x(r),r},unlinkPasskey:async e=>{let r=await t.unlinkPasskey(e);return x(r),r},unlinkCrossAppAccount:async({subject:e})=>{let r=w?.linkedAccounts.find(t=>"cross_app"===t.type&&t.subject===e)?.providerApp;if(!r)throw new eK("Invalid subject");t.storeProviderAccessToken(r.id,null);let n=await t.unlinkOAuth(`privy:${r.id}`,e);return x(n),n},setActiveWallet:async e=>{let t=v.find(t=>(0,n.Kn)(t.address)===(0,n.Kn)(e)),r=w?.linkedAccounts.find(t=>"wallet"===t.type&&n.Kn(t.address)===n.Kn(e));if(t&&await t.isConnected()){if(t.linked){let e=Object.assign({},w);e.wallet=r&&{address:r.address,chainType:r.chainType,chainId:r.chainId,walletClient:r.walletClient,walletClientType:r.walletClientType,connectorType:r.connectorType,imported:r.imported},x(e)}else t.loginOrLink()}else W(e),eg()},forkSession:()=>t.forkSession(),createWallet:async()=>{if(!f||!w)throw nK(et,"createWallet","onError","must_be_authenticated"),Error("User must be authenticated before creating a Privy wallet");return ev(w,15e3)},setWalletRecovery:async e=>eS({legacySetWalletPasswordFlow:!1,showAutomaticRecovery:e?.showAutomaticRecovery??!1}),setWalletPassword:async()=>eS({legacySetWalletPasswordFlow:!0,showAutomaticRecovery:!1}),signMessage:(e,r,i)=>new Promise(async(a,o)=>{let{requesterAppId:s}=r||{};if(!f||!w){nK(et,"signMessage","onError","must_be_authenticated"),o(Error("User must be authenticated before signing with a Privy wallet"));return}let l=i?w?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType&&n.Kn(e.address)===n.Kn(i)):rC(w);if(!l){nK(et,"signMessage","onError","embedded_wallet_not_found"),o(Error("Must have a Privy wallet before signing"));return}if("string"!=typeof e||e.length<1){nK(et,"signMessage","onError","invalid_message"),o(Error("Message must be a non-empty string"));return}z(!0);let c=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let r=await uK();if(!L||!r||!await eN.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_started",payload:{walletAddress:l.address,requesterAppId:s}});let{response:n}=await L.rpc({accessToken:r,address:l.address,requesterAppId:s,request:{method:"personal_sign",params:[e,l.address]}}),i=n.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_message_completed",payload:{walletAddress:l.address,requesterAppId:s}}),i};if(U.embeddedWallets.noPromptOnSignature){r&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let e=await c();nK(et,"signMessage","onSuccess",e),a(e)}catch(e){nK(et,"signMessage","onError","unable_to_sign"),o(e??new rW("Unable to sign message"))}}else H({signMessage:{method:"personal_sign",data:e,confirmAndSign:c,onSuccess:e=>{nK(et,"signMessage","onSuccess",e),a(e)},onFailure:e=>{nK(et,"signMessage","onError","unable_to_sign"),o(e)},uiOptions:r||{}},connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:e=>{nK(et,"signMessage","onError","unknown_connect_wallet_error"),o(e)},address:l.address}}),eo("EMBEDDED_WALLET_CONNECTING_SCREEN")}),signTypedData:(e,r)=>new Promise(async(n,i)=>{let{requesterAppId:a}=r||{};if(!f||!w){nK(et,"signTypedData","onError","must_be_authenticated"),i(Error("User must be authenticated before signing with a Privy wallet"));return}let o=rC(w);if(!o){nK(et,"signTypedData","onError","embedded_wallet_not_found"),i(Error("Must have a Privy wallet before signing"));return}z(!0);let s=tE(e),l=async()=>{if(!f)throw Error("User must be authenticated before signing with a Privy wallet");let e=await uK();if(!L||!e||!await eN.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_started",payload:{walletAddress:o.address,requesterAppId:a}});let{response:r}=await L.rpc({accessToken:e,address:o.address,requesterAppId:a,request:{method:"eth_signTypedData_v4",params:[o.address,s]}}),n=r.data;return t.createAnalyticsEvent({eventName:"embedded_wallet_sign_typed_data_completed",payload:{walletAddress:o.address,requesterAppId:a}}),n};if(U.embeddedWallets.noPromptOnSignature||U.legacyWalletUiConfig){r&&console.warn("uiOptions defined with `noPromptOnSignature` set to true in app config");try{let e=await l();nK(et,"signTypedData","onSuccess",e),n(e)}catch(e){nK(et,"signTypedData","onError","unable_to_sign"),i(e??new rW("Unable to sign message"))}}else H({signMessage:{method:"eth_signTypedData_v4",data:s,confirmAndSign:l,onSuccess:e=>{nK(et,"signTypedData","onSuccess",e),n(e)},onFailure:e=>{nK(et,"signTypedData","onError","unable_to_sign"),i(e)},uiOptions:r||{}},connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_SIGN_REQUEST_SCREEN",onFailure:e=>{nK(et,"signMessage","onError","unknown_connect_wallet_error"),i(e)}}}),eo("EMBEDDED_WALLET_CONNECTING_SCREEN")}),sendTransaction:async(e,t,r)=>sZ(await (await eb(e,t,r)).wait()),exportWallet:()=>new Promise(async(r,n)=>{if(!f||!w){n(Error("User must be authenticated before exporting their Privy wallet"));return}if(!rC(w)){n(Error("Must have a Privy wallet before exporting"));return}if(z(!0),H($),!await uK()||!L){n(Error("Must have valid access token to enroll in MFA"));return}if(!L){n(Error("Must have a Privy wallet before exporting"));return}H({keyExport:{appId:e.appId,appClientId:e.clientId,origin:t.apiUrl,onSuccess:r,onFailure:n},connectWallet:{onCompleteNavigateTo:"EMBEDDED_WALLET_KEY_EXPORT_SCREEN",onFailure:n,shouldForceMFA:!0}}),eo("EMBEDDED_WALLET_CONNECTING_SCREEN")}),promptMfa:e_,async init(e){switch(e){case"sms":await t.initMfaSmsVerification();return;case"passkey":return await t.initMfaPasskeyVerification();case"totp":return;default:throw Error(`Unsupported MFA method: ${e}`)}},async submit(e,t){switch(e){case"totp":case"sms":if("string"!=typeof t)throw new eK("Invalid MFA code");J.current?.resolve({mfaMethod:e,mfaCode:t,relyingParty:window.origin}),await new Promise((e,t)=>{ee.current={resolve:e,reject:t}});break;case"passkey":if("string"==typeof t)throw new eK("Invalid authenticator response");let n=uG(await (await r.e(550).then(r.bind(r,74550))).startAuthentication(t));J.current?.resolve({mfaMethod:e,mfaCode:n,relyingParty:window.origin}),await new Promise((e,t)=>{ee.current={resolve:e,reject:t}});break;default:throw J.current?.reject(new eK("Unsupported MFA method")),new eK(`Unsupported MFA method: ${e}`)}},cancel(){J.current?.reject(new eK("MFA canceled"))},async initEnrollmentWithSms(e){let t=await uK();if(!t||!L)throw Error("Must have valid access token to enroll in MFA");await L.initEnrollMfa({method:"sms",accessToken:t,phoneNumber:e.phoneNumber})},enrollInMfa:e=>new Promise((t,r)=>{if(!e){eN.closePrivyModal(),t();return}U.mfa.noPromptOnMfaRequired&&console.warn("[Privy Warning] Triggering the 'showMfaEnrollmentModal' function when 'noPromptOnMfaRequired' is set to true is unexpected. If this is intentional, ensure that you are building custom UIs for MFA verification."),H({mfaEnrollmentFlow:{mfaMethods:U.mfa.methods,onSuccess:t,onFailure:r}}),eo("MFA_ENROLLMENT_FLOW_SCREEN")}),async initEnrollmentWithTotp(){let e=await uK();if(!e||!L)throw Error("Must have valid access token to enroll in MFA");let t=await L.initEnrollMfa({method:"totp",accessToken:e});return{secret:t.secret,authUrl:t.authUrl}},async submitEnrollmentWithSms(e){let r=await uK();if(!r||!L)throw Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"sms",accessToken:r,phoneNumber:e.phoneNumber,code:e.mfaCode}),x(await t.getAuthenticatedUser())},async submitEnrollmentWithTotp(e){let r=await uK();if(!r||!L)throw Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"totp",accessToken:r,code:e.mfaCode}),x(await t.getAuthenticatedUser())},async initEnrollmentWithPasskey(){},async submitEnrollmentWithPasskey({credentialIds:e}){let r=await uK();if(!r||!L)throw Error("Must have valid access token to enroll in MFA");await L.submitEnrollMfa({method:"passkey",accessToken:r,credentialIds:e}),x(await t.getAuthenticatedUser())},async unenroll(e){let r=await uK();if(!r||!L)throw Error("Must have valid access token to remove MFA");"passkey"===e?await L.submitEnrollMfa({method:"passkey",accessToken:r,credentialIds:[]}):await L.unenrollMfa({method:e,accessToken:r}),x(await t.getAuthenticatedUser())},requestFarcasterSignerFromWarpcast:async()=>{let e=await uK(),r=w?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!e)throw Error("Must have valid access token to connect with Farcaster");if(!L||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!w?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await eN.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");let n=await L.initFarcasterSigner({address:r.address,hdWalletIndex:null,accessToken:e,mfaCode:null,mfaMethod:null,relyingParty:window.origin});"approved"===n.status&&x(await t.getAuthenticatedUser()||w||null),H({farcasterSigner:n}),eo("AWAITING_FARCASTER_SIGNER")},getFarcasterSignerPublicKey:async()=>{let e,t=await uK(),r=w?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!L||!r)throw Error("Must have an embedded wallet to use Farcaster signers");if(!w?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await eN.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");if(!w.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");return e=w.farcaster.signerPublicKey.slice(2),Uint8Array.from(e.match(/.{1,2}/g).map(e=>parseInt(e,16)))},signFarcasterMessage:async e=>{let t=await uK(),n=w?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!t)throw Error("Must have valid access token to connect with Farcaster");if(!L||!n)throw Error("Must have an embedded wallet to use Farcaster signers");if(!w?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");if(!await eN.recoverEmbeddedEthereumWallet())throw Error("Unable to connect to wallet");if(!w.farcaster?.signerPublicKey)throw Error("Must have a Farcaster signer public key to sign");let i=await r.e(550).then(r.bind(r,74550)),a=await L.signFarcasterMessage({address:n.address,hdWalletIndex:null,accessToken:t,mfaCode:null,mfaMethod:null,payload:{hash:i.bufferToBase64URLString(e)},fid:BigInt(w.farcaster.fid),relyingParty:window.origin});return new Uint8Array(i.base64URLStringToBuffer(a.signature))},createGuestAccount:async()=>{if(w&&!w.isGuest)throw Error("User cannot already be authenticated to create a guest account");return w?.isGuest?w:eN.loginWithGuestAccountFlow()},isHeadlessOAuthLoading:T,loginWithCode:e=>eN.loginWithCode(e),initLoginWithEmail:e=>eN.initLoginWithEmail(e),initLoginWithSms:e=>eN.initLoginWithSms(e),otpState:M,fundWallet:(e,t)=>eN.fundWallet(e,t),initLoginWithHeadlessOAuth:(e,t)=>eN.initLoginWithHeadlessOAuth(e,t),loginWithHeadlessOAuth:e=>eN.loginWithHeadlessOAuth(e),generateSiweMessage:({address:e,chainId:t})=>eN.generateSiweMessage({address:e,chainId:t}),linkWithSiwe:({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})=>(em("siwe"),eN.linkWithSiwe({message:e,signature:t,chainId:r,walletClientType:n,connectorType:i})),signMessageWithCrossAppWallet:(e,{address:r})=>s3({user:w,client:t,address:r,requesterAppId:U.id,request:{method:"personal_sign",params:[e,r]},reconnect:eT}),signTypedDataWithCrossAppWallet(e,{address:r}){let n=tE(e);return s3({user:w,client:t,address:r,requesterAppId:U.id,request:{method:"eth_signTypedData_v4",params:[r,n]},reconnect:eT})},sendTransactionWithCrossAppWallet:(e,{address:r})=>s3({user:w,client:t,address:r,requesterAppId:U.id,request:{method:"eth_sendTransaction",params:[e]},reconnect:eT}),isModalOpen:h,mfaMethods:U.mfa.methods};uX=eP.signMessage,uJ=eP.signTypedData,u0=async(...e)=>{let t=await eb(...e);return U.embeddedWallets.waitForTransactionConfirmation&&await t.wait(),t};let eN={isNewUserThisSession:k,linkingOrConnectingHint:I,pendingTransaction:null,walletConnectionStatus:N,connectors:t.connectors?.walletConnectors??[],rpcConfig:U.rpcConfig,chains:U.chains,appId:e.appId,showFiatPrices:"native-token"!==U.embeddedWallets.priceDisplay.primary,clientAnalyticsId:t.clientAnalyticsId,nativeTokenSymbolForChainId:e=>U.chains.find(t=>t.id===Number(e))?.nativeCurrency.symbol,initializeWalletProxy:async e=>{if(L)return L;let t=new Promise(e=>{G(()=>t=>e(t))}),r=new Promise(t=>setTimeout(()=>t(null),e)),n=await Promise.race([t,r]);return G(null),n},getAuthFlow:()=>t.authFlow,getAuthMeta:()=>t.authFlow?.meta,closePrivyModal:async(r={shouldCallAuthOnSuccess:!0,isSuccess:!1})=>{let n=p&&f&&w,i;if(n&&ei.current&&(i=ej(w)),"login"===ea.current?r.shouldCallAuthOnSuccess&&n&&ei.current?(nK(et,"login","onComplete",w,k,!1,ei.current,i??null),e.onSuccess?.(w,k)):nK(et,"login","onError","exited_auth_flow"):"link"===ea.current&&i&&(r.isSuccess&&n&&ei.current?nK(et,"linkAccount","onSuccess",w,ei.current,i):ei.current&&nK(et,"linkAccount","onError","exited_link_flow",{linkMethod:ei.current})),A&&hb.includes(A)&&$.funding){let t=h_[A]??null,r=tk($.funding.chain.id,U.chains,U.rpcConfig,{appId:e.appId}),n;try{n=(await r.getBalance($.funding.address)).toBigInt()}catch{console.error("Unable to pull wallet balance")}nK(et,"fundWallet","onUserExited",{address:$.funding.address,chain:$.funding.chain,fundingMethod:t,balance:n})}W(null),ea.current=null,ei.current=null,E(!1),u(!1),setTimeout(()=>{t.authFlow=void 0},200),t.createAnalyticsEvent({eventName:"modal_closed"})},solanaSignMessage:async({message:e})=>new Promise(async(r,n)=>{let i=async()=>{let r=await t.getAccessToken();if(!r)throw Error("User must be authenticated to use their embedded wallet.");if(!b)throw Error("User must have an embedded Solana wallet to sign messages for Solana.");let n=eN.walletProxy??await eN.initializeWalletProxy(15e3);if(!n)throw Error("Failed to initialize embedded wallet proxy.");let{response:i}=await n.rpcSolana({accessToken:r,publicKey:b.address,request:{method:"signMessage",params:{message:e}}});return i.data.signature};if(U.embeddedWallets.noPromptOnSignature)try{let e=await i();r({signature:e})}catch(e){n(e)}else H({signMessage:{method:"solana_signMessage",data:e,confirmAndSign:i,onSuccess:e=>{r({signature:e})},onFailure:e=>{n(e)},uiOptions:{}}}),es("EMBEDDED_WALLET_SIGN_REQUEST_SCREEN")}),openPrivyModal:eo,connectWallet:eh,initLoginWithWallet:async(e,t)=>{ei.current="siwe",eu(e,t)},loginWithWallet:async()=>{let e,r;if(!p)throw new e0;if(!(t.authFlow instanceof rp))throw new eK("Must initialize SIWE flow first.");if(f)try{({user:e}=await t.link()),ei.current="siwe"}catch(e){throw nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),e}else try{({user:e,isNewUser:r}=await t.authenticate()),ei.current="siwe"}catch(e){throw nK(et,"login","onError",e.privyErrorCode||"generic_connect_wallet_error"),e}x(e||w||null),E(r||!1),y(!0)},initLoginWithFarcaster:async e=>{let r=new tW(e);t.startAuthFlow(r);try{ei.current="farcaster",await r.initializeFarcasterConnect()}catch(e){throw"login"===ea.current?nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"):"link"===ea.current&&nK(et,"linkAccount","onError",e.privyErrorCode||"unknown_auth_error",{linkMethod:"farcaster"}),e}},loginWithFarcaster:async()=>{let e,r;if(!p)throw new e0;if(!(t.authFlow instanceof tW))throw new eK("Must initialize Farcaster flow first.");if(f)try{({user:e}=await t.link()),ei.current="farcaster"}catch(e){throw nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"farcaster"}),e}else try{({user:e,isNewUser:r}=await t.authenticate()),ei.current="farcaster"}catch(e){throw nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"),e}x(e||null),E(r||!1),y(!0)},async loginWithGuestAccountFlow(){let e=new t3(this.appId);t.startAuthFlow(e);try{ea.current="login",ei.current="guest";let{user:e,isNewUser:r}=await t.authenticate();if(r=r||!1,!e)throw new eK("Unable to authenticate guest account");if(rk(e,U.embeddedWallets.createOnLogin))try{await ev(e,15e3),e=await eN.refreshUser()}catch{x(e),console.warn("Unable to create embedded wallet for guest account")}else x(e);return E(r),y(!0),nK(et,"login","onComplete",e,r,!1,"guest",null),e}catch(e){throw nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"),e}},async crossAppAuthFlow({appId:e,popup:r}){let n=`privy:${e}`;ei.current=n;let{url:i,stateCode:a,codeVerifier:o}=await s1({api:t.api,appId:e});if(!i)throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:"Unable to open cross-app auth popup",appId:e}}),new eK("No authorization URL returned for cross-app auth.");try{let s=await uq({url:i,popup:r,provider:n}),l=s.stateCode,c=s.authorizationCode;if(l!==a)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:n,storedStateCode:a??"",returnedStateCode:l??""}}),new eK("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");let d=await s2({api:uQ.api,appId:e,codeVerifier:o,stateCode:l,authorizationCode:c});d&&t.storeProviderAccessToken(e,d);let h=await eN.refreshUser();if(!h)throw new eK("Unable to update user");return t.createAnalyticsEvent({eventName:"cross_app_auth_completed",payload:{appId:e}}),h}catch(e){throw t.createAnalyticsEvent({eventName:"cross_app_auth_error",payload:{error:e.toString(),provider:n}}),e}},async initLoginWithOAuth(e,r){if(ei.current=e,ta()){if("google"===e&&aN(window.navigator.userAgent)){es("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}}else{es("IN_APP_BROWSER_LOGIN_NOT_POSSIBLE");return}"twitter"===e&&window.opener&&window.opener.postMessage({type:"PRIVY_OAUTH_USE_BROADCAST_CHANNEL"},"*"),to.del(tY);let n=new t7({provider:e});r&&n.addCaptchaToken(r),t.startAuthFlow(n);let i=await t.authFlow.getAuthorizationUrl();i&&i.url&&("twitter"===e&&s.Dt&&(i.url=i.url.replace("x.com","twitter.com")),window.location.assign(i.url))},async initLoginWithTelegram(e){if(!p)throw new e0;ei.current="telegram";let r=new rf(e);t.startAuthFlow(r),r.meta.telegramWebAppData=void 0,r.meta.telegramAuthResult=await new Promise((e,t)=>U.loginConfig.telegramAuthConfiguration?window.Telegram?void window.Telegram.Login.auth({bot_id:U.loginConfig.telegramAuthConfiguration.botId,request_access:!0},r=>r?e(r):t(new eK("Telegram auth failed or was canceled by the client"))):t(new eK("Telegram was not initialized")):t(new eK("Telegram Auth configuration is not loaded")))},async loginWithTelegram(){let e,r;if(!(t.authFlow instanceof rf))throw new eK("Must initialize Telegram flow before calling loginWithTelegram");if(f)try{({user:e}=await t.link()),ei.current="telegram"}catch(e){throw nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),e}else try{let n=await t.authenticate();e=n.user,r=n.isNewUser,ei.current="telegram"}catch(e){throw"login"===ea.current?nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"):"link"===ea.current&&nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"telegram"}),e}x(e),E(r||!1),y(!0)},async recoveryOAuthFlow(e,r,n){let i,a;function o(r){if(!r)throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:"Unable to open recovery OAuth popup",provider:e}}),new eK("Recovery OAuth failed")}switch(e){case"google-drive":{let r,s,{url:l,codeVerifier:c,stateCode:d}=await oo({api:uQ.api,provider:e});o(l);try{let i=await uV({url:l,popup:n,provider:e});if(r=i.stateCode,s=i.authorizationCode,r!==d)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:d??"",returnedStateCode:r??""}}),new eK("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected")}catch(r){throw t.createAnalyticsEvent({eventName:"recovery_oauth_error",payload:{error:r.toString(),provider:e}}),new eK("Recovery OAuth failed")}[i,a]=await Promise.all([uK(),os({api:uQ.api,provider:e,codeVerifier:c,stateCode:r,authorizationCode:s})]);break}case"icloud":{let{url:t}=await oo({api:uQ.api,provider:e});o(t);let{ckWebAuthToken:r}=await uV({url:t,popup:n,provider:e});a=r,i=await uK()}}if(!L)throw new eK("Cannot connect to wallet proxy");if(!i)throw new eK("Unable to authorize user");switch(r){case"recover":let s=$.recoverWallet?.privyWallet?.address;if(!s)throw new eK("Recovery OAuth failed");t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_started",payload:{walletAddress:s,recoveryMethod:e}}),await L.recover({address:s,accessToken:i,recoveryAccessToken:a,recoveryMethod:e}),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:s,recoveryMethod:e}});break;case"create-wallet":t.createAnalyticsEvent({eventName:"embedded_wallet_creation_started"}),await L.create({accessToken:i,recoveryAccessToken:a,recoveryMethod:e});let l=rC(await eN.refreshUser());if(!l)throw nK(et,"createWallet","onError","unknown_embedded_wallet_error"),Error("Failed to create wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_creation_completed",payload:{walletAddress:l.address}}),nK(et,"createWallet","onSuccess",l);break;case"set-recovery":let c=rC(w);if(!c)throw nK(et,"setWalletRecovery","onError","embedded_wallet_not_found"),Error("Embedded wallet not found");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_started",payload:{walletAddress:c.address,existingRecoveryMethod:c.recoveryMethod,targetRecoveryMethod:e}}),await L.setRecovery({address:c.address,accessToken:i,recoveryAccessToken:a,recoveryMethod:e});let d=rC(await eN.refreshUser());if(!d)throw nK(et,"createWallet","onError","unknown_embedded_wallet_error"),Error("Failed to set recovery on wallet");t.createAnalyticsEvent({eventName:"embedded_wallet_set_recovery_completed",payload:{walletAddress:c.address,existingRecoveryMethod:c.recoveryMethod,targetRecoveryMethod:e}}),nK(et,"setWalletRecovery","onSuccess",e,d);break;default:throw new eK("Unsupported recovery action")}},async loginWithOAuth(e){let r,n,i;if(!(t.authFlow instanceof t7))throw new eK("Must initialize OAuth flow before calling loginWithOAuth");let a=to.get(tG),o=t.authFlow.meta.stateCode;if(a!==o)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e,storedStateCode:a??"",returnedStateCode:o??""}}),new eK("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");if(f)try{let n=await t.link();r=n.user,i=n.oAuthTokens,ei.current=e}catch(t){throw nK(et,"linkAccount","onError",t.privyErrorCode||"failed_to_link_account",{linkMethod:e}),t}else try{let a=await t.authenticate();r=a.user,n=a.isNewUser,i=a.oAuthTokens,ei.current=e}catch(t){throw"login"===ea.current?nK(et,"login","onError",t.privyErrorCode||"unknown_auth_error"):"link"===ea.current&&nK(et,"linkAccount","onError",t.privyErrorCode||"failed_to_link_account",{linkMethod:e}),t}return x(r),E(n||!1),y(!0),i&&r&&nK(et,"oAuthAuthorization","onOAuthTokenGrant",i,{user:r}),i},async initLoginWithPasskey(e){let r=new rh(e);t.startAuthFlow(r),ea.current="login";try{ei.current="passkey",await r.initAuthenticationFlow()}catch(e){throw nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"),e}},async loginWithPasskey(){let e,r;if(!p)throw new e0;if(!(t.authFlow instanceof rh))throw new eK("Must initialize Passkey flow first.");if("passkey"!==ei.current)throw new eK("Must init login with Passkey flow first.");try{ei.current="passkey",{user:e,isNewUser:r}=await t.authenticate()}catch(e){throw nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"),e}x(e),E(r||!1),y(!0)},async initLinkWithPasskey(e){let r=new rh(e);t.startAuthFlow(r),ea.current="link",ei.current="passkey";try{await r.initLinkFlow()}catch(e){throw nK(et,"linkAccount","onError",e.privyErrorCode||"unknown_auth_error",{linkMethod:"passkey"}),e}},async linkWithPasskey(){let e;if(!p)throw new e0;if(!(t.authFlow instanceof rh))throw new eK("Must initialize Passkey flow first.");if("passkey"!==ei.current)throw new eK("Must init login with Passkey flow first.");try{ei.current="passkey",{user:e}=await t.link()}catch(e){throw nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"passkey"}),e}return x(e||w||null),e},async initLoginWithHeadlessOAuth(e,r){if(ta()){if("google"===e&&aN(window.navigator.userAgent))throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.")}else throw Error("It looks like you're using an in-app browser. To log in, please try again using an external browser.");let n=new t7({provider:e,headless:!0});r&&n.addCaptchaToken(r);let i=await t.startAuthFlow(n).getAuthorizationUrl();i?.url&&window.location.assign(i.url)},async loginWithHeadlessOAuth(e){let r,n;P(!0),t.startAuthFlow(new t7(e));let i=to.get(tG),a=e.stateCode;if(i!==a)throw t.createAnalyticsEvent({eventName:"possible_phishing_attempt",payload:{provider:e.provider,storedStateCode:i??"",returnedStateCode:a??""}}),P(!1),new eK("Unexpected auth flow. This may be a phishing attempt.",void 0,"oauth_unexpected");if(f)try{({user:r}=await t.link()),ei.current=e.provider}catch(t){throw nK(et,"linkAccount","onError",t.privyErrorCode||"failed_to_link_account",{linkMethod:e.provider}),t}else try{({user:r,isNewUser:n}=await t.authenticate()),ei.current=e.provider}catch(t){throw"login"===ea.current?nK(et,"login","onError",t.privyErrorCode||"unknown_auth_error"):"link"===ea.current&&nK(et,"linkAccount","onError",t.privyErrorCode||"failed_to_link_account",{linkMethod:e.provider}),t}return x(r),E(n||!1),y(!0),P(!1),r??void 0},initLoginWithEmail:async(e,r)=>{let n=new tt(e,r);t.startAuthFlow(n);try{ei.current="email",await n.sendCodeEmail()}catch(e){throw"login"===ea.current?nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"):"link"===ea.current&&nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"email"}),e}},initUpdateEmail:async(e,r,n)=>{let i=new tr(e,r,n);t.startAuthFlow(i),await i.sendCodeEmail()},initUpdatePhone:async(e,r,n)=>{let i=new rg(e,r,n);t.startAuthFlow(i),await i.sendSmsCode()},initLoginWithSms:async(e,r)=>{O({status:"sending-code"});let n=new rm(e,r);t.startAuthFlow(n);try{ei.current="sms",await n.sendSmsCode(),O({status:"awaiting-code-input"})}catch(e){throw O({status:"error",error:e}),"login"===ea.current?nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"):"link"===ea.current&&nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"sms"}),e}},resendEmailCode:async()=>{await t.authFlow?.sendCodeEmail()},resendSmsCode:async()=>{await t.authFlow?.sendSmsCode()},loginWithCode:async e=>{let r,n;if(O({status:"submitting-code"}),!p){let e=new e0;throw O({status:"error",error:e}),e}if(t.authFlow instanceof tt)t.authFlow.meta.emailCode=e.trim();else if(t.authFlow instanceof rm)t.authFlow.meta.smsCode=e.trim();else{let e=new eK("Must initialize a passwordless code flow first");throw O({status:"error",error:e}),e}if(await uK(),"link"===ea.current)try{({user:r}=await t.link())}catch(e){throw O({status:"error",error:e}),nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:ei.current}),e}else try{({user:r,isNewUser:n}=await t.authenticate())}catch(e){throw O({status:"error",error:e}),nK(et,"login","onError",e.privyErrorCode||"unknown_auth_error"),e}x(r||w||null),E(n||!1),y(!0),O({status:"done"})},generateSiweMessage:async({address:e,chainId:r,captchaToken:n})=>{ea.current="link",ei.current="siwe";let i=await t.generateSiweNonce({address:e,captchaToken:n});return ru({address:e,chainId:r.replace("eip155:",""),nonce:i})},linkWithSiwe:async({message:e,signature:r,chainId:n,walletClientType:i,connectorType:a})=>{let o;try{if("link"!==ea.current||"siwe"!==ei.current)throw new eK("Must ensure no other auth flow is in progress other than the SIWE signature flow.");o=await t.linkWithSiwe({message:e,signature:r,chainId:n,walletClientType:i,connectorType:a}),o=await eN.refreshUser()??o;let s=ej(o);s&&nK(et,"linkAccount","onSuccess",o,"siwe",s)}catch(e){throw nK(et,"linkAccount","onError",e.privyErrorCode||"failed_to_link_account",{linkMethod:"siwe"}),ea.current=null,ei.current=null,e}x(o||w||null),ea.current=null,ei.current=null},refreshUser:async()=>{let e=await t.getAuthenticatedUser();return x(e),e},walletProxy:L,createAnalyticsEvent:({eventName:e,payload:r,timestamp:n})=>t.createAnalyticsEvent({eventName:e,payload:r,timestamp:n}),acceptTerms:async()=>{let e=await t.acceptTerms();return x(e),e},getUsdTokenPrice:e=>t.getUsdTokenPrice(e),recoverEmbeddedEthereumWallet:async()=>new Promise(async(e,r)=>{let n=rC(w)||r_(w),i=await uK();if(!i||!L||!n){r(Error("Must have valid access token and Privy wallet to recover wallet"));return}z(!0);try{await L.connect({accessToken:i,address:n.address}),e(!0)}catch(a){a8(a)&&"privy"===n.recoveryMethod?(t.createAnalyticsEvent({eventName:"embedded_wallet_pinless_recovery_started",payload:{walletAddress:n.address}}),(await L.recover({address:n.address,accessToken:i,recoveryMethod:n.recoveryMethod})).address||r(Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_wallet_recovery_completed",payload:{walletAddress:n.address}}),e(!0)):a8(a)&&"privy"!==n.recoveryMethod?(H({recoverWallet:{privyWallet:n,onFailure:r,onSuccess:()=>e(!0)},recoveryOAuthStatus:{provider:n.recoveryMethod,action:"recover"}}),eo(oa(n.recoveryMethod))):r(a)}}),embeddedSolanaWallet:b,createEmbeddedSolanaWallet:async()=>{z(!0);let e=await uK(),r=rb(w),n=rC(w);if(!w||!e)throw new eK("User must be logged in to create a Solana wallet");if(r)throw new eK("User already has an embedded Solana wallet.");if(n){if("privy"===n.recoveryMethod)await eN.recoverEmbeddedEthereumWallet();else throw new eK("Cannot create an embedded Solana wallet for a user with an existing Ethereum wallet with user-controlled recovery.")}let i=await eN.initializeWalletProxy(15e3);if(!i)throw new eK("Unable to initialize wallet proxy");t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_started"});try{await i.createSolana({accessToken:e,ethereumAddress:n?.address});let r=await eN.refreshUser(),a=rb(r);if(!a)throw new eK("Could not get Solana wallet for user");return t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_completed",payload:{walletAddress:a.address}}),a}catch(e){throw t.createAnalyticsEvent({eventName:"embedded_solana_wallet_creation_failed"}),new eK("Failed to create Solana embedded wallet with error ",e)}},recoverEmbeddedSolanaWallet:async()=>new Promise(async(e,r)=>{let n=rb(w),i=await uK();if(!i||!L||!n){r(Error("Must have valid access token and Privy wallet to recover wallet"));return}z(!0);try{await L.connectSolana({accessToken:i,publicKey:n.address}),e(!0)}catch(a){a8(a)&&"privy"===n.recoveryMethod?(t.createAnalyticsEvent({eventName:"embedded_solana_wallet_pinless_recovery_started",payload:{walletAddress:n.address}}),(await L.recoverSolana({publicKey:n.address,accessToken:i})).publicKey||r(Error("Unable to recover wallet")),t.createAnalyticsEvent({eventName:"embedded_solana_wallet_recovery_completed",payload:{walletAddress:n.address}}),e(!0)):r(a)}}),getMoonpaySignedUrl:ew,initCoinbaseOnRamp:t.initCoinbaseOnRamp.bind(t),getCoinbaseOnRampStatus:t.getCoinbaseOnRampStatus.bind(t),setReadyToTrue:e=>{g(!0),B?.(e)},updateWallets:()=>ex(),fundWallet:async(e,t)=>{if(!U.fundingConfig||0===U.fundingConfig.methods.length)throw Error("Wallet funding is not enabled");let r=hk({fundingMethods:U.fundingConfig.methods});H({funding:eA({address:e,fundWalletConfig:t,methodScreen:r})}),eo(r)},requestFarcasterSignerStatus:async e=>{let r=await uK(),n=w?.linkedAccounts.find(e=>"wallet"===e.type&&"privy"===e.walletClientType);if(!r)throw Error("Must have valid access token to connect with Farcaster");if(!L||!n)throw Error("Must have an embedded wallet to use Farcaster signers");if(!w?.farcaster?.fid)throw Error("Must have Farcaster account to use Farcaster signers");let i=await t.requestFarcasterSignerStatus(e);return"approved"===i.status&&x(await t.getAuthenticatedUser()||w||null),i}};u1=eN.recoverEmbeddedEthereumWallet,u2=eN.recoverEmbeddedSolanaWallet,u3=eN.solanaSignMessage;let eR=(0,o.useMemo)(()=>({wallets:v,ready:K&&er}),[v,K,er]);return(0,m.jsx)(nz.Provider,{value:eP,children:(0,m.jsx)(nq.Provider,{value:et,children:(0,m.jsx)(s$.Provider,{value:eR,children:(0,m.jsx)(nL,{...U,children:(0,m.jsxs)(nD.Provider,{value:eN,children:[(0,m.jsx)(aM,{children:(0,m.jsxs)(nf,{data:$,setModalData:H,setInitialScreen:S,initialScreen:A,authenticated:f,open:h,children:[e.children,!U.headless&&U.captchaEnabled&&p&&!f&&(0,m.jsx)(nU,{delayedExecution:!1}),(0,m.jsx)(ux,{theme:{...U.appearance.palette||{}}}),!U.render.standalone&&(0,m.jsx)(uR,{open:h})]})}),Z&&D?(0,m.jsx)(uH,{appId:e.appId,appClientId:e.clientId,clientAnalyticsId:t.clientAnalyticsId,origin:t.apiUrl,mfaMethods:w?.mfaMethods,mfaPromise:J,mfaSubmitPromise:ee,onLoad:F,onLoadFailed:()=>null}):null,U.loginMethods.telegram&&U.loginConfig.telegramAuthConfiguration&&(0,m.jsx)(ik,{if:!0,children:(0,m.jsx)(uI,{scriptHost:e.apiUrl||tL,botUsername:U.loginConfig.telegramAuthConfiguration.botName})})]})})})})})}}}]); ================================================ FILE: client/out/_next/static/chunks/3d47b92a-88f28c2ab0026672.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[614],{28196:function(t,a,n){n.d(a,{In4:function(){return u}});var h=n(91810);function u(t){return(0,h.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{d:"M12.71 2.29a1 1 0 0 0-1.42 0l-9 9a1 1 0 0 0 0 1.42A1 1 0 0 0 3 13h1v7a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7h1a1 1 0 0 0 1-1 1 1 0 0 0-.29-.71zM6 20v-9.59l6-6 6 6V20z"},child:[]}]})(t)}}}]); ================================================ FILE: client/out/_next/static/chunks/53c13509-fd73beeb7afe2e31.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[240],{63872:function(c,t,s){s.d(t,{P$5:function(){return n},d1A:function(){return r}});var l=s(91810);function n(c){return(0,l.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 224c0 17.7 14.3 32 32 32s32-14.3 32-32c0-53 43-96 96-96H320v32c0 12.9 7.8 24.6 19.8 29.6s25.7 2.2 34.9-6.9l64-64c12.5-12.5 12.5-32.8 0-45.3l-64-64c-9.2-9.2-22.9-11.9-34.9-6.9S320 19.1 320 32V64H160C71.6 64 0 135.6 0 224zm512 64c0-17.7-14.3-32-32-32s-32 14.3-32 32c0 53-43 96-96 96H192V352c0-12.9-7.8-24.6-19.8-29.6s-25.7-2.2-34.9 6.9l-64 64c-12.5 12.5-12.5 32.8 0 45.3l64 64c9.2 9.2 22.9 11.9 34.9 6.9s19.8-16.6 19.8-29.6V448H352c88.4 0 160-71.6 160-160z"},child:[]}]})(c)}function r(c){return(0,l.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6V160H352c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96h32V64c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H96c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6V416H352c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8H32c-17.7 0-32-14.3-32-32s14.3-32 32-32H96c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8h32V320c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"},child:[]}]})(c)}}}]); ================================================ FILE: client/out/_next/static/chunks/550.78062c8e0f31c7e4.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[550],{74550:function(e,t,r){function n(e){let t=new Uint8Array(e),r="";for(let e of t)r+=String.fromCharCode(e);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function a(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4,n=atob(t.padEnd(t.length+r,"=")),a=new ArrayBuffer(n.length),o=new Uint8Array(a);for(let e=0;ed.indexOf(e)))return e}async function f(e){var t;let r,c,d,f,E;if(!o())throw Error("WebAuthn is not supported in this browser");let w={publicKey:{...e,challenge:a(e.challenge),user:{...e.user,id:(t=e.user.id,new TextEncoder().encode(t))},excludeCredentials:e.excludeCredentials?.map(i)}};w.signal=u.createNewAbortSignal();try{r=await navigator.credentials.create(w)}catch(e){throw function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new l({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("ConstraintError"===e.name){if(r.authenticatorSelection?.requireResidentKey===!0)return new l({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(r.authenticatorSelection?.userVerification==="required")return new l({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else if("InvalidStateError"===e.name)return new l({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});else if("NotAllowedError"===e.name)return new l({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("NotSupportedError"===e.name)return new l(0===r.pubKeyCredParams.filter(e=>"public-key"===e.type).length?{message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}:{message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s(t))return new l({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rp.id!==t)return new l({message:`The RP ID "${r.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("TypeError"===e.name){if(r.user.id.byteLength<1||r.user.id.byteLength>64)return new l({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if("UnknownError"===e.name)return new l({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}({error:e,options:w})}if(!r)throw Error("Registration was not completed");let{id:A,rawId:g,response:p,type:b}=r;if("function"==typeof p.getTransports&&(d=p.getTransports()),"function"==typeof p.getPublicKeyAlgorithm)try{f=p.getPublicKeyAlgorithm()}catch(e){R("getPublicKeyAlgorithm()",e)}if("function"==typeof p.getPublicKey)try{let e=p.getPublicKey();null!==e&&(E=n(e))}catch(e){R("getPublicKey()",e)}if("function"==typeof p.getAuthenticatorData)try{c=n(p.getAuthenticatorData())}catch(e){R("getAuthenticatorData()",e)}return{id:A,rawId:n(g),response:{attestationObject:n(p.attestationObject),clientDataJSON:n(p.clientDataJSON),transports:d,publicKeyAlgorithm:f,publicKey:E,authenticatorData:c},type:b,clientExtensionResults:r.getClientExtensionResults(),authenticatorAttachment:h(r.authenticatorAttachment)}}function R(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them. `,t)}function E(){let e=window.PublicKeyCredential;return void 0===e.isConditionalMediationAvailable?new Promise(e=>e(!1)):e.isConditionalMediationAvailable()}async function w(e,t=!1){let r,c,d;if(!o())throw Error("WebAuthn is not supported in this browser");e.allowCredentials?.length!==0&&(r=e.allowCredentials?.map(i));let f={...e,challenge:a(e.challenge),allowCredentials:r},R={};if(t){if(!await E())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1)throw Error('No with "webauthn" as the only or last value in its `autocomplete` attribute was detected');R.mediation="conditional",f.allowCredentials=[]}R.publicKey=f,R.signal=u.createNewAbortSignal();try{c=await navigator.credentials.get(R)}catch(e){throw function({error:e,options:t}){let{publicKey:r}=t;if(!r)throw Error("options was missing required publicKey property");if("AbortError"===e.name){if(t.signal instanceof AbortSignal)return new l({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if("NotAllowedError"===e.name)return new l({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});else if("SecurityError"===e.name){let t=window.location.hostname;if(!s(t))return new l({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e});if(r.rpId!==t)return new l({message:`The RP ID "${r.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else if("UnknownError"===e.name)return new l({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e});return e}({error:e,options:R})}if(!c)throw Error("Authentication was not completed");let{id:w,rawId:A,response:g,type:p}=c;if(g.userHandle){var b;b=g.userHandle,d=new TextDecoder("utf-8").decode(b)}return{id:w,rawId:n(A),response:{authenticatorData:n(g.authenticatorData),clientDataJSON:n(g.clientDataJSON),signature:n(g.signature),userHandle:d},type:p,clientExtensionResults:c.getClientExtensionResults(),authenticatorAttachment:h(c.authenticatorAttachment)}}function A(){return o()?PublicKeyCredential.isUserVerifyingPlatformAuthenticatorAvailable():new Promise(e=>e(!1))}}}]); ================================================ FILE: client/out/_next/static/chunks/5ab80550-22a236d451c69b50.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[764],{50499:function(t,e,r){let i,n;r.d(e,{$0m:function(){return J},AWt:function(){return il},Au2:function(){return im},B95:function(){return nh},Bvr:function(){return iL},BwD:function(){return ti},D6H:function(){return iG},DJo:function(){return r4},DQe:function(){return x},DaH:function(){return Q},DdM:function(){return i6},E0T:function(){return tn},E12:function(){return iH},EJd:function(){return nr},ENt:function(){return iI},Ggh:function(){return nd},GqV:function(){return tt},H1S:function(){return W},H4H:function(){return ni},HIp:function(){return iw},HhN:function(){return ts},IPd:function(){return V},Ih8:function(){return i$},IkP:function(){return ii},JTI:function(){return no},KCv:function(){return Y},L5o:function(){return iV},Llj:function(){return iS},M_r:function(){return iX},Maj:function(){return ij},NmC:function(){return r5},O6B:function(){return nv},ONw:function(){return nc},PMr:function(){return nt},Q01:function(){return ne},Q8x:function(){return iN},UGU:function(){return q},WGe:function(){return ib},X_B:function(){return K},Y31:function(){return is},YmJ:function(){return iA},Z26:function(){return i9},Z42:function(){return $},_HE:function(){return iB},alS:function(){return nf},b$m:function(){return z},bW6:function(){return tu},c4l:function(){return r7},cOS:function(){return iC},eGA:function(){return to},gn4:function(){return tr},gpE:function(){return iz},guN:function(){return O},h1R:function(){return i3},hA9:function(){return ih},hFY:function(){return X},hHR:function(){return nn},heJ:function(){return iF},iPz:function(){return te},ing:function(){return i7},jUY:function(){return j},jdp:function(){return ig},jvJ:function(){return i1},kCb:function(){return iJ},m$A:function(){return iv},naP:function(){return i5},nfW:function(){return ns},o8e:function(){return iW},ouN:function(){return iu},p8o:function(){return nu},peR:function(){return iM},qJM:function(){return io},qt8:function(){return iY},rFo:function(){return na},rVF:function(){return ip},rjm:function(){return iy},uwg:function(){return nm},vBi:function(){return iE},wvx:function(){return r9},xWS:function(){return i2}});var o,s,u,f,h,a,l,c,d,p,m,g=r(52159),v=r(54574),A=r(25527),y=r(70053),b=r(61179),w=r(23518),M=r(67878),E=r(24861),S=r(67929),I=r(89414),N=r(39613),B=r(57711),C=r(25566),_=r(9109).Buffer;function x(t){let[e,r]=t.split(":");return{namespace:e,reference:r}}function O(t,e=[]){let r=[];return Object.keys(t).forEach(i=>{if(e.length&&!e.includes(i))return;let n=t[i];r.push(...n.accounts)}),r}function R(t,e){return t.includes(":")?[t]:e.chains||[]}var k=Object.defineProperty,P=Object.getOwnPropertySymbols,U=Object.prototype.hasOwnProperty,T=Object.prototype.propertyIsEnumerable,D=(t,e,r)=>e in t?k(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,F=(t,e)=>{for(var r in e||(e={}))U.call(e,r)&&D(t,r,e[r]);if(P)for(var r of P(e))T.call(e,r)&&D(t,r,e[r]);return t};let L={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"};function q(){return"u">typeof C&&"u">typeof C.versions&&"u">typeof C.versions.node}function z(){return!(0,A.getDocument)()&&!!(0,A.getNavigator)()&&"ReactNative"===navigator.product}function j(){return!q()&&!!(0,A.getNavigator)()&&!!(0,A.getDocument)()}function H(){return z()?L.reactNative:q()?L.node:j()?L.browser:L.unknown}function K(){var t;try{return z()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Application)?null==(t=r.g.Application)?void 0:t.applicationId:void 0}catch{return}}function Q(){return(0,y.D)()||{name:"",description:"",url:"",icons:[""]}}function J({protocol:t,version:e,relayUrl:i,sdkVersion:n,auth:o,projectId:s,useOnCloseEvent:u,bundleId:f}){var h,a;let l;let c=i.split("?"),d=function(t,e,i){let n=function(){if(H()===L.reactNative&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)){let{OS:t,Version:e}=r.g.Platform;return[t,e].join("-")}let t=(0,g.qY)();if(null===t)return"unknown";let e=t.os?t.os.replace(" ","").toLowerCase():"unknown";return"browser"===t.type?[e,t.name,t.version].join("-"):[e,t.version].join("-")}(),o=function(){var t;let e=H();return e===L.browser?[e,(null==(t=(0,A.getLocation)())?void 0:t.host)||"unknown"].join(":"):e}();return[[t,e].join("-"),["js",i].join("-"),n,o].join("/")}(t,e,n),p=(h=c[1]||"",a={auth:o,ua:d,projectId:s,useOnCloseEvent:u||void 0,origin:f||void 0},l=F(F({},l=b.parse(h)),a),h=b.stringify(l));return c[0]+"?"+p}function G(t,e){return t.filter(t=>e.includes(t)).length===t.length}function Y(t){return Object.fromEntries(t.entries())}function V(t){return new Map(Object.entries(t))}function W(t=v.FIVE_MINUTES,e){let r,i,n;let o=(0,v.toMiliseconds)(t||v.FIVE_MINUTES);return{resolve:t=>{n&&r&&(clearTimeout(n),r(t))},reject:t=>{n&&i&&(clearTimeout(n),i(t))},done:()=>new Promise((t,s)=>{n=setTimeout(()=>{s(Error(e))},o),r=t,i=s})}}function X(t,e,r){return new Promise(async(i,n)=>{let o=setTimeout(()=>n(Error(r)),e);try{let e=await t;i(e)}catch(t){n(t)}clearTimeout(o)})}function Z(t,e){if("string"==typeof e&&e.startsWith(`${t}:`))return e;if("topic"===t.toLowerCase()){if("string"!=typeof e)throw Error('Value must be "string" for expirer target type: topic');return`topic:${e}`}if("id"===t.toLowerCase()){if("number"!=typeof e)throw Error('Value must be "number" for expirer target type: id');return`id:${e}`}throw Error(`Unknown expirer target type: ${t}`)}function $(t){return Z("topic",t)}function tt(t){return Z("id",t)}function te(t){let[e,r]=t.split(":"),i={id:void 0,topic:void 0};if("topic"===e&&"string"==typeof r)i.topic=r;else if("id"===e&&Number.isInteger(Number(r)))i.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${e}:${r}`);return i}function tr(t,e){return(0,v.fromMiliseconds)((e||Date.now())+(0,v.toMiliseconds)(t))}function ti(t){return Date.now()>=(0,v.toMiliseconds)(t)}function tn(t,e){return`${t}${e?`:${e}`:""}`}function to(t=[],e=[]){return[...new Set([...t,...e])]}async function ts({id:t,topic:e,wcDeepLink:i}){try{if(!i)return;let n="string"==typeof i?JSON.parse(i):i,o=n?.href;if("string"!=typeof o)return;o.endsWith("/")&&(o=o.slice(0,-1));let s=`${o}/wc?requestId=${t}&sessionTopic=${e}`,u=H();u===L.browser?s.startsWith("https://")||s.startsWith("http://")?window.open(s,"_blank","noreferrer noopener"):window.open(s,"_self","noreferrer noopener"):u===L.reactNative&&"u">typeof(null==r.g?void 0:r.g.Linking)&&await r.g.Linking.openURL(s)}catch(t){console.error(t)}}async function tu(t,e){try{return await t.getItem(e)||(j()?localStorage.getItem(e):void 0)}catch(t){console.error(t)}}var tf="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},th={exports:{}};!function(){var t="input is invalid type",e="object"==typeof window,r=e?window:{};r.JS_SHA3_NO_WINDOW&&(e=!1);var i=!e&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof C&&C.versions&&C.versions.node?r=tf:i&&(r=self);var n=!r.JS_SHA3_NO_COMMON_JS&&th.exports,o=!r.JS_SHA3_NO_ARRAY_BUFFER&&"u">typeof ArrayBuffer,s="0123456789abcdef".split(""),u=[4,1024,262144,67108864],f=[0,8,16,24],h=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],a=[224,256,384,512],l=[128,256],c=["hex","buffer","arrayBuffer","array","digest"],d={128:168,256:136};(r.JS_SHA3_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),o&&(r.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(t){return"object"==typeof t&&t.buffer&&t.buffer.constructor===ArrayBuffer});for(var p=function(t,e,r){return function(i){return new x(t,e,t).update(i)[r]()}},m=function(t,e,r){return function(i,n){return new x(t,e,n).update(i)[r]()}},g=function(t,e,r){return function(e,i,n,o){return w["cshake"+t].update(e,i,n,o)[r]()}},v=function(t,e,r){return function(e,i,n,o){return w["kmac"+t].update(e,i,n,o)[r]()}},A=function(t,e,r,i){for(var n=0;n>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var i=0;i<50;++i)this.s[i]=0}function O(t,e,r){x.call(this,t,e,r)}x.prototype.update=function(e){if(this.finalized)throw Error("finalize already called");var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!o||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var n,s,u=this.blocks,h=this.byteCount,a=e.length,l=this.blockCount,c=0,d=this.s;c>2]|=e[c]<>2]|=s<>2]|=(192|s>>6)<=57344?u[n>>2]|=(224|s>>12)<>2]|=(240|s>>18)<>2]|=(128|s>>12&63)<>2]|=(128|s>>6&63)<>2]|=(128|63&s)<=h){for(this.start=n-h,this.block=u[l],n=0;n>=8,r=255&t;r>0;)n.unshift(r),t>>=8,r=255&t,++i;return e?n.push(i):n.unshift(i),this.update(n),n.length},x.prototype.encodeString=function(e){var r,i=typeof e;if("string"!==i){if("object"===i){if(null===e)throw Error(t);if(o&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!o||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}var n=0,s=e.length;if(r)n=s;else for(var u=0;u=57344?n+=3:(f=65536+((1023&f)<<10|1023&e.charCodeAt(++u)),n+=4)}return n+=this.encode(8*n),this.update(e),n},x.prototype.bytepad=function(t,e){for(var r=this.encode(e),i=0;i>2]|=this.padding[3&e],this.lastByteIndex===this.byteCount)for(t[0]=t[r],e=1;e>4&15]+s[15&t]+s[t>>12&15]+s[t>>8&15]+s[t>>20&15]+s[t>>16&15]+s[t>>28&15]+s[t>>24&15];u%e==0&&(R(r),o=0)}return n&&(f+=s[(t=r[o])>>4&15]+s[15&t],n>1&&(f+=s[t>>12&15]+s[t>>8&15]),n>2&&(f+=s[t>>20&15]+s[t>>16&15])),f},x.prototype.arrayBuffer=function(){this.finalize();var t,e=this.blockCount,r=this.s,i=this.outputBlocks,n=this.extraBytes,o=0,s=0,u=this.outputBits>>3;t=new ArrayBuffer(n?i+1<<2:u);for(var f=new Uint32Array(t);s>8&255,f[t+2]=e>>16&255,f[t+3]=e>>24&255;u%r==0&&R(i)}return o&&(t=u<<2,e=i[s],f[t]=255&e,o>1&&(f[t+1]=e>>8&255),o>2&&(f[t+2]=e>>16&255)),f},O.prototype=new x,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),x.prototype.finalize.call(this)};var R=function(t){var e,r,i,n,o,s,u,f,a,l,c,d,p,m,g,v,A,y,b,w,M,E,S,I,N,B,C,_,x,O,R,k,P,U,T,D,F,L,q,z,j,H,K,Q,J,G,Y,V,W,X,Z,$,tt,te,tr,ti,tn,to,ts,tu,tf,th,ta;for(i=0;i<48;i+=2)n=t[0]^t[10]^t[20]^t[30]^t[40],o=t[1]^t[11]^t[21]^t[31]^t[41],s=t[2]^t[12]^t[22]^t[32]^t[42],u=t[3]^t[13]^t[23]^t[33]^t[43],f=t[4]^t[14]^t[24]^t[34]^t[44],a=t[5]^t[15]^t[25]^t[35]^t[45],l=t[6]^t[16]^t[26]^t[36]^t[46],c=t[7]^t[17]^t[27]^t[37]^t[47],d=t[8]^t[18]^t[28]^t[38]^t[48],p=t[9]^t[19]^t[29]^t[39]^t[49],e=d^(s<<1|u>>>31),r=p^(u<<1|s>>>31),t[0]^=e,t[1]^=r,t[10]^=e,t[11]^=r,t[20]^=e,t[21]^=r,t[30]^=e,t[31]^=r,t[40]^=e,t[41]^=r,e=n^(f<<1|a>>>31),r=o^(a<<1|f>>>31),t[2]^=e,t[3]^=r,t[12]^=e,t[13]^=r,t[22]^=e,t[23]^=r,t[32]^=e,t[33]^=r,t[42]^=e,t[43]^=r,e=s^(l<<1|c>>>31),r=u^(c<<1|l>>>31),t[4]^=e,t[5]^=r,t[14]^=e,t[15]^=r,t[24]^=e,t[25]^=r,t[34]^=e,t[35]^=r,t[44]^=e,t[45]^=r,e=f^(d<<1|p>>>31),r=a^(p<<1|d>>>31),t[6]^=e,t[7]^=r,t[16]^=e,t[17]^=r,t[26]^=e,t[27]^=r,t[36]^=e,t[37]^=r,t[46]^=e,t[47]^=r,e=l^(n<<1|o>>>31),r=c^(o<<1|n>>>31),t[8]^=e,t[9]^=r,t[18]^=e,t[19]^=r,t[28]^=e,t[29]^=r,t[38]^=e,t[39]^=r,t[48]^=e,t[49]^=r,m=t[0],g=t[1],G=t[11]<<4|t[10]>>>28,Y=t[10]<<4|t[11]>>>28,_=t[20]<<3|t[21]>>>29,x=t[21]<<3|t[20]>>>29,tu=t[31]<<9|t[30]>>>23,tf=t[30]<<9|t[31]>>>23,H=t[40]<<18|t[41]>>>14,K=t[41]<<18|t[40]>>>14,U=t[2]<<1|t[3]>>>31,T=t[3]<<1|t[2]>>>31,v=t[13]<<12|t[12]>>>20,A=t[12]<<12|t[13]>>>20,V=t[22]<<10|t[23]>>>22,W=t[23]<<10|t[22]>>>22,O=t[33]<<13|t[32]>>>19,R=t[32]<<13|t[33]>>>19,th=t[42]<<2|t[43]>>>30,ta=t[43]<<2|t[42]>>>30,te=t[5]<<30|t[4]>>>2,tr=t[4]<<30|t[5]>>>2,D=t[14]<<6|t[15]>>>26,F=t[15]<<6|t[14]>>>26,y=t[25]<<11|t[24]>>>21,b=t[24]<<11|t[25]>>>21,X=t[34]<<15|t[35]>>>17,Z=t[35]<<15|t[34]>>>17,k=t[45]<<29|t[44]>>>3,P=t[44]<<29|t[45]>>>3,I=t[6]<<28|t[7]>>>4,N=t[7]<<28|t[6]>>>4,ti=t[17]<<23|t[16]>>>9,tn=t[16]<<23|t[17]>>>9,L=t[26]<<25|t[27]>>>7,q=t[27]<<25|t[26]>>>7,w=t[36]<<21|t[37]>>>11,M=t[37]<<21|t[36]>>>11,$=t[47]<<24|t[46]>>>8,tt=t[46]<<24|t[47]>>>8,Q=t[8]<<27|t[9]>>>5,J=t[9]<<27|t[8]>>>5,B=t[18]<<20|t[19]>>>12,C=t[19]<<20|t[18]>>>12,to=t[29]<<7|t[28]>>>25,ts=t[28]<<7|t[29]>>>25,z=t[38]<<8|t[39]>>>24,j=t[39]<<8|t[38]>>>24,E=t[48]<<14|t[49]>>>18,S=t[49]<<14|t[48]>>>18,t[0]=m^~v&y,t[1]=g^~A&b,t[10]=I^~B&_,t[11]=N^~C&x,t[20]=U^~D&L,t[21]=T^~F&q,t[30]=Q^~G&V,t[31]=J^~Y&W,t[40]=te^~ti&to,t[41]=tr^~tn&ts,t[2]=v^~y&w,t[3]=A^~b&M,t[12]=B^~_&O,t[13]=C^~x&R,t[22]=D^~L&z,t[23]=F^~q&j,t[32]=G^~V&X,t[33]=Y^~W&Z,t[42]=ti^~to&tu,t[43]=tn^~ts&tf,t[4]=y^~w&E,t[5]=b^~M&S,t[14]=_^~O&k,t[15]=x^~R&P,t[24]=L^~z&H,t[25]=q^~j&K,t[34]=V^~X&$,t[35]=W^~Z&tt,t[44]=to^~tu&th,t[45]=ts^~tf&ta,t[6]=w^~E&m,t[7]=M^~S&g,t[16]=O^~k&I,t[17]=R^~P&N,t[26]=z^~H&U,t[27]=j^~K&T,t[36]=X^~$&Q,t[37]=Z^~tt&J,t[46]=tu^~th&te,t[47]=tf^~ta&tr,t[8]=E^~m&v,t[9]=S^~g&A,t[18]=k^~I&B,t[19]=P^~N&C,t[28]=H^~U&D,t[29]=K^~T&F,t[38]=$^~Q&G,t[39]=tt^~J&Y,t[48]=th^~te&ti,t[49]=ta^~tr&tn,t[0]^=h[i],t[1]^=h[i+1]};if(n)th.exports=w;else for(E=0;E{try{if("test"!=="test".normalize(e))throw Error("bad normalize")}catch{t.push(e)}}),t.length)throw Error("missing "+t.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw Error("broken implementation")}catch(t){return t.message}return null}();(s=l||(l={})).DEBUG="DEBUG",s.INFO="INFO",s.WARNING="WARNING",s.ERROR="ERROR",s.OFF="OFF",(u=c||(c={})).UNKNOWN_ERROR="UNKNOWN_ERROR",u.NOT_IMPLEMENTED="NOT_IMPLEMENTED",u.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",u.NETWORK_ERROR="NETWORK_ERROR",u.SERVER_ERROR="SERVER_ERROR",u.TIMEOUT="TIMEOUT",u.BUFFER_OVERRUN="BUFFER_OVERRUN",u.NUMERIC_FAULT="NUMERIC_FAULT",u.MISSING_NEW="MISSING_NEW",u.INVALID_ARGUMENT="INVALID_ARGUMENT",u.MISSING_ARGUMENT="MISSING_ARGUMENT",u.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",u.CALL_EXCEPTION="CALL_EXCEPTION",u.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",u.NONCE_EXPIRED="NONCE_EXPIRED",u.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",u.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",u.TRANSACTION_REPLACED="TRANSACTION_REPLACED",u.ACTION_REJECTED="ACTION_REJECTED";let tv="0123456789abcdef";class tA{constructor(t){Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}_log(t,e){let r=t.toLowerCase();null==td[r]&&this.throwArgumentError("invalid log level name","logLevel",t),tp>td[r]||console.log.apply(console,e)}debug(...t){this._log(tA.levels.DEBUG,t)}info(...t){this._log(tA.levels.INFO,t)}warn(...t){this._log(tA.levels.WARNING,t)}makeError(t,e,r){if(tc)return this.makeError("censored error",e,{});e||(e=tA.errors.UNKNOWN_ERROR),r||(r={});let i=[];Object.keys(r).forEach(t=>{let e=r[t];try{if(e instanceof Uint8Array){let r="";for(let t=0;t>4]+tv[15&e[t]];i.push(t+"=Uint8Array(0x"+r+")")}else i.push(t+"="+JSON.stringify(e))}catch{i.push(t+"="+JSON.stringify(r[t].toString()))}}),i.push(`code=${e}`),i.push(`version=${this.version}`);let n=t,o="";switch(e){case c.NUMERIC_FAULT:{o="NUMERIC_FAULT";let e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case c.CALL_EXCEPTION:case c.INSUFFICIENT_FUNDS:case c.MISSING_NEW:case c.NONCE_EXPIRED:case c.REPLACEMENT_UNDERPRICED:case c.TRANSACTION_REPLACED:case c.UNPREDICTABLE_GAS_LIMIT:o=e}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");let s=Error(t);return s.reason=n,s.code=e,Object.keys(r).forEach(function(t){s[t]=r[t]}),s}throwError(t,e,r){throw this.makeError(t,e,r)}throwArgumentError(t,e,r){return this.throwError(t,tA.errors.INVALID_ARGUMENT,{argument:e,value:r})}assert(t,e,r,i){t||this.throwError(e,r,i)}assertArgument(t,e,r,i){t||this.throwArgumentError(e,r,i)}checkNormalize(t){tg&&this.throwError("platform missing String.prototype.normalize",tA.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:tg})}checkSafeUint53(t,e){"number"==typeof t&&(null==e&&(e="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(e,tA.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(e,tA.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,e,r){r=r?": "+r:"",te&&this.throwError("too many arguments"+r,tA.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:e})}checkNew(t,e){(t===Object||null==t)&&this.throwError("missing new",tA.errors.MISSING_NEW,{name:e.name})}checkAbstract(t,e){t===e?this.throwError("cannot instantiate abstract class "+JSON.stringify(e.name)+" directly; use a sub-class",tA.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):(t===Object||null==t)&&this.throwError("missing new",tA.errors.MISSING_NEW,{name:e.name})}static globalLogger(){return tm||(tm=new tA("logger/5.7.0")),tm}static setCensorship(t,e){if(!t&&e&&this.globalLogger().throwError("cannot permanently disable censorship",tA.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),tl){if(!t)return;this.globalLogger().throwError("error censorship permanent",tA.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}tc=!!t,tl=!!e}static setLogLevel(t){let e=td[t.toLowerCase()];if(null==e){tA.globalLogger().warn("invalid log level - "+t);return}tp=e}static from(t){return new tA(t)}}tA.errors=c,tA.levels=l;let ty=new tA("bytes/5.7.0");function tb(t){return!!t.toHexString}function tw(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return tw(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function tM(t){return"number"==typeof t&&t==t&&t%1==0}function tE(t){if(null==t)return!1;if(t.constructor===Uint8Array)return!0;if("string"==typeof t||!tM(t.length)||t.length<0)return!1;for(let e=0;e=256)return!1}return!0}function tS(t,e){if(e||(e={}),"number"==typeof t){ty.checkSafeUint53(t,"invalid arrayify value");let e=[];for(;t;)e.unshift(255&t),t=parseInt(String(t/256));return 0===e.length&&e.push(0),tw(new Uint8Array(e))}if(e.allowMissingPrefix&&"string"==typeof t&&"0x"!==t.substring(0,2)&&(t="0x"+t),tb(t)&&(t=t.toHexString()),tI(t)){let r=t.substring(2);r.length%2&&("left"===e.hexPad?r="0"+r:"right"===e.hexPad?r+="0":ty.throwArgumentError("hex data is odd-length","value",t));let i=[];for(let t=0;t>4]+tN[15&i]}return e}return ty.throwArgumentError("invalid hexlify value","value",t)}function tC(t,e,r){return"string"!=typeof t?t=tB(t):(!tI(t)||t.length%2)&&ty.throwArgumentError("invalid hexData","value",t),e=2+2*e,null!=r?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function t_(t,e){for("string"!=typeof t?t=tB(t):tI(t)||ty.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&ty.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function tx(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(tI(t)&&!(t.length%2)||tE(t)){let r=tS(t);64===r.length?(e.v=27+(r[32]>>7),r[32]&=127,e.r=tB(r.slice(0,32)),e.s=tB(r.slice(32,64))):65===r.length?(e.r=tB(r.slice(0,32)),e.s=tB(r.slice(32,64)),e.v=r[64]):ty.throwArgumentError("invalid signature string","signature",t),e.v<27&&(0===e.v||1===e.v?e.v+=27:ty.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=tB(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,null!=e._vs){let r=function(t,e){(t=tS(t)).length>e&&ty.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),tw(r)}(tS(e._vs),32);e._vs=tB(r);let i=r[0]>=128?1:0;null==e.recoveryParam?e.recoveryParam=i:e.recoveryParam!==i&&ty.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),r[0]&=127;let n=tB(r);null==e.s?e.s=n:e.s!==n&&ty.throwArgumentError("signature v mismatch _vs","signature",t)}if(null==e.recoveryParam)null==e.v?ty.throwArgumentError("signature missing v and recoveryParam","signature",t):0===e.v||1===e.v?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(null==e.v)e.v=27+e.recoveryParam;else{let r=0===e.v||1===e.v?e.v:1-e.v%2;e.recoveryParam!==r&&ty.throwArgumentError("signature recoveryParam mismatch v","signature",t)}null!=e.r&&tI(e.r)?e.r=t_(e.r,32):ty.throwArgumentError("signature missing or invalid r","signature",t),null!=e.s&&tI(e.s)?e.s=t_(e.s,32):ty.throwArgumentError("signature missing or invalid s","signature",t);let r=tS(e.s);r[0]>=128&&ty.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let i=tB(r);e._vs&&(tI(e._vs)||ty.throwArgumentError("signature invalid _vs","signature",t),e._vs=t_(e._vs,32)),null==e._vs?e._vs=i:e._vs!==i&&ty.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function tO(t){return"0x"+ta.keccak_256(tS(t))}var tR={exports:{}},tk=function(t){var e=t.default;if("function"==typeof e){var r=function(){return e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var i=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,i.get?i:{enumerable:!0,get:function(){return t[e]}})}),r}(Object.freeze({__proto__:null,default:{}}));!function(t,e){function r(t,e){if(!t)throw Error(e||"Assertion failed")}function i(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}function n(t,e,r){if(n.isBN(t))return t;this.negative=0,this.words=null,this.length=0,this.red=null,null!==t&&(("le"===e||"be"===e)&&(r=e,e=10),this._init(t||0,e||10,r||"be"))}"object"==typeof t?t.exports=n:e.BN=n,n.BN=n,n.wordSize=26;try{a="u">typeof window&&"u">typeof window.Buffer?window.Buffer:tk.Buffer}catch{}function o(t,e){var i=t.charCodeAt(e);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+t)}function s(t,e,r){var i=o(t,r);return r-1>=e&&(i|=o(t,r-1)<<4),i}function u(t,e,i,n){for(var o=0,s=0,u=Math.min(t.length,i),f=e;f=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s0?t:e},n.min=function(t,e){return 0>t.cmp(e)?t:e},n.prototype._init=function(t,e,i){if("number"==typeof t)return this._initNumber(t,e,i);if("object"==typeof t)return this._initArray(t,e,i);"hex"===e&&(e=16),r(e===(0|e)&&e>=2&&e<=36);var n=0;"-"===(t=t.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=t[n]|t[n-1]<<8|t[n-2]<<16,this.words[o]|=s<>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);else if("le"===i)for(n=0,o=0;n>>26-u&67108863,(u+=24)>=26&&(u-=26,o++);return this._strip()},n.prototype._parseHex=function(t,e,r){this.length=Math.ceil((t.length-e)/6),this.words=Array(this.length);for(var i=0;i=e;i-=2)n=s(t,e,i)<=18?(o-=18,u+=1,this.words[u]|=n>>>26):o+=8;else for(i=(t.length-e)%2==0?e+1:e;i=18?(o-=18,u+=1,this.words[u]|=n>>>26):o+=8;this._strip()},n.prototype._parseBase=function(t,e,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=67108863;n*=e)i++;i--,n=n/e|0;for(var o=t.length-r,s=o%i,f=Math.min(o,o-s)+r,h=0,a=r;a1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch{n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?""}var a,l=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],c=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],d=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];function p(t,e,r){r.negative=e.negative^t.negative;var i=t.length+e.length|0;r.length=i,i=i-1|0;var n=0|t.words[0],o=0|e.words[0],s=n*o,u=67108863&s,f=s/67108864|0;r.words[0]=u;for(var h=1;h>>26,l=67108863&f,c=Math.min(h,e.length-1),d=Math.max(0,h-t.length+1);d<=c;d++){var p=h-d|0;a+=(s=(n=0|t.words[p])*(o=0|e.words[d])+l)/67108864|0,l=67108863&s}r.words[h]=0|l,f=0|a}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.toString=function(t,e){if(e=0|e||1,16===(t=t||10)||"hex"===t){i="";for(var i,n=0,o=0,s=0;s>>24-n&16777215,(n+=2)>=26&&(n-=26,s--),i=0!==o||s!==this.length-1?l[6-f.length]+f+i:f+i}for(0!==o&&(i=o.toString(16)+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(t===(0|t)&&t>=2&&t<=36){var h=c[t],a=d[t];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modrn(a).toString(t);i=(p=p.idivn(a)).isZero()?m+i:l[h-m.length]+m+i}for(this.isZero()&&(i="0"+i);i.length%e!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var t=this.words[0];return 2===this.length?t+=67108864*this.words[1]:3===this.length&&1===this.words[2]?t+=4503599627370496+67108864*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-t:t},n.prototype.toJSON=function(){return this.toString(16,2)},a&&(n.prototype.toBuffer=function(t,e){return this.toArrayLike(a,t,e)}),n.prototype.toArray=function(t,e){return this.toArrayLike(Array,t,e)},n.prototype.toArrayLike=function(t,e,i){this._strip();var n=this.byteLength(),o=i||Math.max(1,n);r(n<=o,"byte array longer than desired length"),r(o>0,"Requested array length <= 0");var s=t.allocUnsafe?t.allocUnsafe(o):new t(o);return this["_toArrayLike"+("le"===e?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(t,e){for(var r=0,i=0,n=0,o=0;n>8&255),r>16&255),6===o?(r>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r=0&&(t[r--]=s>>8&255),r>=0&&(t[r--]=s>>16&255),6===o?(r>=0&&(t[r--]=s>>24&255),i=0,o=0):(i=s>>>24,o+=2)}if(r>=0)for(t[r--]=i;r>=0;)t[r--]=0},Math.clz32?n.prototype._countBits=function(t){return 32-Math.clz32(t)}:n.prototype._countBits=function(t){var e=t,r=0;return e>=4096&&(r+=13,e>>>=13),e>=64&&(r+=7,e>>>=7),e>=8&&(r+=4,e>>>=4),e>=2&&(r+=2,e>>>=2),r+e},n.prototype._zeroBits=function(t){if(0===t)return 26;var e=t,r=0;return 8191&e||(r+=13,e>>>=13),127&e||(r+=7,e>>>=7),15&e||(r+=4,e>>>=4),3&e||(r+=2,e>>>=2),1&e||r++,r},n.prototype.bitLength=function(){var t=this.words[this.length-1],e=this._countBits(t);return(this.length-1)*26+e},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var t=0,e=0;et.length?this.clone().ior(t):t.clone().ior(this)},n.prototype.uor=function(t){return this.length>t.length?this.clone().iuor(t):t.clone().iuor(this)},n.prototype.iuand=function(t){var e;e=this.length>t.length?t:this;for(var r=0;rt.length?this.clone().iand(t):t.clone().iand(this)},n.prototype.uand=function(t){return this.length>t.length?this.clone().iuand(t):t.clone().iuand(this)},n.prototype.iuxor=function(t){var e,r;this.length>t.length?(e=this,r=t):(e=t,r=this);for(var i=0;it.length?this.clone().ixor(t):t.clone().ixor(this)},n.prototype.uxor=function(t){return this.length>t.length?this.clone().iuxor(t):t.clone().iuxor(this)},n.prototype.inotn=function(t){r("number"==typeof t&&t>=0);var e=0|Math.ceil(t/26),i=t%26;this._expand(e),i>0&&e--;for(var n=0;n0&&(this.words[n]=~this.words[n]&67108863>>26-i),this._strip()},n.prototype.notn=function(t){return this.clone().inotn(t)},n.prototype.setn=function(t,e){r("number"==typeof t&&t>=0);var i=t/26|0,n=t%26;return this._expand(i+1),e?this.words[i]=this.words[i]|1<t.length?(r=this,i=t):(r=t,i=this);for(var e,r,i,n=0,o=0;o>>26;for(;0!==n&&o>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ot.length?this.clone().iadd(t):t.clone().iadd(this)},n.prototype.isub=function(t){if(0!==t.negative){t.negative=0;var e,r,i=this.iadd(t);return t.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(t),this.negative=1,this._normSign();var n=this.cmp(t);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(e=this,r=t):(e=t,r=this);for(var o=0,s=0;s>26,this.words[s]=67108863&i;for(;0!==o&&s>26,this.words[s]=67108863&i;if(0===o&&s>>13,d=0|s[1],p=8191&d,m=d>>>13,g=0|s[2],v=8191&g,A=g>>>13,y=0|s[3],b=8191&y,w=y>>>13,M=0|s[4],E=8191&M,S=M>>>13,I=0|s[5],N=8191&I,B=I>>>13,C=0|s[6],_=8191&C,x=C>>>13,O=0|s[7],R=8191&O,k=O>>>13,P=0|s[8],U=8191&P,T=P>>>13,D=0|s[9],F=8191&D,L=D>>>13,q=0|u[0],z=8191&q,j=q>>>13,H=0|u[1],K=8191&H,Q=H>>>13,J=0|u[2],G=8191&J,Y=J>>>13,V=0|u[3],W=8191&V,X=V>>>13,Z=0|u[4],$=8191&Z,tt=Z>>>13,te=0|u[5],tr=8191&te,ti=te>>>13,tn=0|u[6],to=8191&tn,ts=tn>>>13,tu=0|u[7],tf=8191&tu,th=tu>>>13,ta=0|u[8],tl=8191&ta,tc=ta>>>13,td=0|u[9],tp=8191&td,tm=td>>>13;r.negative=t.negative^e.negative,r.length=19,i=Math.imul(l,z),n=(n=Math.imul(l,j))+Math.imul(c,z)|0,o=Math.imul(c,j);var tg=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tg>>>26)|0,tg&=67108863,i=Math.imul(p,z),n=(n=Math.imul(p,j))+Math.imul(m,z)|0,o=Math.imul(m,j),i=i+Math.imul(l,K)|0,n=(n=n+Math.imul(l,Q)|0)+Math.imul(c,K)|0,o=o+Math.imul(c,Q)|0;var tv=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tv>>>26)|0,tv&=67108863,i=Math.imul(v,z),n=(n=Math.imul(v,j))+Math.imul(A,z)|0,o=Math.imul(A,j),i=i+Math.imul(p,K)|0,n=(n=n+Math.imul(p,Q)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,Q)|0,i=i+Math.imul(l,G)|0,n=(n=n+Math.imul(l,Y)|0)+Math.imul(c,G)|0,o=o+Math.imul(c,Y)|0;var tA=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tA>>>26)|0,tA&=67108863,i=Math.imul(b,z),n=(n=Math.imul(b,j))+Math.imul(w,z)|0,o=Math.imul(w,j),i=i+Math.imul(v,K)|0,n=(n=n+Math.imul(v,Q)|0)+Math.imul(A,K)|0,o=o+Math.imul(A,Q)|0,i=i+Math.imul(p,G)|0,n=(n=n+Math.imul(p,Y)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,Y)|0,i=i+Math.imul(l,W)|0,n=(n=n+Math.imul(l,X)|0)+Math.imul(c,W)|0,o=o+Math.imul(c,X)|0;var ty=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(ty>>>26)|0,ty&=67108863,i=Math.imul(E,z),n=(n=Math.imul(E,j))+Math.imul(S,z)|0,o=Math.imul(S,j),i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(w,K)|0,o=o+Math.imul(w,Q)|0,i=i+Math.imul(v,G)|0,n=(n=n+Math.imul(v,Y)|0)+Math.imul(A,G)|0,o=o+Math.imul(A,Y)|0,i=i+Math.imul(p,W)|0,n=(n=n+Math.imul(p,X)|0)+Math.imul(m,W)|0,o=o+Math.imul(m,X)|0,i=i+Math.imul(l,$)|0,n=(n=n+Math.imul(l,tt)|0)+Math.imul(c,$)|0,o=o+Math.imul(c,tt)|0;var tb=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tb>>>26)|0,tb&=67108863,i=Math.imul(N,z),n=(n=Math.imul(N,j))+Math.imul(B,z)|0,o=Math.imul(B,j),i=i+Math.imul(E,K)|0,n=(n=n+Math.imul(E,Q)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,Q)|0,i=i+Math.imul(b,G)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(w,G)|0,o=o+Math.imul(w,Y)|0,i=i+Math.imul(v,W)|0,n=(n=n+Math.imul(v,X)|0)+Math.imul(A,W)|0,o=o+Math.imul(A,X)|0,i=i+Math.imul(p,$)|0,n=(n=n+Math.imul(p,tt)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,tt)|0,i=i+Math.imul(l,tr)|0,n=(n=n+Math.imul(l,ti)|0)+Math.imul(c,tr)|0,o=o+Math.imul(c,ti)|0;var tw=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tw>>>26)|0,tw&=67108863,i=Math.imul(_,z),n=(n=Math.imul(_,j))+Math.imul(x,z)|0,o=Math.imul(x,j),i=i+Math.imul(N,K)|0,n=(n=n+Math.imul(N,Q)|0)+Math.imul(B,K)|0,o=o+Math.imul(B,Q)|0,i=i+Math.imul(E,G)|0,n=(n=n+Math.imul(E,Y)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,Y)|0,i=i+Math.imul(b,W)|0,n=(n=n+Math.imul(b,X)|0)+Math.imul(w,W)|0,o=o+Math.imul(w,X)|0,i=i+Math.imul(v,$)|0,n=(n=n+Math.imul(v,tt)|0)+Math.imul(A,$)|0,o=o+Math.imul(A,tt)|0,i=i+Math.imul(p,tr)|0,n=(n=n+Math.imul(p,ti)|0)+Math.imul(m,tr)|0,o=o+Math.imul(m,ti)|0,i=i+Math.imul(l,to)|0,n=(n=n+Math.imul(l,ts)|0)+Math.imul(c,to)|0,o=o+Math.imul(c,ts)|0;var tM=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tM>>>26)|0,tM&=67108863,i=Math.imul(R,z),n=(n=Math.imul(R,j))+Math.imul(k,z)|0,o=Math.imul(k,j),i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Q)|0)+Math.imul(x,K)|0,o=o+Math.imul(x,Q)|0,i=i+Math.imul(N,G)|0,n=(n=n+Math.imul(N,Y)|0)+Math.imul(B,G)|0,o=o+Math.imul(B,Y)|0,i=i+Math.imul(E,W)|0,n=(n=n+Math.imul(E,X)|0)+Math.imul(S,W)|0,o=o+Math.imul(S,X)|0,i=i+Math.imul(b,$)|0,n=(n=n+Math.imul(b,tt)|0)+Math.imul(w,$)|0,o=o+Math.imul(w,tt)|0,i=i+Math.imul(v,tr)|0,n=(n=n+Math.imul(v,ti)|0)+Math.imul(A,tr)|0,o=o+Math.imul(A,ti)|0,i=i+Math.imul(p,to)|0,n=(n=n+Math.imul(p,ts)|0)+Math.imul(m,to)|0,o=o+Math.imul(m,ts)|0,i=i+Math.imul(l,tf)|0,n=(n=n+Math.imul(l,th)|0)+Math.imul(c,tf)|0,o=o+Math.imul(c,th)|0;var tE=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tE>>>26)|0,tE&=67108863,i=Math.imul(U,z),n=(n=Math.imul(U,j))+Math.imul(T,z)|0,o=Math.imul(T,j),i=i+Math.imul(R,K)|0,n=(n=n+Math.imul(R,Q)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,Q)|0,i=i+Math.imul(_,G)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,Y)|0,i=i+Math.imul(N,W)|0,n=(n=n+Math.imul(N,X)|0)+Math.imul(B,W)|0,o=o+Math.imul(B,X)|0,i=i+Math.imul(E,$)|0,n=(n=n+Math.imul(E,tt)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,tt)|0,i=i+Math.imul(b,tr)|0,n=(n=n+Math.imul(b,ti)|0)+Math.imul(w,tr)|0,o=o+Math.imul(w,ti)|0,i=i+Math.imul(v,to)|0,n=(n=n+Math.imul(v,ts)|0)+Math.imul(A,to)|0,o=o+Math.imul(A,ts)|0,i=i+Math.imul(p,tf)|0,n=(n=n+Math.imul(p,th)|0)+Math.imul(m,tf)|0,o=o+Math.imul(m,th)|0,i=i+Math.imul(l,tl)|0,n=(n=n+Math.imul(l,tc)|0)+Math.imul(c,tl)|0,o=o+Math.imul(c,tc)|0;var tS=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tS>>>26)|0,tS&=67108863,i=Math.imul(F,z),n=(n=Math.imul(F,j))+Math.imul(L,z)|0,o=Math.imul(L,j),i=i+Math.imul(U,K)|0,n=(n=n+Math.imul(U,Q)|0)+Math.imul(T,K)|0,o=o+Math.imul(T,Q)|0,i=i+Math.imul(R,G)|0,n=(n=n+Math.imul(R,Y)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,Y)|0,i=i+Math.imul(_,W)|0,n=(n=n+Math.imul(_,X)|0)+Math.imul(x,W)|0,o=o+Math.imul(x,X)|0,i=i+Math.imul(N,$)|0,n=(n=n+Math.imul(N,tt)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,tt)|0,i=i+Math.imul(E,tr)|0,n=(n=n+Math.imul(E,ti)|0)+Math.imul(S,tr)|0,o=o+Math.imul(S,ti)|0,i=i+Math.imul(b,to)|0,n=(n=n+Math.imul(b,ts)|0)+Math.imul(w,to)|0,o=o+Math.imul(w,ts)|0,i=i+Math.imul(v,tf)|0,n=(n=n+Math.imul(v,th)|0)+Math.imul(A,tf)|0,o=o+Math.imul(A,th)|0,i=i+Math.imul(p,tl)|0,n=(n=n+Math.imul(p,tc)|0)+Math.imul(m,tl)|0,o=o+Math.imul(m,tc)|0,i=i+Math.imul(l,tp)|0,n=(n=n+Math.imul(l,tm)|0)+Math.imul(c,tp)|0,o=o+Math.imul(c,tm)|0;var tI=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tI>>>26)|0,tI&=67108863,i=Math.imul(F,K),n=(n=Math.imul(F,Q))+Math.imul(L,K)|0,o=Math.imul(L,Q),i=i+Math.imul(U,G)|0,n=(n=n+Math.imul(U,Y)|0)+Math.imul(T,G)|0,o=o+Math.imul(T,Y)|0,i=i+Math.imul(R,W)|0,n=(n=n+Math.imul(R,X)|0)+Math.imul(k,W)|0,o=o+Math.imul(k,X)|0,i=i+Math.imul(_,$)|0,n=(n=n+Math.imul(_,tt)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,tt)|0,i=i+Math.imul(N,tr)|0,n=(n=n+Math.imul(N,ti)|0)+Math.imul(B,tr)|0,o=o+Math.imul(B,ti)|0,i=i+Math.imul(E,to)|0,n=(n=n+Math.imul(E,ts)|0)+Math.imul(S,to)|0,o=o+Math.imul(S,ts)|0,i=i+Math.imul(b,tf)|0,n=(n=n+Math.imul(b,th)|0)+Math.imul(w,tf)|0,o=o+Math.imul(w,th)|0,i=i+Math.imul(v,tl)|0,n=(n=n+Math.imul(v,tc)|0)+Math.imul(A,tl)|0,o=o+Math.imul(A,tc)|0,i=i+Math.imul(p,tp)|0,n=(n=n+Math.imul(p,tm)|0)+Math.imul(m,tp)|0,o=o+Math.imul(m,tm)|0;var tN=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tN>>>26)|0,tN&=67108863,i=Math.imul(F,G),n=(n=Math.imul(F,Y))+Math.imul(L,G)|0,o=Math.imul(L,Y),i=i+Math.imul(U,W)|0,n=(n=n+Math.imul(U,X)|0)+Math.imul(T,W)|0,o=o+Math.imul(T,X)|0,i=i+Math.imul(R,$)|0,n=(n=n+Math.imul(R,tt)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,tt)|0,i=i+Math.imul(_,tr)|0,n=(n=n+Math.imul(_,ti)|0)+Math.imul(x,tr)|0,o=o+Math.imul(x,ti)|0,i=i+Math.imul(N,to)|0,n=(n=n+Math.imul(N,ts)|0)+Math.imul(B,to)|0,o=o+Math.imul(B,ts)|0,i=i+Math.imul(E,tf)|0,n=(n=n+Math.imul(E,th)|0)+Math.imul(S,tf)|0,o=o+Math.imul(S,th)|0,i=i+Math.imul(b,tl)|0,n=(n=n+Math.imul(b,tc)|0)+Math.imul(w,tl)|0,o=o+Math.imul(w,tc)|0,i=i+Math.imul(v,tp)|0,n=(n=n+Math.imul(v,tm)|0)+Math.imul(A,tp)|0,o=o+Math.imul(A,tm)|0;var tB=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tB>>>26)|0,tB&=67108863,i=Math.imul(F,W),n=(n=Math.imul(F,X))+Math.imul(L,W)|0,o=Math.imul(L,X),i=i+Math.imul(U,$)|0,n=(n=n+Math.imul(U,tt)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,tt)|0,i=i+Math.imul(R,tr)|0,n=(n=n+Math.imul(R,ti)|0)+Math.imul(k,tr)|0,o=o+Math.imul(k,ti)|0,i=i+Math.imul(_,to)|0,n=(n=n+Math.imul(_,ts)|0)+Math.imul(x,to)|0,o=o+Math.imul(x,ts)|0,i=i+Math.imul(N,tf)|0,n=(n=n+Math.imul(N,th)|0)+Math.imul(B,tf)|0,o=o+Math.imul(B,th)|0,i=i+Math.imul(E,tl)|0,n=(n=n+Math.imul(E,tc)|0)+Math.imul(S,tl)|0,o=o+Math.imul(S,tc)|0,i=i+Math.imul(b,tp)|0,n=(n=n+Math.imul(b,tm)|0)+Math.imul(w,tp)|0,o=o+Math.imul(w,tm)|0;var tC=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tC>>>26)|0,tC&=67108863,i=Math.imul(F,$),n=(n=Math.imul(F,tt))+Math.imul(L,$)|0,o=Math.imul(L,tt),i=i+Math.imul(U,tr)|0,n=(n=n+Math.imul(U,ti)|0)+Math.imul(T,tr)|0,o=o+Math.imul(T,ti)|0,i=i+Math.imul(R,to)|0,n=(n=n+Math.imul(R,ts)|0)+Math.imul(k,to)|0,o=o+Math.imul(k,ts)|0,i=i+Math.imul(_,tf)|0,n=(n=n+Math.imul(_,th)|0)+Math.imul(x,tf)|0,o=o+Math.imul(x,th)|0,i=i+Math.imul(N,tl)|0,n=(n=n+Math.imul(N,tc)|0)+Math.imul(B,tl)|0,o=o+Math.imul(B,tc)|0,i=i+Math.imul(E,tp)|0,n=(n=n+Math.imul(E,tm)|0)+Math.imul(S,tp)|0,o=o+Math.imul(S,tm)|0;var t_=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(t_>>>26)|0,t_&=67108863,i=Math.imul(F,tr),n=(n=Math.imul(F,ti))+Math.imul(L,tr)|0,o=Math.imul(L,ti),i=i+Math.imul(U,to)|0,n=(n=n+Math.imul(U,ts)|0)+Math.imul(T,to)|0,o=o+Math.imul(T,ts)|0,i=i+Math.imul(R,tf)|0,n=(n=n+Math.imul(R,th)|0)+Math.imul(k,tf)|0,o=o+Math.imul(k,th)|0,i=i+Math.imul(_,tl)|0,n=(n=n+Math.imul(_,tc)|0)+Math.imul(x,tl)|0,o=o+Math.imul(x,tc)|0,i=i+Math.imul(N,tp)|0,n=(n=n+Math.imul(N,tm)|0)+Math.imul(B,tp)|0,o=o+Math.imul(B,tm)|0;var tx=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tx>>>26)|0,tx&=67108863,i=Math.imul(F,to),n=(n=Math.imul(F,ts))+Math.imul(L,to)|0,o=Math.imul(L,ts),i=i+Math.imul(U,tf)|0,n=(n=n+Math.imul(U,th)|0)+Math.imul(T,tf)|0,o=o+Math.imul(T,th)|0,i=i+Math.imul(R,tl)|0,n=(n=n+Math.imul(R,tc)|0)+Math.imul(k,tl)|0,o=o+Math.imul(k,tc)|0,i=i+Math.imul(_,tp)|0,n=(n=n+Math.imul(_,tm)|0)+Math.imul(x,tp)|0,o=o+Math.imul(x,tm)|0;var tO=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tO>>>26)|0,tO&=67108863,i=Math.imul(F,tf),n=(n=Math.imul(F,th))+Math.imul(L,tf)|0,o=Math.imul(L,th),i=i+Math.imul(U,tl)|0,n=(n=n+Math.imul(U,tc)|0)+Math.imul(T,tl)|0,o=o+Math.imul(T,tc)|0,i=i+Math.imul(R,tp)|0,n=(n=n+Math.imul(R,tm)|0)+Math.imul(k,tp)|0,o=o+Math.imul(k,tm)|0;var tR=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tR>>>26)|0,tR&=67108863,i=Math.imul(F,tl),n=(n=Math.imul(F,tc))+Math.imul(L,tl)|0,o=Math.imul(L,tc),i=i+Math.imul(U,tp)|0,n=(n=n+Math.imul(U,tm)|0)+Math.imul(T,tp)|0,o=o+Math.imul(T,tm)|0;var tk=(h+i|0)+((8191&n)<<13)|0;h=(o+(n>>>13)|0)+(tk>>>26)|0,tk&=67108863,i=Math.imul(F,tp),n=(n=Math.imul(F,tm))+Math.imul(L,tp)|0,o=Math.imul(L,tm);var tP=(h+i|0)+((8191&n)<<13)|0;return h=(o+(n>>>13)|0)+(tP>>>26)|0,tP&=67108863,f[0]=tg,f[1]=tv,f[2]=tA,f[3]=ty,f[4]=tb,f[5]=tw,f[6]=tM,f[7]=tE,f[8]=tS,f[9]=tI,f[10]=tN,f[11]=tB,f[12]=tC,f[13]=t_,f[14]=tx,f[15]=tO,f[16]=tR,f[17]=tk,f[18]=tP,0!==h&&(f[19]=h,r.length++),r};function g(t,e,r){r.negative=e.negative^t.negative,r.length=t.length+e.length;for(var i=0,n=0,o=0;o>>26)|0)>>>26,s&=67108863}r.words[o]=u,i=s,s=n}return 0!==i?r.words[o]=i:r.length--,r._strip()}Math.imul||(m=p),n.prototype.mulTo=function(t,e){var r,i=this.length+t.length;return 10===this.length&&10===t.length?m(this,t,e):i<63?p(this,t,e):g(this,t,e)},n.prototype.mul=function(t){var e=new n(null);return e.words=Array(this.length+t.length),this.mulTo(t,e)},n.prototype.mulf=function(t){var e=new n(null);return e.words=Array(this.length+t.length),g(this,t,e)},n.prototype.imul=function(t){return this.clone().mulTo(t,this)},n.prototype.imuln=function(t){var e=t<0;e&&(t=-t),r("number"==typeof t),r(t<67108864);for(var i=0,n=0;n>=26,i+=(o/67108864|0)+(s>>>26),this.words[n]=67108863&s}return 0!==i&&(this.words[n]=i,this.length++),e?this.ineg():this},n.prototype.muln=function(t){return this.clone().imuln(t)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(t){var e=function(t){for(var e=Array(t.bitLength()),r=0;r>>n&1}return e}(t);if(0===e.length)return new n(1);for(var r=this,i=0;i=0);var e,i=t%26,n=(t-i)/26,o=67108863>>>26-i<<26-i;if(0!==i){var s=0;for(e=0;e>>26-i}s&&(this.words[e]=s,this.length++)}if(0!==n){for(e=this.length-1;e>=0;e--)this.words[e+n]=this.words[e];for(e=0;e=0),n=e?(e-e%26)/26:0;var n,o=t%26,s=Math.min((t-o)/26,this.length),u=67108863^67108863>>>o<s)for(this.length-=s,f=0;f=0&&(0!==h||f>=n);f--){var a=0|this.words[f];this.words[f]=h<<26-o|a>>>o,h=a&u}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(t,e,i){return r(0===this.negative),this.iushrn(t,e,i)},n.prototype.shln=function(t){return this.clone().ishln(t)},n.prototype.ushln=function(t){return this.clone().iushln(t)},n.prototype.shrn=function(t){return this.clone().ishrn(t)},n.prototype.ushrn=function(t){return this.clone().iushrn(t)},n.prototype.testn=function(t){r("number"==typeof t&&t>=0);var e=t%26,i=(t-e)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var e=t%26,i=(t-e)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==e&&i++,this.length=Math.min(i,this.length),0!==e&&(this.words[this.length-1]&=67108863^67108863>>>e<=67108864;e++)this.words[e]-=67108864,e===this.length-1?this.words[e+1]=1:this.words[e+1]++;return this.length=Math.max(this.length,e+1),this},n.prototype.isubn=function(t){if(r("number"==typeof t),r(t<67108864),t<0)return this.iaddn(-t);if(0!==this.negative)return this.negative=0,this.iaddn(t),this.negative=1,this;if(this.words[0]-=t,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var e=0;e>26)-(f/67108864|0),this.words[n+i]=67108863&s}for(;n>26,this.words[n+i]=67108863&s;if(0===u)return this._strip();for(r(-1===u),u=0,n=0;n>26,this.words[n]=67108863&s;return this.negative=1,this._strip()},n.prototype._wordDiv=function(t,e){var r=this.length-t.length,i=this.clone(),o=t,s=0|o.words[o.length-1];0!=(r=26-this._countBits(s))&&(o=o.ushln(r),i.iushln(r),s=0|o.words[o.length-1]);var u,f=i.length-o.length;if("mod"!==e){(u=new n(null)).length=f+1,u.words=Array(u.length);for(var h=0;h=0;l--){var c=(0|i.words[o.length+l])*67108864+(0|i.words[o.length+l-1]);for(c=Math.min(c/s|0,67108863),i._ishlnsubmul(o,c,l);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(o,1,l),i.isZero()||(i.negative^=1);u&&(u.words[l]=c)}return u&&u._strip(),i._strip(),"div"!==e&&0!==r&&i.iushrn(r),{div:u||null,mod:i}},n.prototype.divmod=function(t,e,i){var o,s,u;return(r(!t.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===t.negative?(u=this.neg().divmod(t,e),"mod"!==e&&(o=u.div.neg()),"div"!==e&&(s=u.mod.neg(),i&&0!==s.negative&&s.iadd(t)),{div:o,mod:s}):0===this.negative&&0!==t.negative?(u=this.divmod(t.neg(),e),"mod"!==e&&(o=u.div.neg()),{div:o,mod:u.mod}):this.negative&t.negative?(u=this.neg().divmod(t.neg(),e),"div"!==e&&(s=u.mod.neg(),i&&0!==s.negative&&s.isub(t)),{div:u.div,mod:s}):t.length>this.length||0>this.cmp(t)?{div:new n(0),mod:this}:1===t.length?"div"===e?{div:this.divn(t.words[0]),mod:null}:"mod"===e?{div:null,mod:new n(this.modrn(t.words[0]))}:{div:this.divn(t.words[0]),mod:new n(this.modrn(t.words[0]))}:this._wordDiv(t,e)},n.prototype.div=function(t){return this.divmod(t,"div",!1).div},n.prototype.mod=function(t){return this.divmod(t,"mod",!1).mod},n.prototype.umod=function(t){return this.divmod(t,"mod",!0).mod},n.prototype.divRound=function(t){var e=this.divmod(t);if(e.mod.isZero())return e.div;var r=0!==e.div.negative?e.mod.isub(t):e.mod,i=t.ushrn(1),n=t.andln(1),o=r.cmp(i);return o<0||1===n&&0===o?e.div:0!==e.div.negative?e.div.isubn(1):e.div.iaddn(1)},n.prototype.modrn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=67108864%t,n=0,o=this.length-1;o>=0;o--)n=(i*n+(0|this.words[o]))%t;return e?-n:n},n.prototype.modn=function(t){return this.modrn(t)},n.prototype.idivn=function(t){var e=t<0;e&&(t=-t),r(t<=67108863);for(var i=0,n=this.length-1;n>=0;n--){var o=(0|this.words[n])+67108864*i;this.words[n]=o/t|0,i=o%t}return this._strip(),e?this.ineg():this},n.prototype.divn=function(t){return this.clone().idivn(t)},n.prototype.egcd=function(t){r(0===t.negative),r(!t.isZero());var e=this,i=t.clone();e=0!==e.negative?e.umod(t):e.clone();for(var o=new n(1),s=new n(0),u=new n(0),f=new n(1),h=0;e.isEven()&&i.isEven();)e.iushrn(1),i.iushrn(1),++h;for(var a=i.clone(),l=e.clone();!e.isZero();){for(var c=0,d=1;!(e.words[0]&d)&&c<26;++c,d<<=1);if(c>0)for(e.iushrn(c);c-- >0;)(o.isOdd()||s.isOdd())&&(o.iadd(a),s.isub(l)),o.iushrn(1),s.iushrn(1);for(var p=0,m=1;!(i.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(i.iushrn(p);p-- >0;)(u.isOdd()||f.isOdd())&&(u.iadd(a),f.isub(l)),u.iushrn(1),f.iushrn(1);e.cmp(i)>=0?(e.isub(i),o.isub(u),s.isub(f)):(i.isub(e),u.isub(o),f.isub(s))}return{a:u,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(t){r(0===t.negative),r(!t.isZero());var e,i=this,o=t.clone();i=0!==i.negative?i.umod(t):i.clone();for(var s=new n(1),u=new n(0),f=o.clone();i.cmpn(1)>0&&o.cmpn(1)>0;){for(var h=0,a=1;!(i.words[0]&a)&&h<26;++h,a<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var l=0,c=1;!(o.words[0]&c)&&l<26;++l,c<<=1);if(l>0)for(o.iushrn(l);l-- >0;)u.isOdd()&&u.iadd(f),u.iushrn(1);i.cmp(o)>=0?(i.isub(o),s.isub(u)):(o.isub(i),u.isub(s))}return 0>(e=0===i.cmpn(1)?s:u).cmpn(0)&&e.iadd(t),e},n.prototype.gcd=function(t){if(this.isZero())return t.abs();if(t.isZero())return this.abs();var e=this.clone(),r=t.clone();e.negative=0,r.negative=0;for(var i=0;e.isEven()&&r.isEven();i++)e.iushrn(1),r.iushrn(1);for(;;){for(;e.isEven();)e.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=e.cmp(r);if(n<0){var o=e;e=r,r=o}else if(0===n||0===r.cmpn(1))break;e.isub(r)}return r.iushln(i)},n.prototype.invm=function(t){return this.egcd(t).a.umod(t)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(t){return this.words[0]&t},n.prototype.bincn=function(t){r("number"==typeof t);var e=t%26,i=(t-e)/26,n=1<>>26,u&=67108863,this.words[s]=u}return 0!==o&&(this.words[s]=o,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(t){var e,i=t<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)e=1;else{i&&(t=-t),r(t<=67108863,"Number is too big");var n=0|this.words[0];e=n===t?0:nt.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|t.words[r];if(i!==n){in&&(e=1);break}}return e},n.prototype.gtn=function(t){return 1===this.cmpn(t)},n.prototype.gt=function(t){return 1===this.cmp(t)},n.prototype.gten=function(t){return this.cmpn(t)>=0},n.prototype.gte=function(t){return this.cmp(t)>=0},n.prototype.ltn=function(t){return -1===this.cmpn(t)},n.prototype.lt=function(t){return -1===this.cmp(t)},n.prototype.lten=function(t){return 0>=this.cmpn(t)},n.prototype.lte=function(t){return 0>=this.cmp(t)},n.prototype.eqn=function(t){return 0===this.cmpn(t)},n.prototype.eq=function(t){return 0===this.cmp(t)},n.red=function(t){return new E(t)},n.prototype.toRed=function(t){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),t.convertTo(this)._forceRed(t)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(t){return this.red=t,this},n.prototype.forceRed=function(t){return r(!this.red,"Already a number in reduction context"),this._forceRed(t)},n.prototype.redAdd=function(t){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,t)},n.prototype.redIAdd=function(t){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,t)},n.prototype.redSub=function(t){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,t)},n.prototype.redISub=function(t){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,t)},n.prototype.redShl=function(t){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,t)},n.prototype.redMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.mul(this,t)},n.prototype.redIMul=function(t){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,t),this.red.imul(this,t)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(t){return r(this.red&&!t.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,t)};var v={k256:null,p224:null,p192:null,p25519:null};function A(t,e){this.name=t,this.p=new n(e,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function y(){A.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function b(){A.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function w(){A.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function M(){A.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(t){if("string"==typeof t){var e=n._prime(t);this.m=e.p,this.prime=e}else r(t.gtn(1),"modulus must be greater than 1"),this.m=t,this.prime=null}function S(t){E.call(this,t),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}A.prototype._tmp=function(){var t=new n(null);return t.words=Array(Math.ceil(this.n/13)),t},A.prototype.ireduce=function(t){var e,r=t;do this.split(r,this.tmp),e=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(e>this.n);var i=e0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},A.prototype.split=function(t,e){t.iushrn(this.n,0,e)},A.prototype.imulK=function(t){return t.imul(this.k)},i(y,A),y.prototype.split=function(t,e){for(var r=Math.min(t.length,9),i=0;i>>22,n=o}n>>>=22,t.words[i-10]=n,0===n&&t.length>10?t.length-=10:t.length-=9},y.prototype.imulK=function(t){t.words[t.length]=0,t.words[t.length+1]=0,t.length+=2;for(var e=0,r=0;r>>=26,t.words[r]=n,e=i}return 0!==e&&(t.words[t.length++]=e),t},n._prime=function(t){var e;if(v[t])return v[t];if("k256"===t)e=new y;else if("p224"===t)e=new b;else if("p192"===t)e=new w;else if("p25519"===t)e=new M;else throw Error("Unknown prime "+t);return v[t]=e,e},E.prototype._verify1=function(t){r(0===t.negative,"red works only with positives"),r(t.red,"red works only with red numbers")},E.prototype._verify2=function(t,e){r((t.negative|e.negative)==0,"red works only with positives"),r(t.red&&t.red===e.red,"red works only with red numbers")},E.prototype.imod=function(t){return this.prime?this.prime.ireduce(t)._forceRed(this):(f(t,t.umod(this.m)._forceRed(this)),t)},E.prototype.neg=function(t){return t.isZero()?t.clone():this.m.sub(t)._forceRed(this)},E.prototype.add=function(t,e){this._verify2(t,e);var r=t.add(e);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(t,e){this._verify2(t,e);var r=t.iadd(e);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(t,e){this._verify2(t,e);var r=t.sub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(t,e){this._verify2(t,e);var r=t.isub(e);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(t,e){return this._verify1(t),this.imod(t.ushln(e))},E.prototype.imul=function(t,e){return this._verify2(t,e),this.imod(t.imul(e))},E.prototype.mul=function(t,e){return this._verify2(t,e),this.imod(t.mul(e))},E.prototype.isqr=function(t){return this.imul(t,t.clone())},E.prototype.sqr=function(t){return this.mul(t,t)},E.prototype.sqrt=function(t){if(t.isZero())return t.clone();var e=this.m.andln(3);if(r(e%2==1),3===e){var i=this.m.add(new n(1)).iushrn(2);return this.pow(t,i)}for(var o=this.m.subn(1),s=0;!o.isZero()&&0===o.andln(1);)s++,o.iushrn(1);r(!o.isZero());var u=new n(1).toRed(this),f=u.redNeg(),h=this.m.subn(1).iushrn(1),a=this.m.bitLength();for(a=new n(2*a*a).toRed(this);0!==this.pow(a,h).cmp(f);)a.redIAdd(f);for(var l=this.pow(a,o),c=this.pow(t,o.addn(1).iushrn(1)),d=this.pow(t,o),p=s;0!==d.cmp(u);){for(var m=d,g=0;0!==m.cmp(u);g++)m=m.redSqr();r(g=0;i--){for(var h=e.words[i],a=f-1;a>=0;a--){var l=h>>a&1;if(o!==r[0]&&(o=this.sqr(o)),0===l&&0===s){u=0;continue}s<<=1,s|=l,4!=++u&&(0!==i||0!==a)||(o=this.mul(o,r[s]),u=0,s=0)}f=26}return o},E.prototype.convertTo=function(t){var e=t.umod(this.m);return e===t?e.clone():e},E.prototype.convertFrom=function(t){var e=t.clone();return e.red=null,e},n.mont=function(t){return new S(t)},i(S,E),S.prototype.convertTo=function(t){return this.imod(t.ushln(this.shift))},S.prototype.convertFrom=function(t){var e=this.imod(t.mul(this.rinv));return e.red=null,e},S.prototype.imul=function(t,e){if(t.isZero()||e.isZero())return t.words[0]=0,t.length=1,t;var r=t.imul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),o=n;return n.cmp(this.m)>=0?o=n.isub(this.m):0>n.cmpn(0)&&(o=n.iadd(this.m)),o._forceRed(this)},S.prototype.mul=function(t,e){if(t.isZero()||e.isZero())return new n(0)._forceRed(this);var r=t.mul(e),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),o=r.isub(i).iushrn(this.shift),s=o;return o.cmp(this.m)>=0?s=o.isub(this.m):0>o.cmpn(0)&&(s=o.iadd(this.m)),s._forceRed(this)},S.prototype.invm=function(t){return this.imod(t._invmp(this.m).mul(this.r2))._forceRed(this)}}(tR,tf);var tP=tR.exports;let tU="bignumber/5.7.0";var tT=tP.BN;let tD=new tA(tU),tF={},tL=!1;class tq{constructor(t,e){t!==tF&&tD.throwError("cannot call constructor directly; use BigNumber.from",tA.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=e,this._isBigNumber=!0,Object.freeze(this)}fromTwos(t){return tj(tH(this).fromTwos(t))}toTwos(t){return tj(tH(this).toTwos(t))}abs(){return"-"===this._hex[0]?tq.from(this._hex.substring(1)):this}add(t){return tj(tH(this).add(tH(t)))}sub(t){return tj(tH(this).sub(tH(t)))}div(t){return tq.from(t).isZero()&&tK("division-by-zero","div"),tj(tH(this).div(tH(t)))}mul(t){return tj(tH(this).mul(tH(t)))}mod(t){let e=tH(t);return e.isNeg()&&tK("division-by-zero","mod"),tj(tH(this).umod(e))}pow(t){let e=tH(t);return e.isNeg()&&tK("negative-power","pow"),tj(tH(this).pow(e))}and(t){let e=tH(t);return(this.isNegative()||e.isNeg())&&tK("unbound-bitwise-result","and"),tj(tH(this).and(e))}or(t){let e=tH(t);return(this.isNegative()||e.isNeg())&&tK("unbound-bitwise-result","or"),tj(tH(this).or(e))}xor(t){let e=tH(t);return(this.isNegative()||e.isNeg())&&tK("unbound-bitwise-result","xor"),tj(tH(this).xor(e))}mask(t){return(this.isNegative()||t<0)&&tK("negative-width","mask"),tj(tH(this).maskn(t))}shl(t){return(this.isNegative()||t<0)&&tK("negative-width","shl"),tj(tH(this).shln(t))}shr(t){return(this.isNegative()||t<0)&&tK("negative-width","shr"),tj(tH(this).shrn(t))}eq(t){return tH(this).eq(tH(t))}lt(t){return tH(this).lt(tH(t))}lte(t){return tH(this).lte(tH(t))}gt(t){return tH(this).gt(tH(t))}gte(t){return tH(this).gte(tH(t))}isNegative(){return"-"===this._hex[0]}isZero(){return tH(this).isZero()}toNumber(){try{return tH(this).toNumber()}catch{tK("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return tD.throwError("this platform does not support BigInt",tA.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?tL||(tL=!0,tD.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?tD.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",tA.errors.UNEXPECTED_ARGUMENT,{}):tD.throwError("BigNumber.toString does not accept parameters",tA.errors.UNEXPECTED_ARGUMENT,{})),tH(this).toString(10)}toHexString(){return this._hex}toJSON(t){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof tq)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new tq(tF,tz(t)):t.match(/^-?[0-9]+$/)?new tq(tF,tz(new tT(t))):tD.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&tK("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&tK("overflow","BigNumber.from",t),tq.from(String(t));if("bigint"==typeof t)return tq.from(t.toString());if(tE(t))return tq.from(tB(t));if(t){if(t.toHexString){let e=t.toHexString();if("string"==typeof e)return tq.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(tI(e)||"-"===e[0]&&tI(e.substring(1))))return tq.from(e)}}return tD.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(t){return!!(t&&t._isBigNumber)}}function tz(t){if("string"!=typeof t)return tz(t.toString(16));if("-"===t[0])return"-"===(t=t.substring(1))[0]&&tD.throwArgumentError("invalid hex","value",t),"0x00"===(t=tz(t))?t:"-"+t;if("0x"!==t.substring(0,2)&&(t="0x"+t),"0x"===t)return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&"0x00"===t.substring(0,4);)t="0x"+t.substring(4);return t}function tj(t){return tq.from(tz(t))}function tH(t){let e=tq.from(t).toHexString();return"-"===e[0]?new tT("-"+e.substring(3),16):new tT(e.substring(2),16)}function tK(t,e,r){let i={fault:t,operation:e};return null!=r&&(i.value=r),tD.throwError(t,tA.errors.NUMERIC_FAULT,i)}let tQ=new tA(tU),tJ={},tG=tq.from(0),tY=tq.from(-1);function tV(t,e,r,i){let n={fault:e,operation:r};return void 0!==i&&(n.value=i),tQ.throwError(t,tA.errors.NUMERIC_FAULT,n)}let tW="0";for(;tW.length<256;)tW+=tW;function tX(t){if("number"!=typeof t)try{t=tq.from(t).toNumber()}catch{}return"number"==typeof t&&t>=0&&t<=256&&!(t%1)?"1"+tW.substring(0,t):tQ.throwArgumentError("invalid decimal size","decimals",t)}function tZ(t,e){null==e&&(e=0);let r=tX(e),i=(t=tq.from(t)).lt(tG);i&&(t=t.mul(tY));let n=t.mod(r).toString();for(;n.length2&&tQ.throwArgumentError("too many decimal points","value",t);let o=n[0],s=n[1];for(o||(o="0"),s||(s="0");"0"===s[s.length-1];)s=s.substring(0,s.length-1);for(s.length>r.length-1&&tV("fractional component exceeds decimals","underflow","parseFixed"),""===s&&(s="0");s.lengthnull==t[e]?i:(typeof t[e]!==r&&tQ.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e]);e=n("signed","boolean",e),r=n("width","number",r),i=n("decimals","number",i)}return r%8&&tQ.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&tQ.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new t0(tJ,e,r,i)}}class t1{constructor(t,e,r,i){t!==tJ&&tQ.throwError("cannot use FixedNumber constructor; use FixedNumber.from",tA.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=e,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(t){this.format.name!==t.format.name&&tQ.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",t)}addUnsafe(t){this._checkFormat(t);let e=t$(this._value,this.format.decimals),r=t$(t._value,t.format.decimals);return t1.fromValue(e.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);let e=t$(this._value,this.format.decimals),r=t$(t._value,t.format.decimals);return t1.fromValue(e.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);let e=t$(this._value,this.format.decimals),r=t$(t._value,t.format.decimals);return t1.fromValue(e.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);let e=t$(this._value,this.format.decimals),r=t$(t._value,t.format.decimals);return t1.fromValue(e.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=t1.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(e=e.subUnsafe(t2.toFormat(e.format))),e}ceiling(){let t=this.toString().split(".");1===t.length&&t.push("0");let e=t1.from(t[0],this.format),r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(e=e.addUnsafe(t2.toFormat(e.format))),e}round(t){null==t&&(t=0);let e=this.toString().split(".");if(1===e.length&&e.push("0"),(t<0||t>80||t%1)&&tQ.throwArgumentError("invalid decimal count","decimals",t),e[1].length<=t)return this;let r=t1.from("1"+tW.substring(0,t),this.format),i=t3.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(t){return null==t?this._hex:(t%8&&tQ.throwArgumentError("invalid byte width","width",t),t_(tq.from(this._hex).fromTwos(this.format.width).toTwos(t).toHexString(),t/8))}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return t1.fromString(this._value,t)}static fromValue(t,e,r){var i;return null!=r||null==e||null!=(i=e)&&(tq.isBigNumber(i)||"number"==typeof i&&i%1==0||"string"==typeof i&&i.match(/^-?[0-9]+$/)||tI(i)||"bigint"==typeof i||tE(i))||(r=e,e=null),null==e&&(e=0),null==r&&(r="fixed"),t1.fromString(tZ(t,e),t0.from(r))}static fromString(t,e){null==e&&(e="fixed");let r=t0.from(e),i=t$(t,r.decimals);!r.signed&&i.lt(tG)&&tV("unsigned value cannot be negative","overflow","value",t);let n=null;return new t1(tJ,r.signed?i.toTwos(r.width).toHexString():t_(i.toHexString(),r.width/8),tZ(i,r.decimals),r)}static fromBytes(t,e){null==e&&(e="fixed");let r=t0.from(e);if(tS(t).length>r.width/8)throw Error("overflow");let i=tq.from(t);return r.signed&&(i=i.fromTwos(r.width)),new t1(tJ,i.toTwos((r.signed?0:1)+r.width).toHexString(),tZ(i,r.decimals),r)}static from(t,e){if("string"==typeof t)return t1.fromString(t,e);if(tE(t))return t1.fromBytes(t,e);try{return t1.fromValue(t,0,e)}catch(t){if(t.code!==tA.errors.INVALID_ARGUMENT)throw t}return tQ.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(t){return!!(t&&t._isFixedNumber)}}let t2=t1.from(1),t3=t1.from("0.5"),t6=new tA("strings/5.7.0");function t8(t,e,r,i,n){if(t===p.BAD_PREFIX||t===p.UNEXPECTED_CONTINUE){let t=0;for(let i=e+1;i>6==2;i++)t++;return t}return t===p.OVERRUN?r.length-e-1:0}function t4(t,e=d.current){e!=d.current&&(t6.checkNormalize(),t=t.normalize(e));let r=[];for(let e=0;e>6|192),r.push(63&i|128);else if((64512&i)==55296){e++;let n=t.charCodeAt(e);if(e>=t.length||(64512&n)!=56320)throw Error("invalid utf-8 string");let o=65536+((1023&i)<<10)+(1023&n);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return tS(r)}function t5(t,e){e||(e=function(t){return[parseInt(t,16)]});let r=0,i={};return t.split(",").forEach(t=>{let n=t.split(":");i[r+=parseInt(n[0],16)]=e(n[1])}),i}function t7(t){let e=0;return t.split(",").map(t=>{let r=t.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:e+parseInt(r[0],16),h:e=parseInt(r[1],16)}})}(f=d||(d={})).current="",f.NFC="NFC",f.NFD="NFD",f.NFKC="NFKC",f.NFKD="NFKD",(h=p||(p={})).UNEXPECTED_CONTINUE="unexpected continuation byte",h.BAD_PREFIX="bad codepoint prefix",h.OVERRUN="string overrun",h.MISSING_CONTINUE="missing continuation byte",h.OUT_OF_RANGE="out of UTF-8 range",h.UTF16_SURROGATE="UTF-16 surrogate",h.OVERLONG="overlong representation",Object.freeze({error:function(t,e,r,i,n){return t6.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)},ignore:t8,replace:function(t,e,r,i,n){return t===p.OVERLONG?(i.push(n),0):(i.push(65533),t8(t,e,r))}}),t7("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map(t=>parseInt(t,16)),t5("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),t5("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),t5("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",function(t){if(t.length%4!=0)throw Error("bad data");let e=[];for(let r=0;r0&&Array.isArray(t)?n(t,e-1):r.push(t)})};return n(t,e),r}function ee(t,e){let r=Array(t);for(let i=0,n=-1;ie[t]):r}function ei(t,e,r){let i=Array(t).fill(void 0).map(()=>[]);for(let n=0;n>1:i>>1}return r})(t,r).forEach((t,e)=>i[e].push(t));return i}let en=(o=function(t){let e=0;function r(){return t[e++]<<8|t[e++]}let i=r(),n=1,o=[0,1];for(let t=1;t>--f&1}let l=0;for(let t=0;t<31;t++)l=l<<1|a();let c=[],d=0,p=2147483648;for(;;){let t=Math.floor(((l-d+1)*n-1)/p),e=0,r=i;for(;r-e>1;){let i=e+r>>>1;t{switch(e-m){case 3:return m+65792+(t[u++]<<16|t[u++]<<8|t[u++]);case 2:return m+256+(t[u++]<<8|t[u++]);case 1:return m+t[u++];default:return e-1}})}(function(t){t=atob(t);let e=[];for(let r=0;ro[n++]);er(en),er(en),function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(function(t,e){let r=1+e(),i=e(),n=function(t){let e=[];for(;;){let r=t();if(0==r)break;e.push(r)}return e}(e);return et(ei(n.length,1+t,e).map((t,e)=>{let o=t[0],s=t.slice(1);return Array(n[e]).fill(void 0).map((t,e)=>{let n=e*i;return[o+e*r,s.map(t=>t+n)]})}))}(r,t))}for(;;){let r=t()-1;if(r<0)break;e.push(ei(1+t(),1+r,t).map(t=>[t[0],t.slice(1)]))}(function(t){let e={};for(let r=0;rt-e),function t(){let e=[];for(;;){let r=er(en,i);if(0==r.length)break;e.push({set:new Set(r),node:t()})}e.sort((t,e)=>e.set.size-t.set.size);let r=en();return{branches:e,valid:r%3,fe0f:!!(1&(r=r/3|0)),save:1==(r>>=1),check:2==r}}(),new tA(t9),new Uint8Array(32).fill(0);let eo=`Ethereum Signed Message: `;function es(t){return"string"==typeof t&&(t=t4(t)),tO(function(t){let e=t.map(t=>tS(t)),r=new Uint8Array(e.reduce((t,e)=>t+e.length,0));return e.reduce((t,e)=>(r.set(e,t),t+e.length),0),tw(r)}([t4(eo),t4(String(t.length)),t]))}new tA("rlp/5.7.0");let eu=new tA("address/5.7.0");function ef(t){tI(t,20)||eu.throwArgumentError("invalid address","address",t);let e=(t=t.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let t=0;t<40;t++)r[t]=e[t].charCodeAt(0);let i=tS(tO(r));for(let t=0;t<40;t+=2)i[t>>1]>>4>=8&&(e[t]=e[t].toUpperCase()),(15&i[t>>1])>=8&&(e[t+1]=e[t+1].toUpperCase());return"0x"+e.join("")}let eh={};for(let t=0;t<10;t++)eh[String(t)]=String(t);for(let t=0;t<26;t++)eh[String.fromCharCode(65+t)]=String(10+t);let ea=Math.floor(Math.log10?Math.log10(9007199254740991):Math.log(9007199254740991)/Math.LN10);function el(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}new tA("properties/5.7.0"),new tA(t9),new Uint8Array(32).fill(0),tq.from(-1);let ec=tq.from(0),ed=tq.from(1);tq.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),t_(ed.toHexString(),32),t_(ec.toHexString(),32);var ep={},em={};function eg(t,e){if(!t)throw Error(e||"Assertion failed")}eg.equal=function(t,e,r){if(t!=e)throw Error(r||"Assertion failed: "+t+" != "+e)};var ev={exports:{}};"function"==typeof Object.create?ev.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:ev.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}};var eA=ev.exports;function ey(t){return(t>>>24|t>>>8&65280|t<<8&16711680|(255&t)<<24)>>>0}function eb(t){return 1===t.length?"0"+t:t}function ew(t){return 7===t.length?"0"+t:6===t.length?"00"+t:5===t.length?"000"+t:4===t.length?"0000"+t:3===t.length?"00000"+t:2===t.length?"000000"+t:1===t.length?"0000000"+t:t}em.inherits=eA,em.toArray=function(t,e){if(Array.isArray(t))return t.slice();if(!t)return[];var r=[];if("string"==typeof t){if(e){if("hex"===e)for((t=t.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(t="0"+t),n=0;n>6|192:((o=t,s=n,(64512&o.charCodeAt(s))!=55296||s<0||s+1>=o.length||(64512&o.charCodeAt(s+1))!=56320)?r[i++]=u>>12|224:(u=65536+((1023&u)<<10)+(1023&t.charCodeAt(++n)),r[i++]=u>>18|240,r[i++]=u>>12&63|128),r[i++]=u>>6&63|128),r[i++]=63&u|128)}}else for(n=0;n>>0;return s},em.split32=function(t,e){for(var r=Array(4*t.length),i=0,n=0;i>>24,r[n+1]=o>>>16&255,r[n+2]=o>>>8&255,r[n+3]=255&o):(r[n+3]=o>>>24,r[n+2]=o>>>16&255,r[n+1]=o>>>8&255,r[n]=255&o)}return r},em.rotr32=function(t,e){return t>>>e|t<<32-e},em.rotl32=function(t,e){return t<>>32-e},em.sum32=function(t,e){return t+e>>>0},em.sum32_3=function(t,e,r){return t+e+r>>>0},em.sum32_4=function(t,e,r,i){return t+e+r+i>>>0},em.sum32_5=function(t,e,r,i,n){return t+e+r+i+n>>>0},em.sum64=function(t,e,r,i){var n=t[e],o=i+t[e+1]>>>0;t[e]=(o>>0,t[e+1]=o},em.sum64_hi=function(t,e,r,i){return(e+i>>>0>>0},em.sum64_lo=function(t,e,r,i){return e+i>>>0},em.sum64_4_hi=function(t,e,r,i,n,o,s,u){var f,h=e;return t+r+n+s+(0+((h=h+i>>>0)>>0)>>0)>>0},em.sum64_4_lo=function(t,e,r,i,n,o,s,u){return e+i+o+u>>>0},em.sum64_5_hi=function(t,e,r,i,n,o,s,u,f,h){var a,l=e;return t+r+n+s+f+(0+((l=l+i>>>0)>>0)>>0)>>0)>>0},em.sum64_5_lo=function(t,e,r,i,n,o,s,u,f,h){return e+i+o+u+h>>>0},em.rotr64_hi=function(t,e,r){return(e<<32-r|t>>>r)>>>0},em.rotr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0},em.shr64_hi=function(t,e,r){return t>>>r},em.shr64_lo=function(t,e,r){return(t<<32-r|e>>>r)>>>0};var eM={};function eE(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}eM.BlockHash=eE,eE.prototype.update=function(t,e){if(t=em.toArray(t,e),this.pending?this.pending=this.pending.concat(t):this.pending=t,this.pendingTotal+=t.length,this.pending.length>=this._delta8){var r=(t=this.pending).length%this._delta8;this.pending=t.slice(t.length-r,t.length),0===this.pending.length&&(this.pending=null),t=em.join32(t,0,t.length-r,this.endian);for(var i=0;i>>24&255,i[n++]=t>>>16&255,i[n++]=t>>>8&255,i[n++]=255&t}else for(i[n++]=255&t,i[n++]=t>>>8&255,i[n++]=t>>>16&255,i[n++]=t>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,o=8;o>>3},eI.g1_256=function(t){return eN(t,17)^eN(t,19)^t>>>10};var eC=em.rotl32,e_=em.sum32,ex=em.sum32_5,eO=eI.ft_1,eR=eM.BlockHash,ek=[1518500249,1859775393,2400959708,3395469782];function eP(){if(!(this instanceof eP))return new eP;eR.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}em.inherits(eP,eR),eP.blockSize=512,eP.outSize=160,eP.hmacStrength=80,eP.padLength=64,eP.prototype._update=function(t,e){for(var r=this.W,i=0;i<16;i++)r[i]=t[e+i];for(;ithis.blockSize&&(t=new this.Hash().update(t).digest()),eg(t.length<=this.blockSize);for(var e=t.length;e>8,s=255&n;o?r.push(o,s):r.push(s)}return r},e.zero2=r,e.toHex=i,e.encode=function(t,e){return"hex"===e?i(t):t}}),rg=rc(function(t,e){e.assert=rd,e.toArray=rm.toArray,e.zero2=rm.zero2,e.toHex=rm.toHex,e.encode=rm.encode,e.getNAF=function(t,e,r){var i=Array(Math.max(t.bitLength(),r)+1);i.fill(0);for(var n=1<(n>>1)-1?(n>>1)-f:f,o.isubn(u)):u=0,i[s]=u,o.iushrn(1)}return i},e.getJSF=function(t,e){var r=[[],[]];t=t.clone(),e=e.clone();for(var i,n=0,o=0;t.cmpn(-n)>0||e.cmpn(-o)>0;){var s,u,f=t.andln(3)+n&3,h=e.andln(3)+o&3;3===f&&(f=-1),3===h&&(h=-1),s=1&f?(3==(i=t.andln(7)+n&7)||5===i)&&2===h?-f:f:0,r[0].push(s),u=1&h?(3==(i=e.andln(7)+o&7)||5===i)&&2===f?-h:h:0,r[1].push(u),2*n===s+1&&(n=1-n),2*o===u+1&&(o=1-o),t.iushrn(1),e.iushrn(1)}return r},e.cachedProperty=function(t,e,r){var i="_"+e;t.prototype[e]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(t){return new tP(t,"hex","le")}}),rv=rg.getNAF,rA=rg.getJSF,ry=rg.assert;function rb(t,e){this.type=t,this.p=new tP(e.p,16),this.red=e.prime?tP.red(e.prime):tP.mont(this.p),this.zero=new tP(0).toRed(this.red),this.one=new tP(1).toRed(this.red),this.two=new tP(2).toRed(this.red),this.n=e.n&&new tP(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function rw(t,e){this.curve=t,this.type=e,this.precomputed=null}rb.prototype.point=function(){throw Error("Not implemented")},rb.prototype.validate=function(){throw Error("Not implemented")},rb.prototype._fixedNafMul=function(t,e){ry(t.precomputed);var r=t._getDoubles(),i=rv(e,1,this._bitLength),n=(1<=o;f--)s=(s<<1)+i[f];u.push(s)}for(var h=this.jpoint(null,null,null),a=this.jpoint(null,null,null),l=n;l>0;l--){for(o=0;o=0;u--){for(var f=0;u>=0&&0===o[u];u--)f++;if(u>=0&&f++,s=s.dblp(f),u<0)break;var h=o[u];ry(0!==h),s="affine"===t.type?h>0?s.mixedAdd(n[h-1>>1]):s.mixedAdd(n[-h-1>>1].neg()):h>0?s.add(n[h-1>>1]):s.add(n[-h-1>>1].neg())}return"affine"===t.type?s.toP():s},rb.prototype._wnafMulAdd=function(t,e,r,i,n){var o,s,u,f=this._wnafT1,h=this._wnafT2,a=this._wnafT3,l=0;for(o=0;o=1;o-=2){var d=o-1,p=o;if(1!==f[d]||1!==f[p]){a[d]=rv(r[d],f[d],this._bitLength),a[p]=rv(r[p],f[p],this._bitLength),l=Math.max(a[d].length,l),l=Math.max(a[p].length,l);continue}var m=[e[d],null,null,e[p]];0===e[d].y.cmp(e[p].y)?(m[1]=e[d].add(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg())):0===e[d].y.cmp(e[p].y.redNeg())?(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].add(e[p].neg())):(m[1]=e[d].toJ().mixedAdd(e[p]),m[2]=e[d].toJ().mixedAdd(e[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],v=rA(r[d],r[p]);for(l=Math.max(v[0].length,l),a[d]=Array(l),a[p]=Array(l),s=0;s=0;o--){for(var M=0;o>=0;){var E=!0;for(s=0;s=0&&M++,b=b.dblp(M),o<0)break;for(s=0;s0?u=h[s][S-1>>1]:S<0&&(u=h[s][-S-1>>1].neg()),b="affine"===u.type?b.mixedAdd(u):b.add(u))}}for(o=0;o=Math.ceil((t.bitLength()+1)/e.step)},rw.prototype._getDoubles=function(t,e){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;nn[0].cmp(n[1])?n[0]:n[1]).toRed(this.red)}if(t.lambda)r=new tP(t.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(e))?r=o[0]:(r=o[1],rE(0===this.g.mul(r).x.cmp(this.g.x.redMul(e))))}return i=t.basis?t.basis.map(function(t){return{a:new tP(t.a,16),b:new tP(t.b,16)}}):this._getEndoBasis(r),{beta:e,lambda:r,basis:i}}},rS.prototype._getEndoRoots=function(t){var e=t===this.p?this.red:tP.mont(t),r=new tP(2).toRed(e).redInvm(),i=r.redNeg(),n=new tP(3).toRed(e).redNeg().redSqrt().redMul(r);return[i.redAdd(n).fromRed(),i.redSub(n).fromRed()]},rS.prototype._getEndoBasis=function(t){for(var e,r,i,n,o,s,u,f,h,a=this.n.ushrn(Math.floor(this.n.bitLength()/2)),l=t,c=this.n.clone(),d=new tP(1),p=new tP(0),m=new tP(0),g=new tP(1),v=0;0!==l.cmpn(0);){var A=c.div(l);f=c.sub(A.mul(l)),h=m.sub(A.mul(d));var y=g.sub(A.mul(p));if(!i&&0>f.cmp(a))e=u.neg(),r=d,i=f.neg(),n=h;else if(i&&2==++v)break;u=f,c=l,l=f,m=d,d=h,g=p,p=y}o=f.neg(),s=h;var b=i.sqr().add(n.sqr());return o.sqr().add(s.sqr()).cmp(b)>=0&&(o=e,s=r),i.negative&&(i=i.neg(),n=n.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:i,b:n},{a:o,b:s}]},rS.prototype._endoSplit=function(t){var e=this.endo.basis,r=e[0],i=e[1],n=i.b.mul(t).divRound(this.n),o=r.b.neg().mul(t).divRound(this.n),s=n.mul(r.a),u=o.mul(i.a),f=n.mul(r.b),h=o.mul(i.b);return{k1:t.sub(s).sub(u),k2:f.add(h).neg()}},rS.prototype.pointFromX=function(t,e){(t=new tP(t,16)).red||(t=t.toRed(this.red));var r=t.redSqr().redMul(t).redIAdd(t.redMul(this.a)).redIAdd(this.b),i=r.redSqrt();if(0!==i.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var n=i.fromRed().isOdd();return(e&&!n||!e&&n)&&(i=i.redNeg()),this.point(t,i)},rS.prototype.validate=function(t){if(t.inf)return!0;var e=t.x,r=t.y,i=this.a.redMul(e),n=e.redSqr().redMul(e).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},rS.prototype._endoWnafMulAdd=function(t,e,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,o=0;o":""},rI.prototype.isInfinity=function(){return this.inf},rI.prototype.add=function(t){if(this.inf)return t;if(t.inf)return this;if(this.eq(t))return this.dbl();if(this.neg().eq(t)||0===this.x.cmp(t.x))return this.curve.point(null,null);var e=this.y.redSub(t.y);0!==e.cmpn(0)&&(e=e.redMul(this.x.redSub(t.x).redInvm()));var r=e.redSqr().redISub(this.x).redISub(t.x),i=e.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},rI.prototype.dbl=function(){if(this.inf)return this;var t=this.y.redAdd(this.y);if(0===t.cmpn(0))return this.curve.point(null,null);var e=this.curve.a,r=this.x.redSqr(),i=t.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(e).redMul(i),o=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},rI.prototype.getX=function(){return this.x.fromRed()},rI.prototype.getY=function(){return this.y.fromRed()},rI.prototype.mul=function(t){return t=new tP(t,16),this.isInfinity()?this:this._hasDoubles(t)?this.curve._fixedNafMul(this,t):this.curve.endo?this.curve._endoWnafMulAdd([this],[t]):this.curve._wnafMul(this,t)},rI.prototype.mulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},rI.prototype.jmulAdd=function(t,e,r){var i=[this,e],n=[t,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},rI.prototype.eq=function(t){return this===t||this.inf===t.inf&&(this.inf||0===this.x.cmp(t.x)&&0===this.y.cmp(t.y))},rI.prototype.neg=function(t){if(this.inf)return this;var e=this.curve.point(this.x,this.y.redNeg());if(t&&this.precomputed){var r=this.precomputed,i=function(t){return t.neg()};e.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return e},rI.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},rM(rN,rb.BasePoint),rS.prototype.jpoint=function(t,e,r){return new rN(this,t,e,r)},rN.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var t=this.z.redInvm(),e=t.redSqr(),r=this.x.redMul(e),i=this.y.redMul(e).redMul(t);return this.curve.point(r,i)},rN.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},rN.prototype.add=function(t){if(this.isInfinity())return t;if(t.isInfinity())return this;var e=t.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(e),n=t.x.redMul(r),o=this.y.redMul(e.redMul(t.z)),s=t.y.redMul(r.redMul(this.z)),u=i.redSub(n),f=o.redSub(s);if(0===u.cmpn(0))return 0!==f.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var h=u.redSqr(),a=h.redMul(u),l=i.redMul(h),c=f.redSqr().redIAdd(a).redISub(l).redISub(l),d=f.redMul(l.redISub(c)).redISub(o.redMul(a)),p=this.z.redMul(t.z).redMul(u);return this.curve.jpoint(c,d,p)},rN.prototype.mixedAdd=function(t){if(this.isInfinity())return t.toJ();if(t.isInfinity())return this;var e=this.z.redSqr(),r=this.x,i=t.x.redMul(e),n=this.y,o=t.y.redMul(e).redMul(this.z),s=r.redSub(i),u=n.redSub(o);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var f=s.redSqr(),h=f.redMul(s),a=r.redMul(f),l=u.redSqr().redIAdd(h).redISub(a).redISub(a),c=u.redMul(a.redISub(l)).redISub(n.redMul(h)),d=this.z.redMul(s);return this.curve.jpoint(l,c,d)},rN.prototype.dblp=function(t){if(0===t||this.isInfinity())return this;if(!t)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var e,r=this;for(e=0;e=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},rN.prototype.inspect=function(){return this.isInfinity()?"":""},rN.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var rB=rc(function(t,e){e.base=rb,e.short=rS,e.mont=null,e.edwards=null}),rC=rc(function(t,e){var r,i=rg.assert;function n(t){"short"===t.type?this.curve=new rB.short(t):"edwards"===t.type?this.curve=new rB.edwards(t):this.curve=new rB.mont(t),this.g=this.curve.g,this.n=this.curve.n,this.hash=t.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function o(t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var i=new n(r);return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:i}),i}})}e.PresetCurve=n,o("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:ep.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),o("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:ep.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),o("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:ep.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),o("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:ep.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),o("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:ep.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),o("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ep.sha256,gRed:!1,g:["9"]}),o("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:ep.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch{r=void 0}o("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:ep.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})});function r_(t){if(!(this instanceof r_))return new r_(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=rm.toArray(t.entropy,t.entropyEnc||"hex"),r=rm.toArray(t.nonce,t.nonceEnc||"hex"),i=rm.toArray(t.pers,t.persEnc||"hex");rd(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,i)}r_.prototype._init=function(t,e,r){var i=t.concat(e).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(t.concat(r||[])),this._reseed=1},r_.prototype.generate=function(t,e,r,i){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof e&&(i=r,r=e,e=null),r&&(r=rm.toArray(r,i||"hex"),this._update(r));for(var n=[];n.length"};var rR=rg.assert;function rk(t,e){if(t instanceof rk)return t;this._importDER(t,e)||(rR(t.r&&t.s,"Signature without r or s"),this.r=new tP(t.r,16),this.s=new tP(t.s,16),void 0===t.recoveryParam?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}function rP(){this.place=0}function rU(t,e){var r=t[e.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4)return!1;for(var n=0,o=0,s=e.place;o>>=0;return!(n<=127)&&(e.place=s,n)}function rT(t){for(var e=0,r=t.length-1;!t[e]&&!(128&t[e+1])&&e>>3);for(t.push(128|r);--r;)t.push(e>>>(r<<3)&255);t.push(e)}rk.prototype._importDER=function(t,e){t=rg.toArray(t,e);var r=new rP;if(48!==t[r.place++])return!1;var i=rU(t,r);if(!1===i||i+r.place!==t.length||2!==t[r.place++])return!1;var n=rU(t,r);if(!1===n)return!1;var o=t.slice(r.place,n+r.place);if(r.place+=n,2!==t[r.place++])return!1;var s=rU(t,r);if(!1===s||t.length!==s+r.place)return!1;var u=t.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}return this.r=new tP(o),this.s=new tP(u),this.recoveryParam=null,!0},rk.prototype.toDER=function(t){var e=this.r.toArray(),r=this.s.toArray();for(128&e[0]&&(e=[0].concat(e)),128&r[0]&&(r=[0].concat(r)),e=rT(e),r=rT(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var i=[2];rD(i,e.length),(i=i.concat(e)).push(2),rD(i,r.length);var n=i.concat(r),o=[48];return rD(o,n.length),o=o.concat(n),rg.encode(o,t)};var rF=function(){throw Error("unsupported")},rL=rg.assert;function rq(t){if(!(this instanceof rq))return new rq(t);"string"==typeof t&&(rL(Object.prototype.hasOwnProperty.call(rC,t),"Unknown curve "+t),t=rC[t]),t instanceof rC.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}rq.prototype.keyPair=function(t){return new rO(this,t)},rq.prototype.keyFromPrivate=function(t,e){return rO.fromPrivate(this,t,e)},rq.prototype.keyFromPublic=function(t,e){return rO.fromPublic(this,t,e)},rq.prototype.genKeyPair=function(t){t||(t={});for(var e=new r_({hash:this.hash,pers:t.pers,persEnc:t.persEnc||"utf8",entropy:t.entropy||rF(this.hash.hmacStrength),entropyEnc:t.entropy&&t.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),i=this.n.sub(new tP(2));;){var n=new tP(e.generate(r));if(!(n.cmp(i)>0))return n.iaddn(1),this.keyFromPrivate(n)}},rq.prototype._truncateToN=function(t,e){var r=8*t.byteLength()-this.n.bitLength();return r>0&&(t=t.ushrn(r)),!e&&t.cmp(this.n)>=0?t.sub(this.n):t},rq.prototype.sign=function(t,e,r,i){"object"==typeof r&&(i=r,r=null),i||(i={}),e=this.keyFromPrivate(e,r),t=this._truncateToN(new tP(t,16));for(var n=this.n.byteLength(),o=e.getPrivate().toArray("be",n),s=t.toArray("be",n),u=new r_({hash:this.hash,entropy:o,nonce:s,pers:i.pers,persEnc:i.persEnc||"utf8"}),f=this.n.sub(new tP(1)),h=0;;h++){var a=i.k?i.k(h):new tP(u.generate(this.n.byteLength()));if(!(0>=(a=this._truncateToN(a,!0)).cmpn(1)||a.cmp(f)>=0)){var l=this.g.mul(a);if(!l.isInfinity()){var c=l.getX(),d=c.umod(this.n);if(0!==d.cmpn(0)){var p=a.invm(this.n).mul(d.mul(e.getPrivate()).iadd(t));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(l.getY().isOdd()?1:0)|(0!==c.cmp(d)?2:0);return i.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new rk({r:d,s:p,recoveryParam:m})}}}}}},rq.prototype.verify=function(t,e,r,i){t=this._truncateToN(new tP(t,16)),r=this.keyFromPublic(r,i);var n=(e=new rk(e,"hex")).r,o=e.s;if(0>n.cmpn(1)||n.cmp(this.n)>=0||0>o.cmpn(1)||o.cmp(this.n)>=0)return!1;var s,u=o.invm(this.n),f=u.mul(t).umod(this.n),h=u.mul(n).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(f,r.getPublic(),h)).isInfinity()&&s.eqXToP(n):!(s=this.g.mulAdd(f,r.getPublic(),h)).isInfinity()&&0===s.getX().umod(this.n).cmp(n)},rq.prototype.recoverPubKey=function(t,e,r,i){rL((3&r)===r,"The recovery param is more than two bits"),e=new rk(e,i);var n=this.n,o=new tP(t),s=e.r,u=e.s,f=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),f):this.curve.pointFromX(s,f);var a=e.r.invm(n),l=n.sub(o).mul(a).umod(n),c=u.mul(a).umod(n);return this.g.mulAdd(l,s,c)},rq.prototype.getKeyRecoveryParam=function(t,e,r,i){if(null!==(e=new rk(e,i)).recoveryParam)return e.recoveryParam;for(var n,o=0;o<4;o++){try{n=this.recoverPubKey(t,e,o)}catch{continue}if(n.eq(r))return o}throw Error("Unable to find valid recovery factor")};var rz=rc(function(t,e){e.version="6.5.4",e.utils=rg,e.rand=function(){throw Error("unsupported")},e.curve=rB,e.curves=rC,e.ec=rq,e.eddsa=null}).ec;let rj=new tA("signing-key/5.7.0"),rH=null;function rK(){return rH||(rH=new rz("secp256k1")),rH}class rQ{constructor(t){el(this,"curve","secp256k1"),el(this,"privateKey",tB(t)),32!==function(t){if("string"!=typeof t)t=tB(t);else if(!tI(t)||t.length%2)return null;return(t.length-2)/2}(this.privateKey)&&rj.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let e=rK().keyFromPrivate(tS(this.privateKey));el(this,"publicKey","0x"+e.getPublic(!1,"hex")),el(this,"compressedPublicKey","0x"+e.getPublic(!0,"hex")),el(this,"_isSigningKey",!0)}_addPoint(t){let e=rK().keyFromPublic(tS(this.publicKey)),r=rK().keyFromPublic(tS(t));return"0x"+e.pub.add(r.pub).encodeCompressed("hex")}signDigest(t){let e=rK().keyFromPrivate(tS(this.privateKey)),r=tS(t);32!==r.length&&rj.throwArgumentError("bad digest length","digest",t);let i=e.sign(r,{canonical:!0});return tx({recoveryParam:i.recoveryParam,r:t_("0x"+i.r.toString(16),32),s:t_("0x"+i.s.toString(16),32)})}computeSharedSecret(t){let e=rK().keyFromPrivate(tS(this.privateKey)),r=rK().keyFromPublic(tS(rJ(t)));return t_("0x"+e.derive(r.getPublic()).toString(16),32)}static isSigningKey(t){return!!(t&&t._isSigningKey)}}function rJ(t,e){let r=tS(t);if(32===r.length){let t=new rQ(r);return e?"0x"+rK().keyFromPrivate(r).getPublic(!0,"hex"):t.publicKey}return 33===r.length?e?tB(r):"0x"+rK().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?e?"0x"+rK().keyFromPublic(r).getPublic(!0,"hex"):tB(r):rj.throwArgumentError("invalid public or private key","key","[REDACTED]")}async function rG(t,e,r,i,n,o){switch(r.t){case"eip191":var s;return s=r.s,(function(t){let e=null;if("string"!=typeof t&&eu.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==t.substring(0,2)&&(t="0x"+t),e=ef(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&eu.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==function(t){let e=(t=(t=t.toUpperCase()).substring(4)+t.substring(0,2)+"00").split("").map(t=>eh[t]).join("");for(;e.length>=ea;){let t=e.substring(0,ea);e=parseInt(t,10)%97+e.substring(t.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}(t)&&eu.throwArgumentError("bad icap checksum","address",t),e=new tT(t.substring(4),36).toString(16);e.length<40;)e="0"+e;e=ef("0x"+e)}else eu.throwArgumentError("invalid address","address",t);return e})(tC(tO(tC(rJ(function(t,e){let r=tx(e),i={r:tS(r.r),s:tS(r.s)};return"0x"+rK().recoverPubKey(tS(t),i,r.recoveryParam).encode("hex",!1)}(tS(es(e)),s)),1)),12)).toLowerCase()===t.toLowerCase();case"eip1271":return await rY(t,e,r.s,i,n,o);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function rY(t,e,r,i,n,o){try{let s="0x1626ba7e",u=r.substring(2),f=es(e).substring(2),h=await fetch(`${o||"https://rpc.walletconnect.com/v1"}/?chainId=${i}&projectId=${n}`,{method:"POST",body:JSON.stringify({id:Date.now()+Math.floor(1e3*Math.random()),jsonrpc:"2.0",method:"eth_call",params:[{to:t,data:s+f+"00000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000041"+u},"latest"]})}),{result:a}=await h.json();return!!a&&a.slice(0,s.length).toLowerCase()===s.toLowerCase()}catch(t){return console.error("isValidEip1271Signature: ",t),!1}}new tA("transactions/5.7.0"),(a=m||(m={}))[a.legacy=0]="legacy",a[a.eip2930=1]="eip2930",a[a.eip1559=2]="eip1559";var rV=Object.defineProperty,rW=Object.defineProperties,rX=Object.getOwnPropertyDescriptors,rZ=Object.getOwnPropertySymbols,r$=Object.prototype.hasOwnProperty,r0=Object.prototype.propertyIsEnumerable,r1=(t,e,r)=>e in t?rV(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,r2=(t,e)=>{for(var r in e||(e={}))r$.call(e,r)&&r1(t,r,e[r]);if(rZ)for(var r of rZ(e))r0.call(e,r)&&r1(t,r,e[r]);return t},r3=(t,e)=>rW(t,rX(e));let r6=t=>t?.split(":"),r8=t=>{let e=t&&r6(t);if(e)return t.includes("did:pkh:")?e[3]:e[1]},r4=t=>{let e=t&&r6(t);if(e)return e[2]+":"+e[3]},r5=t=>{let e=t&&r6(t);if(e)return e.pop()};async function r7(t){let{cacao:e,projectId:r}=t,{s:i,p:n}=e,o=r9(n,n.iss),s=r5(n.iss);return await rG(s,o,i,r8(n.iss),r)}let r9=(t,e)=>{let r=`${t.domain} wants you to sign in with your Ethereum account:`,i=r5(e);if(!t.aud&&!t.uri)throw Error("Either `aud` or `uri` is required to construct the message");let n=t.statement||void 0,o=`URI: ${t.aud||t.uri}`,s=`Version: ${t.version}`,u=`Chain ID: ${r8(e)}`,f=`Nonce: ${t.nonce}`,h=`Issued At: ${t.iat}`,a=t.exp?`Expiration Time: ${t.exp}`:void 0,l=t.nbf?`Not Before: ${t.nbf}`:void 0,c=t.requestId?`Request ID: ${t.requestId}`:void 0,d=t.resources?`Resources:${t.resources.map(t=>` - ${t}`).join("")}`:void 0,p=ih(t.resources);return p&&(n=function(t="",e){it(e);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(t.includes(r))return t;let i=[],n=0;Object.keys(e.att).forEach(t=>{let r=Object.keys(e.att[t]).map(t=>({ability:t.split("/")[0],action:t.split("/")[1]}));r.sort((t,e)=>t.action.localeCompare(e.action));let o={};r.forEach(t=>{o[t.ability]||(o[t.ability]=[]),o[t.ability].push(t.action)});let s=Object.keys(o).map(e=>(n++,`(${n}) '${e}': '${o[e].join("', '")}' for '${t}'.`));i.push(s.join(", ").replace(".,","."))});let o=i.join(" "),s=`${r}${o}`;return`${t?t+" ":""}${s}`}(n,ir(p))),[r,i,"",n,"",o,s,u,f,h,a,l,c,d].filter(t=>null!=t).join(` `)};function it(t){if(!t)throw Error("No recap provided, value is undefined");if(!t.att)throw Error("No `att` property found");let e=Object.keys(t.att);if(!(null!=e&&e.length))throw Error("No resources found in `att` property");e.forEach(e=>{let r=t.att[e];if(Array.isArray(r)||"object"!=typeof r)throw Error(`Resource must be an object: ${e}`);if(!Object.keys(r).length)throw Error(`Resource object is empty: ${e}`);Object.keys(r).forEach(t=>{let e=r[t];if(!Array.isArray(e))throw Error(`Ability limits ${t} must be an array of objects, found: ${e}`);if(!e.length)throw Error(`Value of ${t} is empty array, must be an array with objects`);e.forEach(e=>{if("object"!=typeof e)throw Error(`Ability limits (${t}) must be an array of objects, found: ${e}`)})})})}function ie(t){return it(t),`urn:recap:${_.from(JSON.stringify(t)).toString("base64").replace(/=/g,"")}`}function ir(t){var e;let r=(e=t.replace("urn:recap:",""),JSON.parse(_.from(e,"base64").toString("utf-8")));return it(r),r}function ii(t,e,r){return ie(function(t,e,r,i={}){return r?.sort((t,e)=>t.localeCompare(e)),{att:{[t]:function(t,e,r={}){return Object.assign({},...(e=e?.sort((t,e)=>t.localeCompare(e))).map(e=>({[`${t}/${e}`]:[r]})))}(e,r,i)}}}(t,e,r))}function io(t,e){return ie(function(t,e){it(t),it(e);let r=Object.keys(t.att).concat(Object.keys(e.att)).sort((t,e)=>t.localeCompare(e)),i={att:{}};return r.forEach(r=>{var n,o;Object.keys((null==(n=t.att)?void 0:n[r])||{}).concat(Object.keys((null==(o=e.att)?void 0:o[r])||{})).sort((t,e)=>t.localeCompare(e)).forEach(n=>{var o,s;i.att[r]=r3(r2({},i.att[r]),{[n]:(null==(o=t.att[r])?void 0:o[n])||(null==(s=e.att[r])?void 0:s[n])})})}),i}(ir(t),ir(e)))}function is(t){var e;let r=ir(t);it(r);let i=null==(e=r.att)?void 0:e.eip155;return i?Object.keys(i).map(t=>t.split("/")[1]):[]}function iu(t){let e=ir(t);it(e);let r=[];return Object.values(e.att).forEach(t=>{Object.values(t).forEach(t=>{var e;null!=(e=t?.[0])&&e.chains&&r.push(t[0].chains)})}),[...new Set(r.flat())]}function ih(t){if(!t)return;let e=t?.[t.length-1];return e&&e.includes("urn:recap:")?e:void 0}let ia="base10",il="base16",ic="base64pad",id="utf8",ip=1;function im(){let t=I.Au();return{privateKey:(0,N.BB)(t.secretKey,il),publicKey:(0,N.BB)(t.publicKey,il)}}function ig(){let t=(0,E.randomBytes)(32);return(0,N.BB)(t,il)}function iv(t,e){let r=I.gi((0,N.mL)(t,il),(0,N.mL)(e,il),!0),i=new M.t(S.mE,r).expand(32);return(0,N.BB)(i,il)}function iA(t){let e=(0,S.vp)((0,N.mL)(t,il));return(0,N.BB)(e,il)}function iy(t){let e=(0,S.vp)((0,N.mL)(t,id));return(0,N.BB)(e,il)}function ib(t){return Number((0,N.BB)(t,ia))}function iw(t){var e;let r=(e="u">typeof t.type?t.type:0,(0,N.mL)(`${e}`,ia));if(ib(r)===ip&&typeof t.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let i="u">typeof t.senderPublicKey?(0,N.mL)(t.senderPublicKey,il):void 0,n="u">typeof t.iv?(0,N.mL)(t.iv,il):(0,E.randomBytes)(12);return function(t){if(ib(t.type)===ip){if(typeof t.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");return(0,N.BB)((0,N.zo)([t.type,t.senderPublicKey,t.iv,t.sealed]),ic)}return(0,N.BB)((0,N.zo)([t.type,t.iv,t.sealed]),ic)}({type:r,sealed:new w.OK((0,N.mL)(t.symKey,il)).seal(n,(0,N.mL)(t.message,id)),iv:n,senderPublicKey:i})}function iM(t){let e=new w.OK((0,N.mL)(t.symKey,il)),{sealed:r,iv:i}=iE(t.encoded),n=e.open(i,r);if(null===n)throw Error("Failed to decrypt");return(0,N.BB)(n,id)}function iE(t){let e=(0,N.mL)(t,ic),r=e.slice(0,1);if(ib(r)===ip){let t=e.slice(1,33),i=e.slice(33,45);return{type:r,sealed:e.slice(45),iv:i,senderPublicKey:t}}let i=e.slice(1,13);return{type:r,sealed:e.slice(13),iv:i}}function iS(t,e){let r=iE(t);return iI({type:ib(r.type),senderPublicKey:"u">typeof r.senderPublicKey?(0,N.BB)(r.senderPublicKey,il):void 0,receiverPublicKey:e?.receiverPublicKey})}function iI(t){let e=t?.type||0;if(e===ip){if(typeof t?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof t?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:e,senderPublicKey:t?.senderPublicKey,receiverPublicKey:t?.receiverPublicKey}}function iN(t){return t.type===ip&&"string"==typeof t.senderPublicKey&&"string"==typeof t.receiverPublicKey}function iB(t){return t?.relay||{protocol:"irn"}}function iC(t){let e=B.iO[t];if(typeof e>"u")throw Error(`Relay Protocol not supported: ${t}`);return e}var i_=Object.defineProperty,ix=Object.defineProperties,iO=Object.getOwnPropertyDescriptors,iR=Object.getOwnPropertySymbols,ik=Object.prototype.hasOwnProperty,iP=Object.prototype.propertyIsEnumerable,iU=(t,e,r)=>e in t?i_(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,iT=(t,e)=>{for(var r in e||(e={}))ik.call(e,r)&&iU(t,r,e[r]);if(iR)for(var r of iR(e))iP.call(e,r)&&iU(t,r,e[r]);return t},iD=(t,e)=>ix(t,iO(e));function iF(t){var e;let r=(t=(t=t.includes("wc://")?t.replace("wc://",""):t).includes("wc:")?t.replace("wc:",""):t).indexOf(":"),i=-1!==t.indexOf("?")?t.indexOf("?"):void 0,n=t.substring(0,r),o=t.substring(r+1,i).split("@"),s="u">typeof i?t.substring(i):"",u=b.parse(s),f="string"==typeof u.methods?u.methods.split(","):void 0;return{protocol:n,topic:(e=o[0]).startsWith("//")?e.substring(2):e,version:parseInt(o[1],10),symKey:u.symKey,relay:function(t,e="-"){let r={},i="relay"+e;return Object.keys(t).forEach(e=>{if(e.startsWith(i)){let n=e.replace(i,""),o=t[e];r[n]=o}}),r}(u),methods:f,expiryTimestamp:u.expiryTimestamp?parseInt(u.expiryTimestamp,10):void 0}}function iL(t){return`${t.protocol}:${t.topic}@${t.version}?`+b.stringify(iT(iD(iT({symKey:t.symKey},function(t,e="-"){let r={};return Object.keys(t).forEach(i=>{t[i]&&(r["relay"+e+i]=t[i])}),r}(t.relay)),{expiryTimestamp:t.expiryTimestamp}),t.methods?{methods:t.methods.join(",")}:{}))}function iq(t){let e=[];return t.forEach(t=>{let[r,i]=t.split(":");e.push(`${r}:${i}`)}),e}function iz(t){return t.includes(":")}function ij(t){return iz(t)?t.split(":")[0]:t}function iH(t,e){let r=function(t){let e={};return t?.forEach(t=>{let[r,i]=t.split(":");e[r]||(e[r]={accounts:[],chains:[],events:[]}),e[r].accounts.push(t),e[r].chains.push(`${r}:${i}`)}),e}(e=e.map(t=>t.replace("did:pkh:","")));for(let[e,i]of Object.entries(r))i.methods?i.methods=to(i.methods,t):i.methods=t,i.events=["chainChanged","accountsChanged"];return r}Object.prototype.hasOwnProperty,Object.prototype.propertyIsEnumerable;let iK={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},iQ={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function iJ(t,e){let{message:r,code:i}=iQ[t];return{message:e?`${r} ${e}`:r,code:i}}function iG(t,e){let{message:r,code:i}=iK[t];return{message:e?`${r} ${e}`:r,code:i}}function iY(t,e){return!!Array.isArray(t)&&(!("u">typeof e)||!t.length||t.every(e))}function iV(t){return Object.getPrototypeOf(t)===Object.prototype&&Object.keys(t).length}function iW(t){return typeof t>"u"}function iX(t,e){return!!(e&&iW(t))||"string"==typeof t&&!!t.trim().length}function iZ(t,e){return!!(e&&iW(t))||"number"==typeof t&&!isNaN(t)}function i$(t,e){let{requiredNamespaces:r}=e,i=Object.keys(t.namespaces),n=Object.keys(r),o=!0;return!!G(n,i)&&(i.forEach(e=>{let{accounts:i,methods:n,events:s}=t.namespaces[e],u=iq(i),f=r[e];G(R(e,f),u)&&G(f.methods,n)&&G(f.events,s)||(o=!1)}),o)}function i0(t){return!!(iX(t,!1)&&t.includes(":"))&&2===t.split(":").length}function i1(t){if(iX(t,!1))try{return"u">typeof new URL(t)}catch{}return!1}function i2(t){var e;return null==(e=t?.proposer)?void 0:e.publicKey}function i3(t){return t?.topic}function i6(t,e){let r=null;return iX(t?.publicKey,!1)||(r=iJ("MISSING_OR_INVALID",`${e} controller public key should be a string`)),r}function i8(t){let e=!0;return iY(t)?t.length&&(e=t.every(t=>iX(t,!1))):e=!1,e}function i4(t,e){let r=null;return Object.values(t).forEach(t=>{var i;let n;if(r)return;let o=(i=`${e}, namespace`,n=null,i8(t?.methods)?i8(t?.events)||(n=iG("UNSUPPORTED_EVENTS",`${i}, events should be an array of strings or empty array for no events`)):n=iG("UNSUPPORTED_METHODS",`${i}, methods should be an array of strings or empty array for no methods`),n);o&&(r=o)}),r}function i5(t,e,r){let i=null;if(t&&iV(t)){let n;let o=i4(t,e);o&&(i=o);let s=(n=null,Object.entries(t).forEach(([t,i])=>{var o,s;let u;if(n)return;let f=(o=R(t,i),s=`${e} ${r}`,u=null,iY(o)&&o.length?o.forEach(t=>{u||i0(t)||(u=iG("UNSUPPORTED_CHAINS",`${s}, chain ${t} should be a string and conform to "namespace:chainId" format`))}):i0(t)||(u=iG("UNSUPPORTED_CHAINS",`${s}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),u);f&&(n=f)}),n);s&&(i=s)}else i=iJ("MISSING_OR_INVALID",`${e}, ${r} should be an object with data`);return i}function i7(t,e){let r=null;if(t&&iV(t)){let i;let n=i4(t,e);n&&(r=n);let o=(i=null,Object.values(t).forEach(t=>{var r,n;let o;if(i)return;let s=(r=t?.accounts,n=`${e} namespace`,o=null,iY(r)?r.forEach(t=>{o||function(t){if(iX(t,!1)&&t.includes(":")){let e=t.split(":");if(3===e.length){let t=e[0]+":"+e[1];return!!e[2]&&i0(t)}}return!1}(t)||(o=iG("UNSUPPORTED_ACCOUNTS",`${n}, account ${t} should be a string and conform to "namespace:chainId:address" format`))}):o=iG("UNSUPPORTED_ACCOUNTS",`${n}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),o);s&&(i=s)}),i);o&&(r=o)}else r=iJ("MISSING_OR_INVALID",`${e}, namespaces should be an object with data`);return r}function i9(t){return iX(t.protocol,!0)}function nt(t,e){let r=!1;return e&&!t?r=!0:t&&iY(t)&&t.length&&t.forEach(t=>{r=i9(t)}),r}function ne(t){return"number"==typeof t}function nr(t){return"u">typeof t}function ni(t){return!(!t||"object"!=typeof t||!t.code||!iZ(t.code,!1)||!t.message||!iX(t.message,!1))}function nn(t){return!(iW(t)||!iX(t.method,!1))}function no(t){return!(iW(t)||iW(t.result)&&iW(t.error)||!iZ(t.id,!1)||!iX(t.jsonrpc,!1))}function ns(t){return!(iW(t)||!iX(t.name,!1))}function nu(t,e){return!(!i0(e)||!(function(t){let e=[];return Object.values(t).forEach(t=>{e.push(...iq(t.accounts))}),e})(t).includes(e))}function nf(t,e,r){return!!iX(r,!1)&&(function(t,e){let r=[];return Object.values(t).forEach(t=>{iq(t.accounts).includes(e)&&r.push(...t.methods)}),r})(t,e).includes(r)}function nh(t,e,r){return!!iX(r,!1)&&(function(t,e){let r=[];return Object.values(t).forEach(t=>{iq(t.accounts).includes(e)&&r.push(...t.events)}),r})(t,e).includes(r)}function na(t,e,r){let i=null,n=function(t){let e={};return Object.keys(t).forEach(r=>{var i;r.includes(":")?e[r]=t[r]:null==(i=t[r].chains)||i.forEach(i=>{e[i]={methods:t[r].methods,events:t[r].events}})}),e}(t),o=function(t){let e={};return Object.keys(t).forEach(r=>{if(r.includes(":"))e[r]=t[r];else{let i=iq(t[r].accounts);i?.forEach(i=>{e[i]={accounts:t[r].accounts.filter(t=>t.includes(`${i}:`)),methods:t[r].methods,events:t[r].events}})}}),e}(e),s=Object.keys(n),u=Object.keys(o),f=nl(Object.keys(t)),h=nl(Object.keys(e)),a=f.filter(t=>!h.includes(t));return a.length&&(i=iJ("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. Required: ${a.toString()} Received: ${Object.keys(e).toString()}`)),G(s,u)||(i=iJ("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. Required: ${s.toString()} Approved: ${u.toString()}`)),Object.keys(e).forEach(t=>{if(!t.includes(":")||i)return;let n=iq(e[t].accounts);n.includes(t)||(i=iJ("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${t} Required: ${t} Approved: ${n.toString()}`))}),s.forEach(t=>{i||(G(n[t].methods,o[t].methods)?G(n[t].events,o[t].events)||(i=iJ("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${t}`)):i=iJ("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${t}`))}),i}function nl(t){return[...new Set(t.map(t=>t.includes(":")?t.split(":")[0]:t))]}function nc(t,e){return iZ(t,!1)&&t<=e.max&&t>=e.min}function nd(){let t=H();return new Promise(e=>{switch(t){case L.browser:e(j()&&navigator?.onLine);break;case L.reactNative:e(np());break;case L.node:default:e(!0)}})}async function np(){if(z()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo){let t=await (null==r.g?void 0:r.g.NetInfo.fetch());return t?.isConnected}return!0}function nm(t){switch(H()){case L.browser:!z()&&j()&&(window.addEventListener("online",()=>t(!0)),window.addEventListener("offline",()=>t(!1)));break;case L.reactNative:z()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener(e=>t(e?.isConnected));case L.node:}}let ng={};class nv{static get(t){return ng[t]}static set(t,e){ng[t]=e}static delete(t){delete ng[t]}}}}]); ================================================ FILE: client/out/_next/static/chunks/5e22fd23-a888f1085fc13e55.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[452],{69824:function(t,c,n){n.d(c,{Vmf:function(){return a}});var u=n(91810);function a(t){return(0,u.w_)({tag:"svg",attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 217.9L383 345c9.4 9.4 24.6 9.4 33.9 0 9.4-9.4 9.3-24.6 0-34L273 167c-9.1-9.1-23.7-9.3-33.1-.7L95 310.9c-4.7 4.7-7 10.9-7 17s2.3 12.3 7 17c9.4 9.4 24.6 9.4 33.9 0l127.1-127z"},child:[]}]})(t)}}}]); ================================================ FILE: client/out/_next/static/chunks/795d4814-3c1aeb3c4a7db891.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[51],{16356:function(t,h,a){a.d(h,{Dk$:function(){return v},FH3:function(){return l}});var n=a(91810);function l(t){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0V0z"},child:[]},{tag:"path",attr:{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6v12zm2.46-7.12 1.41-1.41L12 12.59l2.12-2.12 1.41 1.41L13.41 14l2.12 2.12-1.41 1.41L12 15.41l-2.12 2.12-1.41-1.41L10.59 14l-2.13-2.12zM15.5 4l-1-1h-5l-1 1H5v2h14V4z"},child:[]}]})(t)}function v(t){return(0,n.w_)({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zM7 7h7v2H7V7zm3 8H7v-2h3v2zm-3-3v-2h7v2H7zm12 3h-2v2h-2v-2h-2v-2h2v-2h2v2h2v2z"},child:[]}]})(t)}}}]); ================================================ FILE: client/out/_next/static/chunks/866.ab29f905adb91a5f.js ================================================ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[866],{80866:function(e,t,r){let i;r.r(t),r.d(t,{WcmModal:function(){return ih},WcmQrCode:function(){return rw}});/** * @license * Copyright 2019 Google LLC * SPDX-License-Identifier: BSD-3-Clause */let o=window,l=o.ShadowRoot&&(void 0===o.ShadyCSS||o.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,a=Symbol(),n=new WeakMap;class s{constructor(e,t,r){if(this._$cssResult$=!0,r!==a)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(l&&void 0===e){let r=void 0!==t&&1===t.length;r&&(e=n.get(t)),void 0===e&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),r&&n.set(t,e))}return e}toString(){return this.cssText}}let c=e=>new s("string"==typeof e?e:e+"",void 0,a),d=(e,...t)=>new s(1===e.length?e[0]:t.reduce((t,r,i)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if("number"==typeof e)return e;throw Error("Value passed to 'css' function must be a 'css' function result: "+e+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(r)+e[i+1],e[0]),e,a),h=(e,t)=>{l?e.adoptedStyleSheets=t.map(e=>e instanceof CSSStyleSheet?e:e.styleSheet):t.forEach(t=>{let r=document.createElement("style"),i=o.litNonce;void 0!==i&&r.setAttribute("nonce",i),r.textContent=t.cssText,e.appendChild(r)})},m=l?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t="";for(let r of e.cssRules)t+=r.cssText;return c(t)})(e):e,p=window,u=p.trustedTypes,w=u?u.emptyScript:"",g=p.reactiveElementPolyfillSupport,v={toAttribute(e,t){switch(t){case Boolean:e=e?w:null;break;case Object:case Array:e=null==e?e:JSON.stringify(e)}return e},fromAttribute(e,t){let r=e;switch(t){case Boolean:r=null!==e;break;case Number:r=null===e?null:Number(e);break;case Object:case Array:try{r=JSON.parse(e)}catch(e){r=null}}return r}},f=(e,t)=>t!==e&&(t==t||e==e),b={attribute:!0,type:String,converter:v,reflect:!1,hasChanged:f},y="finalized";class x extends HTMLElement{constructor(){super(),this._$Ei=new Map,this.isUpdatePending=!1,this.hasUpdated=!1,this._$El=null,this._$Eu()}static addInitializer(e){var t;this.finalize(),(null!==(t=this.h)&&void 0!==t?t:this.h=[]).push(e)}static get observedAttributes(){this.finalize();let e=[];return this.elementProperties.forEach((t,r)=>{let i=this._$Ep(r,t);void 0!==i&&(this._$Ev.set(i,r),e.push(i))}),e}static createProperty(e,t=b){if(t.state&&(t.attribute=!1),this.finalize(),this.elementProperties.set(e,t),!t.noAccessor&&!this.prototype.hasOwnProperty(e)){let r="symbol"==typeof e?Symbol():"__"+e,i=this.getPropertyDescriptor(e,r,t);void 0!==i&&Object.defineProperty(this.prototype,e,i)}}static getPropertyDescriptor(e,t,r){return{get(){return this[t]},set(i){let o=this[e];this[t]=i,this.requestUpdate(e,o,r)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)||b}static finalize(){if(this.hasOwnProperty(y))return!1;this[y]=!0;let e=Object.getPrototypeOf(this);if(e.finalize(),void 0!==e.h&&(this.h=[...e.h]),this.elementProperties=new Map(e.elementProperties),this._$Ev=new Map,this.hasOwnProperty("properties")){let e=this.properties;for(let t of[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)])this.createProperty(t,e[t])}return this.elementStyles=this.finalizeStyles(this.styles),!0}static finalizeStyles(e){let t=[];if(Array.isArray(e))for(let r of new Set(e.flat(1/0).reverse()))t.unshift(m(r));else void 0!==e&&t.push(m(e));return t}static _$Ep(e,t){let r=t.attribute;return!1===r?void 0:"string"==typeof r?r:"string"==typeof e?e.toLowerCase():void 0}_$Eu(){var e;this._$E_=new Promise(e=>this.enableUpdating=e),this._$AL=new Map,this._$Eg(),this.requestUpdate(),null===(e=this.constructor.h)||void 0===e||e.forEach(e=>e(this))}addController(e){var t,r;(null!==(t=this._$ES)&&void 0!==t?t:this._$ES=[]).push(e),void 0!==this.renderRoot&&this.isConnected&&(null===(r=e.hostConnected)||void 0===r||r.call(e))}removeController(e){var t;null===(t=this._$ES)||void 0===t||t.splice(this._$ES.indexOf(e)>>>0,1)}_$Eg(){this.constructor.elementProperties.forEach((e,t)=>{this.hasOwnProperty(t)&&(this._$Ei.set(t,this[t]),delete this[t])})}createRenderRoot(){var e;let t=null!==(e=this.shadowRoot)&&void 0!==e?e:this.attachShadow(this.constructor.shadowRootOptions);return h(t,this.constructor.elementStyles),t}connectedCallback(){var e;void 0===this.renderRoot&&(this.renderRoot=this.createRenderRoot()),this.enableUpdating(!0),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostConnected)||void 0===t?void 0:t.call(e)})}enableUpdating(e){}disconnectedCallback(){var e;null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostDisconnected)||void 0===t?void 0:t.call(e)})}attributeChangedCallback(e,t,r){this._$AK(e,r)}_$EO(e,t,r=b){var i;let o=this.constructor._$Ep(e,r);if(void 0!==o&&!0===r.reflect){let l=(void 0!==(null===(i=r.converter)||void 0===i?void 0:i.toAttribute)?r.converter:v).toAttribute(t,r.type);this._$El=e,null==l?this.removeAttribute(o):this.setAttribute(o,l),this._$El=null}}_$AK(e,t){var r;let i=this.constructor,o=i._$Ev.get(e);if(void 0!==o&&this._$El!==o){let e=i.getPropertyOptions(o),l="function"==typeof e.converter?{fromAttribute:e.converter}:void 0!==(null===(r=e.converter)||void 0===r?void 0:r.fromAttribute)?e.converter:v;this._$El=o,this[o]=l.fromAttribute(t,e.type),this._$El=null}}requestUpdate(e,t,r){let i=!0;void 0!==e&&(((r=r||this.constructor.getPropertyOptions(e)).hasChanged||f)(this[e],t)?(this._$AL.has(e)||this._$AL.set(e,t),!0===r.reflect&&this._$El!==e&&(void 0===this._$EC&&(this._$EC=new Map),this._$EC.set(e,r))):i=!1),!this.isUpdatePending&&i&&(this._$E_=this._$Ej())}async _$Ej(){this.isUpdatePending=!0;try{await this._$E_}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return null!=e&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){var e;if(!this.isUpdatePending)return;this.hasUpdated,this._$Ei&&(this._$Ei.forEach((e,t)=>this[t]=e),this._$Ei=void 0);let t=!1,r=this._$AL;try{(t=this.shouldUpdate(r))?(this.willUpdate(r),null===(e=this._$ES)||void 0===e||e.forEach(e=>{var t;return null===(t=e.hostUpdate)||void 0===t?void 0:t.call(e)}),this.update(r)):this._$Ek()}catch(e){throw t=!1,this._$Ek(),e}t&&this._$AE(r)}willUpdate(e){}_$AE(e){var t;null===(t=this._$ES)||void 0===t||t.forEach(e=>{var t;return null===(t=e.hostUpdated)||void 0===t?void 0:t.call(e)}),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$Ek(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$E_}shouldUpdate(e){return!0}update(e){void 0!==this._$EC&&(this._$EC.forEach((e,t)=>this._$EO(t,this[t],e)),this._$EC=void 0),this._$Ek()}updated(e){}firstUpdated(e){}}x[y]=!0,x.elementProperties=new Map,x.elementStyles=[],x.shadowRootOptions={mode:"open"},null==g||g({ReactiveElement:x}),(null!==(ef=p.reactiveElementVersions)&&void 0!==ef?ef:p.reactiveElementVersions=[]).push("1.6.3");let $=window,C=$.trustedTypes,A=C?C.createPolicy("lit-html",{createHTML:e=>e}):void 0,_="$lit$",O=`lit$${(Math.random()+"").slice(9)}$`,E="?"+O,k=`<${E}>`,I=document,T=()=>I.createComment(""),P=e=>null===e||"object"!=typeof e&&"function"!=typeof e,M=Array.isArray,S=e=>M(e)||"function"==typeof(null==e?void 0:e[Symbol.iterator]),R="[ \n\f\r]",L=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,W=/-->/g,j=/>/g,D=RegExp(`>|${R}(?:([^\\s"'>=/]+)(${R}*=${R}*(?:[^ \f\r"'\`<>=]|("|')|))|$)`,"g"),N=/'/g,U=/"/g,z=/^(?:script|style|textarea|title)$/i,H=e=>(t,...r)=>({_$litType$:e,strings:t,values:r}),Z=H(1),B=H(2),V=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),F=new WeakMap,K=I.createTreeWalker(I,129,null,!1);function Q(e,t){if(!Array.isArray(e)||!e.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==A?A.createHTML(t):t}let Y=(e,t)=>{let r=e.length-1,i=[],o,l=2===t?"":"",a=L;for(let t=0;t"===s[0]?(a=null!=o?o:L,c=-1):void 0===s[1]?c=-2:(c=a.lastIndex-s[2].length,n=s[1],a=void 0===s[3]?D:'"'===s[3]?U:N):a===U||a===N?a=D:a===W||a===j?a=L:(a=D,o=void 0);let h=a===D&&e[t+1].startsWith("/>")?" ":"";l+=a===L?r+k:c>=0?(i.push(n),r.slice(0,c)+_+r.slice(c)+O+h):r+O+(-2===c?(i.push(void 0),t):h)}return[Q(e,l+(e[r]||"")+(2===t?"":"")),i]};class G{constructor({strings:e,_$litType$:t},r){let i;this.parts=[];let o=0,l=0,a=e.length-1,n=this.parts,[s,c]=Y(e,t);if(this.el=G.createElement(s,r),K.currentNode=this.el.content,2===t){let e=this.el.content,t=e.firstChild;t.remove(),e.append(...t.childNodes)}for(;null!==(i=K.nextNode())&&n.length0){i.textContent=C?C.emptyScript:"";for(let r=0;r2||""!==r[0]||""!==r[1]?(this._$AH=Array(r.length-1).fill(new String),this.strings=r):this._$AH=q}get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}_$AI(e,t=this,r,i){let o=this.strings,l=!1;if(void 0===o)(l=!P(e=X(this,e,t,0))||e!==this._$AH&&e!==V)&&(this._$AH=e);else{let i,a;let n=e;for(e=o[0],i=0;i{var i,o;let l=null!==(i=null==r?void 0:r.renderBefore)&&void 0!==i?i:t,a=l._$litPart$;if(void 0===a){let e=null!==(o=null==r?void 0:r.renderBefore)&&void 0!==o?o:null;l._$litPart$=a=new ee(t.insertBefore(T(),e),e,void 0,null!=r?r:{})}return a._$AI(e),a};class ec extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){var e,t;let r=super.createRenderRoot();return null!==(e=(t=this.renderOptions).renderBefore)&&void 0!==e||(t.renderBefore=r.firstChild),r}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=es(t,this.renderRoot,this.renderOptions)}connectedCallback(){var e;super.connectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!0)}disconnectedCallback(){var e;super.disconnectedCallback(),null===(e=this._$Do)||void 0===e||e.setConnected(!1)}render(){return V}}ec.finalized=!0,ec._$litElement$=!0,null===(ey=globalThis.litElementHydrateSupport)||void 0===ey||ey.call(globalThis,{LitElement:ec});let ed=globalThis.litElementPolyfillSupport;null==ed||ed({LitElement:ec}),(null!==(ex=globalThis.litElementVersions)&&void 0!==ex?ex:globalThis.litElementVersions=[]).push("3.3.3");/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */let eh=e=>t=>"function"==typeof t?(customElements.define(e,t),t):((e,t)=>{let{kind:r,elements:i}=t;return{kind:r,elements:i,finisher(t){customElements.define(e,t)}}})(e,t),em=(e,t)=>"method"!==t.kind||!t.descriptor||"value"in t.descriptor?{kind:"field",key:Symbol(),placement:"own",descriptor:{},originalKey:t.key,initializer(){"function"==typeof t.initializer&&(this[t.key]=t.initializer.call(this))},finisher(r){r.createProperty(t.key,e)}}:{...t,finisher(r){r.createProperty(t.key,e)}},ep=(e,t,r)=>{t.constructor.createProperty(r,e)};function eu(e){return(t,r)=>void 0!==r?ep(e,t,r):em(e,t)}/** * @license * Copyright 2017 Google LLC * SPDX-License-Identifier: BSD-3-Clause */function ew(e){return eu({...e,state:!0})}null!=(null===(e$=window.HTMLSlotElement)||void 0===e$?void 0:e$.prototype.assignedElements)||((e,t)=>e.assignedNodes(t).filter(e=>e.nodeType===Node.ELEMENT_NODE));class eg{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,r){this._$Ct=e,this._$AM=t,this._$Ci=r}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}}/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */let ev=(i=class extends eg{constructor(e){var t;if(super(e),1!==e.type||"class"!==e.name||(null===(t=e.strings)||void 0===t?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(e){return" "+Object.keys(e).filter(t=>e[t]).join(" ")+" "}update(e,[t]){var r,i;if(void 0===this.it){for(let i in this.it=new Set,void 0!==e.strings&&(this.nt=new Set(e.strings.join(" ").split(/\s/).filter(e=>""!==e))),t)!t[i]||(null===(r=this.nt)||void 0===r?void 0:r.has(i))||this.it.add(i);return this.render(t)}let o=e.element.classList;for(let e in this.it.forEach(e=>{e in t||(o.remove(e),this.it.delete(e))}),t){let r=!!t[e];r===this.it.has(e)||(null===(i=this.nt)||void 0===i?void 0:i.has(e))||(r?(o.add(e),this.it.add(e)):(o.remove(e),this.it.delete(e)))}return V}},(...e)=>({_$litDirective$:i,values:e}));var ef,eb,ey,ex,e$,eC=r(11481);let eA={duration:.3,delay:0,endDelay:0,repeat:0,easing:"ease"},e_={ms:e=>1e3*e,s:e=>e/1e3},eO=()=>{},eE=e=>e;function ek(e,t=!0){if(e&&"finished"!==e.playState)try{e.stop?e.stop():(t&&e.commitStyles(),e.cancel())}catch(e){}}let eI=e=>e(),eT=(e,t,r=eA.duration)=>new Proxy({animations:e.map(eI).filter(Boolean),duration:r,options:t},eM),eP=e=>e.animations[0],eM={get:(e,t)=>{let r=eP(e);switch(t){case"duration":return e.duration;case"currentTime":return e_.s((null==r?void 0:r[t])||0);case"playbackRate":case"playState":return null==r?void 0:r[t];case"finished":return e.finished||(e.finished=Promise.all(e.animations.map(eS)).catch(eO)),e.finished;case"stop":return()=>{e.animations.forEach(e=>ek(e))};case"forEachNative":return t=>{e.animations.forEach(r=>t(r,e))};default:return void 0===(null==r?void 0:r[t])?void 0:()=>e.animations.forEach(e=>e[t]())}},set:(e,t,r)=>{switch(t){case"currentTime":r=e_.ms(r);case"playbackRate":for(let i=0;ie.finished,eR=e=>"object"==typeof e&&!!e.createAnimation,eL=e=>"number"==typeof e,eW=e=>Array.isArray(e)&&!eL(e[0]),ej=(e,t,r)=>-r*e+r*t+e,eD=(e,t,r)=>t-e==0?1:(r-e)/(t-e);function eN(e,t){let r=e[e.length-1];for(let i=1;i<=t;i++){let o=eD(0,t,i);e.push(ej(r,1,o))}}let eU=(e,t,r)=>{let i=t-e;return((r-e)%i+i)%i+e},ez=(e,t,r)=>Math.min(Math.max(r,e),t),eH=(e,t,r)=>(((1-3*r+3*t)*e+(3*r-6*t))*e+3*t)*e;function eZ(e,t,r,i){if(e===t&&r===i)return eE;let o=t=>(function(e,t,r,i,o){let l,a;let n=0;do(l=eH(a=t+(r-t)/2,i,o)-e)>0?r=a:t=a;while(Math.abs(l)>1e-7&&++n<12);return a})(t,0,1,e,r);return e=>0===e||1===e?e:eH(o(e),t,i)}let eB=(e,t="end")=>r=>{let i=(r="end"===t?Math.min(r,.999):Math.max(r,.001))*e;return ez(0,1,("end"===t?Math.floor(i):Math.ceil(i))/e)},eV=e=>"function"==typeof e,eq=e=>Array.isArray(e)&&eL(e[0]),eF={ease:eZ(.25,.1,.25,1),"ease-in":eZ(.42,0,1,1),"ease-in-out":eZ(.42,0,.58,1),"ease-out":eZ(0,0,.58,1)},eK=/\((.*?)\)/;function eQ(e){if(eV(e))return e;if(eq(e))return eZ(...e);let t=eF[e];if(t)return t;if(e.startsWith("steps")){let t=eK.exec(e);if(t){let e=t[1].split(",");return eB(parseFloat(e[0]),e[1].trim())}}return eE}class eY{constructor(e,t=[0,1],{easing:r,duration:i=eA.duration,delay:o=eA.delay,endDelay:l=eA.endDelay,repeat:a=eA.repeat,offset:n,direction:s="normal",autoplay:c=!0}={}){if(this.startTime=null,this.rate=1,this.t=0,this.cancelTimestamp=null,this.easing=eE,this.duration=0,this.totalDuration=0,this.repeat=0,this.playState="idle",this.finished=new Promise((e,t)=>{this.resolve=e,this.reject=t}),eR(r=r||eA.easing)){let e=r.createAnimation(t);r=e.easing,t=e.keyframes||t,i=e.duration||i}this.repeat=a,this.easing=eW(r)?eE:eQ(r),this.updateDuration(i);let d=function(e,t=function(e){let t=[0];return eN(t,e-1),t}(e.length),r=eE){let i=e.length,o=i-t.length;return o>0&&eN(t,o),o=>{var l;let a=0;for(;a{var r;let i=0;i=void 0!==this.pauseTime?this.pauseTime:(t-this.startTime)*this.rate,this.t=i,i/=1e3,i=Math.max(i-o,0),"finished"===this.playState&&void 0===this.pauseTime&&(i=this.totalDuration);let a=i/this.duration,n=Math.floor(a),c=a%1;!c&&a>=1&&(c=1),1===c&&n--;let h=n%2;("reverse"===s||"alternate"===s&&h||"alternate-reverse"===s&&!h)&&(c=1-c);let m=i>=this.totalDuration?1:Math.min(c,1),p=d(this.easing(m));e(p),void 0===this.pauseTime&&("finished"===this.playState||i>=this.totalDuration+l)?(this.playState="finished",null===(r=this.resolve)||void 0===r||r.call(this,p)):"idle"!==this.playState&&(this.frameRequestId=requestAnimationFrame(this.tick))},c&&this.play()}play(){let e=performance.now();this.playState="running",void 0!==this.pauseTime?this.startTime=e-this.pauseTime:this.startTime||(this.startTime=e),this.cancelTimestamp=this.startTime,this.pauseTime=void 0,this.frameRequestId=requestAnimationFrame(this.tick)}pause(){this.playState="paused",this.pauseTime=this.t}finish(){this.playState="finished",this.tick(0)}stop(){var e;this.playState="idle",void 0!==this.frameRequestId&&cancelAnimationFrame(this.frameRequestId),null===(e=this.reject)||void 0===e||e.call(this,!1)}cancel(){this.stop(),this.tick(this.cancelTimestamp)}reverse(){this.rate*=-1}commitStyles(){}updateDuration(e){this.duration=e,this.totalDuration=e*(this.repeat+1)}get currentTime(){return this.t}set currentTime(e){void 0!==this.pauseTime||0===this.rate?this.pauseTime=e:this.startTime=performance.now()-e/this.rate}get playbackRate(){return this.rate}set playbackRate(e){this.rate=e}}var eG=function(){};class eX{setAnimation(e){this.animation=e,null==e||e.finished.then(()=>this.clearAnimation()).catch(()=>{})}clearAnimation(){this.animation=this.generator=void 0}}let eJ=new WeakMap;function e0(e){return eJ.has(e)||eJ.set(e,{transforms:[],values:new Map}),eJ.get(e)}let e1=["","X","Y","Z"],e2={x:"translateX",y:"translateY",z:"translateZ"},e5={syntax:"",initialValue:"0deg",toDefaultUnit:e=>e+"deg"},e3={translate:{syntax:"",initialValue:"0px",toDefaultUnit:e=>e+"px"},rotate:e5,scale:{syntax:"",initialValue:1,toDefaultUnit:eE},skew:e5},e4=new Map,e7=e=>`--motion-${e}`,e6=["x","y","z"];["translate","scale","rotate","skew"].forEach(e=>{e1.forEach(t=>{e6.push(e+t),e4.set(e7(e+t),e3[e])})});let e8=(e,t)=>e6.indexOf(e)-e6.indexOf(t),e9=new Set(e6),te=e=>e9.has(e),tt=(e,t)=>{var r;e2[t]&&(t=e2[t]);let{transforms:i}=e0(e);r=t,-1===i.indexOf(r)&&i.push(r),e.style.transform=tr(i)},tr=e=>e.sort(e8).reduce(ti,"").trim(),ti=(e,t)=>`${e} ${t}(var(${e7(t)}))`,to=e=>e.startsWith("--"),tl=new Set,ta=(e,t)=>document.createElement("div").animate(e,t),tn={cssRegisterProperty:()=>"undefined"!=typeof CSS&&Object.hasOwnProperty.call(CSS,"registerProperty"),waapi:()=>Object.hasOwnProperty.call(Element.prototype,"animate"),partialKeyframes:()=>{try{ta({opacity:[1]})}catch(e){return!1}return!0},finished:()=>!!ta({opacity:[0,1]},{duration:.001}).finished,linearEasing:()=>{try{ta({opacity:0},{easing:"linear(0, 1)"})}catch(e){return!1}return!0}},ts={},tc={};for(let e in tn)tc[e]=()=>(void 0===ts[e]&&(ts[e]=tn[e]()),ts[e]);let td=(e,t)=>{let r="",i=Math.round(t/.015);for(let t=0;teV(e)?tc.linearEasing()?`linear(${td(e,t)})`:eA.easing:eq(e)?tm(e):e,tm=([e,t,r,i])=>`cubic-bezier(${e}, ${t}, ${r}, ${i})`,tp=e=>Array.isArray(e)?e:[e];function tu(e){return e2[e]&&(e=e2[e]),te(e)?e7(e):e}let tw={get:(e,t)=>{let r=to(t=tu(t))?e.style.getPropertyValue(t):getComputedStyle(e)[t];if(!r&&0!==r){let e=e4.get(t);e&&(r=e.initialValue)}return r},set:(e,t,r)=>{to(t=tu(t))?e.style.setProperty(t,r):e.style[t]=r}},tg=e=>"string"==typeof e,tv=(e,t)=>e[t]?Object.assign(Object.assign({},e),e[t]):Object.assign({},e),tf=function(e,t,r={}){var i,o,l;"string"==typeof(i=e)?i=document.querySelectorAll(i):i instanceof Element&&(i=[i]);let a=(e=Array.from(i||[])).length;eG(!!a,"No valid element provided."),eG(!!t,"No keyframes defined.");let n=[];for(let i=0;i{let l=()=>{var t,r;return null!==(r=null!==(t=tw.get(e,$))&&void 0!==t?t:null==A?void 0:A.initialValue)&&void 0!==r?r:0},b=function(e,t){for(let r=0;rt+e)}return i}(b,A);if(eR(p)){let e=p.createAnimation(b,"opacity"!==t,l,$,C);p=e.easing,b=e.keyframes||b,c=e.duration||c}if(to($)&&(tc.cssRegisterProperty()?function(e){if(!tl.has(e)){tl.add(e);try{let{syntax:t,initialValue:r}=e4.has(e)?e4.get(e):{};CSS.registerProperty({name:e,inherits:!1,syntax:t,initialValue:r})}catch(e){}}}($):x=!1),y&&!tc.linearEasing()&&(eV(p)||eW(p)&&p.some(eV))&&(x=!1),x){A&&(b=b.map(e=>eL(e)?A.toDefaultUnit(e):e)),1===b.length&&(!tc.partialKeyframes()||s)&&b.unshift(l());let t={delay:e_.ms(d),duration:e_.ms(c),endDelay:e_.ms(h),easing:eW(p)?void 0:th(p,c),direction:w,iterations:m+1,fill:"both"};(a=e.animate({[$]:b,offset:g,easing:eW(p)?p.map(e=>th(e,c)):void 0},t)).finished||(a.finished=new Promise((e,t)=>{a.onfinish=e,a.oncancel=t}));let r=b[b.length-1];a.finished.then(()=>{u||(tw.set(e,$,r),a.cancel())}).catch(eO),v||(a.playbackRate=1.000001)}else if(o&&y)1===(b=b.map(e=>"string"==typeof e?parseFloat(e):e)).length&&b.unshift(parseFloat(l())),a=new o(t=>{tw.set(e,$,_?_(t):t)},b,Object.assign(Object.assign({},i),{duration:c,easing:p}));else{let t=b[b.length-1];tw.set(e,$,A&&eL(t)?A.toDefaultUnit(t):t)}return s&&n(e,t,b,{duration:c,delay:d,easing:p,repeat:m,offset:g},"motion-one"),C.setAnimation(a),a&&!f&&a.pause(),a}}(s,e,t[e],c,eY);n.push(d)}}return eT(n,r,r.duration)};function tb(e,t,r){return(eV(e)?function(e,t={}){return eT([()=>{let r=new eY(e,[0,1],t);return r.finished.catch(()=>{}),r}],t,t.duration)}:tf)(e,t,r)}/** * @license * Copyright 2018 Google LLC * SPDX-License-Identifier: BSD-3-Clause */let ty=e=>null!=e?e:q;var tx=r(19783),t$=Object.defineProperty,tC=Object.getOwnPropertySymbols,tA=Object.prototype.hasOwnProperty,t_=Object.prototype.propertyIsEnumerable,tO=(e,t,r)=>t in e?t$(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tE=(e,t)=>{for(var r in t||(t={}))tA.call(t,r)&&tO(e,r,t[r]);if(tC)for(var r of tC(t))t_.call(t,r)&&tO(e,r,t[r]);return e};function tk(){return{"--wcm-accent-color":"#3396FF","--wcm-accent-fill-color":"#FFFFFF","--wcm-z-index":"89","--wcm-background-color":"#3396FF","--wcm-background-border-radius":"8px","--wcm-container-border-radius":"30px","--wcm-wallet-icon-border-radius":"15px","--wcm-wallet-icon-large-border-radius":"30px","--wcm-wallet-icon-small-border-radius":"7px","--wcm-input-border-radius":"28px","--wcm-button-border-radius":"10px","--wcm-notification-border-radius":"36px","--wcm-secondary-button-border-radius":"28px","--wcm-icon-button-border-radius":"50%","--wcm-button-hover-highlight-border-radius":"10px","--wcm-text-big-bold-size":"20px","--wcm-text-big-bold-weight":"600","--wcm-text-big-bold-line-height":"24px","--wcm-text-big-bold-letter-spacing":"-0.03em","--wcm-text-big-bold-text-transform":"none","--wcm-text-xsmall-bold-size":"10px","--wcm-text-xsmall-bold-weight":"700","--wcm-text-xsmall-bold-line-height":"12px","--wcm-text-xsmall-bold-letter-spacing":"0.02em","--wcm-text-xsmall-bold-text-transform":"uppercase","--wcm-text-xsmall-regular-size":"12px","--wcm-text-xsmall-regular-weight":"600","--wcm-text-xsmall-regular-line-height":"14px","--wcm-text-xsmall-regular-letter-spacing":"-0.03em","--wcm-text-xsmall-regular-text-transform":"none","--wcm-text-small-thin-size":"14px","--wcm-text-small-thin-weight":"500","--wcm-text-small-thin-line-height":"16px","--wcm-text-small-thin-letter-spacing":"-0.03em","--wcm-text-small-thin-text-transform":"none","--wcm-text-small-regular-size":"14px","--wcm-text-small-regular-weight":"600","--wcm-text-small-regular-line-height":"16px","--wcm-text-small-regular-letter-spacing":"-0.03em","--wcm-text-small-regular-text-transform":"none","--wcm-text-medium-regular-size":"16px","--wcm-text-medium-regular-weight":"600","--wcm-text-medium-regular-line-height":"20px","--wcm-text-medium-regular-letter-spacing":"-0.03em","--wcm-text-medium-regular-text-transform":"none","--wcm-font-family":"-apple-system, system-ui, BlinkMacSystemFont, 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', sans-serif","--wcm-font-feature-settings":"'tnum' on, 'lnum' on, 'case' on","--wcm-success-color":"rgb(38,181,98)","--wcm-error-color":"rgb(242, 90, 103)","--wcm-overlay-background-color":"rgba(0, 0, 0, 0.3)","--wcm-overlay-backdrop-filter":"none"}}let tI={getPreset:e=>tk()[e],setTheme(){let e=document.querySelector(":root"),{themeVariables:t}=eC.ThemeCtrl.state;e&&Object.entries(tE(tE(tE({},function(){var e;let t={light:{foreground:{1:"rgb(20,20,20)",2:"rgb(121,134,134)",3:"rgb(158,169,169)"},background:{1:"rgb(255,255,255)",2:"rgb(241,243,243)",3:"rgb(228,231,231)"},overlay:"rgba(0,0,0,0.1)"},dark:{foreground:{1:"rgb(228,231,231)",2:"rgb(148,158,158)",3:"rgb(110,119,119)"},background:{1:"rgb(20,20,20)",2:"rgb(39,42,42)",3:"rgb(59,64,64)"},overlay:"rgba(255,255,255,0.1)"}}[null!=(e=eC.ThemeCtrl.state.themeMode)?e:"dark"];return{"--wcm-color-fg-1":t.foreground[1],"--wcm-color-fg-2":t.foreground[2],"--wcm-color-fg-3":t.foreground[3],"--wcm-color-bg-1":t.background[1],"--wcm-color-bg-2":t.background[2],"--wcm-color-bg-3":t.background[3],"--wcm-color-overlay":t.overlay}}()),tk()),t)).forEach(([t,r])=>e.style.setProperty(t,r))},globalCss:d`*,::after,::before{margin:0;padding:0;box-sizing:border-box;font-style:normal;text-rendering:optimizeSpeed;-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;-webkit-tap-highlight-color:transparent;backface-visibility:hidden}button{cursor:pointer;display:flex;justify-content:center;align-items:center;position:relative;border:none;background-color:transparent;transition:all .2s ease}@media (hover:hover) and (pointer:fine){button:active{transition:all .1s ease;transform:scale(.93)}}button::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;transition:background-color,.2s ease}button:disabled{cursor:not-allowed}button svg,button wcm-text{position:relative;z-index:1}input{border:none;outline:0;appearance:none}img{display:block}::selection{color:var(--wcm-accent-fill-color);background:var(--wcm-accent-color)}`},tT=d`button{border-radius:var(--wcm-secondary-button-border-radius);height:28px;padding:0 10px;background-color:var(--wcm-accent-color)}button path{fill:var(--wcm-accent-fill-color)}button::after{border-radius:inherit;border:1px solid var(--wcm-color-overlay)}button:disabled::after{background-color:transparent}.wcm-icon-left svg{margin-right:5px}.wcm-icon-right svg{margin-left:5px}button:active::after{background-color:var(--wcm-color-overlay)}.wcm-ghost,.wcm-ghost:active::after,.wcm-outline{background-color:transparent}.wcm-ghost:active{opacity:.5}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}.wcm-ghost:hover::after{background-color:transparent}.wcm-ghost:hover{opacity:.5}}button:disabled{background-color:var(--wcm-color-bg-3);pointer-events:none}.wcm-ghost::after{border-color:transparent}.wcm-ghost path{fill:var(--wcm-color-fg-2)}.wcm-outline path{fill:var(--wcm-accent-color)}.wcm-outline:disabled{background-color:transparent;opacity:.5}`;var tP=Object.defineProperty,tM=Object.getOwnPropertyDescriptor,tS=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?tM(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&tP(t,r,l),l};let tR=class extends ec{constructor(){super(...arguments),this.disabled=!1,this.iconLeft=void 0,this.iconRight=void 0,this.onClick=()=>null,this.variant="default"}render(){let e={"wcm-icon-left":void 0!==this.iconLeft,"wcm-icon-right":void 0!==this.iconRight,"wcm-ghost":"ghost"===this.variant,"wcm-outline":"outline"===this.variant},t="inverse";return"ghost"===this.variant&&(t="secondary"),"outline"===this.variant&&(t="accent"),Z``}};tR.styles=[tI.globalCss,tT],tS([eu({type:Boolean})],tR.prototype,"disabled",2),tS([eu()],tR.prototype,"iconLeft",2),tS([eu()],tR.prototype,"iconRight",2),tS([eu()],tR.prototype,"onClick",2),tS([eu()],tR.prototype,"variant",2),tR=tS([eh("wcm-button")],tR);let tL=d`:host{display:inline-block}button{padding:0 15px 1px;height:40px;border-radius:var(--wcm-button-border-radius);color:var(--wcm-accent-fill-color);background-color:var(--wcm-accent-color)}button::after{content:'';top:0;bottom:0;left:0;right:0;position:absolute;background-color:transparent;border-radius:inherit;transition:background-color .2s ease;border:1px solid var(--wcm-color-overlay)}button:active::after{background-color:var(--wcm-color-overlay)}button:disabled{padding-bottom:0;background-color:var(--wcm-color-bg-3);color:var(--wcm-color-fg-3)}.wcm-secondary{color:var(--wcm-accent-color);background-color:transparent}.wcm-secondary::after{display:none}@media(hover:hover){button:hover::after{background-color:var(--wcm-color-overlay)}}`;var tW=Object.defineProperty,tj=Object.getOwnPropertyDescriptor,tD=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?tj(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&tW(t,r,l),l};let tN=class extends ec{constructor(){super(...arguments),this.disabled=!1,this.variant="primary"}render(){let e={"wcm-secondary":"secondary"===this.variant};return Z``}};tN.styles=[tI.globalCss,tL],tD([eu({type:Boolean})],tN.prototype,"disabled",2),tD([eu()],tN.prototype,"variant",2),tN=tD([eh("wcm-button-big")],tN);let tU=d`:host{background-color:var(--wcm-color-bg-2);border-top:1px solid var(--wcm-color-bg-3)}div{padding:10px 20px;display:inherit;flex-direction:inherit;align-items:inherit;width:inherit;justify-content:inherit}`;var tz=Object.defineProperty,tH=Object.getOwnPropertyDescriptor;let tZ=class extends ec{render(){return Z`
`}};tZ.styles=[tI.globalCss,tU],tZ=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?tH(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&tz(t,r,l),l})([eh("wcm-info-footer")],tZ);let tB={CROSS_ICON:B``,WALLET_CONNECT_LOGO:B``,WALLET_CONNECT_ICON:B``,WALLET_CONNECT_ICON_COLORED:B``,BACK_ICON:B``,COPY_ICON:B``,RETRY_ICON:B``,DESKTOP_ICON:B``,MOBILE_ICON:B``,ARROW_DOWN_ICON:B``,ARROW_UP_RIGHT_ICON:B``,ARROW_RIGHT_ICON:B``,QRCODE_ICON:B``,SCAN_ICON:B``,CHECKMARK_ICON:B``,SEARCH_ICON:B``,WALLET_PLACEHOLDER:B``,GLOBE_ICON:B``},tV=d`.wcm-toolbar-placeholder{top:0;bottom:0;left:0;right:0;width:100%;position:absolute;display:block;pointer-events:none;height:100px;border-radius:calc(var(--wcm-background-border-radius) * .9);background-color:var(--wcm-background-color);background-position:center;background-size:cover}.wcm-toolbar{height:38px;display:flex;position:relative;margin:5px 15px 5px 5px;justify-content:space-between;align-items:center}.wcm-toolbar img,.wcm-toolbar svg{height:28px;object-position:left center;object-fit:contain}#wcm-wc-logo path{fill:var(--wcm-accent-fill-color)}button{width:28px;height:28px;border-radius:var(--wcm-icon-button-border-radius);border:0;display:flex;justify-content:center;align-items:center;cursor:pointer;background-color:var(--wcm-color-bg-1);box-shadow:0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-bg-2)}button svg{display:block;object-position:center}button path{fill:var(--wcm-color-fg-1)}.wcm-toolbar div{display:flex}@media(hover:hover){button:hover{background-color:var(--wcm-color-bg-2)}}`;var tq=Object.defineProperty,tF=Object.getOwnPropertyDescriptor;let tK=class extends ec{render(){return Z`
${tB.WALLET_CONNECT_LOGO}
`}};tK.styles=[tI.globalCss,tV],tK=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?tF(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&tq(t,r,l),l})([eh("wcm-modal-backcard")],tK);let tQ=d`main{padding:20px;padding-top:0;width:100%}`;var tY=Object.defineProperty,tG=Object.getOwnPropertyDescriptor;let tX=class extends ec{render(){return Z`
`}};tX.styles=[tI.globalCss,tQ],tX=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?tG(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&tY(t,r,l),l})([eh("wcm-modal-content")],tX);let tJ=d`footer{padding:10px;display:flex;flex-direction:column;align-items:inherit;justify-content:inherit;border-top:1px solid var(--wcm-color-bg-2)}`;var t0=Object.defineProperty,t1=Object.getOwnPropertyDescriptor;let t2=class extends ec{render(){return Z`
`}};t2.styles=[tI.globalCss,tJ],t2=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?t1(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&t0(t,r,l),l})([eh("wcm-modal-footer")],t2);let t5=d`header{display:flex;justify-content:center;align-items:center;padding:20px;position:relative}.wcm-border{border-bottom:1px solid var(--wcm-color-bg-2);margin-bottom:20px}header button{padding:15px 20px}header button:active{opacity:.5}@media(hover:hover){header button:hover{opacity:.5}}.wcm-back-btn{position:absolute;left:0}.wcm-action-btn{position:absolute;right:0}path{fill:var(--wcm-accent-color)}`;var t3=Object.defineProperty,t4=Object.getOwnPropertyDescriptor,t7=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?t4(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&t3(t,r,l),l};let t6=class extends ec{constructor(){super(...arguments),this.title="",this.onAction=void 0,this.actionIcon=void 0,this.border=!1}backBtnTemplate(){return Z``}actionBtnTemplate(){return Z``}render(){let e={"wcm-border":this.border},t=eC.AV.state.history.length>1,r=this.title?Z`${this.title}`:Z``;return Z`
${t?this.backBtnTemplate():null} ${r} ${this.onAction?this.actionBtnTemplate():null}
`}};t6.styles=[tI.globalCss,t5],t7([eu()],t6.prototype,"title",2),t7([eu()],t6.prototype,"onAction",2),t7([eu()],t6.prototype,"actionIcon",2),t7([eu({type:Boolean})],t6.prototype,"border",2),t6=t7([eh("wcm-modal-header")],t6);let t8={MOBILE_BREAKPOINT:600,WCM_RECENT_WALLET_DATA:"WCM_RECENT_WALLET_DATA",EXPLORER_WALLET_URL:"https://explorer.walletconnect.com/?type=wallet",getShadowRootElement(e,t){let r=e.renderRoot.querySelector(t);if(!r)throw Error(`${t} not found`);return r},getWalletIcon({id:e,image_id:t}){let{walletImages:r}=eC.ConfigCtrl.state;return null!=r&&r[e]?r[e]:t?eC.ExplorerCtrl.getWalletImageUrl(t):""},getWalletName:(e,t=!1)=>t&&e.length>8?`${e.substring(0,8)}..`:e,isMobileAnimation:()=>window.innerWidth<=t8.MOBILE_BREAKPOINT,preloadImage:async e=>Promise.race([new Promise((t,r)=>{let i=new Image;i.onload=t,i.onerror=r,i.crossOrigin="anonymous",i.src=e}),eC.zv.wait(3e3)]),getErrorMessage:e=>e instanceof Error?e.message:"Unknown Error",debounce(e,t=500){let r;return(...i)=>{r&&clearTimeout(r),r=setTimeout(function(){e(...i)},t)}},handleMobileLinking(e){let t;let{walletConnectUri:r}=eC.OptionsCtrl.state,{mobile:i,name:o}=e,l=i?.native,a=i?.universal;t8.setRecentWallet(e),r&&(t="",l?t=eC.zv.formatUniversalUrl(l,r,o):a&&(t=eC.zv.formatNativeUrl(a,r,o)),eC.zv.openHref(t,"_self"))},handleAndroidLinking(){let{walletConnectUri:e}=eC.OptionsCtrl.state;e&&(eC.zv.setWalletConnectAndroidDeepLink(e),eC.zv.openHref(e,"_self"))},async handleUriCopy(){let{walletConnectUri:e}=eC.OptionsCtrl.state;if(e)try{await navigator.clipboard.writeText(e),eC.ToastCtrl.openToast("Link copied","success")}catch{eC.ToastCtrl.openToast("Failed to copy","error")}},getCustomImageUrls(){let{walletImages:e}=eC.ConfigCtrl.state;return Object.values(Object.values(e??{}))},truncate:(e,t=8)=>e.length<=t?e:`${e.substring(0,4)}...${e.substring(e.length-4)}`,setRecentWallet(e){try{localStorage.setItem(t8.WCM_RECENT_WALLET_DATA,JSON.stringify(e))}catch{console.info("Unable to set recent wallet")}},getRecentWallet(){try{let e=localStorage.getItem(t8.WCM_RECENT_WALLET_DATA);return e?JSON.parse(e):void 0}catch{console.info("Unable to get recent wallet")}},caseSafeIncludes:(e,t)=>e.toUpperCase().includes(t.toUpperCase()),openWalletExplorerUrl(){eC.zv.openHref(t8.EXPLORER_WALLET_URL,"_blank")},getCachedRouterWalletPlatforms(){let{desktop:e,mobile:t}=eC.zv.getWalletRouterData(),r=!!e?.native,i=!!e?.universal;return{isDesktop:r,isMobile:!!t?.native||!!t?.universal,isWeb:i}},goToConnectingView(e){eC.AV.setData({Wallet:e});let t=eC.zv.isMobile(),{isDesktop:r,isWeb:i,isMobile:o}=t8.getCachedRouterWalletPlatforms();t?o?eC.AV.push("MobileConnecting"):i?eC.AV.push("WebConnecting"):eC.AV.push("InstallWallet"):r?eC.AV.push("DesktopConnecting"):i?eC.AV.push("WebConnecting"):o?eC.AV.push("MobileQrcodeConnecting"):eC.AV.push("InstallWallet")}},t9=d`.wcm-router{overflow:hidden;will-change:transform}.wcm-content{display:flex;flex-direction:column}`;var re=Object.defineProperty,rt=Object.getOwnPropertyDescriptor,rr=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rt(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&re(t,r,l),l};let ri=class extends ec{constructor(){super(),this.view=eC.AV.state.view,this.prevView=eC.AV.state.view,this.unsubscribe=void 0,this.oldHeight="0px",this.resizeObserver=void 0,this.unsubscribe=eC.AV.subscribe(e=>{this.view!==e.view&&this.onChangeRoute()})}firstUpdated(){this.resizeObserver=new ResizeObserver(([e])=>{let t=`${e.contentRect.height}px`;"0px"!==this.oldHeight&&tb(this.routerEl,{height:[this.oldHeight,t]},{duration:.2}),this.oldHeight=t}),this.resizeObserver.observe(this.contentEl)}disconnectedCallback(){var e,t;null==(e=this.unsubscribe)||e.call(this),null==(t=this.resizeObserver)||t.disconnect()}get routerEl(){return t8.getShadowRootElement(this,".wcm-router")}get contentEl(){return t8.getShadowRootElement(this,".wcm-content")}viewTemplate(){switch(this.view){case"ConnectWallet":return Z``;case"DesktopConnecting":return Z``;case"MobileConnecting":return Z``;case"WebConnecting":return Z``;case"MobileQrcodeConnecting":return Z``;case"WalletExplorer":return Z``;case"Qrcode":return Z``;case"InstallWallet":return Z``;default:return Z`
Not Found
`}}async onChangeRoute(){await tb(this.routerEl,{opacity:[1,0],scale:[1,1.02]},{duration:.15,delay:.1}).finished,this.view=eC.AV.state.view,tb(this.routerEl,{opacity:[0,1],scale:[.99,1]},{duration:.37,delay:.05})}render(){return Z`
${this.viewTemplate()}
`}};ri.styles=[tI.globalCss,t9],rr([ew()],ri.prototype,"view",2),rr([ew()],ri.prototype,"prevView",2),ri=rr([eh("wcm-modal-router")],ri);let ro=d`div{height:36px;width:max-content;display:flex;justify-content:center;align-items:center;padding:9px 15px 11px;position:absolute;top:12px;box-shadow:0 6px 14px -6px rgba(10,16,31,.3),0 10px 32px -4px rgba(10,16,31,.15);z-index:2;left:50%;transform:translateX(-50%);pointer-events:none;backdrop-filter:blur(20px) saturate(1.8);-webkit-backdrop-filter:blur(20px) saturate(1.8);border-radius:var(--wcm-notification-border-radius);border:1px solid var(--wcm-color-overlay);background-color:var(--wcm-color-overlay)}svg{margin-right:5px}@-moz-document url-prefix(){div{background-color:var(--wcm-color-bg-3)}}.wcm-success path{fill:var(--wcm-accent-color)}.wcm-error path{fill:var(--wcm-error-color)}`;var rl=Object.defineProperty,ra=Object.getOwnPropertyDescriptor,rn=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?ra(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rl(t,r,l),l};let rs=class extends ec{constructor(){super(),this.open=!1,this.unsubscribe=void 0,this.timeout=void 0,this.unsubscribe=eC.ToastCtrl.subscribe(e=>{e.open?(this.open=!0,this.timeout=setTimeout(()=>eC.ToastCtrl.closeToast(),2200)):(this.open=!1,clearTimeout(this.timeout))})}disconnectedCallback(){var e;null==(e=this.unsubscribe)||e.call(this),clearTimeout(this.timeout),eC.ToastCtrl.closeToast()}render(){let{message:e,variant:t}=eC.ToastCtrl.state;return this.open?Z`
${"success"===t?tB.CHECKMARK_ICON:null} ${"error"===t?tB.CROSS_ICON:null}${e}
`:null}};function rc(e,t,r){return e!==t&&(e-t<0?t-e:e-t)<=r+.1}rs.styles=[tI.globalCss,ro],rn([ew()],rs.prototype,"open",2),rs=rn([eh("wcm-modal-toast")],rs);let rd={generate(e,t,r){let i="#141414",o=[],l=function(e,t){let r=Array.prototype.slice.call(tx.create(e,{errorCorrectionLevel:"Q"}).modules.data,0),i=Math.sqrt(r.length);return r.reduce((e,t,r)=>(r%i==0?e.push([t]):e[e.length-1].push(t))&&e,[])}(e,0),a=t/l.length,n=[{x:0,y:0},{x:1,y:0},{x:0,y:1}];n.forEach(({x:e,y:t})=>{let r=(l.length-7)*a*e,s=(l.length-7)*a*t;for(let e=0;e`)}});let s=Math.floor((r+25)/a),c=l.length/2-s/2,d=l.length/2+s/2-1,h=[];l.forEach((e,t)=>{e.forEach((e,r)=>{!l[t][r]||t<7&&r<7||t>l.length-8&&r<7||t<7&&r>l.length-8||t>c&&tc&&r{m[e]?m[e].push(t):m[e]=[t]}),Object.entries(m).map(([e,t])=>{let r=t.filter(e=>t.every(t=>!rc(e,t,a)));return[Number(e),r]}).forEach(([e,t])=>{t.forEach(t=>{o.push(B``)})}),Object.entries(m).filter(([e,t])=>t.length>1).map(([e,t])=>{let r=t.filter(e=>t.some(t=>rc(e,t,a)));return[Number(e),r]}).map(([e,t])=>{t.sort((e,t)=>et.some(t=>rc(e,t,a)));t?t.push(e):r.push([e])}return[e,r.map(e=>[e[0],e[e.length-1]])]}).forEach(([e,t])=>{t.forEach(([t,r])=>{o.push(B``)})}),o}},rh=d`@keyframes fadeIn{0%{opacity:0}100%{opacity:1}}div{position:relative;user-select:none;display:block;overflow:hidden;aspect-ratio:1/1;animation:fadeIn ease .2s}.wcm-dark{background-color:#fff;border-radius:var(--wcm-container-border-radius);padding:18px;box-shadow:0 2px 5px #000}svg:first-child,wcm-wallet-image{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{transform:translateY(-50%) translateX(-50%)}wcm-wallet-image{width:25%;height:25%;border-radius:var(--wcm-wallet-icon-border-radius)}svg:first-child{transform:translateY(-50%) translateX(-50%) scale(.9)}svg:first-child path:first-child{fill:var(--wcm-accent-color)}svg:first-child path:last-child{stroke:var(--wcm-color-overlay)}`;var rm=Object.defineProperty,rp=Object.getOwnPropertyDescriptor,ru=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rp(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rm(t,r,l),l};let rw=class extends ec{constructor(){super(...arguments),this.uri="",this.size=0,this.imageId=void 0,this.walletId=void 0,this.imageUrl=void 0}svgTemplate(){let e="light"===eC.ThemeCtrl.state.themeMode?this.size:this.size-36;return B`${rd.generate(this.uri,e,e/4)}`}render(){let e={"wcm-dark":"dark"===eC.ThemeCtrl.state.themeMode};return Z`
${this.walletId||this.imageUrl?Z``:tB.WALLET_CONNECT_ICON_COLORED} ${this.svgTemplate()}
`}};rw.styles=[tI.globalCss,rh],ru([eu()],rw.prototype,"uri",2),ru([eu({type:Number})],rw.prototype,"size",2),ru([eu()],rw.prototype,"imageId",2),ru([eu()],rw.prototype,"walletId",2),ru([eu()],rw.prototype,"imageUrl",2),rw=ru([eh("wcm-qrcode")],rw);let rg=d`:host{position:relative;height:28px;width:80%}input{width:100%;height:100%;line-height:28px!important;border-radius:var(--wcm-input-border-radius);font-style:normal;font-family:-apple-system,system-ui,BlinkMacSystemFont,'Segoe UI',Roboto,Ubuntu,'Helvetica Neue',sans-serif;font-feature-settings:'case' on;font-weight:500;font-size:16px;letter-spacing:-.03em;padding:0 10px 0 34px;transition:.2s all ease;color:var(--wcm-color-fg-1);background-color:var(--wcm-color-bg-3);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay);caret-color:var(--wcm-accent-color)}input::placeholder{color:var(--wcm-color-fg-2)}svg{left:10px;top:4px;pointer-events:none;position:absolute;width:20px;height:20px}input:focus-within{box-shadow:inset 0 0 0 1px var(--wcm-accent-color)}path{fill:var(--wcm-color-fg-2)}`;var rv=Object.defineProperty,rf=Object.getOwnPropertyDescriptor,rb=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rf(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rv(t,r,l),l};let ry=class extends ec{constructor(){super(...arguments),this.onChange=()=>null}render(){return Z` ${tB.SEARCH_ICON}`}};ry.styles=[tI.globalCss,rg],rb([eu()],ry.prototype,"onChange",2),ry=rb([eh("wcm-search-input")],ry);let rx=d`@keyframes rotate{100%{transform:rotate(360deg)}}@keyframes dash{0%{stroke-dasharray:1,150;stroke-dashoffset:0}50%{stroke-dasharray:90,150;stroke-dashoffset:-35}100%{stroke-dasharray:90,150;stroke-dashoffset:-124}}svg{animation:rotate 2s linear infinite;display:flex;justify-content:center;align-items:center}svg circle{stroke-linecap:round;animation:dash 1.5s ease infinite;stroke:var(--wcm-accent-color)}`;var r$=Object.defineProperty,rC=Object.getOwnPropertyDescriptor;let rA=class extends ec{render(){return Z``}};rA.styles=[tI.globalCss,rx],rA=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?rC(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&r$(t,r,l),l})([eh("wcm-spinner")],rA);let r_=d`span{font-style:normal;font-family:var(--wcm-font-family);font-feature-settings:var(--wcm-font-feature-settings)}.wcm-xsmall-bold{font-family:var(--wcm-text-xsmall-bold-font-family);font-weight:var(--wcm-text-xsmall-bold-weight);font-size:var(--wcm-text-xsmall-bold-size);line-height:var(--wcm-text-xsmall-bold-line-height);letter-spacing:var(--wcm-text-xsmall-bold-letter-spacing);text-transform:var(--wcm-text-xsmall-bold-text-transform)}.wcm-xsmall-regular{font-family:var(--wcm-text-xsmall-regular-font-family);font-weight:var(--wcm-text-xsmall-regular-weight);font-size:var(--wcm-text-xsmall-regular-size);line-height:var(--wcm-text-xsmall-regular-line-height);letter-spacing:var(--wcm-text-xsmall-regular-letter-spacing);text-transform:var(--wcm-text-xsmall-regular-text-transform)}.wcm-small-thin{font-family:var(--wcm-text-small-thin-font-family);font-weight:var(--wcm-text-small-thin-weight);font-size:var(--wcm-text-small-thin-size);line-height:var(--wcm-text-small-thin-line-height);letter-spacing:var(--wcm-text-small-thin-letter-spacing);text-transform:var(--wcm-text-small-thin-text-transform)}.wcm-small-regular{font-family:var(--wcm-text-small-regular-font-family);font-weight:var(--wcm-text-small-regular-weight);font-size:var(--wcm-text-small-regular-size);line-height:var(--wcm-text-small-regular-line-height);letter-spacing:var(--wcm-text-small-regular-letter-spacing);text-transform:var(--wcm-text-small-regular-text-transform)}.wcm-medium-regular{font-family:var(--wcm-text-medium-regular-font-family);font-weight:var(--wcm-text-medium-regular-weight);font-size:var(--wcm-text-medium-regular-size);line-height:var(--wcm-text-medium-regular-line-height);letter-spacing:var(--wcm-text-medium-regular-letter-spacing);text-transform:var(--wcm-text-medium-regular-text-transform)}.wcm-big-bold{font-family:var(--wcm-text-big-bold-font-family);font-weight:var(--wcm-text-big-bold-weight);font-size:var(--wcm-text-big-bold-size);line-height:var(--wcm-text-big-bold-line-height);letter-spacing:var(--wcm-text-big-bold-letter-spacing);text-transform:var(--wcm-text-big-bold-text-transform)}:host(*){color:var(--wcm-color-fg-1)}.wcm-color-primary{color:var(--wcm-color-fg-1)}.wcm-color-secondary{color:var(--wcm-color-fg-2)}.wcm-color-tertiary{color:var(--wcm-color-fg-3)}.wcm-color-inverse{color:var(--wcm-accent-fill-color)}.wcm-color-accnt{color:var(--wcm-accent-color)}.wcm-color-error{color:var(--wcm-error-color)}`;var rO=Object.defineProperty,rE=Object.getOwnPropertyDescriptor,rk=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rE(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rO(t,r,l),l};let rI=class extends ec{constructor(){super(...arguments),this.variant="medium-regular",this.color="primary"}render(){let e={"wcm-big-bold":"big-bold"===this.variant,"wcm-medium-regular":"medium-regular"===this.variant,"wcm-small-regular":"small-regular"===this.variant,"wcm-small-thin":"small-thin"===this.variant,"wcm-xsmall-regular":"xsmall-regular"===this.variant,"wcm-xsmall-bold":"xsmall-bold"===this.variant,"wcm-color-primary":"primary"===this.color,"wcm-color-secondary":"secondary"===this.color,"wcm-color-tertiary":"tertiary"===this.color,"wcm-color-inverse":"inverse"===this.color,"wcm-color-accnt":"accent"===this.color,"wcm-color-error":"error"===this.color};return Z``}};rI.styles=[tI.globalCss,r_],rk([eu()],rI.prototype,"variant",2),rk([eu()],rI.prototype,"color",2),rI=rk([eh("wcm-text")],rI);let rT=d`button{width:100%;height:100%;border-radius:var(--wcm-button-hover-highlight-border-radius);display:flex;align-items:flex-start}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}button>div{width:80px;padding:5px 0;display:flex;flex-direction:column;align-items:center}wcm-text{width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;text-align:center}wcm-wallet-image{height:60px;width:60px;transition:all .2s ease;border-radius:var(--wcm-wallet-icon-border-radius);margin-bottom:5px}.wcm-sublabel{margin-top:2px}`;var rP=Object.defineProperty,rM=Object.getOwnPropertyDescriptor,rS=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rM(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rP(t,r,l),l};let rR=class extends ec{constructor(){super(...arguments),this.onClick=()=>null,this.name="",this.walletId="",this.label=void 0,this.imageId=void 0,this.installed=!1,this.recent=!1}sublabelTemplate(){return this.recent?Z`RECENT`:this.installed?Z`INSTALLED`:null}handleClick(){eC.uA.click({name:"WALLET_BUTTON",walletId:this.walletId}),this.onClick()}render(){var e;return Z``}};rR.styles=[tI.globalCss,rT],rS([eu()],rR.prototype,"onClick",2),rS([eu()],rR.prototype,"name",2),rS([eu()],rR.prototype,"walletId",2),rS([eu()],rR.prototype,"label",2),rS([eu()],rR.prototype,"imageId",2),rS([eu({type:Boolean})],rR.prototype,"installed",2),rS([eu({type:Boolean})],rR.prototype,"recent",2),rR=rS([eh("wcm-wallet-button")],rR);let rL=d`:host{display:block}div{overflow:hidden;position:relative;border-radius:inherit;width:100%;height:100%;background-color:var(--wcm-color-overlay)}svg{position:relative;width:100%;height:100%}div::after{content:'';position:absolute;top:0;bottom:0;left:0;right:0;border-radius:inherit;border:1px solid var(--wcm-color-overlay)}div img{width:100%;height:100%;object-fit:cover;object-position:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var rW=Object.defineProperty,rj=Object.getOwnPropertyDescriptor,rD=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rj(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rW(t,r,l),l};let rN=class extends ec{constructor(){super(...arguments),this.walletId="",this.imageId=void 0,this.imageUrl=void 0}render(){var e;let t=null!=(e=this.imageUrl)&&e.length?this.imageUrl:t8.getWalletIcon({id:this.walletId,image_id:this.imageId});return Z`${t.length?Z`
${this.id}
`:tB.WALLET_PLACEHOLDER}`}};rN.styles=[tI.globalCss,rL],rD([eu()],rN.prototype,"walletId",2),rD([eu()],rN.prototype,"imageId",2),rD([eu()],rN.prototype,"imageUrl",2),rN=rD([eh("wcm-wallet-image")],rN);var rU=Object.defineProperty,rz=Object.getOwnPropertyDescriptor,rH=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rz(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rU(t,r,l),l};let rZ=class extends ec{constructor(){super(),this.preload=!0,this.preloadData()}async loadImages(e){try{null!=e&&e.length&&await Promise.all(e.map(async e=>t8.preloadImage(e)))}catch{console.info("Unsuccessful attempt at preloading some images",e)}}async preloadListings(){if(eC.ConfigCtrl.state.enableExplorer){await eC.ExplorerCtrl.getRecomendedWallets(),eC.OptionsCtrl.setIsDataLoaded(!0);let{recomendedWallets:e}=eC.ExplorerCtrl.state,t=e.map(e=>t8.getWalletIcon(e));await this.loadImages(t)}else eC.OptionsCtrl.setIsDataLoaded(!0)}async preloadCustomImages(){let e=t8.getCustomImageUrls();await this.loadImages(e)}async preloadData(){try{this.preload&&(this.preload=!1,await Promise.all([this.preloadListings(),this.preloadCustomImages()]))}catch(e){console.error(e),eC.ToastCtrl.openToast("Failed preloading","error")}}};rH([ew()],rZ.prototype,"preload",2),rZ=rH([eh("wcm-explorer-context")],rZ);var rB=Object.defineProperty,rV=Object.getOwnPropertyDescriptor;let rq=class extends ec{constructor(){super(),this.unsubscribeTheme=void 0,tI.setTheme(),this.unsubscribeTheme=eC.ThemeCtrl.subscribe(tI.setTheme)}disconnectedCallback(){var e;null==(e=this.unsubscribeTheme)||e.call(this)}};rq=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?rV(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rB(t,r,l),l})([eh("wcm-theme-context")],rq);let rF=d`@keyframes scroll{0%{transform:translate3d(0,0,0)}100%{transform:translate3d(calc(-70px * 9),0,0)}}.wcm-slider{position:relative;overflow-x:hidden;padding:10px 0;margin:0 -20px;width:calc(100% + 40px)}.wcm-track{display:flex;width:calc(70px * 18);animation:scroll 20s linear infinite;opacity:.7}.wcm-track svg{margin:0 5px}wcm-wallet-image{width:60px;height:60px;margin:0 5px;border-radius:var(--wcm-wallet-icon-border-radius)}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-title{display:flex;align-items:center;margin-bottom:10px}.wcm-title svg{margin-right:6px}.wcm-title path{fill:var(--wcm-accent-color)}wcm-modal-footer .wcm-title{padding:0 10px}wcm-button-big{position:absolute;top:50%;left:50%;transform:translateY(-50%) translateX(-50%);filter:drop-shadow(0 0 17px var(--wcm-color-bg-1))}wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-info-footer wcm-text{text-align:center;margin-bottom:15px}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var rK=Object.defineProperty,rQ=Object.getOwnPropertyDescriptor;let rY=class extends ec{onGoToQrcode(){eC.AV.push("Qrcode")}render(){let{recomendedWallets:e}=eC.ExplorerCtrl.state,t=[...e,...e],r=2*eC.zv.RECOMMENDED_WALLET_AMOUNT;return Z`
${tB.MOBILE_ICON}WalletConnect
${[...Array(r)].map((e,r)=>{let i=t[r%t.length];return i?Z``:tB.WALLET_PLACEHOLDER})}
Select Wallet
Choose WalletConnect to see supported apps on your device`}};rY.styles=[tI.globalCss,rF],rY=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?rQ(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rK(t,r,l),l})([eh("wcm-android-wallet-selection")],rY);let rG=d`@keyframes loading{to{stroke-dashoffset:0}}@keyframes shake{10%,90%{transform:translate3d(-1px,0,0)}20%,80%{transform:translate3d(1px,0,0)}30%,50%,70%{transform:translate3d(-2px,0,0)}40%,60%{transform:translate3d(2px,0,0)}}:host{display:flex;flex-direction:column;align-items:center}div{position:relative;width:110px;height:110px;display:flex;justify-content:center;align-items:center;margin:40px 0 20px 0;transform:translate3d(0,0,0)}svg{position:absolute;width:110px;height:110px;fill:none;stroke:transparent;stroke-linecap:round;stroke-width:2px;top:0;left:0}use{stroke:var(--wcm-accent-color);animation:loading 1s linear infinite}wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:90px;height:90px}wcm-text{margin-bottom:40px}.wcm-error svg{stroke:var(--wcm-error-color)}.wcm-error use{display:none}.wcm-error{animation:shake .4s cubic-bezier(.36,.07,.19,.97) both}.wcm-stale svg,.wcm-stale use{display:none}`;var rX=Object.defineProperty,rJ=Object.getOwnPropertyDescriptor,r0=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?rJ(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&rX(t,r,l),l};let r1=class extends ec{constructor(){super(...arguments),this.walletId=void 0,this.imageId=void 0,this.isError=!1,this.isStale=!1,this.label=""}svgLoaderTemplate(){var e,t;let r=null!=(t=null==(e=eC.ThemeCtrl.state.themeVariables)?void 0:e["--wcm-wallet-icon-large-border-radius"])?t:tI.getPreset("--wcm-wallet-icon-large-border-radius"),i=0,o=317-1.57*(i=(r.includes("%")?.88*parseInt(r,10):parseInt(r,10))*1.17),l=425-1.8*i;return Z``}render(){let e={"wcm-error":this.isError,"wcm-stale":this.isStale};return Z`
${this.svgLoaderTemplate()}
${this.isError?"Connection declined":this.label}`}};r1.styles=[tI.globalCss,rG],r0([eu()],r1.prototype,"walletId",2),r0([eu()],r1.prototype,"imageId",2),r0([eu({type:Boolean})],r1.prototype,"isError",2),r0([eu({type:Boolean})],r1.prototype,"isStale",2),r0([eu()],r1.prototype,"label",2),r1=r0([eh("wcm-connector-waiting")],r1);let r2={manualWallets(){var e,t;let{mobileWallets:r,desktopWallets:i}=eC.ConfigCtrl.state,o=null==(e=r2.recentWallet())?void 0:e.id,l=eC.zv.isMobile()?r:i,a=l?.filter(e=>o!==e.id);return null!=(t=eC.zv.isMobile()?a?.map(({id:e,name:t,links:r})=>({id:e,name:t,mobile:r,links:r})):a?.map(({id:e,name:t,links:r})=>({id:e,name:t,desktop:r,links:r})))?t:[]},recentWallet:()=>t8.getRecentWallet(),recomendedWallets(e=!1){var t;let r=e||null==(t=r2.recentWallet())?void 0:t.id,{recomendedWallets:i}=eC.ExplorerCtrl.state;return i.filter(e=>r!==e.id)}},r5={onConnecting(e){t8.goToConnectingView(e)},manualWalletsTemplate(){return r2.manualWallets().map(e=>Z``)},recomendedWalletsTemplate(e=!1){return r2.recomendedWallets(e).map(e=>Z``)},recentWalletTemplate(){let e=r2.recentWallet();if(e)return Z``}},r3=d`.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between}.wcm-desktop-title,.wcm-mobile-title{display:flex;align-items:center}.wcm-mobile-title{justify-content:space-between;margin-bottom:20px;margin-top:-10px}.wcm-desktop-title{margin-bottom:10px;padding:0 10px}.wcm-subtitle{display:flex;align-items:center}.wcm-subtitle:last-child path{fill:var(--wcm-color-fg-3)}.wcm-desktop-title svg,.wcm-mobile-title svg{margin-right:6px}.wcm-desktop-title path,.wcm-mobile-title path{fill:var(--wcm-accent-color)}`;var r4=Object.defineProperty,r7=Object.getOwnPropertyDescriptor;let r6=class extends ec{render(){let{explorerExcludedWalletIds:e,enableExplorer:t}=eC.ConfigCtrl.state,r=r5.manualWalletsTemplate(),i=r5.recomendedWalletsTemplate(),o=[r5.recentWalletTemplate(),...r,...i],l=(o=o.filter(Boolean)).length>4||"ALL"!==e&&t,a=[],n=!!(a=l?o.slice(0,3):o).length;return Z`
${tB.MOBILE_ICON}Mobile
${tB.SCAN_ICON}Scan with your wallet
${n?Z`
${tB.DESKTOP_ICON}Desktop
${a} ${l?Z``:null}
`:null}`}};r6.styles=[tI.globalCss,r3],r6=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?r7(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&r4(t,r,l),l})([eh("wcm-desktop-wallet-selection")],r6);let r8=d`div{background-color:var(--wcm-color-bg-2);padding:10px 20px 15px 20px;border-top:1px solid var(--wcm-color-bg-3);text-align:center}a{color:var(--wcm-accent-color);text-decoration:none;transition:opacity .2s ease-in-out;display:inline}a:active{opacity:.8}@media(hover:hover){a:hover{opacity:.8}}`;var r9=Object.defineProperty,ie=Object.getOwnPropertyDescriptor;let it=class extends ec{render(){let{termsOfServiceUrl:e,privacyPolicyUrl:t}=eC.ConfigCtrl.state;return e??t?Z`
By connecting your wallet to this app, you agree to the app's ${e?Z`Terms of Service`:null} ${e&&t?"and":null} ${t?Z`Privacy Policy`:null}
`:null}};it.styles=[tI.globalCss,r8],it=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?ie(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&r9(t,r,l),l})([eh("wcm-legal-notice")],it);let ir=d`div{display:grid;grid-template-columns:repeat(4,80px);margin:0 -10px;justify-content:space-between;row-gap:10px}`;var ii=Object.defineProperty,io=Object.getOwnPropertyDescriptor;let il=class extends ec{onQrcode(){eC.AV.push("Qrcode")}render(){let{explorerExcludedWalletIds:e,enableExplorer:t}=eC.ConfigCtrl.state,r=r5.manualWalletsTemplate(),i=r5.recomendedWalletsTemplate(),o=[r5.recentWalletTemplate(),...r,...i],l=(o=o.filter(Boolean)).length>8||"ALL"!==e&&t,a=[],n=!!(a=l?o.slice(0,7):o).length;return Z`${n?Z`
${a} ${l?Z``:null}
`:null}`}};il.styles=[tI.globalCss,ir],il=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?io(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&ii(t,r,l),l})([eh("wcm-mobile-wallet-selection")],il);let ia=d`:host{all:initial}.wcm-overlay{top:0;bottom:0;left:0;right:0;position:fixed;z-index:var(--wcm-z-index);overflow:hidden;display:flex;justify-content:center;align-items:center;opacity:0;pointer-events:none;background-color:var(--wcm-overlay-background-color);backdrop-filter:var(--wcm-overlay-backdrop-filter)}@media(max-height:720px) and (orientation:landscape){.wcm-overlay{overflow:scroll;align-items:flex-start;padding:20px 0}}.wcm-active{pointer-events:auto}.wcm-container{position:relative;max-width:360px;width:100%;outline:0;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) var(--wcm-container-border-radius) var(--wcm-container-border-radius);border:1px solid var(--wcm-color-overlay);overflow:hidden}.wcm-card{width:100%;position:relative;border-radius:var(--wcm-container-border-radius);overflow:hidden;box-shadow:0 6px 14px -6px rgba(10,16,31,.12),0 10px 32px -4px rgba(10,16,31,.1),0 0 0 1px var(--wcm-color-overlay);background-color:var(--wcm-color-bg-1);color:var(--wcm-color-fg-1)}@media(max-width:600px){.wcm-container{max-width:440px;border-radius:var(--wcm-background-border-radius) var(--wcm-background-border-radius) 0 0}.wcm-card{border-radius:var(--wcm-container-border-radius) var(--wcm-container-border-radius) 0 0}.wcm-overlay{align-items:flex-end}}@media(max-width:440px){.wcm-container{border:0}}`;var is=Object.defineProperty,ic=Object.getOwnPropertyDescriptor,id=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?ic(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&is(t,r,l),l};let ih=class extends ec{constructor(){super(),this.open=!1,this.active=!1,this.unsubscribeModal=void 0,this.abortController=void 0,this.unsubscribeModal=eC.jb.subscribe(e=>{e.open?this.onOpenModalEvent():this.onCloseModalEvent()})}disconnectedCallback(){var e;null==(e=this.unsubscribeModal)||e.call(this)}get overlayEl(){return t8.getShadowRootElement(this,".wcm-overlay")}get containerEl(){return t8.getShadowRootElement(this,".wcm-container")}toggleBodyScroll(e){if(document.querySelector("body")){if(e){let e=document.getElementById("wcm-styles");e?.remove()}else document.head.insertAdjacentHTML("beforeend",'')}}onCloseModal(e){e.target===e.currentTarget&&eC.jb.close()}onOpenModalEvent(){this.toggleBodyScroll(!1),this.addKeyboardEvents(),this.open=!0,setTimeout(async()=>{let e=t8.isMobileAnimation()?{y:["50vh","0vh"]}:{scale:[.98,1]};await Promise.all([tb(this.overlayEl,{opacity:[0,1]},{delay:.1,duration:.2}).finished,tb(this.containerEl,e,{delay:.1,duration:.2}).finished]),this.active=!0},0)}async onCloseModalEvent(){this.toggleBodyScroll(!0),this.removeKeyboardEvents();let e=t8.isMobileAnimation()?{y:["0vh","50vh"]}:{scale:[1,.98]};await Promise.all([tb(this.overlayEl,{opacity:[1,0]},{duration:.2}).finished,tb(this.containerEl,e,{duration:.2}).finished]),this.containerEl.removeAttribute("style"),this.active=!1,this.open=!1}addKeyboardEvents(){this.abortController=new AbortController,window.addEventListener("keydown",e=>{var t;"Escape"===e.key?eC.jb.close():"Tab"===e.key&&(null!=(t=e.target)&&t.tagName.includes("wcm-")||this.containerEl.focus())},this.abortController),this.containerEl.focus()}removeKeyboardEvents(){var e;null==(e=this.abortController)||e.abort(),this.abortController=void 0}render(){let e={"wcm-overlay":!0,"wcm-active":this.active};return Z`
${this.open?Z`
`:null}
`}};ih.styles=[tI.globalCss,ia],id([ew()],ih.prototype,"open",2),id([ew()],ih.prototype,"active",2),ih=id([eh("wcm-modal")],ih);let im=d`div{display:flex;margin-top:15px}slot{display:inline-block;margin:0 5px}wcm-button{margin:0 5px}`;var ip=Object.defineProperty,iu=Object.getOwnPropertyDescriptor,iw=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?iu(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&ip(t,r,l),l};let ig=class extends ec{constructor(){super(...arguments),this.isMobile=!1,this.isDesktop=!1,this.isWeb=!1,this.isRetry=!1}onMobile(){eC.zv.isMobile()?eC.AV.replace("MobileConnecting"):eC.AV.replace("MobileQrcodeConnecting")}onDesktop(){eC.AV.replace("DesktopConnecting")}onWeb(){eC.AV.replace("WebConnecting")}render(){return Z`
${this.isRetry?Z``:null} ${this.isMobile?Z`Mobile`:null} ${this.isDesktop?Z`Desktop`:null} ${this.isWeb?Z`Web`:null}
`}};ig.styles=[tI.globalCss,im],iw([eu({type:Boolean})],ig.prototype,"isMobile",2),iw([eu({type:Boolean})],ig.prototype,"isDesktop",2),iw([eu({type:Boolean})],ig.prototype,"isWeb",2),iw([eu({type:Boolean})],ig.prototype,"isRetry",2),ig=iw([eh("wcm-platform-selection")],ig);let iv=d`button{display:flex;flex-direction:column;padding:5px 10px;border-radius:var(--wcm-button-hover-highlight-border-radius);height:100%;justify-content:flex-start}.wcm-icons{width:60px;height:60px;display:flex;flex-wrap:wrap;padding:7px;border-radius:var(--wcm-wallet-icon-border-radius);justify-content:space-between;align-items:center;margin-bottom:5px;background-color:var(--wcm-color-bg-2);box-shadow:inset 0 0 0 1px var(--wcm-color-overlay)}button:active{background-color:var(--wcm-color-overlay)}@media(hover:hover){button:hover{background-color:var(--wcm-color-overlay)}}.wcm-icons img{width:21px;height:21px;object-fit:cover;object-position:center;border-radius:calc(var(--wcm-wallet-icon-border-radius)/ 2);border:1px solid var(--wcm-color-overlay)}.wcm-icons svg{width:21px;height:21px}.wcm-icons img:nth-child(1),.wcm-icons img:nth-child(2),.wcm-icons svg:nth-child(1),.wcm-icons svg:nth-child(2){margin-bottom:4px}wcm-text{width:100%;text-align:center}#wallet-placeholder-fill{fill:var(--wcm-color-bg-3)}#wallet-placeholder-dash{stroke:var(--wcm-color-overlay)}`;var ib=Object.defineProperty,iy=Object.getOwnPropertyDescriptor;let ix=class extends ec{onClick(){eC.AV.push("WalletExplorer")}render(){let{recomendedWallets:e}=eC.ExplorerCtrl.state,t=[...e,...r2.manualWallets()].reverse().slice(0,4);return Z``}};ix.styles=[tI.globalCss,iv],ix=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?iy(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&ib(t,r,l),l})([eh("wcm-view-all-wallets-button")],ix);let i$=d`.wcm-qr-container{width:100%;display:flex;justify-content:center;align-items:center;aspect-ratio:1/1}`;var iC=Object.defineProperty,iA=Object.getOwnPropertyDescriptor,i_=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?iA(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iC(t,r,l),l};let iO=class extends ec{constructor(){super(),this.walletId="",this.imageId="",this.uri="",setTimeout(()=>{let{walletConnectUri:e}=eC.OptionsCtrl.state;this.uri=e},0)}get overlayEl(){return t8.getShadowRootElement(this,".wcm-qr-container")}render(){return Z`
${this.uri?Z``:Z``}
`}};iO.styles=[tI.globalCss,i$],i_([eu()],iO.prototype,"walletId",2),i_([eu()],iO.prototype,"imageId",2),i_([ew()],iO.prototype,"uri",2),iO=i_([eh("wcm-walletconnect-qr")],iO);var iE=Object.defineProperty,ik=Object.getOwnPropertyDescriptor;let iI=class extends ec{viewTemplate(){return eC.zv.isAndroid()?Z``:eC.zv.isMobile()?Z``:Z``}render(){return Z`${this.viewTemplate()}`}};iI.styles=[tI.globalCss],iI=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?ik(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iE(t,r,l),l})([eh("wcm-connect-wallet-view")],iI);let iT=d`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var iP=Object.defineProperty,iM=Object.getOwnPropertyDescriptor,iS=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?iM(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iP(t,r,l),l};let iR=class extends ec{constructor(){super(),this.isError=!1,this.openDesktopApp()}onFormatAndRedirect(e){let{desktop:t,name:r}=eC.zv.getWalletRouterData(),i=t?.native;if(i){let t=eC.zv.formatNativeUrl(i,e,r);eC.zv.openHref(t,"_self")}}openDesktopApp(){let{walletConnectUri:e}=eC.OptionsCtrl.state,t=eC.zv.getWalletRouterData();t8.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){let{name:e,id:t,image_id:r}=eC.zv.getWalletRouterData(),{isMobile:i,isWeb:o}=t8.getCachedRouterWalletPlatforms();return Z`${`Connection can continue loading if ${e} is not installed on your device`}Retry`}};iR.styles=[tI.globalCss,iT],iS([ew()],iR.prototype,"isError",2),iR=iS([eh("wcm-desktop-connecting-view")],iR);let iL=d`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}wcm-button{margin-top:15px}`;var iW=Object.defineProperty,ij=Object.getOwnPropertyDescriptor;let iD=class extends ec{onInstall(e){e&&eC.zv.openHref(e,"_blank")}render(){let{name:e,id:t,image_id:r,homepage:i}=eC.zv.getWalletRouterData();return Z`${`Download ${e} to continue. If multiple browser extensions are installed, disable non ${e} ones and try again`}Download`}};iD.styles=[tI.globalCss,iL],iD=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?ij(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iW(t,r,l),l})([eh("wcm-install-wallet-view")],iD);let iN=d`wcm-wallet-image{border-radius:var(--wcm-wallet-icon-large-border-radius);width:96px;height:96px;margin-bottom:20px}wcm-info-footer{display:flex;width:100%}.wcm-app-store{justify-content:space-between}.wcm-app-store wcm-wallet-image{margin-right:10px;margin-bottom:0;width:28px;height:28px;border-radius:var(--wcm-wallet-icon-small-border-radius)}.wcm-app-store div{display:flex;align-items:center}.wcm-app-store wcm-button{margin-right:-10px}.wcm-note{flex-direction:column;align-items:center;padding:5px 0}.wcm-note wcm-text{text-align:center}wcm-platform-selection{margin-top:-15px}.wcm-note wcm-text{margin-top:15px}.wcm-note wcm-text span{color:var(--wcm-accent-color)}`;var iU=Object.defineProperty,iz=Object.getOwnPropertyDescriptor,iH=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?iz(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iU(t,r,l),l};let iZ=class extends ec{constructor(){super(),this.isError=!1,this.openMobileApp()}onFormatAndRedirect(e,t=!1){let{mobile:r,name:i}=eC.zv.getWalletRouterData(),o=r?.native,l=r?.universal;if(o&&!t){let t=eC.zv.formatNativeUrl(o,e,i);eC.zv.openHref(t,"_self")}else if(l){let t=eC.zv.formatUniversalUrl(l,e,i);eC.zv.openHref(t,"_self")}}openMobileApp(e=!1){let{walletConnectUri:t}=eC.OptionsCtrl.state,r=eC.zv.getWalletRouterData();t8.setRecentWallet(r),t&&this.onFormatAndRedirect(t,e)}onGoToAppStore(e){e&&eC.zv.openHref(e,"_blank")}render(){let{name:e,id:t,image_id:r,app:i,mobile:o}=eC.zv.getWalletRouterData(),{isWeb:l}=t8.getCachedRouterWalletPlatforms(),a=i?.ios,n=o?.universal;return Z`Retry${n?Z`Still doesn't work? Try this alternate link`:null}
${`Get ${e}`}
App Store
`}};iZ.styles=[tI.globalCss,iN],iH([ew()],iZ.prototype,"isError",2),iZ=iH([eh("wcm-mobile-connecting-view")],iZ);let iB=d`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var iV=Object.defineProperty,iq=Object.getOwnPropertyDescriptor;let iF=class extends ec{render(){let{name:e,id:t,image_id:r}=eC.zv.getWalletRouterData(),{isDesktop:i,isWeb:o}=t8.getCachedRouterWalletPlatforms();return Z`${`Scan this QR Code with your phone's camera or inside ${e} app`}`}};iF.styles=[tI.globalCss,iB],iF=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?iq(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iV(t,r,l),l})([eh("wcm-mobile-qr-connecting-view")],iF);var iK=Object.defineProperty,iQ=Object.getOwnPropertyDescriptor;let iY=class extends ec{render(){return Z``}};iY.styles=[tI.globalCss],iY=((e,t,r,i)=>{for(var o,l=i>1?void 0:i?iQ(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iK(t,r,l),l})([eh("wcm-qrcode-view")],iY);let iG=d`wcm-modal-content{height:clamp(200px,60vh,600px);display:block;overflow:scroll;scrollbar-width:none;position:relative;margin-top:1px}.wcm-grid{display:grid;grid-template-columns:repeat(4,80px);justify-content:space-between;margin:-15px -10px;padding-top:20px}wcm-modal-content::after,wcm-modal-content::before{content:'';position:fixed;pointer-events:none;z-index:1;width:100%;height:20px;opacity:1}wcm-modal-content::before{box-shadow:0 -1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(var(--wcm-color-bg-1),rgba(255,255,255,0))}wcm-modal-content::after{box-shadow:0 1px 0 0 var(--wcm-color-bg-1);background:linear-gradient(rgba(255,255,255,0),var(--wcm-color-bg-1));top:calc(100% - 20px)}wcm-modal-content::-webkit-scrollbar{display:none}.wcm-placeholder-block{display:flex;justify-content:center;align-items:center;height:100px;overflow:hidden}.wcm-empty,.wcm-loading{display:flex}.wcm-loading .wcm-placeholder-block{height:100%}.wcm-end-reached .wcm-placeholder-block{height:0;opacity:0}.wcm-empty .wcm-placeholder-block{opacity:1;height:100%}wcm-wallet-button{margin:calc((100% - 60px)/ 3) 0}`;var iX=Object.defineProperty,iJ=Object.getOwnPropertyDescriptor,i0=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?iJ(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&iX(t,r,l),l};let i1=class extends ec{constructor(){super(...arguments),this.loading=!eC.ExplorerCtrl.state.wallets.listings.length,this.firstFetch=!eC.ExplorerCtrl.state.wallets.listings.length,this.search="",this.endReached=!1,this.intersectionObserver=void 0,this.searchDebounce=t8.debounce(e=>{e.length>=1?(this.firstFetch=!0,this.endReached=!1,this.search=e,eC.ExplorerCtrl.resetSearch(),this.fetchWallets()):this.search&&(this.search="",this.endReached=this.isLastPage(),eC.ExplorerCtrl.resetSearch())})}firstUpdated(){this.createPaginationObserver()}disconnectedCallback(){var e;null==(e=this.intersectionObserver)||e.disconnect()}get placeholderEl(){return t8.getShadowRootElement(this,".wcm-placeholder-block")}createPaginationObserver(){this.intersectionObserver=new IntersectionObserver(([e])=>{e.isIntersecting&&!(this.search&&this.firstFetch)&&this.fetchWallets()}),this.intersectionObserver.observe(this.placeholderEl)}isLastPage(){let{wallets:e,search:t}=eC.ExplorerCtrl.state,{listings:r,total:i}=this.search?t:e;return i<=40||r.length>=i}async fetchWallets(){var e;let{wallets:t,search:r}=eC.ExplorerCtrl.state,{listings:i,total:o,page:l}=this.search?r:t;if(!this.endReached&&(this.firstFetch||o>40&&i.lengtht8.getWalletIcon(e));await Promise.all([...i.map(async e=>t8.preloadImage(e)),eC.zv.wait(300)]),this.endReached=this.isLastPage()}catch(e){console.error(e),eC.ToastCtrl.openToast(t8.getErrorMessage(e),"error")}finally{this.loading=!1,this.firstFetch=!1}}onConnect(e){eC.zv.isAndroid()?t8.handleMobileLinking(e):t8.goToConnectingView(e)}onSearchChange(e){let{value:t}=e.target;this.searchDebounce(t)}render(){let{wallets:e,search:t}=eC.ExplorerCtrl.state,{listings:r}=this.search?t:e,i=this.loading&&!r.length,o=this.search.length>=3,l=r5.manualWalletsTemplate(),a=r5.recomendedWalletsTemplate(!0);o&&(l=l.filter(({values:e})=>t8.caseSafeIncludes(e[0],this.search)),a=a.filter(({values:e})=>t8.caseSafeIncludes(e[0],this.search)));let n=!this.loading&&!r.length&&!a.length,s={"wcm-loading":i,"wcm-end-reached":this.endReached||!this.loading,"wcm-empty":n};return Z`
${i?null:l} ${i?null:a} ${i?null:r.map(e=>Z`${e?Z``:null}`)}
${n?Z`No results found`:null} ${!n&&this.loading?Z``:null}
`}};i1.styles=[tI.globalCss,iG],i0([ew()],i1.prototype,"loading",2),i0([ew()],i1.prototype,"firstFetch",2),i0([ew()],i1.prototype,"search",2),i0([ew()],i1.prototype,"endReached",2),i1=i0([eh("wcm-wallet-explorer-view")],i1);let i2=d`wcm-info-footer{flex-direction:column;align-items:center;display:flex;width:100%;padding:5px 0}wcm-text{text-align:center}`;var i5=Object.defineProperty,i3=Object.getOwnPropertyDescriptor,i4=(e,t,r,i)=>{for(var o,l=i>1?void 0:i?i3(t,r):t,a=e.length-1;a>=0;a--)(o=e[a])&&(l=(i?o(t,r,l):o(l))||l);return i&&l&&i5(t,r,l),l};let i7=class extends ec{constructor(){super(),this.isError=!1,this.openWebWallet()}onFormatAndRedirect(e){let{desktop:t,name:r}=eC.zv.getWalletRouterData(),i=t?.universal;if(i){let t=eC.zv.formatUniversalUrl(i,e,r);eC.zv.openHref(t,"_blank")}}openWebWallet(){let{walletConnectUri:e}=eC.OptionsCtrl.state,t=eC.zv.getWalletRouterData();t8.setRecentWallet(t),e&&this.onFormatAndRedirect(e)}render(){let{name:e,id:t,image_id:r}=eC.zv.getWalletRouterData(),{isMobile:i,isDesktop:o}=t8.getCachedRouterWalletPlatforms(),l=eC.zv.isMobile();return Z`${`${e} web app has opened in a new tab. Go there, accept the connection, and come back`}Retry`}};i7.styles=[tI.globalCss,i2],i4([ew()],i7.prototype,"isError",2),i7=i4([eh("wcm-web-connecting-view")],i7)}}]); ================================================ FILE: client/out/_next/static/chunks/app/_not-found/page-55d3376e1599fe3a.js ================================================ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[409],{67589:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_not-found/page",function(){return n(35457)}])},35457:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"default",{enumerable:!0,get:function(){return s}}),n(99920);let i=n(57437);n(2265);let o={fontFamily:'system-ui,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji"',height:"100vh",textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center"},l={display:"inline-block"},r={display:"inline-block",margin:"0 20px 0 0",padding:"0 23px 0 0",fontSize:24,fontWeight:500,verticalAlign:"top",lineHeight:"49px"},d={fontSize:14,fontWeight:400,lineHeight:"49px",margin:0};function s(){return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)("title",{children:"404: This page could not be found."}),(0,i.jsx)("div",{style:o,children:(0,i.jsxs)("div",{children:[(0,i.jsx)("style",{dangerouslySetInnerHTML:{__html:"body{color:#000;background:#fff;margin:0}.next-error-h1{border-right:1px solid rgba(0,0,0,.3)}@media (prefers-color-scheme:dark){body{color:#fff;background:#000}.next-error-h1{border-right:1px solid rgba(255,255,255,.3)}}"}}),(0,i.jsx)("h1",{className:"next-error-h1",style:r,children:"404"}),(0,i.jsx)("div",{style:l,children:(0,i.jsx)("h2",{style:d,children:"This page could not be found."})})]})})]})}("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)}},function(e){e.O(0,[971,23,744],function(){return e(e.s=67589)}),_N_E=e.O()}]); ================================================ FILE: client/out/_next/static/chunks/app/layout-696be0f0413601fb.js ================================================ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[185],{35883:function(){},46601:function(){},52361:function(){},94616:function(){},81592:function(e,t,n){Promise.resolve().then(n.t.bind(n,75326,23)),Promise.resolve().then(n.bind(n,27776)),Promise.resolve().then(n.t.bind(n,53054,23)),Promise.resolve().then(n.bind(n,29635)),Promise.resolve().then(n.bind(n,61559)),Promise.resolve().then(n.bind(n,90037))},29635:function(e,t,n){"use strict";n.d(t,{default:function(){return l}});var r=n(57437),o=n(76437);n(27776);let i={id:80002,network:"Polygon Amoy Testnet",name:"Amoy",nativeCurrency:{name:"MATIC",symbol:"MATIC",decimals:18},rpcUrls:{default:{http:["https://rpc.ankr.com/polygon_amoy"]},public:{http:["https://rpc.ankr.com/polygon_amoy"]}},blockExplorers:{default:{name:"Explorer",url:"https://amoy.polygonscan.com/"}}},a={appId:"clz007cw406bz3iq8dwolge41",config:{logo:"https://your.logo.url",loginMethods:["wallet"],appearance:{walletList:["metamask","detected_wallets","rainbow"],theme:"dark"},defaultChain:i,supportedChains:[i],embeddedWallets:{createOnLogin:"users-without-wallets"}}};var l=e=>{let{children:t}=e;return(0,r.jsx)(o.rr,{...a,children:t})}},99782:function(e,t,n){"use strict";n.d(t,{SK:function(){return l}});let r=(0,n(66862).oM)({name:"musicPlayer",initialState:{uri:"/audio/chin-tapak-dum-dum.mp3",isPlaying:!0,index:0,coverImage:"",title:"",artist:""},reducers:{setUri:(e,t)=>{e.uri=t.payload},setIsPlaying:(e,t)=>{e.isPlaying=t.payload},setIndex:(e,t)=>{e.index=t.payload},setMusicPlayer:(e,t)=>({...e,...t.payload})}}),{setUri:o,setIsPlaying:i,setIndex:a,setMusicPlayer:l}=r.actions;t.ZP=r.reducer},61559:function(e,t,n){"use strict";n.d(t,{default:function(){return s}});var r=n(57437),o=n(11444),i=n(66862),a=n(99782);let l=(0,i.xC)({reducer:{musicPlayer:a.ZP}});function s(e){let{children:t}=e;return(0,r.jsx)(o.zt,{store:l,children:t})}},90037:function(e,t,n){"use strict";n.d(t,{ThemeProvider:function(){return i}});var r=n(57437);n(2265);var o=n(79512);function i(e){let{children:t,...n}=e;return(0,r.jsx)(o.f,{...n,children:t})}},53054:function(){},75326:function(e){e.exports={style:{fontFamily:"'__Inter_d65c78', '__Inter_Fallback_d65c78'",fontStyle:"normal"},className:"__className_d65c78"}}},function(e){e.O(0,[370,269,764,202,971,23,744],function(){return e(e.s=81592)}),_N_E=e.O()}]); ================================================ FILE: client/out/_next/static/chunks/app/page-bbd1448002907ff3.js ================================================ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[931],{35883:function(){},46601:function(){},24654:function(){},52361:function(){},94616:function(){},84285:function(e,t,a){Promise.resolve().then(a.bind(a,94484))},94484:function(e,t,a){"use strict";a.r(t),a.d(t,{default:function(){return ta}});var n=a(57437),i=a(98094),s=a(24841),r=a(75027),l=a(63872),o=a(2265);let d=()=>"https://picsum.photos/200/300?random=".concat(Math.floor(1e3*Math.random()));d(),d(),d(),d(),d();let c=[{name:"Relaxation Sounds",description:"Soothing sounds to help you relax and unwind.",creator:"John Doe",image:d(),tracks:[{title:"Peaceful Ambience",artist:"Ownsound",soundUri:"/audio/sample-9s.mp3",cover:d()},{title:"Rainy Day Meditation",artist:"Ownsound",soundUri:"/audio/sample-1s.mp3",cover:d()},{title:"Forest Soundscape",artist:"Ownsound",soundUri:"/audio/sample-9s.mp3",cover:d()},{title:"Ocean Waves",artist:"Nature Tunes",soundUri:"/audio/sample-4s.mp3",cover:d()}]},{name:"Nature Sounds",description:"Immerse yourself in the sounds of nature.",creator:"Jane Smith",image:d(),tracks:[{title:"Mountain Stream",artist:"Nature Tunes",soundUri:"/audio/sample-7s.mp3",cover:d()},{title:"Birdsong",artist:"Nature Tunes",soundUri:"/audio/sample-5s.mp3",cover:d()},{title:"Night Crickets",artist:"Nature Tunes",soundUri:"/audio/sample-2s.mp3",cover:d()},{title:"Morning Dew",artist:"Nature Tunes",soundUri:"/audio/sample-3s.mp3",cover:d()}]},{name:"Instrumental Calm",description:"Relaxing instrumental tracks to help you focus.",creator:"Alex Johnson",image:d(),tracks:[{title:"Calm Piano",artist:"Relaxation Music",soundUri:"/audio/sample-8s.mp3",cover:d()},{title:"Evening Serenity",artist:"Relaxation Music",soundUri:"/audio/sample-6s.mp3",cover:d()},{title:"Gentle Guitar",artist:"Relaxation Music",soundUri:"/audio/sample-10s.mp3",cover:d()},{title:"Soft Strings",artist:"Relaxation Music",soundUri:"/audio/sample-11s.mp3",cover:d()}]}];function p(e){let{url:t}=e,a=(0,o.useRef)(null),[d,c]=(0,o.useState)(!1),[p,u]=(0,o.useState)(0),[m,y]=(0,o.useState)(0);(0,o.useEffect)(()=>{if(t){let e=a.current;u(0),c(!1),a.current.play(),c(!0);let t=()=>{y(e.duration)},n=()=>{u(e.currentTime)},i=()=>{c(!1),u(0)};return e&&(e.addEventListener("loadedmetadata",t),e.addEventListener("timeupdate",n),e.addEventListener("ended",i)),()=>{e&&(e.removeEventListener("loadedmetadata",t),e.removeEventListener("timeupdate",n),e.removeEventListener("ended",i))}}},[t]);let x=e=>{if(isNaN(e))return"00:00";let t=Math.floor(e%60);return"".concat(Math.floor(e/60),":").concat(t<10?"0"+t:t)};return console.log(t),(0,n.jsxs)("div",{className:"px-4 py-2 w-full flex items-center justify-between gap-3",children:[(0,n.jsx)("audio",{ref:a,src:t},t),(0,n.jsx)("div",{className:"controls flex items-center gap-2",children:(0,n.jsx)("button",{onClick:()=>{let e=a.current;d?e.pause():e.play(),c(!d)},className:"bg-primary text-white rounded-full p-1.5 flex items-center justify-center",children:d?(0,n.jsx)(s.Z,{className:"w-3 h-3"}):(0,n.jsx)(i.Z,{className:"w-3 h-3"})})}),(0,n.jsxs)("div",{className:"flex-1 flex items-center gap-2",children:[(0,n.jsx)("span",{className:"text-sm",children:x(p)}),(0,n.jsx)("input",{type:"range",min:"0",max:"100",value:p/m*100||0,onChange:e=>{let t=a.current,n=e.target.value/100*m;t.currentTime=n},className:"flex-1 range accent-primary"}),(0,n.jsx)("span",{className:"text-sm",children:x(m)})]}),(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)(l.d1A,{className:"cursor-pointer"}),(0,n.jsx)(r.U6L,{className:"cursor-pointer"}),(0,n.jsx)(r.t00,{className:"cursor-pointer"}),(0,n.jsx)(l.P$5,{className:"cursor-pointer"})]})]})}var u=a(3274),m=e=>{let{noWidth:t=!1}=e;return t?(0,n.jsx)(u.Z,{className:"animate-spin text-primary"}):(0,n.jsx)(u.Z,{className:"animate-spin text-primary w-40"})},y=a(71322),x=a(41505),h=a(44839),f=a(96164);function g(){for(var e=arguments.length,t=Array(e),a=0;a{let{className:t,...a}=e;return(0,n.jsx)(x.eh,{className:g("flex h-full w-full data-[panel-group-direction=vertical]:flex-col",t),...a})},b=x.s_,w=e=>{let{withHandle:t,className:a,...i}=e;return(0,n.jsx)(x.OT,{className:g("relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90",a),...i,children:t&&(0,n.jsx)("div",{className:"z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border",children:(0,n.jsx)(y.Z,{className:"h-2.5 w-2.5"})})})};var j=a(76437),N=a(89896);function T(e,t,a){if(e.length<=t+a)return e;let n=e.slice(0,t),i=e.slice(-a);return"".concat(n,".........").concat(i)}var k=a(21246),E=a(87592),S=a(22468),P=a(28165);let C=k.fC,R=k.xz;k.ZA,k.Uv,k.Tr,k.Ee,o.forwardRef((e,t)=>{let{className:a,inset:i,children:s,...r}=e;return(0,n.jsxs)(k.fF,{ref:t,className:g("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",i&&"pl-8",a),...r,children:[s,(0,n.jsx)(E.Z,{className:"ml-auto h-4 w-4"})]})}).displayName=k.fF.displayName,o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(k.tu,{ref:t,className:g("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",a),...i})}).displayName=k.tu.displayName;let M=o.forwardRef((e,t)=>{let{className:a,sideOffset:i=4,...s}=e;return(0,n.jsx)(k.Uv,{children:(0,n.jsx)(k.VY,{ref:t,sideOffset:i,className:g("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",a),...s})})});M.displayName=k.VY.displayName;let F=o.forwardRef((e,t)=>{let{className:a,inset:i,...s}=e;return(0,n.jsx)(k.ck,{ref:t,className:g("relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",i&&"pl-8",a),...s})});F.displayName=k.ck.displayName,o.forwardRef((e,t)=>{let{className:a,children:i,checked:s,...r}=e;return(0,n.jsxs)(k.oC,{ref:t,className:g("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",a),checked:s,...r,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(k.wU,{children:(0,n.jsx)(S.Z,{className:"h-4 w-4"})})}),i]})}).displayName=k.oC.displayName,o.forwardRef((e,t)=>{let{className:a,children:i,...s}=e;return(0,n.jsxs)(k.Rk,{ref:t,className:g("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",a),...s,children:[(0,n.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,n.jsx)(k.wU,{children:(0,n.jsx)(P.Z,{className:"h-2 w-2 fill-current"})})}),i]})}).displayName=k.Rk.displayName,o.forwardRef((e,t)=>{let{className:a,inset:i,...s}=e;return(0,n.jsx)(k.__,{ref:t,className:g("px-2 py-1.5 text-sm font-semibold",i&&"pl-8",a),...s})}).displayName=k.__.displayName,o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(k.Z0,{ref:t,className:g("-mx-1 my-1 h-px bg-muted",a),...i})}).displayName=k.Z0.displayName;var I=a(66648),A=a(71538),D=a(12218);let B=(0,D.j)("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),L=o.forwardRef((e,t)=>{let{className:a,variant:i,size:s,asChild:r=!1,...l}=e,o=r?A.g7:"button";return(0,n.jsx)(o,{className:g(B({variant:i,size:s,className:a})),ref:t,...l})});L.displayName="Button";var Z=a(38296),O=a(92699),z=a(79512);function U(){let{setTheme:e}=(0,z.F)();return(0,n.jsxs)(C,{children:[(0,n.jsx)(R,{asChild:!0,children:(0,n.jsxs)(L,{variant:"outline",size:"icon",children:[(0,n.jsx)(Z.Z,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),(0,n.jsx)(O.Z,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),(0,n.jsx)("span",{className:"sr-only",children:"Toggle theme"})]})}),(0,n.jsxs)(M,{align:"end",children:[(0,n.jsx)(F,{onClick:()=>e("light"),children:"Light"}),(0,n.jsx)(F,{onClick:()=>e("dark"),children:"Dark"}),(0,n.jsx)(F,{onClick:()=>e("system"),children:"System"})]})]})}var H=e=>{let{w0:t}=e,{login:a,authenticated:i,logout:s}=(0,j.sv)();return(0,n.jsx)("div",{className:"p-6",children:i?(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsxs)(C,{className:"w-full",children:[(0,n.jsx)(R,{className:"w-full bg-primary rounded-md",children:(0,n.jsxs)("div",{className:"py-2 flex items-center justify-between px-4 w-full",children:[(0,n.jsx)("div",{children:(0,n.jsx)(I.default,{src:"/icons/connect-wallet.svg",width:20,height:20,alt:"wallet"})}),(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[(0,n.jsx)("p",{className:"text-white",children:(null==t?void 0:t.address)&&T(t.address,4,4)}),(0,n.jsx)(I.default,{src:"/icons/down-arrow.svg",width:10,height:10})]})]})}),(0,n.jsx)(M,{className:"min-w-[18rem]",children:(0,n.jsx)(F,{children:(0,n.jsxs)("div",{className:"flex items-center justify-between w-full",onClick:s,children:[(0,n.jsx)("p",{children:"Logout"}),(0,n.jsx)(N.Z,{className:"w-4"})]})})})]}),(0,n.jsx)(U,{})]}):(0,n.jsx)(L,{className:"w-full",onClick:a,children:"Connect Wallet"})})};let V=(0,D.j)("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function G(e){let{className:t,variant:a,...i}=e;return(0,n.jsx)("div",{className:g(V({variant:a}),t),...i})}var _=a(14504),W=a(95137),Y=a(98141),q=a(34446),X=a(52022),K=a(28196),J=a(3003),$=a(18422),Q=a(38364);let ee=(0,D.j)("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),et=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(Q.f,{ref:t,className:g(ee(),a),...i})});et.displayName=Q.f.displayName;let ea=o.forwardRef((e,t)=>{let{className:a,type:i,...s}=e;return(0,n.jsx)("input",{type:i,className:g("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...s})});ea.displayName="Input";var en=e=>{let{items:t,renderItem:a,containerId:i}=e,s=(0,o.useRef)(null),[r,l]=(0,o.useState)(!1),[d,c]=(0,o.useState)(!1);return(0,o.useEffect)(()=>{let e=()=>{if(s.current){let{scrollLeft:e,scrollWidth:t,clientWidth:a}=s.current;l(e>0),c(e+a{s.current&&s.current.removeEventListener("scroll",e),window.removeEventListener("resize",e)}},[]),(0,n.jsxs)("div",{className:"relative",children:[r&&(0,n.jsx)("button",{className:"absolute left-0 top-20 transform bg-primary rounded-full z-10 text-white w-6 h-6 flex items-center justify-center drop-shadow-md",onClick:()=>{s.current.scrollBy({left:-200,behavior:"smooth"})},children:(0,n.jsx)(W.Z,{className:"w-3"})}),d&&(0,n.jsx)("button",{className:"absolute right-0 top-20 transform bg-primary rounded-full z-10 text-white w-6 h-6 flex items-center justify-center drop-shadow-md",onClick:()=>{s.current.scrollBy({left:200,behavior:"smooth"})},children:(0,n.jsx)(W.Z,{className:"w-3 rotate-180"})}),(0,n.jsx)("div",{className:"px-4",children:(0,n.jsx)("div",{id:i,ref:s,className:"flex space-x-4 overflow-x-auto scrollbar-hide py-2",children:t.map((e,t)=>(0,n.jsx)("div",{className:"space-y-2 flex-shrink-0",children:a(e)},t))})})]})},ei=a(20920),es=a(6538);let er=es.fC,el=es.xz,eo=es.h_,ed=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(es.aV,{className:g("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",a),...i,ref:t})});ed.displayName=es.aV.displayName;let ec=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsxs)(eo,{children:[(0,n.jsx)(ed,{}),(0,n.jsx)(es.VY,{ref:t,className:g("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",a),...i})]})});ec.displayName=es.VY.displayName;let ep=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:g("flex flex-col space-y-2 text-center sm:text-left",t),...a})};ep.displayName="AlertDialogHeader";let eu=e=>{let{className:t,...a}=e;return(0,n.jsx)("div",{className:g("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",t),...a})};eu.displayName="AlertDialogFooter";let em=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(es.Dx,{ref:t,className:g("text-lg font-semibold",a),...i})});em.displayName=es.Dx.displayName;let ey=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(es.dk,{ref:t,className:g("text-sm text-muted-foreground",a),...i})});ey.displayName=es.dk.displayName;let ex=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(es.aU,{ref:t,className:g(B(),a),...i})});ex.displayName=es.aU.displayName;let eh=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(es.$j,{ref:t,className:g(B({variant:"outline"}),"mt-2 sm:mt-0",a),...i})});eh.displayName=es.$j.displayName;let ef=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)("textarea",{className:g("flex min-h-[80px] w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",a),ref:t,...i})});ef.displayName="Textarea";var eg=a(9646);let ev=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsx)(eg.fC,{className:g("peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",a),...i,ref:t,children:(0,n.jsx)(eg.bU,{className:g("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0")})})});ev.displayName=eg.fC.displayName;var eb=a(16356),ew=a(22584),ej=a(38401),eN=a(38472);let eT="0xaD4b216C20Ac6a06D67d03c8176C047BB81CB7A0",ek=[{inputs:[{internalType:"address",name:"musicxTokenAddress",type:"address"},{internalType:"address",name:"protocolFeeAddress",type:"address"}],stateMutability:"payable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"CreatorPayoutWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"newCreator",type:"address"}],name:"FullRoyaltyBought",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"creator",type:"address"}],name:"NFTMinted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"buyer",type:"address"}],name:"NFTPurchased",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"renter",type:"address"},{indexed:!1,internalType:"uint256",name:"duration",type:"uint256"}],name:"NFTRented",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"rentBaseAmount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"rentDuration",type:"uint256"}],name:"RentInfoSet",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!0,internalType:"address",name:"creator",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"RoyaltyPaid",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bool",name:"_fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"_fullRoyaltyBuyoutPrice",type:"uint256"}],name:"buyFullRoyalty",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"buyNFT",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"bool",name:"fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"fullRoyaltyBuyoutPrice",type:"uint256"},{internalType:"string",name:"title",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"string",name:"coverImage",type:"string"},{internalType:"string",name:"mp3FileLocationId",type:"string"},{internalType:"bool",name:"isRentingAllowed",type:"bool"},{internalType:"uint256",name:"supply",type:"uint256"},{internalType:"uint256",name:"royaltyPercentage",type:"uint256"}],internalType:"struct OwnSound.CreateNFTParams",name:"params",type:"tuple"},{internalType:"uint256",name:"randomNumber",type:"uint256"}],name:"createNFT",outputs:[{internalType:"uint256",name:"newTokenId",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"creatorPayouts",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAllTokensInfo",outputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{components:[{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"bool",name:"fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"fullRoyaltyBuyoutPrice",type:"uint256"},{internalType:"string",name:"title",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"string",name:"coverImage",type:"string"},{internalType:"string",name:"mp3FileLocationId",type:"string"},{internalType:"bool",name:"isRentingAllowed",type:"bool"},{internalType:"uint256",name:"supply",type:"uint256"},{internalType:"uint256",name:"royaltyPercentage",type:"uint256"},{internalType:"address",name:"creator",type:"address"},{internalType:"uint256",name:"remainingSupply",type:"uint256"},{internalType:"uint256",name:"randomNumber",type:"uint256"}],internalType:"struct OwnSound.NFTMetadata",name:"metadata",type:"tuple"},{internalType:"address",name:"creator",type:"address"}],internalType:"struct OwnSound.TokenInfo[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getNFTMetadata",outputs:[{components:[{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"bool",name:"fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"fullRoyaltyBuyoutPrice",type:"uint256"},{internalType:"string",name:"title",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"string",name:"coverImage",type:"string"},{internalType:"string",name:"mp3FileLocationId",type:"string"},{internalType:"bool",name:"isRentingAllowed",type:"bool"},{internalType:"uint256",name:"supply",type:"uint256"},{internalType:"uint256",name:"royaltyPercentage",type:"uint256"},{internalType:"address",name:"creator",type:"address"},{internalType:"uint256",name:"remainingSupply",type:"uint256"},{internalType:"uint256",name:"randomNumber",type:"uint256"}],internalType:"struct OwnSound.NFTMetadata",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"randomNumber",type:"uint256"}],name:"getNFTMetadataByRandomNumber",outputs:[{components:[{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"bool",name:"fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"fullRoyaltyBuyoutPrice",type:"uint256"},{internalType:"string",name:"title",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"string",name:"coverImage",type:"string"},{internalType:"string",name:"mp3FileLocationId",type:"string"},{internalType:"bool",name:"isRentingAllowed",type:"bool"},{internalType:"uint256",name:"supply",type:"uint256"},{internalType:"uint256",name:"royaltyPercentage",type:"uint256"},{internalType:"address",name:"creator",type:"address"},{internalType:"uint256",name:"remainingSupply",type:"uint256"},{internalType:"uint256",name:"randomNumber",type:"uint256"}],internalType:"struct OwnSound.NFTMetadata",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getRentInfo",outputs:[{components:[{internalType:"bool",name:"purchased",type:"bool"},{internalType:"bool",name:"isRenting",type:"bool"},{internalType:"uint256",name:"rentPrice",type:"uint256"},{internalType:"address",name:"renter",type:"address"},{internalType:"uint256",name:"rentDuration",type:"uint256"},{internalType:"uint256",name:"rentEndTime",type:"uint256"}],internalType:"struct OwnSound.OwnershipInfo",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getRentableTokens",outputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{components:[{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"bool",name:"fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"fullRoyaltyBuyoutPrice",type:"uint256"},{internalType:"string",name:"title",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"string",name:"coverImage",type:"string"},{internalType:"string",name:"mp3FileLocationId",type:"string"},{internalType:"bool",name:"isRentingAllowed",type:"bool"},{internalType:"uint256",name:"supply",type:"uint256"},{internalType:"uint256",name:"royaltyPercentage",type:"uint256"},{internalType:"address",name:"creator",type:"address"},{internalType:"uint256",name:"remainingSupply",type:"uint256"},{internalType:"uint256",name:"randomNumber",type:"uint256"}],internalType:"struct OwnSound.NFTMetadata",name:"metadata",type:"tuple"},{internalType:"uint256",name:"rentBaseAmount",type:"uint256"},{internalType:"uint256",name:"rentDuration",type:"uint256"},{internalType:"address",name:"currentOwner",type:"address"},{internalType:"bool",name:"isRenting",type:"bool"}],internalType:"struct OwnSound.RentableTokenInfo[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"buyer",type:"address"}],name:"getWalletPurchasedNFTs",outputs:[{internalType:"uint256[]",name:"",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"}],name:"getWalletTokensWithMetadata",outputs:[{components:[{internalType:"uint256",name:"tokenId",type:"uint256"},{components:[{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"bool",name:"fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"fullRoyaltyBuyoutPrice",type:"uint256"},{internalType:"string",name:"title",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"string",name:"coverImage",type:"string"},{internalType:"string",name:"mp3FileLocationId",type:"string"},{internalType:"bool",name:"isRentingAllowed",type:"bool"},{internalType:"uint256",name:"supply",type:"uint256"},{internalType:"uint256",name:"royaltyPercentage",type:"uint256"},{internalType:"address",name:"creator",type:"address"},{internalType:"uint256",name:"remainingSupply",type:"uint256"},{internalType:"uint256",name:"randomNumber",type:"uint256"}],internalType:"struct OwnSound.NFTMetadata",name:"metadata",type:"tuple"},{components:[{internalType:"bool",name:"purchased",type:"bool"},{internalType:"bool",name:"isRenting",type:"bool"},{internalType:"uint256",name:"rentPrice",type:"uint256"},{internalType:"address",name:"renter",type:"address"},{internalType:"uint256",name:"rentDuration",type:"uint256"},{internalType:"uint256",name:"rentEndTime",type:"uint256"}],internalType:"struct OwnSound.OwnershipInfo",name:"ownershipInfo",type:"tuple"}],internalType:"struct OwnSound.WalletTokenInfo[]",name:"",type:"tuple[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"nftMetadata",outputs:[{internalType:"uint256",name:"basePrice",type:"uint256"},{internalType:"bool",name:"fullRoyaltyAllowed",type:"bool"},{internalType:"uint256",name:"fullRoyaltyBuyoutPrice",type:"uint256"},{internalType:"string",name:"title",type:"string"},{internalType:"string",name:"description",type:"string"},{internalType:"string",name:"coverImage",type:"string"},{internalType:"string",name:"mp3FileLocationId",type:"string"},{internalType:"bool",name:"isRentingAllowed",type:"bool"},{internalType:"uint256",name:"supply",type:"uint256"},{internalType:"uint256",name:"royaltyPercentage",type:"uint256"},{internalType:"address",name:"creator",type:"address"},{internalType:"uint256",name:"remainingSupply",type:"uint256"},{internalType:"uint256",name:"randomNumber",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"owner",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"},{internalType:"address",name:"",type:"address"}],name:"ownershipInfo",outputs:[{internalType:"bool",name:"purchased",type:"bool"},{internalType:"bool",name:"isRenting",type:"bool"},{internalType:"uint256",name:"rentPrice",type:"uint256"},{internalType:"address",name:"renter",type:"address"},{internalType:"uint256",name:"rentDuration",type:"uint256"},{internalType:"uint256",name:"rentEndTime",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"randomNumberToTokenId",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"rentNFT",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"rentPrice",type:"uint256"},{internalType:"uint256",name:"rentDuration",type:"uint256"}],name:"setRentInfo",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"withdrawCreatorPayout",outputs:[],stateMutability:"nonpayable",type:"function"}],eE="0x9b344Cc9f7Bfa905cc6eBCF87AbC03338785b70B",eS=[{inputs:[{internalType:"address",name:"initialOwner",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"ECDSAInvalidSignature",type:"error"},{inputs:[{internalType:"uint256",name:"length",type:"uint256"}],name:"ECDSAInvalidSignatureLength",type:"error"},{inputs:[{internalType:"bytes32",name:"s",type:"bytes32"}],name:"ECDSAInvalidSignatureS",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"allowance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientAllowance",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"balance",type:"uint256"},{internalType:"uint256",name:"needed",type:"uint256"}],name:"ERC20InsufficientBalance",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ERC20InvalidApprover",type:"error"},{inputs:[{internalType:"address",name:"receiver",type:"address"}],name:"ERC20InvalidReceiver",type:"error"},{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"ERC20InvalidSender",type:"error"},{inputs:[{internalType:"address",name:"spender",type:"address"}],name:"ERC20InvalidSpender",type:"error"},{inputs:[{internalType:"uint256",name:"deadline",type:"uint256"}],name:"ERC2612ExpiredSignature",type:"error"},{inputs:[{internalType:"address",name:"signer",type:"address"},{internalType:"address",name:"owner",type:"address"}],name:"ERC2612InvalidSigner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"currentNonce",type:"uint256"}],name:"InvalidAccountNonce",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"OwnableInvalidOwner",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"OwnableUnauthorizedAccount",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"burnFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];var eP=a(22554),eC=a(27776),eR=a(85068);let eM=o.forwardRef((e,t)=>{let{className:a,...i}=e;return(0,n.jsxs)(eR.fC,{ref:t,className:g("relative flex w-full touch-none select-none items-center",a),...i,children:[(0,n.jsx)(eR.fQ,{className:"relative h-2 w-full grow overflow-hidden rounded-full bg-secondary",children:(0,n.jsx)(eR.e6,{className:"absolute h-full bg-primary"})}),(0,n.jsx)(eR.bU,{className:"block h-5 w-5 rounded-full border-2 border-primary bg-background ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50"})]})});eM.displayName=eR.fC.displayName;var eF=e=>{let{getSongs:t}=e,[a,i]=(0,o.useState)(!1),[s,r]=(0,o.useState)(!1),[l,d]=(0,o.useState)(!1),[c,p]=(0,o.useState)(""),{wallets:u}=(0,j.rB)(),y=u[0],[x,h]=(0,o.useState)(null),[f,g]=(0,o.useState)(1),[v,b]=(0,o.useState)(!1),[w,N]=(0,o.useState)(null),[T,k]=(0,o.useState)(""),[E,S]=(0,o.useState)(""),[P,C]=(0,o.useState)(""),[R,M]=(0,o.useState)(""),[F,A]=(0,o.useState)(""),[D,B]=(0,o.useState)(0),[Z,O]=(0,o.useState)(""),[z,U]=(0,o.useState)(!1),[H,V]=(0,o.useState)(!1),[G,_]=(0,o.useState)({songName:"",songDescription:"",basePrice:"",royaltyPrice:"",royaltyPercentage:"",isRentingAllowed:!1}),W=async e=>{let t=e.target.files[0];if(t){i(!0);try{let e=new FormData;Object.keys(G).forEach(t=>{e.append(t,G[t])}),e.append("musicFile",t),e.append("userAddress",y.address);let a=await eN.Z.post("/api/endpoint",e,{headers:{"Content-Type":"multipart/form-data"}});console.log("Response:",a.data),console.log("Response:",a.data.value),p(a.data.value),h(t),k(t.name)}catch(e){eC.A.error("Error uploading file"),console.error("Error uploading file:",e)}finally{i(!1)}}},Y=async e=>{let t=e.target.files[0];if(t){r(!0);try{let e=new FormData;e.append("file",t),e.append("upload_preset","fi0lxkc1"),e.append("api_key","697773597345229");let a=await fetch("https://api.cloudinary.com/v1_1/da9h8exvs/image/upload",{method:"POST",body:e});if(!a.ok){let e=await a.json();throw Error("Upload failed: ".concat(e.error.message))}let n=await a.json();N(n.secure_url)}catch(e){console.error("Error uploading image:",e)}finally{r(!1)}}},q=async()=>{1===f&&T&&x&&g(2)},X=async()=>{O(""),U(!0),console.log(c);try{let e=await (null==y?void 0:y.getEthersProvider());if(!e)throw Error("Provider is not available");let a=await e.getSigner();if(!a)throw Error("Signer is not available");let n=new eP.CH(eT,ek,a),i=await n.createNFT({basePrice:R,fullRoyaltyAllowed:H,fullRoyaltyBuyoutPrice:F,title:E,description:P,coverImage:w,mp3FileLocationId:c,isRentingAllowed:v,supply:100,royaltyPercentage:D},c);await i.wait(1),console.log(i),U(!1),d(!1),await t(y.address),eC.A.success("Successfully published the song")}catch(e){U(!1),console.error("Error creating NFT:",e),O("Failed to create NFT. Please try again.")}};return(0,n.jsxs)(er,{open:l,onOpenChange:e=>d(e),children:[(0,n.jsx)(el,{children:(0,n.jsx)(L,{variant:"outline",className:"w-full h-full",children:"Publish Audio"})}),(0,n.jsxs)(ec,{children:[(0,n.jsxs)(ep,{children:[(0,n.jsx)(em,{children:1===f?"Upload Music":"Song Details"}),(0,n.jsx)(ey,{children:1===f?"Upload your music file and proceed to enter the song details.":"Enter the details of your song and finalize your submission."})]}),(0,n.jsxs)("div",{className:"space-y-3",children:[1===f&&(0,n.jsx)(n.Fragment,{children:(0,n.jsxs)("div",{className:"relative h-24 w-full border border-muted-foreground border-dashed rounded-md flex items-center justify-center gap-2 cursor-pointer transition-transform duration-300 ease-in-out transform hover:scale-105",children:[(0,n.jsx)("input",{type:"file",accept:"audio/*",className:"absolute inset-0 opacity-0 cursor-pointer",onChange:W,disabled:a}),a?(0,n.jsxs)("div",{className:"flex items-center gap-2",children:[(0,n.jsx)("div",{className:"buffering"}),(0,n.jsx)(m,{})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(ew.Z,{className:"text-muted-foreground w-8 h-8"}),(0,n.jsx)("p",{className:"text-muted-foreground",children:T?"Selected File: ".concat(T):"Upload Music File"})]})]})}),2===f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"flex gap-3 items-center",children:[(0,n.jsx)("div",{className:"w-24 h-24 bg-muted rounded-md overflow-hidden relative",children:w?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("img",{src:w,alt:"Uploaded",className:"w-full h-full object-cover"}),(0,n.jsx)("button",{onClick:()=>{N(null)},className:"absolute z-[99999999999] bottom-1 right-1 bg-red-600 text-white rounded-full p-1 transition-opacity",children:(0,n.jsx)(eb.FH3,{})})]}):(0,n.jsx)("div",{className:"relative h-full w-full flex items-center justify-center",children:s?(0,n.jsxs)("div",{className:"flex flex-col items-center",children:[(0,n.jsx)("div",{className:"buffering"}),(0,n.jsx)(m,{})]}):(0,n.jsxs)("div",{className:"relative h-full w-full flex items-center justify-center",children:[(0,n.jsx)("div",{children:(0,n.jsx)(ew.Z,{className:"text-muted-foreground"})}),(0,n.jsx)("label",{className:"absolute cursor-pointer flex items-center justify-center w-full h-full text-muted",children:(0,n.jsx)("input",{type:"file",accept:"image/*",className:"hidden",onChange:Y})})]})})})," ",(0,n.jsxs)("div",{className:"h-16 flex flex-col justify-between",children:[(0,n.jsx)(et,{children:"Song Name"}),(0,n.jsx)(ea,{placeholder:"Enter song name",value:E,onChange:e=>S(e.target.value)})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(et,{children:"Song Description"}),(0,n.jsx)(ef,{placeholder:"Enter song description",className:"mt-2.5",value:P,onChange:e=>C(e.target.value)})]}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsxs)("div",{className:"flex items-center space-x-2 pt-2",children:[(0,n.jsx)(et,{htmlFor:"isRentingAllowed",children:"Renting Allowed?"}),(0,n.jsx)(ev,{id:"isRentingAllowed",onCheckedChange:e=>b(e)})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-2 pt-2",children:[(0,n.jsx)(et,{htmlFor:"full-royalty",children:"Full Royalty Allowed?"}),(0,n.jsx)(ev,{id:"full-royalty",onCheckedChange:e=>V(e)})]})]}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)(et,{children:"Base Price"}),(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full mt-2.5",children:[(0,n.jsx)(ea,{placeholder:"Enter Base Price",type:"number",value:R,onChange:e=>M(e.target.value)}),(0,n.jsx)(I.default,{src:"/icons/token-coin.svg",width:20,height:20,alt:"coin"})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(et,{children:"Royalty Price"}),(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full mt-2.5",children:[(0,n.jsx)(ea,{placeholder:"Enter Royalty Price",type:"number",value:F,onChange:e=>A(e.target.value)}),(0,n.jsx)(I.default,{src:"/icons/token-coin.svg",width:20,height:20,alt:"coin"})]})]})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)(et,{children:"Royalty Percentage"}),(0,n.jsxs)("div",{className:"flex items-center gap-3 w-full mt-2.5",children:[(0,n.jsx)(eM,{defaultValue:[0],max:20,step:5,className:"",onValueChange:e=>B(e)}),(0,n.jsxs)("div",{className:"flex text-muted-foreground",children:[D,(0,n.jsx)(ej.Z,{className:"text-muted-foreground w-4"})]})]})]}),Z&&(0,n.jsx)("div",{className:"text-red-500 text-sm mt-2",children:Z})]})]}),(0,n.jsxs)(eu,{children:[(0,n.jsx)(eh,{children:"Cancel"}),1===f&&(0,n.jsx)(L,{onClick:q,disabled:!T,children:"Next"}),2===f&&(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(L,{variant:"outline",onClick:()=>{2===f&&g(1)},children:"Back"}),(0,n.jsx)(L,{onClick:X,disabled:!E||!P||z,children:z?"Uploading...":"Upload"})]})]})]})]})},eI=a(43393),eA=a.n(eI),eD=JSON.parse('{"nm":"Comp 1","mn":"","layers":[{"ty":3,"nm":"Null 1","mn":"","sr":1,"st":0,"op":121,"ip":0,"hd":false,"cl":"","ln":"","ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[250,245,0],"t":0,"ti":[0,0,0],"to":[0,1.667,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.667,"y":1},"s":[250,255,0],"t":60,"ti":[0,1.667,0],"to":[0,0,0]},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[250,245,0],"t":120}],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":0,"ix":11}},"ef":[],"ind":1},{"ty":4,"nm":"face","mn":"","sr":1,"st":0,"op":121,"ip":0,"hd":false,"cl":"","ln":"","ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[250,250,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":1,"k":[{"o":{"x":0.748,"y":0},"i":{"x":0.667,"y":1},"s":[0,0,0],"t":30,"ti":[0,0,0],"to":[0,0,0]},{"o":{"x":0.178,"y":0},"i":{"x":0.352,"y":1},"s":[8,0,0],"t":45,"ti":[0,0,0],"to":[0,0,0]},{"o":{"x":0.077,"y":0},"i":{"x":0.491,"y":1},"s":[-8,0,0],"t":60,"ti":[-1.333,0,0],"to":[0,0,0]},{"o":{"x":0.333,"y":0},"i":{"x":0.491,"y":1},"s":[3,0,0],"t":73,"ti":[0.5,0,0],"to":[1.333,0,0]},{"o":{"x":0.167,"y":0.167},"i":{"x":0.833,"y":0.833},"s":[0,0,0],"t":84}],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":1,"it":[{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0.964,0],[0.926,1.269],[-2.109,1.537],[-12.421,0],[-9.638,-6.507],[1.46,-2.163],[2.164,1.463],[9.78,0],[8.382,-6.108]],"o":[[-1.46,0],[-1.537,-2.109],[10.009,-7.294],[11.67,0],[2.163,1.46],[-1.458,2.163],[-8.071,-5.448],[-10.408,0],[-0.84,0.612]],"v":[[-30.712,9.847],[-34.536,7.904],[-33.499,1.302],[0.788,-9.847],[33.361,0.099],[34.633,6.66],[28.073,7.932],[0.788,-0.396],[-27.934,8.941]]},"ix":2}},{"ty":"fl","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.4275,0.3176,0.8157],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[250,273.902],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Group 2","ix":2,"cix":2,"np":2,"it":[{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-5.22],[5.22,0],[0,5.22],[-5.22,0]],"o":[[0,5.22],[-5.22,0],[0,-5.22],[5.22,0]],"v":[[9.451,0],[0,9.451],[-9.451,0],[0,-9.451]]},"ix":2}},{"ty":"fl","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.4275,0.3176,0.8157],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[212.197,225.702],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Group 2","ix":2,"cix":2,"np":2,"it":[{"ty":"sh","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,-5.22],[5.22,0],[0,5.22],[-5.22,0]],"o":[[0,5.22],[-5.22,0],[0,-5.22],[5.22,0]],"v":[[9.451,0],[0,9.451],[-9.451,0],[0,-9.451]]},"ix":2}},{"ty":"fl","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.4275,0.3176,0.8157],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[287.803,225.702],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]},{"ty":"tr","a":{"a":0,"k":[287.803,225.702],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[287.803,225.702],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":2,"parent":1},{"ty":4,"nm":"magnification glass","mn":"","sr":1,"st":0,"op":121,"ip":0,"hd":false,"cl":"","ln":"","ddd":0,"bm":0,"hasMask":false,"ao":0,"ks":{"a":{"a":0,"k":[0,0,0],"ix":1},"s":{"a":0,"k":[100,100,100],"ix":6},"sk":{"a":0,"k":0},"p":{"a":0,"k":[27,24,0],"ix":2},"r":{"a":0,"k":0,"ix":10},"sa":{"a":0,"k":0},"o":{"a":0,"k":100,"ix":11}},"ef":[],"shapes":[{"ty":"gr","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Group","nm":"Group 1","ix":1,"cix":2,"np":3,"it":[{"ty":"sh","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 1","ix":1,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[14.17,-15.84],[0.87,-0.89],[25.14,0],[0,49.35],[-49.35,0],[0,-49.35]],"o":[[-0.82,0.93],[-16.27,16.75],[-49.35,0],[0,-49.35],[49.35,0],[0,22.88]],"v":[[39.949,35.36],[37.419,38.08],[-26.751,65.25],[-116.251,-24.25],[-26.751,-113.75],[62.749,-24.25]]},"ix":2}},{"ty":"sh","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Shape - Group","nm":"Path 2","ix":2,"d":1,"ks":{"a":0,"k":{"c":true,"i":[[0,0],[0,25.41],[60.93,0],[0,-60.93],[-60.93,0],[-19.48,17.2]],"o":[[14.48,-18.69],[0,-60.93],[-60.93,0],[0,60.93],[27.96,0],[0,0]],"v":[[60.639,43.3],[83.749,-24.25],[-26.751,-134.75],[-137.251,-24.25],[-26.751,86.25],[46.269,58.61]]},"ix":2}},{"ty":"fl","bm":0,"cl":"","ln":"","hd":false,"mn":"ADBE Vector Graphic - Fill","nm":"Fill 1","c":{"a":0,"k":[0.4275,0.3176,0.8157],"ix":4},"r":1,"o":{"a":0,"k":100,"ix":5}},{"ty":"tr","a":{"a":0,"k":[0,0],"ix":1},"s":{"a":0,"k":[100,100],"ix":3},"sk":{"a":0,"k":0,"ix":4},"p":{"a":0,"k":[0,0],"ix":2},"r":{"a":0,"k":0,"ix":6},"sa":{"a":0,"k":0,"ix":5},"o":{"a":0,"k":100,"ix":7}}]}],"ind":3,"parent":1}],"ddd":0,"h":500,"w":500,"meta":{"a":"","k":"","d":"","g":"LottieFiles AE 3.2.2","tc":"#000000"},"v":"4.8.0","fr":60,"op":121,"ip":0,"assets":[]}'),eB=a(40472),eL=a(11444),eZ=a(99782),eO=e=>{let{song:t}=e,a=(0,eL.I0)(),[i,s,r]=t;console.log(i.toString());let l=async(e,t)=>{let n=Number(t[12].toString());try{a((0,eZ.SK)({uri:"/api/hashsong/".concat(n),isPlaying:!0,index:0,coverImage:t[5],title:t[3],artist:t[4]}))}catch(e){console.error("Error playing song:",e),eC.A.error("Failed to play song. Please try again.")}};return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{className:"relative flex",children:[(0,n.jsx)("div",{className:"w-36 h-36",children:(0,n.jsx)("img",{src:s[5],className:"aspect-square rounded-md w-full h-full object-cover",alt:s[3]})}),(0,n.jsx)("div",{className:"w-10 h-10 cursor-pointer bg-primary z-10 -bottom-3 -right-2 absolute rounded-full flex items-center justify-center text-white",onClick:()=>{l("bafybeic5zcykf7fpg7c2zuf76p2gddegxlt64hbfp76qqs7l4l6yx3nraa",s)},children:(0,n.jsx)(eB.Z,{})})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"w-full text-center truncate max-w-xs mx-auto",title:s[3],children:s[3]}),(0,n.jsx)("p",{className:"text-sm text-center text-muted-foreground",children:s[4]})]})]})},ez=e=>{let{playlist:t}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-36 h-36",children:(0,n.jsx)("img",{src:t.image,className:"aspect-square rounded-md w-full h-full object-cover",alt:t.name})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"w-full text-center truncate max-w-xs mx-auto",title:t.name,children:t.name}),(0,n.jsx)("p",{className:"text-sm text-center text-muted-foreground",children:t.creator})]})]})},eU=()=>{let{authenticated:e,ready:t}=(0,j.sv)(),{wallets:a}=(0,j.rB)(),i=a[0],[s,r]=(0,o.useState)([]),[l,d]=(0,o.useState)(!0),[p,u]=(0,o.useState)(!1),y=async e=>{if(!e){toast.error("Address is not provided"),u(!0),d(!1);return}try{let t=await (null==i?void 0:i.getEthersProvider());if(!t)throw console.error("Provider is not available:",t),Error("Provider is not available");let a=await t.getSigner();if(!a)throw console.error("Signer is not available:",a),Error("Signer is not available");let n=new eP.CH(eT,ek,a),s=await n.getWalletTokensWithMetadata(e);console.log(s),r(s),d(!1)}catch(e){console.error("Error fetching songs:",e),u(!0),d(!1)}};(0,o.useEffect)(()=>{t&&e&&(null==i?void 0:i.address)!==void 0&&(console.log("Wallet Address: ",i.address),y(i.address))},[i,t,e]);let x={hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{type:"spring",stiffness:300,damping:24}}};return(0,n.jsxs)(Y.E.div,{className:"w-full flex flex-col gap-6 pb-32 h-[85vh] overflow-y-auto scrollbar-hide",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},initial:"hidden",animate:"visible",children:[(0,n.jsxs)(Y.E.div,{className:"mt-10 scroll-m-20 border-b pb-4 text-3xl font-semibold tracking-tight transition-colors first:mt-0 w-full flex items-center justify-between sticky top-0 z-50 bg-background",variants:x,children:["GM Ser!",(0,n.jsx)(eF,{getSongs:y,w0:i})]}),(0,n.jsxs)(Y.E.div,{className:"flex w-full gap-3 items-center",variants:x,children:[(0,n.jsxs)(Y.E.div,{className:"w-24 h-24 relative",children:[(0,n.jsx)("img",{src:"/nft.avif",className:"rounded-lg"}),(0,n.jsx)(Y.E.div,{className:"w-6 h-6 flex items-center justify-center absolute bg-muted z-10 -bottom-2 -right-2 rounded-full cursor-pointer drop-shadow",whileHover:{scale:1.1},whileTap:{scale:.9},children:(0,n.jsx)($.Z,{className:"w-3"})})]}),(0,n.jsxs)(Y.E.div,{className:"flex flex-col gap-3",variants:x,children:[(0,n.jsx)(et,{children:"Username"}),(0,n.jsx)(ea,{placeholder:"Change username",className:"max-w-xs"})]})]}),(0,n.jsx)(Y.E.div,{className:"scroll-m-20 border-b pb-2 text-xl font-semibold tracking-tight transition-colors first:mt-0",variants:x,children:"Your NFS's"}),(0,n.jsx)(q.M,{children:l?(0,n.jsx)(Y.E.div,{className:"grid place-items-center min-h-32",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:(0,n.jsx)(m,{})}):p?(0,n.jsx)(Y.E.p,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:"Error loading songs"}):0===s.length?(0,n.jsxs)(Y.E.div,{className:"w-full h-32 flex items-center justify-center",initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},children:[(0,n.jsx)("div",{className:"w-20 h-20",children:(0,n.jsx)(eA(),{animationData:eD})}),(0,n.jsx)("p",{className:"text-muted-foreground",children:"No NFS's found!"})]}):(0,n.jsx)(Y.E.div,{variants:x,children:(0,n.jsx)(en,{items:s,renderItem:e=>(0,n.jsx)(eO,{song:e}),containerId:"scrollContainer-".concat((0,ei.Z)())})})}),(0,n.jsx)(Y.E.div,{className:"scroll-m-20 border-b pb-2 text-xl font-semibold tracking-tight transition-colors first:mt-0",variants:x,children:"Your Playlist"}),(0,n.jsx)(Y.E.div,{variants:x,children:(0,n.jsx)(en,{items:c,renderItem:e=>(0,n.jsx)(ez,{playlist:e}),containerId:"scrollContainer-".concat((0,ei.Z)())})})]})},eH=e=>{let{track:t,setSelectedLayout:a}=e;return(0,n.jsxs)("div",{className:"p-3 hover:bg-muted rounded-lg cursor-pointer",onClick:()=>a("view-song/".concat(t.id)),children:[(0,n.jsx)("div",{className:"w-36 h-36",children:(0,n.jsx)("img",{src:t.cover,className:"aspect-square rounded-md w-full h-full object-cover",alt:t.title})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"w-full text-center truncate max-w-xs mx-auto",title:t.title,children:t.title}),(0,n.jsx)("p",{className:"text-sm text-center text-muted-foreground",children:t.artist})]})]})},eV=e=>{let{playlist:t}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)("div",{className:"w-36 h-36",children:(0,n.jsx)("img",{src:t.image,className:"aspect-square rounded-md w-full h-full object-cover",alt:t.name})}),(0,n.jsxs)("div",{children:[(0,n.jsx)("p",{className:"w-full text-center truncate max-w-xs mx-auto",title:t.name,children:t.name}),(0,n.jsxs)("p",{className:"text-sm text-center text-muted-foreground",children:[t.tracks.length," songs"]})]})]})},eG=e=>{let{setSelectedLayout:t,w0:a}=e,{authenticated:i,ready:s}=(0,j.sv)(),[r,l]=(0,o.useState)(""),[d,p]=(0,o.useState)([]),[u,y]=(0,o.useState)(!0),[x,h]=(0,o.useState)(!0),f=async()=>{try{y(!0);let e=await (null==a?void 0:a.getEthersProvider());if(!e)throw Error("Provider is not available");let t=await e.getSigner();if(!t)throw Error("Signer is not available");let n=new eP.CH(eT,ek,t),i=(await n.getAllTokensInfo()).map(e=>({id:e[0].toNumber(),title:e[1][3],artist:e[1][4],cover:e[1][5],price:e[1][0].toNumber(),owner:e[2]})).reverse();p(i)}catch(e){console.log(e)}finally{y(!1)}},g=async()=>{h(!0),setTimeout(()=>{h(!1)},1e3)};(0,o.useEffect)(()=>{s&&i&&(null==a?void 0:a.address)!==void 0&&(f(),g())},[a,s,i]);let v=(e,t)=>e.filter(e=>{let a=e.title||"",n=e.artist||"";return a.toLowerCase().includes(t.toLowerCase())||n.toLowerCase().includes(t.toLowerCase())}),b=v(d,r),w=v(c,r),N={hidden:{y:20,opacity:0},visible:{y:0,opacity:1}};return(0,n.jsxs)(Y.E.div,{className:"w-full flex flex-col gap-6 pb-32 h-[85vh] overflow-y-auto scrollbar-hide mt-2",initial:"hidden",animate:"visible",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},children:[(0,n.jsxs)(Y.E.div,{className:"mt-10 scroll-m-20 border-b pb-4 text-3xl font-semibold tracking-tight transition-colors first:mt-0 sticky top-0 z-[50] bg-background w-full flex items-center justify-between",variants:N,children:["Explore",(0,n.jsx)(Y.E.div,{className:"w-auto p-1",whileHover:{scale:1.05},whileTap:{scale:.95},children:(0,n.jsx)(ea,{type:"text",placeholder:"Search...",value:r,onChange:e=>{l(e.target.value)}})})]}),(0,n.jsx)(Y.E.div,{variants:N,children:u?(0,n.jsx)("div",{className:"text-center h-32 grid place-items-center",children:(0,n.jsx)(m,{})}):b.length>0?(0,n.jsx)(en,{items:b,renderItem:e=>(0,n.jsx)(eH,{track:e,setSelectedLayout:t}),containerId:"scrollContainer-".concat((0,ei.Z)())}):(0,n.jsx)("div",{className:"text-center",children:"No tracks found"})}),(0,n.jsxs)(Y.E.div,{variants:N,children:[(0,n.jsx)(Y.E.div,{className:"scroll-m-20 mb-5 border-b pb-2 text-xl font-semibold tracking-tight transition-colors first:mt-0",variants:N,children:"Popular Playlists"}),x?(0,n.jsx)("div",{className:"text-center h-32 grid place-items-center",children:(0,n.jsx)(m,{})}):w.length>0?(0,n.jsx)(en,{items:w,renderItem:e=>(0,n.jsx)(eV,{playlist:e,setSelectedLayout:t}),containerId:"scrollContainer-".concat((0,ei.Z)())}):(0,n.jsx)("div",{className:"text-center",children:"No playlists found"})]})]})};function e_(){return(0,n.jsxs)(er,{children:[(0,n.jsx)(el,{asChild:!0,children:(0,n.jsx)(L,{variant:"outline",className:"dark:text-white",children:"Need MCX ?"})}),(0,n.jsxs)(ec,{children:[(0,n.jsxs)(ep,{children:[(0,n.jsx)(em,{children:"Need some MusicX(MCX) Token?"}),(0,n.jsx)(ey,{className:"dark:text-white text-black",children:"Follow @0xabhii and DM your Polygon Amoy Wallet Address to receive 20 MusicX tokens!"})]}),(0,n.jsxs)(eu,{children:[(0,n.jsx)(eh,{children:"Cancel"}),(0,n.jsx)(ex,{onClick:()=>window.open("https://x.com/0xabhii","_blank"),children:"Continue "})]})]})]})}var eW=a(69824),eY=a(58789);function eq(e){let{metadata:t,songId:a,isowner:i}=e,[s,r]=(0,o.useState)(a),[l,d]=(0,o.useState)(""),[c,p]=(0,o.useState)(""),{authenticated:u,ready:m}=(0,j.sv)(),{wallets:y}=(0,j.rB)(),x=y[0],h=async()=>{try{let e=await (null==x?void 0:x.getEthersProvider());if(!e)throw Error("Provider is not available");let t=await e.getSigner();if(!t)throw Error("Signer is not available");let a=new eP.CH(eT,ek,t),n=await a.setRentInfo(s,l,c,{gasLimit:7e5});await n.wait(),console.log("Rent set successfully:",n),eC.A.success("Rent set successfully!")}catch(e){eC.A.error("Failed to set rent. Please try again."),console.error("Error setting rent:",e)}},f=async()=>{try{let e=await (null==x?void 0:x.getEthersProvider());if(!e)throw Error("Provider is not available");let t=await e.getSigner();if(!t)throw Error("Signer is not available");let a=new eP.CH(eT,ek,t);if(i){let e=await a.rentNFT(s,{value:l,gasLimit:7e5});await e.wait(),console.log("NFT rentInfo updated successfully:",e),eC.A.success("NFT rentInfo updated successfully!")}else{let e=await a.rentNFT(s,{gasLimit:7e5});await e.wait(),console.log("NFT rented successfully:",e),eC.A.success("NFT rented successfully!")}}catch(e){eC.A.error("Failed to rent NFT. Please try again."),console.error("Error renting NFT:",e)}};return(0,n.jsxs)(er,{children:[(0,n.jsx)(el,{asChild:!0,children:(0,n.jsx)(Y.E.button,{whileHover:{scale:1.05},whileTap:{scale:.95},className:"mt-6 border dark:text-white text-black font-semibold py-2 px-4 rounded-full transition duration-300 ease-in-out transform hover:-translate-y-1 hover:shadow-xl",children:i?"Set Rent":"Rent"})}),(0,n.jsxs)(ec,{children:[(0,n.jsxs)(ep,{children:[(0,n.jsx)(em,{children:i?"Set Rent for ".concat(t.name):"Rent ".concat(t.name)}),(0,n.jsx)(ey,{children:i?"Set the rental parameters for your NFT. This action can be modified later.":"Rent this NFT for the specified duration."}),(0,n.jsxs)("div",{className:"space-y-4 mt-4",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"tokenId",className:"block text-sm font-medium text-gray-700",children:"Token ID"}),(0,n.jsx)(ea,{id:"tokenId",value:s,onChange:e=>r(e.target.value),placeholder:"Token ID",className:"mt-1",readOnly:!0})]}),i?(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"rentPrice",className:"block text-sm font-medium text-gray-700",children:"Rent Price (in wei)"}),(0,n.jsx)(ea,{id:"rentPrice",value:l,onChange:e=>d(e.target.value),placeholder:"Rent Price",className:"mt-1"})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"rentDuration",className:"block text-sm font-medium text-gray-700",children:"Rent Duration (in seconds)"}),(0,n.jsx)(ea,{id:"rentDuration",value:c,onChange:e=>p(e.target.value),placeholder:"Rent Duration",className:"mt-1"})]})]}):(0,n.jsxs)(n.Fragment,{children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"rentPrice",className:"block text-sm font-medium text-gray-700",children:"Rent Price"}),(0,n.jsx)(ea,{id:"rentPrice",value:t.rentPrice||"Not set",className:"mt-1",readOnly:!0})]}),(0,n.jsxs)("div",{children:[(0,n.jsx)("label",{htmlFor:"rentDuration",className:"block text-sm font-medium text-gray-700",children:"Rent Duration"}),(0,n.jsx)(ea,{id:"rentDuration",value:t.rentDuration||"Not set",className:"mt-1",readOnly:!0})]})]})]})]}),(0,n.jsxs)(eu,{children:[(0,n.jsx)(eh,{children:"Cancel"}),(0,n.jsx)(ex,{onClick:i?h:f,children:i?"Set Rent":"Rent Now"})]})]})]})}var eX=e=>{let{selectedLayout:t,setSelectedLayout:a,getMusicXTokenBalance:i}=e,{authenticated:s,ready:r}=(0,j.sv)(),{wallets:l}=(0,j.rB)(),[d,c]=(0,o.useState)(!0),[p,u]=(0,o.useState)(!1),[y,x]=(0,o.useState)(!1),[h,f]=(0,o.useState)(!1),g=l[0],[v,b]=(0,o.useState)(null),w=t.split("view-song/")[1],N=async e=>{try{c(!0);let t=await (null==g?void 0:g.getEthersProvider());if(!t)throw Error("Provider is not available");let a=await t.getSigner();if(!a)throw Error("Signer is not available");let n=new eP.CH(eT,ek,a),i=await n.getNFTMetadata(e);console.log(i);let s={id:i[0].toNumber(),isListed:i[1],price:i[0].toNumber(),name:i[3],description:i[4],imageUrl:i[5],audioUrl:i[6],isRentable:i[7],rentPrice:i[8].toNumber(),royaltyPercentage:i[9].toNumber(),creator:i[10],totalRents:i[11].toNumber(),createdAt:new Date().toLocaleDateString()};console.log(s);let r=await n.getRentableTokens();if(0===r.length){console.log("No rentable tokens"),b({...s,rentPrice:0});return}console.log(r);let l=r[0][1],o={songName:l[3],songSymbol:l[4],imageUrl:l[5],isRentable:l[8],rentPrice:l[9].toString(),rentDuration:l[10],ownerAddress:l[11],rentStartTime:l[13]};console.log(o);let d=eY.fi(s.price.toString());console.log(d.toString()),b({...s,rentPrice:o.rentPrice})}catch(e){console.error("Error fetching song details:",e),eC.A.error("Failed to fetch song details")}finally{c(!1)}},T=async e=>{try{let t=await (null==g?void 0:g.getEthersProvider());if(!t)throw Error("Provider is not available");let a=await t.getSigner();if(!a)throw Error("Signer is not available");let n=new eP.CH(eT,ek,a),i=await n.ownershipInfo(e,g.address);console.log(i),f(i[0])}catch(e){console.error("Error fetching ownership info:",e),eC.A.error("Failed to fetch ownership information")}};console.log(w),(0,o.useEffect)(()=>{r&&s&&(null==g?void 0:g.address)!==void 0&&(T(w),N(w))},[w,r,s,null==g?void 0:g.address]);let k=async e=>{try{x(!0);let t=await (null==g?void 0:g.getEthersProvider());if(!t)throw Error("Provider is not available");let a=await t.getSigner();if(!a)throw Error("Signer is not available");let n=new eP.CH(eT,ek,a),i=new eP.CH(eE,eS,a);if((await i.allowance(await a.getAddress(),eT)).lt(eY.fi(v.price.toString()))){u(!0);let e=await i.approve(eT,eY.fi(v.price.toString()),{gasLimit:3e5});await e.wait(1),u(!1)}let s=await n.buyNFT(e,{gasLimit:3e5});await s.wait(1),await N(e),eC.A.success("NFT purchased successfully!")}catch(e){console.error("Error buying NFT:",e),e.message.includes("ERC20: insufficient allowance")||e.message.includes("user denied transaction signature")?eC.A.error("You need to approve the contract to spend your tokens. Click the 'Approve' button to continue."):eC.A.error("Failed to purchase NFT. Please try again later.")}finally{x(!1)}};return d?(0,n.jsx)("div",{className:"text-center mt-80 w-full grid place-items-center",children:(0,n.jsx)(m,{})}):v?(0,n.jsxs)("div",{className:"w-full flex flex-col gap-6 pb-32 h-[85vh] overflow-y-auto scrollbar-hide",children:[(0,n.jsxs)(Y.E.div,{initial:{opacity:0,y:-50},animate:{opacity:1,y:0},transition:{duration:.5},className:"scroll-m-20 border-b pb-4 pt-2 text-3xl font-semibold tracking-tight sticky top-0 z-[50] bg-background w-full flex items-center gap-4",children:[(0,n.jsx)("div",{className:"hover:bg-muted text-foreground p-1.5 cursor-pointer rounded-full",onClick:()=>a("explore"),children:(0,n.jsx)(eW.Vmf,{size:24,className:"-rotate-90"})}),"Song Details"]}),(0,n.jsxs)("div",{className:"flex flex-col md:flex-row gap-8 px-4 md:px-8",children:[(0,n.jsx)(Y.E.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.5,delay:.2},className:"w-full md:w-1/3",children:(0,n.jsx)("img",{src:v.imageUrl,alt:v.name,className:"w-full h-auto rounded-lg shadow-lg hover:shadow-2xl transition-shadow duration-300"})}),(0,n.jsxs)(Y.E.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},transition:{duration:.5,delay:.4},className:"w-full md:w-2/3 space-y-4",children:[(0,n.jsx)("h2",{className:"text-4xl font-bold text-primary",children:v.name}),(0,n.jsxs)("p",{className:"text-xl text-muted-foreground",children:["Creator: ",v.creator]}),(0,n.jsx)("p",{className:"text-muted-foreground",children:v.description}),(0,n.jsxs)("div",{className:"grid grid-cols-2 gap-4 mt-6",children:[(0,n.jsxs)("div",{className:"border dark:border-none dark:bg-gray-800 bg-muted p-4 rounded-lg",children:[(0,n.jsx)("p",{className:"text-foreground dark:text-gray-400",children:"Price"}),(0,n.jsxs)("p",{className:"text-2xl font-semibold text-green-400",children:[v.price," MSX"]})]}),(0,n.jsxs)("div",{className:"border dark:border-none dark:bg-gray-800 bg-muted p-4 rounded-lg",children:[(0,n.jsx)("p",{className:"text-foreground dark:text-gray-400",children:"Royalty"}),(0,n.jsxs)("p",{className:"text-2xl font-semibold text-yellow-400",children:[v.royaltyPercentage,"%"]})]}),(0,n.jsxs)("div",{className:"border dark:border-none dark:bg-gray-800 bg-muted p-4 rounded-lg",children:[(0,n.jsx)("p",{className:"text-foreground dark:text-gray-400",children:"Rentable"}),(0,n.jsx)("p",{className:"text-xl font-semibold text-blue-400",children:v.isRentable?"Yes":"No"})]}),(0,n.jsxs)("div",{className:"border dark:border-none dark:bg-gray-800 bg-muted p-4 rounded-lg",children:[(0,n.jsx)("p",{className:"text-foreground dark:text-gray-400",children:"Rent Price"}),(0,n.jsxs)("p",{className:"text-xl font-semibold text-pink-400",children:[v.rentPrice," MSX"]})]})]}),(0,n.jsxs)("p",{className:"text-muted-foreground mt-4",children:["Created on: ",v.createdAt]}),console.log(w),v.creator!==g.address?(0,n.jsxs)("div",{className:"flex items-center gap-3",children:[v.isRentable&&(0,n.jsx)(eq,{metadata:v,songId:w,isowner:h}),!h&&v.isListed&&(0,n.jsx)(Y.E.button,{whileHover:{scale:1.05},whileTap:{scale:.95},className:"mt-6 bg-primary hover:bg-purple-700 text-white font-semibold py-2 px-4 rounded-full transition duration-300 ease-in-out transform hover:-translate-y-1 hover:shadow-xl",onClick:()=>k(w),disabled:y||p,children:y?"Purchasing...":p?"Approving...":"Purchase Now"})]}):(0,n.jsx)("p",{className:"text-red-500",children:"You cannot purchase your own song. You are the creator of this"})]})]})]}):(0,n.jsx)("div",{className:"text-center mt-8",children:"No song details available."})},eK=a(45282),eJ=a(80847),e$=()=>{let[e,t]=(0,o.useState)("https://images.tv9hindi.com/wp-content/uploads/2024/08/chin-tapak-dum-dum-1.png"),[a,i]=(0,o.useState)(16/9),s=(0,eK.c)(0),r=(0,eK.c)(0),l=(0,eJ.H)(r,[-500,500],[5,-5]),d=(0,eJ.H)(s,[-500,500],[-5,5]);return(0,o.useEffect)(()=>{{let t=new window.Image;t.onload=()=>{i(t.width/t.height)},t.src=e}},[e]),(0,n.jsx)("div",{className:"w-full h-screen px-10 flex items-center justify-center overflow-hidden -mt-20",onMouseMove:function(e){let t=e.currentTarget.getBoundingClientRect();s.set(e.clientX-t.left-t.width/2),r.set(e.clientY-t.top-t.height/2)},children:(0,n.jsxs)(Y.E.div,{className:"w-full h-full flex flex-col items-center justify-center",style:{rotateX:l,rotateY:d,perspective:1e3},initial:{opacity:0,scale:1.1},animate:{opacity:1,scale:1},transition:{duration:1.5},children:[(0,n.jsxs)(Y.E.div,{className:"relative",whileHover:{scale:1.05},transition:{type:"spring",stiffness:300,damping:20},children:[(0,n.jsx)(Y.E.div,{className:"absolute inset-0 bg-purple-500 rounded-full opacity-30 blur-xl",animate:{scale:[1,1.2,1],rotate:[0,180,360]},transition:{duration:10,repeat:1/0,ease:"linear"}}),(0,n.jsx)("div",{style:{width:"min(80vw, ".concat(60*a,"vh)"),height:"min(".concat(80/a,"vw, 60vh)"),position:"relative"},children:(0,n.jsx)("img",{src:e,alt:"Home Page Image",style:{width:"100%",height:"100%",objectFit:"cover"},className:"rounded-full shadow-2xl z-10 relative"})}),(0,n.jsx)(Y.E.div,{className:"absolute inset-0 rounded-full",style:{background:"linear-gradient(45deg, rgba(168, 85, 247, 0.4) 0%, rgba(168, 85, 247, 0) 70%)",zIndex:20},animate:{rotate:360},transition:{duration:20,repeat:1/0,ease:"linear"}})]}),(0,n.jsx)(Y.E.h1,{className:"mt-8 text-4xl font-bold text-transparent bg-clip-text bg-gradient-to-r from-purple-400 to-pink-600",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5,duration:.8}})]})})},eQ=a(74697),e0=()=>{let[e,t]=(0,o.useState)([]),[a,i]=(0,o.useState)(!1),[s,r]=(0,o.useState)(""),[l,d]=(0,o.useState)([]),[c,p]=(0,o.useState)(!1),[m,y]=(0,o.useState)(null),{authenticated:x,ready:h}=(0,j.sv)(),{wallets:f}=(0,j.rB)(),g=f[0],v=async a=>{a.preventDefault(),p(!0),y(null);try{let a=e.map(e=>e.id),{data:n}=await eN.Z.post("/api/playlist",{playName:s,playArray:a,rentalAdd:g.address});console.log("Playlist created:",n),eC.A.success("Playlist created successfully!"),i(!1),r(""),t([])}catch(e){var n,l;console.error("Error creating playlist:",e),y((null===(l=e.response)||void 0===l?void 0:null===(n=l.data)||void 0===n?void 0:n.message)||"Failed to create playlist. Please try again."),eC.A.error("Failed to create playlist. Please try again.")}finally{p(!1)}},b=async()=>{try{let e=await (null==g?void 0:g.getEthersProvider());if(!e)throw Error("Provider is not available");let t=await e.getSigner();if(!t)throw Error("Signer is not available");let a=new eP.CH(eT,ek,t),n=await a.getWalletPurchasedNFTs(g.address);console.log(n);let i=n.map(e=>a.nftMetadata(e)),s=(await Promise.all(i)).map((e,t)=>({id:t,title:e[3],description:e[4],image:e[5]}));d(s)}catch(e){console.error("Error fetching purchased songs:",e)}};(0,o.useEffect)(()=>{h&&x&&(null==g?void 0:g.address)!==void 0&&b()},[h,x,null==g?void 0:g.address]);let w=e=>{t(t=>t.some(t=>t.id===e.id)?t.filter(t=>t.id!==e.id):[...t,e])};return(0,n.jsxs)(er,{open:a,onOpenChange:e=>i(e),children:[(0,n.jsx)(el,{asChild:!0,children:(0,n.jsx)(Y.E.button,{whileHover:{scale:1.05},whileTap:{scale:.95},className:"bg-primary hover:bg-primary/70 text-white font-bold py-2 px-4 rounded-full shadow-lg",children:"Create Playlist"})}),(0,n.jsxs)(ec,{className:"max-w-md bg-gradient-to-br from-gray-50 to-gray-100",children:[(0,n.jsxs)(ep,{children:[(0,n.jsx)(em,{className:"text-2xl font-bold text-gray-800",children:"Create New Playlist"}),(0,n.jsx)(ey,{className:"text-gray-600",children:"Craft your perfect playlist by adding a name and selecting your favorite tracks."}),(0,n.jsxs)("div",{className:"mt-6 space-y-6",children:[(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("label",{htmlFor:"playlist-name",className:"text-sm font-medium text-gray-700",children:"Playlist Name"}),(0,n.jsx)(ea,{id:"playlist-name",placeholder:"Enter playlist name",value:s,onChange:e=>r(e.target.value),className:"border-gray-300 focus:ring-purple-500 focus:border-purple-500"})]}),m&&(0,n.jsx)("div",{className:"text-red-500 text-sm mt-2",children:m}),(0,n.jsxs)("div",{className:"space-y-2",children:[(0,n.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Select Audio Tracks:"}),(0,n.jsx)("div",{className:"max-h-48 overflow-y-auto overflow-x-hidden border border-gray-200 rounded-md bg-white",children:l.map(t=>(0,n.jsxs)(Y.E.div,{className:"flex items-center p-3 cursor-pointer ".concat(e.some(e=>e.id===t.id)?"bg-purple-100":"hover:bg-gray-50"),onClick:()=>w(t),whileHover:{scale:1.02},whileTap:{scale:.98},children:[(0,n.jsx)("img",{src:t.image,alt:t.title,className:"w-12 h-12 object-cover rounded-md mr-3"}),(0,n.jsxs)("div",{className:"flex-grow",children:[(0,n.jsx)("h3",{className:"text-sm font-medium text-gray-800",children:t.title}),(0,n.jsx)("p",{className:"text-xs text-gray-500",children:t.description})]}),e.some(e=>e.id===t.id)&&(0,n.jsx)(S.Z,{className:"h-5 w-5 text-purple-500 ml-2"})]},t.id))})]}),(0,n.jsx)(q.M,{children:e.length>0&&(0,n.jsxs)(Y.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:-20},className:"space-y-2 max-h-24 overflow-y-auto",children:[(0,n.jsx)("h4",{className:"text-sm font-medium text-gray-700",children:"Selected Tracks:"}),(0,n.jsx)("div",{className:"flex flex-wrap gap-2",children:e.map(e=>(0,n.jsxs)(Y.E.div,{className:"bg-purple-100 text-purple-800 text-sm font-medium px-3 py-1 rounded-full flex items-center",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},children:[e.title,(0,n.jsx)(eQ.Z,{className:"h-4 w-4 ml-2 cursor-pointer text-purple-600 hover:text-purple-800",onClick:t=>{t.stopPropagation(),w(e)}})]},e.id))})]})})]})]}),(0,n.jsxs)(eu,{children:[(0,n.jsx)(eh,{className:"bg-gray-200 text-gray-800 hover:bg-gray-300",children:"Cancel"}),(0,n.jsx)(ex,{className:"bg-gradient-to-r from-purple-500 to-pink-500 text-white hover:from-purple-600 hover:to-pink-600",disabled:!s||0===e.length,onClick:v,children:c?(0,n.jsx)(n.Fragment,{children:(0,n.jsx)(u.Z,{className:"animate-spin text-white w-20"})}):"Create Playlist"})]})]})]})},e2=a(40933),e1=a(51077),e5=a(97334),e6=a.n(e5);let e3=e=>{let{song:t,isPlaying:a,onPlay:i}=e;return(0,n.jsxs)(Y.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},className:"bg-white rounded-lg shadow-md overflow-hidden flex items-center p-4 mb-4 hover:shadow-lg transition-shadow duration-300",children:[(0,n.jsx)("img",{src:t.imageUrl,alt:t.name,className:"w-16 h-16 rounded-md object-cover mr-4"}),(0,n.jsxs)("div",{className:"flex-grow",children:[(0,n.jsx)("h3",{className:"text-lg font-semibold mb-1",children:t.name}),(0,n.jsx)("p",{className:"text-sm text-gray-600 line-clamp-1",children:t.description})]}),(0,n.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,n.jsxs)("div",{className:"text-right",children:[(0,n.jsxs)("p",{className:"text-sm text-gray-500 flex items-center",children:[(0,n.jsx)(e2.Z,{className:"w-4 h-4 mr-1"})," ",t.rentDuration.toString()," ","days"]}),(0,n.jsxs)("p",{className:"text-sm text-gray-500 flex items-center",children:[(0,n.jsx)(e1.Z,{className:"w-4 h-4 mr-1"})," ",eY.dF(t.price)," MSX"]})]}),(0,n.jsx)(L,{onClick:()=>i(t.cid,t),size:"sm",variant:a?"default":"outline",className:"min-w-[40px]",children:a?(0,n.jsx)(s.Z,{className:"h-4 w-4"}):(0,n.jsx)(eB.Z,{className:"h-4 w-4"})})]})]})};var e4=()=>{let{ready:e,authenticated:t}=(0,j.sv)(),{wallets:a}=(0,j.rB)(),i=a[0],[s,r]=(0,o.useState)(null),[l,d]=(0,o.useState)([]),[c,p]=(0,o.useState)(null),u=async e=>{try{let t=await (null==i?void 0:i.getEthersProvider());if(!t)throw Error("Provider is not available");let a=await t.getSigner();if(!a)throw Error("Signer is not available");let n=new eP.CH(eT,ek,a),s=e.map(async e=>{let t=await n.getNFTMetadata(e);return{tokenId:e,price:t[0],name:t[3],description:t[4],imageUrl:t[5],rentPrice:t[8],rentDuration:t[9],owner:t[10],cid:t[12].toString()}}),r=await Promise.all(s);d(r)}catch(e){console.error("Error fetching metadata:",e)}},m=async()=>{try{let{data:e}=await eN.Z.get("/api/getPlaylist/".concat(i.address));if(console.log("Playlist data:",e),r(e),e.playlistame&&e.playlistame.length>0){let t=e.playlistame[0],a=e.Randomsalt;console.log("Sending to backend:",{playlistName:t,random:a});try{let e=await eN.Z.post("/api/getSound",e6().stringify({random:a,playName:t}),{headers:{"Content-Type":"application/x-www-form-urlencoded"}});if(console.log("Response from getSound:",e.data),e.data.playlistData){let t=e.data.playlistData.split(",").map(Number);await u(t)}}catch(e){console.error("Error sending data:",e)}}else console.log("No playlists found")}catch(e){console.error("Error fetching playlist:",e)}},y=(0,eL.I0)(),x=(e,t)=>{console.log(e);let a=Number(e);console.log(a),console.log(t),y((0,eZ.SK)({uri:"/api/hashsong/".concat(a),isPlaying:!0,index:0,coverImage:t.imageUrl,title:t.name,artist:t.description}))};return((0,o.useEffect)(()=>{e&&t&&(null==i?void 0:i.address)!==void 0&&m()},[i,e,t]),e&&t&&(null==i?void 0:i.address)!==void 0)?(0,n.jsxs)(Y.E.div,{className:"w-full flex flex-col gap-6 pb-32 h-[85vh] overflow-y-auto scrollbar-hide",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},initial:"hidden",animate:"visible",children:[(0,n.jsx)(Y.E.div,{className:"mt-10 scroll-m-20 border-b pb-4 text-3xl font-semibold tracking-tight transition-colors first:mt-0 w-full flex items-center justify-between sticky top-0 z-50 bg-background",variants:{hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{type:"spring",stiffness:300,damping:24}}},children:s&&s.playlistame&&s.playlistame.length>0?s.playlistame[0]:"Your Playlist"}),(0,n.jsx)("div",{className:"container mx-auto px-4 py-8 max-w-3xl",children:(0,n.jsx)(Y.E.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5},children:s&&s.playlistame&&s.playlistame.length>0?(0,n.jsx)("div",{children:l.length>0?(0,n.jsx)("div",{className:"space-y-4",children:l.map(e=>(0,n.jsx)(e3,{song:e,isPlaying:c===e.tokenId,onPlay:x},e.tokenId))}):(0,n.jsx)("p",{className:"text-xl text-center text-gray-600",children:"No tracks in this playlist yet."})}):(0,n.jsxs)("div",{className:"text-center",children:[(0,n.jsx)("h2",{className:"text-3xl font-bold mb-4",children:"No Playlists Yet"}),(0,n.jsx)("p",{className:"text-xl text-gray-600 mb-4",children:"Create your first playlist to get started!"}),(0,n.jsx)("p",{className:"mb-8 max-w-md mx-auto text-gray-500",children:"Note: you can only create playlist when you have at least one track purchased."}),(0,n.jsx)(e0,{})]})})})]}):(0,n.jsx)("div",{children:"Loading..."})},e8=()=>{let[e,t]=(0,o.useState)([]),[a,i]=(0,o.useState)(!0),[r,l]=(0,o.useState)(null),[d,c]=(0,o.useState)({}),{authenticated:p,ready:m}=(0,j.sv)(),{wallets:y}=(0,j.rB)(),x=y[0],h=(0,eL.I0)(),f=async()=>{try{let e=await (null==x?void 0:x.getEthersProvider());if(!e)throw Error("Provider is not available");let a=await e.getSigner();if(!a)throw Error("Signer is not available");let n=new eP.CH(eT,ek,a),i=await n.getWalletPurchasedNFTs(x.address),s=i.map(e=>n.nftMetadata(e)),r=(await Promise.all(s)).map((e,t)=>({id:i[t].toString(),tokenId:e[2],title:e[3],description:e[4],image:e[5],price:e[0],rentPrice:e[8],rentDuration:e[9],owner:e[10],cid:e[12].toString()}));t(r)}catch(e){console.error("Error fetching purchased songs:",e),eC.A.error("Failed to fetch purchased songs. Please try again.")}finally{i(!1)}};(0,o.useEffect)(()=>{m&&p&&(null==x?void 0:x.address)&&f()},[m,p,null==x?void 0:x.address]);let g=e=>{let t=Number(e.cid);console.log(t),h((0,eZ.SK)({uri:"/api/hashsong/".concat(t),isPlaying:!0,index:0,coverImage:e.image,title:e.title,artist:e.description})),l(r===e.id?null:e.id)};return m&&p&&(null==x?void 0:x.address)?(0,n.jsxs)(Y.E.div,{className:"w-full flex flex-col gap-6 pb-32 h-[85vh] overflow-y-auto scrollbar-hide",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},initial:"hidden",animate:"visible",children:[(0,n.jsx)(Y.E.div,{className:"mt-10 scroll-m-20 mb-6 border-b pb-4 text-3xl font-semibold tracking-tight transition-colors first:mt-0 w-full flex items-center justify-between sticky top-0 z-50 bg-background",variants:{hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{type:"spring",stiffness:300,damping:24}}},children:"Your Purchased Songs"}),a?(0,n.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,n.jsx)(u.Z,{className:"animate-spin text-purple-500 w-8 h-8"})}):e.length>0?(0,n.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 p-6",children:e.map(e=>(0,n.jsxs)(Y.E.div,{className:"bg-white rounded-xl border overflow-hidden hover:shadow-xl transition-all duration-300",whileHover:{y:-5,scale:1.02},children:[(0,n.jsxs)("div",{className:"aspect-w-1 aspect-h-1 relative",children:[!d[e.id]&&(0,n.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-100",children:(0,n.jsx)(u.Z,{className:"animate-spin text-purple-500 w-10 h-10"})}),console.log(e),(0,n.jsx)("img",{src:e.image,alt:e.title,className:"w-full h-full object-cover aspect-square transition-opacity duration-300 ".concat(d[e.id]?"opacity-100":"opacity-0"),onLoad:()=>c(t=>({...t,[e.id]:!0})),onError:t=>{console.error("Image load error:",t),t.target.onerror=null,t.target.src="/path/to/default-image.jpg",c(t=>({...t,[e.id]:!0}))}})]}),(0,n.jsxs)("div",{className:"p-3",children:[(0,n.jsx)("h3",{className:"text-xl font-bold text-gray-800 mb-1 truncate",children:e.title}),(0,n.jsx)("p",{className:"text-gray-600 text-sm mb-4 line-clamp-2",children:e.description}),(0,n.jsxs)("div",{className:"flex items-center justify-between",children:[(0,n.jsx)("span",{className:"text-sm text-purple-600 font-medium",children:T(e.owner,4,4)||"Unknown Artist"}),(0,n.jsx)(L,{onClick:()=>g(e),size:"sm",variant:r===e.id?"default":"outline",className:"rounded-full hover:bg-purple-100 hover:text-black transition-colors",children:r===e.id?(0,n.jsx)(s.Z,{className:"h-5 w-5 text-white"}):(0,n.jsx)(eB.Z,{className:"h-5 w-5 text-purple-700"})})]})]})]},e.id))}):(0,n.jsxs)("div",{className:"text-center text-gray-600",children:[(0,n.jsx)(_.Z,{className:"mx-auto text-gray-400 w-16 h-16 mb-4"}),(0,n.jsx)("p",{className:"text-xl",children:"You haven't purchased any songs yet."})]})]}):(0,n.jsx)("div",{className:"flex justify-center items-center h-64",children:(0,n.jsx)(u.Z,{className:"animate-spin text-purple-500 w-8 h-8"})})};function e9(e){let{w0:t,selectedMode:a,setSelectedMode:i,selectedLayout:s,setSelectedLayout:r}=e,{authenticated:l,ready:d}=(0,j.sv)(),p=(0,eL.I0)(),[u,y]=(0,o.useState)(0),x=(0,eL.v9)(e=>e.musicPlayer),[h,f]=(0,o.useState)(0),[g,N]=(0,o.useState)(!0),[T,k]=(0,o.useState)([]),E=async e=>{N(!0);try{let a=await (null==t?void 0:t.getEthersProvider());if(!a)throw Error("Provider is not available");let n=await a.getSigner();if(!n)throw Error("Signer is not available");let i=new eP.CH(eE,eS,n),s=await i.balanceOf(e);f(s.toString())}catch(e){console.error("Error fetching MusicX balance:",e),f(0)}finally{N(!1)}},S=async()=>{try{let e=await (null==t?void 0:t.getEthersProvider());if(!e)throw Error("Provider is not available");let a=await e.getSigner();if(!a)throw Error("Signer is not available");let n=new eP.CH(eT,ek,a);console.log("hdbs");let i=await n.getWalletPurchasedNFTs(t.address),s=i.map(e=>n.nftMetadata(e));console.log(s);let r=(await Promise.all(s)).map((e,t)=>({id:i[t].toString(),title:e[3],description:e[4],image:e[5],cid:e[12].toString()}));k(r)}catch(e){console.error("Error fetching purchased songs:",e)}};(0,o.useEffect)(()=>{d&&l&&(null==t?void 0:t.address)!==void 0&&(console.log("Wallet Address: ",t.address),E(t.address),S())},[t,d,l,a]);let P=e=>{let{title:t,artist:a,soundUri:n,cover:i}=e;p((0,eZ.SK)({uri:n,isPlaying:!0,index:0,coverImage:i,title:t,artist:a}))},C=[{name:"Home",icon:K.In4},{name:"Explore",icon:J.Mam},{name:"Profile",icon:X.Z},{name:"Playlist",icon:eb.Dk$},{name:"My Songs",icon:_.Z}],R=e=>{r(e.toLowerCase())};return(0,n.jsxs)(v,{direction:"horizontal",children:[(0,n.jsxs)(b,{defaultSize:50,children:[(0,n.jsxs)(Y.E.div,{className:"w-full p-6 dark:bg-muted/10 bg-muted border-b flex items-center justify-between",initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},children:[(0,n.jsx)(Y.E.div,{className:"flex items-center gap-3",initial:{x:-20,opacity:0},animate:{x:0,opacity:1},transition:{delay:.2},children:(0,n.jsx)("p",{className:"",children:"OwnSound"})}),(0,n.jsx)(q.M,{mode:"wait",children:g?(0,n.jsx)(Y.E.div,{className:"grid items-center justify-end",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3},children:(0,n.jsx)("div",{className:"flex",children:(0,n.jsx)(m,{noWidth:!0})})},"loader"):h<=0?(0,n.jsx)(Y.E.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3},children:(0,n.jsx)(e_,{})},"contact"):(0,n.jsxs)(Y.E.div,{className:"flex items-center gap-2 font-semibold text-primary",initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.3},children:[(0,n.jsx)(Y.E.p,{className:"text-primary",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},children:"0"===h?"0":h.slice(0,-18)}),(0,n.jsx)(Y.E.div,{initial:{scale:0},animate:{scale:1},transition:{delay:.4,type:"spring",stiffness:200},children:(0,n.jsx)(I.default,{src:"/icons/token-coin.svg",width:25,height:25,alt:"coin"})})]},"balance")})]}),(0,n.jsx)(Y.E.div,{className:"flex flex-col space-y-6 p-4 mt-4",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5,staggerChildren:.1},children:C.map((e,t)=>{let a=e.icon;return(0,n.jsxs)(Y.E.div,{className:"flex items-center space-x-2 cursor-pointer transition-transform transform ".concat(s===e.name.toLowerCase()?"text-primary":"text-muted-foreground"),onClick:()=>R(e.name),initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.6+.1*t},whileHover:{scale:1.05},whileTap:{scale:.95},children:[(0,n.jsx)(a,{className:"h-6 w-6"}),(0,n.jsx)("span",{children:e.name})]},e.name)})})]}),(0,n.jsx)(w,{}),(0,n.jsx)(b,{defaultSize:120,children:(0,n.jsxs)("div",{className:"p-6",children:["home"===s&&(0,n.jsx)("div",{className:"mt-10",children:(0,n.jsx)(e$,{})}),"song"===s&&(0,n.jsx)("div",{className:"h-full flex items-center justify-center mt-10",children:(0,n.jsx)("img",{src:x.coverImage||"/nft.avif",width:600,height:600,className:"rounded-lg drop-shadow-md aspect-square"})}),"profile"===s&&(0,n.jsx)(eU,{}),"explore"===s&&(0,n.jsx)(eG,{setSelectedLayout:r,w0:t}),s.includes("view-song")&&(0,n.jsx)(eX,{selectedLayout:s,setSelectedLayout:r,getMusicXTokenBalance:E}),"playlist"===s&&(0,n.jsx)(e4,{selectedLayout:s,setSelectedLayout:r}),"my songs"===s&&(0,n.jsx)(e8,{selectedLayout:s,setSelectedLayout:r})]})}),(0,n.jsx)(w,{}),(0,n.jsx)(b,{defaultSize:50,children:(0,n.jsx)(v,{direction:"vertical",children:(0,n.jsxs)(b,{defaultSize:75,children:[(0,n.jsx)(H,{w0:t}),(0,n.jsxs)("div",{className:"p-6 flex items-center gap-4",children:[(0,n.jsx)(G,{className:"songs"===a?"bg-primary text-white cursor-pointer":"bg-transparent text-foreground hover:bg-muted cursor-pointer",onClick:()=>i("songs"),children:"Songs"}),(0,n.jsx)(G,{className:"playlists"===a?"bg-primary text-white cursor-pointer":"bg-transparent text-foreground hover:bg-muted cursor-pointer",onClick:()=>i("playlists"),children:"Playlists"})]}),(0,n.jsx)("div",{className:"h-[85vh] overflow-y-auto scrollbar-hide",children:"playlists"===a?(0,n.jsx)(e7,{playlists:c,clickedIdx:u,handleSelectedMusicPlay:P,setClickedIdx:y}):(0,n.jsx)(te,{purchasedSongs:T,clickedIdx:u,handleSelectedMusicPlay:P,setClickedIdx:y})})]})})})]})}let e7=e=>{let{playlists:t,clickedIdx:a,setClickedIdx:r,handleSelectedMusicPlay:l}=e,[d,c]=(0,o.useState)(null),p=e=>{c(e)},u={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},m={hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{type:"spring",stiffness:300,damping:24}}};return(0,n.jsx)(Y.E.div,{className:"px-6",variants:u,initial:"hidden",animate:"visible",children:(0,n.jsx)(q.M,{mode:"wait",children:d?(0,n.jsxs)(Y.E.div,{initial:{opacity:0,x:50},animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{type:"spring",stiffness:300,damping:30},className:"space-y-4",children:[(0,n.jsxs)("div",{className:"flex items-center gap-3 mb-6",children:[(0,n.jsx)(Y.E.div,{whileHover:{scale:1.1},whileTap:{scale:.9},children:(0,n.jsx)(W.Z,{className:"w-4 h-4 cursor-pointer",onClick:()=>c(null)})}),(0,n.jsx)(Y.E.h2,{className:"text-xl font-semibold",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:d.name})]}),(0,n.jsx)(Y.E.div,{variants:u,initial:"hidden",animate:"visible",className:"space-y-4",children:d.tracks.map((e,t)=>(0,n.jsxs)(Y.E.div,{variants:m,whileHover:{scale:1.02},className:"flex w-full items-center justify-between p-4 hover:bg-muted rounded-md border",children:[(0,n.jsxs)("div",{className:"w-full flex items-center gap-4",children:[(0,n.jsx)(Y.E.img,{src:e.cover,alt:e.title,className:"w-12 h-12 rounded-md",whileHover:{scale:1.1},whileTap:{scale:.9}}),(0,n.jsxs)("div",{children:[(0,n.jsx)(Y.E.p,{className:"font-semibold",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:e.title}),(0,n.jsx)(Y.E.p,{className:"text-sm text-gray-500",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},children:e.artist})]})]}),(0,n.jsx)("div",{className:"grid place-items-center",children:(0,n.jsx)(Y.E.div,{className:"rounded-full p-1.5 bg-primary cursor-pointer",whileHover:{scale:1.1},whileTap:{scale:.9},onClick:()=>{l(t),r(t)},children:(0,n.jsx)(q.M,{mode:"wait",children:a===t?(0,n.jsx)(Y.E.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},children:(0,n.jsx)(s.Z,{className:"w-3 h-3 text-white"})},"pause"):(0,n.jsx)(Y.E.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},children:(0,n.jsx)(i.Z,{className:"w-3 h-3 text-white"})},"play")})})})]},t))})]},"playlist"):(0,n.jsx)(Y.E.div,{variants:u,className:"space-y-4",children:t.map((e,t)=>(0,n.jsx)(Y.E.div,{variants:m,whileHover:{scale:1.02},className:"flex w-full items-center justify-between p-4 hover:bg-muted rounded-md border cursor-pointer",onClick:()=>p(e),children:(0,n.jsxs)("div",{className:"w-full flex items-center gap-4",children:[(0,n.jsx)(Y.E.img,{src:e.image,alt:"cover",className:"w-12 h-12 rounded-md",whileHover:{scale:1.1},whileTap:{scale:.9}}),(0,n.jsxs)("div",{children:[(0,n.jsx)(Y.E.p,{className:"font-semibold",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:e.name}),(0,n.jsxs)(Y.E.p,{className:"text-sm text-gray-500",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},children:[e.tracks.length," songs"]})]})]})},t))},"playlists")})})},te=e=>{let{purchasedSongs:t,clickedIdx:a,setClickedIdx:r,handleSelectedMusicPlay:l}=e;console.log(t);let o={hidden:{y:20,opacity:0},visible:{y:0,opacity:1,transition:{type:"spring",stiffness:300,damping:24}}};return(0,n.jsx)(Y.E.div,{className:"px-6 space-y-4",variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1}}},initial:"hidden",animate:"visible",children:t.length>0?t.map((e,t)=>(0,n.jsxs)(Y.E.div,{variants:o,whileHover:{scale:1.02},className:"flex w-full items-center justify-between p-4 hover:bg-muted rounded-md border",children:[(0,n.jsxs)("div",{className:"w-full flex items-center gap-4",children:[(0,n.jsx)(Y.E.img,{src:e.image,alt:e.title,className:"w-12 h-12 rounded-md object-cover",whileHover:{scale:1.1},whileTap:{scale:.9}}),(0,n.jsxs)("div",{children:[(0,n.jsx)(Y.E.p,{className:"font-semibold",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:e.title}),(0,n.jsx)(Y.E.p,{className:"text-sm text-gray-500",initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},children:e.description})]})]}),(0,n.jsx)("div",{className:"grid place-items-center",children:(0,n.jsx)(Y.E.div,{className:"rounded-full p-1.5 bg-primary cursor-pointer",whileHover:{scale:1.1},whileTap:{scale:.9},onClick:()=>{l({title:e.title,artist:e.description,soundUri:"/api/hashsong/".concat(Number(e.cid)),cover:e.image}),r(t)},children:(0,n.jsx)(q.M,{mode:"wait",children:a===t?(0,n.jsx)(Y.E.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},children:(0,n.jsx)(s.Z,{className:"w-3 h-3 text-white"})},"pause"):(0,n.jsx)(Y.E.div,{initial:{scale:0},animate:{scale:1},exit:{scale:0},children:(0,n.jsx)(i.Z,{className:"w-3 h-3 text-white"})},"play")})})})]},e.id)):(0,n.jsx)(Y.E.div,{variants:o,className:"text-center text-gray-500 py-8",children:"No purchased songs found."})})};var tt=a(87138),ta=()=>{let e=(0,eL.v9)(e=>e.musicPlayer),[t,a]=(0,o.useState)("home"),[i,s]=(0,o.useState)("songs"),{ready:r,authenticated:l,login:d}=(0,j.sv)(),{wallets:c}=(0,j.rB)(),u=c[0];return r?l?(0,n.jsxs)("div",{className:"h-screen",children:[(0,n.jsx)(e9,{w0:u,musicPlayer:e,selectedMode:i,setSelectedMode:s,selectedLayout:t,setSelectedLayout:a}),(0,n.jsxs)(Y.E.div,{initial:{y:100,opacity:0},animate:{y:0,opacity:1},exit:{y:100,opacity:0},transition:{type:"spring",stiffness:300,damping:30},className:"fixed w-full bottom-0 border-t p-4 bg-background backdrop-blur-xl grid grid-cols-3",children:[(0,n.jsx)(q.M,{children:(0,n.jsxs)(Y.E.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},transition:{duration:.3},className:"flex gap-3 items-center z-50",children:[(0,n.jsx)(Y.E.img,{src:e.coverImage||"/nft.avif",alt:"cover",className:"w-12 h-12 rounded-md",whileHover:{scale:1.1},whileTap:{scale:.9}}),(0,n.jsxs)("div",{children:[(0,n.jsx)(Y.E.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},className:"font-semibold",children:e.title||"Yo! Click on music to play"}),(0,n.jsx)(Y.E.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.3},className:"text-sm",children:e.artist||"Follow Qoneqt on instagram"})]})]})}),(0,n.jsx)(Y.E.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.1},className:"w-[36rem] h-full",children:(0,n.jsx)("div",{children:(0,n.jsx)(p,{url:e.uri,musicPlayer:e})})}),(0,n.jsx)("div",{})]})]}):(0,n.jsxs)("div",{className:"relative flex min-h-screen flex-col items-center justify-center p-3.5",children:[(0,n.jsxs)("main",{className:"flex flex-col items-center gap-y-9",children:[(0,n.jsxs)("div",{className:"max-w-lg space-y-3.5 text-center",children:[(0,n.jsx)("h1",{className:"text-5xl font-semibold tracking-tight md:text-7xl",children:"OwnSound"}),(0,n.jsx)("p",{className:"md:text-balance text-muted-foreground md:text-xl",children:"Encrypted Melodies Unlimited Possibilities. Leveraging MusicX, Polygon, Inco & The Graph."})]}),(0,n.jsx)("div",{className:"flex items-center gap-3.5",children:(0,n.jsx)(L,{onClick:d,children:"Connect Wallet"})})]}),(0,n.jsxs)("footer",{className:"absolute bottom-3.5 mx-auto flex items-center gap-[0.5ch] text-center text-muted-foreground",children:[(0,n.jsx)("span",{children:"Powered by"}),(0,n.jsx)(tt.default,{href:"https://qoneqt.com/",target:"_blank",className:"group flex items-center text-primary font-semibold gap-[0.5ch] underline-offset-4 hover:underline",children:"Qoneqt."})]})]}):(0,n.jsx)("div",{className:"w-full grid items-center justify-center min-h-screen",children:(0,n.jsx)(m,{})})}},99782:function(e,t,a){"use strict";a.d(t,{SK:function(){return l}});let n=(0,a(66862).oM)({name:"musicPlayer",initialState:{uri:"/audio/chin-tapak-dum-dum.mp3",isPlaying:!0,index:0,coverImage:"",title:"",artist:""},reducers:{setUri:(e,t)=>{e.uri=t.payload},setIsPlaying:(e,t)=>{e.isPlaying=t.payload},setIndex:(e,t)=>{e.index=t.payload},setMusicPlayer:(e,t)=>({...e,...t.payload})}}),{setUri:i,setIsPlaying:s,setIndex:r,setMusicPlayer:l}=n.actions;t.ZP=n.reducer}},function(e){e.O(0,[269,764,51,452,505,240,994,614,705,202,112,971,23,744],function(){return e(e.s=84285)}),_N_E=e.O()}]); ================================================ FILE: client/out/_next/static/chunks/dc112a36-9245e58b51327391.js ================================================ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[705],{71451:function(module,exports,__webpack_require__){"undefined"!=typeof navigator&&function(t,e){module.exports=e()}(0,function(){"use strict";var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(t){_useWebWorker=!!t},getWebWorker=function(){return _useWebWorker},setLocationHref=function(t){locationHref=t},getLocationHref=function(){return locationHref};function createTag(t){return document.createElement(t)}function extendPrototype(t,e){var i,s,r=t.length;for(i=0;i1?i[1]=1:i[1]<=0&&(i[1]=0),HSVtoRGB(i[0],i[1],i[2])}function addBrightnessToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[2]+=e,i[2]>1?i[2]=1:i[2]<0&&(i[2]=0),HSVtoRGB(i[0],i[1],i[2])}function addHueToRGB(t,e){var i=RGBtoHSV(255*t[0],255*t[1],255*t[2]);return i[0]+=e/360,i[0]>1?i[0]-=1:i[0]<0&&(i[0]+=1),HSVtoRGB(i[0],i[1],i[2])}var rgbToHex=function(){var t,e,i=[];for(t=0;t<256;t+=1)e=t.toString(16),i[t]=1===e.length?"0"+e:e;return function(t,e,s){return t<0&&(t=0),e<0&&(e=0),s<0&&(s=0),"#"+i[t]+i[e]+i[s]}}(),setSubframeEnabled=function(t){subframeEnabled=!!t},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(t){expressionsPlugin=t},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(t){expressionsInterfaces=t},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(t){defaultCurveSegments=t},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(t){idPrefix$1=t},getIdPrefix=function(){return idPrefix$1};function createNS(t){return document.createElementNS(svgNS,t)}function _typeof$5(t){return(_typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var dataManager=function(){var t,e,i=1,s=[],r={onmessage:function(){},postMessage:function(e){t({data:e})}},a={postMessage:function(t){r.onmessage({data:t})}};function n(e){if(window.Worker&&window.Blob&&getWebWorker()){var i=new Blob(["var _workerSelf = self; self.onmessage = ",e.toString()],{type:"text/javascript"});return new Worker(URL.createObjectURL(i))}return t=e,r}function o(){e||((e=n(function(t){function e(){function t(e,i){var n,o,h,l,p,f,c=e.length;for(o=0;o=0;e-=1)if("sh"===t[e].ty){if(t[e].ks.k.i)a(t[e].ks.k);else for(i=0,s=t[e].ks.k.length;ii[0]||!(i[0]>t[0])&&(t[1]>i[1]||!(i[1]>t[1])&&(t[2]>i[2]||!(i[2]>t[2])&&null))}var o=function(){var t=[4,4,14];function e(t){var e=t.t.d;t.t.d={k:[{s:e,t:0}]}}function i(t){var i,s=t.length;for(i=0;i=0;i-=1)if("sh"===t[i].ty){if(t[i].ks.k.i)t[i].ks.k.c=t[i].closed;else for(s=0,r=t[i].ks.k.length;s500)&&(this._imageLoaded(),clearInterval(i)),e+=1}).bind(this),50)}function a(e){var i=s(e,this.assetsPath,this.path),r=createNS("image");isSafari?this.testImageLoaded(r):r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",(function(){a.img=t,this._imageLoaded()}).bind(this),!1),r.setAttributeNS("http://www.w3.org/1999/xlink","href",i),this._elementHelper.append?this._elementHelper.append(r):this._elementHelper.appendChild(r);var a={img:r,assetData:e};return a}function n(e){var i=s(e,this.assetsPath,this.path),r=createTag("img");r.crossOrigin="anonymous",r.addEventListener("load",this._imageLoaded,!1),r.addEventListener("error",(function(){a.img=t,this._imageLoaded()}).bind(this),!1),r.src=i;var a={img:r,assetData:e};return a}function o(t){var e={assetData:t},i=s(t,this.assetsPath,this.path);return dataManager.loadData(i,(function(t){e.img=t,this._footageLoaded()}).bind(this),(function(){e.img={},this._footageLoaded()}).bind(this)),e}function h(t,e){this.imagesLoadedCb=e;var i,s=t.length;for(i=0;ithis.animationData.op&&(this.animationData.op=t.op,this.totalFrames=Math.floor(t.op-this.animationData.ip));var e,i,s=this.animationData.layers,r=s.length,a=t.layers,n=a.length;for(i=0;ithis.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(t){this.triggerRenderFrameError(t)}},AnimationItem.prototype.play=function(t){(!t||this.name===t)&&!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(t){t&&this.name!==t||!1!==this.isPaused||(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(t){t&&this.name!==t||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(t){t&&this.name!==t||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(t){for(var e,i=0;i=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?e>=this.totalFrames?(this.playCount+=1,this.checkSegments(e%this.totalFrames)||(this.setCurrentRawFrameValue(e%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(e):this.checkSegments(e>this.totalFrames?e%this.totalFrames:0)||(i=!0,e=this.totalFrames-1):e<0?this.checkSegments(e%this.totalFrames)||(this.loop&&!(this.playCount--<=0&&!0!==this.loop)?(this.setCurrentRawFrameValue(this.totalFrames+e%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0):(i=!0,e=0)):this.setCurrentRawFrameValue(e),i&&(this.setCurrentRawFrameValue(e),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(t,e){this.playCount=0,t[1]0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=t[0]-t[1],this.timeCompleted=this.totalFrames,this.firstFrame=t[1],this.setCurrentRawFrameValue(this.totalFrames-.001-e)):t[1]>t[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=t[1]-t[0],this.timeCompleted=this.totalFrames,this.firstFrame=t[0],this.setCurrentRawFrameValue(.001+e)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(t,e){var i=-1;this.isPaused&&(this.currentRawFrame+this.firstFramee&&(i=e-t)),this.firstFrame=t,this.totalFrames=e-t,this.timeCompleted=this.totalFrames,-1!==i&&this.goToAndStop(i,!0)},AnimationItem.prototype.playSegments=function(t,e){if(e&&(this.segments.length=0),"object"===_typeof$4(t[0])){var i,s=t.length;for(i=0;i=0;i-=1)e[i].animation.destroy(t)}function P(t,e,i){var s,r=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=r.length;for(s=0;s0?i=h:e=h;while(Math.abs(o)>a&&++l=r?g(t,p,e,i):0===f?p:d(t,a,a+h,e,i)}},t}(),pooling=function(){return{double:function(t){return t.concat(createSizedArray(t.length))}}}(),poolFactory=function(){return function(t,e,i){var s=0,r=t,a=createSizedArray(r);return{newElement:function(){var t;return s?(s-=1,t=a[s]):t=e(),t},release:function(t){s===r&&(a=pooling.double(a),r*=2),i&&i(t),a[s]=t,s+=1}}}}(),bezierLengthPool=function(){return poolFactory(8,function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})}(),segmentsLengthPool=function(){return poolFactory(8,function(){return{lengths:[],totalLength:0}},function(t){var e,i=t.lengths.length;for(e=0;e-.001&&n<.001}function i(i,s,r,a,n,o,h,l,p){if(0===r&&0===o&&0===p)return e(i,s,a,n,h,l);var f,c=t.sqrt(t.pow(a-i,2)+t.pow(n-s,2)+t.pow(o-r,2)),m=t.sqrt(t.pow(h-i,2)+t.pow(l-s,2)+t.pow(p-r,2)),u=t.sqrt(t.pow(h-a,2)+t.pow(l-n,2)+t.pow(p-o,2));return(f=c>m?c>u?c-m-u:u-m-c:u>m?u-m-c:m-c-u)>-.0001&&f<1e-4}var s=function(){return function(t,e,i,s){var r,a,n,o,h,l,p=getDefaultCurveSegments(),f=0,c=[],m=[],u=bezierLengthPool.newElement();for(r=0,n=i.length;rn?-1:1,l=!0;l;)if(s[a]<=n&&s[a+1]>n?(o=(n-s[a])/(s[a+1]-s[a]),l=!1):a+=h,a<0||a>=r-1){if(a===r-1)return i[a];l=!1}return i[a]+(i[a+1]-i[a])*o}function l(e,i,s,r,a,n){var o=h(a,n),l=1-o;return[t.round((l*l*l*e[0]+(o*l*l+l*o*l+l*l*o)*s[0]+(o*o*l+l*o*o+o*l*o)*r[0]+o*o*o*i[0])*1e3)/1e3,t.round((l*l*l*e[1]+(o*l*l+l*o*l+l*l*o)*s[1]+(o*o*l+l*o*o+o*l*o)*r[1]+o*o*o*i[1])*1e3)/1e3]}var p=createTypedArray("float32",8);return{getSegmentsLength:r,getNewSegment:function(e,i,s,r,a,n,o){a<0?a=0:a>1&&(a=1);var l,f=h(a,o),c=h(n=n>1?1:n,o),m=e.length,u=1-f,d=1-c,g=u*u*u,y=f*u*u*3,v=f*f*u*3,b=f*f*f,x=u*u*d,_=f*u*d+u*f*d+u*u*c,k=f*f*d+u*f*c+f*u*c,C=f*f*c,P=u*d*d,A=f*d*d+u*c*d+u*d*c,w=f*c*d+u*c*c+f*d*c,S=f*c*c,D=d*d*d,T=c*d*d+d*c*d+d*d*c,M=c*c*d+d*c*c+c*d*c,E=c*c*c;for(l=0;l=v.t-o){y.h&&(y=v),h=0;break}if(v.t-o>t){h=l;break}l=c||t=c?u.points.length-1:0;for(x=0,_=u.points[d].point.length;x<_;x+=1)g[x]=u.points[d].point[x]}else{b.__fnct?A=b.__fnct:(A=BezierFactory.getBezierEasing(y.o.x,y.o.y,y.i.x,y.i.y,y.n).get,b.__fnct=A),k=A((t-m)/(c-m));var g,y,v,b,x,_,k,C,P,A,w,S,D=u.segmentLength*k,T=e.lastFrame=T&&D=c?(g[0]=w[0],g[1]=w[1],g[2]=w[2]):t<=m?(g[0]=y.s[0],g[1]=y.s[1],g[2]=y.s[2]):quaternionToEuler(g,slerp(createQuaternion(y.s),createQuaternion(w),(t-m)/(c-m)));else for(l=0;l=c?k=1:t1e-6?(a=Math.sin(s=Math.acos(r)),n=Math.sin((1-i)*s)/a,o=Math.sin(i*s)/a):(n=1-i,o=i),h[0]=n*l+o*m,h[1]=n*p+o*u,h[2]=n*f+o*d,h[3]=n*c+o*g,h}function quaternionToEuler(t,e){var i=e[0],s=e[1],r=e[2],a=e[3],n=Math.atan2(2*s*a-2*i*r,1-2*s*s-2*r*r),o=Math.asin(2*i*s+2*r*a),h=Math.atan2(2*i*a-2*s*r,1-2*i*i-2*r*r);t[0]=n/degToRads,t[1]=o/degToRads,t[2]=h/degToRads}function createQuaternion(t){var e=t[0]*degToRads,i=t[1]*degToRads,s=t[2]*degToRads,r=Math.cos(e/2),a=Math.cos(i/2),n=Math.cos(s/2),o=Math.sin(e/2),h=Math.sin(i/2),l=Math.sin(s/2),p=r*a*n-o*h*l;return[o*h*n+r*a*l,o*a*n+r*h*l,r*h*n-o*a*l,p]}function getValueAtCurrentTime(){var t=this.comp.renderedFrame-this.offsetTime,e=this.keyframes[0].t-this.offsetTime,i=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(t===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=i&&t>=i||this._caching.lastFrame=t&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var s=this.interpolateValue(t,this._caching);this.pv=s}return this._caching.lastFrame=t,this.pv}function setVValue(t){var e;if("unidimensional"===this.propType)e=t*this.mult,mathAbs(this.v-e)>1e-5&&(this.v=e,this._mdf=!0);else for(var i=0,s=this.v.length;i1e-5&&(this.v[i]=e,this._mdf=!0),i+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length){if(this.lock){this.setVValue(this.pv);return}this.lock=!0,this._mdf=this._isFirstFrame;var t,e=this.effectsSequence.length,i=this.kf?this.pv:this.data.k;for(t=0;t=this._maxLength&&this.doubleArrayLength(),i){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}a[s]&&(!a[s]||r)||(a[s]=pointPool.newElement()),a[s][0]=t,a[s][1]=e},ShapePath.prototype.setTripleAt=function(t,e,i,s,r,a,n,o){this.setXYAt(t,e,"v",n,o),this.setXYAt(i,s,"o",n,o),this.setXYAt(r,a,"i",n,o)},ShapePath.prototype.reverse=function(){var t,e=new ShapePath;e.setPathData(this.c,this._length);var i=this.v,s=this.o,r=this.i,a=0;this.c&&(e.setTripleAt(i[0][0],i[0][1],r[0][0],r[0][1],s[0][0],s[0][1],0,!1),a=1);var n=this._length-1,o=this._length;for(t=a;t=r[r.length-1].t-this.offsetTime)a=r[r.length-1].s?r[r.length-1].s[0]:r[r.length-2].e[0],o=!0;else{for(var a,n,o,h,l,p,f,c,m,u,d,g,y,v=s,b=r.length-1,x=!0;x&&(u=r[v],!((d=r[v+1]).t-this.offsetTime>t));)v=d.t-this.offsetTime?c=1:ts&&e>s)||(this._caching.lastIndex=r0||t>-.000001&&t<0?s(t*e)/e:t}function I(){var t=this.props;return"matrix("+F(t[0])+","+F(t[1])+","+F(t[4])+","+F(t[5])+","+F(t[12])+","+F(t[13])+")"}return function(){this.reset=r,this.rotate=a,this.rotateX=n,this.rotateY=o,this.rotateZ=h,this.skew=p,this.skewFromAxis=f,this.shear=l,this.scale=c,this.setTransform=m,this.translate=u,this.transform=d,this.multiply=g,this.applyToPoint=_,this.applyToX=k,this.applyToY=C,this.applyToZ=P,this.applyToPointArray=T,this.applyToTriplePoints=D,this.applyToPointStringified=M,this.toCSS=E,this.to2dCSS=I,this.clone=b,this.cloneFromProps=x,this.equals=v,this.inversePoints=S,this.inversePoint=w,this.getInverseMatrix=A,this._t=this.transform,this.isIdentity=y,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(t){return(_typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}var lottie={},standalone="__[STANDALONE]__",animationData="__[ANIMATIONDATA]__",renderer="";function setLocation(t){setLocationHref(t)}function searchAnimations(){!0===standalone?animationManager.searchAnimations(animationData,standalone,renderer):animationManager.searchAnimations()}function setSubframeRendering(t){setSubframeEnabled(t)}function setPrefix(t){setIdPrefix(t)}function loadAnimation(t){return!0===standalone&&(t.animationData=JSON.parse(animationData)),animationManager.loadAnimation(t)}function setQuality(t){if("string"==typeof t)switch(t){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(t)&&t>1&&setDefaultCurveSegments(t);getDefaultCurveSegments()>=50?roundValues(!1):roundValues(!0)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(t,e){"expressions"===t&&setExpressionsPlugin(e)}function getFactory(t){switch(t){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(t){for(var e=queryString.split("&"),i=0;i=1?o.push({s:t-1,e:e-1}):(o.push({s:t,e:1}),o.push({s:0,e:e-1}));var h=[],l=o.length;for(a=0;as+i||h.push([n.s*r<=s?0:(n.s*r-s)/i,n.e*r>=s+i?1:(n.e*r-s)/i]);return h.length||h.push([0,0]),h},TrimModifier.prototype.releasePathsData=function(t){var e,i=t.length;for(e=0;e1?1+e:this.s.v<0?0+e:this.s.v+e)>(n=this.e.v>1?1+e:this.e.v<0?0+e:this.e.v+e)){var i=a;a=n,n=i}a=1e-4*Math.round(1e4*a),n=1e-4*Math.round(1e4*n),this.sValue=a,this.eValue=n}else a=this.sValue,n=this.eValue;var s=this.shapes.length,r=0;if(n===a)for(h=0;h=0;h-=1)if((u=this.shapes[h]).shape._mdf){for((d=u.localShapeCollection).releaseShapes(),2===this.m&&s>1?(g=this.calculateShapeEdges(a,n,u.totalShapeLength,x,r),x+=u.totalShapeLength):g=[[v,b]],p=g.length,l=0;l=1?y.push({s:u.totalShapeLength*(v-1),e:u.totalShapeLength*(b-1)}):(y.push({s:u.totalShapeLength*v,e:u.totalShapeLength}),y.push({s:0,e:u.totalShapeLength*(b-1)}));var _=this.addShapes(u,y[0]);if(y[0].s!==y[0].e){if(y.length>1){if(u.shape.paths.shapes[u.shape.paths._length-1].c){var k=_.pop();this.addPaths(_,d),_=this.addShapes(u,y[1],k)}else this.addPaths(_,d),_=this.addShapes(u,y[1])}this.addPaths(_,d)}}u.shape.paths=d}}},TrimModifier.prototype.addPaths=function(t,e){var i,s=t.length;for(i=0;ie.e){i.c=!1;break}else e.s<=u&&e.e>=u+n.addedLength?(this.addSegment(c[s].v[r-1],c[s].o[r-1],c[s].i[r],c[s].v[r],i,o,g),g=!1):(l=bez.getNewSegment(c[s].v[r-1],c[s].v[r],c[s].o[r-1],c[s].i[r],(e.s-u)/n.addedLength,(e.e-u)/n.addedLength,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1),u+=n.addedLength,o+=1;if(c[s].c&&h.length){if(n=h[r-1],u<=e.e){var y=h[r-1].addedLength;e.s<=u&&e.e>=u+y?(this.addSegment(c[s].v[r-1],c[s].o[r-1],c[s].i[0],c[s].v[0],i,o,g),g=!1):(l=bez.getNewSegment(c[s].v[r-1],c[s].v[0],c[s].o[r-1],c[s].i[0],(e.s-u)/y,(e.e-u)/y,h[r-1]),this.addSegmentFromArray(l,i,o,g),g=!1,i.c=!1)}else i.c=!1;u+=n.addedLength,o+=1}if(i._length&&(i.setXYAt(i.v[p][0],i.v[p][1],"i",p),i.setXYAt(i.v[i._length-1][0],i.v[i._length-1][1],"o",i._length-1)),u>e.e)break;s=this.p.keyframes[this.p.keyframes.length-1].t?(s=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/i,0),r=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/i,0)):(s=this.p.pv,r=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/i,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){s=[],r=[];var s,r,a=this.px,n=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(s[0]=a.getValueAtTime((a.keyframes[0].t+.01)/i,0),s[1]=n.getValueAtTime((n.keyframes[0].t+.01)/i,0),r[0]=a.getValueAtTime(a.keyframes[0].t/i,0),r[1]=n.getValueAtTime(n.keyframes[0].t/i,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(s[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/i,0),s[1]=n.getValueAtTime(n.keyframes[n.keyframes.length-1].t/i,0),r[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/i,0),r[1]=n.getValueAtTime((n.keyframes[n.keyframes.length-1].t-.01)/i,0)):(s=[a.pv,n.pv],r[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/i,a.offsetTime),r[1]=n.getValueAtTime((n._caching.lastFrame+n.offsetTime-.01)/i,n.offsetTime))}else s=r=t;this.v.rotate(-Math.atan2(s[1]-r[1],s[0]-r[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}}function s(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}}function r(){}function a(t){this._addDynamicProperty(t),this.elem.addDynamicProperty(t),this._isDirty=!0}function n(t,e,i){if(this.elem=t,this.frameId=-1,this.propType="transform",this.data=e,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(i||t),e.p&&e.p.s?(this.px=PropertyFactory.getProp(t,e.p.x,0,0,this),this.py=PropertyFactory.getProp(t,e.p.y,0,0,this),e.p.z&&(this.pz=PropertyFactory.getProp(t,e.p.z,0,0,this))):this.p=PropertyFactory.getProp(t,e.p||{k:[0,0,0]},1,0,this),e.rx){if(this.rx=PropertyFactory.getProp(t,e.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(t,e.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(t,e.rz,0,degToRads,this),e.or.k[0].ti){var s,r=e.or.k.length;for(s=0;s=Math.abs(t)}function lerp(t,e,i){return t*(1-i)+e*i}function lerpPoint(t,e,i){return[lerp(t[0],e[0],i),lerp(t[1],e[1],i)]}function quadRoots(t,e,i){if(0===t)return[];var s=e*e-4*t*i;if(s<0)return[];var r=-e/(2*t);if(0===s)return[r];var a=Math.sqrt(s)/(2*t);return[r-a,r+a]}function polynomialCoefficients(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function singlePoint(t){return new PolynomialBezier(t,t,t,t,!1)}function PolynomialBezier(t,e,i,s,r){r&&pointEqual(t,e)&&(e=lerpPoint(t,s,1/3)),r&&pointEqual(i,s)&&(i=lerpPoint(t,s,2/3));var a=polynomialCoefficients(t[0],e[0],i[0],s[0]),n=polynomialCoefficients(t[1],e[1],i[1],s[1]);this.a=[a[0],n[0]],this.b=[a[1],n[1]],this.c=[a[2],n[2]],this.d=[a[3],n[3]],this.points=[t,e,i,s]}function extrema(t,e){var i=t.points[0][e],s=t.points[t.points.length-1][e];if(i>s){var r=s;s=i,i=r}for(var a=quadRoots(3*t.a[e],2*t.b[e],t.c[e]),n=0;n0&&a[n]<1){var o=t.point(a[n])[e];os&&(s=o)}return{min:i,max:s}}function intersectData(t,e,i){var s=t.boundingBox();return{cx:s.cx,cy:s.cy,width:s.width,height:s.height,bez:t,t:(e+i)/2,t1:e,t2:i}}function splitData(t){var e=t.bez.split(.5);return[intersectData(e[0],t.t1,t.t),intersectData(e[1],t.t,t.t2)]}function boxIntersect(t,e){return 2*Math.abs(t.cx-e.cx)=a||t.width<=s&&t.height<=s&&e.width<=s&&e.height<=s){r.push([t.t,e.t]);return}var n=splitData(t),o=splitData(e);intersectsImpl(n[0],o[0],i+1,s,r,a),intersectsImpl(n[0],o[1],i+1,s,r,a),intersectsImpl(n[1],o[0],i+1,s,r,a),intersectsImpl(n[1],o[1],i+1,s,r,a)}}function crossProduct(t,e){return[t[1]*e[2]-t[2]*e[1],t[2]*e[0]-t[0]*e[2],t[0]*e[1]-t[1]*e[0]]}function lineIntersection(t,e,i,s){var r=[t[0],t[1],1],a=[e[0],e[1],1],n=[i[0],i[1],1],o=[s[0],s[1],1],h=crossProduct(crossProduct(r,a),crossProduct(n,o));return floatZero(h[2])?null:[h[0]/h[2],h[1]/h[2]]}function polarOffset(t,e,i){return[t[0]+Math.cos(e)*i,t[1]-Math.sin(e)*i]}function pointDistance(t,e){return Math.hypot(t[0]-e[0],t[1]-e[1])}function pointEqual(t,e){return floatEqual(t[0],e[0])&&floatEqual(t[1],e[1])}function ZigZagModifier(){}function setPoint(t,e,i,s,r,a,n){var o=i-Math.PI/2,h=i+Math.PI/2,l=e[0]+Math.cos(i)*s*r,p=e[1]-Math.sin(i)*s*r;t.setTripleAt(l,p,l+Math.cos(o)*a,p-Math.sin(o)*a,l+Math.cos(h)*n,p-Math.sin(h)*n,t.length())}function getPerpendicularVector(t,e){var i=[e[0]-t[0],e[1]-t[1]],s=-(.5*Math.PI);return[Math.cos(s)*i[0]-Math.sin(s)*i[1],Math.sin(s)*i[0]+Math.cos(s)*i[1]]}function getProjectingAngle(t,e){var i=0===e?t.length()-1:e-1,s=(e+1)%t.length(),r=getPerpendicularVector(t.v[i],t.v[s]);return Math.atan2(0,1)-Math.atan2(r[1],r[0])}function zigZagCorner(t,e,i,s,r,a,n){var o=getProjectingAngle(e,i),h=e.v[i%e._length],l=e.v[0===i?e._length-1:i-1],p=e.v[(i+1)%e._length],f=2===a?Math.sqrt(Math.pow(h[0]-l[0],2)+Math.pow(h[1]-l[1],2)):0,c=2===a?Math.sqrt(Math.pow(h[0]-p[0],2)+Math.pow(h[1]-p[1],2)):0;setPoint(t,e.v[i%e._length],o,n,s,c/((r+1)*2),f/((r+1)*2),a)}function zigZagSegment(t,e,i,s,r,a){for(var n=0;n1&&e.length>1&&(r=getIntersection(t[0],e[e.length-1])))?[[t[0].split(r[0])[0]],[e[e.length-1].split(r[1])[1]]]:[i,s]}function pruneIntersections(t){for(var e,i=1;i1&&(e=pruneSegmentIntersection(t[t.length-1],t[0]),t[t.length-1]=e[0],t[0]=e[1]),t}function offsetSegmentSplit(t,e){var i,s,r,a,n=t.inflectionPoints();if(0===n.length)return[offsetSegment(t,e)];if(1===n.length||floatEqual(n[1],1))return i=(r=t.split(n[0]))[0],s=r[1],[offsetSegment(i,e),offsetSegment(s,e)];i=(r=t.split(n[0]))[0];var o=(n[1]-n[0])/(1-n[0]);return a=(r=r[1].split(o))[0],s=r[1],[offsetSegment(i,e),offsetSegment(a,e),offsetSegment(s,e)]}function OffsetPathModifier(){}function getFontProperties(t){for(var e=t.fStyle?t.fStyle.split(" "):[],i="normal",s="normal",r=e.length,a=0;a0;)i-=1,this._elements.unshift(e[i]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(t){var e,i=t.length;for(e=0;e0?Math.floor(u):Math.ceil(u),y=this.pMatrix.props,v=this.rMatrix.props,b=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var x=0;if(u>0){for(;xg;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),x-=1;d&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-d,!0),x-=d)}for(r=1===this.data.m?0:this._currentCopies-1,a=1===this.data.m?1:-1,n=this._currentCopies;n;){if(l=(s=(i=this.elemsData[r].it)[i.length-1].transform.mProps.v.props).length,i[i.length-1].transform.mProps._mdf=!0,i[i.length-1].transform.op._mdf=!0,i[i.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(r/(this._currentCopies-1)),0!==x){for((0!==r&&1===a||r!==this._currentCopies-1&&-1===a)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),this.matrix.transform(b[0],b[1],b[2],b[3],b[4],b[5],b[6],b[7],b[8],b[9],b[10],b[11],b[12],b[13],b[14],b[15]),this.matrix.transform(y[0],y[1],y[2],y[3],y[4],y[5],y[6],y[7],y[8],y[9],y[10],y[11],y[12],y[13],y[14],y[15]),h=0;h0&&s<1?[e]:[]:[e-s,e+s].filter(function(t){return t>0&&t<1})},PolynomialBezier.prototype.split=function(t){if(t<=0)return[singlePoint(this.points[0]),this];if(t>=1)return[this,singlePoint(this.points[this.points.length-1])];var e=lerpPoint(this.points[0],this.points[1],t),i=lerpPoint(this.points[1],this.points[2],t),s=lerpPoint(this.points[2],this.points[3],t),r=lerpPoint(e,i,t),a=lerpPoint(i,s,t),n=lerpPoint(r,a,t);return[new PolynomialBezier(this.points[0],e,r,n,!0),new PolynomialBezier(n,a,s,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var t=this.bounds();return{left:t.x.min,right:t.x.max,top:t.y.min,bottom:t.y.max,width:t.x.max-t.x.min,height:t.y.max-t.y.min,cx:(t.x.max+t.x.min)/2,cy:(t.y.max+t.y.min)/2}},PolynomialBezier.prototype.intersections=function(t,e,i){void 0===e&&(e=2),void 0===i&&(i=7);var s=[];return intersectsImpl(intersectData(this,0,1),intersectData(t,0,1),0,e,s,i),s},PolynomialBezier.shapeSegment=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[e],t.o[e],t.i[i],t.v[i],!0)},PolynomialBezier.shapeSegmentInverted=function(t,e){var i=(e+1)%t.length();return new PolynomialBezier(t.v[i],t.i[i],t.o[e],t.v[e],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(t,e){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(t,e.s,0,null,this),this.frequency=PropertyFactory.getProp(t,e.r,0,null,this),this.pointsType=PropertyFactory.getProp(t,e.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(t,e,i,s){var r=t._length,a=shapePool.newElement();if(a.c=t.c,t.c||(r-=1),0===r)return a;var n=-1,o=PolynomialBezier.shapeSegment(t,0);zigZagCorner(a,t,0,e,i,s,n);for(var h=0;h=0;r-=1)n=PolynomialBezier.shapeSegmentInverted(t,r),l.push(offsetSegmentSplit(n,e));l=pruneIntersections(l);var p=null,f=null;for(r=0;r0&&(h=!1),h){var l=createTag("style");l.setAttribute("f-forigin",i[a].fOrigin),l.setAttribute("f-origin",i[a].origin),l.setAttribute("f-family",i[a].fFamily),l.type="text/css",l.innerText="@font-face {font-family: "+i[a].fFamily+"; font-style: normal; src: url('"+i[a].fPath+"');}",e.appendChild(l)}}else if("g"===i[a].fOrigin||1===i[a].origin){for(o=0,n=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]');o=55296&&i<=56319){var s=t.charCodeAt(1);s>=56320&&s<=57343&&(e=(i-55296)*1024+s-56320+65536)}return e}function k(t,e){var i=t.toString(16)+e.toString(16);return -1!==f.indexOf(i)}function C(t){return t===h}function P(t){return t===o}function A(t){var e=_(t);return e>=l&&e<=p}function w(t){return A(t.substr(0,2))&&A(t.substr(2,2))}function S(t){return -1!==i.indexOf(t)}function D(t,e){var i=_(t.substr(e,2));if(i!==s)return!1;var o=0;for(e+=2;o<5;){if((i=_(t.substr(e,2)))n)return!1;o+=1,e+=2}return _(t.substr(e,2))===r}function T(){this.isLoaded=!0}var M=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};M.isModifier=k,M.isZeroWidthJoiner=C,M.isFlagEmoji=w,M.isRegionalCode=A,M.isCombinedCharacter=S,M.isRegionalFlag=D,M.isVariationSelector=P,M.BLACK_FLAG_CODE_POINT=s;var E={addChars:y,addFonts:g,getCharData:v,getFontByName:x,measureText:b,checkLoadedFonts:u,setIsLoaded:T};return M.prototype=E,M}();function SlotManager(t){this.animationData=t}function slotFactory(t){return new SlotManager(t)}function RenderableElement(){}SlotManager.prototype.getProp=function(t){return this.animationData.slots&&this.animationData.slots[t.sid]?Object.assign(t,this.animationData.slots[t.sid].p):t},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(t){-1===this.renderableComponents.indexOf(t)&&this.renderableComponents.push(t)},removeRenderableComponent:function(t){-1!==this.renderableComponents.indexOf(t)&&this.renderableComponents.splice(this.renderableComponents.indexOf(t),1)},prepareRenderableFrame:function(t){this.checkLayerLimits(t)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(t){this.data.ip-this.data.st<=t&&this.data.op-this.data.st>t?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var t,e=this.renderableComponents.length;for(t=0;t.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(t){this.audio.rate(t)},AudioElement.prototype.volume=function(t){this._volumeMultiplier=t,this._previousVolume=t*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(t){var e,i,s=this.layers.length;for(this.completeLayers=!0,e=s-1;e>=0;e-=1)!this.elements[e]&&(i=this.layers[e]).ip-i.st<=t-this.layers[e].st&&i.op-i.st>t-this.layers[e].st&&this.buildItem(e),this.completeLayers=!!this.elements[e]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(t){switch(t.ty){case 2:return this.createImage(t);case 0:return this.createComp(t);case 1:return this.createSolid(t);case 3:default:return this.createNull(t);case 4:return this.createShape(t);case 5:return this.createText(t);case 6:return this.createAudio(t);case 13:return this.createCamera(t);case 15:return this.createFootage(t)}},BaseRenderer.prototype.createCamera=function(){throw Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(t){return new AudioElement(t,this.globalData,this)},BaseRenderer.prototype.createFootage=function(t){return new FootageElement(t,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var t,e=this.layers.length;for(t=0;t0&&(this.maskElement.setAttribute("id",h),this.element.maskedElement.setAttribute(p,"url("+getLocationHref()+"#"+h+")"),s.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var t=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:t,localMat:t,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var t,e=this.finalTransform.mat,i=0,s=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;i1&&(a+=" C"+e.o[s-1][0]+","+e.o[s-1][1]+" "+e.i[0][0]+","+e.i[0][1]+" "+e.v[0][0]+","+e.v[0][1]),i.lastPath!==a){var n="";i.elem&&(e.c&&(n=t.inv?this.solidPath+a:a),i.elem.setAttribute("d",n)),i.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var t={};function e(t,e){var i=createNS("filter");return i.setAttribute("id",t),!0!==e&&(i.setAttribute("filterUnits","objectBoundingBox"),i.setAttribute("x","0%"),i.setAttribute("y","0%"),i.setAttribute("width","100%"),i.setAttribute("height","100%")),i}function i(){var t=createNS("feColorMatrix");return t.setAttribute("type","matrix"),t.setAttribute("color-interpolation-filters","sRGB"),t.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),t}return t.createFilter=e,t.createAlphaToLuminanceFilter=i,t}(),featureSupport=function(){var t={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(t.maskType=!1),/firefox/i.test(navigator.userAgent)&&(t.svgLumaHidden=!1),t}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(t){var e,i,s="SourceGraphic",r=t.data.ef?t.data.ef.length:0,a=createElementID(),n=filtersFactory.createFilter(a,!0),o=0;for(e=0,this.filters=[];e=0&&!this.shapeModifiers[t].processShapes(this._isFirstFrame);t-=1);}},searchProcessedElement:function(t){for(var e=this.processedElements,i=0,s=e.length;i.01)return!1;i+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var t=0,e=this.data.k.k.length;t0;)h=s.transformers[u].mProps._mdf||h,m-=1,u-=1;if(h)for(m=g-s.styles[p].lvl,u=s.transformers.length-1;m>0;)c.multiply(s.transformers[u].mProps.v),m-=1,u-=1}else c=t;if(n=(f=s.sh.paths)._length,h){for(a=0,o="";a=1?v=.99:v<=-1&&(v=-.99);var b=o*v,x=Math.cos(y+e.a.v)*b+p[0],_=Math.sin(y+e.a.v)*b+p[1];h.setAttribute("fx",x),h.setAttribute("fy",_),l&&!e.g._collapsable&&(e.of.setAttribute("fx",x),e.of.setAttribute("fy",_))}}function h(t,e,i){var s=e.style,r=e.d;r&&(r._mdf||i)&&r.dashStr&&(s.pElem.setAttribute("stroke-dasharray",r.dashStr),s.pElem.setAttribute("stroke-dashoffset",r.dashoffset[0])),e.c&&(e.c._mdf||i)&&s.pElem.setAttribute("stroke","rgb("+bmFloor(e.c.v[0])+","+bmFloor(e.c.v[1])+","+bmFloor(e.c.v[2])+")"),(e.o._mdf||i)&&s.pElem.setAttribute("stroke-opacity",e.o.v),(e.w._mdf||i)&&(s.pElem.setAttribute("stroke-width",e.w.v),s.msElem&&s.msElem.setAttribute("stroke-width",e.w.v))}return{createRenderFunction:function(t){switch(t.ty){case"fl":return a;case"gf":return o;case"gs":return n;case"st":return h;case"sh":case"el":case"rc":case"sr":return r;case"tr":return i;case"no":return s;default:return null}}}}();function SVGShapeElement(t,e,i){this.shapes=[],this.shapesData=t.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(t,e,i),this.prevViewData=[]}function LetterProps(t,e,i,s,r,a){this.o=t,this.sw=e,this.sc=i,this.fc=s,this.m=r,this.p=a,this._mdf={o:!0,sw:!!e,sc:!!i,fc:!!s,m:!0,p:!0}}function TextProperty(t,e){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,e.d&&e.d.sid&&(e.d=t.globalData.slotManager.getProp(e.d)),this.data=e,this.elem=t,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var t,e,i,s,r=this.shapes.length,a=this.stylesList.length,n=[],o=!1;for(i=0;i1&&o&&this.setShapesAsAnimated(n)}},SVGShapeElement.prototype.setShapesAsAnimated=function(t){var e,i=t.length;for(e=0;e=0;o-=1){if((c=this.searchProcessedElement(t[o]))?e[o]=i[c-1]:t[o]._render=n,"fl"===t[o].ty||"st"===t[o].ty||"gf"===t[o].ty||"gs"===t[o].ty||"no"===t[o].ty)c?e[o].style.closed=!1:e[o]=this.createStyleElement(t[o],r),t[o]._render&&e[o].style.pElem.parentNode!==s&&s.appendChild(e[o].style.pElem),d.push(e[o].style);else if("gr"===t[o].ty){if(c)for(h=0,l=e[o].it.length;h1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(t){this.effectsSequence.push(t),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(t){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||t){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var e,i=this.currentData,s=this.keysIndex;if(this.lock){this.setCurrentData(this.currentData);return}this.lock=!0,this._mdf=!1;var r=this.effectsSequence.length,a=t||this.data.d.k[this.keysIndex].s;for(e=0;ee);)i+=1;return this.keysIndex!==i&&(this.keysIndex=i),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(t){for(var e,i,s=[],r=0,a=t.length,n=!1,o=!1,h="";r=55296&&e<=56319?FontManager.isRegionalFlag(t,r)?h=t.substr(r,14):(i=t.charCodeAt(r+1))>=56320&&i<=57343&&(FontManager.isModifier(e,i)?(h=t.substr(r,2),n=!0):h=FontManager.isFlagEmoji(t.substr(r,4))?t.substr(r,4):t.substr(r,2)):e>56319?(i=t.charCodeAt(r+1),FontManager.isVariationSelector(e)&&(n=!0)):FontManager.isZeroWidthJoiner(e)&&(n=!0,o=!0),n?(s[s.length-1]+=h,n=!1):s.push(h),r+=h.length;return s},TextProperty.prototype.completeTextData=function(t){t.__complete=!0;var e=this.elem.globalData.fontManager,i=this.data,s=[],r=0,a=i.m.g,n=0,o=0,h=0,l=[],p=0,f=0,c=e.getFontByName(t.f),m=0,u=getFontProperties(c);t.fWeight=u.weight,t.fStyle=u.style,t.finalSize=t.s,t.finalText=this.buildFinalText(t.t),y=t.finalText.length,t.finalLineHeight=t.lh;var d=t.tr/1e3*t.finalSize;if(t.sz)for(var g,y,v,b,x,_,k,C,P,A,w=!0,S=t.sz[0],D=t.sz[1];w;){A=this.buildFinalText(t.t),P=0,p=0,y=A.length,d=t.tr/1e3*t.finalSize;var T=-1;for(g=0;gS&&" "!==A[g]?(-1===T?y+=1:g=T,P+=t.finalLineHeight||1.2*t.finalSize,A.splice(g,T===g?1:0,"\r"),T=-1,p=0):p+=m+d;P+=c.ascent*t.finalSize/100,this.canResize&&t.finalSize>this.minimumFontSize&&Df?p:f,p=-2*d,b="",v=!0,h+=1):b=I,e.chars?(k=e.getCharData(I,c.fStyle,e.getFontByName(t.f).fFamily),m=v?0:k.w*t.finalSize/100):m=e.measureText(b,t.f,t.finalSize)," "===I?M+=m+d:(p+=m+d+M,M=0),s.push({l:m,an:m,add:n,n:v,anIndexes:[],val:b,line:h,animatorJustifyOffset:0}),2==a){if(n+=m,""===b||" "===b||g===y-1){for((""===b||" "===b)&&(n-=m);o<=g;)s[o].an=n,s[o].ind=r,s[o].extra=m,o+=1;r+=1,n=0}}else if(3==a){if(n+=m,""===b||g===y-1){for(""===b&&(n-=m);o<=g;)s[o].an=n,s[o].ind=r,s[o].extra=m,o+=1;n=0,r+=1}}else s[r].ind=r,s[r].extra=0,r+=1;if(t.l=s,f=p>f?p:f,l.push(p),t.sz)t.boxWidth=t.sz[0],t.justifyOffset=0;else switch(t.boxWidth=f,t.j){case 1:t.justifyOffset=-t.boxWidth;break;case 2:t.justifyOffset=-t.boxWidth/2;break;default:t.justifyOffset=0}t.lineWidths=l;var E=i.a;_=E.length;var F=[];for(x=0;x<_;x+=1){for((L=E[x]).a.sc&&(t.strokeColorAnim=!0),L.a.sw&&(t.strokeWidthAnim=!0),(L.a.fc||L.a.fh||L.a.fs||L.a.fb)&&(t.fillColorAnim=!0),V=0,R=L.s.b,g=0;g0?r=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?n=1-this.xe.v/100:o=1+this.xe.v/100;var h=BezierFactory.getBezierEasing(r,a,n,o).get,l=0,p=this.finalS,f=this.finalE,c=this.data.sh;if(2===c)l=h(l=f===p?s>=f?1:0:t(0,e(.5/(f-p)+(s-p)/(f-p),1)));else if(3===c)l=h(l=f===p?s>=f?0:1:1-t(0,e(.5/(f-p)+(s-p)/(f-p),1)));else if(4===c)f===p?l=0:(l=t(0,e(.5/(f-p)+(s-p)/(f-p),1)))<.5?l*=2:l=1-2*(l-.5),l=h(l);else if(5===c){if(f===p)l=0;else{var m=f-p,u=-m/2+(s=e(t(0,s+.5-p),f-p)),d=m/2;l=Math.sqrt(1-u*u/(d*d))}l=h(l)}else 6===c?l=h(l=f===p?0:(1+Math.cos(Math.PI+2*Math.PI*(s=e(t(0,s+.5-p),f-p))/(f-p)))/2):(s>=i(p)&&(l=s-p<0?t(0,e(e(f,1)-(p-s),1)):t(0,e(f-s,1))),l=h(l));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var y=.5-.5*g;l1&&(l=1)}return l*this.a.v},getValue:function(t){this.iterateDynamicProperties(),this._mdf=t||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,t&&2===this.data.r&&(this.e.v=this._currentTextLength);var e=2===this.data.r?1:100/this.data.totalChars,i=this.o.v/e,s=this.s.v/e+i,r=this.e.v/e+i;if(s>r){var a=s;s=r,r=a}this.finalS=s,this.finalE=r}},extendPrototype([DynamicPropertyContainer],s),{getTextSelectorProp:function(t,e,i){return new s(t,e,i)}}}();function TextAnimatorDataProperty(t,e,i){var s={propType:!1},r=PropertyFactory.getProp,a=e.a;this.a={r:a.r?r(t,a.r,0,degToRads,i):s,rx:a.rx?r(t,a.rx,0,degToRads,i):s,ry:a.ry?r(t,a.ry,0,degToRads,i):s,sk:a.sk?r(t,a.sk,0,degToRads,i):s,sa:a.sa?r(t,a.sa,0,degToRads,i):s,s:a.s?r(t,a.s,1,.01,i):s,a:a.a?r(t,a.a,1,0,i):s,o:a.o?r(t,a.o,0,.01,i):s,p:a.p?r(t,a.p,1,0,i):s,sw:a.sw?r(t,a.sw,0,0,i):s,sc:a.sc?r(t,a.sc,1,0,i):s,fc:a.fc?r(t,a.fc,1,0,i):s,fh:a.fh?r(t,a.fh,0,0,i):s,fs:a.fs?r(t,a.fs,0,.01,i):s,fb:a.fb?r(t,a.fb,0,.01,i):s,t:a.t?r(t,a.t,0,0,i):s},this.s=TextSelectorProp.getTextSelectorProp(t,e.s,i),this.s.t=e.s.t}function TextAnimatorProperty(t,e,i){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=t,this._renderType=e,this._elem=i,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(i)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var t,e,i=this._textData.a.length,s=PropertyFactory.getProp;for(t=0;t=F+to||!O?(q=(F+to-L)/I.partialLength,l=z.point[0]+(I.point[0]-z.point[0])*q,p=z.point[1]+(I.point[1]-z.point[1])*q,C.translate(-x[0]*w[T].an*.005,-(x[1]*X*.01)),B=!1):O&&(L+=I.partialLength,(R+=1)>=O.length&&(R=0,N[V+=1]?O=N[V].points:W.v.c?(R=0,O=N[V=0].points):(L-=I.partialLength,O=null)),O&&(z=I,G=(I=O[R]).partialLength));h=w[T].an/2-w[T].add,C.translate(-h,0,0)}else h=w[T].an/2-w[T].add,C.translate(-h,0,0),C.translate(-x[0]*w[T].an*.005,-x[1]*X*.01,0);for(r=0;rd?this.textSpans[d].span:createNS(a?"g":"text"),m<=d){if(y.setAttribute("stroke-linecap","butt"),y.setAttribute("stroke-linejoin","round"),y.setAttribute("stroke-miterlimit","4"),this.textSpans[d].span=y,a){var u=createNS("g");y.appendChild(u),this.textSpans[d].childSpan=u}this.textSpans[d].span=y,this.layerElement.appendChild(y)}y.style.display="inherit"}if(n.reset(),h&&(r[d].n&&(l=-c,p+=t.yOffset+(f?1:0),f=!1),this.applyTextPropertiesToMatrix(t,n,r[d].line,l,p),l+=(r[d].l||0)+c),a){if(1===(v=this.globalData.fontManager.getCharData(t.finalText[d],e.fStyle,this.globalData.fontManager.getFontByName(t.f).fFamily)).t)b=new SVGCompElement(v.data,this.globalData,this);else{var d,g,y,v,b,x=emptyShapeData;v.data&&v.data.shapes&&(x=this.buildShapeData(v.data,t.finalSize)),b=new SVGShapeElement(x,this.globalData,this)}if(this.textSpans[d].glyph){var _=this.textSpans[d].glyph;this.textSpans[d].childSpan.removeChild(_.layerElement),_.destroy()}this.textSpans[d].glyph=b,b._debug=!0,b.prepareFrame(0),b.renderFrame(),this.textSpans[d].childSpan.appendChild(b.layerElement),1===v.t&&this.textSpans[d].childSpan.setAttribute("transform","scale("+t.finalSize/100+","+t.finalSize/100+")")}else h&&y.setAttribute("transform","translate("+n.props[12]+","+n.props[13]+")"),y.textContent=r[d].val,y.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}h&&y&&y.setAttribute("d",o)}else{var k=this.textContainer,C="start";switch(t.j){case 1:C="end";break;case 2:C="middle";break;default:C="start"}k.setAttribute("text-anchor",C),k.setAttribute("letter-spacing",c);var P=this.buildTextContents(t.finalText);for(d=0,g=P.length,p=t.ps?t.ps[1]+t.ascent:0;d=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].prepareFrame(t-this.layers[e].st);if(this.globalData._mdf)for(e=0;e=0;e-=1)(this.completeLayers||this.elements[e])&&(this.elements[e].prepareFrame(this.renderedFrame-this.layers[e].st),this.elements[e]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var t,e=this.layers.length;for(t=0;t=0;i-=1)t.finalTransform.multiply(t.transforms[i].transform.mProps.v);t._mdf=r},processSequences:function(t){var e,i=this.sequenceList.length;for(e=0;e=1){this.buffers=[];var t=this.globalData.canvasContext,e=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(e);var i=assetLoader.createCanvas(t.canvas.width,t.canvas.height);this.buffers.push(i),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var t=this.globalData;if(t.blendMode!==this.data.bm){t.blendMode=this.data.bm;var e=getBlendMode(this.data.bm);t.canvasContext.globalCompositeOperation=e}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(t){t.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var t=this.buffers[0].getContext("2d");this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var t=this.buffers[1],e=t.getContext("2d");if(this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var i=assetLoader.getLumaCanvas(this.canvasContext.canvas);i.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(i,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(t,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(t){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||t)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var e=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(e),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(e),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(t,e){var i={data:t,type:t.ty,preTransforms:this.transformsManager.addTransformSequence(e),transforms:[],elements:[],closed:!0===t.hd},s={};if("fl"===t.ty||"st"===t.ty?(s.c=PropertyFactory.getProp(this,t.c,1,255,this),s.c.k||(i.co="rgb("+bmFloor(s.c.v[0])+","+bmFloor(s.c.v[1])+","+bmFloor(s.c.v[2])+")")):("gf"===t.ty||"gs"===t.ty)&&(s.s=PropertyFactory.getProp(this,t.s,1,null,this),s.e=PropertyFactory.getProp(this,t.e,1,null,this),s.h=PropertyFactory.getProp(this,t.h||{k:0},0,.01,this),s.a=PropertyFactory.getProp(this,t.a||{k:0},0,degToRads,this),s.g=new GradientProperty(this,t.g,this)),s.o=PropertyFactory.getProp(this,t.o,0,.01,this),"st"===t.ty||"gs"===t.ty){if(i.lc=lineCapEnum[t.lc||2],i.lj=lineJoinEnum[t.lj||2],1==t.lj&&(i.ml=t.ml),s.w=PropertyFactory.getProp(this,t.w,0,null,this),s.w.k||(i.wi=s.w.v),t.d){var r=new DashProperty(this,t.d,"canvas",this);s.d=r,s.d.k||(i.da=s.d.dashArray,i.do=s.d.dashoffset[0])}}else i.r=2===t.r?"evenodd":"nonzero";return this.stylesList.push(i),s.style=i,s},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(t){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,t.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,t,this)}}},CVShapeElement.prototype.createShapeElement=function(t){var e=new CVShapeData(this,t,this.stylesList,this.transformsManager);return this.shapes.push(e),this.addShapeToModifiers(e),e},CVShapeElement.prototype.reloadShapes=function(){this._isFirstFrame=!0;var t,e=this.itemsData.length;for(t=0;t=0;a-=1){if((h=this.searchProcessedElement(t[a]))?e[a]=i[h-1]:t[a]._shouldRender=s,"fl"===t[a].ty||"st"===t[a].ty||"gf"===t[a].ty||"gs"===t[a].ty)h?e[a].style.closed=!1:e[a]=this.createStyleElement(t[a],u),c.push(e[a].style);else if("gr"===t[a].ty){if(h)for(n=0,o=e[a].it.length;n=0;r-=1)"tr"===e[r].ty?(a=i[r].transform,this.renderShapeTransform(t,a)):"sh"===e[r].ty||"el"===e[r].ty||"rc"===e[r].ty||"sr"===e[r].ty?this.renderPath(e[r],i[r]):"fl"===e[r].ty?this.renderFill(e[r],i[r],a):"st"===e[r].ty?this.renderStroke(e[r],i[r],a):"gf"===e[r].ty||"gs"===e[r].ty?this.renderGradientFill(e[r],i[r],a):"gr"===e[r].ty?this.renderShape(a,e[r].it,i[r].it):e[r].ty;s&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(t,e){if(this._isFirstFrame||e._mdf||t.transforms._mdf){var i,s,r,a=t.trNodes,n=e.paths,o=n._length;a.length=0;var h=t.transforms.finalTransform;for(r=0;r=1?f=.99:f<=-1&&(f=-.99);var c=l*f,m=Math.cos(p+e.a.v)*c+o[0],u=Math.sin(p+e.a.v)*c+o[1];r=n.createRadialGradient(m,u,0,o[0],o[1],l)}var d=t.g.p,g=e.g.c,y=1;for(a=0;ao&&"xMidYMid slice"===h||nr&&"meet"===o||ar&&"slice"===o)?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===l&&(ar&&"slice"===o)?this.transformCanvas.tx=(i-this.transformCanvas.w*(s/this.transformCanvas.h))*this.renderConfig.dpr:this.transformCanvas.tx=0,"YMid"===p&&(a>r&&"meet"===o||ar&&"meet"===o||a=0;t-=1)this.elements[t]&&this.elements[t].destroy&&this.elements[t].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(t,e){if((this.renderedFrame!==t||!0!==this.renderConfig.clearCanvas||e)&&!this.destroyed&&-1!==t){this.renderedFrame=t,this.globalData.frameNum=t-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||e,this.globalData.projectInterface.currentFrame=t;var i,s=this.layers.length;for(this.completeLayers||this.checkLayers(t),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].prepareFrame(t-this.layers[i].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),i=s-1;i>=0;i-=1)(this.completeLayers||this.elements[i])&&this.elements[i].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(t){var e=this.elements;if(!e[t]&&99!==this.layers[t].ty){var i=this.createItem(this.layers[t],this,this.globalData);e[t]=i,i.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var t=2*this._length,e=0;for(e=this._length;e=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()},CVCompElement.prototype.destroy=function(){var t;for(t=this.layers.length-1;t>=0;t-=1)this.elements[t]&&this.elements[t].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(t){return new CVCompElement(t,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var t=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var e=this.finalTransform.mat.toCSS();t.transform=e,t.webkitTransform=e}this.finalTransform._opMdf&&(t.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var t;this.data.hasMask?((t=createNS("rect")).setAttribute("width",this.data.sw),t.setAttribute("height",this.data.sh),t.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((t=createTag("div")).style.width=this.data.sw+"px",t.style.height=this.data.sh+"px",t.style.backgroundColor=this.data.sc),this.layerElement.appendChild(t)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var t;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),t=this.svgElement;else{t=createNS("svg");var e=this.comp.data?this.comp.data:this.globalData.compSize;t.setAttribute("width",e.w),t.setAttribute("height",e.h),t.appendChild(this.shapesContainer),this.layerElement.appendChild(t)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=t},HShapeElement.prototype.getTransformedPoint=function(t,e){var i,s=t.length;for(i=0;i0&&o<1&&f[c].push(this.calculateF(o,t,e,i,s,c)):(h=a*a-4*n*r)>=0&&((l=(-a+bmSqrt(h))/(2*r))>0&&l<1&&f[c].push(this.calculateF(l,t,e,i,s,c)),(p=(-a-bmSqrt(h))/(2*r))>0&&p<1&&f[c].push(this.calculateF(p,t,e,i,s,c))));this.shapeBoundingBox.left=bmMin.apply(null,f[0]),this.shapeBoundingBox.top=bmMin.apply(null,f[1]),this.shapeBoundingBox.right=bmMax.apply(null,f[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,f[1])},HShapeElement.prototype.calculateF=function(t,e,i,s,r,a){return bmPow(1-t,3)*e[a]+3*bmPow(1-t,2)*t*i[a]+3*(1-t)*bmPow(t,2)*s[a]+bmPow(t,3)*r[a]},HShapeElement.prototype.calculateBoundingBox=function(t,e){var i,s=t.length;for(i=0;ii&&(i=r)}i*=t.mult}else i=t.v*t.mult;e.x-=i,e.xMax+=i,e.y-=i,e.yMax+=i},HShapeElement.prototype.currentBoxContains=function(t){return this.currentBBox.x<=t.x&&this.currentBBox.y<=t.y&&this.currentBBox.width+this.currentBBox.x>=t.x+t.width&&this.currentBBox.height+this.currentBBox.y>=t.y+t.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var t=this.tempBoundingBox,e=999999;if(t.x=e,t.xMax=-e,t.y=e,t.yMax=-e,this.calculateBoundingBox(this.itemsData,t),t.width=t.xMax=0;i-=1){var e=this.hierarchy[i].finalTransform.mProp;this.mat.translate(-e.p.v[0],-e.p.v[1],e.p.v[2]),this.mat.rotateX(-e.or.v[0]).rotateY(-e.or.v[1]).rotateZ(e.or.v[2]),this.mat.rotateX(-e.rx.v).rotateY(-e.ry.v).rotateZ(e.rz.v),this.mat.scale(1/e.s.v[0],1/e.s.v[1],1/e.s.v[2]),this.mat.translate(e.a.v[0],e.a.v[1],e.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var i,s,r,a=Math.sqrt(Math.pow((r=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]])[0],2)+Math.pow(r[1],2)+Math.pow(r[2],2)),n=[r[0]/a,r[1]/a,r[2]/a],o=Math.sqrt(n[2]*n[2]+n[0]*n[0]),h=Math.atan2(n[1],o),l=Math.atan2(n[0],-n[2]);this.mat.rotateY(l).rotateX(-h)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var p=!this._prevMat.equals(this.mat);if((p||this.pe._mdf)&&this.comp.threeDElements){for(i=0,s=this.comp.threeDElements.length;i=t)return this.threeDElements[e].perspectiveElem;e+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(t,e){var i,s,r=createTag("div");styleDiv(r);var a=createTag("div");if(styleDiv(a),"3d"===e){(i=r.style).width=this.globalData.compSize.w+"px",i.height=this.globalData.compSize.h+"px";var n="50% 50%";i.webkitTransformOrigin=n,i.mozTransformOrigin=n,i.transformOrigin=n;var o="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(s=a.style).transform=o,s.webkitTransform=o}r.appendChild(a);var h={container:a,perspectiveElem:r,startPos:t,endPos:t,type:e};return this.threeDElements.push(h),h},HybridRendererBase.prototype.build3dContainers=function(){var t,e,i=this.layers.length,s="";for(t=0;t=0;t-=1)this.resizerElem.appendChild(this.threeDElements[t].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(t,e){for(var i=0,s=this.threeDElements.length;in?(t=r/this.globalData.compSize.w,e=r/this.globalData.compSize.w,i=0,s=(a-this.globalData.compSize.h*(r/this.globalData.compSize.w))/2):(t=a/this.globalData.compSize.h,e=a/this.globalData.compSize.h,i=(r-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,s=0);var o=this.resizerElem.style;o.webkitTransform="matrix3d("+t+",0,0,0,0,"+e+",0,0,0,0,1,0,"+i+","+s+",0,1)",o.transform=o.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var t,e=this.globalData.compSize.w,i=this.globalData.compSize.h,s=this.threeDElements.length;for(t=0;t=p;)t/=2,e/=2,i>>>=1;return(t+i)/e};return x.int32=function(){return 0|b.g(4)},x.quick=function(){return b.g(4)/4294967296},x.double=x,g(v(b.S),t),(s.pass||n||function(t,i,s,r){return(r&&(r.S&&u(r,b),t.state=function(){return u(b,{})}),s)?(e[o]=t,i):t})(x,c,"global"in s?s.global:this==e,s.state)}function m(t){var e,i=t.length,s=this,a=0,n=s.i=s.j=0,o=s.S=[];for(i||(t=[i++]);ai){var s=i;i=e,e=s}return Math.min(Math.max(t,e),i)}function radiansToDegrees(t){return t/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(t){return t*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(t,e){if("number"==typeof t||t instanceof Number)return e=e||0,Math.abs(t-e);e||(e=helperLengthArray);var i,s=Math.min(t.length,e.length),r=0;for(i=0;i.5?l/(2-n-o):l/(n+o),n){case s:e=(r-a)/l+(r1&&(i-=1),i<1/6)?t+(e-t)*6*i:i<.5?e:i<2/3?t+(e-t)*(2/3-i)*6:t}function hslToRgb(t){var e,i,s,r=t[0],a=t[1],n=t[2];if(0===a)e=n,s=n,i=n;else{var o=n<.5?n*(1+a):n+a-n*a,h=2*n-o;e=hue2rgb(h,o,r+1/3),i=hue2rgb(h,o,r),s=hue2rgb(h,o,r-1/3)}return[e,i,s,t[3]]}function linear(t,e,i,s,r){if((void 0===s||void 0===r)&&(s=e,r=i,e=0,i=1),i=i)return r;var o=i===e?0:(t-e)/(i-e);if(!s.length)return s+(r-s)*o;var h=s.length,l=createTypedArray("float32",h);for(a=0;a1){for(s=0;s1?e=1:e<0&&(e=0);var n=t(e);if($bm_isInstanceOfArray(r)){var o,h=r.length,l=createTypedArray("float32",h);for(o=0;odata.k[e].t&&tdata.k[e+1].t-t?(i=e+2,s=data.k[e+1].t):(i=e+1,s=data.k[e].t);break}}-1===i&&(i=e+1,s=data.k[e].t)}}else i=0,s=0;var a={};return a.index=i,a.time=s/elem.comp.globalData.frameRate,a}function key(t){if(!data.k.length||"number"==typeof data.k[0])throw Error("The property has no keyframe at index "+t);t-=1,e={time:data.k[t].t/elem.comp.globalData.frameRate,value:[]};var e,i,s,r=Object.prototype.hasOwnProperty.call(data.k[t],"s")?data.k[t].s:data.k[t-1].e;for(i=0,s=r.length;il.length-1)&&(e=l.length-1),s=p-(r=l[l.length-1-e].t)),"pingpong"===t){if(Math.floor((h-r)/s)%2!=0)return this.getValueAtTime((s-(h-r)%s+r)/this.comp.globalData.frameRate,0)}else if("offset"===t){var f=this.getValueAtTime(r/this.comp.globalData.frameRate,0),c=this.getValueAtTime(p/this.comp.globalData.frameRate,0),m=this.getValueAtTime(((h-r)%s+r)/this.comp.globalData.frameRate,0),u=Math.floor((h-r)/s);if(this.pv.length){for(a=0,n=(o=Array(f.length)).length;a=p)return this.pv;if(i?(s=e?Math.abs(this.elem.comp.globalData.frameRate*e):Math.max(0,this.elem.data.op-p),r=p+s):((!e||e>l.length-1)&&(e=l.length-1),s=(r=l[e].t)-p),"pingpong"===t){if(Math.floor((p-h)/s)%2==0)return this.getValueAtTime(((p-h)%s+p)/this.comp.globalData.frameRate,0)}else if("offset"===t){var f=this.getValueAtTime(p/this.comp.globalData.frameRate,0),c=this.getValueAtTime(r/this.comp.globalData.frameRate,0),m=this.getValueAtTime((s-(p-h)%s+p)/this.comp.globalData.frameRate,0),u=Math.floor((p-h)/s)+1;if(this.pv.length){for(a=0,n=(o=Array(f.length)).length;a1?(n-a)/(e-1):1,h=0,l=0;for(i=this.pv.length?createTypedArray("float32",this.pv.length):0;hn){var p=o,f=s.c&&o===h-1?0:o+1,c=(n-l)/a[o].addedLength;i=bez.getPointInSegment(s.v[p],s.v[f],s.o[p],s.i[f],c,a[o]);break}l+=a[o].addedLength,o+=1}return i||(i=s.c?[s.v[0][0],s.v[0][1]]:[s.v[s._length-1][0],s.v[s._length-1][1]]),i},vectorOnPath:function(t,e,i){1==t?t=this.v.c:0==t&&(t=.999);var s=this.pointOnPath(t,e),r=this.pointOnPath(t+.001,e),a=r[0]-s[0],n=r[1]-s[1],o=Math.sqrt(Math.pow(a,2)+Math.pow(n,2));return 0===o?[0,0]:"tangent"===i?[a/o,n/o]:[-n/o,a/o]},tangentOnPath:function(t,e){return this.vectorOnPath(t,e,"tangent")},normalOnPath:function(t,e){return this.vectorOnPath(t,e,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([p],h),extendPrototype([p],l),l.prototype.getValueAtTime=o,l.prototype.initiateExpression=ExpressionManager.initiateExpression;var f=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(t,e,i,s,r){var a=f(t,e,i,s,r);return a.propertyIndex=e.ix,a.lock=!1,3===i?expressionHelpers.searchExpressions(t,e.pt,a):4===i&&expressionHelpers.searchExpressions(t,e.ks,a),a.k&&t.addDynamicProperty(a),a}}function initialize$1(){addPropertyDecorator()}function addDecorator(){function t(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}TextProperty.prototype.getExpressionValue=function(t,e){var i=this.calculateExpression(e);if(t.t!==i){var s={};return this.copyData(s,t),s.t=i.toString(),s.__complete=!1,s}return t},TextProperty.prototype.searchProperty=function(){var t=this.searchKeyframes(),e=this.searchExpressions();return this.kf=t||e,this.kf},TextProperty.prototype.searchExpressions=t}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(t,e){var i,s,r=createNS("feMerge");for(r.setAttribute("result",t),s=0;s=p?u<0?s:r:s+m*Math.pow((a-t)/u,1/i),f[c]=n,c+=1,o+=256/(h-1);return f.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){var e,i=this.filterManager.effectElements;this.feFuncRComposed&&(t||i[3].p._mdf||i[4].p._mdf||i[5].p._mdf||i[6].p._mdf||i[7].p._mdf)&&(e=this.getTableValue(i[3].p.v,i[4].p.v,i[5].p.v,i[6].p.v,i[7].p.v),this.feFuncRComposed.setAttribute("tableValues",e),this.feFuncGComposed.setAttribute("tableValues",e),this.feFuncBComposed.setAttribute("tableValues",e)),this.feFuncR&&(t||i[10].p._mdf||i[11].p._mdf||i[12].p._mdf||i[13].p._mdf||i[14].p._mdf)&&(e=this.getTableValue(i[10].p.v,i[11].p.v,i[12].p.v,i[13].p.v,i[14].p.v),this.feFuncR.setAttribute("tableValues",e)),this.feFuncG&&(t||i[17].p._mdf||i[18].p._mdf||i[19].p._mdf||i[20].p._mdf||i[21].p._mdf)&&(e=this.getTableValue(i[17].p.v,i[18].p.v,i[19].p.v,i[20].p.v,i[21].p.v),this.feFuncG.setAttribute("tableValues",e)),this.feFuncB&&(t||i[24].p._mdf||i[25].p._mdf||i[26].p._mdf||i[27].p._mdf||i[28].p._mdf)&&(e=this.getTableValue(i[24].p.v,i[25].p.v,i[26].p.v,i[27].p.v,i[28].p.v),this.feFuncB.setAttribute("tableValues",e)),this.feFuncA&&(t||i[31].p._mdf||i[32].p._mdf||i[33].p._mdf||i[34].p._mdf||i[35].p._mdf)&&(e=this.getTableValue(i[31].p.v,i[32].p.v,i[33].p.v,i[34].p.v,i[35].p.v),this.feFuncA.setAttribute("tableValues",e))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(t){if(t||this.filterManager._mdf){if((t||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),t||this.filterManager.effectElements[0].p._mdf){var e=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*e[0]),Math.round(255*e[1]),Math.round(255*e[2])))}if((t||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),t||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var i=this.filterManager.effectElements[3].p.v,s=(this.filterManager.effectElements[2].p.v-90)*degToRads,r=i*Math.cos(s),a=i*Math.sin(s);this.feOffset.setAttribute("dx",r),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(t,e,i){this.initialized=!1,this.filterManager=e,this.filterElem=t,this.elem=i,i.matteElement=createNS("g"),i.matteElement.appendChild(i.layerElement),i.matteElement.appendChild(i.transformedElement),i.baseElement=i.matteElement}function SVGGaussianBlurEffect(t,e,i,s){t.setAttribute("x","-100%"),t.setAttribute("y","-100%"),t.setAttribute("width","300%"),t.setAttribute("height","300%"),this.filterManager=e;var r=createNS("feGaussianBlur");r.setAttribute("result",s),t.appendChild(r),this.feGaussianBlur=r}function TransformEffect(){}function SVGTransformEffect(t,e){this.init(e)}function CVTransformEffect(t){this.init(t)}return SVGMatte3Effect.prototype.findSymbol=function(t){for(var e=0,i=_svgMatteSymbols.length;ep||(e.current=d[p],d[p]=null,p--)}function g(e,t){d[++p]=e.current,e.current=t}var y=Symbol.for("react.element"),v=Symbol.for("react.portal"),b=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),S=Symbol.for("react.provider"),C=Symbol.for("react.consumer"),E=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),N=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),L=Symbol.for("react.scope");Symbol.for("react.debug_trace_mode");var T=Symbol.for("react.offscreen"),F=Symbol.for("react.legacy_hidden"),M=Symbol.for("react.cache");Symbol.for("react.tracing_marker");var O=Symbol.iterator;function R(e){return null===e||"object"!=typeof e?null:"function"==typeof(e=O&&e[O]||e["@@iterator"])?e:null}var D=m(null),A=m(null),I=m(null),U=m(null),B={$$typeof:E,_currentValue:null,_currentValue2:null,_threadCount:0,Provider:null,Consumer:null};function V(e,t){switch(g(I,t),g(A,e),g(D,null),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)&&(t=t.namespaceURI)?s2(t):0;break;default:if(t=(e=8===e?t.parentNode:t).tagName,e=e.namespaceURI)t=s3(e=s2(e),t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}h(D),g(D,t)}function Q(){h(D),h(A),h(I)}function $(e){null!==e.memoizedState&&g(U,e);var t=D.current,n=s3(t,e.type);t!==n&&(g(A,e),g(D,n))}function j(e){A.current===e&&(h(D),h(A)),U.current===e&&(h(U),B._currentValue=null)}var W=a.unstable_scheduleCallback,H=a.unstable_cancelCallback,q=a.unstable_shouldYield,K=a.unstable_requestPaint,Y=a.unstable_now,X=a.unstable_getCurrentPriorityLevel,G=a.unstable_ImmediatePriority,Z=a.unstable_UserBlockingPriority,J=a.unstable_NormalPriority,ee=a.unstable_LowPriority,et=a.unstable_IdlePriority,en=a.log,er=a.unstable_setDisableYieldValue,el=null,ea=null;function eo(e){if("function"==typeof en&&er(e),ea&&"function"==typeof ea.setStrictMode)try{ea.setStrictMode(el,e)}catch(e){}}var ei=Math.clz32?Math.clz32:function(e){return 0==(e>>>=0)?32:31-(eu(e)/es|0)|0},eu=Math.log,es=Math.LN2,ec=128,ef=4194304;function ed(e){var t=42&e;if(0!==t)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194176&e;case 4194304:case 8388608:case 16777216:case 33554432:return 62914560&e;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ep(e,t){var n=e.pendingLanes;if(0===n)return 0;var r=0,l=e.suspendedLanes;e=e.pingedLanes;var a=134217727&n;return 0!==a?0!=(n=a&~l)?r=ed(n):0!=(e&=a)&&(r=ed(e)):0!=(n&=~l)?r=ed(n):0!==e&&(r=ed(e)),0===r?0:0!==t&&t!==r&&0==(t&l)&&((l=r&-r)>=(e=t&-t)||32===l&&0!=(4194176&e))?t:r}function em(e,t){return e.errorRecoveryDisabledLanes&t?0:0!=(e=-536870913&e.pendingLanes)?e:536870912&e?536870912:0}function eh(){var e=ec;return 0==(4194176&(ec<<=1))&&(ec=128),e}function eg(){var e=ef;return 0==(62914560&(ef<<=1))&&(ef=4194304),e}function ey(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function ev(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-ei(t);e.entangledLanes|=t,e.entanglements[r]=1073741824|e.entanglements[r]|4194218&n}function eb(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-ei(n),l=1<l||u[r]!==s[l]){var c="\n"+u[r].replace(" at new "," at ");return e.displayName&&c.includes("")&&(c=c.replace("",e.displayName)),c}while(1<=r&&0<=l);break}}}finally{eG=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?eX(n):""}function eJ(e){try{var t="";do t+=function(e){switch(e.tag){case 26:case 27:case 5:return eX(e.type);case 16:return eX("Lazy");case 13:return eX("Suspense");case 19:return eX("SuspenseList");case 0:case 2:case 15:return e=eZ(e.type,!1);case 11:return e=eZ(e.type.render,!1);case 1:return e=eZ(e.type,!0);default:return""}}(e),e=e.return;while(e);return t}catch(e){return"\nError generating stack: "+e.message+"\n"+e.stack}}var e0=Symbol.for("react.client.reference");function e1(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function e2(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function e3(e){e._valueTracker||(e._valueTracker=function(e){var t=e2(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&void 0!==n&&"function"==typeof n.get&&"function"==typeof n.set){var l=n.get,a=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return l.call(this)},set:function(e){r=""+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(e){r=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function e4(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=e2(e)?e.checked?"true":"false":e.value),(e=r)!==n&&(t.setValue(e),!0)}function e6(e){if(void 0===(e=e||("undefined"!=typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}var e8=/[\n"\\]/g;function e5(e){return e.replace(e8,function(e){return"\\"+e.charCodeAt(0).toString(16)+" "})}function e7(e,t,n,r,l,a,o,i){e.name="",null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o?e.type=o:e.removeAttribute("type"),null!=t?"number"===o?(0===t&&""===e.value||e.value!=t)&&(e.value=""+e1(t)):e.value!==""+e1(t)&&(e.value=""+e1(t)):"submit"!==o&&"reset"!==o||e.removeAttribute("value"),null!=t?te(e,o,e1(t)):null!=n?te(e,o,e1(n)):null!=r&&e.removeAttribute("value"),null==l&&null!=a&&(e.defaultChecked=!!a),null!=l&&(e.checked=l&&"function"!=typeof l&&"symbol"!=typeof l),null!=i&&"function"!=typeof i&&"symbol"!=typeof i&&"boolean"!=typeof i?e.name=""+e1(i):e.removeAttribute("name")}function e9(e,t,n,r,l,a,o,i){if(null!=a&&"function"!=typeof a&&"symbol"!=typeof a&&"boolean"!=typeof a&&(e.type=a),null!=t||null!=n){if(!("submit"!==a&&"reset"!==a||null!=t))return;n=null!=n?""+e1(n):"",t=null!=t?""+e1(t):n,i||t===e.value||(e.value=t),e.defaultValue=t}r="function"!=typeof(r=null!=r?r:l)&&"symbol"!=typeof r&&!!r,e.checked=i?e.checked:!!r,e.defaultChecked=!!r,null!=o&&"function"!=typeof o&&"symbol"!=typeof o&&"boolean"!=typeof o&&(e.name=o)}function te(e,t,n){"number"===t&&e6(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}var tt=Array.isArray;function tn(e,t,n,r){if(e=e.options,t){t={};for(var l=0;l"+t.valueOf().toString()+"",t=iX.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}}var to=ta;"undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(to=function(e,t){return MSApp.execUnsafeLocalFunction(function(){return ta(e,t)})});var ti=to;function tu(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&3===n.nodeType){n.nodeValue=t;return}}e.textContent=t}var ts=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function tc(e,t,n){var r=0===t.indexOf("--");null==n||"boolean"==typeof n||""===n?r?e.setProperty(t,""):"float"===t?e.cssFloat="":e[t]="":r?e.setProperty(t,n):"number"!=typeof n||0===n||ts.has(t)?"float"===t?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function tf(e,t,n){if(null!=t&&"object"!=typeof t)throw Error(i(62));if(e=e.style,null!=n){for(var r in n)!n.hasOwnProperty(r)||null!=t&&t.hasOwnProperty(r)||(0===r.indexOf("--")?e.setProperty(r,""):"float"===r?e.cssFloat="":e[r]="");for(var l in t)r=t[l],t.hasOwnProperty(l)&&n[l]!==r&&tc(e,l,r)}else for(var a in t)t.hasOwnProperty(a)&&tc(e,a,t[a])}function td(e){if(-1===e.indexOf("-"))return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var tp=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),tm=null;function th(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var tg=null,ty=null;function tv(e){var t=eO(e);if(t&&(e=t.stateNode)){var n=eD(e);switch(e=t.stateNode,t.type){case"input":if(e7(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,"radio"===n.type&&null!=t){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+e5(""+t)+'"][type="radio"]'),t=0;t>=o,l-=o,tj=1<<32-ei(t)+l|n<h?(g=f,f=null):g=f.sibling;var y=p(l,f,i[h],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(l,f),o=a(y,o,h),null===c?s=y:c.sibling=y,c=y,f=g}if(h===i.length)return n(l,f),tZ&&tH(l,h),s;if(null===f){for(;hg?(y=h,h=null):y=h.sibling;var b=p(l,h,v.value,s);if(null===b){null===h&&(h=y);break}e&&h&&null===b.alternate&&t(l,h),o=a(b,o,g),null===f?c=b:f.sibling=b,f=b,h=y}if(v.done)return n(l,h),tZ&&tH(l,g),c;if(null===h){for(;!v.done;g++,v=u.next())null!==(v=d(l,v.value,s))&&(o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return tZ&&tH(l,g),c}for(h=r(l,h);!v.done;g++,v=u.next())null!==(v=m(h,l,g,v.value,s))&&(e&&null!==v.alternate&&h.delete(null===v.key?g:v.key),o=a(v,o,g),null===f?c=v:f.sibling=v,f=v);return e&&h.forEach(function(e){return t(l,e)}),tZ&&tH(l,g),c}(s,c,f,h);if("function"==typeof f.then)return u(s,c,nJ(f),h);if(f.$$typeof===E)return u(s,c,ai(s,f,h),h);n1(s,f)}return"string"==typeof f&&""!==f||"number"==typeof f?(f=""+f,null!==c&&6===c.tag?(n(s,c.sibling),(c=l(c,f)).return=s):(n(s,c),(c=i_(f,s.mode,h)).return=s),o(s=c)):n(s,c)}(u,s,c,f),nG=null,u}}var n4=n3(!0),n6=n3(!1),n8=m(null),n5=m(0);function n7(e,t){g(n5,e=oz),g(n8,t),oz=e|t.baseLanes}function n9(){g(n5,oz),g(n8,n8.current)}function re(){oz=n5.current,h(n8),h(n5)}var rt=m(null),rn=null;function rr(e){var t=e.alternate;g(ri,1&ri.current),g(rt,e),null===rn&&(null===t||null!==n8.current?rn=e:null!==t.memoizedState&&(rn=e))}function rl(e){if(22===e.tag){if(g(ri,ri.current),g(rt,e),null===rn){var t=e.alternate;null!==t&&null!==t.memoizedState&&(rn=e)}}else ra(e)}function ra(){g(ri,ri.current),g(rt,rt.current)}function ro(e){h(rt),rn===e&&(rn=null),h(ri)}var ri=m(0);function ru(e){for(var t=e;null!==t;){if(13===t.tag){var n=t.memoizedState;if(null!==n&&(null===(n=n.dehydrated)||"$?"===n.data||"$!"===n.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!=(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var rs=s.ReactCurrentDispatcher,rc=s.ReactCurrentBatchConfig,rf=0,rd=null,rp=null,rm=null,rh=!1,rg=!1,ry=!1,rv=0,rb=0,rk=null,rw=0;function rS(){throw Error(i(321))}function rC(e,t){if(null===t)return!1;for(var n=0;na?a:8;var o=rc.transition,i={_callbacks:new Set};rc.transition=i,lf(e,!1,t,n);try{var u=l();if(null!==u&&"object"==typeof u&&"function"==typeof u.then){av(i,u);var s,c,f=(s=[],c={status:"pending",value:null,reason:null,then:function(e){s.push(e)}},u.then(function(){c.status="fulfilled",c.value=r;for(var e=0;e title"))),sG(l,n,r),l[eE]=e,eI(l),n=l;break e;case"link":var a=cE("link","href",t).get(n+(r.href||""));if(a){for(var o=0;o",e=e.removeChild(e.firstChild);break;case"select":e="string"==typeof r.is?l.createElement("select",{is:r.is}):l.createElement("select"),r.multiple?e.multiple=!0:r.size&&(e.size=r.size);break;default:e="string"==typeof r.is?l.createElement(n,{is:r.is}):l.createElement(n)}}e[eE]=t,e[ex]=r;e:for(l=t.child;null!==l;){if(5===l.tag||6===l.tag)e.appendChild(l.stateNode);else if(4!==l.tag&&27!==l.tag&&null!==l.child){l.child.return=l,l=l.child;continue}if(l===t)break;for(;null===l.sibling;){if(null===l.return||l.return===t)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(t.stateNode=e,sG(e,n,r),n){case"button":case"input":case"select":case"textarea":e=!!r.autoFocus;break;case"img":e=!0;break;default:e=!1}e&&aC(t)}}return aP(t),t.flags&=-16777217,null;case 6:if(e&&null!=t.stateNode)e.memoizedProps!==r&&aC(t);else{if("string"!=typeof r&&null===t.stateNode)throw Error(i(166));if(e=I.current,t9(t)){e:{if(e=t.stateNode,n=t.memoizedProps,e[eE]=t,(r=e.nodeValue!==n)&&null!==(l=tX))switch(l.tag){case 3:if(l=0!=(1&l.mode),sq(e.nodeValue,n,l),l){e=!1;break e}break;case 27:case 5:var a=0!=(1&l.mode);if(!0!==l.memoizedProps.suppressHydrationWarning&&sq(e.nodeValue,n,a),a){e=!1;break e}}e=r}e&&aC(t)}else(e=s1(e).createTextNode(r))[eE]=t,t.stateNode=e}return aP(t),null;case 13:if(ro(t),r=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(tZ&&null!==tG&&0!=(1&t.mode)&&0==(128&t.flags))ne(),nt(),t.flags|=384,l=!1;else if(l=t9(t),null!==r&&null!==r.dehydrated){if(null===e){if(!l)throw Error(i(318));if(!(l=null!==(l=t.memoizedState)?l.dehydrated:null))throw Error(i(317));l[eE]=t}else nt(),0==(128&t.flags)&&(t.memoizedState=null),t.flags|=4;aP(t),l=!1}else null!==tJ&&(o0(tJ),tJ=null),l=!0;if(!l)return 256&t.flags?t:null}if(0!=(128&t.flags))return t.lanes=n,t;return n=null!==r,e=null!==e&&null!==e.memoizedState,n&&(r=t.child,l=null,null!==r.alternate&&null!==r.alternate.memoizedState&&null!==r.alternate.memoizedState.cachePool&&(l=r.alternate.memoizedState.cachePool.pool),a=null,null!==r.memoizedState&&null!==r.memoizedState.cachePool&&(a=r.memoizedState.cachePool.pool),a!==l&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),ax(t,t.updateQueue),aP(t),null;case 4:return Q(),null===e&&sA(t.stateNode.containerInfo),aP(t),null;case 10:return an(t.type._context),aP(t),null;case 19:if(h(ri),null===(l=t.memoizedState))return aP(t),null;if(r=0!=(128&t.flags),null===(a=l.rendering)){if(r)az(l,!1);else{if(0!==oP||null!==e&&0!=(128&e.flags))for(e=t.child;null!==e;){if(null!==(a=ru(e))){for(t.flags|=128,az(l,!1),e=a.updateQueue,t.updateQueue=e,ax(t,e),t.subtreeFlags=0,e=n,n=t.child;null!==n;)ix(n,e),n=n.sibling;return g(ri,1&ri.current|2),t.child}e=e.sibling}null!==l.tail&&Y()>oI&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}}else{if(!r){if(null!==(e=ru(a))){if(t.flags|=128,r=!0,e=e.updateQueue,t.updateQueue=e,ax(t,e),az(l,!0),null===l.tail&&"hidden"===l.tailMode&&!a.alternate&&!tZ)return aP(t),null}else 2*Y()-l.renderingStartTime>oI&&536870912!==n&&(t.flags|=128,r=!0,az(l,!1),t.lanes=4194304)}l.isBackwards?(a.sibling=t.child,t.child=a):(null!==(e=l.last)?e.sibling=a:t.child=a,l.last=a)}if(null!==l.tail)return t=l.tail,l.rendering=t,l.tail=t.sibling,l.renderingStartTime=Y(),t.sibling=null,e=ri.current,g(ri,r?1&e|2:1&e),t;return aP(t),null;case 22:case 23:return ro(t),re(),r=null!==t.memoizedState,null!==e?null!==e.memoizedState!==r&&(t.flags|=8192):r&&(t.flags|=8192),r&&0!=(1&t.mode)?0!=(536870912&n)&&0==(128&t.flags)&&(aP(t),6&t.subtreeFlags&&(t.flags|=8192)):aP(t),null!==(n=t.updateQueue)&&ax(t,n.retryQueue),n=null,null!==e&&null!==e.memoizedState&&null!==e.memoizedState.cachePool&&(n=e.memoizedState.cachePool.pool),r=null,null!==t.memoizedState&&null!==t.memoizedState.cachePool&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),null!==e&&h(ab),null;case 24:return n=null,null!==e&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),an(ad),aP(t),null;case 25:return null}throw Error(i(156,t.tag))}(t.alternate,t,oz);if(null!==n){ow=n;return}if(null!==(t=t.sibling)){ow=t;return}ow=t=e}while(null!==t);0===oP&&(oP=5)}function is(e,t,n,r,l){var a=ek,o=ov.transition;try{ov.transition=null,ek=2,function(e,t,n,r,l,a){do id();while(null!==oj);if(0!=(6&ob))throw Error(i(327));var o,u=e.finishedWork,s=e.finishedLanes;if(null!==u){if(e.finishedWork=null,e.finishedLanes=0,u===e.current)throw Error(i(177));e.callbackNode=null,e.callbackPriority=0,e.cancelPendingCommit=null;var c=u.lanes|u.childLanes;if(function(e,t,n){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.entangledLanes&=t,e.errorRecoveryDisabledLanes&=t,e.shellSuspendCounter=0,t=e.entanglements;for(var l=e.expirationTimes,a=e.hiddenUpdates;0r&&(l=r,r=a,a=l),l=si(n,a);var o=si(n,r);l&&o&&(1!==e.rangeCount||e.anchorNode!==l.node||e.anchorOffset!==l.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&((t=t.createRange()).setStart(l.node,l.offset),e.removeAllRanges(),a>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"==typeof n.focus&&n.focus(),n=0;nn?32:n;n=ov.transition;var l=ek;try{if(ov.transition=null,ek=r,null===oj)var a=!1;else{r=oq,oq=null;var o=oj,u=oW;if(oj=null,oW=0,0!=(6&ob))throw Error(i(331));var s=ob;if(ob|=4,of(o.current),ol(o,o.current,u,r),ob=s,nb(!1),ea&&"function"==typeof ea.onPostCommitFiberRoot)try{ea.onPostCommitFiberRoot(el,o)}catch(e){}a=!0}return a}finally{ek=l,ov.transition=n,ic(e,t)}}return!1}function ip(e,t,n){t=lL(e,t=lP(n,t),2),null!==(e=nO(e,t,2))&&(o2(e,2),nv(e))}function im(e,t,n){if(3===e.tag)ip(e,e,n);else for(;null!==t;){if(3===t.tag){ip(t,e,n);break}if(1===t.tag){var r=t.stateNode;if("function"==typeof t.type.getDerivedStateFromError||"function"==typeof r.componentDidCatch&&(null===oQ||!oQ.has(r))){e=lT(t,e=lP(n,e),2),null!==(t=nO(t,e,2))&&(o2(t,2),nv(t));break}}t=t.return}}function ih(e,t,n){var r=e.pingCache;if(null===r){r=e.pingCache=new om;var l=new Set;r.set(t,l)}else void 0===(l=r.get(t))&&(l=new Set,r.set(t,l));l.has(n)||(ox=!0,l.add(n),e=ig.bind(null,e,t,n),t.then(e,e))}function ig(e,t,n){var r=e.pingCache;null!==r&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,2&ob?oR=!0:4&ob&&(oD=!0),ik(),ok===e&&(oS&n)===n&&(4===oP||3===oP&&(62914560&oS)===oS&&300>Y()-oA?0==(2&ob)&&o5(e,0):oT|=n),nv(e)}function iy(e,t){0===t&&(t=0==(1&e.mode)?2:eg()),null!==(e=ns(e,t))&&(o2(e,t),nv(e))}function iv(e){var t=e.memoizedState,n=0;null!==t&&(n=t.retryLane),iy(e,n)}function ib(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,l=e.memoizedState;null!==l&&(n=l.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}null!==r&&r.delete(t),iy(e,n)}function ik(){if(50=uH),uY=!1;function uX(e,t){switch(e){case"keyup":return -1!==uj.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uG(e){return"object"==typeof(e=e.detail)&&"data"in e?e.data:null}var uZ=!1,uJ={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function u0(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!uJ[e.type]:"textarea"===t}function u1(e,t,n,r){tb(r),0<(t=sV(t,"onChange")).length&&(n=new i3("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var u2=null,u3=null;function u4(e){sM(e,0)}function u6(e){if(e4(eR(e)))return e}function u8(e,t){if("change"===e)return t}var u5=!1;if(e$){if(e$){var u7="oninput"in document;if(!u7){var u9=document.createElement("div");u9.setAttribute("oninput","return;"),u7="function"==typeof u9.oninput}r=u7}else r=!1;u5=r&&(!document.documentMode||9=t)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=so(r)}}function su(){for(var e=window,t=e6();t instanceof e.HTMLIFrameElement;){try{var n="string"==typeof t.contentWindow.location.href}catch(e){n=!1}if(n)e=t.contentWindow;else break;t=e6(e.document)}return t}function ss(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}var sc=e$&&"documentMode"in document&&11>=document.documentMode,sf=null,sd=null,sp=null,sm=!1;function sh(e,t,n){var r=n.window===n?n.document:9===n.nodeType?n:n.ownerDocument;sm||null==sf||sf!==e6(r)||(r="selectionStart"in(r=sf)&&ss(r)?{start:r.selectionStart,end:r.selectionEnd}:{anchorNode:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset},sp&&nQ(sp,r)||(sp=r,0<(r=sV(sd,"onSelect")).length&&(t=new i3("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=sf)))}function sg(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var sy={animationend:sg("Animation","AnimationEnd"),animationiteration:sg("Animation","AnimationIteration"),animationstart:sg("Animation","AnimationStart"),transitionend:sg("Transition","TransitionEnd")},sv={},sb={};function sk(e){if(sv[e])return sv[e];if(!sy[e])return e;var t,n=sy[e];for(t in n)if(n.hasOwnProperty(t)&&t in sb)return sv[e]=n[t];return e}e$&&(sb=document.createElement("div").style,"AnimationEvent"in window||(delete sy.animationend.animation,delete sy.animationiteration.animation,delete sy.animationstart.animation),"TransitionEvent"in window||delete sy.transitionend.transition);var sw=sk("animationend"),sS=sk("animationiteration"),sC=sk("animationstart"),sE=sk("transitionend"),sx=new Map,sz="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll scrollEnd toggle touchMove waiting wheel".split(" ");function sP(e,t){sx.set(e,t),eV(t,[e])}for(var sN=0;sN title"):null)}var cz=null;function cP(){}function cN(){if(this.count--,0===this.count){if(this.stylesheets)cL(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var c_=null;function cL(e,t){e.stylesheets=null,null!==e.unsuspend&&(e.count++,c_=new Map,t.forEach(cT,e),c_=null,cN.call(e))}function cT(e,t){if(!(4&t.state.loading)){var n=c_.get(e);if(n)var r=n.get(null);else{n=new Map,c_.set(e,n);for(var l=e.querySelectorAll("link[data-precedence],style[data-precedence]"),a=0;a