From 7b635fd2e5dacca3ea165206190fb87d8ae6d5ba Mon Sep 17 00:00:00 2001 From: "Loki (AI Agent)" Date: Mon, 2 Feb 2026 21:45:04 +0000 Subject: [PATCH 1/4] feat(tools): add revoke-duplicates script for issue #9 Identifies duplicate identity attestations and revokes older ones, keeping only the newest attestation per username. Usage: DRY RUN: npx ts-node src/revoke-duplicates.ts EXECUTE: PRIVATE_KEY=0x... npx ts-node src/revoke-duplicates.ts --execute Note: Only the original attester can revoke their attestations. Fixes #9 (partial - provides tooling, proper fix requires resolver enforcement) --- backend/src/revoke-duplicates.ts | 205 +++++++++++++++++++++++++++++++ 1 file changed, 205 insertions(+) create mode 100644 backend/src/revoke-duplicates.ts diff --git a/backend/src/revoke-duplicates.ts b/backend/src/revoke-duplicates.ts new file mode 100644 index 0000000..177048c --- /dev/null +++ b/backend/src/revoke-duplicates.ts @@ -0,0 +1,205 @@ +/** + * Revoke duplicate identity attestations + * + * Identifies usernames with multiple attestations and revokes the older ones, + * keeping only the most recent attestation per username. + * + * Usage: + * DRY RUN: npx ts-node tools/revoke-duplicates.ts + * EXECUTE: PRIVATE_KEY=0x... npx ts-node tools/revoke-duplicates.ts --execute + */ + +import { createPublicClient, createWalletClient, http, parseAbi } from 'viem'; +import { privateKeyToAccount } from 'viem/accounts'; +import { baseSepolia } from 'viem/chains'; + +const EAS_GRAPHQL = 'https://base-sepolia.easscan.org/graphql'; +const EAS_ADDRESS = '0x4200000000000000000000000000000000000021'; +const IDENTITY_SCHEMA_UID = '0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af'; + +const EAS_ABI = parseAbi([ + 'function revoke((bytes32 schema, (bytes32 uid, bytes32 value)[] data)) external payable returns (bool)', +]); + +interface Attestation { + id: string; + attester: string; + recipient: string; + time: number; + decodedDataJson: string; + revoked: boolean; +} + +interface DecodedField { + name: string; + value: { value: string }; +} + +async function fetchIdentityAttestations(): Promise { + const query = ` + query GetIdentities($schemaId: String!) { + attestations( + where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } + orderBy: { time: asc } + ) { + id + attester + recipient + time + decodedDataJson + revoked + } + } + `; + + const response = await fetch(EAS_GRAPHQL, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + query, + variables: { schemaId: IDENTITY_SCHEMA_UID } + }) + }); + + if (!response.ok) { + throw new Error(`EAS API error: ${response.statusText}`); + } + + const data = await response.json() as { data?: { attestations?: Attestation[] } }; + return data?.data?.attestations ?? []; +} + +function extractUsername(attestation: Attestation): string | null { + try { + const decoded: DecodedField[] = JSON.parse(attestation.decodedDataJson); + const usernameField = decoded.find(d => d.name === 'username'); + return usernameField?.value?.value?.toLowerCase() ?? null; + } catch { + return null; + } +} + +function findDuplicates(attestations: Attestation[]): Map { + const byUsername = new Map(); + + for (const att of attestations) { + const username = extractUsername(att); + if (!username) continue; + + const existing = byUsername.get(username) ?? []; + existing.push(att); + byUsername.set(username, existing); + } + + // Filter to only usernames with duplicates + const duplicates = new Map(); + for (const [username, atts] of byUsername) { + if (atts.length > 1) { + // Sort by time descending (newest first) + atts.sort((a, b) => b.time - a.time); + duplicates.set(username, atts); + } + } + + return duplicates; +} + +async function revokeAttestation(uid: string, walletClient: any): Promise { + const hash = await walletClient.writeContract({ + address: EAS_ADDRESS, + abi: EAS_ABI, + functionName: 'revoke', + args: [{ + schema: IDENTITY_SCHEMA_UID, + data: [{ uid: uid as `0x${string}`, value: '0x0000000000000000000000000000000000000000000000000000000000000000' as `0x${string}` }] + }] + }); + return hash; +} + +async function main() { + const execute = process.argv.includes('--execute'); + const privateKey = process.env.PRIVATE_KEY; + + console.log('šŸ” Scanning for duplicate identity attestations...\n'); + + // Fetch all identity attestations + const attestations = await fetchIdentityAttestations(); + console.log(`Found ${attestations.length} total identity attestations\n`); + + // Find duplicates + const duplicates = findDuplicates(attestations); + + if (duplicates.size === 0) { + console.log('āœ… No duplicates found!'); + return; + } + + console.log(`āš ļø Found ${duplicates.size} usernames with duplicate attestations:\n`); + + const toRevoke: { uid: string; username: string; attester: string }[] = []; + + for (const [username, atts] of duplicates) { + console.log(` ${username}:`); + for (let i = 0; i < atts.length; i++) { + const att = atts[i]; + const date = new Date(att.time * 1000).toISOString(); + const status = i === 0 ? 'āœ“ KEEP (newest)' : 'āœ— REVOKE'; + console.log(` ${status} ${att.id.slice(0, 10)}... (${date})`); + + if (i > 0) { + toRevoke.push({ uid: att.id, username, attester: att.attester }); + } + } + console.log(); + } + + console.log(`\nTotal attestations to revoke: ${toRevoke.length}\n`); + + if (!execute) { + console.log('šŸ”¶ DRY RUN - No changes made.'); + console.log(' Run with --execute and PRIVATE_KEY=0x... to revoke duplicates.'); + return; + } + + if (!privateKey) { + console.error('āŒ PRIVATE_KEY environment variable required for --execute'); + process.exit(1); + } + + // Set up wallet client + const account = privateKeyToAccount(privateKey as `0x${string}`); + const walletClient = createWalletClient({ + account, + chain: baseSepolia, + transport: http('https://sepolia.base.org') + }); + + console.log(`šŸ”‘ Using wallet: ${account.address}\n`); + + // Check that wallet matches attester for all attestations + for (const item of toRevoke) { + if (item.attester.toLowerCase() !== account.address.toLowerCase()) { + console.error(`āŒ Cannot revoke ${item.uid} - attester ${item.attester} doesn't match wallet ${account.address}`); + console.error(' Only the original attester can revoke an attestation.'); + process.exit(1); + } + } + + // Revoke each duplicate + console.log('šŸš€ Revoking duplicates...\n'); + + for (const item of toRevoke) { + try { + console.log(` Revoking ${item.uid.slice(0, 10)}... (${item.username})`); + const hash = await revokeAttestation(item.uid, walletClient); + console.log(` āœ“ TX: ${hash}`); + } catch (err: any) { + console.error(` āœ— Failed: ${err.message}`); + } + } + + console.log('\nāœ… Done!'); +} + +main().catch(console.error); From 508464f8f5453d7050c33d97eee2a26209c4f568 Mon Sep 17 00:00:00 2001 From: "Loki (AI Agent)" Date: Mon, 2 Feb 2026 21:46:15 +0000 Subject: [PATCH 2/4] fix(frontend): prevent duplicate attestations via resolver pre-check Before creating an attestation, check if the username is already registered in the UsernameUniqueResolver. If it's registered to a different wallet, show an error. If registered to the same wallet, warn but allow re-attestation. This prevents the duplicate attestation bug (Issue #9) at the UI level. Fixes #9 --- .../typescript/apps/web/ui/AttestForm.tsx | 34 +++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/src/main/typescript/apps/web/ui/AttestForm.tsx b/src/main/typescript/apps/web/ui/AttestForm.tsx index c379fee..d729ff7 100644 --- a/src/main/typescript/apps/web/ui/AttestForm.tsx +++ b/src/main/typescript/apps/web/ui/AttestForm.tsx @@ -3,8 +3,9 @@ import { z } from 'zod'; import { useWallet } from '../wallet/WalletContext'; import { useGithubAuth } from '../auth/useGithub'; import { appConfig } from '../utils/config'; -import { attestIdentityBinding, encodeBindingData, EASAddresses } from '../utils/eas'; -import { Hex, verifyMessage } from 'viem'; +import { attestIdentityBinding, encodeBindingData, EASAddresses, getChainConfig } from '../utils/eas'; +import { Hex, verifyMessage, createPublicClient, http } from 'viem'; +import { UsernameUniqueResolverABI } from '@didgit/abi'; import { Button } from '../components/ui/button'; import { Input } from '../components/ui/input'; import { Alert } from '../components/ui/alert'; @@ -106,6 +107,35 @@ export const AttestForm: React.FC = () => { if (!gistUrl) return setError('Create a proof gist first'); if (!easReady) return setError('EAS contract address not configured (set VITE_EAS_ADDRESS)'); + // Check if identity already exists in resolver (prevent duplicates - Issue #9) + const resolverAddress = cfg.RESOLVER_ADDRESS as `0x${string}` | undefined; + if (resolverAddress) { + try { + const publicClient = createPublicClient({ + chain: getChainConfig(cfg.CHAIN_ID), + transport: http() + }); + const existingOwner = await publicClient.readContract({ + address: resolverAddress, + abi: UsernameUniqueResolverABI, + functionName: 'getIdentityOwner', + args: ['github.com', parsed.data.github_username] + }) as `0x${string}`; + + if (existingOwner && existingOwner !== '0x0000000000000000000000000000000000000000') { + // Identity exists - check if it's this wallet + if (existingOwner.toLowerCase() !== address?.toLowerCase()) { + return setError(`Username "${parsed.data.github_username}" is already registered to a different wallet (${existingOwner.slice(0, 6)}...${existingOwner.slice(-4)}). Each username can only be linked to one wallet.`); + } + // Same wallet - warn but allow (might be re-attesting) + console.warn('Identity already registered to this wallet, proceeding with re-attestation'); + } + } catch (e) { + // If resolver check fails, log but don't block (resolver might not be deployed) + console.warn('Could not check resolver for existing identity:', e); + } + } + // Resolve account address (EIP-7702 may reuse EOA address) const accountAddress = smartAddress ?? address; if (!accountAddress) return setError('No account address available'); From 91c93a1c96b010d49b0e6c4c0ab686442d78e3f4 Mon Sep 17 00:00:00 2001 From: "Loki (AI Agent)" Date: Tue, 3 Feb 2026 00:28:19 +0000 Subject: [PATCH 3/4] fix: production safety for duplicate attestation prevention (PR #13) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit AttestForm.tsx: - Replace broken @didgit/abi import with inline ABI definition - Fix async error in catch block that could cause double-throws - Include getIdentityOwner and setRepositoryPattern ABI functions revoke-duplicates.ts: - Add pagination to GraphQL query (PAGE_SIZE=100 with skip) - Add transaction confirmation (waitForTransactionReceipt) - Replace 'any' types with proper interfaces (RevokeClients) - Add proper type assertions for hex strings - Fix error handling with instanceof Error check šŸ¤– Authored by Loki --- backend/src/revoke-duplicates.ts | 93 +++- public/assets/ccip-CfLiOW7z.js | 1 + public/assets/ccip-L2KjvZow.js | 1 - ...ants-VN1kIEzb.js => constants-DBcQLFY6.js} | 2 +- public/assets/index-0jpWsoRj.js | 1 - public/assets/index-3O4qPenO.js | 1 - public/assets/index-C3_GJ6Eb.js | 1 + public/assets/index-C4xokDO6.js | 473 ++++++++++++++++ public/assets/index-CGdEoSbI.js | 504 ------------------ public/assets/index-SdYwD8P5.js | 1 - public/assets/index-uTQGe5qG.js | 1 + ...Qwj.js => kernelAccountClient-DgEyP8pS.js} | 6 +- public/index.html | 2 +- .../typescript/apps/web/tsconfig.tsbuildinfo | 2 +- .../typescript/apps/web/ui/AttestForm.tsx | 58 +- 15 files changed, 589 insertions(+), 558 deletions(-) create mode 100644 public/assets/ccip-CfLiOW7z.js delete mode 100644 public/assets/ccip-L2KjvZow.js rename public/assets/{constants-VN1kIEzb.js => constants-DBcQLFY6.js} (98%) delete mode 100644 public/assets/index-0jpWsoRj.js delete mode 100644 public/assets/index-3O4qPenO.js create mode 100644 public/assets/index-C3_GJ6Eb.js create mode 100644 public/assets/index-C4xokDO6.js delete mode 100644 public/assets/index-CGdEoSbI.js delete mode 100644 public/assets/index-SdYwD8P5.js create mode 100644 public/assets/index-uTQGe5qG.js rename public/assets/{kernelAccountClient-DrOnjQwj.js => kernelAccountClient-DgEyP8pS.js} (65%) diff --git a/backend/src/revoke-duplicates.ts b/backend/src/revoke-duplicates.ts index 177048c..e4203ec 100644 --- a/backend/src/revoke-duplicates.ts +++ b/backend/src/revoke-duplicates.ts @@ -9,7 +9,7 @@ * EXECUTE: PRIVATE_KEY=0x... npx ts-node tools/revoke-duplicates.ts --execute */ -import { createPublicClient, createWalletClient, http, parseAbi } from 'viem'; +import { createPublicClient, createWalletClient, http, parseAbi, type WalletClient, type PublicClient } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { baseSepolia } from 'viem/chains'; @@ -36,11 +36,17 @@ interface DecodedField { } async function fetchIdentityAttestations(): Promise { + const PAGE_SIZE = 100; + const allAttestations: Attestation[] = []; + let skip = 0; + const query = ` - query GetIdentities($schemaId: String!) { + query GetIdentities($schemaId: String!, $take: Int!, $skip: Int!) { attestations( where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } orderBy: { time: asc } + take: $take + skip: $skip ) { id attester @@ -52,21 +58,37 @@ async function fetchIdentityAttestations(): Promise { } `; - const response = await fetch(EAS_GRAPHQL, { - method: 'POST', - headers: { 'Content-Type': 'application/json' }, - body: JSON.stringify({ - query, - variables: { schemaId: IDENTITY_SCHEMA_UID } - }) - }); + while (true) { + const response = await fetch(EAS_GRAPHQL, { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + query, + variables: { schemaId: IDENTITY_SCHEMA_UID, take: PAGE_SIZE, skip } + }) + }); + + if (!response.ok) { + throw new Error(`EAS API error: ${response.statusText}`); + } - if (!response.ok) { - throw new Error(`EAS API error: ${response.statusText}`); + const data = await response.json() as { data?: { attestations?: Attestation[] } }; + const attestations = data?.data?.attestations ?? []; + + if (attestations.length === 0) { + break; + } + + allAttestations.push(...attestations); + + if (attestations.length < PAGE_SIZE) { + break; + } + + skip += PAGE_SIZE; } - const data = await response.json() as { data?: { attestations?: Attestation[] } }; - return data?.data?.attestations ?? []; + return allAttestations; } function extractUsername(attestation: Attestation): string | null { @@ -104,16 +126,31 @@ function findDuplicates(attestations: Attestation[]): Map return duplicates; } -async function revokeAttestation(uid: string, walletClient: any): Promise { +interface RevokeClients { + walletClient: WalletClient; + publicClient: PublicClient; +} + +async function revokeAttestation(uid: string, clients: RevokeClients): Promise<`0x${string}`> { + const { walletClient, publicClient } = clients; + const hash = await walletClient.writeContract({ address: EAS_ADDRESS, abi: EAS_ABI, functionName: 'revoke', args: [{ - schema: IDENTITY_SCHEMA_UID, + schema: IDENTITY_SCHEMA_UID as `0x${string}`, data: [{ uid: uid as `0x${string}`, value: '0x0000000000000000000000000000000000000000000000000000000000000000' as `0x${string}` }] - }] + }], + chain: baseSepolia, }); + + // Wait for transaction confirmation + const receipt = await publicClient.waitForTransactionReceipt({ hash }); + if (receipt.status !== 'success') { + throw new Error(`Transaction failed: ${hash}`); + } + return hash; } @@ -167,14 +204,23 @@ async function main() { process.exit(1); } - // Set up wallet client + // Set up wallet and public clients const account = privateKeyToAccount(privateKey as `0x${string}`); + const transport = http('https://sepolia.base.org'); + const walletClient = createWalletClient({ account, chain: baseSepolia, - transport: http('https://sepolia.base.org') + transport }); + const publicClient = createPublicClient({ + chain: baseSepolia, + transport + }); + + const clients: RevokeClients = { walletClient, publicClient }; + console.log(`šŸ”‘ Using wallet: ${account.address}\n`); // Check that wallet matches attester for all attestations @@ -192,10 +238,11 @@ async function main() { for (const item of toRevoke) { try { console.log(` Revoking ${item.uid.slice(0, 10)}... (${item.username})`); - const hash = await revokeAttestation(item.uid, walletClient); - console.log(` āœ“ TX: ${hash}`); - } catch (err: any) { - console.error(` āœ— Failed: ${err.message}`); + const hash = await revokeAttestation(item.uid, clients); + console.log(` āœ“ TX confirmed: ${hash}`); + } catch (err) { + const message = err instanceof Error ? err.message : String(err); + console.error(` āœ— Failed: ${message}`); } } diff --git a/public/assets/ccip-CfLiOW7z.js b/public/assets/ccip-CfLiOW7z.js new file mode 100644 index 0000000..7e2c667 --- /dev/null +++ b/public/assets/ccip-CfLiOW7z.js @@ -0,0 +1 @@ +import{a2 as p,aw as m,ag as w,a5 as k,h as b,ax as x,ay as L,az as O,x as E,D as R,aA as y,X as M}from"./index-C4xokDO6.js";class S extends p{constructor({callbackSelector:r,cause:a,data:n,extraData:i,sender:f,urls:t}){var o;super(a.shortMessage||"An error occurred while fetching for an offchain result.",{cause:a,metaMessages:[...a.metaMessages||[],(o=a.metaMessages)!=null&&o.length?"":[],"Offchain Gateway Call:",t&&[" Gateway URL(s):",...t.map(d=>` ${m(d)}`)],` Sender: ${f}`,` Data: ${n}`,` Callback selector: ${r}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class $ extends p{constructor({result:r,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(a)}`,`Response: ${w(r)}`],name:"OffchainLookupResponseMalformedError"})}}class q extends p{constructor({sender:r,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}const D="0x556f1830",T={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 G(c,{blockNumber:r,blockTag:a,data:n,to:i}){const{args:f}=k({data:n,abi:[T]}),[t,o,d,l,s]=f,{ccipRead:e}=c,h=e&&typeof(e==null?void 0:e.request)=="function"?e.request:A;try{if(!b(i,t))throw new q({sender:t,to:i});const u=o.includes(x)?await L({data:d,ccipRequest:h}):await h({data:d,sender:t,urls:o}),{data:g}=await O(c,{blockNumber:r,blockTag:a,data:E([l,R([{type:"bytes"},{type:"bytes"}],[u,s])]),to:i});return g}catch(u){throw new S({callbackSelector:l,cause:u,data:n,extraData:s,sender:t,urls:o})}}async function A({data:c,sender:r,urls:a}){var i;let n=new Error("An unknown error occurred.");for(let f=0;f` ${m(d)}`)],` Sender: ${f}`,` Data: ${n}`,` Callback selector: ${r}`,` Extra data: ${i}`].flat(),name:"OffchainLookupError"})}}class q extends p{constructor({result:r,url:a}){super("Offchain gateway response is malformed. Response data must be a hex value.",{metaMessages:[`Gateway URL: ${m(a)}`,`Response: ${w(r)}`],name:"OffchainLookupResponseMalformedError"})}}class S extends p{constructor({sender:r,to:a}){super("Reverted sender address does not match target contract address (`to`).",{metaMessages:[`Contract address: ${a}`,`OffchainLookup sender address: ${r}`],name:"OffchainLookupSenderMismatchError"})}}const G="0x556f1830",T={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 D(c,{blockNumber:r,blockTag:a,data:n,to:i}){const{args:f}=b({data:n,abi:[T]}),[t,o,d,l,s]=f,{ccipRead:e}=c,h=e&&typeof(e==null?void 0:e.request)=="function"?e.request:A;try{if(!k(i,t))throw new S({sender:t,to:i});const u=o.includes(L)?await O({data:d,ccipRequest:h}):await h({data:d,sender:t,urls:o}),{data:g}=await x(c,{blockNumber:r,blockTag:a,data:E([l,R([{type:"bytes"},{type:"bytes"}],[u,s])]),to:i});return g}catch(u){throw new $({callbackSelector:l,cause:u,data:n,extraData:s,sender:t,urls:o})}}async function A({data:c,sender:r,urls:a}){var i;let n=new Error("An unknown error occurred.");for(let f=0;fa==="0.6"?{address:E,version:a}:{address:A,version:a},l="0xd6CEDDe84be40893d153Be9d467CD6aD37875b28",V=Object.freeze(Object.defineProperty({__proto__:null,get CALL_TYPE(){return f},DUMMY_ECDSA_SIG:o,get EXEC_TYPE(){return s},FACTORY_ADDRESS_V0_6:e,FACTORY_ADDRESS_V0_6_INIT_CODE_HASH:d,KERNEL_7702_DELEGATION_ADDRESS:l,KERNEL_IMPLEMENTATION_SLOT:K,KERNEL_NAME:R,KERNEL_V0_2:b,KERNEL_V2_2:D,KERNEL_V2_3:_,KERNEL_V2_4:C,KERNEL_V3_0:x,KERNEL_V3_1:B,KERNEL_V3_2:L,KERNEL_V3_3:F,KERNEL_V3_3_BETA:i,KernelFactoryToInitCodeHashMap:S,KernelVersionToAddressesMap:r,MAGIC_VALUE_SIG_REPLAYABLE:n,ONLY_ENTRYPOINT_HOOK_ADDRESS:N,PLUGIN_TYPE:O,TOKEN_ACTION:I,get VALIDATOR_MODE(){return c},VALIDATOR_TYPE:T,getEntryPoint:u,safeCreateCallAddress:m},Symbol.toStringTag,{value:"Module"}));export{f as C,o as D,s as E,r as K,n as M,N as O,O as P,T as V,E as a,K as b,V as c,c as d,A as e,R as f,x as g,B as h,m as s}; +import{z as t}from"./index-C4xokDO6.js";const E="0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789",A="0x0000000071727De22E5E9d8BAf0edAc6f37da032",o="0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c",n="0x0555ad2729e8da1777a4e5020806f8bf7601c3db6bfe402f410a34958363a95a",e="0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",d="0xee9d8350bd899dd261db689aafd87eb8a30f085adbaff48152399438ff4eed73",r={"0.0.2":{accountImplementationAddress:t,factoryAddress:"0xaee9762ce625e0a8f7b184670fb57c37bfe1d0f1"},"0.2.2":{accountImplementationAddress:"0x0DA6a956B9488eD4dd761E59f52FDc6c8068E6B5",factoryAddress:e,initCodeHash:d},"0.2.3":{accountImplementationAddress:"0xD3F582F6B4814E989Ee8E96bc3175320B5A540ab",factoryAddress:e,initCodeHash:d},"0.2.4":{accountImplementationAddress:"0xd3082872F8B06073A021b4602e022d5A070d7cfC",factoryAddress:e,initCodeHash:d},"0.3.0":{accountImplementationAddress:"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27",factoryAddress:"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",metaFactoryAddress:"0xd703aaE79538628d27099B8c4f621bE4CCd142d5",initCodeHash:"0x6fe6e6ea30eddce942b9618033ab8429f9ddac594053bec8a6744fffc71976e2"},"0.3.1":{accountImplementationAddress:"0xBAC849bB641841b44E965fB01A4Bf5F074f84b4D",factoryAddress:"0xaac5D4240AF87249B3f71BC8E4A2cae074A3E419",metaFactoryAddress:"0xd703aaE79538628d27099B8c4f621bE4CCd142d5",initCodeHash:"0x85d96aa1c9a65886d094915d76ccae85f14027a02c1647dde659f869460f03e6"},"0.3.2":{accountImplementationAddress:"0xD830D15D3dc0C269F3dBAa0F3e8626d33CFdaBe1",factoryAddress:"0x7a1dBAB750f12a90EB1B60D2Ae3aD17D4D81EfFe",metaFactoryAddress:"0xd703aaE79538628d27099B8c4f621bE4CCd142d5",initCodeHash:"0xc7c48c9dd12de68b8a4689b6f8c8c07b61d4d6fa4ddecdd86a6980d045fa67eb"},"0.3.3":{accountImplementationAddress:"0xd6CEDDe84be40893d153Be9d467CD6aD37875b28",factoryAddress:"0x2577507b78c2008Ff367261CB6285d44ba5eF2E9",metaFactoryAddress:"0xd703aaE79538628d27099B8c4f621bE4CCd142d5",initCodeHash:"0xc452397f1e7518f8cea0566ac057e243bb1643f6298aba8eec8cdee78ee3b3dd"}},b="0.0.2",D="0.2.2",_="0.2.3",C="0.2.4",x="0.3.0",B="0.3.1",L="0.3.2",i="0.3.3",F="0.3.3",I="0x2087C7FfD0d0DAE80a00EE74325aBF3449e0eaf1",N="0xb230f0A1C7C95fa11001647383c8C7a8F316b900",R="Kernel",T={SUDO:"0x00",SECONDARY:"0x01",PERMISSION:"0x02",EIP7702:"0x00"};var c;(function(a){a.DEFAULT="0x00",a.ENABLE="0x01"})(c||(c={}));var f;(function(a){a.SINGLE="0x00",a.BATCH="0x01",a.DELEGATE_CALL="0xFF"})(f||(f={}));var s;(function(a){a.DEFAULT="0x00",a.TRY_EXEC="0x01"})(s||(s={}));const O={VALIDATOR:1,EXECUTOR:2,FALLBACK:3,HOOK:4,POLICY:5,SIGNER:6},m="0x9b35Af71d77eaf8d7e40252370304687390A1A52",S={"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3":"0xee9d8350bd899dd261db689aafd87eb8a30f085adbaff48152399438ff4eed73","0x6723b44Abeec4E71eBE3232BD5B455805baDD22f":"0x6fe6e6ea30eddce942b9618033ab8429f9ddac594053bec8a6744fffc71976e2"},K="0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc",u=a=>a==="0.6"?{address:E,version:a}:{address:A,version:a},l="0xd6CEDDe84be40893d153Be9d467CD6aD37875b28",V=Object.freeze(Object.defineProperty({__proto__:null,get CALL_TYPE(){return f},DUMMY_ECDSA_SIG:o,get EXEC_TYPE(){return s},FACTORY_ADDRESS_V0_6:e,FACTORY_ADDRESS_V0_6_INIT_CODE_HASH:d,KERNEL_7702_DELEGATION_ADDRESS:l,KERNEL_IMPLEMENTATION_SLOT:K,KERNEL_NAME:R,KERNEL_V0_2:b,KERNEL_V2_2:D,KERNEL_V2_3:_,KERNEL_V2_4:C,KERNEL_V3_0:x,KERNEL_V3_1:B,KERNEL_V3_2:L,KERNEL_V3_3:F,KERNEL_V3_3_BETA:i,KernelFactoryToInitCodeHashMap:S,KernelVersionToAddressesMap:r,MAGIC_VALUE_SIG_REPLAYABLE:n,ONLY_ENTRYPOINT_HOOK_ADDRESS:N,PLUGIN_TYPE:O,TOKEN_ACTION:I,get VALIDATOR_MODE(){return c},VALIDATOR_TYPE:T,getEntryPoint:u,safeCreateCallAddress:m},Symbol.toStringTag,{value:"Module"}));export{f as C,o as D,s as E,r as K,n as M,N as O,O as P,T as V,E as a,K as b,V as c,c as d,A as e,R as f,x as g,B as h,m as s}; diff --git a/public/assets/index-0jpWsoRj.js b/public/assets/index-0jpWsoRj.js deleted file mode 100644 index 7427ec7..0000000 --- a/public/assets/index-0jpWsoRj.js +++ /dev/null @@ -1 +0,0 @@ -import{b as X,t as _e,c as ie,v as F,F as Se,M as xe,n as de,o as J,e as se,f as ce,h as ue,j as le,k as fe,d as ge,l as Ae,K as Te,p as he,q as $,r as z,u as N,w as ye,C as He,x as W,H as ke,a3 as Oe,B as re,y as Re,z as Ke,A as ze}from"./kernelAccountClient-DrOnjQwj.js";import{T as x,aa as Ne,ah as Fe,ai as Le,aj as Ve,ak as Pe,al as Ue,am as Ye,a3 as U,an as q,E as Z,ad as L,ao as we,a4 as Ce,ap as Be,aq as We,W as V,O as ee,P as Q,Q as R,V as H,C as D,D as $e,R as te,X as pe,Y as Ee,_ as Ie,$ as me,ar as Ge,a0 as je,a1 as qe,a2 as Qe}from"./index-CGdEoSbI.js";import{b as Xe,K as k,V as O,e as De,D as Je,M as ve,d as Ze}from"./constants-VN1kIEzb.js";function et({abi:e,address:t,client:n}){const a=n,[o,s]=a?"public"in a&&"wallet"in a?[a.public,a.wallet]:"public"in a?[a.public,void 0]:"wallet"in a?[void 0,a.wallet]:[a,a]:[void 0,void 0],C=o!=null,I=s!=null,f={};let A=!1,h=!1,m=!1;for(const u of e)if(u.type==="function"?u.stateMutability==="view"||u.stateMutability==="pure"?A=!0:h=!0:u.type==="event"&&(m=!0),A&&h&&m)break;return C&&(A&&(f.read=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(o,Ne,"readContract")({abi:e,address:t,functionName:w,args:d,...g})}}})),h&&(f.simulate=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(o,Fe,"simulateContract")({abi:e,address:t,functionName:w,args:d,...g})}}})),m&&(f.createEventFilter=new Proxy({},{get(u,w){return(...c)=>{const d=e.find(v=>v.type==="event"&&v.name===w),{args:g,options:E}=j(c,d);return x(o,Le,"createContractEventFilter")({abi:e,address:t,eventName:w,args:g,...E})}}}),f.getEvents=new Proxy({},{get(u,w){return(...c)=>{const d=e.find(v=>v.type==="event"&&v.name===w),{args:g,options:E}=j(c,d);return x(o,Ve,"getContractEvents")({abi:e,address:t,eventName:w,args:g,...E})}}}),f.watchEvent=new Proxy({},{get(u,w){return(...c)=>{const d=e.find(v=>v.type==="event"&&v.name===w),{args:g,options:E}=j(c,d);return x(o,Pe,"watchContractEvent")({abi:e,address:t,eventName:w,args:g,...E})}}}))),I&&h&&(f.write=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(s,Ue,"writeContract")({abi:e,address:t,functionName:w,args:d,...g})}}})),(C||I)&&h&&(f.estimateGas=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(o??s,Ye,"estimateContractGas")({abi:e,address:t,functionName:w,args:d,...g,account:g.account??s.account})}}})),f.address=t,f.abi=e,f}function Y(e){const t=e.length&&Array.isArray(e[0]),n=t?e[0]:[],a=(t?e[1]:e[0])??{};return{args:n,options:a}}function j(e,t){let n=!1;Array.isArray(e[0])?n=!0:e.length===1?n=t.inputs.some(s=>s.indexed):e.length===2&&(n=!0);const a=n?e[0]:void 0,o=(n?e[1]:e[0])??{};return{args:a,options:o}}function oe(e){return!e||typeof e!="object"||!("BYTES_PER_ELEMENT"in e)?!1:e.BYTES_PER_ELEMENT===1&&e.constructor.name==="Uint8Array"}function tt(e){return at(e)}function at(e){const t=U(q(e.from)),n=Z(oe(e.salt)?e.salt:U(e.salt),{size:32}),a="bytecodeHash"in e?oe(e.bytecodeHash)?e.bytecodeHash:U(e.bytecodeHash):L(e.bytecode,"bytes");return q(we(L(Ce([U("0xff"),t,n,a])),12))}const nt=async(e,t)=>{const{address:n}=t,a=await x(e,Be,"getStorageAt")({address:n,slot:Xe});if(!a)throw new Error("Kernel implementation address not found");const o=we(a,12),s=We(o)?o:V(o);return q(s)},st={"0.0.2 - 0.2.4":"0xd9AB5096a832b9ce79914329DAEE236f8Eea0390","0.3.0":"0x8104e3Ad430EA6d354d013A6789fDFc71E671c43",">=0.3.1":"0x845ADb2C711129d4f3966735eD98a9F09fC4cE57"},G=(e,t,n)=>{var o;F(e.version,t);const a=(o=Object.entries(st).find(([s])=>Se(t,s)))==null?void 0:o[1];if(!a&&!n)throw new Error(`Validator not found for Kernel version: ${t}`);return n??a??R};async function be(e,{signer:t,entryPoint:n,kernelVersion:a,validatorAddress:o}){const s=G(n,a,o),C=await X({signer:t}),I=await ee(e);return{..._e({address:C.address,async signMessage({message:A}){return Q(e,{account:C,message:A})},async signTransaction(A,h){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(A){return C.signTypedData(A)}}),supportedKernelVersions:a,validatorType:"SECONDARY",address:s,source:"ECDSAValidator",getIdentifier(){return s},async getEnableData(){return C.address},async getNonceKey(A,h){return h||0n},async signUserOperation(A){const h=ie({userOperation:{...A,signature:"0x"},entryPointAddress:n.address,entryPointVersion:n.version,chainId:I});return await Q(e,{account:C,message:{raw:h}})},async getStubSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"},async isEnabled(A,h){return!1}}}const rt=async(e,t,n)=>{F(t.version,n);const a=k[n];return t.version==="0.6"?await ot(e,a.factoryAddress):it(a.accountImplementationAddress)},ot=async(e,t)=>await et({address:t,abi:[{type:"function",name:"initCodeHash",inputs:[],outputs:[{name:"result",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"}],client:e}).read.initCodeHash(),it=e=>{if(!$e(e))throw new Error("Invalid implementation address");const t=D(["0x603d3d8160223d3973",e,"0x6009","0x5155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076","0xcc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3"]);return L(t)},dt=(e,t,n)=>{const a=V(t,{size:32}),o=H({abi:xe,functionName:"initialize",args:[n,e]}),s=Ce([o,a]),C=BigInt(L(s)),I=BigInt("0xffffffffffffffffffffffff");return V(C&I,{size:32})},ct=(e,t,n,a,o,s,C)=>{const I=V(t,{size:32});let f;if(s==="0.3.0"){f=H({abi:de,functionName:"initialize",args:[D([O.SECONDARY,o]),n,e,a]});const h=D([f,I]);return L(h)}f=H({abi:J,functionName:"initialize",args:[D([O.SECONDARY,o]),n,e,a,C]});const A=D([f,I]);return L(A)};async function wt(e){F(e.entryPoint.version,e.kernelVersion);const t=k[e.kernelVersion],n=G(e.entryPoint,e.kernelVersion),a=await(async()=>{if("initCodeHash"in e&&e.initCodeHash)return e.initCodeHash;if("publicClient"in e&&e.publicClient)return await rt(e.publicClient,e.entryPoint,e.kernelVersion);throw new Error("Either initCodeHash or publicClient must be provided")})();let o;if(e.entryPoint.version==="0.6")o=dt(e.eoaAddress,e.index,n);else{const s="hookAddress"in e&&e.hookAddress?e.hookAddress:R,C="hookData"in e&&e.hookData?e.hookData:"0x",I="initConfig"in e&&e.initConfig?e.initConfig:[];o=ct(e.eoaAddress,e.index,s,C,n,e.kernelVersion,I)}return tt({bytecodeHash:a,opcode:"CREATE2",from:t.factoryAddress,salt:o})}const ut=({entryPointVersion:e,kernelVersion:t,validatorAddress:n,validatorData:a})=>{const o=D([O.SECONDARY,n]);return t==="0.3.0"?H({abi:de,functionName:"initialize",args:[o,R,a,"0x"]}):H({abi:J,functionName:"initialize",args:[o,R,a,"0x",[]]})},lt=async({entryPointVersion:e,kernelVersion:t,validatorData:n,index:a,factoryAddress:o,validatorAddress:s})=>{const C=ut({entryPointVersion:e,kernelVersion:t,validatorAddress:s,validatorData:n});return H({abi:Te,functionName:"deployWithFactory",args:[o,C,V(a,{size:32})]})},B=async(e,t,n)=>{const a=await nt(e,{address:t});return te(a,k[n].accountImplementationAddress)};async function Ct(e,{entryPoint:t,signer:n,index:a=0n,address:o,migrationVersion:s,pluginMigrations:C}){if(t.version==="0.6")throw new Error("EntryPointV0.6 is not supported for migration");F(t.version,s.from),F(t.version,s.to);const I=k[s.from],f=G(t,s.from),A=G(t,s.to),h=await X({signer:n});let m;const u=async()=>m||(m=e.chain?e.chain.id:await x(e,ee,"getChainId")({}),m),w=async()=>lt({entryPointVersion:t.version,factoryAddress:I.factoryAddress,index:a,kernelVersion:s.from,validatorAddress:f,validatorData:h.address}),c=async()=>({factory:I.metaFactoryAddress??R,factoryData:await w()});let d=o??await(async()=>{const{factory:l,factoryData:p}=await c();return await se(e,{factory:l,factoryData:p,entryPointAddress:t.address})})(),g=await B(e,d,s.to);const E={pendingPlugins:C||[],allInstalled:!1},v=async()=>{if(!E.pendingPlugins.length||E.allInstalled){E.allInstalled=!0;return}const l=await Promise.all(E.pendingPlugins.map(p=>Ae(e,{address:d,plugin:p})));E.pendingPlugins=E.pendingPlugins.filter((p,r)=>!l[r]),E.allInstalled=E.pendingPlugins.length===0};await v();const M={address:(t==null?void 0:t.address)??De,abi:((t==null?void 0:t.version)??"0.7")==="0.6"?ce:ue,version:(t==null?void 0:t.version)??"0.7"};return le({kernelVersion:s.to,kernelPluginManager:await ge(e,{entryPoint:t,kernelVersion:s.to,chainId:await u(),sudo:await be(e,{entryPoint:t,signer:h,kernelVersion:s.to,validatorAddress:A})}),factoryAddress:(await c()).factory,generateInitCode:w,accountImplementationAddress:k[s.to].accountImplementationAddress,encodeModuleInstallCallData:async()=>{throw new Error("Not implemented")},nonceKeyManager:fe({source:{get:()=>0,set:()=>{}}}),client:e,entryPoint:M,getFactoryArgs:c,async getAddress(){if(d)return d;const{factory:l,factoryData:p}=await c();return d=await se(e,{factory:l,factoryData:p,entryPointAddress:t.address}),d},async encodeDeployCallData(l){throw new Error("Not implemented")},async encodeCalls(l,p){await v();const r=[];if(E.pendingPlugins.length>0&&t.version==="0.7")for(const y of E.pendingPlugins)r.push(ye(d,y));g=g||await B(e,d,s.to);let i=l;if(g)i=[...r,...l];else{const y=k[s.to].accountImplementationAddress,_={to:d,data:H({abi:He,functionName:"upgradeTo",args:[y]}),value:0n};if(!te(f,A)){const b=D([O.SECONDARY,Z(A,{size:20,dir:"right"})]),S={to:d,data:H({abi:J,functionName:"changeRootValidator",args:[b,R,h.address,"0x"]}),value:0n};i=[_,S,...r,...l]}i=[_,...r,...l]}return W(i,p)},async sign({hash:l}){return this.signMessage({message:l})},async signMessage({message:l,useReplayableSignature:p}){g=g||await B(e,d,s.to);const r=me(l),i=g?s.to:s.from,y=i==="0.3.0"?"0.3.0-beta":i,_=await $(r,{name:"Kernel",chainId:m,version:y,verifyingContract:d},p);let b=await h.signMessage({message:{raw:_}});return z(N.ERC1271_WITH_VALIDATOR,y)?(p&&z(N.ERC1271_REPLAYABLE,y)&&(b=D([ve,b])),D([O.SUDO,b])):b},async signTypedData(l){const{message:p,primaryType:r,types:i,domain:y}=l,_={EIP712Domain:pe({domain:y}),...i};Ee({domain:y,message:p,primaryType:r,types:_});const b=Ie(l);g=g||await B(e,d,s.to);const S=g?s.to:s.from,K=S==="0.3.0"?"0.3.0-beta":S,T=await $(b,{name:"Kernel",chainId:m,version:K,verifyingContract:d}),P=await h.signMessage({message:{raw:T}});return z(N.ERC1271_WITH_VALIDATOR,K)?D([O.SUDO,P]):P},async getNonce(l){const p=ft(f,l==null?void 0:l.key);return he(e,{address:d,entryPointAddress:t.address,key:p})},async getStubSignature(){return Je},async signUserOperation(l){const{chainId:p=await u(),...r}=l,i=ie({userOperation:{...r,sender:r.sender??d,signature:"0x"},entryPointAddress:t.address,entryPointVersion:t.version,chainId:p});return await Q(e,{account:h,message:{raw:i}})}})}const ft=(e,t=0n)=>{if(t>Ge)throw new Error("nonce key must be equal or less than 2 bytes(maxUint16) for Kernel version v0.7");const n=Ze.DEFAULT,a=O.SUDO,o=Z(D([n,a,e,V(t,{size:2})]),{size:24});return BigInt(o)};function pt(e){return ke({...e,account:e.account,userOperation:{...e.userOperation,prepareUserOperation:async(t,n)=>{const a=n.authorization||await e.account.signAuthorization(),o={...n,authorization:a};return await Oe(t,o)}}})}const gt=(e,t,{accountImplementationAddress:n,factoryAddress:a,metaFactoryAddress:o})=>{F(e,t);const s=k[t];if(!s)throw new Error(`No addresses found for kernel version ${t}`);return{accountImplementationAddress:n??s.accountImplementationAddress,factoryAddress:s.factoryAddress,metaFactoryAddress:s.metaFactoryAddress??R}};async function Et(e,{signer:t,plugins:n,entryPoint:a,accountImplementationAddress:o,kernelVersion:s,pluginMigrations:C,eip7702Auth:I}){var p;const{accountImplementationAddress:f}=gt(a.version,s,{accountImplementationAddress:o,factoryAddress:void 0,metaFactoryAddress:void 0});let A,h;typeof t=="object"&&t!==null&&"account"in t&&(h=(p=t.account)==null?void 0:p.address);const m=await X({signer:t,address:h}),u=m.address,w=async()=>A||(A=e.chain?e.chain.id:await x(e,ee,"getChainId")({}),A),c=await ge(e,{sudo:await be(e,{signer:m,entryPoint:a,kernelVersion:s}),entryPoint:a,kernelVersion:s,chainId:await w()}),d=async()=>"0x",g=async()=>({factory:void 0,factoryData:void 0}),E=async()=>{const r=await je(e,{address:u});if(!r||r.length===0||!r.toLowerCase().startsWith(`0xef0100${f.slice(2).toLowerCase()}`)){if(I&&!te(I.address,f))throw new Error("EIP-7702 authorization delegate address does not match account implementation address");const i=I??await qe(e,{account:m,address:f,chainId:await w()});if(!await Qe({authorization:i,address:u}))throw new Error("Authorization verification failed");return i}},v={address:(a==null?void 0:a.address)??De,abi:((a==null?void 0:a.version)??"0.7")==="0.6"?ce:ue,version:(a==null?void 0:a.version)??"0.7"},M={pendingPlugins:C||[],allInstalled:!1},l=async()=>{if(!M.pendingPlugins.length||M.allInstalled){M.allInstalled=!0;return}const r=await Promise.all(M.pendingPlugins.map(i=>Ae(e,{address:u,plugin:i})));M.pendingPlugins=M.pendingPlugins.filter((i,y)=>!r[y]),M.allInstalled=M.pendingPlugins.length===0};return await l(),le({kernelVersion:s,kernelPluginManager:c,accountImplementationAddress:f,factoryAddress:void 0,generateInitCode:d,encodeModuleInstallCallData:async()=>await c.encodeModuleInstallCallData(u),nonceKeyManager:fe({source:{get:()=>0,set:()=>{}}}),client:e,entryPoint:v,getFactoryArgs:g,async getAddress(){return u},signAuthorization:E,async encodeDeployCallData(r){return a.version==="0.6"?Ke(r):ze(r)},async encodeCalls(r,i){if(await l(),M.pendingPlugins.length>0&&a.version==="0.7"&&c.activeValidatorMode==="sudo"){const y=[];for(const _ of M.pendingPlugins)y.push(ye(u,_));return W([...r,...y],i,n!=null&&n.hook?!0:void 0)}return r.length===1&&(!i||i==="call")&&r[0].to.toLowerCase()===u.toLowerCase()?r[0].data??"0x":a.version==="0.6"?Re(r,i):n!=null&&n.hook?W(r,i,!0):W(r,i)},async sign({hash:r}){return this.signMessage({message:r})},async signMessage({message:r,useReplayableSignature:i}){const y=me(r),{name:_,chainId:b,version:S}=await re(e,u,s,A),K=await $(y,{name:_,chainId:Number(b),version:S,verifyingContract:u},i);let T=await c.signMessage({message:{raw:K}});return z(N.ERC1271_WITH_VALIDATOR,S)?(i&&z(N.ERC1271_REPLAYABLE,S)&&(T=D([ve,T])),D([c.getIdentifier(),T])):T},async signTypedData(r){const{message:i,primaryType:y,types:_,domain:b}=r,S={EIP712Domain:pe({domain:b}),..._};Ee({domain:b,message:i,primaryType:y,types:S});const K=Ie(r),{name:T,chainId:P,version:ae}=await re(e,u,s,A),Me=await $(K,{name:T,chainId:Number(P),version:ae,verifyingContract:u}),ne=await c.signMessage({message:{raw:Me}});return z(N.ERC1271_WITH_VALIDATOR,ae)?D([c.getIdentifier(),ne]):ne},async getNonce(r){const i=await c.getNonceKey(u,r==null?void 0:r.key);return he(e,{address:u,entryPointAddress:a.address,key:i})},async getStubSignature(r){if(!r)throw new Error("No user operation provided");return c.getStubSignature(r)},async signUserOperation(r){const{chainId:i=await w(),...y}=r;return c.signUserOperation({...y,sender:y.sender??await this.getAddress(),chainId:i})}})}export{Et as create7702KernelAccount,pt as create7702KernelAccountClient,Ct as createEcdsaKernelMigrationAccount,wt as getKernelAddressFromECDSA,G as getValidatorAddress,st as kernelVersionRangeToValidator,be as signerToEcdsaValidator}; diff --git a/public/assets/index-3O4qPenO.js b/public/assets/index-3O4qPenO.js deleted file mode 100644 index 2198fa4..0000000 --- a/public/assets/index-3O4qPenO.js +++ /dev/null @@ -1 +0,0 @@ -import{g as _e,a as Le,t as X,b as Te,c as xe,s as Ue,i as ne,d as Be,e as R,f as de,h as Ke,j as oe,k as ce,v as ke,l as He,K as Ge,m as Xe,n as ze,o as We,p as ye,q as Ae,r as $,u as q,w as Ye,x as J,y as $e,z as qe,A as Je,B as Qe,C as Q,D as Ze,E as je,F as et,G as tt,H as Jt}from"./kernelAccountClient-DrOnjQwj.js";import{I as Aa,J as Da,L as Ca,M as Ea,S as Ta,N as xa,O as Ba,P as Fa,Q as ga,R as ha,T as Ia,U as wa,V as Ma,W as va,X as Sa,Y as Ra,Z as Na,_ as Va,$ as Pa,a0 as Oa,a1 as _a,a2 as La}from"./kernelAccountClient-DrOnjQwj.js";import{B as at,C as M,D as nt,I as st,E as G,F as rt,G as it,H as dt,J as ot,K as ct,L as yt,N as pt,U as ut,O as z,P as se,Q as v,R as Z,T as pe,V as A,W as re,X as Fe,Y as ge,_ as he,$ as lt,a0 as bt,a1 as ft,a2 as mt,a3 as At,a4 as ie,a5 as De,a6 as j,a7 as ue,a8 as le,a9 as Dt,aa as Ct,ab as Et,ac as Tt,ad as xt,ae as Bt,af as Ft,ag as gt}from"./index-CGdEoSbI.js";import{e as ht,K as Ie,M as It,a as we,C as wt,V as Mt,P as vt}from"./constants-VN1kIEzb.js";import{c as Ka}from"./constants-VN1kIEzb.js";function St(t,e){if(t.length!==e.length)throw new at({expectedLength:t.length,givenLength:e.length});const a=[];for(let n=0;nLe(t,e),getPaymasterStubData:e=>_e(t,e)}}function Nt(t){return{...X({address:t,async signMessage(){throw new Error("Method not supported")},async signTransaction(a){throw new Error("Method not supported")},async signTypedData(a){throw new Error("Method not supported")}}),publicKey:"0x",source:"empty"}}async function Vt(t,{signer:e,entryPoint:a,kernelVersion:n}){var u;const r=await Te({signer:e}),i=((u=t.chain)==null?void 0:u.id)??await z(t);return{...X({address:r.address,async signMessage({message:c}){return se(t,{account:r,message:c})},async signTransaction(c,d){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(c){return r.signTypedData(c)}}),supportedKernelVersions:n,validatorType:"EIP7702",address:r.address,source:"EIP7702Validator",getIdentifier(){return"0x"},async getEnableData(){return r.address},async getNonceKey(c,d){return d||0n},async signUserOperation(c){const d=xe({userOperation:{...c,signature:"0x"},entryPointAddress:a.address,entryPointVersion:a.version,chainId:i});return await se(t,{account:r,message:{raw:d}})},async getStubSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"},async isEnabled(c,d){return!1}}}const Pt=[{type:"constructor",inputs:[{name:"_impl",type:"address",internalType:"address"}],stateMutability:"nonpayable"},{type:"function",name:"createAccount",inputs:[{name:"data",type:"bytes",internalType:"bytes"},{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"payable"},{type:"function",name:"getAddress",inputs:[{name:"data",type:"bytes",internalType:"bytes"},{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"implementation",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"error",name:"InitializeError",inputs:[]}],Ot=[{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"address",name:"proxy",type:"address"}],stateMutability:"payable",type:"function"}],jt={ACCOUNT_LOGIC_V0_6:"0xd3082872F8B06073A021b4602e022d5A070d7cfC",ACCOUNT_LOGIC_V0_7:"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27",FACTORY_ADDRESS_V0_6:"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",FACTORY_ADDRESS_V0_7:"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",FACTORY_STAKER:"0xd703aaE79538628d27099B8c4f621bE4CCd142d5"},_t=async({entryPointVersion:t,kernelPluginManager:e,initHook:a,kernelVersion:n,initConfig:r})=>{var d,C,E,y;const{enableData:i,identifier:o,validatorAddress:u,initConfig:c}=await e.getValidatorInitData();return t==="0.6"?A({abi:Xe,functionName:"initialize",args:[u,i]}):n==="0.3.0"?A({abi:ze,functionName:"initialize",args:[o,a&&e.hook?(d=e.hook)==null?void 0:d.getIdentifier():v,i,a&&e.hook?await((C=e.hook)==null?void 0:C.getEnableData()):"0x"]}):A({abi:We,functionName:"initialize",args:[o,a&&e.hook?(E=e.hook)==null?void 0:E.getIdentifier():v,i,a&&e.hook?await((y=e.hook)==null?void 0:y.getEnableData()):"0x",r??c??[]]})},Lt=async({index:t,factoryAddress:e,accountImplementationAddress:a,entryPointVersion:n,kernelPluginManager:r,initHook:i,kernelVersion:o,initConfig:u,useMetaFactory:c})=>{const d=await _t({entryPointVersion:n,kernelPluginManager:r,initHook:i,kernelVersion:o,initConfig:u});return n==="0.6"?A({abi:Ot,functionName:"createAccount",args:[a,d,t]}):c?A({abi:Ge,functionName:"deployWithFactory",args:[e,d,re(t,{size:32})]}):A({abi:Pt,functionName:"createAccount",args:[d,re(t,{size:32})]})},Ut=(t,e,{accountImplementationAddress:a,factoryAddress:n,metaFactoryAddress:r})=>{ke(t,e);const i=Ie[e];if(!i)throw new Error(`No addresses found for kernel version ${e}`);return{accountImplementationAddress:a??i.accountImplementationAddress,factoryAddress:n??i.factoryAddress,metaFactoryAddress:r??i.metaFactoryAddress??v}};async function Ce(t,{plugins:e,entryPoint:a,index:n=0n,factoryAddress:r,accountImplementationAddress:i,metaFactoryAddress:o,address:u,kernelVersion:c,initConfig:d,useMetaFactory:C=!0,eip7702Auth:E,eip7702Account:y,pluginMigrations:m}){var me;const s=!!y||!!E;if(s&&!Ue.satisfies(c,">=0.3.3"))throw new Error("EIP-7702 is recommended for kernel version >=0.3.3");const l=y?await Te({signer:y,address:u}):void 0;let D;l&&(D=await Vt(t,{signer:l,entryPoint:a,kernelVersion:c}));let B=C;const{accountImplementationAddress:h,factoryAddress:N,metaFactoryAddress:P}=Ut(a.version,c,{accountImplementationAddress:i,factoryAddress:r,metaFactoryAddress:o});let V,L;const U=async()=>V||(V=t.chain?t.chain.id:await pe(t,z,"getChainId")({}),V),be=async()=>L||(L=await Qe(t,f,c,await U()),L),T=ne(e)?e:await Be(t,{sudo:l?D:e==null?void 0:e.sudo,regular:e==null?void 0:e.regular,hook:e==null?void 0:e.hook,action:e==null?void 0:e.action,pluginEnableSignature:e==null?void 0:e.pluginEnableSignature,entryPoint:a,kernelVersion:c,chainId:await U()}),Ne=!!(ne(e)?e.hook&&e.getIdentifier()===((me=e.sudoValidator)==null?void 0:me.getIdentifier()):e!=null&&e.hook&&!(e!=null&&e.regular)),W=async()=>{if(s)return"0x";if(!h||!N)throw new Error("Missing account logic address or factory address");return Lt({index:n,factoryAddress:N,accountImplementationAddress:h,entryPointVersion:a.version,kernelPluginManager:T,initHook:Ne,kernelVersion:c,initConfig:d,useMetaFactory:B})},K=async()=>s?{factory:void 0,factoryData:void 0}:{factory:a.version==="0.6"||B===!1?N:P,factoryData:await W()};let f=u??(s?(l==null?void 0:l.address)??v:await(async()=>{const{factory:p,factoryData:b}=await K();if(!p||!b)throw new Error("Missing factory address or factory data");return await R(t,{factory:p,factoryData:b,entryPointAddress:a.address})})());Z(f,v)&&B&&(B=!1,f=await R(t,{factory:N,factoryData:await W(),entryPointAddress:a.address}),Z(f,v)&&(B=!0));const Ve={address:(a==null?void 0:a.address)??ht,abi:((a==null?void 0:a.version)??"0.7")==="0.6"?de:Ke,version:(a==null?void 0:a.version)??"0.7"},g={pendingPlugins:m||[],allInstalled:!1},fe=async()=>{if(!g.pendingPlugins.length||g.allInstalled){g.allInstalled=!0;return}const p=await Promise.all(g.pendingPlugins.map(b=>He(t,{address:f,plugin:b})));g.pendingPlugins=g.pendingPlugins.filter((b,x)=>!p[x]),g.allInstalled=g.pendingPlugins.length===0},Pe=async()=>{const p=await bt(t,{address:f});if(!p||p.length===0||!p.toLowerCase().startsWith(`0xef0100${h.slice(2).toLowerCase()}`)){if(E&&!Z(E.address,h))throw new Error("EIP-7702 authorization delegate address does not match account implementation address");const b=E??await ft(t,{account:l,address:h,chainId:await U()});if(!await mt({authorization:b,address:f}))throw new Error("Authorization verification failed");return b}};return await fe(),oe({authorization:s?{account:l??Nt(f),address:h}:void 0,kernelVersion:c,kernelPluginManager:T,accountImplementationAddress:h,factoryAddress:(await K()).factory,generateInitCode:W,encodeModuleInstallCallData:async()=>await T.encodeModuleInstallCallData(f),nonceKeyManager:ce({source:{get:()=>0,set:()=>{}}}),client:t,entryPoint:Ve,getFactoryArgs:K,async getAddress(){if(f)return f;const{factory:p,factoryData:b}=await K();if(!p||!b)throw new Error("Missing factory address or factory data");return f=await R(t,{factory:p,factoryData:b,entryPointAddress:a.address}),f},async encodeDeployCallData(p){return a.version==="0.6"?qe(p):Je(p)},async encodeCalls(p,b,x){if(await fe(),g.pendingPlugins.length>0&&a.version==="0.7"&&T.activeValidatorMode==="sudo"){const I=[];for(const w of g.pendingPlugins)I.push(Ye(f,w));return J([...p,...I],b,e!=null&&e.hook?!0:void 0,x)}return p.length===1&&(!b||b==="call")&&p[0].to.toLowerCase()===f.toLowerCase()?p[0].data??"0x":a.version==="0.6"?$e(p,b):e!=null&&e.hook?J(p,b,!0,x):J(p,b,void 0,x)},eip7702Authorization:Pe,async sign({hash:p}){return this.signMessage({message:p})},async signMessage({message:p,useReplayableSignature:b}){const x=lt(p),{name:I,chainId:w,version:S}=await be();let F;if(s)F=await T.signTypedData({message:{hash:x},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:I,version:S,chainId:b?0:Number(w),verifyingContract:f}});else if(a.version==="0.6"){const O=await Ae(x,{name:I,chainId:Number(w),version:S,verifyingContract:f},b);F=await T.signMessage({message:{raw:O}})}else F=await T.signTypedData({message:{hash:x},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:I,version:S,chainId:b?0:Number(w),verifyingContract:f}});return $(q.ERC1271_WITH_VALIDATOR,S)?(b&&$(q.ERC1271_REPLAYABLE,S)&&(F=M([It,F])),M([T.getIdentifier(),F])):F},async signTypedData(p){const{message:b,primaryType:x,types:I,domain:w}=p,S={EIP712Domain:Fe({domain:w}),...I};ge({domain:w,message:b,primaryType:x,types:S});const F=he(p),{name:O,chainId:Y,version:k}=await be();let _;if(s)_=await T.signTypedData({message:{hash:F},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:O,version:k,chainId:Number(Y),verifyingContract:f}});else if(a.version==="0.6"){const Oe=await Ae(F,{name:O,chainId:Number(Y),version:k,verifyingContract:f});_=await T.signMessage({message:{raw:Oe}})}else _=await T.signTypedData({message:{hash:F},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:O,version:k,chainId:Number(Y),verifyingContract:f}});return $(q.ERC1271_WITH_VALIDATOR,k)?M([T.getIdentifier(),_]):_},async getNonce(p){const b=await T.getNonceKey(f,p==null?void 0:p.key);return ye(t,{address:f,entryPointAddress:a.address,key:b})},async getStubSignature(p){if(!p)throw new Error("No user operation provided");return T.getStubSignature(p)},async signUserOperation(p){const{chainId:b=await U(),...x}=p;return T.signUserOperation({...x,sender:x.sender??await this.getAddress(),chainId:b})}})}const ve="0x8ae01fcf7c655655ff2c6ef907b8b4718ab4e17c",Se=[{type:"function",name:"multiSend",inputs:[{type:"bytes",name:"transactions"}]}],Kt=t=>{const e=At(t.data);return St(["uint8","address","uint256","uint256","bytes"],[t.callType==="delegatecall"?1:0,t.to,t.value||0n,BigInt(e.length),t.data]).slice(2)},Re=t=>{if(!Array.isArray(t))throw new Error("Invalid multiSend calls, should use an array of calls");return`0x${t.map(e=>Kt(e)).join("")}`},kt=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"contract EIP1967Proxy",name:"proxy",type:"address"}],stateMutability:"nonpayable",type:"function"}],ee=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"operation",type:"uint8"}],name:"executeAndRevert",outputs:[],stateMutability:"nonpayable",type:"function"}],Ht={FACTORY_ADDRESS:"0x4E4946298614FC299B50c947289F4aD0572CB9ce"};async function ea(t,{signer:e,address:a,entryPoint:n,index:r=0n}){const i={...e,signTransaction:(y,m)=>{throw new Error("Smart account signer doesn't need to sign transactions")}},o=await z(t),u=async()=>A({abi:kt,functionName:"createAccount",args:[e.address,r]}),c=async()=>({factory:Ht.FACTORY_ADDRESS,factoryData:await u()});let d=a??await(async()=>{const{factory:y,factoryData:m}=await c();return await R(t,{factory:y,factoryData:m,entryPointAddress:n.address})})();if(!d)throw new Error("Account address not found");const C=X({address:d,async signMessage({message:y}){return i.signMessage({message:y})},async signTransaction(y,m){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(y){return i.signTypedData(y)}}),E={address:(n==null?void 0:n.address)??we,abi:de,version:(n==null?void 0:n.version)??"0.6"};return oe({...C,generateInitCode:u,encodeModuleInstallCallData:async()=>{throw new Error("Not implemented")},nonceKeyManager:ce({source:{get:()=>0,set:()=>{}}}),async sign({hash:y}){return C.signMessage({message:y})},async signMessage({message:y}){return C.signMessage({message:y})},async signTypedData(y){return i.signTypedData(y)},async getAddress(){if(d)return d;const{factory:y,factoryData:m}=await c();return d=await R(t,{factory:y,factoryData:m,entryPointAddress:n.address}),d},getFactoryArgs:c,client:t,entryPoint:E,async getNonce(){return ye(t,{address:d,entryPointAddress:n.address})},async signUserOperation(y){const m=xe({userOperation:{...y,sender:y.sender??await this.getAddress(),signature:"0x"},entryPointAddress:n.address,entryPointVersion:n.version,chainId:o});return await se(t,{account:i,message:{raw:m}})},async encodeCalls(y,m){if(y.length>1){if(m==="delegatecall")throw new Error("Cannot batch delegatecall");const l=A({abi:Se,functionName:"multiSend",args:[Re(y)]});return A({abi:ee,functionName:"executeAndRevert",args:[ve,0n,l,1n]})}const s=y.length===0?void 0:y[0];if(!s)throw new Error("No calls to encode");if(!m||m==="call")return s.to.toLowerCase()===d.toLowerCase()?s.data||"0x":A({abi:ee,functionName:"executeAndRevert",args:[s.to,s.value||0n,s.data,0n]});if(m==="delegatecall")return A({abi:ee,functionName:"executeAndRevert",args:[s.to,s.value||0n,s.data,1n]});throw new Error("Invalid call type")},async getStubSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"}})}const te=[{type:"constructor",inputs:[{name:"v1",type:"address",internalType:"contract IValidator"},{name:"v2",type:"address",internalType:"contract IValidator"},{name:"v3",type:"address",internalType:"contract IValidator"},{name:"v4",type:"address",internalType:"contract IValidator"},{name:"v5",type:"address",internalType:"contract IValidator"},{name:"s1",type:"address",internalType:"contract ISigner"},{name:"s2",type:"address",internalType:"contract ISigner"},{name:"s3",type:"address",internalType:"contract ISigner"},{name:"tv1",type:"address",internalType:"contract IValidator"},{name:"tv2",type:"address",internalType:"contract IValidator"},{name:"tv3",type:"address",internalType:"contract IValidator"},{name:"ts1",type:"address",internalType:"contract ISigner"}],stateMutability:"nonpayable"},{type:"function",name:"consumeGas",inputs:[{name:"count",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isMigrated",inputs:[{name:"kernel",type:"address",internalType:"contract Kernel"},{name:"validators",type:"address[]",internalType:"contract IValidator[]"},{name:"pIds",type:"bytes4[]",internalType:"PermissionId[]"}],outputs:[{name:"root",type:"bool",internalType:"bool"},{name:"v",type:"bool[]",internalType:"bool[]"},{name:"p",type:"bool[]",internalType:"bool[]"}],stateMutability:"view"},{type:"function",name:"migrate",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"migrateWithCall",inputs:[{name:"validators",type:"address[]",internalType:"contract IValidator[]"},{name:"permissionIds",type:"bytes4[]",internalType:"bytes4[]"},{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"execData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"migrateWithPermissionId",inputs:[{name:"permissionId",type:"bytes4[]",internalType:"bytes4[]"},{name:"validators",type:"address[]",internalType:"contract IValidator[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"mockSlot",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"usedSlot",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"}],ae="0x03EB97959433D55748839D27C93330Cb85F31A93";async function ta(t,e){if(e.entryPoint.version!=="0.7")throw new Error("Only EntryPoint 0.7 is supported");const{plugins:{sudo:{migrate:{from:a,to:n}}},...r}=e,i=await Ce(t,{plugins:{sudo:a},...r});let o=!1,u=!1;const c=async()=>{try{if(o)return o;const m=await pe(t,Ct,"readContract")({address:i.address,abi:Q,functionName:"rootValidator",args:[]}),s=M([Mt[n.validatorType],G(n.getIdentifier(),{size:20,dir:"right"})]);return o=m.toLowerCase()===s.toLowerCase(),o}catch{return!1}};if([u,o]=await Promise.all([i.isDeployed(),c()]),u&&o)return Ce(t,{plugins:{sudo:n},...r,address:i.address});const d=A({abi:Q,functionName:"installModule",args:[3n,ae,ie([De(j({abi:te,name:"migrateWithCall"})),v,ue(le("bytes selectorInitData, bytes hookInitData"),[wt.DELEGATE_CALL,"0x0000"])])]}),C={to:i.address,data:d,value:0n},E=A({abi:Q,functionName:"uninstallModule",args:[3n,ae,ie([De(j({abi:te,name:"migrateWithCall"})),"0x"])]}),y={to:i.address,data:E,value:0n};return{...i,getRootValidatorMigrationStatus:c,async encodeCalls(m,s){const l=await c(),D=await i.encodeCalls(m,s);if(l)return D;const{args:[B,h]}=Dt({abi:[j({abi:Ze,name:"execute"})],data:D}),N=A({abi:te,functionName:"migrateWithCall",args:[[],[],B,h]}),P={to:ae,data:N,value:0n};if(e.kernelVersion!=="0.3.0")return i.encodeCalls([P],"delegatecall");P.to=i.address;const V=[C,P,y];return i.encodeCalls(V,"call")}}}const H=[{type:"constructor",inputs:[{name:"_entryPoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"disableMode",inputs:[{name:"_disableFlag",type:"bytes4",internalType:"bytes4"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"entryPoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"},{name:"operation",type:"uint8",internalType:"enum Operation"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"getDefaultValidator",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IKernelValidator"}],stateMutability:"view"},{type:"function",name:"getDisabledMode",inputs:[],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"getExecution",inputs:[{name:"_selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutionDetail",components:[{name:"validUntil",type:"uint48",internalType:"uint48"},{name:"validAfter",type:"uint48",internalType:"uint48"},{name:"executor",type:"address",internalType:"address"},{name:"validator",type:"address",internalType:"contract IKernelValidator"}]}],stateMutability:"view"},{type:"function",name:"getLastDisabledTime",inputs:[],outputs:[{name:"",type:"uint48",internalType:"uint48"}],stateMutability:"view"},{type:"function",name:"getNonce",inputs:[{name:"key",type:"uint192",internalType:"uint192"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getNonce",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_defaultValidator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"setDefaultValidator",inputs:[{name:"_defaultValidator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setExecution",inputs:[{name:"_selector",type:"bytes4",internalType:"bytes4"},{name:"_executor",type:"address",internalType:"address"},{name:"_validator",type:"address",internalType:"contract IKernelValidator"},{name:"_validUntil",type:"uint48",internalType:"uint48"},{name:"_validAfter",type:"uint48",internalType:"uint48"},{name:"_enableData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct UserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"callGasLimit",type:"uint256",internalType:"uint256"},{name:"verificationGasLimit",type:"uint256",internalType:"uint256"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"maxFeePerGas",type:"uint256",internalType:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256",internalType:"uint256"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"version",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"event",name:"DefaultValidatorChanged",inputs:[{name:"oldValidator",type:"address",indexed:!0,internalType:"address"},{name:"newValidator",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ExecutionChanged",inputs:[{name:"selector",type:"bytes4",indexed:!0,internalType:"bytes4"},{name:"executor",type:"address",indexed:!0,internalType:"address"},{name:"validator",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"newImplementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1}],Gt=[{type:"constructor",inputs:[{name:"_entryPoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"function",name:"createAccount",inputs:[{name:"_validator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"},{name:"_index",type:"uint256",internalType:"uint256"}],outputs:[{name:"proxy",type:"address",internalType:"contract EIP1967Proxy"}],stateMutability:"nonpayable"},{type:"function",name:"entryPoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"getAccountAddress",inputs:[{name:"_validator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"},{name:"_index",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"kernelTemplate",inputs:[],outputs:[{name:"",type:"address",internalType:"contract TempKernel"}],stateMutability:"view"},{type:"function",name:"nextTemplate",inputs:[],outputs:[{name:"",type:"address",internalType:"contract Kernel"}],stateMutability:"view"},{type:"event",name:"AccountCreated",inputs:[{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"validator",type:"address",indexed:!0,internalType:"address"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"},{name:"index",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1}],Xt="0x9b35Af71d77eaf8d7e40252370304687390A1A52",zt=Et(["function performCreate(uint256 value, bytes memory deploymentData) public returns (address newContract)","function performCreate2(uint256 value, bytes memory deploymentData, bytes32 salt) public returns (address newContract)"]),Wt={FACTORY_ADDRESS:"0xaee9762ce625e0a8f7b184670fb57c37bfe1d0f1"},Yt=async({index:t,factoryAddress:e,validatorAddress:a,enableData:n})=>M([e,A({abi:Gt,functionName:"createAccount",args:[a,n,t]})]);async function aa(t,{plugins:e,entryPoint:a,index:n=0n,factoryAddress:r=Wt.FACTORY_ADDRESS,address:i}){const o=ne(e)?e:await Be(t,{sudo:e.sudo,regular:e.regular,action:e.action,pluginEnableSignature:e.pluginEnableSignature,kernelVersion:"0.0.2",entryPoint:a}),u=async()=>{const s=await o.getValidatorInitData();return Yt({index:n,factoryAddress:r,validatorAddress:s.validatorAddress,enableData:s.enableData})},c=async()=>({factory:r,factoryData:await u()});let d=i??await(async()=>{const{factory:s,factoryData:l}=await c();return await R(t,{factory:s,factoryData:l,entryPointAddress:a.address})})();const C=X({address:d,async signMessage({message:s}){return o.signMessage({message:s})},async signTransaction(s,l){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(s){const l=s,D={EIP712Domain:Fe({domain:l.domain}),...l.types};ge({domain:l.domain,message:l.message,primaryType:l.primaryType,types:D});const B=he(s);return o.signMessage({message:{raw:B}})}}),E={address:(a==null?void 0:a.address)??we,abi:de,version:(a==null?void 0:a.version)??"0.6"};let y;const m=async()=>y||(y=t.chain?t.chain.id:await pe(t,z,"getChainId")({}),y);return oe({kernelVersion:"0.0.2",client:t,entryPoint:E,kernelPluginManager:o,factoryAddress:r,accountImplementationAddress:Ie["0.0.2"].accountImplementationAddress,generateInitCode:u,encodeModuleInstallCallData:async()=>await o.encodeModuleInstallCallData(d),nonceKeyManager:ce({source:{get:()=>0,set:()=>{}}}),async sign({hash:s}){return C.signMessage({message:s})},async signMessage(s){return C.signMessage(s)},async signTypedData(s){return C.signTypedData(s)},getFactoryArgs:c,async getAddress(){if(d)return d;const{factory:s,factoryData:l}=await c();return d=await R(t,{factory:s,factoryData:l,entryPointAddress:a.address}),d},async getNonce(s){const l=await o.getNonceKey(d,s==null?void 0:s.key);return ye(t,{address:d,entryPointAddress:a.address,key:l})},async signUserOperation(s){const{chainId:l=await m(),...D}=s;return o.signUserOperation({...D,sender:D.sender??await this.getAddress(),chainId:l})},async encodeDeployCallData(s){return A({abi:H,functionName:"execute",args:[Xt,0n,A({abi:zt,functionName:"performCreate",args:[0n,Tt({abi:s.abi,bytecode:s.bytecode,args:s.args})]}),1]})},async encodeCalls(s,l){if(s.length>1){const B=A({abi:Se,functionName:"multiSend",args:[Re(s)]});return A({abi:H,functionName:"execute",args:[ve,0n,B,1]})}const D=s.length===0?void 0:s[0];if(!D)throw new Error("No calls to encode");if(!l||l==="call")return D.to.toLowerCase()===d.toLowerCase()?D.data||"0x":A({abi:H,functionName:"execute",args:[D.to,D.value||0n,D.data||"0x",0]});if(l==="delegatecall")return A({abi:H,functionName:"execute",args:[D.to,0n,D.data||"0x",1]});throw new Error("Invalid call type")},async getStubSignature(s){if(!s)throw new Error("No user operation provided");return o.getStubSignature(s)}})}const $t="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",na=async({signer:t,hash:e,signature:a,client:n})=>(await n.call({data:ie([$t,ue(le("address, bytes32, bytes"),[t,e,a])])})).data==="0x01",Ee=(t,e)=>{const n=xt(re(t)).substring(2,e*2+2);return BigInt(`0x${n}`)},sa=(t,e)=>e==="0.6"?Ee(t,24):Ee(t,2),ra=t=>{const{key:e="public",name:a="ZeroDev Paymaster Client",transport:n}=t;return Bt({...t,transport:i=>n({...i,retryCount:0}),key:e,name:a,type:"zerodevPaymasterClient"}).extend(Rt).extend(je())},ia=(t,e)=>{function a(r){return async(...i)=>{for(let o=0;o{const d=c(n);for(const[C,E]of Object.entries(d))typeof E=="function"?n[C]=async(...y)=>E(...y):console.error(`Expected a function for modification of ${C}, but received type ${typeof E}`);return n};const u=Reflect.get(r,i,o);return typeof u=="function"?a(i):u}});return n},da=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"DeploymentFailed",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"SaltDoesNotStartWithCaller",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"proxy",type:"address"},{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Deployed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"cancelOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"completeOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"address",name:"proxy",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"getAccountAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{internalType:"bytes32",name:"result",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isAllowedImplementation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"ownershipHandoverExpiresAt",outputs:[{internalType:"uint256",name:"result",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownershipHandoverValidFor",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"predictDeterministicAddress",outputs:[{internalType:"address",name:"predicted",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"requestOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],name:"setEntryPoint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bool",name:"_allow",type:"bool"}],name:"setImplementation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"}],oa=[{type:"constructor",inputs:[{name:"_entrypoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"accountId",inputs:[],outputs:[{name:"accountImplementationId",type:"string",internalType:"string"}],stateMutability:"pure"},{type:"function",name:"changeRootValidator",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"currentNonce",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"entrypoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executorConfig",inputs:[{name:"executor",type:"address",internalType:"contract IExecutor"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutorManager.ExecutorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"function",name:"grantAccess",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"allow",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"payable"},{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"},{name:"initConfig",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"installModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"initData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"installValidations",inputs:[{name:"vIds",type:"bytes21[]",internalType:"ValidationId[]"},{name:"configs",type:"tuple[]",internalType:"struct ValidationManager.ValidationConfig[]",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]},{name:"validationData",type:"bytes[]",internalType:"bytes[]"},{name:"hookData",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"payable"},{type:"function",name:"invalidateNonce",inputs:[{name:"nonce",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"isAllowedSelector",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isModuleInstalled",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"additionalContext",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"permissionConfig",inputs:[{name:"pId",type:"bytes4",internalType:"PermissionId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.PermissionConfig",components:[{name:"permissionFlag",type:"bytes2",internalType:"PassFlag"},{name:"signer",type:"address",internalType:"contract ISigner"},{name:"policyData",type:"bytes22[]",internalType:"PolicyData[]"}]}],stateMutability:"view"},{type:"function",name:"replayableUserOpHash",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"entryPoint",type:"address",internalType:"address"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"pure"},{type:"function",name:"rootValidator",inputs:[],outputs:[{name:"",type:"bytes21",internalType:"ValidationId"}],stateMutability:"view"},{type:"function",name:"selectorConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct SelectorManager.SelectorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"},{name:"target",type:"address",internalType:"address"},{name:"callType",type:"bytes1",internalType:"CallType"}]}],stateMutability:"view"},{type:"function",name:"supportsExecutionMode",inputs:[{name:"mode",type:"bytes32",internalType:"ExecMode"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"supportsModule",inputs:[{name:"moduleTypeId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"uninstallModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"deInitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"uninstallValidation",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"deinitData",type:"bytes",internalType:"bytes"},{name:"hookDeinitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"validNonceFrom",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"ValidationData"}],stateMutability:"payable"},{type:"function",name:"validationConfig",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.ValidationConfig",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"event",name:"ModuleInstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ModuleUninstallResult",inputs:[{name:"module",type:"address",indexed:!1,internalType:"address"},{name:"result",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"ModuleUninstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"NonceInvalidated",inputs:[{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionInstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionUninstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"}],anonymous:!1},{type:"event",name:"Received",inputs:[{name:"sender",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RootValidatorUpdated",inputs:[{name:"rootValidator",type:"bytes21",indexed:!1,internalType:"ValidationId"}],anonymous:!1},{type:"event",name:"SelectorSet",inputs:[{name:"selector",type:"bytes4",indexed:!1,internalType:"bytes4"},{name:"vId",type:"bytes21",indexed:!1,internalType:"ValidationId"},{name:"allowed",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"TryExecuteUnsuccessful",inputs:[{name:"batchExecutionindex",type:"uint256",indexed:!1,internalType:"uint256"},{name:"result",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ValidatorInstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"ValidatorUninstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"}],anonymous:!1},{type:"error",name:"AlreadyInitialized",inputs:[]},{type:"error",name:"EnableNotApproved",inputs:[]},{type:"error",name:"ExecutionReverted",inputs:[]},{type:"error",name:"InitConfigError",inputs:[{name:"idx",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidCallType",inputs:[]},{type:"error",name:"InvalidCaller",inputs:[]},{type:"error",name:"InvalidExecutor",inputs:[]},{type:"error",name:"InvalidFallback",inputs:[]},{type:"error",name:"InvalidMode",inputs:[]},{type:"error",name:"InvalidModuleType",inputs:[]},{type:"error",name:"InvalidNonce",inputs:[]},{type:"error",name:"InvalidSelector",inputs:[]},{type:"error",name:"InvalidSelectorData",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"InvalidValidationType",inputs:[]},{type:"error",name:"InvalidValidator",inputs:[]},{type:"error",name:"NonceInvalidationError",inputs:[]},{type:"error",name:"NotSupportedCallType",inputs:[]},{type:"error",name:"OnlyExecuteUserOp",inputs:[]},{type:"error",name:"PermissionDataLengthMismatch",inputs:[]},{type:"error",name:"PermissionNotAlllowedForSignature",inputs:[]},{type:"error",name:"PermissionNotAlllowedForUserOp",inputs:[]},{type:"error",name:"PolicyDataTooLarge",inputs:[]},{type:"error",name:"PolicyFailed",inputs:[{name:"i",type:"uint256",internalType:"uint256"}]},{type:"error",name:"PolicySignatureOrderError",inputs:[]},{type:"error",name:"RootValidatorCannotBeRemoved",inputs:[]},{type:"error",name:"SignerPrefixNotPresent",inputs:[]}],ca=[{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_to",type:"address"}],name:"transfer20Action",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_id",type:"uint256"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"transferERC1155Action",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_id",type:"uint256"},{internalType:"address",name:"_to",type:"address"}],name:"transferERC721Action",outputs:[],stateMutability:"nonpayable",type:"function"}],ya={1:{ABT:"0xB98d4C97425d9908E66E53A6fDf673ACcA0BE986",ACH:"0xEd04915c23f00A313a544955524EB7DBD823143d",ADX:"0xADE00C28244d5CE17D72E40330B1c318cD12B7c3",AGLD:"0x32353A6C91143bfd6C7d363B546e62a9A2489A20",AIOZ:"0x626E8036dEB333b408Be468F951bdB42433cBF18",ALEPH:"0x27702a26126e0B3702af63Ee09aC4d1A084EF628",ALI:"0x6B0b3a982b4634aC68dD83a4DBF02311cE324181",ALICE:"0xAC51066d7bEC65Dc4589368da368b212745d63E8",ALPHA:"0xa1faa113cbE53436Df28FF0aEe54275c13B40975",AMP:"0xfF20817765cB7f73d4bde2e66e067E58D11095C2",ANKR:"0x8290333ceF9e6D528dD5618Fb97a76f268f3EDD4",ANT:"0xa117000000f279D81A1D3cc75430fAA017FA5A2e",APE:"0x4d224452801ACEd8B2F0aebE155379bb5D594381",API3:"0x0b38210ea11411557c13457D4dA7dC6ea731B88a",ARB:"0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1",ASM:"0x2565ae0385659badCada1031DB704442E1b69982",AUDIO:"0x18aAA7115705e8be94bfFEBDE57Af9BFc265B998",AXL:"0x467719aD09025FcC6cF6F8311755809d45a5E5f3",AXS:"0xBB0E17EF65F82Ab018d8EDd776e8DD940327B28b",BADGER:"0x3472A5A71965499acd81997a54BBA8D852C6E53d",BAL:"0xba100000625a3754423978a60c9317c58a424e3D",BIGTIME:"0x64Bc2cA1Be492bE7185FAA2c8835d9b824c8a194",BIT:"0x1A4b46696b2bB4794Eb3D4c26f1c55F9170fa4C5",BLUR:"0x5283D291DBCF85356A21bA090E6db59121208b44",BLZ:"0x5732046A883704404F284Ce41FfADd5b007FD668",BNT:"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C",BOND:"0x0391D2021f89DC339F60Fff84546EA23E337750f",BTRST:"0x799ebfABE77a6E34311eeEe9825190B9ECe32824",BUSD:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",CBETH:"0xBe9895146f7AF43049ca1c1AE358B0541Ea49704",CELR:"0x4F9254C83EB525f9FCf346490bbb3ed28a81C667",CHR:"0x8A2279d4A90B6fe1C4B30fa660cC9f926797bAA2",CHZ:"0x3506424F91fD33084466F402d5D97f05F8e3b4AF",COTI:"0xDDB3422497E61e13543BeA06989C0789117555c5",COVAL:"0x3D658390460295FB963f54dC0899cfb1c30776Df",CQT:"0xD417144312DbF50465b1C641d016962017Ef6240",CRO:"0xA0b73E1Ff0B80914AB6fe0444E65848C4C34450b",CRPT:"0x08389495D7456E1951ddF7c3a1314A4bfb646d8B",CRV:"0xD533a949740bb3306d119CC777fa900bA034cd52",CTSI:"0x491604c0FDF08347Dd1fa4Ee062a822A5DD06B5D",CUBE:"0xDf801468a808a32656D2eD2D2d80B72A129739f4",CVC:"0x41e5560054824eA6B0732E656E3Ad64E20e94E45",CVX:"0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B",DAI:"0x6B175474E89094C44Da98b954EedeAC495271d0F",DAR:"0x081131434f93063751813C619Ecca9C4dC7862a3",DDX:"0x3A880652F47bFaa771908C07Dd8673A787dAEd3A",DENT:"0x3597bfD533a99c9aa083587B074434E61Eb0A258",DEXT:"0xfB7B4564402E5500dB5bB6d63Ae671302777C75a",DIA:"0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419",DPI:"0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b",DYP:"0x961C8c0B1aaD0c0b10a51FeF6a867E3091BCef17",ELA:"0xe6fd75ff38Adca4B97FBCD938c86b98772431867",ELON:"0x761D38e5ddf6ccf6Cf7c55759d5210750B5D60F3",ENJ:"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c",ENS:"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72",ERN:"0xBBc2AE13b23d715c30720F079fcd9B4a74093505",EUL:"0xd9Fcd98c322942075A5C3860693e9f4f03AAE07b",EURC:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",FARM:"0xa0246c9032bC3A600820415aE600c6388619A14D",FET:"0xaea46A60368A7bD060eec7DF8CBa43b7EF41Ad85",FIS:"0xef3A930e1FfFFAcd2fc13434aC81bD278B0ecC8d",FORTH:"0x77FbA179C79De5B7653F68b5039Af940AdA60ce0",FRAX:"0x853d955aCEf822Db058eb8505911ED77F175b99e",FTM:"0x4E15361FD6b4BB609Fa63C81A2be19d873717870",FXS:"0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0",GAL:"0x5fAa989Af96Af85384b8a938c2EdE4A7378D9875",GFI:"0xdab396cCF3d84Cf2D07C4454e10C8A6F5b008D2b",GHST:"0x3F382DbD960E3a9bbCeaE22651E88158d2791550",GLM:"0x7DD9c5Cba05E151C895FDe1CF355C9A1D5DA6429",GNO:"0x6810e776880C02933D47DB1b9fc05908e5386b96",GODS:"0xccC8cb5229B0ac8069C51fd58367Fd1e622aFD97",GRT:"0xc944E90C64B2c07662A292be6244BDf05Cda44a7",GTC:"0xDe30da39c46104798bB5aA3fe8B9e0e1F348163F",GUSD:"0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd",HFT:"0xb3999F658C0391d94A37f7FF328F3feC942BcADC",HIGH:"0x71Ab77b7dbB4fa7e017BC15090b2163221420282",ILV:"0x767FE9EDC9E0dF98E07454847909b5E959D7ca0E",IMX:"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",INDEX:"0x0954906da0Bf32d5479e25f46056d22f08464cab",INJ:"0xe28b3B32B6c345A34Ff64674606124Dd5Aceca30",INV:"0x41D5D79431A913C4aE7d69a668ecdfE5fF9DFB68",IOTX:"0x6fB3e0A217407EFFf7Ca062D46c26E5d60a14d69",JASMY:"0x7420B4b9a0110cdC71fB720908340C03F9Bc03EC",JUP:"0x4B1E80cAC91e2216EEb63e29B957eB91Ae9C2Be8",KEEP:"0x85Eee30c52B0b379b046Fb0F85F4f3Dc3009aFEC",KP3R:"0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44",LCX:"0x037A54AaB062628C9Bbae1FDB1583c195585fe41",LDO:"0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32",LINK:"0x514910771AF9Ca656af840dff83E8264EcF986CA",LOKA:"0x61E90A50137E1F645c9eF4a0d3A4f01477738406",LPT:"0x58b6A8A3302369DAEc383334672404Ee733aB239",LQTY:"0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D",LRC:"0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD",LUSD:"0x5f98805A4E8be255a32880FDeC7F6728C6568bA0",MANA:"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942",MASK:"0x69af81e73A73B40adF4f3d4223Cd9b1ECE623074",MATH:"0x08d967bb0134F2d07f7cfb6E246680c53927DD30",MATIC:"0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",MCO2:"0xfC98e825A2264D890F9a1e68ed50E1526abCcacD",MDT:"0x814e0908b12A99FeCf5BC101bB5d0b8B5cDf7d26",METIS:"0x9E32b13ce7f2E80A01932B42553652E053D6ed8e",MIM:"0x99D8a9C45b2ecA8864373A26D1459e3Dff1e17F3",MIR:"0x09a3EcAFa817268f77BE1283176B946C4ff2E608",MLN:"0xec67005c4E498Ec7f55E092bd1d35cbC47C91892",MONA:"0x275f5Ad03be0Fa221B4C6649B8AeE09a42D9412A",MPL:"0x33349B282065b0284d756F0577FB39c158F935e6",MTL:"0xF433089366899D83a9f26A773D59ec7eCF30355e",MUSE:"0xB6Ca7399B4F9CA56FC27cBfF44F4d2e4Eef1fc81",MXC:"0x5Ca381bBfb58f0092df149bD3D243b08B9a8386e",NCT:"0x9E46A38F5DaaBe8683E10793b06749EEF7D733d1",NEXO:"0xB62132e35a6c13ee1EE0f84dC5d40bad8d815206",NMR:"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671",OCEAN:"0x967da4048cD07aB37855c090aAF366e4ce1b9F48",OGN:"0x8207c1FfC5B6804F6024322CcF34F29c3541Ae26",ONEINCH:"0x111111111117dC0aa78b770fA6A738034120C302",ORN:"0x0258F474786DdFd37ABCE6df6BBb1Dd5dfC4434a",OXT:"0x4575f41308EC1483f3d399aa9a2826d74Da13Deb",PAXG:"0x45804880De22913dAFE09f4980848ECE6EcbAf78",PERP:"0xbC396689893D065F41bc2C6EcbeE5e0085233447",PLA:"0x3a4f40631a4f906c2BaD353Ed06De7A5D3fCb430",POLS:"0x83e6f1E41cdd28eAcEB20Cb649155049Fac3D5Aa",POLY:"0x9992eC3cF6A55b00978cdDF2b27BC6882d88D1eC",POWR:"0x595832F8FC6BF59c85C527fEC3740A1b7a361269",PRIME:"0xb23d80f5FefcDDaa212212F028021B41DEd428CF",PRQ:"0x362bc847A3a9637d3af6624EeC853618a43ed7D2",PYUSD:"0x6c3ea9036406852006290770BEdFcAbA0e23A0e8",QNT:"0x4a220E6096B25EADb88358cb44068A3248254675",QUICK:"0x6c28AeF8977c9B773996d0e8376d2EE379446F2f",RAD:"0x31c8EAcBFFdD875c74b94b077895Bd78CF1E64A3",RAI:"0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919",RARE:"0xba5BDe662c17e2aDFF1075610382B9B691296350",RARI:"0xFca59Cd816aB1eaD66534D82bc21E7515cE441CF",REN:"0x408e41876cCCDC0F92210600ef50372656052a38",REP:"0x1985365e9f78359a9B6AD760e32412f4a445E862",REQ:"0x8f8221aFbB33998d8584A2B05749bA73c37a938a",REVV:"0x557B933a7C2c45672B610F8954A3deB39a51A8Ca",RLC:"0x607F4C5BB672230e8672085532f7e901544a7375",RLY:"0xf1f955016EcbCd7321c7266BccFB96c68ea5E49b",RNDR:"0x6De037ef9aD2725EB40118Bb1702EBb27e4Aeb24",SHIB:"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",SNT:"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E",SOL:"0xD31a59c85aE9D8edEFeC411D448f90841571b89c",SPELL:"0x090185f2135308BaD17527004364eBcC2D37e5F6",STORJ:"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC",SUPER:"0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55",SUSHI:"0x6B3595068778DD592e39A122f4f5a5cF09C90fE2",SWFTC:"0x0bb217E40F8a5Cb79Adf04E1aAb60E5abd0dfC1e",SYLO:"0xf293d23BF2CDc05411Ca0edDD588eb1977e8dcd4",SYN:"0x0f2D719407FdBeFF09D87557AbB7232601FD9F29",TBTC:"0x18084fbA666a33d37592fA2633fD49a74DD93a88",TOKE:"0x2e9d63788249371f1DFC918a52f8d799F4a38C94",TONE:"0x2Ab6Bb8408ca3199B8Fa6C92d5b455F820Af03c4",TRAC:"0xaA7a9CA87d3694B5755f213B5D04094b8d0F0A6F",TRB:"0x88dF592F8eb5D7Bd38bFeF7dEb0fBc02cf3778a0",TRIBE:"0xc7283b66Eb1EB5FB86327f08e1B5816b0720212B",TRU:"0x4C19596f5aAfF459fA38B0f7eD92F11AE6543784",TVK:"0xd084B83C305daFD76AE3E1b4E1F1fe2eCcCb3988",UNI:"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",USDC:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",USDT:"0xdAC17F958D2ee523a2206206994597C13D831ec7",VGX:"0x3C4B6E6e1eA3D4863700D7F76b36B7f3D3f13E3d",WAMPL:"0xEDB171C18cE90B633DB442f2A6F72874093b49Ef",WBTC:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",WETH:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",XCN:"0xA2cd3D43c775978A96BdBf12d733D5A1ED94fb18",XSGD:"0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96",YFI:"0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e",YFII:"0xa1d0E215a23d7030842FC67cE582a6aFa3CCaB83"},5:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x07865c6E87B9F70255377e024ace6630C1Eaa37F"},10:{AAVE:"0x76FB31fb4af56892A25e32cFC43De717950c9278",CRV:"0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53",DAI:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",ENS:"0x65559aA14915a70190438eF90104769e5E890A00",FRAX:"0x2E3D870790dC77A83DD1d18184Acc7439A53f475",LDO:"0xFdb794692724153d1488CcdBE0C56c252596735F",LINK:"0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6",LUSD:"0xc40F949F8a4e094D1b49a23ea9241D289B7b2819",OP:"0x4200000000000000000000000000000000000042",PEPE:"0xC1c167CC44f7923cd0062c4370Df962f9DDB16f5",PERP:"0x9e1028F5F1D5eDE59748FFceE5532509976840E0",RAI:"0x7FB688CCf682d58f86D7e38e03f9D22e7705448B",UNI:"0x6fd9d7AD17242c41f7131d257212c54A0e816691",USDC:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",USDT:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",WBTC:"0x68f180fcCe6836688e9084f035309E29Bf0A2095",WETH:"0x4200000000000000000000000000000000000006"},56:{AAVE:"0xfb6115445Bff7b52FeB98650C87f44907E58f802",ADA:"0x3ee2200efb3400fabb9aacf31297cbdd1d435d47",AVAX:"0x1ce0c2827e2ef14d5c4f29a091d735a204794041",BTCB:"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",BUSD:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",CAKE:"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",DAI:"0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",DOGE:"0xba2ae424d960c26247dd6c32edc70b295c744c43",DOT:"0x7083609fce4d1d8dc0c979aab8c869ea2c873402",ETH:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",FET:"0x031b41e504677879370e9DBcF937283A8691Fa7f",FRAX:"0x90C97F71E18723b0Cf0dfa30ee176Ab653E89F40",FTM:"0xAD29AbB318791D579433D831ed122aFeAf29dcfe",HIGH:"0x5f4Bde007Dc06b867f86EBFE4802e34A1fFEEd63",HOOK:"0xa260e12d2b924cb899ae80bb58123ac3fee1e2f0",LINK:"0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD",MATIC:"0xCC42724C6683B7E57334c4E856f4c9965ED682bD",MBOX:"0x3203c9e46ca618c8c1ce5dc67e7e9d75f5da2377",MIM:"0xfE19F0B51438fd612f6FD59C1dbB3eA319f433Ba",SHIB:"0x2859e4544c4bb03966803b044a93563bd2d0dd4d",STG:"0xB0D502E938ed5f4df2E681fE6E419ff29631d62b",TRON:"0xce7de646e7208a4ef112cb6ed5038fa6cc6b12e3",TWT:"0x4B0F1812e5Df2A09796481Ff14017e6005508003",UNI:"0xBf5140A22578168FD562DCcF235E5D43A02ce9B1",USDC:"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",USDT:"0x55d398326f99059fF775485246999027B3197955",WBNB:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",XRP:"0x1d2f0da169ceb9fc7b3144628db156f3f6c60dbe"},97:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x16227D60f7a0e586C66B005219dfc887D13C9531"},137:{AAVE:"0xD6DF932A45C0f255f85145f286eA0b292B21C90B",AGEUR:"0xE0B52e49357Fd4DAf2c15e02058DCE6BC0057db4",ANKR:"0x101A023270368c0D50BFfb62780F4aFd4ea79C35",BUSD:"0xdAb529f40E671A1D4bF91361c21bf9f0C9712ab7",COMP:"0x8505b9d2254A7Ae468c0E9dd10Ccea3A837aef5c",CRV:"0x172370d5Cd63279eFa6d502DAB29171933a610AF",DAI:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",DPI:"0x85955046DF4668e1DD369D2DE9f3AEB98DD2A369",DYDX:"0x4C3bF0a3DE9524aF68327d1D2558a3B70d17D42a",FORT:"0x9ff62d1FC52A907B6DCbA8077c2DDCA6E6a9d3e1",FRAX:"0x104592a158490a9228070E0A8e5343B499e125D0",GHST:"0x385Eeac5cB85A38A9a07A70c73e0a3271CfB54A7",GNS:"0xE5417Af564e4bFDA1c483642db72007871397896",GRT:"0x5fe2B58c013d7601147DcdD68C143A77499f5531",IOTX:"0xf6372cDb9c1d3674E83842e3800F2A62aC9F3C66",LDO:"0xC3C7d422809852031b44ab29EEC9F1EfF2A58756",LINK:"0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39",MANA:"0xA1c57f48F0Deb89f569dFbE6E2B7f46D33606fD4",MKR:"0x6f7C932e7684666C9fd1d44527765433e01fF61d",MLN:"0xa9f37D84c856fDa3812ad0519Dad44FA0a3Fe207",ONEINCH:"0x9c2C5fd7b07E95EE044DDeba0E97a665F142394f",OXT:"0x9880e3dDA13c8e7D4804691A45160102d31F6060",RNDR:"0x61299774020dA444Af134c82fa83E3810b309991",SHIB:"0x6f8a06447Ff6FcF75d803135a7de15CE88C1d4ec",SNX:"0x50B728D8D964fd00C2d0AAD81718b71311feF68a",SUSHI:"0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a",UNI:"0xb33EaAd8d922B1083446DC23f610c2567fB5180f",USDC:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",USDCe:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",USDT:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",VOXEL:"0xd0258a3fD00f38aa8090dfee343f10A9D4d30D3F",WBTC:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",WETH:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"},420:{ECO:"0x54bBECeA38ff36D32323f8A754683C1F5433A89f","6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0xe05606174bac4A6364B31bd0eCA4bf4dD368f8C6"},8453:{DAI:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",PRIME:"0xfA980cEd6895AC314E7dE34Ef1bFAE90a5AdD21b",TBTC:"0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b",USDbC:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",USDC:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",WAMPL:"0x489fe42C267fe0366B16b0c39e7AEEf977E841eF",WETH:"0x4200000000000000000000000000000000000006"},42161:{AAVE:"0xba5DdD1f9d7F570dc94a51479a000E3BCE967196",ARB:"0x912ce59144191c1204e64559fe8253a0e49e6548",BADGER:"0xBfa641051Ba0a0Ad1b0AcF549a89536A0D76472E",BAL:"0x040d1edc9569d4bab2d15287dc5a4f10f56a56b8",CBETH:"0x1DEBd73E752bEaF79865Fd6446b0c970EaE7732f",COMP:"0x354A6dA3fcde098F8389cad84b0182725c6C91dE",CRV:"0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978",CTX:"0x84F5c2cFba754E76DD5aE4fB369CfC920425E12b",DAI:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",FRAX:"0x17fc002b466eec40dae837fc4be5c67993ddbd6f",GMX:"0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",GRT:"0x9623063377AD1B27544C965cCd7342f7EA7e88C7",KYBER:"0xe4dddfe67e7164b0fe14e218d80dc4c08edc01cb",LDO:"0x13Ad51ed4F1B7e9Dc168d8a00cB3f4dDD85EfA60",LINK:"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",LPT:"0x289ba1701C2F088cf0faf8B3705246331cB8A839",LUSD:"0x93b346b6BC2548dA6A1E7d98E9a421B42541425b",MATIC:"0x561877b6b3DD7651313794e5F2894B2F18bE0766",SNX:"0xcBA56Cd8216FCBBF3fA6DF6137F3147cBcA37D60",SPELL:"0x3E6648C5a70A150A88bCE65F4aD4d506Fe15d2AF",SUSHI:"0xd4d42F0b6DEF4CE0383636770eF773390d85c61A",TUSD:"0x4d15a3a2286d883af0aa1b3f21367843fac63e07",UNI:"0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0",USDC:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",USDCe:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",USDT:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",WBTC:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",WETH:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},43113:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x5425890298aed601595a70AB815c96711a31Bc65"},43114:{BENQI:"0x8729438eb15e2c8b576fcc6aecda6a148776c0f5",BUSDe:"0x19860ccb0a68fd4213ab9d8266f7bbf05a8dde98",DAIe:"0xd586e7f844cea2f87f50152665bcbc2c279d8d70",EURC:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",JOE:"0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd",MIM:"0x130966628846BFd36ff31a822705796e8cb8C18D",PNG:"0x60781c2586d68229fde47564546784ab3faca982",STG:"0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590",USDC:"0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",USDCe:"0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664",USDT:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",USDTe:"0xc7198437980c041c805a1edcba50c1ce5db95118",WAVAX:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",WBTC:"0x50b7545627a5162F82A992c33b87aDc75187B218",WETH:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB"},80001:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x9999f7Fea5938fD3b1E26A12c3f2fb024e194f97"},84531:{ECO:"0x7ea172aa6DFe9bEceef679D4Cf90E600e89b9969","6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0xF175520C52418dfE19C8098071a252da48Cd1C19"},84532:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"},421613:{USDC:"0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63","6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"},421614:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"},11155111:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"},11155420:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"}};class pa extends Ft.EventEmitter{constructor(e){super(),Object.defineProperty(this,"kernelClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.kernelClient=e}async request({method:e,params:a=[]}){switch(e){case"eth_requestAccounts":return this.handleEthRequestAccounts();case"eth_accounts":return this.handleEthAccounts();case"eth_sendTransaction":return this.handleEthSendTransaction(a);case"eth_sign":return this.handleEthSign(a);case"personal_sign":return this.handlePersonalSign(a);case"eth_signTypedData":case"eth_signTypedData_v4":return this.handleEthSignTypedDataV4(a);default:return this.kernelClient.transport.request({method:e,params:a})}}async handleEthRequestAccounts(){return this.kernelClient.account?[this.kernelClient.account.address]:[]}async handleEthAccounts(){return this.kernelClient.account?[this.kernelClient.account.address]:[]}async handleEthSendTransaction(e){const[a]=e;return this.kernelClient.sendTransaction({...a,value:a.value?gt(a.value):void 0})}async handleEthSign(e){var r;if(!((r=this.kernelClient)!=null&&r.account))throw new Error("account not connected!");const[a,n]=e;if(a.toLowerCase()!==this.kernelClient.account.address.toLowerCase())throw new Error("cannot sign for address that is not the current account");return this.kernelClient.signMessage({message:n,account:this.kernelClient.account})}async handlePersonalSign(e){var r;if(!((r=this.kernelClient)!=null&&r.account))throw new Error("account not connected!");const[a,n]=e;if(n.toLowerCase()!==this.kernelClient.account.address.toLowerCase())throw new Error("cannot sign for address that is not the current account");return this.kernelClient.signMessage({message:a,account:this.kernelClient.account})}async handleEthSignTypedDataV4(e){var i;if(!((i=this.kernelClient)!=null&&i.account))throw new Error("account not connected!");const[a,n]=e,r=JSON.parse(n);if(a.toLowerCase()!==this.kernelClient.account.address.toLowerCase())throw new Error("cannot sign for address that is not the current account");return this.kernelClient.signTypedData({account:this.kernelClient.account,domain:r.domain,types:r.types,message:r.message,primaryType:r.primaryType})}}const ua=t=>{const e=new URL(t),a=e.searchParams;return a.has("bundlerProvider")?a.set("bundlerProvider","PIMLICO"):a.has("paymasterProvider")?a.set("paymasterProvider","PIMLICO"):a.set("provider","PIMLICO"),e.search=a.toString(),e.toString()},la=(t,e)=>{const n=new URL(t).searchParams;return(n.get("provider")??n.get("bundlerProvider")??n.get("paymasterProvider"))===e},ba=async({plugin:t,entryPoint:e,kernelVersion:a,hook:n,action:r})=>{if(!et(a,">0.3.0"))throw new Error("Kernel version must be greater than 0.3.0");return{type:vt.VALIDATOR,address:t.address,data:M([(n==null?void 0:n.getIdentifier())??v,ue(le("bytes validatorData, bytes hookData, bytes selectorData"),[await t.getEnableData(),await(n==null?void 0:n.getEnableData())??"0x",(r==null?void 0:r.selector)??tt(e.version)])])}};export{Aa as AccountNotFoundError,Da as EIP1271Abi,jt as KERNEL_ADDRESSES,q as KERNEL_FEATURES,Ca as KERNEL_FEATURES_BY_VERSION,Ea as KernelAccountAbi,pa as KernelEIP1193Provider,da as KernelFactoryAbi,Ge as KernelFactoryStakerAbi,Q as KernelV3AccountAbi,Ze as KernelV3ExecuteAbi,Pt as KernelV3FactoryAbi,ze as KernelV3InitAbi,We as KernelV3_1AccountAbi,oa as KernelV3_3AccountAbi,Ta as SignTransactionNotSupportedBySmartAccountError,ca as TokenActionsAbi,Qe as accountMetadata,Nt as addressToEmptyAccount,xa as changeSudoValidator,Ka as constants,ia as createFallbackKernelAccountClient,Ce as createKernelAccount,Jt as createKernelAccountClient,aa as createKernelAccountV0_2,ea as createKernelAccountV1,ta as createKernelMigrationAccount,ra as createZeroDevPaymasterClient,Ba as deepHexlify,Ae as eip712WrapHash,$e as encodeCallDataEpV06,J as encodeCallDataEpV07,qe as encodeDeployCallDataV06,Je as encodeDeployCallDataV07,Fa as fixSignedData,ya as gasTokenAddresses,tt as getActionSelector,sa as getCustomNonceKeyFromString,ga as getERC20PaymasterApproveCall,ha as getEncodedPluginsData,Ia as getExecMode,wa as getKernelV3Nonce,Ma as getPluginsEnableTypedData,va as getUpgradeKernelCall,Sa as getUserOperationGasPrice,ba as getValidatorPluginInstallModuleData,$ as hasKernelFeature,Ra as invalidateNonce,Na as isPluginInitialized,la as isProviderSet,Va as kernelAccountClientActions,et as satisfiesRange,ua as setPimlicoAsProvider,Pa as signUserOperation,Oa as sponsorUserOperation,Te as toSigner,_a as uninstallPlugin,La as upgradeKernel,ke as validateKernelVersionWithEntryPoint,na as verifyEIP6492Signature,je as zerodevPaymasterActions}; diff --git a/public/assets/index-C3_GJ6Eb.js b/public/assets/index-C3_GJ6Eb.js new file mode 100644 index 0000000..0616f6c --- /dev/null +++ b/public/assets/index-C3_GJ6Eb.js @@ -0,0 +1 @@ +import{g as Qe,a as Ze,t as Y,b as we,c as Ie,s as et,i as de,d as Me,e as R,f as pe,h as tt,j as ue,k as le,v as at,l as nt,K as st,m as rt,n as it,o as dt,p as fe,q as xe,r as Q,u as Z,w as ot,x as ee,y as ct,z as yt,A as pt,B as ut,C as te,D as lt,E as ft,F as bt,G as mt,H as Aa}from"./kernelAccountClient-DgEyP8pS.js";import{I as Va,J as Ua,L as Ka,M as ka,S as Ha,N as Ga,O as za,P as Xa,Q as Wa,R as Ya,T as ja,U as $a,V as qa,W as Ja,X as Qa,Y as Za,Z as en,_ as tn,$ as an,a0 as nn,a1 as sn,a2 as rn}from"./kernelAccountClient-DgEyP8pS.js";import{A as At,c as M,i as Ct,I as Dt,p as X,s as Et,b as Tt,a as xt,n as Bt,d as Ft,B as gt,e as ht,U as vt,g as j,f as oe,z as S,h as ae,j as be,k as C,t as ce,l as Se,v as Le,m as Re,o as wt,q as It,r as Mt,u as St,w as Lt,x as ye,y as Be,C as ne,D as me,E as Ae,F as Rt,G as _t,H as Nt,J as Ot,K as Pt,L as Vt,M as Ut}from"./index-C4xokDO6.js";import{e as Kt,K as _e,M as kt,a as Ne,C as Ht,V as Gt,P as zt}from"./constants-DBcQLFY6.js";import{c as on}from"./constants-DBcQLFY6.js";function Xt(t,e){if(t.length!==e.length)throw new At({expectedLength:t.length,givenLength:e.length});const a=[];for(let n=0;n0&&(r=a[0]),r instanceof Error)throw r;var c=new Error("Unhandled error."+(r?" ("+r.message+")":""));throw c.context=r,c}var y=i[e];if(y===void 0)return!1;if(typeof y=="function")Fe(y,this,a);else for(var o=y.length,D=Ge(y,o),n=0;n0&&r.length>s&&!r.warned){r.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+r.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=t,c.type=e,c.count=r.length,Wt(c)}return t}b.prototype.addListener=function(e,a){return Ue(this,e,a,!1)};b.prototype.on=b.prototype.addListener;b.prototype.prependListener=function(e,a){return Ue(this,e,a,!0)};function Yt(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function Ke(t,e,a){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:a},s=Yt.bind(n);return s.listener=a,n.wrapFn=s,s}b.prototype.once=function(e,a){return $(a),this.on(e,Ke(this,e,a)),this};b.prototype.prependOnceListener=function(e,a){return $(a),this.prependListener(e,Ke(this,e,a)),this};b.prototype.removeListener=function(e,a){var n,s,i,r,c;if($(a),s=this._events,s===void 0)return this;if(n=s[e],n===void 0)return this;if(n===a||n.listener===a)--this._eventsCount===0?this._events=Object.create(null):(delete s[e],s.removeListener&&this.emit("removeListener",e,n.listener||a));else if(typeof n!="function"){for(i=-1,r=n.length-1;r>=0;r--)if(n[r]===a||n[r].listener===a){c=n[r].listener,i=r;break}if(i<0)return this;i===0?n.shift():jt(n,i),n.length===1&&(s[e]=n[0]),s.removeListener!==void 0&&this.emit("removeListener",e,c||a)}return this};b.prototype.off=b.prototype.removeListener;b.prototype.removeAllListeners=function(e){var a,n,s;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),r;for(s=0;s=0;s--)this.removeListener(e,a[s]);return this};function ke(t,e,a){var n=t._events;if(n===void 0)return[];var s=n[e];return s===void 0?[]:typeof s=="function"?a?[s.listener||s]:[s]:a?$t(s):Ge(s,s.length)}b.prototype.listeners=function(e){return ke(this,e,!0)};b.prototype.rawListeners=function(e){return ke(this,e,!1)};b.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):He.call(t,e)};b.prototype.listenerCount=He;function He(t){var e=this._events;if(e!==void 0){var a=e[t];if(typeof a=="function")return 1;if(a!==void 0)return a.length}return 0}b.prototype.eventNames=function(){return this._eventsCount>0?W(this._events):[]};function Ge(t,e){for(var a=new Array(e),n=0;nZe(t,e),getPaymasterStubData:e=>Qe(t,e)}}function ea(t){return{...Y({address:t,async signMessage(){throw new Error("Method not supported")},async signTransaction(a){throw new Error("Method not supported")},async signTypedData(a){throw new Error("Method not supported")}}),publicKey:"0x",source:"empty"}}async function ta(t,{signer:e,entryPoint:a,kernelVersion:n}){var c;const s=await we({signer:e}),i=((c=t.chain)==null?void 0:c.id)??await j(t);return{...Y({address:s.address,async signMessage({message:y}){return oe(t,{account:s,message:y})},async signTransaction(y,o){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(y){return s.signTypedData(y)}}),supportedKernelVersions:n,validatorType:"EIP7702",address:s.address,source:"EIP7702Validator",getIdentifier(){return"0x"},async getEnableData(){return s.address},async getNonceKey(y,o){return o||0n},async signUserOperation(y){const o=Ie({userOperation:{...y,signature:"0x"},entryPointAddress:a.address,entryPointVersion:a.version,chainId:i});return await oe(t,{account:s,message:{raw:o}})},async getStubSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"},async isEnabled(y,o){return!1}}}const aa=[{type:"constructor",inputs:[{name:"_impl",type:"address",internalType:"address"}],stateMutability:"nonpayable"},{type:"function",name:"createAccount",inputs:[{name:"data",type:"bytes",internalType:"bytes"},{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"payable"},{type:"function",name:"getAddress",inputs:[{name:"data",type:"bytes",internalType:"bytes"},{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"implementation",inputs:[],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"error",name:"InitializeError",inputs:[]}],na=[{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"address",name:"proxy",type:"address"}],stateMutability:"payable",type:"function"}],Ea={ACCOUNT_LOGIC_V0_6:"0xd3082872F8B06073A021b4602e022d5A070d7cfC",ACCOUNT_LOGIC_V0_7:"0x94F097E1ebEB4ecA3AAE54cabb08905B239A7D27",FACTORY_ADDRESS_V0_6:"0x5de4839a76cf55d0c90e2061ef4386d962E15ae3",FACTORY_ADDRESS_V0_7:"0x6723b44Abeec4E71eBE3232BD5B455805baDD22f",FACTORY_STAKER:"0xd703aaE79538628d27099B8c4f621bE4CCd142d5"},sa=async({entryPointVersion:t,kernelPluginManager:e,initHook:a,kernelVersion:n,initConfig:s})=>{var o,D,T,p;const{enableData:i,identifier:r,validatorAddress:c,initConfig:y}=await e.getValidatorInitData();return t==="0.6"?C({abi:rt,functionName:"initialize",args:[c,i]}):n==="0.3.0"?C({abi:it,functionName:"initialize",args:[r,a&&e.hook?(o=e.hook)==null?void 0:o.getIdentifier():S,i,a&&e.hook?await((D=e.hook)==null?void 0:D.getEnableData()):"0x"]}):C({abi:dt,functionName:"initialize",args:[r,a&&e.hook?(T=e.hook)==null?void 0:T.getIdentifier():S,i,a&&e.hook?await((p=e.hook)==null?void 0:p.getEnableData()):"0x",s??y??[]]})},ra=async({index:t,factoryAddress:e,accountImplementationAddress:a,entryPointVersion:n,kernelPluginManager:s,initHook:i,kernelVersion:r,initConfig:c,useMetaFactory:y})=>{const o=await sa({entryPointVersion:n,kernelPluginManager:s,initHook:i,kernelVersion:r,initConfig:c});return n==="0.6"?C({abi:na,functionName:"createAccount",args:[a,o,t]}):y?C({abi:st,functionName:"deployWithFactory",args:[e,o,ce(t,{size:32})]}):C({abi:aa,functionName:"createAccount",args:[o,ce(t,{size:32})]})},ia=(t,e,{accountImplementationAddress:a,factoryAddress:n,metaFactoryAddress:s})=>{at(t,e);const i=_e[e];if(!i)throw new Error(`No addresses found for kernel version ${e}`);return{accountImplementationAddress:a??i.accountImplementationAddress,factoryAddress:n??i.factoryAddress,metaFactoryAddress:s??i.metaFactoryAddress??S}};async function he(t,{plugins:e,entryPoint:a,index:n=0n,factoryAddress:s,accountImplementationAddress:i,metaFactoryAddress:r,address:c,kernelVersion:y,initConfig:o,useMetaFactory:D=!0,eip7702Auth:T,eip7702Account:p,pluginMigrations:A}){var Te;const d=!!p||!!T;if(d&&!et.satisfies(y,">=0.3.3"))throw new Error("EIP-7702 is recommended for kernel version >=0.3.3");const l=p?await we({signer:p,address:c}):void 0;let E;l&&(E=await ta(t,{signer:l,entryPoint:a,kernelVersion:y}));let F=D;const{accountImplementationAddress:v,factoryAddress:_,metaFactoryAddress:P}=ia(a.version,y,{accountImplementationAddress:i,factoryAddress:s,metaFactoryAddress:r});let N,K;const k=async()=>N||(N=t.chain?t.chain.id:await be(t,j,"getChainId")({}),N),De=async()=>K||(K=await ut(t,m,y,await k()),K),x=de(e)?e:await Me(t,{sudo:l?E:e==null?void 0:e.sudo,regular:e==null?void 0:e.regular,hook:e==null?void 0:e.hook,action:e==null?void 0:e.action,pluginEnableSignature:e==null?void 0:e.pluginEnableSignature,entryPoint:a,kernelVersion:y,chainId:await k()}),je=!!(de(e)?e.hook&&e.getIdentifier()===((Te=e.sudoValidator)==null?void 0:Te.getIdentifier()):e!=null&&e.hook&&!(e!=null&&e.regular)),q=async()=>{if(d)return"0x";if(!v||!_)throw new Error("Missing account logic address or factory address");return ra({index:n,factoryAddress:_,accountImplementationAddress:v,entryPointVersion:a.version,kernelPluginManager:x,initHook:je,kernelVersion:y,initConfig:o,useMetaFactory:F})},H=async()=>d?{factory:void 0,factoryData:void 0}:{factory:a.version==="0.6"||F===!1?_:P,factoryData:await q()};let m=c??(d?(l==null?void 0:l.address)??S:await(async()=>{const{factory:u,factoryData:f}=await H();if(!u||!f)throw new Error("Missing factory address or factory data");return await R(t,{factory:u,factoryData:f,entryPointAddress:a.address})})());ae(m,S)&&F&&(F=!1,m=await R(t,{factory:_,factoryData:await q(),entryPointAddress:a.address}),ae(m,S)&&(F=!0));const $e={address:(a==null?void 0:a.address)??Kt,abi:((a==null?void 0:a.version)??"0.7")==="0.6"?pe:tt,version:(a==null?void 0:a.version)??"0.7"},h={pendingPlugins:A||[],allInstalled:!1},Ee=async()=>{if(!h.pendingPlugins.length||h.allInstalled){h.allInstalled=!0;return}const u=await Promise.all(h.pendingPlugins.map(f=>nt(t,{address:m,plugin:f})));h.pendingPlugins=h.pendingPlugins.filter((f,B)=>!u[B]),h.allInstalled=h.pendingPlugins.length===0},qe=async()=>{const u=await It(t,{address:m});if(!u||u.length===0||!u.toLowerCase().startsWith(`0xef0100${v.slice(2).toLowerCase()}`)){if(T&&!ae(T.address,v))throw new Error("EIP-7702 authorization delegate address does not match account implementation address");const f=T??await Mt(t,{account:l,address:v,chainId:await k()});if(!await St({authorization:f,address:m}))throw new Error("Authorization verification failed");return f}};return await Ee(),ue({authorization:d?{account:l??ea(m),address:v}:void 0,kernelVersion:y,kernelPluginManager:x,accountImplementationAddress:v,factoryAddress:(await H()).factory,generateInitCode:q,encodeModuleInstallCallData:async()=>await x.encodeModuleInstallCallData(m),nonceKeyManager:le({source:{get:()=>0,set:()=>{}}}),client:t,entryPoint:$e,getFactoryArgs:H,async getAddress(){if(m)return m;const{factory:u,factoryData:f}=await H();if(!u||!f)throw new Error("Missing factory address or factory data");return m=await R(t,{factory:u,factoryData:f,entryPointAddress:a.address}),m},async encodeDeployCallData(u){return a.version==="0.6"?yt(u):pt(u)},async encodeCalls(u,f,B){if(await Ee(),h.pendingPlugins.length>0&&a.version==="0.7"&&x.activeValidatorMode==="sudo"){const w=[];for(const I of h.pendingPlugins)w.push(ot(m,I));return ee([...u,...w],f,e!=null&&e.hook?!0:void 0,B)}return u.length===1&&(!f||f==="call")&&u[0].to.toLowerCase()===m.toLowerCase()?u[0].data??"0x":a.version==="0.6"?ct(u,f):e!=null&&e.hook?ee(u,f,!0,B):ee(u,f,void 0,B)},eip7702Authorization:qe,async sign({hash:u}){return this.signMessage({message:u})},async signMessage({message:u,useReplayableSignature:f}){const B=wt(u),{name:w,chainId:I,version:L}=await De();let g;if(d)g=await x.signTypedData({message:{hash:B},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:w,version:L,chainId:f?0:Number(I),verifyingContract:m}});else if(a.version==="0.6"){const V=await xe(B,{name:w,chainId:Number(I),version:L,verifyingContract:m},f);g=await x.signMessage({message:{raw:V}})}else g=await x.signTypedData({message:{hash:B},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:w,version:L,chainId:f?0:Number(I),verifyingContract:m}});return Q(Z.ERC1271_WITH_VALIDATOR,L)?(f&&Q(Z.ERC1271_REPLAYABLE,L)&&(g=M([kt,g])),M([x.getIdentifier(),g])):g},async signTypedData(u){const{message:f,primaryType:B,types:w,domain:I}=u,L={EIP712Domain:Se({domain:I}),...w};Le({domain:I,message:f,primaryType:B,types:L});const g=Re(u),{name:V,chainId:J,version:G}=await De();let U;if(d)U=await x.signTypedData({message:{hash:g},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:V,version:G,chainId:Number(J),verifyingContract:m}});else if(a.version==="0.6"){const Je=await xe(g,{name:V,chainId:Number(J),version:G,verifyingContract:m});U=await x.signMessage({message:{raw:Je}})}else U=await x.signTypedData({message:{hash:g},primaryType:"Kernel",types:{Kernel:[{name:"hash",type:"bytes32"}]},domain:{name:V,version:G,chainId:Number(J),verifyingContract:m}});return Q(Z.ERC1271_WITH_VALIDATOR,G)?M([x.getIdentifier(),U]):U},async getNonce(u){const f=await x.getNonceKey(m,u==null?void 0:u.key);return fe(t,{address:m,entryPointAddress:a.address,key:f})},async getStubSignature(u){if(!u)throw new Error("No user operation provided");return x.getStubSignature(u)},async signUserOperation(u){const{chainId:f=await k(),...B}=u;return x.signUserOperation({...B,sender:B.sender??await this.getAddress(),chainId:f})}})}const Xe="0x8ae01fcf7c655655ff2c6ef907b8b4718ab4e17c",We=[{type:"function",name:"multiSend",inputs:[{type:"bytes",name:"transactions"}]}],da=t=>{const e=Lt(t.data);return Xt(["uint8","address","uint256","uint256","bytes"],[t.callType==="delegatecall"?1:0,t.to,t.value||0n,BigInt(e.length),t.data]).slice(2)},Ye=t=>{if(!Array.isArray(t))throw new Error("Invalid multiSend calls, should use an array of calls");return`0x${t.map(e=>da(e)).join("")}`},oa=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"contract EIP1967Proxy",name:"proxy",type:"address"}],stateMutability:"nonpayable",type:"function"}],se=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"operation",type:"uint8"}],name:"executeAndRevert",outputs:[],stateMutability:"nonpayable",type:"function"}],ca={FACTORY_ADDRESS:"0x4E4946298614FC299B50c947289F4aD0572CB9ce"};async function Ta(t,{signer:e,address:a,entryPoint:n,index:s=0n}){const i={...e,signTransaction:(p,A)=>{throw new Error("Smart account signer doesn't need to sign transactions")}},r=await j(t),c=async()=>C({abi:oa,functionName:"createAccount",args:[e.address,s]}),y=async()=>({factory:ca.FACTORY_ADDRESS,factoryData:await c()});let o=a??await(async()=>{const{factory:p,factoryData:A}=await y();return await R(t,{factory:p,factoryData:A,entryPointAddress:n.address})})();if(!o)throw new Error("Account address not found");const D=Y({address:o,async signMessage({message:p}){return i.signMessage({message:p})},async signTransaction(p,A){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(p){return i.signTypedData(p)}}),T={address:(n==null?void 0:n.address)??Ne,abi:pe,version:(n==null?void 0:n.version)??"0.6"};return ue({...D,generateInitCode:c,encodeModuleInstallCallData:async()=>{throw new Error("Not implemented")},nonceKeyManager:le({source:{get:()=>0,set:()=>{}}}),async sign({hash:p}){return D.signMessage({message:p})},async signMessage({message:p}){return D.signMessage({message:p})},async signTypedData(p){return i.signTypedData(p)},async getAddress(){if(o)return o;const{factory:p,factoryData:A}=await y();return o=await R(t,{factory:p,factoryData:A,entryPointAddress:n.address}),o},getFactoryArgs:y,client:t,entryPoint:T,async getNonce(){return fe(t,{address:o,entryPointAddress:n.address})},async signUserOperation(p){const A=Ie({userOperation:{...p,sender:p.sender??await this.getAddress(),signature:"0x"},entryPointAddress:n.address,entryPointVersion:n.version,chainId:r});return await oe(t,{account:i,message:{raw:A}})},async encodeCalls(p,A){if(p.length>1){if(A==="delegatecall")throw new Error("Cannot batch delegatecall");const l=C({abi:We,functionName:"multiSend",args:[Ye(p)]});return C({abi:se,functionName:"executeAndRevert",args:[Xe,0n,l,1n]})}const d=p.length===0?void 0:p[0];if(!d)throw new Error("No calls to encode");if(!A||A==="call")return d.to.toLowerCase()===o.toLowerCase()?d.data||"0x":C({abi:se,functionName:"executeAndRevert",args:[d.to,d.value||0n,d.data,0n]});if(A==="delegatecall")return C({abi:se,functionName:"executeAndRevert",args:[d.to,d.value||0n,d.data,1n]});throw new Error("Invalid call type")},async getStubSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"}})}const re=[{type:"constructor",inputs:[{name:"v1",type:"address",internalType:"contract IValidator"},{name:"v2",type:"address",internalType:"contract IValidator"},{name:"v3",type:"address",internalType:"contract IValidator"},{name:"v4",type:"address",internalType:"contract IValidator"},{name:"v5",type:"address",internalType:"contract IValidator"},{name:"s1",type:"address",internalType:"contract ISigner"},{name:"s2",type:"address",internalType:"contract ISigner"},{name:"s3",type:"address",internalType:"contract ISigner"},{name:"tv1",type:"address",internalType:"contract IValidator"},{name:"tv2",type:"address",internalType:"contract IValidator"},{name:"tv3",type:"address",internalType:"contract IValidator"},{name:"ts1",type:"address",internalType:"contract ISigner"}],stateMutability:"nonpayable"},{type:"function",name:"consumeGas",inputs:[{name:"count",type:"uint256",internalType:"uint256"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isMigrated",inputs:[{name:"kernel",type:"address",internalType:"contract Kernel"},{name:"validators",type:"address[]",internalType:"contract IValidator[]"},{name:"pIds",type:"bytes4[]",internalType:"PermissionId[]"}],outputs:[{name:"root",type:"bool",internalType:"bool"},{name:"v",type:"bool[]",internalType:"bool[]"},{name:"p",type:"bool[]",internalType:"bool[]"}],stateMutability:"view"},{type:"function",name:"migrate",inputs:[],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"migrateWithCall",inputs:[{name:"validators",type:"address[]",internalType:"contract IValidator[]"},{name:"permissionIds",type:"bytes4[]",internalType:"bytes4[]"},{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"execData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"migrateWithPermissionId",inputs:[{name:"permissionId",type:"bytes4[]",internalType:"bytes4[]"},{name:"validators",type:"address[]",internalType:"contract IValidator[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"mockSlot",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"},{type:"function",name:"usedSlot",inputs:[{name:"",type:"address",internalType:"address"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"}],ie="0x03EB97959433D55748839D27C93330Cb85F31A93";async function xa(t,e){if(e.entryPoint.version!=="0.7")throw new Error("Only EntryPoint 0.7 is supported");const{plugins:{sudo:{migrate:{from:a,to:n}}},...s}=e,i=await he(t,{plugins:{sudo:a},...s});let r=!1,c=!1;const y=async()=>{try{if(r)return r;const A=await be(t,_t,"readContract")({address:i.address,abi:te,functionName:"rootValidator",args:[]}),d=M([Gt[n.validatorType],X(n.getIdentifier(),{size:20,dir:"right"})]);return r=A.toLowerCase()===d.toLowerCase(),r}catch{return!1}};if([c,r]=await Promise.all([i.isDeployed(),y()]),c&&r)return he(t,{plugins:{sudo:n},...s,address:i.address});const o=C({abi:te,functionName:"installModule",args:[3n,ie,ye([Be(ne({abi:re,name:"migrateWithCall"})),S,me(Ae("bytes selectorInitData, bytes hookInitData"),[Ht.DELEGATE_CALL,"0x0000"])])]}),D={to:i.address,data:o,value:0n},T=C({abi:te,functionName:"uninstallModule",args:[3n,ie,ye([Be(ne({abi:re,name:"migrateWithCall"})),"0x"])]}),p={to:i.address,data:T,value:0n};return{...i,getRootValidatorMigrationStatus:y,async encodeCalls(A,d){const l=await y(),E=await i.encodeCalls(A,d);if(l)return E;const{args:[F,v]}=Rt({abi:[ne({abi:lt,name:"execute"})],data:E}),_=C({abi:re,functionName:"migrateWithCall",args:[[],[],F,v]}),P={to:ie,data:_,value:0n};if(e.kernelVersion!=="0.3.0")return i.encodeCalls([P],"delegatecall");P.to=i.address;const N=[D,P,p];return i.encodeCalls(N,"call")}}}const z=[{type:"constructor",inputs:[{name:"_entryPoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"disableMode",inputs:[{name:"_disableFlag",type:"bytes4",internalType:"bytes4"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"entryPoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"to",type:"address",internalType:"address"},{name:"value",type:"uint256",internalType:"uint256"},{name:"data",type:"bytes",internalType:"bytes"},{name:"operation",type:"uint8",internalType:"enum Operation"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"getDefaultValidator",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IKernelValidator"}],stateMutability:"view"},{type:"function",name:"getDisabledMode",inputs:[],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"getExecution",inputs:[{name:"_selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutionDetail",components:[{name:"validUntil",type:"uint48",internalType:"uint48"},{name:"validAfter",type:"uint48",internalType:"uint48"},{name:"executor",type:"address",internalType:"address"},{name:"validator",type:"address",internalType:"contract IKernelValidator"}]}],stateMutability:"view"},{type:"function",name:"getLastDisabledTime",inputs:[],outputs:[{name:"",type:"uint48",internalType:"uint48"}],stateMutability:"view"},{type:"function",name:"getNonce",inputs:[{name:"key",type:"uint192",internalType:"uint192"}],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"getNonce",inputs:[],outputs:[{name:"",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_defaultValidator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"name",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"setDefaultValidator",inputs:[{name:"_defaultValidator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"setExecution",inputs:[{name:"_selector",type:"bytes4",internalType:"bytes4"},{name:"_executor",type:"address",internalType:"address"},{name:"_validator",type:"address",internalType:"contract IKernelValidator"},{name:"_validUntil",type:"uint48",internalType:"uint48"},{name:"_validAfter",type:"uint48",internalType:"uint48"},{name:"_enableData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct UserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"callGasLimit",type:"uint256",internalType:"uint256"},{name:"verificationGasLimit",type:"uint256",internalType:"uint256"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"maxFeePerGas",type:"uint256",internalType:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256",internalType:"uint256"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"uint256"}],stateMutability:"nonpayable"},{type:"function",name:"version",inputs:[],outputs:[{name:"",type:"string",internalType:"string"}],stateMutability:"view"},{type:"event",name:"DefaultValidatorChanged",inputs:[{name:"oldValidator",type:"address",indexed:!0,internalType:"address"},{name:"newValidator",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ExecutionChanged",inputs:[{name:"selector",type:"bytes4",indexed:!0,internalType:"bytes4"},{name:"executor",type:"address",indexed:!0,internalType:"address"},{name:"validator",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"newImplementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1}],ya=[{type:"constructor",inputs:[{name:"_entryPoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"function",name:"createAccount",inputs:[{name:"_validator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"},{name:"_index",type:"uint256",internalType:"uint256"}],outputs:[{name:"proxy",type:"address",internalType:"contract EIP1967Proxy"}],stateMutability:"nonpayable"},{type:"function",name:"entryPoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"getAccountAddress",inputs:[{name:"_validator",type:"address",internalType:"contract IKernelValidator"},{name:"_data",type:"bytes",internalType:"bytes"},{name:"_index",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"kernelTemplate",inputs:[],outputs:[{name:"",type:"address",internalType:"contract TempKernel"}],stateMutability:"view"},{type:"function",name:"nextTemplate",inputs:[],outputs:[{name:"",type:"address",internalType:"contract Kernel"}],stateMutability:"view"},{type:"event",name:"AccountCreated",inputs:[{name:"account",type:"address",indexed:!0,internalType:"address"},{name:"validator",type:"address",indexed:!0,internalType:"address"},{name:"data",type:"bytes",indexed:!1,internalType:"bytes"},{name:"index",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1}],pa="0x9b35Af71d77eaf8d7e40252370304687390A1A52",ua=Nt(["function performCreate(uint256 value, bytes memory deploymentData) public returns (address newContract)","function performCreate2(uint256 value, bytes memory deploymentData, bytes32 salt) public returns (address newContract)"]),la={FACTORY_ADDRESS:"0xaee9762ce625e0a8f7b184670fb57c37bfe1d0f1"},fa=async({index:t,factoryAddress:e,validatorAddress:a,enableData:n})=>M([e,C({abi:ya,functionName:"createAccount",args:[a,n,t]})]);async function Ba(t,{plugins:e,entryPoint:a,index:n=0n,factoryAddress:s=la.FACTORY_ADDRESS,address:i}){const r=de(e)?e:await Me(t,{sudo:e.sudo,regular:e.regular,action:e.action,pluginEnableSignature:e.pluginEnableSignature,kernelVersion:"0.0.2",entryPoint:a}),c=async()=>{const d=await r.getValidatorInitData();return fa({index:n,factoryAddress:s,validatorAddress:d.validatorAddress,enableData:d.enableData})},y=async()=>({factory:s,factoryData:await c()});let o=i??await(async()=>{const{factory:d,factoryData:l}=await y();return await R(t,{factory:d,factoryData:l,entryPointAddress:a.address})})();const D=Y({address:o,async signMessage({message:d}){return r.signMessage({message:d})},async signTransaction(d,l){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(d){const l=d,E={EIP712Domain:Se({domain:l.domain}),...l.types};Le({domain:l.domain,message:l.message,primaryType:l.primaryType,types:E});const F=Re(d);return r.signMessage({message:{raw:F}})}}),T={address:(a==null?void 0:a.address)??Ne,abi:pe,version:(a==null?void 0:a.version)??"0.6"};let p;const A=async()=>p||(p=t.chain?t.chain.id:await be(t,j,"getChainId")({}),p);return ue({kernelVersion:"0.0.2",client:t,entryPoint:T,kernelPluginManager:r,factoryAddress:s,accountImplementationAddress:_e["0.0.2"].accountImplementationAddress,generateInitCode:c,encodeModuleInstallCallData:async()=>await r.encodeModuleInstallCallData(o),nonceKeyManager:le({source:{get:()=>0,set:()=>{}}}),async sign({hash:d}){return D.signMessage({message:d})},async signMessage(d){return D.signMessage(d)},async signTypedData(d){return D.signTypedData(d)},getFactoryArgs:y,async getAddress(){if(o)return o;const{factory:d,factoryData:l}=await y();return o=await R(t,{factory:d,factoryData:l,entryPointAddress:a.address}),o},async getNonce(d){const l=await r.getNonceKey(o,d==null?void 0:d.key);return fe(t,{address:o,entryPointAddress:a.address,key:l})},async signUserOperation(d){const{chainId:l=await A(),...E}=d;return r.signUserOperation({...E,sender:E.sender??await this.getAddress(),chainId:l})},async encodeDeployCallData(d){return C({abi:z,functionName:"execute",args:[pa,0n,C({abi:ua,functionName:"performCreate",args:[0n,Ot({abi:d.abi,bytecode:d.bytecode,args:d.args})]}),1]})},async encodeCalls(d,l){if(d.length>1){const F=C({abi:We,functionName:"multiSend",args:[Ye(d)]});return C({abi:z,functionName:"execute",args:[Xe,0n,F,1]})}const E=d.length===0?void 0:d[0];if(!E)throw new Error("No calls to encode");if(!l||l==="call")return E.to.toLowerCase()===o.toLowerCase()?E.data||"0x":C({abi:z,functionName:"execute",args:[E.to,E.value||0n,E.data||"0x",0]});if(l==="delegatecall")return C({abi:z,functionName:"execute",args:[E.to,0n,E.data||"0x",1]});throw new Error("Invalid call type")},async getStubSignature(d){if(!d)throw new Error("No user operation provided");return r.getStubSignature(d)}})}const ba="0x60806040523480156200001157600080fd5b50604051620007003803806200070083398101604081905262000034916200056f565b6000620000438484846200004f565b9050806000526001601ff35b600080846001600160a01b0316803b806020016040519081016040528181526000908060200190933c90507f6492649264926492649264926492649264926492649264926492649264926492620000a68462000451565b036200021f57600060608085806020019051810190620000c79190620005ce565b8651929550909350915060000362000192576000836001600160a01b031683604051620000f5919062000643565b6000604051808303816000865af19150503d806000811462000134576040519150601f19603f3d011682016040523d82523d6000602084013e62000139565b606091505b5050905080620001905760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b505b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90620001c4908b90869060040162000661565b602060405180830381865afa158015620001e2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200020891906200069d565b6001600160e01b031916149450505050506200044a565b805115620002b157604051630b135d3f60e11b808252906001600160a01b03871690631626ba7e9062000259908890889060040162000661565b602060405180830381865afa15801562000277573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906200029d91906200069d565b6001600160e01b031916149150506200044a565b8251604114620003195760405162461bcd60e51b815260206004820152603a6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e677468000000000000606482015260840162000187565b620003236200046b565b506020830151604080850151855186939260009185919081106200034b576200034b620006c9565b016020015160f81c9050601b81148015906200036b57508060ff16601c14155b15620003cf5760405162461bcd60e51b815260206004820152603b6024820152600080516020620006e083398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c75650000000000606482015260840162000187565b6040805160008152602081018083528a905260ff83169181019190915260608101849052608081018390526001600160a01b038a169060019060a0016020604051602081039080840390855afa1580156200042e573d6000803e3d6000fd5b505050602060405103516001600160a01b031614955050505050505b9392505050565b60006020825110156200046357600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b03811681146200049f57600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620004d5578181015183820152602001620004bb565b50506000910152565b600082601f830112620004f057600080fd5b81516001600160401b03808211156200050d576200050d620004a2565b604051601f8301601f19908116603f01168101908282118183101715620005385762000538620004a2565b816040528381528660208588010111156200055257600080fd5b62000565846020830160208901620004b8565b9695505050505050565b6000806000606084860312156200058557600080fd5b8351620005928162000489565b6020850151604086015191945092506001600160401b03811115620005b657600080fd5b620005c486828701620004de565b9150509250925092565b600080600060608486031215620005e457600080fd5b8351620005f18162000489565b60208501519093506001600160401b03808211156200060f57600080fd5b6200061d87838801620004de565b935060408601519150808211156200063457600080fd5b50620005c486828701620004de565b6000825162000657818460208701620004b8565b9190910192915050565b828152604060208201526000825180604084015262000688816060850160208701620004b8565b601f01601f1916919091016060019392505050565b600060208284031215620006b057600080fd5b81516001600160e01b0319811681146200044a57600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",Fa=async({signer:t,hash:e,signature:a,client:n})=>(await n.call({data:ye([ba,me(Ae("address, bytes32, bytes"),[t,e,a])])})).data==="0x01",ve=(t,e)=>{const n=Pt(ce(t)).substring(2,e*2+2);return BigInt(`0x${n}`)},ga=(t,e)=>e==="0.6"?ve(t,24):ve(t,2),ha=t=>{const{key:e="public",name:a="ZeroDev Paymaster Client",transport:n}=t;return Vt({...t,transport:i=>n({...i,retryCount:0}),key:e,name:a,type:"zerodevPaymasterClient"}).extend(Zt).extend(ft())},va=(t,e)=>{function a(s){return async(...i)=>{for(let r=0;r{const o=y(n);for(const[D,T]of Object.entries(o))typeof T=="function"?n[D]=async(...p)=>T(...p):console.error(`Expected a function for modification of ${D}, but received type ${typeof T}`);return n};const c=Reflect.get(s,i,r);return typeof c=="function"?a(i):c}});return n},wa=[{inputs:[{internalType:"address",name:"_owner",type:"address"},{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"DeploymentFailed",type:"error"},{inputs:[],name:"NewOwnerIsZeroAddress",type:"error"},{inputs:[],name:"NoHandoverRequest",type:"error"},{inputs:[],name:"SaltDoesNotStartWithCaller",type:"error"},{inputs:[],name:"Unauthorized",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"proxy",type:"address"},{indexed:!0,internalType:"address",name:"implementation",type:"address"}],name:"Deployed",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverCanceled",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"pendingOwner",type:"address"}],name:"OwnershipHandoverRequested",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{inputs:[{internalType:"uint32",name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"cancelOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"completeOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"createAccount",outputs:[{internalType:"address",name:"proxy",type:"address"}],stateMutability:"payable",type:"function"},{inputs:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes",name:"_data",type:"bytes"},{internalType:"uint256",name:"_index",type:"uint256"}],name:"getAccountAddress",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"initCodeHash",outputs:[{internalType:"bytes32",name:"result",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"isAllowedImplementation",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"result",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"pendingOwner",type:"address"}],name:"ownershipHandoverExpiresAt",outputs:[{internalType:"uint256",name:"result",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"ownershipHandoverValidFor",outputs:[{internalType:"uint64",name:"",type:"uint64"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"salt",type:"bytes32"}],name:"predictDeterministicAddress",outputs:[{internalType:"address",name:"predicted",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"requestOwnershipHandover",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],name:"setEntryPoint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_implementation",type:"address"},{internalType:"bool",name:"_allow",type:"bool"}],name:"setImplementation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address payable",name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"}],Ia=[{type:"constructor",inputs:[{name:"_entrypoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"accountId",inputs:[],outputs:[{name:"accountImplementationId",type:"string",internalType:"string"}],stateMutability:"pure"},{type:"function",name:"changeRootValidator",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"currentNonce",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"entrypoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executorConfig",inputs:[{name:"executor",type:"address",internalType:"contract IExecutor"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutorManager.ExecutorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"function",name:"grantAccess",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"},{name:"allow",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"payable"},{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"},{name:"initConfig",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"installModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"initData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"installValidations",inputs:[{name:"vIds",type:"bytes21[]",internalType:"ValidationId[]"},{name:"configs",type:"tuple[]",internalType:"struct ValidationManager.ValidationConfig[]",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]},{name:"validationData",type:"bytes[]",internalType:"bytes[]"},{name:"hookData",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"payable"},{type:"function",name:"invalidateNonce",inputs:[{name:"nonce",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"isAllowedSelector",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isModuleInstalled",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"additionalContext",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"data",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"permissionConfig",inputs:[{name:"pId",type:"bytes4",internalType:"PermissionId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.PermissionConfig",components:[{name:"permissionFlag",type:"bytes2",internalType:"PassFlag"},{name:"signer",type:"address",internalType:"contract ISigner"},{name:"policyData",type:"bytes22[]",internalType:"PolicyData[]"}]}],stateMutability:"view"},{type:"function",name:"replayableUserOpHash",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"entryPoint",type:"address",internalType:"address"}],outputs:[{name:"",type:"bytes32",internalType:"bytes32"}],stateMutability:"pure"},{type:"function",name:"rootValidator",inputs:[],outputs:[{name:"",type:"bytes21",internalType:"ValidationId"}],stateMutability:"view"},{type:"function",name:"selectorConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct SelectorManager.SelectorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"},{name:"target",type:"address",internalType:"address"},{name:"callType",type:"bytes1",internalType:"CallType"}]}],stateMutability:"view"},{type:"function",name:"supportsExecutionMode",inputs:[{name:"mode",type:"bytes32",internalType:"ExecMode"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"supportsModule",inputs:[{name:"moduleTypeId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"uninstallModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"deInitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"uninstallValidation",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"deinitData",type:"bytes",internalType:"bytes"},{name:"hookDeinitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"validNonceFrom",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"ValidationData"}],stateMutability:"payable"},{type:"function",name:"validationConfig",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.ValidationConfig",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"event",name:"ModuleInstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ModuleUninstallResult",inputs:[{name:"module",type:"address",indexed:!1,internalType:"address"},{name:"result",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"ModuleUninstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"NonceInvalidated",inputs:[{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionInstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionUninstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"}],anonymous:!1},{type:"event",name:"Received",inputs:[{name:"sender",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RootValidatorUpdated",inputs:[{name:"rootValidator",type:"bytes21",indexed:!1,internalType:"ValidationId"}],anonymous:!1},{type:"event",name:"SelectorSet",inputs:[{name:"selector",type:"bytes4",indexed:!1,internalType:"bytes4"},{name:"vId",type:"bytes21",indexed:!1,internalType:"ValidationId"},{name:"allowed",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"TryExecuteUnsuccessful",inputs:[{name:"batchExecutionindex",type:"uint256",indexed:!1,internalType:"uint256"},{name:"result",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ValidatorInstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"ValidatorUninstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"}],anonymous:!1},{type:"error",name:"AlreadyInitialized",inputs:[]},{type:"error",name:"EnableNotApproved",inputs:[]},{type:"error",name:"ExecutionReverted",inputs:[]},{type:"error",name:"InitConfigError",inputs:[{name:"idx",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidCallType",inputs:[]},{type:"error",name:"InvalidCaller",inputs:[]},{type:"error",name:"InvalidExecutor",inputs:[]},{type:"error",name:"InvalidFallback",inputs:[]},{type:"error",name:"InvalidMode",inputs:[]},{type:"error",name:"InvalidModuleType",inputs:[]},{type:"error",name:"InvalidNonce",inputs:[]},{type:"error",name:"InvalidSelector",inputs:[]},{type:"error",name:"InvalidSelectorData",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"InvalidValidationType",inputs:[]},{type:"error",name:"InvalidValidator",inputs:[]},{type:"error",name:"NonceInvalidationError",inputs:[]},{type:"error",name:"NotSupportedCallType",inputs:[]},{type:"error",name:"OnlyExecuteUserOp",inputs:[]},{type:"error",name:"PermissionDataLengthMismatch",inputs:[]},{type:"error",name:"PermissionNotAlllowedForSignature",inputs:[]},{type:"error",name:"PermissionNotAlllowedForUserOp",inputs:[]},{type:"error",name:"PolicyDataTooLarge",inputs:[]},{type:"error",name:"PolicyFailed",inputs:[{name:"i",type:"uint256",internalType:"uint256"}]},{type:"error",name:"PolicySignatureOrderError",inputs:[]},{type:"error",name:"RootValidatorCannotBeRemoved",inputs:[]},{type:"error",name:"SignerPrefixNotPresent",inputs:[]}],Ma=[{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_amount",type:"uint256"},{internalType:"address",name:"_to",type:"address"}],name:"transfer20Action",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_id",type:"uint256"},{internalType:"address",name:"_to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"transferERC1155Action",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_token",type:"address"},{internalType:"uint256",name:"_id",type:"uint256"},{internalType:"address",name:"_to",type:"address"}],name:"transferERC721Action",outputs:[],stateMutability:"nonpayable",type:"function"}],Sa={1:{ABT:"0xB98d4C97425d9908E66E53A6fDf673ACcA0BE986",ACH:"0xEd04915c23f00A313a544955524EB7DBD823143d",ADX:"0xADE00C28244d5CE17D72E40330B1c318cD12B7c3",AGLD:"0x32353A6C91143bfd6C7d363B546e62a9A2489A20",AIOZ:"0x626E8036dEB333b408Be468F951bdB42433cBF18",ALEPH:"0x27702a26126e0B3702af63Ee09aC4d1A084EF628",ALI:"0x6B0b3a982b4634aC68dD83a4DBF02311cE324181",ALICE:"0xAC51066d7bEC65Dc4589368da368b212745d63E8",ALPHA:"0xa1faa113cbE53436Df28FF0aEe54275c13B40975",AMP:"0xfF20817765cB7f73d4bde2e66e067E58D11095C2",ANKR:"0x8290333ceF9e6D528dD5618Fb97a76f268f3EDD4",ANT:"0xa117000000f279D81A1D3cc75430fAA017FA5A2e",APE:"0x4d224452801ACEd8B2F0aebE155379bb5D594381",API3:"0x0b38210ea11411557c13457D4dA7dC6ea731B88a",ARB:"0xB50721BCf8d664c30412Cfbc6cf7a15145234ad1",ASM:"0x2565ae0385659badCada1031DB704442E1b69982",AUDIO:"0x18aAA7115705e8be94bfFEBDE57Af9BFc265B998",AXL:"0x467719aD09025FcC6cF6F8311755809d45a5E5f3",AXS:"0xBB0E17EF65F82Ab018d8EDd776e8DD940327B28b",BADGER:"0x3472A5A71965499acd81997a54BBA8D852C6E53d",BAL:"0xba100000625a3754423978a60c9317c58a424e3D",BIGTIME:"0x64Bc2cA1Be492bE7185FAA2c8835d9b824c8a194",BIT:"0x1A4b46696b2bB4794Eb3D4c26f1c55F9170fa4C5",BLUR:"0x5283D291DBCF85356A21bA090E6db59121208b44",BLZ:"0x5732046A883704404F284Ce41FfADd5b007FD668",BNT:"0x1F573D6Fb3F13d689FF844B4cE37794d79a7FF1C",BOND:"0x0391D2021f89DC339F60Fff84546EA23E337750f",BTRST:"0x799ebfABE77a6E34311eeEe9825190B9ECe32824",BUSD:"0x4Fabb145d64652a948d72533023f6E7A623C7C53",CBETH:"0xBe9895146f7AF43049ca1c1AE358B0541Ea49704",CELR:"0x4F9254C83EB525f9FCf346490bbb3ed28a81C667",CHR:"0x8A2279d4A90B6fe1C4B30fa660cC9f926797bAA2",CHZ:"0x3506424F91fD33084466F402d5D97f05F8e3b4AF",COTI:"0xDDB3422497E61e13543BeA06989C0789117555c5",COVAL:"0x3D658390460295FB963f54dC0899cfb1c30776Df",CQT:"0xD417144312DbF50465b1C641d016962017Ef6240",CRO:"0xA0b73E1Ff0B80914AB6fe0444E65848C4C34450b",CRPT:"0x08389495D7456E1951ddF7c3a1314A4bfb646d8B",CRV:"0xD533a949740bb3306d119CC777fa900bA034cd52",CTSI:"0x491604c0FDF08347Dd1fa4Ee062a822A5DD06B5D",CUBE:"0xDf801468a808a32656D2eD2D2d80B72A129739f4",CVC:"0x41e5560054824eA6B0732E656E3Ad64E20e94E45",CVX:"0x4e3FBD56CD56c3e72c1403e103b45Db9da5B9D2B",DAI:"0x6B175474E89094C44Da98b954EedeAC495271d0F",DAR:"0x081131434f93063751813C619Ecca9C4dC7862a3",DDX:"0x3A880652F47bFaa771908C07Dd8673A787dAEd3A",DENT:"0x3597bfD533a99c9aa083587B074434E61Eb0A258",DEXT:"0xfB7B4564402E5500dB5bB6d63Ae671302777C75a",DIA:"0x84cA8bc7997272c7CfB4D0Cd3D55cd942B3c9419",DPI:"0x1494CA1F11D487c2bBe4543E90080AeBa4BA3C2b",DYP:"0x961C8c0B1aaD0c0b10a51FeF6a867E3091BCef17",ELA:"0xe6fd75ff38Adca4B97FBCD938c86b98772431867",ELON:"0x761D38e5ddf6ccf6Cf7c55759d5210750B5D60F3",ENJ:"0xF629cBd94d3791C9250152BD8dfBDF380E2a3B9c",ENS:"0xC18360217D8F7Ab5e7c516566761Ea12Ce7F9D72",ERN:"0xBBc2AE13b23d715c30720F079fcd9B4a74093505",EUL:"0xd9Fcd98c322942075A5C3860693e9f4f03AAE07b",EURC:"0x1aBaEA1f7C830bD89Acc67eC4af516284b1bC33c",FARM:"0xa0246c9032bC3A600820415aE600c6388619A14D",FET:"0xaea46A60368A7bD060eec7DF8CBa43b7EF41Ad85",FIS:"0xef3A930e1FfFFAcd2fc13434aC81bD278B0ecC8d",FORTH:"0x77FbA179C79De5B7653F68b5039Af940AdA60ce0",FRAX:"0x853d955aCEf822Db058eb8505911ED77F175b99e",FTM:"0x4E15361FD6b4BB609Fa63C81A2be19d873717870",FXS:"0x3432B6A60D23Ca0dFCa7761B7ab56459D9C964D0",GAL:"0x5fAa989Af96Af85384b8a938c2EdE4A7378D9875",GFI:"0xdab396cCF3d84Cf2D07C4454e10C8A6F5b008D2b",GHST:"0x3F382DbD960E3a9bbCeaE22651E88158d2791550",GLM:"0x7DD9c5Cba05E151C895FDe1CF355C9A1D5DA6429",GNO:"0x6810e776880C02933D47DB1b9fc05908e5386b96",GODS:"0xccC8cb5229B0ac8069C51fd58367Fd1e622aFD97",GRT:"0xc944E90C64B2c07662A292be6244BDf05Cda44a7",GTC:"0xDe30da39c46104798bB5aA3fe8B9e0e1F348163F",GUSD:"0x056Fd409E1d7A124BD7017459dFEa2F387b6d5Cd",HFT:"0xb3999F658C0391d94A37f7FF328F3feC942BcADC",HIGH:"0x71Ab77b7dbB4fa7e017BC15090b2163221420282",ILV:"0x767FE9EDC9E0dF98E07454847909b5E959D7ca0E",IMX:"0xF57e7e7C23978C3cAEC3C3548E3D615c346e79fF",INDEX:"0x0954906da0Bf32d5479e25f46056d22f08464cab",INJ:"0xe28b3B32B6c345A34Ff64674606124Dd5Aceca30",INV:"0x41D5D79431A913C4aE7d69a668ecdfE5fF9DFB68",IOTX:"0x6fB3e0A217407EFFf7Ca062D46c26E5d60a14d69",JASMY:"0x7420B4b9a0110cdC71fB720908340C03F9Bc03EC",JUP:"0x4B1E80cAC91e2216EEb63e29B957eB91Ae9C2Be8",KEEP:"0x85Eee30c52B0b379b046Fb0F85F4f3Dc3009aFEC",KP3R:"0x1cEB5cB57C4D4E2b2433641b95Dd330A33185A44",LCX:"0x037A54AaB062628C9Bbae1FDB1583c195585fe41",LDO:"0x5A98FcBEA516Cf06857215779Fd812CA3beF1B32",LINK:"0x514910771AF9Ca656af840dff83E8264EcF986CA",LOKA:"0x61E90A50137E1F645c9eF4a0d3A4f01477738406",LPT:"0x58b6A8A3302369DAEc383334672404Ee733aB239",LQTY:"0x6DEA81C8171D0bA574754EF6F8b412F2Ed88c54D",LRC:"0xBBbbCA6A901c926F240b89EacB641d8Aec7AEafD",LUSD:"0x5f98805A4E8be255a32880FDeC7F6728C6568bA0",MANA:"0x0F5D2fB29fb7d3CFeE444a200298f468908cC942",MASK:"0x69af81e73A73B40adF4f3d4223Cd9b1ECE623074",MATH:"0x08d967bb0134F2d07f7cfb6E246680c53927DD30",MATIC:"0x7D1AfA7B718fb893dB30A3aBc0Cfc608AaCfeBB0",MCO2:"0xfC98e825A2264D890F9a1e68ed50E1526abCcacD",MDT:"0x814e0908b12A99FeCf5BC101bB5d0b8B5cDf7d26",METIS:"0x9E32b13ce7f2E80A01932B42553652E053D6ed8e",MIM:"0x99D8a9C45b2ecA8864373A26D1459e3Dff1e17F3",MIR:"0x09a3EcAFa817268f77BE1283176B946C4ff2E608",MLN:"0xec67005c4E498Ec7f55E092bd1d35cbC47C91892",MONA:"0x275f5Ad03be0Fa221B4C6649B8AeE09a42D9412A",MPL:"0x33349B282065b0284d756F0577FB39c158F935e6",MTL:"0xF433089366899D83a9f26A773D59ec7eCF30355e",MUSE:"0xB6Ca7399B4F9CA56FC27cBfF44F4d2e4Eef1fc81",MXC:"0x5Ca381bBfb58f0092df149bD3D243b08B9a8386e",NCT:"0x9E46A38F5DaaBe8683E10793b06749EEF7D733d1",NEXO:"0xB62132e35a6c13ee1EE0f84dC5d40bad8d815206",NMR:"0x1776e1F26f98b1A5dF9cD347953a26dd3Cb46671",OCEAN:"0x967da4048cD07aB37855c090aAF366e4ce1b9F48",OGN:"0x8207c1FfC5B6804F6024322CcF34F29c3541Ae26",ONEINCH:"0x111111111117dC0aa78b770fA6A738034120C302",ORN:"0x0258F474786DdFd37ABCE6df6BBb1Dd5dfC4434a",OXT:"0x4575f41308EC1483f3d399aa9a2826d74Da13Deb",PAXG:"0x45804880De22913dAFE09f4980848ECE6EcbAf78",PERP:"0xbC396689893D065F41bc2C6EcbeE5e0085233447",PLA:"0x3a4f40631a4f906c2BaD353Ed06De7A5D3fCb430",POLS:"0x83e6f1E41cdd28eAcEB20Cb649155049Fac3D5Aa",POLY:"0x9992eC3cF6A55b00978cdDF2b27BC6882d88D1eC",POWR:"0x595832F8FC6BF59c85C527fEC3740A1b7a361269",PRIME:"0xb23d80f5FefcDDaa212212F028021B41DEd428CF",PRQ:"0x362bc847A3a9637d3af6624EeC853618a43ed7D2",PYUSD:"0x6c3ea9036406852006290770BEdFcAbA0e23A0e8",QNT:"0x4a220E6096B25EADb88358cb44068A3248254675",QUICK:"0x6c28AeF8977c9B773996d0e8376d2EE379446F2f",RAD:"0x31c8EAcBFFdD875c74b94b077895Bd78CF1E64A3",RAI:"0x03ab458634910AaD20eF5f1C8ee96F1D6ac54919",RARE:"0xba5BDe662c17e2aDFF1075610382B9B691296350",RARI:"0xFca59Cd816aB1eaD66534D82bc21E7515cE441CF",REN:"0x408e41876cCCDC0F92210600ef50372656052a38",REP:"0x1985365e9f78359a9B6AD760e32412f4a445E862",REQ:"0x8f8221aFbB33998d8584A2B05749bA73c37a938a",REVV:"0x557B933a7C2c45672B610F8954A3deB39a51A8Ca",RLC:"0x607F4C5BB672230e8672085532f7e901544a7375",RLY:"0xf1f955016EcbCd7321c7266BccFB96c68ea5E49b",RNDR:"0x6De037ef9aD2725EB40118Bb1702EBb27e4Aeb24",SHIB:"0x95aD61b0a150d79219dCF64E1E6Cc01f0B64C4cE",SNT:"0x744d70FDBE2Ba4CF95131626614a1763DF805B9E",SOL:"0xD31a59c85aE9D8edEFeC411D448f90841571b89c",SPELL:"0x090185f2135308BaD17527004364eBcC2D37e5F6",STORJ:"0xB64ef51C888972c908CFacf59B47C1AfBC0Ab8aC",SUPER:"0xe53EC727dbDEB9E2d5456c3be40cFF031AB40A55",SUSHI:"0x6B3595068778DD592e39A122f4f5a5cF09C90fE2",SWFTC:"0x0bb217E40F8a5Cb79Adf04E1aAb60E5abd0dfC1e",SYLO:"0xf293d23BF2CDc05411Ca0edDD588eb1977e8dcd4",SYN:"0x0f2D719407FdBeFF09D87557AbB7232601FD9F29",TBTC:"0x18084fbA666a33d37592fA2633fD49a74DD93a88",TOKE:"0x2e9d63788249371f1DFC918a52f8d799F4a38C94",TONE:"0x2Ab6Bb8408ca3199B8Fa6C92d5b455F820Af03c4",TRAC:"0xaA7a9CA87d3694B5755f213B5D04094b8d0F0A6F",TRB:"0x88dF592F8eb5D7Bd38bFeF7dEb0fBc02cf3778a0",TRIBE:"0xc7283b66Eb1EB5FB86327f08e1B5816b0720212B",TRU:"0x4C19596f5aAfF459fA38B0f7eD92F11AE6543784",TVK:"0xd084B83C305daFD76AE3E1b4E1F1fe2eCcCb3988",UNI:"0x1f9840a85d5aF5bf1D1762F925BDADdC4201F984",USDC:"0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48",USDT:"0xdAC17F958D2ee523a2206206994597C13D831ec7",VGX:"0x3C4B6E6e1eA3D4863700D7F76b36B7f3D3f13E3d",WAMPL:"0xEDB171C18cE90B633DB442f2A6F72874093b49Ef",WBTC:"0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",WETH:"0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",XCN:"0xA2cd3D43c775978A96BdBf12d733D5A1ED94fb18",XSGD:"0x70e8dE73cE538DA2bEEd35d14187F6959a8ecA96",YFI:"0x0bc529c00C6401aEF6D220BE8C6Ea1667F6Ad93e",YFII:"0xa1d0E215a23d7030842FC67cE582a6aFa3CCaB83"},5:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x07865c6E87B9F70255377e024ace6630C1Eaa37F"},10:{AAVE:"0x76FB31fb4af56892A25e32cFC43De717950c9278",CRV:"0x0994206dfE8De6Ec6920FF4D779B0d950605Fb53",DAI:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",ENS:"0x65559aA14915a70190438eF90104769e5E890A00",FRAX:"0x2E3D870790dC77A83DD1d18184Acc7439A53f475",LDO:"0xFdb794692724153d1488CcdBE0C56c252596735F",LINK:"0x350a791Bfc2C21F9Ed5d10980Dad2e2638ffa7f6",LUSD:"0xc40F949F8a4e094D1b49a23ea9241D289B7b2819",OP:"0x4200000000000000000000000000000000000042",PEPE:"0xC1c167CC44f7923cd0062c4370Df962f9DDB16f5",PERP:"0x9e1028F5F1D5eDE59748FFceE5532509976840E0",RAI:"0x7FB688CCf682d58f86D7e38e03f9D22e7705448B",UNI:"0x6fd9d7AD17242c41f7131d257212c54A0e816691",USDC:"0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85",USDT:"0x94b008aA00579c1307B0EF2c499aD98a8ce58e58",WBTC:"0x68f180fcCe6836688e9084f035309E29Bf0A2095",WETH:"0x4200000000000000000000000000000000000006"},56:{AAVE:"0xfb6115445Bff7b52FeB98650C87f44907E58f802",ADA:"0x3ee2200efb3400fabb9aacf31297cbdd1d435d47",AVAX:"0x1ce0c2827e2ef14d5c4f29a091d735a204794041",BTCB:"0x7130d2a12b9bcbfae4f2634d864a1ee1ce3ead9c",BUSD:"0xe9e7CEA3DedcA5984780Bafc599bD69ADd087D56",CAKE:"0x0e09fabb73bd3ade0a17ecc321fd13a19e81ce82",DAI:"0x1AF3F329e8BE154074D8769D1FFa4eE058B1DBc3",DOGE:"0xba2ae424d960c26247dd6c32edc70b295c744c43",DOT:"0x7083609fce4d1d8dc0c979aab8c869ea2c873402",ETH:"0x2170Ed0880ac9A755fd29B2688956BD959F933F8",FET:"0x031b41e504677879370e9DBcF937283A8691Fa7f",FRAX:"0x90C97F71E18723b0Cf0dfa30ee176Ab653E89F40",FTM:"0xAD29AbB318791D579433D831ed122aFeAf29dcfe",HIGH:"0x5f4Bde007Dc06b867f86EBFE4802e34A1fFEEd63",HOOK:"0xa260e12d2b924cb899ae80bb58123ac3fee1e2f0",LINK:"0xF8A0BF9cF54Bb92F17374d9e9A321E6a111a51bD",MATIC:"0xCC42724C6683B7E57334c4E856f4c9965ED682bD",MBOX:"0x3203c9e46ca618c8c1ce5dc67e7e9d75f5da2377",MIM:"0xfE19F0B51438fd612f6FD59C1dbB3eA319f433Ba",SHIB:"0x2859e4544c4bb03966803b044a93563bd2d0dd4d",STG:"0xB0D502E938ed5f4df2E681fE6E419ff29631d62b",TRON:"0xce7de646e7208a4ef112cb6ed5038fa6cc6b12e3",TWT:"0x4B0F1812e5Df2A09796481Ff14017e6005508003",UNI:"0xBf5140A22578168FD562DCcF235E5D43A02ce9B1",USDC:"0x8ac76a51cc950d9822d68b83fe1ad97b32cd580d",USDT:"0x55d398326f99059fF775485246999027B3197955",WBNB:"0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c",XRP:"0x1d2f0da169ceb9fc7b3144628db156f3f6c60dbe"},97:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x16227D60f7a0e586C66B005219dfc887D13C9531"},137:{AAVE:"0xD6DF932A45C0f255f85145f286eA0b292B21C90B",AGEUR:"0xE0B52e49357Fd4DAf2c15e02058DCE6BC0057db4",ANKR:"0x101A023270368c0D50BFfb62780F4aFd4ea79C35",BUSD:"0xdAb529f40E671A1D4bF91361c21bf9f0C9712ab7",COMP:"0x8505b9d2254A7Ae468c0E9dd10Ccea3A837aef5c",CRV:"0x172370d5Cd63279eFa6d502DAB29171933a610AF",DAI:"0x8f3Cf7ad23Cd3CaDbD9735AFf958023239c6A063",DPI:"0x85955046DF4668e1DD369D2DE9f3AEB98DD2A369",DYDX:"0x4C3bF0a3DE9524aF68327d1D2558a3B70d17D42a",FORT:"0x9ff62d1FC52A907B6DCbA8077c2DDCA6E6a9d3e1",FRAX:"0x104592a158490a9228070E0A8e5343B499e125D0",GHST:"0x385Eeac5cB85A38A9a07A70c73e0a3271CfB54A7",GNS:"0xE5417Af564e4bFDA1c483642db72007871397896",GRT:"0x5fe2B58c013d7601147DcdD68C143A77499f5531",IOTX:"0xf6372cDb9c1d3674E83842e3800F2A62aC9F3C66",LDO:"0xC3C7d422809852031b44ab29EEC9F1EfF2A58756",LINK:"0x53E0bca35eC356BD5ddDFebbD1Fc0fD03FaBad39",MANA:"0xA1c57f48F0Deb89f569dFbE6E2B7f46D33606fD4",MKR:"0x6f7C932e7684666C9fd1d44527765433e01fF61d",MLN:"0xa9f37D84c856fDa3812ad0519Dad44FA0a3Fe207",ONEINCH:"0x9c2C5fd7b07E95EE044DDeba0E97a665F142394f",OXT:"0x9880e3dDA13c8e7D4804691A45160102d31F6060",RNDR:"0x61299774020dA444Af134c82fa83E3810b309991",SHIB:"0x6f8a06447Ff6FcF75d803135a7de15CE88C1d4ec",SNX:"0x50B728D8D964fd00C2d0AAD81718b71311feF68a",SUSHI:"0x0b3F868E0BE5597D5DB7fEB59E1CADBb0fdDa50a",UNI:"0xb33EaAd8d922B1083446DC23f610c2567fB5180f",USDC:"0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359",USDCe:"0x2791Bca1f2de4661ED88A30C99A7a9449Aa84174",USDT:"0xc2132D05D31c914a87C6611C10748AEb04B58e8F",VOXEL:"0xd0258a3fD00f38aa8090dfee343f10A9D4d30D3F",WBTC:"0x1BFD67037B42Cf73acF2047067bd4F2C47D9BfD6",WETH:"0x7ceB23fD6bC0adD59E62ac25578270cFf1b9f619"},420:{ECO:"0x54bBECeA38ff36D32323f8A754683C1F5433A89f","6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0xe05606174bac4A6364B31bd0eCA4bf4dD368f8C6"},8453:{DAI:"0x50c5725949A6F0c72E6C4a641F24049A917DB0Cb",PRIME:"0xfA980cEd6895AC314E7dE34Ef1bFAE90a5AdD21b",TBTC:"0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b",USDbC:"0xd9aAEc86B65D86f6A7B5B1b0c42FFA531710b6CA",USDC:"0x833589fcd6edb6e08f4c7c32d4f71b54bda02913",WAMPL:"0x489fe42C267fe0366B16b0c39e7AEEf977E841eF",WETH:"0x4200000000000000000000000000000000000006"},42161:{AAVE:"0xba5DdD1f9d7F570dc94a51479a000E3BCE967196",ARB:"0x912ce59144191c1204e64559fe8253a0e49e6548",BADGER:"0xBfa641051Ba0a0Ad1b0AcF549a89536A0D76472E",BAL:"0x040d1edc9569d4bab2d15287dc5a4f10f56a56b8",CBETH:"0x1DEBd73E752bEaF79865Fd6446b0c970EaE7732f",COMP:"0x354A6dA3fcde098F8389cad84b0182725c6C91dE",CRV:"0x11cDb42B0EB46D95f990BeDD4695A6e3fA034978",CTX:"0x84F5c2cFba754E76DD5aE4fB369CfC920425E12b",DAI:"0xDA10009cBd5D07dd0CeCc66161FC93D7c9000da1",FRAX:"0x17fc002b466eec40dae837fc4be5c67993ddbd6f",GMX:"0xfc5A1A6EB076a2C7aD06eD22C90d7E710E35ad0a",GRT:"0x9623063377AD1B27544C965cCd7342f7EA7e88C7",KYBER:"0xe4dddfe67e7164b0fe14e218d80dc4c08edc01cb",LDO:"0x13Ad51ed4F1B7e9Dc168d8a00cB3f4dDD85EfA60",LINK:"0xf97f4df75117a78c1A5a0DBb814Af92458539FB4",LPT:"0x289ba1701C2F088cf0faf8B3705246331cB8A839",LUSD:"0x93b346b6BC2548dA6A1E7d98E9a421B42541425b",MATIC:"0x561877b6b3DD7651313794e5F2894B2F18bE0766",SNX:"0xcBA56Cd8216FCBBF3fA6DF6137F3147cBcA37D60",SPELL:"0x3E6648C5a70A150A88bCE65F4aD4d506Fe15d2AF",SUSHI:"0xd4d42F0b6DEF4CE0383636770eF773390d85c61A",TUSD:"0x4d15a3a2286d883af0aa1b3f21367843fac63e07",UNI:"0xFa7F8980b0f1E64A2062791cc3b0871572f1F7f0",USDC:"0xaf88d065e77c8cC2239327C5EDb3A432268e5831",USDCe:"0xFF970A61A04b1cA14834A43f5dE4533eBDDB5CC8",USDT:"0xFd086bC7CD5C481DCC9C85ebE478A1C0b69FCbb9",WBTC:"0x2f2a2543B76A4166549F7aaB2e75Bef0aefC5B0f",WETH:"0x82aF49447D8a07e3bd95BD0d56f35241523fBab1"},43113:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x5425890298aed601595a70AB815c96711a31Bc65"},43114:{BENQI:"0x8729438eb15e2c8b576fcc6aecda6a148776c0f5",BUSDe:"0x19860ccb0a68fd4213ab9d8266f7bbf05a8dde98",DAIe:"0xd586e7f844cea2f87f50152665bcbc2c279d8d70",EURC:"0xC891EB4cbdEFf6e073e859e987815Ed1505c2ACD",JOE:"0x6e84a6216ea6dacc71ee8e6b0a5b7322eebc0fdd",MIM:"0x130966628846BFd36ff31a822705796e8cb8C18D",PNG:"0x60781c2586d68229fde47564546784ab3faca982",STG:"0x2F6F07CDcf3588944Bf4C42aC74ff24bF56e7590",USDC:"0xb97ef9ef8734c71904d8002f8b6bc66dd9c48a6e",USDCe:"0xa7d7079b0fead91f3e65f86e8915cb59c1a4c664",USDT:"0x9702230A8Ea53601f5cD2dc00fDBc13d4dF4A8c7",USDTe:"0xc7198437980c041c805a1edcba50c1ce5db95118",WAVAX:"0xB31f66AA3C1e785363F0875A1B74E27b85FD66c7",WBTC:"0x50b7545627a5162F82A992c33b87aDc75187B218",WETH:"0x49D5c2BdFfac6CE2BFdB6640F4F80f226bc10bAB"},80001:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x9999f7Fea5938fD3b1E26A12c3f2fb024e194f97"},84531:{ECO:"0x7ea172aa6DFe9bEceef679D4Cf90E600e89b9969","6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0xF175520C52418dfE19C8098071a252da48Cd1C19"},84532:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"},421613:{USDC:"0xfd064A18f3BF249cf1f87FC203E90D8f650f2d63","6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"},421614:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"},11155111:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B",USDC:"0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238"},11155420:{"6TEST":"0x3870419Ba2BBf0127060bCB37f69A1b1C090992B"}};class La extends Qt.EventEmitter{constructor(e){super(),Object.defineProperty(this,"kernelClient",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.kernelClient=e}async request({method:e,params:a=[]}){switch(e){case"eth_requestAccounts":return this.handleEthRequestAccounts();case"eth_accounts":return this.handleEthAccounts();case"eth_sendTransaction":return this.handleEthSendTransaction(a);case"eth_sign":return this.handleEthSign(a);case"personal_sign":return this.handlePersonalSign(a);case"eth_signTypedData":case"eth_signTypedData_v4":return this.handleEthSignTypedDataV4(a);default:return this.kernelClient.transport.request({method:e,params:a})}}async handleEthRequestAccounts(){return this.kernelClient.account?[this.kernelClient.account.address]:[]}async handleEthAccounts(){return this.kernelClient.account?[this.kernelClient.account.address]:[]}async handleEthSendTransaction(e){const[a]=e;return this.kernelClient.sendTransaction({...a,value:a.value?Ut(a.value):void 0})}async handleEthSign(e){var s;if(!((s=this.kernelClient)!=null&&s.account))throw new Error("account not connected!");const[a,n]=e;if(a.toLowerCase()!==this.kernelClient.account.address.toLowerCase())throw new Error("cannot sign for address that is not the current account");return this.kernelClient.signMessage({message:n,account:this.kernelClient.account})}async handlePersonalSign(e){var s;if(!((s=this.kernelClient)!=null&&s.account))throw new Error("account not connected!");const[a,n]=e;if(n.toLowerCase()!==this.kernelClient.account.address.toLowerCase())throw new Error("cannot sign for address that is not the current account");return this.kernelClient.signMessage({message:a,account:this.kernelClient.account})}async handleEthSignTypedDataV4(e){var i;if(!((i=this.kernelClient)!=null&&i.account))throw new Error("account not connected!");const[a,n]=e,s=JSON.parse(n);if(a.toLowerCase()!==this.kernelClient.account.address.toLowerCase())throw new Error("cannot sign for address that is not the current account");return this.kernelClient.signTypedData({account:this.kernelClient.account,domain:s.domain,types:s.types,message:s.message,primaryType:s.primaryType})}}const Ra=t=>{const e=new URL(t),a=e.searchParams;return a.has("bundlerProvider")?a.set("bundlerProvider","PIMLICO"):a.has("paymasterProvider")?a.set("paymasterProvider","PIMLICO"):a.set("provider","PIMLICO"),e.search=a.toString(),e.toString()},_a=(t,e)=>{const n=new URL(t).searchParams;return(n.get("provider")??n.get("bundlerProvider")??n.get("paymasterProvider"))===e},Na=async({plugin:t,entryPoint:e,kernelVersion:a,hook:n,action:s})=>{if(!bt(a,">0.3.0"))throw new Error("Kernel version must be greater than 0.3.0");return{type:zt.VALIDATOR,address:t.address,data:M([(n==null?void 0:n.getIdentifier())??S,me(Ae("bytes validatorData, bytes hookData, bytes selectorData"),[await t.getEnableData(),await(n==null?void 0:n.getEnableData())??"0x",(s==null?void 0:s.selector)??mt(e.version)])])}};export{Va as AccountNotFoundError,Ua as EIP1271Abi,Ea as KERNEL_ADDRESSES,Z as KERNEL_FEATURES,Ka as KERNEL_FEATURES_BY_VERSION,ka as KernelAccountAbi,La as KernelEIP1193Provider,wa as KernelFactoryAbi,st as KernelFactoryStakerAbi,te as KernelV3AccountAbi,lt as KernelV3ExecuteAbi,aa as KernelV3FactoryAbi,it as KernelV3InitAbi,dt as KernelV3_1AccountAbi,Ia as KernelV3_3AccountAbi,Ha as SignTransactionNotSupportedBySmartAccountError,Ma as TokenActionsAbi,ut as accountMetadata,ea as addressToEmptyAccount,Ga as changeSudoValidator,on as constants,va as createFallbackKernelAccountClient,he as createKernelAccount,Aa as createKernelAccountClient,Ba as createKernelAccountV0_2,Ta as createKernelAccountV1,xa as createKernelMigrationAccount,ha as createZeroDevPaymasterClient,za as deepHexlify,xe as eip712WrapHash,ct as encodeCallDataEpV06,ee as encodeCallDataEpV07,yt as encodeDeployCallDataV06,pt as encodeDeployCallDataV07,Xa as fixSignedData,Sa as gasTokenAddresses,mt as getActionSelector,ga as getCustomNonceKeyFromString,Wa as getERC20PaymasterApproveCall,Ya as getEncodedPluginsData,ja as getExecMode,$a as getKernelV3Nonce,qa as getPluginsEnableTypedData,Ja as getUpgradeKernelCall,Qa as getUserOperationGasPrice,Na as getValidatorPluginInstallModuleData,Q as hasKernelFeature,Za as invalidateNonce,en as isPluginInitialized,_a as isProviderSet,tn as kernelAccountClientActions,bt as satisfiesRange,Ra as setPimlicoAsProvider,an as signUserOperation,nn as sponsorUserOperation,we as toSigner,sn as uninstallPlugin,rn as upgradeKernel,at as validateKernelVersionWithEntryPoint,Fa as verifyEIP6492Signature,ft as zerodevPaymasterActions}; diff --git a/public/assets/index-C4xokDO6.js b/public/assets/index-C4xokDO6.js new file mode 100644 index 0000000..67e188e --- /dev/null +++ b/public/assets/index-C4xokDO6.js @@ -0,0 +1,473 @@ +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-C3_GJ6Eb.js","assets/kernelAccountClient-DgEyP8pS.js","assets/constants-DBcQLFY6.js","assets/index-uTQGe5qG.js"])))=>i.map(i=>d[i]); +var rz=Object.defineProperty;var nz=(e,t,r)=>t in e?rz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Ls=(e,t,r)=>nz(e,typeof t!="symbol"?t+"":t,r);function oz(e,t){for(var r=0;rn[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))n(o);new MutationObserver(o=>{for(const i of o)if(i.type==="childList")for(const a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).observe(document,{childList:!0,subtree:!0});function r(o){const i={};return o.integrity&&(i.integrity=o.integrity),o.referrerPolicy&&(i.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?i.credentials="include":o.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(o){if(o.ep)return;o.ep=!0;const i=r(o);fetch(o.href,i)}})();function Ti(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var i$={exports:{}},Vg={},a$={exports:{}},Ye={};/** + * @license React + * react.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 jp=Symbol.for("react.element"),iz=Symbol.for("react.portal"),az=Symbol.for("react.fragment"),sz=Symbol.for("react.strict_mode"),lz=Symbol.for("react.profiler"),cz=Symbol.for("react.provider"),uz=Symbol.for("react.context"),dz=Symbol.for("react.forward_ref"),fz=Symbol.for("react.suspense"),pz=Symbol.for("react.memo"),hz=Symbol.for("react.lazy"),CE=Symbol.iterator;function mz(e){return e===null||typeof e!="object"?null:(e=CE&&e[CE]||e["@@iterator"],typeof e=="function"?e:null)}var s$={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},l$=Object.assign,c$={};function Bu(e,t,r){this.props=e,this.context=t,this.refs=c$,this.updater=r||s$}Bu.prototype.isReactComponent={};Bu.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Bu.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function u$(){}u$.prototype=Bu.prototype;function lS(e,t,r){this.props=e,this.context=t,this.refs=c$,this.updater=r||s$}var cS=lS.prototype=new u$;cS.constructor=lS;l$(cS,Bu.prototype);cS.isPureReactComponent=!0;var EE=Array.isArray,d$=Object.prototype.hasOwnProperty,uS={current:null},f$={key:!0,ref:!0,__self:!0,__source:!0};function p$(e,t,r){var n,o={},i=null,a=null;if(t!=null)for(n in t.ref!==void 0&&(a=t.ref),t.key!==void 0&&(i=""+t.key),t)d$.call(t,n)&&!f$.hasOwnProperty(n)&&(o[n]=t[n]);var s=arguments.length-2;if(s===1)o.children=r;else if(1(\[(\d*)\])*)$/;function rw(e){let t=e.type;if(AE.test(e.type)&&"components"in e){t="(";const r=e.components.length;for(let o=0;o[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function kz(e){return b$.test(e)}function Tz(e){return ya(b$,e)}const w$=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function Iz(e){return w$.test(e)}function Oz(e){return ya(w$,e)}const x$=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function _z(e){return x$.test(e)}function $z(e){return ya(x$,e)}const S$=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function Gg(e){return S$.test(e)}function Rz(e){return ya(S$,e)}const C$=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function jz(e){return C$.test(e)}function Mz(e){return ya(C$,e)}const E$=/^fallback\(\) external(?:\s(?payable{1}))?$/;function Nz(e){return E$.test(e)}function Bz(e){return ya(E$,e)}const Lz=/^receive\(\) external payable$/;function Dz(e){return Lz.test(e)}const kE=new Set(["memory","indexed","storage","calldata"]),zz=new Set(["indexed"]),nw=new Set(["calldata","memory","storage"]);class Fz extends mn{constructor({signature:t}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class Uz extends mn{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" 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 Wz extends mn{constructor({type:t}){super("Unknown type.",{metaMessages:[`Type "${t}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class Hz extends mn{constructor({params:t}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(t,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class Vz extends mn{constructor({param:t}){super("Invalid ABI parameter.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class Gz extends mn{constructor({param:t,name:r}){super("Invalid ABI parameter.",{details:t,metaMessages:[`"${r}" 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 qz extends mn{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class Kz extends mn{constructor({param:t,type:r,modifier:n}){super("Invalid ABI parameter.",{details:t,metaMessages:[`Modifier "${n}" not allowed${r?` in "${r}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${n}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class Zz extends mn{constructor({abiParameter:t}){super("Invalid ABI parameter.",{details:JSON.stringify(t,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class Lu extends mn{constructor({signature:t,type:r}){super(`Invalid ${r} signature.`,{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class Yz extends mn{constructor({signature:t}){super("Unknown signature.",{details:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class Xz extends mn{constructor({signature:t}){super("Invalid struct signature.",{details:t,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class Qz extends mn{constructor({type:t}){super("Circular reference detected.",{metaMessages:[`Struct "${t}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class Jz extends mn{constructor({current:t,depth:r}){super("Unbalanced parentheses.",{metaMessages:[`"${t.trim()}" has too many ${r>0?"opening":"closing"} parentheses.`],details:`Depth "${r}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function eF(e,t,r){let n="";if(r)for(const o of Object.entries(r)){if(!o)continue;let i="";for(const a of o[1])i+=`[${a.type}${a.name?`:${a.name}`:""}]`;n+=`(${o[0]}{${i}})`}return t?`${t}:${e}${n}`:`${e}${n}`}const yb=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}]]);function ow(e,t={}){if(_z(e))return tF(e,t);if(Iz(e))return rF(e,t);if(kz(e))return nF(e,t);if(jz(e))return oF(e,t);if(Nz(e))return iF(e);if(Dz(e))return{type:"receive",stateMutability:"payable"};throw new Yz({signature:e})}function tF(e,t={}){const r=$z(e);if(!r)throw new Lu({signature:e,type:"function"});const n=xn(r.parameters),o=[],i=n.length;for(let s=0;s[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,sF=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,lF=/^u?int$/;function Qi(e,t){var d,f;const r=eF(e,t==null?void 0:t.type,t==null?void 0:t.structs);if(yb.has(r))return yb.get(r);const n=v$.test(e),o=ya(n?sF:aF,e);if(!o)throw new Vz({param:e});if(o.name&&uF(o.name))throw new Gz({param:e,name:o.name});const i=o.name?{name:o.name}:{},a=o.modifier==="indexed"?{indexed:!0}:{},s=(t==null?void 0:t.structs)??{};let l,u={};if(n){l="tuple";const p=xn(o.type),h=[],m=p.length;for(let g=0;g[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function A$(e=[],t={},r=new Set){const n=[],o=e.length;for(let i=0;it(e,i)}function Oo(e,{includeName:t=!1}={}){if(e.type!=="function"&&e.type!=="event"&&e.type!=="error")throw new AF(e.type);return`${e.name}(${Kg(e.inputs,{includeName:t})})`}function Kg(e,{includeName:t=!1}={}){return e?e.map(r=>pF(r,{includeName:t})).join(t?", ":","):""}function pF(e,{includeName:t}){return e.type.startsWith("tuple")?`(${Kg(e.components,{includeName:t})})${e.type.slice(5)}`:e.type+(t&&e.name?` ${e.name}`:"")}function Ei(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}function Gt(e){return Ei(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}const k$="2.45.1";let fd={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${k$}`},le=class iw extends Error{constructor(t,r={}){var s;const n=(()=>{var l;return r.cause instanceof iw?r.cause.details:(l=r.cause)!=null&&l.message?r.cause.message:r.details})(),o=r.cause instanceof iw&&r.cause.docsPath||r.docsPath,i=(s=fd.getDocsUrl)==null?void 0:s.call(fd,{...r,docsPath:o}),a=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...n?[`Details: ${n}`]:[],...fd.version?[`Version: ${fd.version}`]:[]].join(` +`);super(a,r.cause?{cause:r.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:"BaseError"}),this.details=n,this.docsPath=o,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=k$}walk(t){return T$(this,t)}};function T$(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?T$(e.cause,t):t?null:e}class hF extends le{constructor({docsPath:t}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` +`),{docsPath:t,name:"AbiConstructorNotFoundError"})}}class OE extends le{constructor({docsPath:t}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` +`),{docsPath:t,name:"AbiConstructorParamsNotFoundError"})}}class I$ extends le{constructor({data:t,params:r,size:n}){super([`Data size of ${n} bytes is too small for given parameters.`].join(` +`),{metaMessages:[`Params: (${Kg(r,{includeName:!0})})`,`Data: ${t} (${n} bytes)`],name:"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=t,this.params=r,this.size=n}}class Mp extends le{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class mF extends le{constructor({expectedLength:t,givenLength:r,type:n}){super([`ABI encoding array length mismatch for type ${n}.`,`Expected length: ${t}`,`Given length: ${r}`].join(` +`),{name:"AbiEncodingArrayLengthMismatchError"})}}class gF extends le{constructor({expectedSize:t,value:r}){super(`Size of bytes "${r}" (bytes${Gt(r)}) does not match expected size (bytes${t}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class yF extends le{constructor({expectedLength:t,givenLength:r}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${t}`,`Given length (values): ${r}`].join(` +`),{name:"AbiEncodingLengthMismatchError"})}}class vF extends le{constructor(t,{docsPath:r}){super([`Arguments (\`args\`) were provided to "${t}", but "${t}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(` +`),{docsPath:r,name:"AbiErrorInputsNotFoundError"})}}class _E extends le{constructor(t,{docsPath:r}={}){super([`Error ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` +`),{docsPath:r,name:"AbiErrorNotFoundError"})}}class O$ extends le{constructor(t,{docsPath:r}){super([`Encoded error signature "${t}" 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://4byte.sourcify.dev/?q=${t}.`].join(` +`),{docsPath:r,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=t}}class bF extends le{constructor({docsPath:t}){super("Cannot extract event signature from empty topics.",{docsPath:t,name:"AbiEventSignatureEmptyTopicsError"})}}class wF extends le{constructor(t,{docsPath:r}){super([`Encoded event signature "${t}" 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://4byte.sourcify.dev/?q=${t}.`].join(` +`),{docsPath:r,name:"AbiEventSignatureNotFoundError"})}}class $E extends le{constructor(t,{docsPath:r}={}){super([`Event ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` +`),{docsPath:r,name:"AbiEventNotFoundError"})}}class eu extends le{constructor(t,{docsPath:r}={}){super([`Function ${t?`"${t}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` +`),{docsPath:r,name:"AbiFunctionNotFoundError"})}}class _$ extends le{constructor(t,{docsPath:r}){super([`Function "${t}" 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."].join(` +`),{docsPath:r,name:"AbiFunctionOutputsNotFoundError"})}}class xF extends le{constructor(t,{docsPath:r}){super([`Encoded function signature "${t}" 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://4byte.sourcify.dev/?q=${t}.`].join(` +`),{docsPath:r,name:"AbiFunctionSignatureNotFoundError"})}}class SF extends le{constructor(t,r){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${t.type}\` in \`${Oo(t.abiItem)}\`, and`,`\`${r.type}\` in \`${Oo(r.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let CF=class extends le{constructor({expectedSize:t,givenSize:r}){super(`Expected bytes${t}, got bytes${r}.`,{name:"BytesSizeMismatchError"})}};class tm extends le{constructor({abiItem:t,data:r,params:n,size:o}){super([`Data size of ${o} bytes is too small for non-indexed event parameters.`].join(` +`),{metaMessages:[`Params: (${Kg(n,{includeName:!0})})`,`Data: ${r} (${o} bytes)`],name:"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=t,this.data=r,this.params=n,this.size=o}}class pS extends le{constructor({abiItem:t,param:r}){super([`Expected a topic for indexed event parameter${r.name?` "${r.name}"`:""} on event "${Oo(t,{includeName:!0})}".`].join(` +`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=t}}class EF extends le{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r,name:"InvalidAbiEncodingType"})}}class PF extends le{constructor(t,{docsPath:r}){super([`Type "${t}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` +`),{docsPath:r,name:"InvalidAbiDecodingType"})}}let $$=class extends le{constructor(t){super([`Value "${t}" is not a valid array.`].join(` +`),{name:"InvalidArrayError"})}};class AF extends le{constructor(t){super([`"${t}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` +`),{name:"InvalidDefinitionTypeError"})}}class cSe extends le{constructor(t){super(`Type "${t}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}class kF extends le{constructor(t){super(`Filter type "${t}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let R$=class extends le{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset "${t}" is out-of-bounds (size: ${n}).`,{name:"SliceOffsetOutOfBoundsError"})}},j$=class extends le{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}};class RE extends le{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} is expected to be ${r} ${n} long, but is ${t} ${n} long.`,{name:"InvalidBytesLengthError"})}}function Du(e,{dir:t,size:r=32}={}){return typeof e=="string"?Za(e,{dir:t,size:r}):TF(e,{dir:t,size:r})}function Za(e,{dir:t,size:r=32}={}){if(r===null)return e;const n=e.replace("0x","");if(n.length>r*2)throw new j$({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function TF(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new j$({size:e.length,targetSize:r,type:"bytes"});const n=new Uint8Array(r);for(let o=0;ot)throw new _F({givenSize:Gt(e),maxSize:t})}function In(e,t={}){const{signed:r}=t;t.size&&zo(e,{size:t.size});const n=BigInt(e);if(!r)return n;const o=(e.length-2)/2,i=(1n<t.toString(16).padStart(2,"0"));function $o(e,t={}){return typeof e=="number"||typeof e=="bigint"?je(e,t):typeof e=="string"?tu(e,t):typeof e=="boolean"?M$(e,t):ur(e,t)}function M$(e,t={}){const r=`0x${Number(e)}`;return typeof t.size=="number"?(zo(r,{size:t.size}),Du(r,{size:t.size})):r}function ur(e,t={}){let r="";for(let o=0;oi||o=_i.zero&&e<=_i.nine)return e-_i.zero;if(e>=_i.A&&e<=_i.F)return e-(_i.A-10);if(e>=_i.a&&e<=_i.f)return e-(_i.a-10)}function Pi(e,t={}){let r=e;t.size&&(zo(r,{size:t.size}),r=Du(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);const o=n.length/2,i=new Uint8Array(o);for(let a=0,s=0;a>ME&Ih)}:{h:Number(e>>ME&Ih)|0,l:Number(e&Ih)|0}}function DF(e,t=!1){const r=e.length;let n=new Uint32Array(r),o=new Uint32Array(r);for(let i=0;ie<>>32-r,FF=(e,t,r)=>t<>>32-r,UF=(e,t,r)=>t<>>64-r,WF=(e,t,r)=>e<>>64-r,Jl=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function HF(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function yf(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Cl(e,...t){if(!HF(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function VF(e){if(typeof e!="function"||typeof e.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");yf(e.outputLen),yf(e.blockLen)}function ru(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function N$(e,t){Cl(e);const r=t.outputLen;if(e.length>>t}const qF=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function KF(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}function ZF(e){for(let t=0;te:ZF;function YF(e){if(typeof e!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function Zg(e){return typeof e=="string"&&(e=YF(e)),Cl(e),e}function XF(...e){let t=0;for(let n=0;ne().update(Zg(n)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function QF(e=32){if(Jl&&typeof Jl.getRandomValues=="function")return Jl.getRandomValues(new Uint8Array(e));if(Jl&&typeof Jl.randomBytes=="function")return Uint8Array.from(Jl.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}const JF=BigInt(0),pd=BigInt(1),e7=BigInt(2),t7=BigInt(7),r7=BigInt(256),n7=BigInt(113),L$=[],D$=[],z$=[];for(let e=0,t=pd,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],L$.push(2*(5*n+r)),D$.push((e+1)*(e+2)/2%64);let o=JF;for(let i=0;i<7;i++)t=(t<>t7)*n7)%r7,t&e7&&(o^=pd<<(pd<r>32?UF(e,t,r):zF(e,t,r),LE=(e,t,r)=>r>32?WF(e,t,r):FF(e,t,r);function a7(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let a=0;a<10;a++)r[a]=e[a]^e[a+10]^e[a+20]^e[a+30]^e[a+40];for(let a=0;a<10;a+=2){const s=(a+8)%10,l=(a+2)%10,u=r[l],c=r[l+1],d=BE(u,c,1)^r[s],f=LE(u,c,1)^r[s+1];for(let p=0;p<50;p+=10)e[a+p]^=d,e[a+p+1]^=f}let o=e[2],i=e[3];for(let a=0;a<24;a++){const s=D$[a],l=BE(o,i,s),u=LE(o,i,s),c=L$[a];o=e[c],i=e[c+1],e[c]=l,e[c+1]=u}for(let a=0;a<50;a+=10){for(let s=0;s<10;s++)r[s]=e[a+s];for(let s=0;s<10;s++)e[a+s]^=~r[(s+2)%10]&r[(s+4)%10]}e[0]^=o7[n],e[1]^=i7[n]}nu(r)}class gS extends mS{constructor(t,r,n,o=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=t,this.suffix=r,this.outputLen=n,this.enableXOF=o,this.rounds=i,yf(n),!(0=n&&this.keccak();const a=Math.min(n-this.posOut,i-o);t.set(r.subarray(this.posOut,this.posOut+a),o),this.posOut+=a,o+=a}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return yf(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(N$(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,nu(this.state)}_cloneInto(t){const{blockLen:r,suffix:n,outputLen:o,rounds:i,enableXOF:a}=this;return t||(t=new gS(r,n,o,a,i)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=i,t.suffix=n,t.outputLen=o,t.enableXOF=a,t.destroyed=this.destroyed,t}}const s7=(e,t,r)=>B$(()=>new gS(t,e,r)),U$=s7(1,136,256/8);function kr(e,t){const r=t||"hex",n=U$(Ei(e,{strict:!1})?zu(e):e);return r==="bytes"?n:$o(n)}const l7=e=>kr(zu(e));function c7(e){return l7(e)}function u7(e){let t=!0,r="",n=0,o="",i=!1;for(let a=0;a{const t=typeof e=="string"?e:em(e);return u7(t)};function W$(e){return c7(d7(e))}const Yg=W$;let us=class extends le{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},Fu=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}};const bb=new Fu(8192);function Np(e,t){if(bb.has(`${e}.${t}`))return bb.get(`${e}.${t}`);const r=e.substring(2).toLowerCase(),n=kr(pl(r),"bytes"),o=r.split("");for(let a=0;a<40;a+=2)n[a>>1]>>4>=8&&o[a]&&(o[a]=o[a].toUpperCase()),(n[a>>1]&15)>=8&&o[a+1]&&(o[a+1]=o[a+1].toUpperCase());const i=`0x${o.join("")}`;return bb.set(`${e}.${t}`,i),i}function Bp(e,t){if(!io(e,{strict:!1}))throw new us({address:e});return Np(e,t)}const f7=/^0x[a-fA-F0-9]{40}$/,wb=new Fu(8192);function io(e,t){const{strict:r=!0}=t??{},n=`${e}.${r}`;if(wb.has(n))return wb.get(n);const o=f7.test(e)?e.toLowerCase()===e?!0:r?Np(e)===e:!0:!1;return wb.set(n,o),o}function Lr(e){return typeof e[0]=="string"?Uu(e):p7(e)}function p7(e){let t=0;for(const o of e)t+=o.length;const r=new Uint8Array(t);let n=0;for(const o of e)r.set(o,n),n+=o.length;return r}function Uu(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function ou(e,t,r,{strict:n}={}){return Ei(e,{strict:!1})?aw(e,t,r,{strict:n}):G$(e,t,r,{strict:n})}function H$(e,t){if(typeof t=="number"&&t>0&&t>Gt(e)-1)throw new R$({offset:t,position:"start",size:Gt(e)})}function V$(e,t,r){if(typeof t=="number"&&typeof r=="number"&&Gt(e)!==r-t)throw new R$({offset:r,position:"end",size:Gt(e)})}function G$(e,t,r,{strict:n}={}){H$(e,t);const o=e.slice(t,r);return n&&V$(o,t,r),o}function aw(e,t,r,{strict:n}={}){H$(e,t);const o=`0x${e.replace("0x","").slice((t??0)*2,(r??e.length)*2)}`;return n&&V$(o,t,r),o}const ySe=/^(.*)\[([0-9]*)\]$/,h7=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,q$=/^(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 Ss(e,t){if(e.length!==t.length)throw new yF({expectedLength:e.length,givenLength:t.length});const r=m7({params:e,values:t}),n=vS(r);return n.length===0?"0x":n}function m7({params:e,values:t}){const r=[];for(let n=0;n0?Lr([s,a]):s}}if(o)return{dynamic:!0,encoded:a}}return{dynamic:!1,encoded:Lr(i.map(({encoded:a})=>a))}}function v7(e,{param:t}){const[,r]=t.type.split("bytes"),n=Gt(e);if(!r){let o=e;return n%32!==0&&(o=Za(o,{dir:"right",size:Math.ceil((e.length-2)/2/32)*32})),{dynamic:!0,encoded:Lr([Za(je(n,{size:32})),o])}}if(n!==Number.parseInt(r,10))throw new gF({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:Za(e,{dir:"right"})}}function b7(e){if(typeof e!="boolean")throw new le(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Za(M$(e))}}function w7(e,{signed:t,size:r=256}){if(typeof r=="number"){const n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||eo))}}function bS(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}const Lp=e=>ou(W$(e),0,4);function Wl(e){const{abi:t,args:r=[],name:n}=e,o=Ei(n,{strict:!1}),i=t.filter(s=>o?s.type==="function"?Lp(s)===n:s.type==="event"?Yg(s)===n:!1:"name"in s&&s.name===n);if(i.length===0)return;if(i.length===1)return i[0];let a;for(const s of i){if(!("inputs"in s))continue;if(!r||r.length===0){if(!s.inputs||s.inputs.length===0)return s;continue}if(!s.inputs||s.inputs.length===0||s.inputs.length!==r.length)continue;if(r.every((u,c)=>{const d="inputs"in s&&s.inputs[c];return d?sw(u,d):!1})){if(a&&"inputs"in a&&a.inputs){const u=K$(s.inputs,a.inputs,r);if(u)throw new SF({abiItem:s,type:u[0]},{abiItem:a,type:u[1]})}a=s}}return a||i[0]}function sw(e,t){const r=typeof e,n=t.type;switch(n){case"address":return io(e,{strict:!1});case"bool":return r==="boolean";case"function":return r==="string";case"string":return r==="string";default:return n==="tuple"&&"components"in t?Object.values(t.components).every((o,i)=>r==="object"&&sw(Object.values(e)[i],o)):/^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(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(o=>sw(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function K$(e,t,r){for(const n in e){const o=e[n],i=t[n];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return K$(o.components,i.components,r[n]);const a=[o.type,i.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?io(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?io(r[n],{strict:!1}):!1)return a}}const DE="/docs/contract/encodeEventTopics";function Dp(e){var l;const{abi:t,eventName:r,args:n}=e;let o=t[0];if(r){const u=Wl({abi:t,name:r});if(!u)throw new $E(r,{docsPath:DE});o=u}if(o.type!=="event")throw new $E(void 0,{docsPath:DE});const i=Oo(o),a=Yg(i);let s=[];if(n&&"inputs"in o){const u=(l=o.inputs)==null?void 0:l.filter(d=>"indexed"in d&&d.indexed),c=Array.isArray(n)?n:Object.values(n).length>0?(u==null?void 0:u.map(d=>n[d.name]))??[]:[];c.length>0&&(s=(u==null?void 0:u.map((d,f)=>Array.isArray(c[f])?c[f].map((p,h)=>zE({param:d,value:c[f][h]})):typeof c[f]<"u"&&c[f]!==null?zE({param:d,value:c[f]}):null))??[])}return[a,...s]}function zE({param:e,value:t}){if(e.type==="string"||e.type==="bytes")return kr(zu(t));if(e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/))throw new kF(e.type);return Ss([e],[t])}function Xg(e,{method:t}){var n,o;const r={};return e.transport.type==="fallback"&&((o=(n=e.transport).onResponse)==null||o.call(n,({method:i,response:a,status:s,transport:l})=>{s==="success"&&t===i&&(r[a]=l.request)})),i=>r[i]||e.request}async function Z$(e,t){const{address:r,abi:n,args:o,eventName:i,fromBlock:a,strict:s,toBlock:l}=t,u=Xg(e,{method:"eth_newFilter"}),c=i?Dp({abi:n,args:o,eventName:i}):void 0,d=await e.request({method:"eth_newFilter",params:[{address:r,fromBlock:typeof a=="bigint"?je(a):a,toBlock:typeof l=="bigint"?je(l):l,topics:c}]});return{abi:n,args:o,eventName:i,id:d,request:u(d),strict:!!s,type:"event"}}function Rt(e){return typeof e=="string"?{address:e,type:"json-rpc"}:e}const FE="/docs/contract/encodeFunctionData";function C7(e){const{abi:t,args:r,functionName:n}=e;let o=t[0];if(n){const i=Wl({abi:t,args:r,name:n});if(!i)throw new eu(n,{docsPath:FE});o=i}if(o.type!=="function")throw new eu(void 0,{docsPath:FE});return{abi:[o],functionName:Lp(Oo(o))}}function gn(e){const{args:t}=e,{abi:r,functionName:n}=(()=>{var s;return e.abi.length===1&&((s=e.functionName)!=null&&s.startsWith("0x"))?e:C7(e)})(),o=r[0],i=n,a="inputs"in o&&o.inputs?Ss(o.inputs,t??[]):void 0;return Uu([i,a??"0x"])}const E7={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."},Y$={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},P7={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let UE=class extends le{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`,{name:"NegativeOffsetError"})}},X$=class extends le{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`,{name:"PositionOutOfBoundsError"})}},A7=class extends le{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`,{name:"RecursiveReadLimitExceededError"})}};const k7={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 A7({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new X$({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new UE({offset:e});const 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 UE({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const 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,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function wS(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(k7);return r.bytes=e,r.dataView=new DataView(e.buffer??e,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}function T7(e,t={}){typeof t.size<"u"&&zo(e,{size:t.size});const r=ur(e,t);return In(r,t)}function I7(e,t={}){let r=e;if(typeof t.size<"u"&&(zo(r,{size:t.size}),r=Ya(r)),r.length>1||r[0]>1)throw new IF(r);return!!r[0]}function Ki(e,t={}){typeof t.size<"u"&&zo(e,{size:t.size});const r=ur(e,t);return _o(r,t)}function O7(e,t={}){let r=e;return typeof t.size<"u"&&(zo(r,{size:t.size}),r=Ya(r,{dir:"right"})),new TextDecoder().decode(r)}function zp(e,t){const r=typeof t=="string"?Pi(t):t,n=wS(r);if(Gt(r)===0&&e.length>0)throw new Mp;if(Gt(t)&&Gt(t)<32)throw new I$({data:typeof t=="string"?t:ur(t),params:e,size:Gt(t)});let o=0;const i=[];for(let a=0;a48?T7(o,{signed:r}):Ki(o,{signed:r}),32]}function N7(e,t,{staticPosition:r}){const n=t.components.length===0||t.components.some(({name:a})=>!a),o=n?[]:{};let i=0;if(vf(t)){const a=Ki(e.readBytes(lw)),s=r+a;for(let l=0;la.type==="error"&&n===Lp(Oo(a)));if(!i)throw new O$(n,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:i,args:"inputs"in i&&i.inputs&&i.inputs.length>0?zp(i.inputs,ou(r,4)):void 0,errorName:i.name}}const cr=(e,t,r)=>JSON.stringify(e,(n,o)=>typeof o=="bigint"?o.toString():o,r);function Q$({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((o,i)=>`${n&&o.name?`${o.name}: `:""}${typeof t[i]=="object"?cr(t[i]):t[i]}`).join(", ")})`}const D7={gwei:9,wei:18},z7={ether:-9,wei:9};function J$(e,t){let r=e.toString();const n=r.startsWith("-");n&&(r=r.slice(1)),r=r.padStart(t,"0");let[o,i]=[r.slice(0,r.length-t),r.slice(r.length-t)];return i=i.replace(/(0+)$/,""),`${n?"-":""}${o||"0"}${i?`.${i}`:""}`}function Qg(e,t="wei"){return J$(e,D7[t])}function an(e,t="wei"){return J$(e,z7[t])}class F7 extends le{constructor({address:t}){super(`State for account "${t}" is set multiple times.`,{name:"AccountStateConflictError"})}}class U7 extends le{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function HE(e){return e.reduce((t,{slot:r,value:n})=>`${t} ${r}: ${n} +`,"")}function W7(e){return e.reduce((t,{address:r,...n})=>{let o=`${t} ${r}: +`;return n.nonce&&(o+=` nonce: ${n.nonce} +`),n.balance&&(o+=` balance: ${n.balance} +`),n.code&&(o+=` code: ${n.code} +`),n.state&&(o+=` state: +`,o+=HE(n.state)),n.stateDiff&&(o+=` stateDiff: +`,o+=HE(n.stateDiff)),o},` State Override: +`).slice(0,-1)}function Fp(e){const t=Object.entries(e).map(([n,o])=>o===void 0||o===!1?null:[n,o]).filter(Boolean),r=t.reduce((n,[o])=>Math.max(n,o.length),0);return t.map(([n,o])=>` ${`${n}:`.padEnd(r+1)} ${o}`).join(` +`)}class H7 extends le{constructor({transaction:t}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",Fp(t),"}","","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","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class V7 extends le{constructor(t,{account:r,docsPath:n,chain:o,data:i,gas:a,gasPrice:s,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:c,to:d,value:f}){var h;const p=Fp({chain:o&&`${o==null?void 0:o.name} (id: ${o==null?void 0:o.id})`,from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${Qg(f)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:i,gas:a,gasPrice:typeof s<"u"&&`${an(s)} gwei`,maxFeePerGas:typeof l<"u"&&`${an(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${an(u)} gwei`,nonce:c});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",p].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class e8 extends le{constructor({blockHash:t,blockNumber:r,blockTag:n,hash:o,index:i}){let a="Transaction";n&&i!==void 0&&(a=`Transaction at block time "${n}" at index "${i}"`),t&&i!==void 0&&(a=`Transaction at block hash "${t}" at index "${i}"`),r&&i!==void 0&&(a=`Transaction at block number "${r}" at index "${i}"`),o&&(a=`Transaction with hash "${o}"`),super(`${a} could not be found.`,{name:"TransactionNotFoundError"})}}class t8 extends le{constructor({hash:t}){super(`Transaction receipt with hash "${t}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class r8 extends le{constructor({receipt:t}){super(`Transaction with hash "${t.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=t}}class G7 extends le{constructor({hash:t}){super(`Timed out while waiting for transaction with hash "${t}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const q7=e=>e,xS=e=>e;class n8 extends le{constructor(t,{account:r,docsPath:n,chain:o,data:i,gas:a,gasPrice:s,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:c,to:d,value:f,stateOverride:p}){var g;const h=r?Rt(r):void 0;let m=Fp({from:h==null?void 0:h.address,to:d,value:typeof f<"u"&&`${Qg(f)} ${((g=o==null?void 0:o.nativeCurrency)==null?void 0:g.symbol)||"ETH"}`,data:i,gas:a,gasPrice:typeof s<"u"&&`${an(s)} gwei`,maxFeePerGas:typeof l<"u"&&`${an(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${an(u)} gwei`,nonce:c});p&&(m+=` +${W7(p)}`),super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Raw Call Arguments:",m].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class o8 extends le{constructor(t,{abi:r,args:n,contractAddress:o,docsPath:i,functionName:a,sender:s}){const l=Wl({abi:r,args:n,name:a}),u=l?Q$({abiItem:l,args:n,includeFunctionName:!1,includeName:!1}):void 0,c=l?Oo(l,{includeName:!0}):void 0,d=Fp({address:o&&q7(o),function:c,args:u&&u!=="()"&&`${[...Array((a==null?void 0:a.length)??0).keys()].map(()=>" ").join("")}${u}`,sender:s});super(t.shortMessage||`An unknown error occurred while executing the contract function "${a}".`,{cause:t,docsPath:i,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],d&&"Contract Call:",d].filter(Boolean),name:"ContractFunctionExecutionError"}),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}),this.abi=r,this.args=n,this.cause=t,this.contractAddress=o,this.functionName=a,this.sender=s}}class cw extends le{constructor({abi:t,data:r,functionName:n,message:o}){let i,a,s,l;if(r&&r!=="0x")try{a=L7({abi:t,data:r});const{abiItem:c,errorName:d,args:f}=a;if(d==="Error")l=f[0];else if(d==="Panic"){const[p]=f;l=E7[p]}else{const p=c?Oo(c,{includeName:!0}):void 0,h=c&&f?Q$({abiItem:c,args:f,includeFunctionName:!1,includeName:!1}):void 0;s=[p?`Error: ${p}`:"",h&&h!=="()"?` ${[...Array((d==null?void 0:d.length)??0).keys()].map(()=>" ").join("")}${h}`:""]}}catch(c){i=c}else o&&(l=o);let u;i instanceof O$&&(u=i.signature,s=[`Unable to decode signature "${u}" 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://4byte.sourcify.dev/?q=${u}.`]),super(l&&l!=="execution reverted"||u?[`The contract function "${n}" reverted with the following ${u?"signature":"reason"}:`,l||u].join(` +`):`The contract function "${n}" reverted.`,{cause:i,metaMessages:s,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{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=a,this.raw=r,this.reason=l,this.signature=u}}class K7 extends le{constructor({functionName:t}){super(`The contract function "${t}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${t}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class Z7 extends le{constructor({factory:t}){super(`Deployment for counterfactual contract call failed${t?` for factory "${t}".`:""}`,{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."],name:"CounterfactualDeploymentFailedError"})}}class Jg extends le{constructor({data:t,message:r}){super(r||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=t}}class Jd extends le{constructor({body:t,cause:r,details:n,headers:o,status:i,url:a}){super("HTTP request failed.",{cause:r,details:n,metaMessages:[i&&`Status: ${i}`,`URL: ${xS(a)}`,t&&`Request body: ${cr(t)}`].filter(Boolean),name:"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=t,this.headers=o,this.status=i,this.url=a}}class SS extends le{constructor({body:t,error:r,url:n}){super("RPC Request failed.",{cause:r,details:r.message,metaMessages:[`URL: ${xS(n)}`,`Request body: ${cr(t)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{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,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=r.code,this.data=r.data,this.url=n}}class VE extends le{constructor({body:t,url:r}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${xS(r)}`,`Request body: ${cr(t)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=r}}const Y7=-1;class yn extends le{constructor(t,{code:r,docsPath:n,metaMessages:o,name:i,shortMessage:a}){super(a,{cause:t,docsPath:n,metaMessages:o||(t==null?void 0:t.metaMessages),name:i||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=i||t.name,this.code=t instanceof SS?t.code:r??Y7}}class Nn extends yn{constructor(t,r){super(t,r),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=r.data}}class bf extends yn{constructor(t){super(t,{code:bf.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(bf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class wf extends yn{constructor(t){super(t,{code:wf.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(wf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class xf extends yn{constructor(t,{method:r}={}){super(t,{code:xf.code,name:"MethodNotFoundRpcError",shortMessage:`The method${r?` "${r}"`:""} does not exist / is not available.`})}}Object.defineProperty(xf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class Sf extends yn{constructor(t){super(t,{code:Sf.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(Sf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class El extends yn{constructor(t){super(t,{code:El.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(El,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class ds extends yn{constructor(t){super(t,{code:ds.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` +`)})}}Object.defineProperty(ds,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class Cf extends yn{constructor(t){super(t,{code:Cf.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(Cf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class Ef extends yn{constructor(t){super(t,{code:Ef.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(Ef,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class Pf extends yn{constructor(t){super(t,{code:Pf.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(Pf,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class Js extends yn{constructor(t,{method:r}={}){super(t,{code:Js.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${r?` "${r}"`:""} is not supported.`})}}Object.defineProperty(Js,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class iu extends yn{constructor(t){super(t,{code:iu.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(iu,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class Af extends yn{constructor(t){super(t,{code:Af.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(Af,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class Bc extends Nn{constructor(t){super(t,{code:Bc.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(Bc,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class kf extends Nn{constructor(t){super(t,{code:kf.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(kf,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class Tf extends Nn{constructor(t,{method:r}={}){super(t,{code:Tf.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${r?` " ${r}"`:""}.`})}}Object.defineProperty(Tf,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class If extends Nn{constructor(t){super(t,{code:If.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(If,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class Of extends Nn{constructor(t){super(t,{code:Of.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(Of,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class _f extends Nn{constructor(t){super(t,{code:_f.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(_f,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class au extends Nn{constructor(t){super(t,{code:au.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(au,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class $f extends Nn{constructor(t){super(t,{code:$f.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty($f,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class Rf extends Nn{constructor(t){super(t,{code:Rf.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(Rf,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class jf extends Nn{constructor(t){super(t,{code:jf.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(jf,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class Mf extends Nn{constructor(t){super(t,{code:Mf.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(Mf,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class Nf extends Nn{constructor(t){super(t,{code:Nf.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(Nf,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class su extends Nn{constructor(t){super(t,{code:su.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(su,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class X7 extends yn{constructor(t){super(t,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const Q7=3;function Pl(e,{abi:t,address:r,args:n,docsPath:o,functionName:i,sender:a}){const s=e instanceof Jg?e:e instanceof le?e.walk(h=>"data"in h)||e.walk():{},{code:l,data:u,details:c,message:d,shortMessage:f}=s,p=e instanceof Mp?new K7({functionName:i}):[Q7,El.code].includes(l)&&(u||c||d||f)||l===ds.code&&c==="execution reverted"&&u?new cw({abi:t,data:typeof u=="object"?u.data:u,functionName:i,message:s instanceof SS?c:f??d}):e;return new o8(p,{abi:t,args:n,contractAddress:r,docsPath:o,functionName:i,sender:a})}function J7(e){const t=kr(`0x${e.substring(4)}`).substring(26);return Np(`0x${t}`)}const eU="modulepreload",tU=function(e){return"/"+e},GE={},ja=function(t,r,n){let o=Promise.resolve();if(r&&r.length>0){document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),s=(a==null?void 0:a.nonce)||(a==null?void 0:a.getAttribute("nonce"));o=Promise.allSettled(r.map(l=>{if(l=tU(l),l in GE)return;GE[l]=!0;const u=l.endsWith(".css"),c=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${c}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":eU,u||(d.as="script"),d.crossOrigin="",d.href=l,s&&d.setAttribute("nonce",s),document.head.appendChild(d),u)return new Promise((f,p)=>{d.addEventListener("load",f),d.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(a){const s=new Event("vite:preloadError",{cancelable:!0});if(s.payload=a,window.dispatchEvent(s),!s.defaultPrevented)throw a}return o.then(a=>{for(const s of a||[])s.status==="rejected"&&i(s.reason);return t().catch(i)})};async function rU({hash:e,signature:t}){const r=Ei(e)?e:$o(e),{secp256k1:n}=await ja(async()=>{const{secp256k1:a}=await Promise.resolve().then(()=>fG);return{secp256k1:a}},void 0);return`0x${(()=>{if(typeof t=="object"&&"r"in t&&"s"in t){const{r:u,s:c,v:d,yParity:f}=t,p=Number(f??d),h=qE(p);return new n.Signature(In(u),In(c)).addRecoveryBit(h)}const a=Ei(t)?t:$o(t);if(Gt(a)!==65)throw new Error("invalid signature length");const s=_o(`0x${a.slice(130)}`),l=qE(s);return n.Signature.fromCompact(a.substring(2,130)).addRecoveryBit(l)})().recoverPublicKey(r.substring(2)).toHex(!1)}`}function qE(e){if(e===0||e===1)return e;if(e===27)return 0;if(e===28)return 1;throw new Error("Invalid yParityOrV value")}async function CS({hash:e,signature:t}){return J7(await rU({hash:e,signature:t}))}function nU(e,t="hex"){const r=i8(e),n=wS(new Uint8Array(r.length));return r.encode(n),t==="hex"?ur(n.bytes):n.bytes}function i8(e){return Array.isArray(e)?oU(e.map(t=>i8(t))):iU(e)}function oU(e){const t=e.reduce((o,i)=>o+i.length,0),r=a8(t);return{length:t<=55?1+t:1+r+t,encode(o){t<=55?o.pushByte(192+t):(o.pushByte(247+r),r===1?o.pushUint8(t):r===2?o.pushUint16(t):r===3?o.pushUint24(t):o.pushUint32(t));for(const{encode:i}of e)i(o)}}}function iU(e){const t=typeof e=="string"?Pi(e):e,r=a8(t.length);return{length:t.length===1&&t[0]<128?1:t.length<=55?1+t.length:1+r+t.length,encode(o){t.length===1&&t[0]<128?o.pushBytes(t):t.length<=55?(o.pushByte(128+t.length),o.pushBytes(t)):(o.pushByte(183+r),r===1?o.pushUint8(t.length):r===2?o.pushUint16(t.length):r===3?o.pushUint24(t.length):o.pushUint32(t.length),o.pushBytes(t))}}}function a8(e){if(e<2**8)return 1;if(e<2**16)return 2;if(e<2**24)return 3;if(e<2**32)return 4;throw new le("Length is too large.")}function aU(e){const{chainId:t,nonce:r,to:n}=e,o=e.contractAddress??e.address,i=kr(Uu(["0x05",nU([t?je(t):"0x",o,r?je(r):"0x"])]));return n==="bytes"?Pi(i):i}async function ey(e){const{authorization:t,signature:r}=e;return CS({hash:aU(t),signature:r??t})}class sU extends le{constructor(t,{account:r,docsPath:n,chain:o,data:i,gas:a,gasPrice:s,maxFeePerGas:l,maxPriorityFeePerGas:u,nonce:c,to:d,value:f}){var h;const p=Fp({from:r==null?void 0:r.address,to:d,value:typeof f<"u"&&`${Qg(f)} ${((h=o==null?void 0:o.nativeCurrency)==null?void 0:h.symbol)||"ETH"}`,data:i,gas:a,gasPrice:typeof s<"u"&&`${an(s)} gwei`,maxFeePerGas:typeof l<"u"&&`${an(l)} gwei`,maxPriorityFeePerGas:typeof u<"u"&&`${an(u)} gwei`,nonce:c});super(t.shortMessage,{cause:t,docsPath:n,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Estimate Gas Arguments:",p].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class gc extends le{constructor({cause:t,message:r}={}){var o;const n=(o=r==null?void 0:r.replace("execution reverted: ",""))==null?void 0:o.replace("execution reverted","");super(`Execution reverted ${n?`with reason: ${n}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"})}}Object.defineProperty(gc,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(gc,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class rm extends le{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${an(r)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:t,name:"FeeCapTooHighError"})}}Object.defineProperty(rm,"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 uw extends le{constructor({cause:t,maxFeePerGas:r}={}){super(`The fee cap (\`maxFeePerGas\`${r?` = ${an(r)}`:""} gwei) cannot be lower than the block base fee.`,{cause:t,name:"FeeCapTooLowError"})}}Object.defineProperty(uw,"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 dw extends le{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}is higher than the next one expected.`,{cause:t,name:"NonceTooHighError"})}}Object.defineProperty(dw,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class fw extends le{constructor({cause:t,nonce:r}={}){super([`Nonce provided for the transaction ${r?`(${r}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` +`),{cause:t,name:"NonceTooLowError"})}}Object.defineProperty(fw,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class pw extends le{constructor({cause:t,nonce:r}={}){super(`Nonce provided for the transaction ${r?`(${r}) `:""}exceeds the maximum allowed nonce.`,{cause:t,name:"NonceMaxValueError"})}}Object.defineProperty(pw,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class hw extends le{constructor({cause:t}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` +`),{cause:t,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."],name:"InsufficientFundsError"})}}Object.defineProperty(hw,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class mw extends le{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:t,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(mw,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class gw extends le{constructor({cause:t,gas:r}={}){super(`The amount of gas ${r?`(${r}) `:""}provided for the transaction is too low.`,{cause:t,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(gw,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class yw extends le{constructor({cause:t}){super("The transaction type is not supported for this chain.",{cause:t,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(yw,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class nm extends le{constructor({cause:t,maxPriorityFeePerGas:r,maxFeePerGas:n}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${r?` = ${an(r)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${n?` = ${an(n)} gwei`:""}).`].join(` +`),{cause:t,name:"TipAboveFeeCapError"})}}Object.defineProperty(nm,"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 Up extends le{constructor({cause:t}){super(`An error occurred while executing: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownNodeError"})}}function ty(e,t){const r=(e.details||"").toLowerCase(),n=e instanceof le?e.walk(o=>(o==null?void 0:o.code)===gc.code):e;return n instanceof le?new gc({cause:e,message:n.details}):gc.nodeMessage.test(r)?new gc({cause:e,message:e.details}):rm.nodeMessage.test(r)?new rm({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):uw.nodeMessage.test(r)?new uw({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas}):dw.nodeMessage.test(r)?new dw({cause:e,nonce:t==null?void 0:t.nonce}):fw.nodeMessage.test(r)?new fw({cause:e,nonce:t==null?void 0:t.nonce}):pw.nodeMessage.test(r)?new pw({cause:e,nonce:t==null?void 0:t.nonce}):hw.nodeMessage.test(r)?new hw({cause:e}):mw.nodeMessage.test(r)?new mw({cause:e,gas:t==null?void 0:t.gas}):gw.nodeMessage.test(r)?new gw({cause:e,gas:t==null?void 0:t.gas}):yw.nodeMessage.test(r)?new yw({cause:e}):nm.nodeMessage.test(r)?new nm({cause:e,maxFeePerGas:t==null?void 0:t.maxFeePerGas,maxPriorityFeePerGas:t==null?void 0:t.maxPriorityFeePerGas}):new Up({cause:e})}function lU(e,{docsPath:t,...r}){const n=(()=>{const o=ty(e,r);return o instanceof Up?e:o})();return new sU(n,{docsPath:t,...r})}function Wu(e,{format:t}){if(!t)return{};const r={};function n(i){const a=Object.keys(i);for(const s of a)s in e&&(r[s]=e[s]),i[s]&&typeof i[s]=="object"&&!Array.isArray(i[s])&&n(i[s])}const o=t(e||{});return n(o),r}const cU={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function Cs(e,t){const r={};return typeof e.authorizationList<"u"&&(r.authorizationList=uU(e.authorizationList)),typeof e.accessList<"u"&&(r.accessList=e.accessList),typeof e.blobVersionedHashes<"u"&&(r.blobVersionedHashes=e.blobVersionedHashes),typeof e.blobs<"u"&&(typeof e.blobs[0]!="string"?r.blobs=e.blobs.map(n=>ur(n)):r.blobs=e.blobs),typeof e.data<"u"&&(r.data=e.data),e.account&&(r.from=e.account.address),typeof e.from<"u"&&(r.from=e.from),typeof e.gas<"u"&&(r.gas=je(e.gas)),typeof e.gasPrice<"u"&&(r.gasPrice=je(e.gasPrice)),typeof e.maxFeePerBlobGas<"u"&&(r.maxFeePerBlobGas=je(e.maxFeePerBlobGas)),typeof e.maxFeePerGas<"u"&&(r.maxFeePerGas=je(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(r.maxPriorityFeePerGas=je(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(r.nonce=je(e.nonce)),typeof e.to<"u"&&(r.to=e.to),typeof e.type<"u"&&(r.type=cU[e.type]),typeof e.value<"u"&&(r.value=je(e.value)),r}function uU(e){return e.map(t=>({address:t.address,r:t.r?je(BigInt(t.r)):t.r,s:t.s?je(BigInt(t.s)):t.s,chainId:je(t.chainId),nonce:je(t.nonce),...typeof t.yParity<"u"?{yParity:je(t.yParity)}:{},...typeof t.v<"u"&&typeof t.yParity>"u"?{v:je(t.v)}:{}}))}function KE(e){if(!(!e||e.length===0))return e.reduce((t,{slot:r,value:n})=>{if(r.length!==66)throw new RE({size:r.length,targetSize:66,type:"hex"});if(n.length!==66)throw new RE({size:n.length,targetSize:66,type:"hex"});return t[r]=n,t},{})}function dU(e){const{balance:t,nonce:r,state:n,stateDiff:o,code:i}=e,a={};if(i!==void 0&&(a.code=i),t!==void 0&&(a.balance=je(t)),r!==void 0&&(a.nonce=je(r)),n!==void 0&&(a.state=KE(n)),o!==void 0){if(a.state)throw new U7;a.stateDiff=KE(o)}return a}function ES(e){if(!e)return;const t={};for(const{address:r,...n}of e){if(!io(r,{strict:!1}))throw new us({address:r});if(t[r])throw new F7({address:r});t[r]=dU(n)}return t}const xSe=2n**16n-1n,SSe=2n**192n-1n,fU=2n**256n-1n;function va(e){const{account:t,maxFeePerGas:r,maxPriorityFeePerGas:n,to:o}=e,i=t?Rt(t):void 0;if(i&&!io(i.address))throw new us({address:i.address});if(o&&!io(o))throw new us({address:o});if(r&&r>fU)throw new rm({maxFeePerGas:r});if(n&&r&&n>r)throw new nm({maxFeePerGas:r,maxPriorityFeePerGas:n})}class s8 extends le{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class PS extends le{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class pU extends le{constructor({maxPriorityFeePerGas:t}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${an(t)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class l8 extends le{constructor({blockHash:t,blockNumber:r}){let n="Block";t&&(n=`Block at hash "${t}"`),r&&(n=`Block at number "${r}"`),super(`${n} could not be found.`,{name:"BlockNotFoundError"})}}const c8={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function AS(e,t){const r={...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,chainId:e.chainId?_o(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?_o(e.nonce):void 0,to:e.to?e.to:null,transactionIndex:e.transactionIndex?Number(e.transactionIndex):null,type:e.type?c8[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 e.authorizationList&&(r.authorizationList=hU(e.authorizationList)),r.yParity=(()=>{if(e.yParity)return Number(e.yParity);if(typeof r.v=="bigint"){if(r.v===0n||r.v===27n)return 0;if(r.v===1n||r.v===28n)return 1;if(r.v>=35n)return r.v%2n===0n?1:0}})(),r.type==="legacy"&&(delete r.accessList,delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas,delete r.yParity),r.type==="eip2930"&&(delete r.maxFeePerBlobGas,delete r.maxFeePerGas,delete r.maxPriorityFeePerGas),r.type==="eip1559"&&delete r.maxFeePerBlobGas,r}function hU(e){return e.map(t=>({address:t.address,chainId:Number(t.chainId),nonce:Number(t.nonce),r:t.r,s:t.s,yParity:Number(t.yParity)}))}function u8(e,t){const r=(e.transactions??[]).map(n=>typeof n=="string"?n:AS(n));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:r,totalDifficulty:e.totalDifficulty?BigInt(e.totalDifficulty):null}}async function Ao(e,{blockHash:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest",includeTransactions:o}={}){var u,c,d;const i=o??!1,a=r!==void 0?je(r):void 0;let s=null;if(t?s=await e.request({method:"eth_getBlockByHash",params:[t,i]},{dedupe:!0}):s=await e.request({method:"eth_getBlockByNumber",params:[a||n,i]},{dedupe:!!a}),!s)throw new l8({blockHash:t,blockNumber:r});return(((d=(c=(u=e.chain)==null?void 0:u.formatters)==null?void 0:c.block)==null?void 0:d.format)||u8)(s,"getBlock")}async function kS(e){const t=await e.request({method:"eth_gasPrice"});return BigInt(t)}async function mU(e,t){return d8(e,t)}async function d8(e,t){var i,a;const{block:r,chain:n=e.chain,request:o}=t||{};try{const s=((i=n==null?void 0:n.fees)==null?void 0:i.maxPriorityFeePerGas)??((a=n==null?void 0:n.fees)==null?void 0:a.defaultPriorityFee);if(typeof s=="function"){const u=r||await Se(e,Ao,"getBlock")({}),c=await s({block:u,client:e,request:o});if(c===null)throw new Error;return c}if(typeof s<"u")return s;const l=await e.request({method:"eth_maxPriorityFeePerGas"});return In(l)}catch{const[s,l]=await Promise.all([r?Promise.resolve(r):Se(e,Ao,"getBlock")({}),Se(e,kS,"getGasPrice")({})]);if(typeof s.baseFeePerGas!="bigint")throw new PS;const u=l-s.baseFeePerGas;return u<0n?0n:u}}async function gU(e,t){return vw(e,t)}async function vw(e,t){var f,p;const{block:r,chain:n=e.chain,request:o,type:i="eip1559"}=t||{},a=await(async()=>{var h,m;return typeof((h=n==null?void 0:n.fees)==null?void 0:h.baseFeeMultiplier)=="function"?n.fees.baseFeeMultiplier({block:r,client:e,request:o}):((m=n==null?void 0:n.fees)==null?void 0:m.baseFeeMultiplier)??1.2})();if(a<1)throw new s8;const l=10**(((f=a.toString().split(".")[1])==null?void 0:f.length)??0),u=h=>h*BigInt(Math.ceil(a*l))/BigInt(l),c=r||await Se(e,Ao,"getBlock")({});if(typeof((p=n==null?void 0:n.fees)==null?void 0:p.estimateFeesPerGas)=="function"){const h=await n.fees.estimateFeesPerGas({block:r,client:e,multiply:u,request:o,type:i});if(h!==null)return h}if(i==="eip1559"){if(typeof c.baseFeePerGas!="bigint")throw new PS;const h=typeof(o==null?void 0:o.maxPriorityFeePerGas)=="bigint"?o.maxPriorityFeePerGas:await d8(e,{block:c,chain:n,request:o}),m=u(c.baseFeePerGas);return{maxFeePerGas:(o==null?void 0:o.maxFeePerGas)??m+h,maxPriorityFeePerGas:h}}return{gasPrice:(o==null?void 0:o.gasPrice)??u(await Se(e,kS,"getGasPrice")({}))}}async function TS(e,{address:t,blockTag:r="latest",blockNumber:n}){const o=await e.request({method:"eth_getTransactionCount",params:[t,typeof n=="bigint"?je(n):r]},{dedupe:!!n});return _o(o)}function f8(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(i=>Pi(i)):e.blobs,o=[];for(const i of n)o.push(Uint8Array.from(t.blobToKzgCommitment(i)));return r==="bytes"?o:o.map(i=>ur(i))}function p8(e){const{kzg:t}=e,r=e.to??(typeof e.blobs[0]=="string"?"hex":"bytes"),n=typeof e.blobs[0]=="string"?e.blobs.map(a=>Pi(a)):e.blobs,o=typeof e.commitments[0]=="string"?e.commitments.map(a=>Pi(a)):e.commitments,i=[];for(let a=0;aur(a))}function yU(e,t,r,n){if(typeof e.setBigUint64=="function")return e.setBigUint64(t,r,n);const o=BigInt(32),i=BigInt(4294967295),a=Number(r>>o&i),s=Number(r&i),l=n?4:0,u=n?0:4;e.setUint32(t+l,a,n),e.setUint32(t+u,s,n)}function vU(e,t,r){return e&t^~e&r}function bU(e,t,r){return e&t^e&r^t&r}class wU extends mS{constructor(t,r,n,o){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=t,this.outputLen=r,this.padOffset=n,this.isLE=o,this.buffer=new Uint8Array(t),this.view=vb(this.buffer)}update(t){ru(this),t=Zg(t),Cl(t);const{view:r,buffer:n,blockLen:o}=this,i=t.length;for(let a=0;ao-a&&(this.process(n,0),a=0);for(let d=a;dc.length)throw new Error("_sha2: outputLen bigger than state");for(let d=0;d>>3,m=Go(p,17)^Go(p,19)^p>>>10;Ia[d]=m+Ia[d-7]+h+Ia[d-16]|0}let{A:n,B:o,C:i,D:a,E:s,F:l,G:u,H:c}=this;for(let d=0;d<64;d++){const f=Go(s,6)^Go(s,11)^Go(s,25),p=c+f+vU(s,l,u)+xU[d]+Ia[d]|0,m=(Go(n,2)^Go(n,13)^Go(n,22))+bU(n,o,i)|0;c=u,u=l,l=s,s=a+p|0,a=i,i=o,o=n,n=p+m|0}n=n+this.A|0,o=o+this.B|0,i=i+this.C|0,a=a+this.D|0,s=s+this.E|0,l=l+this.F|0,u=u+this.G|0,c=c+this.H|0,this.set(n,o,i,a,s,l,u,c)}roundClean(){nu(Ia)}destroy(){this.set(0,0,0,0,0,0,0,0),nu(this.buffer)}}const h8=B$(()=>new SU),CU=h8;function m8(e,t){return CU(Ei(e,{strict:!1})?zu(e):e)}function EU(e){const{commitment:t,version:r=1}=e,n=e.to??(typeof t=="string"?"hex":"bytes"),o=m8(t);return o.set([r],0),n==="bytes"?o:ur(o)}function PU(e){const{commitments:t,version:r}=e,n=e.to,o=[];for(const i of t)o.push(EU({commitment:i,to:n,version:r}));return o}const ZE=6,g8=32,IS=4096,y8=g8*IS,YE=y8*ZE-1-1*IS*ZE;class AU extends le{constructor({maxSize:t,size:r}){super("Blob size is too large.",{metaMessages:[`Max: ${t} bytes`,`Given: ${r} bytes`],name:"BlobSizeTooLargeError"})}}class kU extends le{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function TU(e){const t=typeof e.data=="string"?Pi(e.data):e.data,r=Gt(t);if(!r)throw new kU;if(r>YE)throw new AU({maxSize:YE,size:r});const n=[];let o=!0,i=0;for(;o;){const a=wS(new Uint8Array(y8));let s=0;for(;sur(a.bytes))}function IU(e){const{data:t,kzg:r,to:n}=e,o=e.blobs??TU({data:t}),i=e.commitments??f8({blobs:o,kzg:r,to:n}),a=e.proofs??p8({blobs:o,commitments:i,kzg:r,to:n}),s=[];for(let l=0;l{const o=ty(e,r);return o instanceof Up?e:o})();return new V7(n,{docsPath:t,...r})}async function Es(e){const t=await e.request({method:"eth_chainId"},{dedupe:!0});return _o(t)}async function OS(e,t){var I,O,_,R,E;const{account:r=e.account,accessList:n,authorizationList:o,chain:i=e.chain,blobVersionedHashes:a,blobs:s,data:l,gas:u,gasPrice:c,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:p,nonce:h,nonceManager:m,to:g,type:y,value:w,...S}=t,x=await(async()=>{if(!r||!m||typeof h<"u")return h;const M=Rt(r),B=i?i.id:await Se(e,Es,"getChainId")({});return await m.consume({address:M.address,chainId:B,client:e})})();va(t);const P=(O=(I=i==null?void 0:i.formatters)==null?void 0:I.transactionRequest)==null?void 0:O.format,T=(P||Cs)({...Wu(S,{format:P}),account:r?Rt(r):void 0,accessList:n,authorizationList:o,blobs:s,blobVersionedHashes:a,data:l,gas:u,gasPrice:c,maxFeePerBlobGas:d,maxFeePerGas:f,maxPriorityFeePerGas:p,nonce:x,to:g,type:y,value:w},"fillTransaction");try{const M=await e.request({method:"eth_fillTransaction",params:[T]}),j=(((R=(_=i==null?void 0:i.formatters)==null?void 0:_.transaction)==null?void 0:R.format)||AS)(M.tx);delete j.blockHash,delete j.blockNumber,delete j.r,delete j.s,delete j.transactionIndex,delete j.v,delete j.yParity,j.data=j.input,j.gas&&(j.gas=t.gas??j.gas),j.gasPrice&&(j.gasPrice=t.gasPrice??j.gasPrice),j.maxFeePerBlobGas&&(j.maxFeePerBlobGas=t.maxFeePerBlobGas??j.maxFeePerBlobGas),j.maxFeePerGas&&(j.maxFeePerGas=t.maxFeePerGas??j.maxFeePerGas),j.maxPriorityFeePerGas&&(j.maxPriorityFeePerGas=t.maxPriorityFeePerGas??j.maxPriorityFeePerGas),j.nonce&&(j.nonce=t.nonce??j.nonce);const N=await(async()=>{var W,H;if(typeof((W=i==null?void 0:i.fees)==null?void 0:W.baseFeeMultiplier)=="function"){const V=await Se(e,Ao,"getBlock")({});return i.fees.baseFeeMultiplier({block:V,client:e,request:t})}return((H=i==null?void 0:i.fees)==null?void 0:H.baseFeeMultiplier)??1.2})();if(N<1)throw new s8;const D=10**(((E=N.toString().split(".")[1])==null?void 0:E.length)??0),z=W=>W*BigInt(Math.ceil(N*D))/BigInt(D);return j.maxFeePerGas&&!t.maxFeePerGas&&(j.maxFeePerGas=z(j.maxFeePerGas)),j.gasPrice&&!t.gasPrice&&(j.gasPrice=z(j.gasPrice)),{raw:M.raw,transaction:{from:T.from,...j}}}catch(M){throw ry(M,{...t,chain:e.chain})}}const _S=["blobVersionedHashes","chainId","fees","gas","nonce","type"],XE=new Map,xb=new Fu(128);async function Wp(e,t){var x,P,A;let r=t;r.account??(r.account=e.account),r.parameters??(r.parameters=_S);const{account:n,chain:o=e.chain,nonceManager:i,parameters:a}=r,s=(()=>{if(typeof(o==null?void 0:o.prepareTransactionRequest)=="function")return{fn:o.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(o==null?void 0:o.prepareTransactionRequest))return{fn:o.prepareTransactionRequest[0],runAt:o.prepareTransactionRequest[1].runAt}})();let l;async function u(){return l||(typeof r.chainId<"u"?r.chainId:o?o.id:(l=await Se(e,Es,"getChainId")({}),l))}const c=n&&Rt(n);let d=r.nonce;if(a.includes("nonce")&&typeof d>"u"&&c&&i){const T=await u();d=await i.consume({address:c.address,chainId:T,client:e})}s!=null&&s.fn&&((x=s.runAt)!=null&&x.includes("beforeFillTransaction"))&&(r=await s.fn({...r,chain:o},{phase:"beforeFillTransaction"}),d??(d=r.nonce));const p=((a.includes("blobVersionedHashes")||a.includes("sidecars"))&&r.kzg&&r.blobs||xb.get(e.uid)===!1||!["fees","gas"].some(I=>a.includes(I))?!1:!!(a.includes("chainId")&&typeof r.chainId!="number"||a.includes("nonce")&&typeof d!="number"||a.includes("fees")&&typeof r.gasPrice!="bigint"&&(typeof r.maxFeePerGas!="bigint"||typeof r.maxPriorityFeePerGas!="bigint")||a.includes("gas")&&typeof r.gas!="bigint"))?await Se(e,OS,"fillTransaction")({...r,nonce:d}).then(T=>{const{chainId:I,from:O,gas:_,gasPrice:R,nonce:E,maxFeePerBlobGas:M,maxFeePerGas:B,maxPriorityFeePerGas:j,type:N,...F}=T.transaction;return xb.set(e.uid,!0),{...r,...O?{from:O}:{},...N?{type:N}:{},...typeof I<"u"?{chainId:I}:{},...typeof _<"u"?{gas:_}:{},...typeof R<"u"?{gasPrice:R}:{},...typeof E<"u"?{nonce:E}:{},...typeof M<"u"?{maxFeePerBlobGas:M}:{},...typeof B<"u"?{maxFeePerGas:B}:{},...typeof j<"u"?{maxPriorityFeePerGas:j}:{},..."nonceKey"in F&&typeof F.nonceKey<"u"?{nonceKey:F.nonceKey}:{}}}).catch(T=>{var _;const I=T;return I.name!=="TransactionExecutionError"||((_=I.walk)==null?void 0:_.call(I,R=>{const E=R;return E.name==="MethodNotFoundRpcError"||E.name==="MethodNotSupportedRpcError"}))&&xb.set(e.uid,!1),r}):r;d??(d=p.nonce),r={...p,...c?{from:c==null?void 0:c.address}:{},...d?{nonce:d}:{}};const{blobs:h,gas:m,kzg:g,type:y}=r;s!=null&&s.fn&&((P=s.runAt)!=null&&P.includes("beforeFillParameters"))&&(r=await s.fn({...r,chain:o},{phase:"beforeFillParameters"}));let w;async function S(){return w||(w=await Se(e,Ao,"getBlock")({blockTag:"latest"}),w)}if(a.includes("nonce")&&typeof d>"u"&&c&&!i&&(r.nonce=await Se(e,TS,"getTransactionCount")({address:c.address,blockTag:"pending"})),(a.includes("blobVersionedHashes")||a.includes("sidecars"))&&h&&g){const T=f8({blobs:h,kzg:g});if(a.includes("blobVersionedHashes")){const I=PU({commitments:T,to:"hex"});r.blobVersionedHashes=I}if(a.includes("sidecars")){const I=p8({blobs:h,commitments:T,kzg:g}),O=IU({blobs:h,commitments:T,proofs:I,to:"hex"});r.sidecars=O}}if(a.includes("chainId")&&(r.chainId=await u()),(a.includes("fees")||a.includes("type"))&&typeof y>"u")try{r.type=OU(r)}catch{let T=XE.get(e.uid);if(typeof T>"u"){const I=await S();T=typeof(I==null?void 0:I.baseFeePerGas)=="bigint",XE.set(e.uid,T)}r.type=T?"eip1559":"legacy"}if(a.includes("fees"))if(r.type!=="legacy"&&r.type!=="eip2930"){if(typeof r.maxFeePerGas>"u"||typeof r.maxPriorityFeePerGas>"u"){const T=await S(),{maxFeePerGas:I,maxPriorityFeePerGas:O}=await vw(e,{block:T,chain:o,request:r});if(typeof r.maxPriorityFeePerGas>"u"&&r.maxFeePerGas&&r.maxFeePerGas"u"){const T=await S(),{gasPrice:I}=await vw(e,{block:T,chain:o,request:r,type:"legacy"});r.gasPrice=I}}return a.includes("gas")&&typeof m>"u"&&(r.gas=await Se(e,$S,"estimateGas")({...r,account:c,prepare:(c==null?void 0:c.type)==="local"?[]:["blobVersionedHashes"]})),s!=null&&s.fn&&((A=s.runAt)!=null&&A.includes("afterFillParameters"))&&(r=await s.fn({...r,chain:o},{phase:"afterFillParameters"})),va(r),delete r.parameters,r}async function $S(e,t){var a,s,l;const{account:r=e.account,prepare:n=!0}=t,o=r?Rt(r):void 0,i=(()=>{if(Array.isArray(n))return n;if((o==null?void 0:o.type)!=="local")return["blobVersionedHashes"]})();try{const u=await(async()=>{if(t.to)return t.to;if(t.authorizationList&&t.authorizationList.length>0)return await ey({authorization:t.authorizationList[0]}).catch(()=>{throw new le("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:c,authorizationList:d,blobs:f,blobVersionedHashes:p,blockNumber:h,blockTag:m,data:g,gas:y,gasPrice:w,maxFeePerBlobGas:S,maxFeePerGas:x,maxPriorityFeePerGas:P,nonce:A,value:T,stateOverride:I,...O}=n?await Wp(e,{...t,parameters:i,to:u}):t;if(y&&t.gas!==y)return y;const R=(typeof h=="bigint"?je(h):void 0)||m,E=ES(I);va(t);const M=(l=(s=(a=e.chain)==null?void 0:a.formatters)==null?void 0:s.transactionRequest)==null?void 0:l.format,j=(M||Cs)({...Wu(O,{format:M}),account:o,accessList:c,authorizationList:d,blobs:f,blobVersionedHashes:p,data:g,gasPrice:w,maxFeePerBlobGas:S,maxFeePerGas:x,maxPriorityFeePerGas:P,nonce:A,to:u,value:T},"estimateGas");return BigInt(await e.request({method:"eth_estimateGas",params:E?[j,R??e.experimental_blockTag??"latest",E]:R?[j,R]:[j]}))}catch(u){throw lU(u,{...t,account:o,chain:e.chain})}}async function _U(e,t){var u;const{abi:r,address:n,args:o,functionName:i,dataSuffix:a=typeof e.dataSuffix=="string"?e.dataSuffix:(u=e.dataSuffix)==null?void 0:u.value,...s}=t,l=gn({abi:r,args:o,functionName:i});try{return await Se(e,$S,"estimateGas")({data:`${l}${a?a.replace("0x",""):""}`,to:n,...s})}catch(c){const d=s.account?Rt(s.account):void 0;throw Pl(c,{abi:r,address:n,args:o,docsPath:"/docs/contract/estimateContractGas",functionName:i,sender:d==null?void 0:d.address})}}function Hu(e,t){if(!io(e,{strict:!1}))throw new us({address:e});if(!io(t,{strict:!1}))throw new us({address:t});return e.toLowerCase()===t.toLowerCase()}const QE="/docs/contract/decodeEventLog";function Bf(e){const{abi:t,data:r,strict:n,topics:o}=e,i=n??!0,[a,...s]=o;if(!a)throw new bF({docsPath:QE});const l=t.find(y=>y.type==="event"&&a===Yg(Oo(y)));if(!(l&&"name"in l)||l.type!=="event")throw new wF(a,{docsPath:QE});const{name:u,inputs:c}=l,d=c==null?void 0:c.some(y=>!("name"in y&&y.name)),f=d?[]:{},p=c.map((y,w)=>[y,w]).filter(([y])=>"indexed"in y&&y.indexed),h=[];for(let y=0;y!("indexed"in y&&y.indexed)),g=i?m:[...h.map(([y])=>y),...m];if(g.length>0){if(r&&r!=="0x")try{const y=zp(g,r);if(y){let w=0;if(!i)for(const[S,x]of h)f[d?x:S.name||x]=y[w++];if(d)for(let S=0;S0?f:void 0}}function $U({param:e,value:t}){return e.type==="string"||e.type==="bytes"||e.type==="tuple"||e.type.match(/^(.*)\[(\d+)?\]$/)?t:(zp([e],t)||[])[0]}function RS(e){const{abi:t,args:r,logs:n,strict:o=!0}=e,i=(()=>{if(e.eventName)return Array.isArray(e.eventName)?e.eventName:[e.eventName]})(),a=t.filter(s=>s.type==="event").map(s=>({abi:s,selector:Yg(s)}));return n.map(s=>{var d;const l=a.filter(f=>s.topics[0]===f.selector);if(l.length===0)return null;let u,c;for(const f of l)try{u=Bf({...s,abi:[f.abi],strict:!0}),c=f;break}catch{}if(!u&&!o){c=l[0];try{u=Bf({data:s.data,topics:s.topics,abi:[c.abi],strict:!1})}catch{const f=(d=c.abi.inputs)==null?void 0:d.some(p=>!("name"in p&&p.name));return{...s,args:f?[]:{},eventName:c.abi.name}}}return!u||!c||i&&!i.includes(u.eventName)||!RU({args:u.args,inputs:c.abi.inputs,matchArgs:r})?null:{...u,...s}}).filter(Boolean)}function RU(e){const{args:t,inputs:r,matchArgs:n}=e;if(!n)return!0;if(!t)return!1;function o(i,a,s){try{return i.type==="address"?Hu(a,s):i.type==="string"||i.type==="bytes"?kr(zu(a))===s:a===s}catch{return!1}}return Array.isArray(t)&&Array.isArray(n)?n.every((i,a)=>{if(i==null)return!0;const s=r[a];return s?(Array.isArray(i)?i:[i]).some(u=>o(s,u,t[a])):!1}):typeof t=="object"&&!Array.isArray(t)&&typeof n=="object"&&!Array.isArray(n)?Object.entries(n).every(([i,a])=>{if(a==null)return!0;const s=r.find(u=>u.name===i);return s?(Array.isArray(a)?a:[a]).some(u=>o(s,u,t[i])):!1}):!1}function Ji(e,{args:t,eventName:r}={}){return{...e,blockHash:e.blockHash?e.blockHash:null,blockNumber:e.blockNumber?BigInt(e.blockNumber):null,blockTimestamp:e.blockTimestamp?BigInt(e.blockTimestamp):e.blockTimestamp===null?null:void 0,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 jS(e,{address:t,blockHash:r,fromBlock:n,toBlock:o,event:i,events:a,args:s,strict:l}={}){const u=l??!1,c=a??(i?[i]:void 0);let d=[];c&&(d=[c.flatMap(m=>Dp({abi:[m],eventName:m.name,args:a?void 0:s}))],i&&(d=d[0]));let f;r?f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,blockHash:r}]}):f=await e.request({method:"eth_getLogs",params:[{address:t,topics:d,fromBlock:typeof n=="bigint"?je(n):n,toBlock:typeof o=="bigint"?je(o):o}]});const p=f.map(h=>Ji(h));return c?RS({abi:c,args:s,logs:p,strict:u}):p}async function v8(e,t){const{abi:r,address:n,args:o,blockHash:i,eventName:a,fromBlock:s,toBlock:l,strict:u}=t,c=a?Wl({abi:r,name:a}):void 0,d=c?void 0:r.filter(f=>f.type==="event");return Se(e,jS,"getLogs")({address:n,args:o,blockHash:i,event:c,events:d,fromBlock:s,toBlock:l,strict:u})}const Sb="/docs/contract/decodeFunctionResult";function Hl(e){const{abi:t,args:r,functionName:n,data:o}=e;let i=t[0];if(n){const s=Wl({abi:t,args:r,name:n});if(!s)throw new eu(n,{docsPath:Sb});i=s}if(i.type!=="function")throw new eu(void 0,{docsPath:Sb});if(!i.outputs)throw new _$(i.name,{docsPath:Sb});const a=zp(i.outputs,o);if(a&&a.length>1)return a;if(a&&a.length===1)return a[0]}const jU="0.1.1";function MU(){return jU}class Le extends Error{static setStaticOptions(t){Le.prototype.docsOrigin=t.docsOrigin,Le.prototype.showVersion=t.showVersion,Le.prototype.version=t.version}constructor(t,r={}){const n=(()=>{var c;if(r.cause instanceof Le){if(r.cause.details)return r.cause.details;if(r.cause.shortMessage)return r.cause.shortMessage}return r.cause&&"details"in r.cause&&typeof r.cause.details=="string"?r.cause.details:(c=r.cause)!=null&&c.message?r.cause.message:r.details})(),o=r.cause instanceof Le&&r.cause.docsPath||r.docsPath,i=r.docsOrigin??Le.prototype.docsOrigin,a=`${i}${o??""}`,s=!!(r.version??Le.prototype.showVersion),l=r.version??Le.prototype.version,u=[t||"An error occurred.",...r.metaMessages?["",...r.metaMessages]:[],...n||o||s?["",n?`Details: ${n}`:void 0,o?`See: ${a}`:void 0,s?`Version: ${l}`:void 0]:[]].filter(c=>typeof c=="string").join(` +`);super(u,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{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,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=r.cause,this.details=n,this.docs=a,this.docsOrigin=i,this.docsPath=o,this.shortMessage=t,this.showVersion=s,this.version=l}walk(t){return b8(this,t)}}Object.defineProperty(Le,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${MU()}`}});Le.setStaticOptions(Le.defaultStaticOptions);function b8(e,t){return t!=null&&t(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause?b8(e.cause,t):t?null:e}function Hp(e,t){if(yc(e)>t)throw new QU({givenSize:yc(e),maxSize:t})}const $i={zero:48,nine:57,A:65,F:70,a:97,f:102};function JE(e){if(e>=$i.zero&&e<=$i.nine)return e-$i.zero;if(e>=$i.A&&e<=$i.F)return e-($i.A-10);if(e>=$i.a&&e<=$i.f)return e-($i.a-10)}function NU(e,t={}){const{dir:r,size:n=32}=t;if(n===0)return e;if(e.length>n)throw new JU({size:e.length,targetSize:n,type:"Bytes"});const o=new Uint8Array(n);for(let i=0;it)throw new iW({givenSize:On(e),maxSize:t})}function BU(e,t){if(typeof t=="number"&&t>0&&t>On(e)-1)throw new I8({offset:t,position:"start",size:On(e)})}function LU(e,t,r){if(typeof t=="number"&&typeof r=="number"&&On(e)!==r-t)throw new I8({offset:r,position:"end",size:On(e)})}function x8(e,t={}){const{dir:r,size:n=32}=t;if(n===0)return e;const o=e.replace("0x","");if(o.length>n*2)throw new aW({size:Math.ceil(o.length/2),targetSize:n,type:"Hex"});return`0x${o[r==="right"?"padEnd":"padStart"](n*2,"0")}`}const DU="#__bigint";function S8(e,t,r){return JSON.stringify(e,(n,o)=>typeof o=="bigint"?o.toString()+DU:o,r)}const zU=new TextDecoder,FU=new TextEncoder;function UU(e){return e instanceof Uint8Array?e:typeof e=="string"?C8(e):WU(e)}function WU(e){return e instanceof Uint8Array?e:new Uint8Array(e)}function C8(e,t={}){const{size:r}=t;let n=e;r&&(ny(e,r),n=kl(e,r));let o=n.slice(2);o.length%2&&(o=`0${o}`);const i=o.length/2,a=new Uint8Array(i);for(let s=0,l=0;s1||n[0]>1)throw new XU(n);return!!n[0]}function Zi(e,t={}){const{size:r}=t;typeof r<"u"&&Hp(e,r);const n=jo(e,t);return k8(n,t)}function ZU(e,t={}){const{size:r}=t;let n=e;return typeof r<"u"&&(Hp(n,r),n=YU(n)),zU.decode(n)}function E8(e){return w8(e,{dir:"left"})}function YU(e){return w8(e,{dir:"right"})}class XU extends Le{constructor(t){super(`Bytes value \`${t}\` is not a valid boolean.`,{metaMessages:["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:"Bytes.InvalidBytesBooleanError"})}}let QU=class extends Le{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},JU=class extends Le{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const eW=new TextEncoder,tW=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function rW(e,t={}){const{strict:r=!1}=t;if(!e)throw new eP(e);if(typeof e!="string")throw new eP(e);if(r&&!/^0x[0-9a-fA-F]*$/.test(e))throw new tP(e);if(!e.startsWith("0x"))throw new tP(e)}function Ro(...e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}function nW(e){return e instanceof Uint8Array?jo(e):Array.isArray(e)?jo(new Uint8Array(e)):e}function P8(e,t={}){const r=`0x${Number(e)}`;return typeof t.size=="number"?(ny(r,t.size),Al(r,t.size)):r}function jo(e,t={}){let r="";for(let o=0;oi||o>1n;return n<=a?n:n-i-1n}function k8(e,t={}){const{signed:r,size:n}=t;return Number(!r&&!n?e:A8(e,t))}function oW(e,t={}){const{strict:r=!1}=t;try{return rW(e,{strict:r}),!0}catch{return!1}}class T8 extends Le{constructor({max:t,min:r,signed:n,size:o,value:i}){super(`Number \`${i}\` is not in safe${o?` ${o*8}-bit`:""}${n?" signed":" unsigned"} integer range ${t?`(\`${r}\` to \`${t}\`)`:`(above \`${r}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class eP extends Le{constructor(t){super(`Value \`${typeof t=="object"?S8(t):t}\` of type \`${typeof t}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class tP extends Le{constructor(t){super(`Value \`${t}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class iW extends Le{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed \`${r}\` bytes. Given size: \`${t}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class I8 extends Le{constructor({offset:t,position:r,size:n}){super(`Slice ${r==="start"?"starting":"ending"} at offset \`${t}\` is out-of-bounds (size: \`${n}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class aW extends Le{constructor({size:t,targetSize:r,type:n}){super(`${n.charAt(0).toUpperCase()}${n.slice(1).toLowerCase()} size (\`${t}\`) exceeds padding size (\`${r}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function sW(e){return{address:e.address,amount:Ur(e.amount),index:Ur(e.index),validatorIndex:Ur(e.validatorIndex)}}function O8(e){return{...typeof e.baseFeePerGas=="bigint"&&{baseFeePerGas:Ur(e.baseFeePerGas)},...typeof e.blobBaseFee=="bigint"&&{blobBaseFee:Ur(e.blobBaseFee)},...typeof e.feeRecipient=="string"&&{feeRecipient:e.feeRecipient},...typeof e.gasLimit=="bigint"&&{gasLimit:Ur(e.gasLimit)},...typeof e.number=="bigint"&&{number:Ur(e.number)},...typeof e.prevRandao=="bigint"&&{prevRandao:Ur(e.prevRandao)},...typeof e.time=="bigint"&&{time:Ur(e.time)},...e.withdrawals&&{withdrawals:e.withdrawals.map(sW)}}}const om=[{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"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],bw=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],_8=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],$8=[..._8,{name:"resolveWithGateways",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"}]}],lW=[..._8,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],rP=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],nP=[{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"}]}],R8=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],oP=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],PSe=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],cW="0x82ad56cb",j8="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",uW="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",dW="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",NS="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class ww extends le{constructor({blockNumber:t,chain:r,contract:n}){super(`Chain "${r.name}" does not support contract "${n.name}".`,{metaMessages:["This could be due to any of the following:",...t&&n.blockCreated&&n.blockCreated>t?[`- The contract "${n.name}" was not deployed until block ${n.blockCreated} (current block ${t}).`]:[`- The chain does not have the contract "${n.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class fW extends le{constructor({chain:t,currentChainId:r}){super(`The current chain of the wallet (id: ${r}) does not match the target chain for the transaction (id: ${t.id} – ${t.name}).`,{metaMessages:[`Current Chain ID: ${r}`,`Expected Chain ID: ${t.id} – ${t.name}`],name:"ChainMismatchError"})}}class pW extends le{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` +`),{name:"ChainNotFoundError"})}}class M8 extends le{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const Cb="/docs/contract/encodeDeployData";function oy(e){const{abi:t,args:r,bytecode:n}=e;if(!r||r.length===0)return n;const o=t.find(a=>"type"in a&&a.type==="constructor");if(!o)throw new hF({docsPath:Cb});if(!("inputs"in o))throw new OE({docsPath:Cb});if(!o.inputs||o.inputs.length===0)throw new OE({docsPath:Cb});const i=Ss(o.inputs,r);return Uu([n,i])}function Vu({blockNumber:e,chain:t,contract:r}){var o;const n=(o=t==null?void 0:t.contracts)==null?void 0:o[r];if(!n)throw new ww({chain:t,contract:{name:r}});if(e&&n.blockCreated&&n.blockCreated>e)throw new ww({blockNumber:e,chain:t,contract:{name:r,blockCreated:n.blockCreated}});return n.address}function N8(e,{docsPath:t,...r}){const n=(()=>{const o=ty(e,r);return o instanceof Up?e:o})();return new n8(n,{docsPath:t,...r})}function BS(){let e=()=>{},t=()=>{};return{promise:new Promise((n,o)=>{e=n,t=o}),resolve:e,reject:t}}const Eb=new Map;function B8({fn:e,id:t,shouldSplitBatch:r,wait:n=0,sort:o}){const i=async()=>{const c=l();a();const d=c.map(({args:f})=>f);d.length!==0&&e(d).then(f=>{o&&Array.isArray(f)&&f.sort(o);for(let p=0;p{for(let p=0;pEb.delete(t),s=()=>l().map(({args:c})=>c),l=()=>Eb.get(t)||[],u=c=>Eb.set(t,[...l(),c]);return{flush:a,async schedule(c){const{promise:d,resolve:f,reject:p}=BS();return(r==null?void 0:r([...s(),c]))&&i(),l().length>0?(u({args:c,resolve:f,reject:p}),d):(u({args:c,resolve:f,reject:p}),setTimeout(i,n),d)}}}async function iy(e,t){var M,B,j,N;const{account:r=e.account,authorizationList:n,batch:o=!!((M=e.batch)!=null&&M.multicall),blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",accessList:s,blobs:l,blockOverrides:u,code:c,data:d,factory:f,factoryData:p,gas:h,gasPrice:m,maxFeePerBlobGas:g,maxFeePerGas:y,maxPriorityFeePerGas:w,nonce:S,to:x,value:P,stateOverride:A,...T}=t,I=r?Rt(r):void 0;if(c&&(f||p))throw new le("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(c&&x)throw new le("Cannot provide both `code` & `to` as parameters.");const O=c&&d,_=f&&p&&x&&d,R=O||_,E=O?L8({code:c,data:d}):_?gW({data:d,factory:f,factoryData:p,to:x}):d;try{va(t);const D=(typeof i=="bigint"?je(i):void 0)||a,z=u?O8(u):void 0,W=ES(A),H=(N=(j=(B=e.chain)==null?void 0:B.formatters)==null?void 0:j.transactionRequest)==null?void 0:N.format,Q=(H||Cs)({...Wu(T,{format:H}),accessList:s,account:I,authorizationList:n,blobs:l,data:E,gas:h,gasPrice:m,maxFeePerBlobGas:g,maxFeePerGas:y,maxPriorityFeePerGas:w,nonce:S,to:R?void 0:x,value:P},"call");if(o&&hW({request:Q})&&!W&&!z)try{return await mW(e,{...Q,blockNumber:i,blockTag:a})}catch(Z){if(!(Z instanceof M8)&&!(Z instanceof ww))throw Z}const re=(()=>{const Z=[Q,D];return W&&z?[...Z,W,z]:W?[...Z,W]:z?[...Z,{},z]:Z})(),Y=await e.request({method:"eth_call",params:re});return Y==="0x"?{data:void 0}:{data:Y}}catch(F){const D=yW(F),{offchainLookup:z,offchainLookupSignature:W}=await ja(async()=>{const{offchainLookup:H,offchainLookupSignature:V}=await import("./ccip-CfLiOW7z.js");return{offchainLookup:H,offchainLookupSignature:V}},[]);if(e.ccipRead!==!1&&(D==null?void 0:D.slice(0,10))===W&&x)return{data:await z(e,{data:D,to:x})};throw R&&(D==null?void 0:D.slice(0,10))==="0x101bb98d"?new Z7({factory:f}):N8(F,{...t,account:I,chain:e.chain})}}function hW({request:e}){const{data:t,to:r,...n}=e;return!(!t||t.startsWith(cW)||!r||Object.values(n).filter(o=>typeof o<"u").length>0)}async function mW(e,t){var m;const{batchSize:r=1024,deployless:n=!1,wait:o=0}=typeof((m=e.batch)==null?void 0:m.multicall)=="object"?e.batch.multicall:{},{blockNumber:i,blockTag:a=e.experimental_blockTag??"latest",data:s,to:l}=t,u=(()=>{if(n)return null;if(t.multicallAddress)return t.multicallAddress;if(e.chain)return Vu({blockNumber:i,chain:e.chain,contract:"multicall3"});throw new M8})(),d=(typeof i=="bigint"?je(i):void 0)||a,{schedule:f}=B8({id:`${e.uid}.${d}`,wait:o,shouldSplitBatch(g){return g.reduce((w,{data:S})=>w+(S.length-2),0)>r*2},fn:async g=>{const y=g.map(x=>({allowFailure:!0,callData:x.data,target:x.to})),w=gn({abi:om,args:[y],functionName:"aggregate3"}),S=await e.request({method:"eth_call",params:[{...u===null?{data:L8({code:NS,data:w})}:{to:u,data:w}},d]});return Hl({abi:om,args:[y],functionName:"aggregate3",data:S||"0x"})}}),[{returnData:p,success:h}]=await f({data:s,to:l});if(!h)throw new Jg({data:p});return p==="0x"?{data:void 0}:{data:p}}function L8(e){const{code:t,data:r}=e;return oy({abi:qg(["constructor(bytes, bytes)"]),bytecode:j8,args:[t,r]})}function gW(e){const{data:t,factory:r,factoryData:n,to:o}=e;return oy({abi:qg(["constructor(address, bytes, address, bytes)"]),bytecode:uW,args:[o,t,r,n]})}function yW(e){var r;if(!(e instanceof le))return;const t=e.walk();return typeof(t==null?void 0:t.data)=="object"?(r=t.data)==null?void 0:r.data:t.data}async function Mo(e,t){const{abi:r,address:n,args:o,functionName:i,...a}=t,s=gn({abi:r,args:o,functionName:i});try{const{data:l}=await Se(e,iy,"call")({...a,data:s,to:n});return Hl({abi:r,args:o,functionName:i,data:l||"0x"})}catch(l){throw Pl(l,{abi:r,address:n,args:o,docsPath:"/docs/contract/readContract",functionName:i})}}async function vW(e,t){var c;const{abi:r,address:n,args:o,functionName:i,dataSuffix:a=typeof e.dataSuffix=="string"?e.dataSuffix:(c=e.dataSuffix)==null?void 0:c.value,...s}=t,l=s.account?Rt(s.account):e.account,u=gn({abi:r,args:o,functionName:i});try{const{data:d}=await Se(e,iy,"call")({batch:!1,data:`${u}${a?a.replace("0x",""):""}`,to:n,...s,account:l}),f=Hl({abi:r,args:o,functionName:i,data:d||"0x"}),p=r.filter(h=>"name"in h&&h.name===t.functionName);return{result:f,request:{abi:p,address:n,args:o,dataSuffix:a,functionName:i,...s,account:l}}}catch(d){throw Pl(d,{abi:r,address:n,args:o,docsPath:"/docs/contract/simulateContract",functionName:i,sender:l==null?void 0:l.address})}}const Pb=new Map,iP=new Map;let bW=0;function ea(e,t,r){const n=++bW,o=()=>Pb.get(e)||[],i=()=>{const c=o();Pb.set(e,c.filter(d=>d.id!==n))},a=()=>{const c=o();if(!c.some(f=>f.id===n))return;const d=iP.get(e);if(c.length===1&&d){const f=d();f instanceof Promise&&f.catch(()=>{})}i()},s=o();if(Pb.set(e,[...s,{id:n,fns:t}]),s&&s.length>0)return a;const l={};for(const c in t)l[c]=(...d)=>{var p,h;const f=o();if(f.length!==0)for(const m of f)(h=(p=m.fns)[c])==null||h.call(p,...d)};const u=r(l);return typeof u=="function"&&iP.set(e,u),a}async function xw(e){return new Promise(t=>setTimeout(t,e))}function Gu(e,{emitOnBegin:t,initialWaitTime:r,interval:n}){let o=!0;const i=()=>o=!1;return(async()=>{let s;t&&(s=await e({unpoll:i}));const l=await(r==null?void 0:r(s))??n;await xw(l);const u=async()=>{o&&(await e({unpoll:i}),await xw(n),u())};u()})(),i}const wW=new Map,xW=new Map;function SW(e){const t=(o,i)=>({clear:()=>i.delete(o),get:()=>i.get(o),set:a=>i.set(o,a)}),r=t(e,wW),n=t(e,xW);return{clear:()=>{r.clear(),n.clear()},promise:r,response:n}}async function CW(e,{cacheKey:t,cacheTime:r=Number.POSITIVE_INFINITY}){const n=SW(t),o=n.response.get();if(o&&r>0&&Date.now()-o.created.getTime()`blockNumber.${e}`;async function Vp(e,{cacheTime:t=e.cacheTime}={}){const r=await CW(()=>e.request({method:"eth_blockNumber"}),{cacheKey:EW(e.uid),cacheTime:t});return BigInt(r)}async function ay(e,{filter:t}){const r="strict"in t&&t.strict,n=await t.request({method:"eth_getFilterChanges",params:[t.id]});if(typeof n[0]=="string")return n;const o=n.map(i=>Ji(i));return!("abi"in t)||!t.abi?o:RS({abi:t.abi,logs:o,strict:r})}async function sy(e,{filter:t}){return t.request({method:"eth_uninstallFilter",params:[t.id]})}function PW(e,t){const{abi:r,address:n,args:o,batch:i=!0,eventName:a,fromBlock:s,onError:l,onLogs:u,poll:c,pollingInterval:d=e.pollingInterval,strict:f}=t;return(typeof c<"u"?c:typeof s=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")))?(()=>{const g=f??!1,y=cr(["watchContractEvent",n,o,i,e.uid,a,d,g,s]);return ea(y,{onLogs:u,onError:l},w=>{let S;s!==void 0&&(S=s-1n);let x,P=!1;const A=Gu(async()=>{var T;if(!P){try{x=await Se(e,Z$,"createContractEventFilter")({abi:r,address:n,args:o,eventName:a,strict:g,fromBlock:s})}catch{}P=!0;return}try{let I;if(x)I=await Se(e,ay,"getFilterChanges")({filter:x});else{const O=await Se(e,Vp,"getBlockNumber")({});S&&S{x&&await Se(e,sy,"uninstallFilter")({filter:x}),A()}})})():(()=>{const g=f??!1,y=cr(["watchContractEvent",n,o,i,e.uid,a,d,g]);let w=!0,S=()=>w=!1;return ea(y,{onLogs:u,onError:l},x=>((async()=>{try{const P=(()=>{if(e.transport.type==="fallback"){const I=e.transport.transports.find(O=>O.config.type==="webSocket"||O.config.type==="ipc");return I?I.value:e.transport}return e.transport})(),A=a?Dp({abi:r,eventName:a,args:o}):[],{unsubscribe:T}=await P.subscribe({params:["logs",{address:n,topics:A}],onData(I){var _;if(!w)return;const O=I.result;try{const{eventName:R,args:E}=Bf({abi:r,data:O.data,topics:O.topics,strict:f}),M=Ji(O,{args:E,eventName:R});x.onLogs([M])}catch(R){let E,M;if(R instanceof tm||R instanceof pS){if(f)return;E=R.abiItem.name,M=(_=R.abiItem.inputs)==null?void 0:_.some(j=>!("name"in j&&j.name))}const B=Ji(O,{args:M?[]:{},eventName:E});x.onLogs([B])}},onError(I){var O;(O=x.onError)==null||O.call(x,I)}});S=T,w||S()}catch(P){l==null||l(P)}})(),()=>S()))})()}class Ps extends le{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` +`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class hl extends le{constructor({docsPath:t,metaMessages:r,type:n}){super(`Account type "${n}" is not supported.`,{docsPath:t,metaMessages:r,name:"AccountTypeNotSupportedError"})}}function LS({chain:e,currentChainId:t}){if(!e)throw new pW;if(t!==e.id)throw new fW({chain:e,currentChainId:t})}async function DS(e,{serializedTransaction:t}){return e.request({method:"eth_sendRawTransaction",params:[t]},{retryCount:0})}const Ab=new Fu(128);async function ly(e,t){var x,P,A,T,I;const{account:r=e.account,assertChainId:n=!0,chain:o=e.chain,accessList:i,authorizationList:a,blobs:s,data:l,dataSuffix:u=typeof e.dataSuffix=="string"?e.dataSuffix:(x=e.dataSuffix)==null?void 0:x.value,gas:c,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,type:g,value:y,...w}=t;if(typeof r>"u")throw new Ps({docsPath:"/docs/actions/wallet/sendTransaction"});const S=r?Rt(r):null;try{va(t);const O=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await ey({authorization:a[0]}).catch(()=>{throw new le("`to` is required. Could not infer from `authorizationList`.")})})();if((S==null?void 0:S.type)==="json-rpc"||S===null){let _;o!==null&&(_=await Se(e,Es,"getChainId")({}),n&&LS({currentChainId:_,chain:o}));const R=(T=(A=(P=e.chain)==null?void 0:P.formatters)==null?void 0:A.transactionRequest)==null?void 0:T.format,M=(R||Cs)({...Wu(w,{format:R}),accessList:i,account:S,authorizationList:a,blobs:s,chainId:_,data:l&&Lr([l,u??"0x"]),gas:c,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:O,type:g,value:y},"sendTransaction"),B=Ab.get(e.uid),j=B?"wallet_sendTransaction":"eth_sendTransaction";try{return await e.request({method:j,params:[M]},{retryCount:0})}catch(N){if(B===!1)throw N;const F=N;if(F.name==="InvalidInputRpcError"||F.name==="InvalidParamsRpcError"||F.name==="MethodNotFoundRpcError"||F.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[M]},{retryCount:0}).then(D=>(Ab.set(e.uid,!0),D)).catch(D=>{const z=D;throw z.name==="MethodNotFoundRpcError"||z.name==="MethodNotSupportedRpcError"?(Ab.set(e.uid,!1),F):z});throw F}}if((S==null?void 0:S.type)==="local"){const _=await Se(e,Wp,"prepareTransactionRequest")({account:S,accessList:i,authorizationList:a,blobs:s,chain:o,data:l&&Lr([l,u??"0x"]),gas:c,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,nonceManager:S.nonceManager,parameters:[..._S,"sidecars"],type:g,value:y,...w,to:O}),R=(I=o==null?void 0:o.serializers)==null?void 0:I.transaction,E=await S.signTransaction(_,{serializer:R});return await Se(e,DS,"sendRawTransaction")({serializedTransaction:E})}throw(S==null?void 0:S.type)==="smart"?new hl({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new hl({docsPath:"/docs/actions/wallet/sendTransaction",type:S==null?void 0:S.type})}catch(O){throw O instanceof hl?O:ry(O,{...t,account:S,chain:t.chain||void 0})}}async function Lf(e,t){return Lf.internal(e,ly,"sendTransaction",t)}(function(e){async function t(r,n,o,i){const{abi:a,account:s=r.account,address:l,args:u,functionName:c,...d}=i;if(typeof s>"u")throw new Ps({docsPath:"/docs/contract/writeContract"});const f=s?Rt(s):null,p=gn({abi:a,args:u,functionName:c});try{return await Se(r,n,o)({data:p,to:l,account:f,...d})}catch(h){throw Pl(h,{abi:a,address:l,args:u,docsPath:"/docs/contract/writeContract",functionName:c,sender:f==null?void 0:f.address})}}e.internal=t})(Lf||(Lf={}));class AW extends le{constructor(t){super(`Call bundle failed with status: ${t.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=t}}function im(e,{delay:t=100,retryCount:r=2,shouldRetry:n=()=>!0}={}){return new Promise((o,i)=>{const a=async({count:s=0}={})=>{const l=async({error:u})=>{const c=typeof t=="function"?t({count:s,error:u}):t;c&&await xw(c),a({count:s+1})};try{const u=await e();o(u)}catch(u){if(sJi(n)):null,to:e.to?e.to:null,transactionIndex:e.transactionIndex?_o(e.transactionIndex):null,status:e.status?D8[e.status]:null,type:e.type?c8[e.type]||e.type:null};return e.blobGasPrice&&(r.blobGasPrice=BigInt(e.blobGasPrice)),e.blobGasUsed&&(r.blobGasUsed=BigInt(e.blobGasUsed)),r}const F8="0x5792579257925792579257925792579257925792579257925792579257925792",U8=je(0,{size:32});async function W8(e,t){var f;const{account:r=e.account,chain:n=e.chain,experimental_fallback:o,experimental_fallbackDelay:i=32,forceAtomic:a=!1,id:s,version:l="2.0.0"}=t,u=r?Rt(r):null;let c=t.capabilities;e.dataSuffix&&!((f=t.capabilities)!=null&&f.dataSuffix)&&(typeof e.dataSuffix=="string"?c={...t.capabilities,dataSuffix:{value:e.dataSuffix,optional:!0}}:c={...t.capabilities,dataSuffix:{value:e.dataSuffix.value,...e.dataSuffix.required?{}:{optional:!0}}});const d=t.calls.map(p=>{const h=p,m=h.abi?gn({abi:h.abi,functionName:h.functionName,args:h.args}):h.data;return{data:h.dataSuffix&&m?Lr([m,h.dataSuffix]):m,to:h.to,value:h.value?je(h.value):void 0}});try{const p=await e.request({method:"wallet_sendCalls",params:[{atomicRequired:a,calls:d,capabilities:c,chainId:je(n.id),from:u==null?void 0:u.address,id:s,version:l}]},{retryCount:0});return typeof p=="string"?{id:p}:p}catch(p){const h=p;if(o&&(h.name==="MethodNotFoundRpcError"||h.name==="MethodNotSupportedRpcError"||h.name==="UnknownRpcError"||h.details.toLowerCase().includes("does not exist / is not available")||h.details.toLowerCase().includes("missing or invalid. request()")||h.details.toLowerCase().includes("did not match any variant of untagged enum")||h.details.toLowerCase().includes("account upgraded to unsupported contract")||h.details.toLowerCase().includes("eip-7702 not supported")||h.details.toLowerCase().includes("unsupported wc_ method")||h.details.toLowerCase().includes("feature toggled misconfigured")||h.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(c&&Object.values(c).some(S=>!S.optional)){const S="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new au(new le(S,{details:S}))}if(a&&d.length>1){const w="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new su(new le(w,{details:w}))}const m=[];for(const w of d){const S=ly(e,{account:u,chain:n,data:w.data,to:w.to,value:w.value?In(w.value):void 0});m.push(S),i>0&&await new Promise(x=>setTimeout(x,i))}const g=await Promise.allSettled(m);if(g.every(w=>w.status==="rejected"))throw g[0].reason;const y=g.map(w=>w.status==="fulfilled"?w.value:U8);return{id:Lr([...y,je(n.id,{size:32}),F8])}}throw ry(p,{...t,account:u,chain:t.chain})}}async function H8(e,t){async function r(c){if(c.endsWith(F8.slice(2))){const f=Ya(aw(c,-64,-32)),p=aw(c,0,-64).slice(2).match(/.{1,64}/g),h=await Promise.all(p.map(g=>U8.slice(2)!==g?e.request({method:"eth_getTransactionReceipt",params:[`0x${g}`]},{dedupe:!0}):void 0)),m=h.some(g=>g===null)?100:h.every(g=>(g==null?void 0:g.status)==="0x1")?200:h.every(g=>(g==null?void 0:g.status)==="0x0")?500:600;return{atomic:!1,chainId:_o(f),receipts:h.filter(Boolean),status:m,version:"2.0.0"}}return e.request({method:"wallet_getCallsStatus",params:[c]})}const{atomic:n=!1,chainId:o,receipts:i,version:a="2.0.0",...s}=await r(t.id),[l,u]=(()=>{const c=s.status;return c>=100&&c<200?["pending",c]:c>=200&&c<300?["success",c]:c>=300&&c<700?["failure",c]:c==="CONFIRMED"?["success",200]:c==="PENDING"?["pending",100]:[void 0,c]})();return{...s,atomic:n,chainId:o?_o(o):void 0,receipts:(i==null?void 0:i.map(c=>({...c,blockNumber:In(c.blockNumber),gasUsed:In(c.gasUsed),status:D8[c.status]})))??[],statusCode:u,status:l,version:a}}async function V8(e,t){const{id:r,pollingInterval:n=e.pollingInterval,status:o=({statusCode:m})=>m===200||m>=300,retryCount:i=4,retryDelay:a=({count:m})=>~~(1<{const g=Gu(async()=>{const y=w=>{clearTimeout(p),g(),w(),h()};try{const w=await im(async()=>{const S=await Se(e,H8,"getCallsStatus")({id:r});if(l&&S.status==="failure")throw new AW(S);return S},{retryCount:i,delay:a});if(!o(w))return;y(()=>m.resolve(w))}catch(w){y(()=>m.reject(w))}},{interval:n,emitOnBegin:!0});return g});return p=s?setTimeout(()=>{h(),clearTimeout(p),f(new kW({id:r}))},s):void 0,await c}class kW extends le{constructor({id:t}){super(`Timed out while waiting for call bundle with id "${t}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const Sw=256;let Oh=Sw,_h;function G8(e=11){if(!_h||Oh+e>Sw*2){_h="",Oh=0;for(let t=0;t{const A=P(x);for(const I in w)delete A[I];const T={...x,...A};return Object.assign(T,{extend:S(T)})}}return Object.assign(w,{extend:S(w)})}function zS(e){var r,n,o,i,a,s;if(!(e instanceof le))return!1;const t=e.walk(l=>l instanceof cw);return t instanceof cw?((r=t.data)==null?void 0:r.errorName)==="HttpError"||((n=t.data)==null?void 0:n.errorName)==="ResolverError"||((o=t.data)==null?void 0:o.errorName)==="ResolverNotContract"||((i=t.data)==null?void 0:i.errorName)==="ResolverNotFound"||((a=t.data)==null?void 0:a.errorName)==="ReverseAddressMismatch"||((s=t.data)==null?void 0:s.errorName)==="UnsupportedResolverProfile":!1}function TW(e){const{abi:t,data:r}=e,n=ou(r,0,4),o=t.find(i=>i.type==="function"&&n===Lp(Oo(i)));if(!o)throw new xF(n,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:o.name,args:"inputs"in o&&o.inputs&&o.inputs.length>0?zp(o.inputs,ou(r,4)):void 0}}const kb="/docs/contract/encodeErrorResult";function aP(e){const{abi:t,errorName:r,args:n}=e;let o=t[0];if(r){const l=Wl({abi:t,args:n,name:r});if(!l)throw new _E(r,{docsPath:kb});o=l}if(o.type!=="error")throw new _E(void 0,{docsPath:kb});const i=Oo(o),a=Lp(i);let s="0x";if(n&&n.length>0){if(!o.inputs)throw new vF(o.name,{docsPath:kb});s=Ss(o.inputs,n)}return Uu([a,s])}const Tb="/docs/contract/encodeFunctionResult";function IW(e){const{abi:t,functionName:r,result:n}=e;let o=t[0];if(r){const a=Wl({abi:t,name:r});if(!a)throw new eu(r,{docsPath:Tb});o=a}if(o.type!=="function")throw new eu(void 0,{docsPath:Tb});if(!o.outputs)throw new _$(o.name,{docsPath:Tb});const i=(()=>{if(o.outputs.length===0)return[];if(o.outputs.length===1)return[n];if(Array.isArray(n))return n;throw new $$(n)})();return Ss(o.outputs,i)}const cy="x-batch-gateway:true";async function OW(e){const{data:t,ccipRequest:r}=e,{args:[n]}=TW({abi:bw,data:t}),o=[],i=[];return await Promise.all(n.map(async(a,s)=>{try{i[s]=a.urls.includes(cy)?await OW({data:a.data,ccipRequest:r}):await r(a),o[s]=!1}catch(l){o[s]=!0,i[s]=_W(l)}})),IW({abi:bw,functionName:"query",result:[o,i]})}function _W(e){return e.name==="HttpRequestError"&&e.status?aP({abi:bw,errorName:"HttpError",args:[e.status,e.shortMessage]}):aP({abi:[Y$],errorName:"Error",args:["shortMessage"in e?e.shortMessage:e.message]})}function K8(e){if(e.length!==66||e.indexOf("[")!==0||e.indexOf("]")!==65)return null;const t=`0x${e.slice(1,65)}`;return Ei(t)?t:null}function Cw(e){let t=new Uint8Array(32).fill(0);if(!e)return ur(t);const r=e.split(".");for(let n=r.length-1;n>=0;n-=1){const o=K8(r[n]),i=o?zu(o):kr(pl(r[n]),"bytes");t=kr(Lr([t,i]),"bytes")}return ur(t)}function $W(e){return`[${e.slice(2)}]`}function RW(e){const t=new Uint8Array(32).fill(0);return e?K8(e)||kr(pl(e)):ur(t)}function FS(e){const t=e.replace(/^\.|\.$/gm,"");if(t.length===0)return new Uint8Array(1);const r=new Uint8Array(pl(t).byteLength+2);let n=0;const o=t.split(".");for(let i=0;i255&&(a=pl($W(RW(o[i])))),r[n]=a.length,r.set(a,n+1),n+=a.length+1}return r.byteLength!==n+1?r.slice(0,n+1):r}async function jW(e,t){const{blockNumber:r,blockTag:n,coinType:o,name:i,gatewayUrls:a,strict:s}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Vu({blockNumber:r,chain:l,contract:"ensUniversalResolver"})})(),c=l==null?void 0:l.ensTlds;if(c&&!c.some(f=>i.endsWith(f)))return null;const d=o!=null?[Cw(i),BigInt(o)]:[Cw(i)];try{const f=gn({abi:nP,functionName:"addr",args:d}),p={address:u,abi:$8,functionName:"resolveWithGateways",args:[$o(FS(i)),f,a??[cy]],blockNumber:r,blockTag:n},m=await Se(e,Mo,"readContract")(p);if(m[0]==="0x")return null;const g=Hl({abi:nP,args:d,functionName:"addr",data:m[0]});return g==="0x"||Ya(g)==="0x00"?null:g}catch(f){if(s)throw f;if(zS(f))return null;throw f}}class MW extends le{constructor({data:t}){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(t)}`],name:"EnsAvatarInvalidMetadataError"})}}class hd extends le{constructor({reason:t}){super(`ENS NFT avatar URI is invalid. ${t}`,{name:"EnsAvatarInvalidNftUriError"})}}class US extends le{constructor({uri:t}){super(`Unable to resolve ENS avatar URI "${t}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class NW extends le{constructor({namespace:t}){super(`ENS NFT avatar namespace "${t}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const BW=/(?https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,LW=/^(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\-.]+))?(?\/.*)?$/,DW=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,zW=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function FW(e){try{const t=await fetch(e,{method:"HEAD"});if(t.status===200){const r=t.headers.get("content-type");return r==null?void 0:r.startsWith("image/")}return!1}catch(t){return typeof t=="object"&&typeof t.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise(r=>{const n=new Image;n.onload=()=>{r(!0)},n.onerror=()=>{r(!1)},n.src=e})}}function sP(e,t){return e?e.endsWith("/")?e.slice(0,-1):e:t}function Z8({uri:e,gatewayUrls:t}){const r=DW.test(e);if(r)return{uri:e,isOnChain:!0,isEncoded:r};const n=sP(t==null?void 0:t.ipfs,"https://ipfs.io"),o=sP(t==null?void 0:t.arweave,"https://arweave.net"),i=e.match(BW),{protocol:a,subpath:s,target:l,subtarget:u=""}=(i==null?void 0:i.groups)||{},c=a==="ipns:/"||s==="ipns/",d=a==="ipfs:/"||s==="ipfs/"||LW.test(e);if(e.startsWith("http")&&!c&&!d){let p=e;return t!=null&&t.arweave&&(p=e.replace(/https:\/\/arweave.net/g,t==null?void 0:t.arweave)),{uri:p,isOnChain:!1,isEncoded:!1}}if((c||d)&&l)return{uri:`${n}/${c?"ipns":"ipfs"}/${l}${u}`,isOnChain:!1,isEncoded:!1};if(a==="ar:/"&&l)return{uri:`${o}/${l}${u||""}`,isOnChain:!1,isEncoded:!1};let f=e.replace(zW,"");if(f.startsWith("o.json());return await WS({gatewayUrls:e,uri:Y8(r)})}catch{throw new US({uri:t})}}async function WS({gatewayUrls:e,uri:t}){const{uri:r,isOnChain:n}=Z8({uri:t,gatewayUrls:e});if(n||await FW(r))return r;throw new US({uri:t})}function WW(e){let t=e;t.startsWith("did:nft:")&&(t=t.replace("did:nft:","").replace(/_/g,"/"));const[r,n,o]=t.split("/"),[i,a]=r.split(":"),[s,l]=n.split(":");if(!i||i.toLowerCase()!=="eip155")throw new hd({reason:"Only EIP-155 supported"});if(!a)throw new hd({reason:"Chain ID not found"});if(!l)throw new hd({reason:"Contract address not found"});if(!o)throw new hd({reason:"Token ID not found"});if(!s)throw new hd({reason:"ERC namespace not found"});return{chainID:Number.parseInt(a,10),namespace:s.toLowerCase(),contractAddress:l,tokenID:o}}async function HW(e,{nft:t}){if(t.namespace==="erc721")return Mo(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(t.namespace==="erc1155")return Mo(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 NW({namespace:t.namespace})}async function VW(e,{gatewayUrls:t,record:r}){return/eip155:/i.test(r)?GW(e,{gatewayUrls:t,record:r}):WS({uri:r,gatewayUrls:t})}async function GW(e,{gatewayUrls:t,record:r}){const n=WW(r),o=await HW(e,{nft:n}),{uri:i,isOnChain:a,isEncoded:s}=Z8({uri:o,gatewayUrls:t});if(a&&(i.includes("data:application/json;base64,")||i.startsWith("{"))){const u=s?atob(i.replace("data:application/json;base64,","")):i,c=JSON.parse(u);return WS({uri:Y8(c),gatewayUrls:t})}let l=n.tokenID;return n.namespace==="erc1155"&&(l=l.replace("0x","").padStart(64,"0")),UW({gatewayUrls:t,uri:i.replace(/(?:0x)?{id}/,l)})}async function X8(e,t){const{blockNumber:r,blockTag:n,key:o,name:i,gatewayUrls:a,strict:s}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Vu({blockNumber:r,chain:l,contract:"ensUniversalResolver"})})(),c=l==null?void 0:l.ensTlds;if(c&&!c.some(d=>i.endsWith(d)))return null;try{const d={address:u,abi:$8,args:[$o(FS(i)),gn({abi:rP,functionName:"text",args:[Cw(i),o]}),a??[cy]],functionName:"resolveWithGateways",blockNumber:r,blockTag:n},p=await Se(e,Mo,"readContract")(d);if(p[0]==="0x")return null;const h=Hl({abi:rP,functionName:"text",data:p[0]});return h===""?null:h}catch(d){if(s)throw d;if(zS(d))return null;throw d}}async function qW(e,{blockNumber:t,blockTag:r,assetGatewayUrls:n,name:o,gatewayUrls:i,strict:a,universalResolverAddress:s}){const l=await Se(e,X8,"getEnsText")({blockNumber:t,blockTag:r,key:"avatar",name:o,universalResolverAddress:s,gatewayUrls:i,strict:a});if(!l)return null;try{return await VW(e,{record:l,gatewayUrls:n})}catch{return null}}async function KW(e,t){const{address:r,blockNumber:n,blockTag:o,coinType:i=60n,gatewayUrls:a,strict:s}=t,{chain:l}=e,u=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!l)throw new Error("client chain not configured. universalResolverAddress is required.");return Vu({blockNumber:n,chain:l,contract:"ensUniversalResolver"})})();try{const c={address:u,abi:lW,args:[r,i,a??[cy]],functionName:"reverseWithGateways",blockNumber:n,blockTag:o},d=Se(e,Mo,"readContract"),[f]=await d(c);return f||null}catch(c){if(s)throw c;if(zS(c))return null;throw c}}async function ZW(e,t){const{blockNumber:r,blockTag:n,name:o}=t,{chain:i}=e,a=(()=>{if(t.universalResolverAddress)return t.universalResolverAddress;if(!i)throw new Error("client chain not configured. universalResolverAddress is required.");return Vu({blockNumber:r,chain:i,contract:"ensUniversalResolver"})})(),s=i==null?void 0:i.ensTlds;if(s&&!s.some(u=>o.endsWith(u)))throw new Error(`${o} is not a valid ENS TLD (${s==null?void 0:s.join(", ")}) for chain "${i.name}" (id: ${i.id}).`);const[l]=await Se(e,Mo,"readContract")({address:a,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[$o(FS(o))],blockNumber:r,blockTag:n});return l}async function Q8(e,t){var g,y,w;const{account:r=e.account,blockNumber:n,blockTag:o="latest",blobs:i,data:a,gas:s,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:c,maxPriorityFeePerGas:d,to:f,value:p,...h}=t,m=r?Rt(r):void 0;try{va(t);const x=(typeof n=="bigint"?je(n):void 0)||o,P=(w=(y=(g=e.chain)==null?void 0:g.formatters)==null?void 0:y.transactionRequest)==null?void 0:w.format,T=(P||Cs)({...Wu(h,{format:P}),account:m,blobs:i,data:a,gas:s,gasPrice:l,maxFeePerBlobGas:u,maxFeePerGas:c,maxPriorityFeePerGas:d,to:f,value:p},"createAccessList"),I=await e.request({method:"eth_createAccessList",params:[T,x]});return{accessList:I.accessList,gasUsed:BigInt(I.gasUsed)}}catch(S){throw N8(S,{...t,account:m,chain:e.chain})}}async function YW(e){const t=Xg(e,{method:"eth_newBlockFilter"}),r=await e.request({method:"eth_newBlockFilter"});return{id:r,request:t(r),type:"block"}}async function J8(e,{address:t,args:r,event:n,events:o,fromBlock:i,strict:a,toBlock:s}={}){const l=o??(n?[n]:void 0),u=Xg(e,{method:"eth_newFilter"});let c=[];l&&(c=[l.flatMap(p=>Dp({abi:[p],eventName:p.name,args:r}))],n&&(c=c[0]));const d=await e.request({method:"eth_newFilter",params:[{address:t,fromBlock:typeof i=="bigint"?je(i):i,toBlock:typeof s=="bigint"?je(s):s,...c.length?{topics:c}:{}}]});return{abi:l,args:r,eventName:n?n.name:void 0,fromBlock:i,id:d,request:u(d),strict:!!a,toBlock:s,type:"event"}}async function eR(e){const t=Xg(e,{method:"eth_newPendingTransactionFilter"}),r=await e.request({method:"eth_newPendingTransactionFilter"});return{id:r,request:t(r),type:"transaction"}}async function XW(e,{address:t,blockNumber:r,blockTag:n=e.experimental_blockTag??"latest"}){const o=typeof r=="bigint"?je(r):void 0,i=await e.request({method:"eth_getBalance",params:[t,o||n]});return BigInt(i)}async function QW(e){const t=await e.request({method:"eth_blobBaseFee"});return BigInt(t)}async function JW(e,{blockHash:t,blockNumber:r,blockTag:n="latest"}={}){const o=r!==void 0?je(r):void 0;let i;return t?i=await e.request({method:"eth_getBlockTransactionCountByHash",params:[t]},{dedupe:!0}):i=await e.request({method:"eth_getBlockTransactionCountByNumber",params:[o||n]},{dedupe:!!o}),_o(i)}async function Ew(e,{address:t,blockNumber:r,blockTag:n="latest"}){const o=r!==void 0?je(r):void 0,i=await e.request({method:"eth_getCode",params:[t,o||n]},{dedupe:!!o});if(i!=="0x")return i}class eH extends le{constructor({address:t}){super(`No EIP-712 domain found on contract "${t}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${t}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function tH(e,t){const{address:r,factory:n,factoryData:o}=t;try{const[i,a,s,l,u,c,d]=await Se(e,Mo,"readContract")({abi:rH,address:r,functionName:"eip712Domain",factory:n,factoryData:o});return{domain:{name:a,version:s,chainId:Number(l),verifyingContract:u,salt:c},extensions:d,fields:i}}catch(i){const a=i;throw a.name==="ContractFunctionExecutionError"&&a.cause.name==="ContractFunctionZeroDataError"?new eH({address:r}):a}}const rH=[{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"}];function nH(e){var t;return{baseFeePerGas:e.baseFeePerGas.map(r=>BigInt(r)),gasUsedRatio:e.gasUsedRatio,oldestBlock:BigInt(e.oldestBlock),reward:(t=e.reward)==null?void 0:t.map(r=>r.map(n=>BigInt(n)))}}async function oH(e,{blockCount:t,blockNumber:r,blockTag:n="latest",rewardPercentiles:o}){const i=typeof r=="bigint"?je(r):void 0,a=await e.request({method:"eth_feeHistory",params:[je(t),i||n,o]},{dedupe:!!i});return nH(a)}async function iH(e,{filter:t}){const r=t.strict??!1,o=(await t.request({method:"eth_getFilterLogs",params:[t.id]})).map(i=>Ji(i));return t.abi?RS({abi:t.abi,logs:o,strict:r}):o}async function aH({address:e,authorization:t,signature:r}){return Hu(Bp(e),await ey({authorization:t,signature:r}))}const $h=new Fu(8192);function sH(e,{enabled:t=!0,id:r}){if(!t||!r)return e();if($h.get(r))return $h.get(r);const n=e().finally(()=>$h.delete(r));return $h.set(r,n),n}function lH(e,t={}){return async(r,n={})=>{var d;const{dedupe:o=!1,methods:i,retryDelay:a=150,retryCount:s=3,uid:l}={...t,...n},{method:u}=r;if((d=i==null?void 0:i.exclude)!=null&&d.includes(u))throw new Js(new Error("method not supported"),{method:u});if(i!=null&&i.include&&!i.include.includes(u))throw new Js(new Error("method not supported"),{method:u});const c=o?tu(`${l}.${cr(r)}`):void 0;return sH(()=>im(async()=>{try{return await e(r)}catch(f){const p=f;switch(p.code){case bf.code:throw new bf(p);case wf.code:throw new wf(p);case xf.code:throw new xf(p,{method:r.method});case Sf.code:throw new Sf(p);case El.code:throw new El(p);case ds.code:throw new ds(p);case Cf.code:throw new Cf(p);case Ef.code:throw new Ef(p);case Pf.code:throw new Pf(p);case Js.code:throw new Js(p,{method:r.method});case iu.code:throw new iu(p);case Af.code:throw new Af(p);case Bc.code:throw new Bc(p);case kf.code:throw new kf(p);case Tf.code:throw new Tf(p);case If.code:throw new If(p);case Of.code:throw new Of(p);case _f.code:throw new _f(p);case au.code:throw new au(p);case $f.code:throw new $f(p);case Rf.code:throw new Rf(p);case jf.code:throw new jf(p);case Mf.code:throw new Mf(p);case Nf.code:throw new Nf(p);case su.code:throw new su(p);case 5e3:throw new Bc(p);default:throw f instanceof le?f:new X7(p)}}},{delay:({count:f,error:p})=>{var h;if(p&&p instanceof Jd){const m=(h=p==null?void 0:p.headers)==null?void 0:h.get("Retry-After");if(m!=null&&m.match(/\d/))return Number.parseInt(m,10)*1e3}return~~(1<cH(f)}),{enabled:o,id:c})}}function cH(e){return"code"in e&&typeof e.code=="number"?e.code===-1||e.code===iu.code||e.code===El.code:e instanceof Jd&&e.status?e.status===403||e.status===408||e.status===413||e.status===429||e.status===500||e.status===502||e.status===503||e.status===504:!0}function tR(e){const t={formatters:void 0,fees:void 0,serializers:void 0,...e};function r(n){return o=>{const i=typeof o=="function"?o(n):o,a={...n,...i};return Object.assign(a,{extend:r(a)})}}return Object.assign(t,{extend:r(t)})}function uH(e,{errorInstance:t=new Error("timed out"),timeout:r,signal:n}){return new Promise((o,i)=>{(async()=>{let a;try{const s=new AbortController;r>0&&(a=setTimeout(()=>{n&&s.abort()},r)),o(await e({signal:(s==null?void 0:s.signal)||null}))}catch(s){(s==null?void 0:s.name)==="AbortError"&&i(t),i(s)}finally{clearTimeout(a)}})()})}function dH(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const lP=dH();function fH(e,t={}){const{url:r,headers:n}=pH(e);return{async request(o){var h;const{body:i,fetchFn:a=t.fetchFn??fetch,onRequest:s=t.onRequest,onResponse:l=t.onResponse,timeout:u=t.timeout??1e4}=o,c={...t.fetchOptions??{},...o.fetchOptions??{}},{headers:d,method:f,signal:p}=c;try{const m=await uH(async({signal:y})=>{const w={...c,body:Array.isArray(i)?cr(i.map(A=>({jsonrpc:"2.0",id:A.id??lP.take(),...A}))):cr({jsonrpc:"2.0",id:i.id??lP.take(),...i}),headers:{...n,"Content-Type":"application/json",...d},method:f||"POST",signal:p||(u>0?y:null)},S=new Request(r,w),x=await(s==null?void 0:s(S,w))??{...w,url:r};return await a(x.url??r,x)},{errorInstance:new VE({body:i,url:r}),timeout:u,signal:!0});l&&await l(m);let g;if((h=m.headers.get("Content-Type"))!=null&&h.startsWith("application/json"))g=await m.json();else{g=await m.text();try{g=JSON.parse(g||"{}")}catch(y){if(m.ok)throw y;g={error:g}}}if(!m.ok)throw new Jd({body:i,details:cr(g.error)||m.statusText,headers:m.headers,status:m.status,url:r});return g}catch(m){throw m instanceof Jd||m instanceof VE?m:new Jd({body:i,cause:m,url:r})}}}}function pH(e){try{const t=new URL(e),r=(()=>{if(t.username){const n=`${decodeURIComponent(t.username)}:${decodeURIComponent(t.password)}`;return t.username="",t.password="",{url:t.toString(),headers:{Authorization:`Basic ${btoa(n)}`}}}})();return{url:t.toString(),...r}}catch{return{url:e}}}const hH=`Ethereum Signed Message: +`;function mH(e){const t=typeof e=="string"?tu(e):typeof e.raw=="string"?e.raw:ur(e.raw),r=tu(`${hH}${Gt(t)}`);return Lr([r,t])}function HS(e,t){return kr(mH(e),t)}class gH extends le{constructor({domain:t}){super(`Invalid domain "${cr(t)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class yH extends le{constructor({primaryType:t,types:r}){super(`Invalid primary type \`${t}\` must be one of \`${JSON.stringify(Object.keys(r))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class vH extends le{constructor({type:t}){super(`Struct type "${t}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function bH(e){const{domain:t,message:r,primaryType:n,types:o}=e,i=(l,u)=>{const c={...u};for(const d of l){const{name:f,type:p}=d;p==="address"&&(c[f]=c[f].toLowerCase())}return c},a=o.EIP712Domain?t?i(o.EIP712Domain,t):{}:{},s=(()=>{if(n!=="EIP712Domain")return i(o[n],r)})();return cr({domain:a,message:s,primaryType:n,types:o})}function rR(e){const{domain:t,message:r,primaryType:n,types:o}=e,i=(a,s)=>{for(const l of a){const{name:u,type:c}=l,d=s[u],f=c.match(q$);if(f&&(typeof d=="number"||typeof d=="bigint")){const[m,g,y]=f;je(d,{signed:g==="int",size:Number.parseInt(y,10)/8})}if(c==="address"&&typeof d=="string"&&!io(d))throw new us({address:d});const p=c.match(h7);if(p){const[m,g]=p;if(g&&Gt(d)!==Number.parseInt(g,10))throw new CF({expectedSize:Number.parseInt(g,10),givenSize:Gt(d)})}const h=o[c];h&&(wH(c),i(h,d))}};if(o.EIP712Domain&&t){if(typeof t!="object")throw new gH({domain:t});i(o.EIP712Domain,t)}if(n!=="EIP712Domain")if(o[n])i(o[n],r);else throw new yH({primaryType:n,types:o})}function VS({domain:e}){return[typeof(e==null?void 0:e.name)=="string"&&{name:"name",type:"string"},(e==null?void 0:e.version)&&{name:"version",type:"string"},(typeof(e==null?void 0:e.chainId)=="number"||typeof(e==null?void 0:e.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(e==null?void 0:e.verifyingContract)&&{name:"verifyingContract",type:"address"},(e==null?void 0:e.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function ASe({domain:e}){return nR({domain:e,types:{EIP712Domain:VS({domain:e})}})}function wH(e){if(e==="address"||e==="bool"||e==="string"||e.startsWith("bytes")||e.startsWith("uint")||e.startsWith("int"))throw new vH({type:e})}function xH(e){const{domain:t={},message:r,primaryType:n}=e,o={EIP712Domain:VS({domain:t}),...e.types};rR({domain:t,message:r,primaryType:n,types:o});const i=["0x1901"];return t&&i.push(nR({domain:t,types:o})),n!=="EIP712Domain"&&i.push(oR({data:r,primaryType:n,types:o})),kr(Lr(i))}function nR({domain:e,types:t}){return oR({data:e,primaryType:"EIP712Domain",types:t})}function oR({data:e,primaryType:t,types:r}){const n=iR({data:e,primaryType:t,types:r});return kr(n)}function iR({data:e,primaryType:t,types:r}){const n=[{type:"bytes32"}],o=[SH({primaryType:t,types:r})];for(const i of r[t]){const[a,s]=sR({types:r,name:i.name,type:i.type,value:e[i.name]});n.push(a),o.push(s)}return Ss(n,o)}function SH({primaryType:e,types:t}){const r=$o(CH({primaryType:e,types:t}));return kr(r)}function CH({primaryType:e,types:t}){let r="";const n=aR({primaryType:e,types:t});n.delete(e);const o=[e,...Array.from(n).sort()];for(const i of o)r+=`${i}(${t[i].map(({name:a,type:s})=>`${s} ${a}`).join(",")})`;return r}function aR({primaryType:e,types:t},r=new Set){const n=e.match(/^\w*/u),o=n==null?void 0:n[0];if(r.has(o)||t[o]===void 0)return r;r.add(o);for(const i of t[o])aR({primaryType:i.type,types:t},r);return r}function sR({types:e,name:t,type:r,value:n}){if(e[r]!==void 0)return[{type:"bytes32"},kr(iR({data:n,primaryType:r,types:e}))];if(r==="bytes")return[{type:"bytes32"},kr(n)];if(r==="string")return[{type:"bytes32"},kr($o(n))];if(r.lastIndexOf("]")===r.length-1){const o=r.slice(0,r.lastIndexOf("[")),i=n.map(a=>sR({name:t,type:o,types:e,value:a}));return[{type:"bytes32"},kr(Ss(i.map(([a])=>a),i.map(([,a])=>a)))]}return[{type:r},n]}class EH extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){const r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){const n=this.keys().next().value;n&&this.delete(n)}return this}}const PH={checksum:new EH(8192)},Ib=PH.checksum;function lR(e,t={}){const{as:r=typeof e=="string"?"Hex":"Bytes"}=t,n=U$(UU(e));return r==="Bytes"?n:jo(n)}const AH=/^0x[a-fA-F0-9]{40}$/;function uy(e,t={}){const{strict:r=!0}=t;if(!AH.test(e))throw new cP({address:e,cause:new kH});if(r){if(e.toLowerCase()===e)return;if(cR(e)!==e)throw new cP({address:e,cause:new TH})}}function cR(e){if(Ib.has(e))return Ib.get(e);uy(e,{strict:!1});const t=e.substring(2).toLowerCase(),r=lR(HU(t),{as:"Bytes"}),n=t.split("");for(let i=0;i<40;i+=2)r[i>>1]>>4>=8&&n[i]&&(n[i]=n[i].toUpperCase()),(r[i>>1]&15)>=8&&n[i+1]&&(n[i+1]=n[i+1].toUpperCase());const o=`0x${n.join("")}`;return Ib.set(e,o),o}function Pw(e,t={}){const{strict:r=!0}=t??{};try{return uy(e,{strict:r}),!0}catch{return!1}}class cP extends Le{constructor({address:t,cause:r}){super(`Address "${t}" is invalid.`,{cause:r}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class kH extends Le{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class TH extends Le{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const IH=/^(.*)\[([0-9]*)\]$/,OH=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,uR=/^(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)?$/,uP=2n**256n-1n;function Lc(e,t,r){const{checksumAddress:n,staticPosition:o}=r,i=KS(t.type);if(i){const[a,s]=i;return $H(e,{...t,type:s},{checksumAddress:n,length:a,staticPosition:o})}if(t.type==="tuple")return NH(e,t,{checksumAddress:n,staticPosition:o});if(t.type==="address")return _H(e,{checksum:n});if(t.type==="bool")return RH(e);if(t.type.startsWith("bytes"))return jH(e,t,{staticPosition:o});if(t.type.startsWith("uint")||t.type.startsWith("int"))return MH(e,t);if(t.type==="string")return BH(e,{staticPosition:o});throw new YS(t.type)}const dP=32,Aw=32;function _H(e,t={}){const{checksum:r=!1}=t,n=e.readBytes(32);return[(i=>r?cR(i):i)(jo(GU(n,-20))),32]}function $H(e,t,r){const{checksumAddress:n,length:o,staticPosition:i}=r;if(!o){const l=Zi(e.readBytes(Aw)),u=i+l,c=u+dP;e.setPosition(u);const d=Zi(e.readBytes(dP)),f=Df(t);let p=0;const h=[];for(let m=0;m48?qU(o,{signed:r}):Zi(o,{signed:r}),32]}function NH(e,t,r){const{checksumAddress:n,staticPosition:o}=r,i=t.components.length===0||t.components.some(({name:l})=>!l),a=i?[]:{};let s=0;if(Df(t)){const l=Zi(e.readBytes(Aw)),u=o+l;for(let c=0;c0?Ro(u,l):u}}if(a)return{dynamic:!0,encoded:l}}return{dynamic:!1,encoded:Ro(...s.map(({encoded:l})=>l))}}function FH(e,{type:t}){const[,r]=t.split("bytes"),n=On(e);if(!r){let o=e;return n%32!==0&&(o=kl(o,Math.ceil((e.length-2)/2/32)*32)),{dynamic:!0,encoded:Ro(Al(Ur(n,{size:32})),o)}}if(n!==Number.parseInt(r,10))throw new fR({expectedSize:Number.parseInt(r,10),value:e});return{dynamic:!1,encoded:kl(e)}}function UH(e){if(typeof e!="boolean")throw new Le(`Invalid boolean value: "${e}" (type: ${typeof e}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:Al(P8(e))}}function WH(e,{signed:t,size:r}){if(typeof r=="number"){const n=2n**(BigInt(r)-(t?1n:0n))-1n,o=t?-n-1n:0n;if(e>n||ea))}}function KS(e){const t=e.match(/^(.*)\[(\d+)?\]$/);return t?[t[2]?Number(t[2]):null,t[1]]:void 0}function Df(e){var n;const{type:t}=e;if(t==="string"||t==="bytes"||t.endsWith("[]"))return!0;if(t==="tuple")return(n=e.components)==null?void 0:n.some(Df);const r=KS(e.type);return!!(r&&Df({...e,type:r[1]}))}const GH={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 ZH({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(e){if(e<0||e>this.bytes.length-1)throw new KH({length:this.bytes.length,position:e})},decrementPosition(e){if(e<0)throw new fP({offset:e});const 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 fP({offset:e});const t=this.position+e;this.assertPosition(t),this.position=t},inspectByte(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectBytes(e,t){const r=t??this.position;return this.assertPosition(r+e-1),this.bytes.subarray(r,r+e)},inspectUint8(e){const t=e??this.position;return this.assertPosition(t),this.bytes[t]},inspectUint16(e){const t=e??this.position;return this.assertPosition(t+1),this.dataView.getUint16(t)},inspectUint24(e){const t=e??this.position;return this.assertPosition(t+2),(this.dataView.getUint16(t)<<8)+this.dataView.getUint8(t+2)},inspectUint32(e){const 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,e&255),this.position+=3},pushUint32(e){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,e),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const e=this.inspectByte();return this.position++,e},readBytes(e,t){this.assertReadLimit(),this._touch();const r=this.inspectBytes(e);return this.position+=t??e,r},readUint8(){this.assertReadLimit(),this._touch();const e=this.inspectUint8();return this.position+=1,e},readUint16(){this.assertReadLimit(),this._touch();const e=this.inspectUint16();return this.position+=2,e},readUint24(){this.assertReadLimit(),this._touch();const e=this.inspectUint24();return this.position+=3,e},readUint32(){this.assertReadLimit(),this._touch();const e=this.inspectUint32();return this.position+=4,e},get remaining(){return this.bytes.length-this.position},setPosition(e){const t=this.position;return this.assertPosition(e),this.position=e,()=>this.position=t},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const e=this.getReadCount();this.positionReadCount.set(this.position,e+1),e>0&&this.recursiveReadCount++}};function qH(e,{recursiveReadLimit:t=8192}={}){const r=Object.create(GH);return r.bytes=e,r.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength),r.positionReadCount=new Map,r.recursiveReadLimit=t,r}class fP extends Le{constructor({offset:t}){super(`Offset \`${t}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class KH extends Le{constructor({length:t,position:r}){super(`Position \`${r}\` is out of bounds (\`0 < position < ${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class ZH extends Le{constructor({count:t,limit:r}){super(`Recursive read limit of \`${r}\` exceeded (recursive read count: \`${t}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function YH(e,t,r={}){const{as:n="Array",checksumAddress:o=!1}=r,i=typeof t=="string"?C8(t):t,a=qH(i);if(yc(i)===0&&e.length>0)throw new QH;if(yc(i)&&yc(i)<32)throw new XH({data:typeof t=="string"?t:jo(t),parameters:e,size:yc(i)});let s=0;const l=n==="Array"?[]:{};for(let u=0;uo?t.create().update(n).digest():n);for(let a=0;anew hR(e,t).update(r).digest();mR.create=(e,t)=>new hR(e,t);function gR(e,t={}){const{recovered:r}=t;if(typeof e.r>"u")throw new Ob({signature:e});if(typeof e.s>"u")throw new Ob({signature:e});if(r&&typeof e.yParity>"u")throw new Ob({signature:e});if(e.r<0n||e.r>uP)throw new sV({value:e.r});if(e.s<0n||e.s>uP)throw new lV({value:e.s});if(typeof e.yParity=="number"&&e.yParity!==0&&e.yParity!==1)throw new QS({value:e.yParity})}function tV(e){return yR(jo(e))}function yR(e){if(e.length!==130&&e.length!==132)throw new aV({signature:e});const t=BigInt(gi(e,0,32)),r=BigInt(gi(e,32,64)),n=(()=>{const o=+`0x${e.slice(130)}`;if(!Number.isNaN(o))try{return XS(o)}catch{throw new QS({value:o})}})();return typeof n>"u"?{r:t,s:r}:{r:t,s:r,yParity:n}}function rV(e){if(!(typeof e.r>"u")&&!(typeof e.s>"u"))return nV(e)}function nV(e){const t=typeof e=="string"?yR(e):e instanceof Uint8Array?tV(e):typeof e.r=="string"?iV(e):e.v?oV(e):{r:e.r,s:e.s,...typeof e.yParity<"u"?{yParity:e.yParity}:{}};return gR(t),t}function oV(e){return{r:e.r,s:e.s,yParity:XS(e.v)}}function iV(e){const t=(()=>{const r=e.v?Number(e.v):void 0;let n=e.yParity?Number(e.yParity):void 0;if(typeof r=="number"&&typeof n!="number"&&(n=XS(r)),typeof n!="number")throw new QS({value:e.yParity});return n})();return{r:BigInt(e.r),s:BigInt(e.s),yParity:t}}function XS(e){if(e===0||e===27)return 0;if(e===1||e===28)return 1;if(e>=35)return e%2===0?1:0;throw new cV({value:e})}class aV extends Le{constructor({signature:t}){super(`Value \`${t}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${On(nW(t))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class Ob extends Le{constructor({signature:t}){super(`Signature \`${S8(t)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class sV extends Le{constructor({value:t}){super(`Value \`${t}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class lV extends Le{constructor({value:t}){super(`Value \`${t}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class QS extends Le{constructor({value:t}){super(`Value \`${t}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class cV extends Le{constructor({value:t}){super(`Value \`${t}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function uV(e,t={}){return typeof e.chainId=="string"?dV(e):{...e,...t.signature}}function dV(e){const{address:t,chainId:r,nonce:n}=e,o=rV(e);return{address:t,chainId:Number(r),nonce:BigInt(n),...o}}const fV="0x8010801080108010801080108010801080108010801080108010801080108010",pV=dR("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function vR(e){if(typeof e=="string"){if(gi(e,-32)!==fV)throw new gV(e)}else gR(e.authorization)}function hV(e){vR(e);const t=k8(gi(e,-64,-32)),r=gi(e,-t-64,-64),n=gi(e,0,-t-64),[o,i,a]=YH(pV,r);return{authorization:uV({address:o.delegation,chainId:Number(o.chainId),nonce:o.nonce,yParity:o.yParity,r:o.r,s:o.s}),signature:n,...a&&a!=="0x"?{data:a,to:i}:{}}}function mV(e){try{return vR(e),!0}catch{return!1}}let gV=class extends Le{constructor(t){super(`Value \`${t}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};async function yV({message:e,signature:t}){return CS({hash:HS(e),signature:t})}async function vV({address:e,message:t,signature:r}){return Hu(Bp(e),await yV({message:t,signature:r}))}function bV(e){return e.map(t=>({...t,value:BigInt(t.value)}))}function wV(e){return{...e,balance:e.balance?BigInt(e.balance):void 0,nonce:e.nonce?_o(e.nonce):void 0,storageProof:e.storageProof?bV(e.storageProof):void 0}}async function xV(e,{address:t,blockNumber:r,blockTag:n,storageKeys:o}){const i=n??"latest",a=r!==void 0?je(r):void 0,s=await e.request({method:"eth_getProof",params:[t,o,a||i]});return wV(s)}async function SV(e,{address:t,blockNumber:r,blockTag:n="latest",slot:o}){const i=r!==void 0?je(r):void 0;return await e.request({method:"eth_getStorageAt",params:[t,o,i||n]})}async function JS(e,{blockHash:t,blockNumber:r,blockTag:n,hash:o,index:i,sender:a,nonce:s}){var f,p,h;const l=n||"latest",u=r!==void 0?je(r):void 0;let c=null;if(o?c=await e.request({method:"eth_getTransactionByHash",params:[o]},{dedupe:!0}):t?c=await e.request({method:"eth_getTransactionByBlockHashAndIndex",params:[t,je(i)]},{dedupe:!0}):typeof i=="number"?c=await e.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[u||l,je(i)]},{dedupe:!!u}):a&&typeof s=="number"&&(c=await e.request({method:"eth_getTransactionBySenderAndNonce",params:[a,je(s)]},{dedupe:!0})),!c)throw new e8({blockHash:t,blockNumber:r,blockTag:l,hash:o,index:i});return(((h=(p=(f=e.chain)==null?void 0:f.formatters)==null?void 0:p.transaction)==null?void 0:h.format)||AS)(c,"getTransaction")}async function CV(e,{hash:t,transactionReceipt:r}){const[n,o]=await Promise.all([Se(e,Vp,"getBlockNumber")({}),t?Se(e,JS,"getTransaction")({hash:t}):void 0]),i=(r==null?void 0:r.blockNumber)||(o==null?void 0:o.blockNumber);return i?n-i+1n:0n}async function T0(e,{hash:t}){var o,i,a;const r=await e.request({method:"eth_getTransactionReceipt",params:[t]},{dedupe:!0});if(!r)throw new t8({hash:t});return(((a=(i=(o=e.chain)==null?void 0:o.formatters)==null?void 0:i.transactionReceipt)==null?void 0:a.format)||z8)(r,"getTransactionReceipt")}async function EV(e,t){var w;const{account:r,authorizationList:n,allowFailure:o=!0,blockNumber:i,blockOverrides:a,blockTag:s,stateOverride:l}=t,u=t.contracts,{batchSize:c=t.batchSize??1024,deployless:d=t.deployless??!1}=typeof((w=e.batch)==null?void 0:w.multicall)=="object"?e.batch.multicall:{},f=(()=>{if(t.multicallAddress)return t.multicallAddress;if(d)return null;if(e.chain)return Vu({blockNumber:i,chain:e.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),p=[[]];let h=0,m=0;for(let S=0;S0&&m>c&&p[h].length>0&&(h++,m=(I.length-2)/2,p[h]=[]),p[h]=[...p[h],{allowFailure:!0,callData:I,target:P}]}catch(I){const O=Pl(I,{abi:x,address:P,args:A,docsPath:"/docs/contract/multicall",functionName:T,sender:r});if(!o)throw O;p[h]=[...p[h],{allowFailure:!0,callData:"0x",target:P}]}}const g=await Promise.allSettled(p.map(S=>Se(e,Mo,"readContract")({...f===null?{code:NS}:{address:f},abi:om,account:r,args:[S],authorizationList:n,blockNumber:i,blockOverrides:a,blockTag:s,functionName:"aggregate3",stateOverride:l}))),y=[];for(let S=0;S{const y=g,w=y.account?Rt(y.account):void 0,S=y.abi?gn(y):y.data,x={...y,account:w,data:y.dataSuffix?Lr([S||"0x",y.dataSuffix]):S,from:y.from??(w==null?void 0:w.address)};return va(x),Cs(x)}),m=f.stateOverrides?ES(f.stateOverrides):void 0;l.push({blockOverrides:p,calls:h,stateOverrides:m})}const c=(typeof r=="bigint"?je(r):void 0)||n;return(await e.request({method:"eth_simulateV1",params:[{blockStateCalls:l,returnFullTransactions:i,traceTransfers:a,validation:s},c]})).map((f,p)=>({...u8(f),calls:f.calls.map((h,m)=>{var _,R;const{abi:g,args:y,functionName:w,to:S}=o[p].calls[m],x=((_=h.error)==null?void 0:_.data)??h.returnData,P=BigInt(h.gasUsed),A=(R=h.logs)==null?void 0:R.map(E=>Ji(E)),T=h.status==="0x1"?"success":"failure",I=g&&T==="success"&&x!=="0x"?Hl({abi:g,data:x,functionName:w}):null,O=(()=>{if(T==="success")return;let E;if(x==="0x"?E=new Mp:x&&(E=new Jg({data:x})),!!E)return Pl(E,{abi:g??[],address:S??"0x",args:y,functionName:w??""})})();return{data:x,gasUsed:P,logs:A,status:T,...T==="success"?{result:I}:{error:O}}})}))}catch(l){const u=l,c=ty(u,{});throw c instanceof Up?u:c}}function Iw(e){let t=!0,r="",n=0,o="",i=!1;for(let a=0;aOw(Object.values(e)[i],o)):/^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(n)?r==="number"||r==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(n)?r==="string"||e instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(n)?Array.isArray(e)&&e.every(o=>Ow(o,{...t,type:n.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function bR(e,t,r){for(const n in e){const o=e[n],i=t[n];if(o.type==="tuple"&&i.type==="tuple"&&"components"in o&&"components"in i)return bR(o.components,i.components,r[n]);const a=[o.type,i.type];if(a.includes("address")&&a.includes("bytes20")?!0:a.includes("address")&&a.includes("string")?Pw(r[n],{strict:!1}):a.includes("address")&&a.includes("bytes")?Pw(r[n],{strict:!1}):!1)return a}}function wR(e,t={}){const{prepare:r=!0}=t,n=Array.isArray(e)||typeof e=="string"?TE(e):e;return{...n,...r?{hash:vc(n)}:{}}}function dy(e,t,r){const{args:n=[],prepare:o=!0}=r??{},i=oW(t,{strict:!1}),a=e.filter(u=>i?u.type==="function"||u.type==="error"?xR(u)===gi(t,0,4):u.type==="event"?vc(u)===t:!1:"name"in u&&u.name===t);if(a.length===0)throw new am({name:t});if(a.length===1)return{...a[0],...o?{hash:vc(a[0])}:{}};let s;for(const u of a){if(!("inputs"in u))continue;if(!n||n.length===0){if(!u.inputs||u.inputs.length===0)return{...u,...o?{hash:vc(u)}:{}};continue}if(!u.inputs||u.inputs.length===0||u.inputs.length!==n.length)continue;if(n.every((d,f)=>{const p="inputs"in u&&u.inputs[f];return p?Ow(d,p):!1})){if(s&&"inputs"in s&&s.inputs){const d=bR(u.inputs,s.inputs,n);if(d)throw new AV({abiItem:u,type:d[0]},{abiItem:s,type:d[1]})}s=u}}const l=(()=>{if(s)return s;const[u,...c]=a;return{...u,overloads:c}})();if(!l)throw new am({name:t});return{...l,...o?{hash:vc(l)}:{}}}function xR(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return dy(r,n)}return e[0]})();return gi(vc(t),0,4)}function PV(...e){const t=(()=>{if(Array.isArray(e[0])){const[n,o]=e;return dy(n,o)}return e[0]})(),r=typeof t=="string"?t:em(t);return Iw(r)}function vc(...e){const t=(()=>{if(Array.isArray(e[0])){const[r,n]=e;return dy(r,n)}return e[0]})();return typeof t!="string"&&"hash"in t&&t.hash?t.hash:lR(MS(PV(t)))}class AV extends Le{constructor(t,r){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${t.type}\` in \`${Iw(em(t.abiItem))}\`, and`,`\`${r.type}\` in \`${Iw(em(r.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:"AbiItem.AmbiguityError"})}}class am extends Le{constructor({name:t,data:r,type:n="item"}){const o=t?` with name "${t}"`:r?` with data "${r}"`:"";super(`ABI ${n}${o} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function kV(...e){var i;const[t,r]=(()=>{if(Array.isArray(e[0])){const[a,s]=e;return[IV(a),s]}return e})(),{bytecode:n,args:o}=r;return Ro(n,(i=t.inputs)!=null&&i.length&&(o!=null&&o.length)?ZS(t.inputs,o):"0x")}function TV(e){return wR(e)}function IV(e){const t=e.find(r=>r.type==="constructor");if(!t)throw new am({name:"constructor"});return t}function OV(...e){const[t,r=[]]=(()=>{if(Array.isArray(e[0])){const[u,c,d]=e;return[pP(u,c,{args:d}),d]}const[s,l]=e;return[s,l]})(),{overloads:n}=t,o=n?pP([t,...n],t.name,{args:r}):t,i=_V(o),a=r.length>0?ZS(o.inputs,r):void 0;return a?Ro(i,a):i}function ec(e,t={}){return wR(e,t)}function pP(e,t,r){const n=dy(e,t,r);if(n.type!=="function")throw new am({name:t,type:"function"});return n}function _V(e){return xR(e)}const $V="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",qo="0x0000000000000000000000000000000000000000",RV="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function jV(e,t){const{blockNumber:r,blockTag:n,calls:o,stateOverrides:i,traceAssetChanges:a,traceTransfers:s,validation:l}=t,u=t.account?Rt(t.account):void 0;if(a&&!u)throw new le("`account` is required when `traceAssetChanges` is true");const c=u?kV(TV("constructor(bytes, bytes)"),{bytecode:j8,args:[RV,OV(ec("function getBalance(address)"),[u.address])]}):void 0,d=a?await Promise.all(t.calls.map(async D=>{if(!D.data&&!D.abi)return;const{accessList:z}=await Q8(e,{account:u.address,...D,data:D.abi?gn(D):D.data});return z.map(({address:W,storageKeys:H})=>H.length>0?W:null)})).then(D=>D.flat().filter(Boolean)):[],f=await Tw(e,{blockNumber:r,blockTag:n,blocks:[...a?[{calls:[{data:c}],stateOverrides:i},{calls:d.map((D,z)=>({abi:[ec("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:D,from:qo,nonce:z})),stateOverrides:[{address:qo,nonce:0}]}]:[],{calls:[...o,{}].map(D=>({...D,from:u==null?void 0:u.address})),stateOverrides:i},...a?[{calls:[{data:c}]},{calls:d.map((D,z)=>({abi:[ec("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[u.address],to:D,from:qo,nonce:z})),stateOverrides:[{address:qo,nonce:0}]},{calls:d.map((D,z)=>({to:D,abi:[ec("function decimals() returns (uint256)")],functionName:"decimals",from:qo,nonce:z})),stateOverrides:[{address:qo,nonce:0}]},{calls:d.map((D,z)=>({to:D,abi:[ec("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:qo,nonce:z})),stateOverrides:[{address:qo,nonce:0}]},{calls:d.map((D,z)=>({to:D,abi:[ec("function symbol() returns (string)")],functionName:"symbol",from:qo,nonce:z})),stateOverrides:[{address:qo,nonce:0}]}]:[]],traceTransfers:s,validation:l}),p=a?f[2]:f[0],[h,m,,g,y,w,S,x]=a?f:[],{calls:P,...A}=p,T=P.slice(0,-1)??[],I=(h==null?void 0:h.calls)??[],O=(m==null?void 0:m.calls)??[],_=[...I,...O].map(D=>D.status==="success"?In(D.data):null),R=(g==null?void 0:g.calls)??[],E=(y==null?void 0:y.calls)??[],M=[...R,...E].map(D=>D.status==="success"?In(D.data):null),B=((w==null?void 0:w.calls)??[]).map(D=>D.status==="success"?D.result:null),j=((x==null?void 0:x.calls)??[]).map(D=>D.status==="success"?D.result:null),N=((S==null?void 0:S.calls)??[]).map(D=>D.status==="success"?D.result:null),F=[];for(const[D,z]of M.entries()){const W=_[D];if(typeof z!="bigint"||typeof W!="bigint")continue;const H=B[D-1],V=j[D-1],Q=N[D-1],re=D===0?{address:$V,decimals:18,symbol:"ETH"}:{address:d[D-1],decimals:Q||H?Number(H??1):void 0,symbol:V??void 0};F.some(Y=>Y.token.address===re.address)||F.push({token:re,value:{pre:W,post:z,diff:z-W}})}return{assetChanges:F,block:A,results:T}}const SR="0x6492649264926492649264926492649264926492649264926492649264926492";function MV(e){if(gi(e,-32)!==SR)throw new LV(e)}function NV(e){const{data:t,signature:r,to:n}=e;return Ro(ZS(dR("address, bytes, bytes"),[n,t,r]),SR)}function BV(e){try{return MV(e),!0}catch{return!1}}class LV extends Le{constructor(t){super(`Value \`${t}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const e5=BigInt(0),_w=BigInt(1);function Gp(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function t5(e){if(!Gp(e))throw new Error("Uint8Array expected")}function zf(e,t){if(typeof t!="boolean")throw new Error(e+" boolean expected, got "+t)}function Rh(e){const t=e.toString(16);return t.length&1?"0"+t:t}function CR(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);return e===""?e5:BigInt("0x"+e)}const ER=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",DV=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function Ff(e){if(t5(e),ER)return e.toHex();let t="";for(let r=0;r=Ri._0&&e<=Ri._9)return e-Ri._0;if(e>=Ri.A&&e<=Ri.F)return e-(Ri.A-10);if(e>=Ri.a&&e<=Ri.f)return e-(Ri.a-10)}function sm(e){if(typeof e!="string")throw new Error("hex string expected, got "+typeof e);if(ER)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const n=new Uint8Array(r);for(let o=0,i=0;otypeof e=="bigint"&&e5<=e;function r5(e,t,r){return _b(e)&&_b(t)&&_b(r)&&t<=e&&ee5;e>>=_w,t+=1);return t}const fy=e=>(_w<new Uint8Array(e),mP=e=>Uint8Array.from(e);function FV(e,t,r){if(typeof e!="number"||e<2)throw new Error("hashLen must be a number");if(typeof t!="number"||t<2)throw new Error("qByteLen must be a number");if(typeof r!="function")throw new Error("hmacFn must be a function");let n=$b(e),o=$b(e),i=0;const a=()=>{n.fill(1),o.fill(0),i=0},s=(...d)=>r(o,n,...d),l=(d=$b(0))=>{o=s(mP([0]),d),n=s(),d.length!==0&&(o=s(mP([1]),d),n=s())},u=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let d=0;const f=[];for(;d{a(),l(d);let p;for(;!(p=f(u()));)l();return a(),p}}const UV={bigint:e=>typeof e=="bigint",function:e=>typeof e=="function",boolean:e=>typeof e=="boolean",string:e=>typeof e=="string",stringOrUint8Array:e=>typeof e=="string"||Gp(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>typeof e=="function"&&Number.isSafeInteger(e.outputLen)};function py(e,t,r={}){const n=(o,i,a)=>{const s=UV[i];if(typeof s!="function")throw new Error("invalid validator function");const l=e[o];if(!(a&&l===void 0)&&!s(l,e))throw new Error("param "+String(o)+" is invalid. Expected "+i+", got "+l)};for(const[o,i]of Object.entries(t))n(o,i,!1);for(const[o,i]of Object.entries(r))n(o,i,!0);return e}function gP(e){const t=new WeakMap;return(r,...n)=>{const o=t.get(r);if(o!==void 0)return o;const i=e(r,...n);return t.set(r,i),i}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const rn=BigInt(0),Vr=BigInt(1),el=BigInt(2),WV=BigInt(3),kR=BigInt(4),TR=BigInt(5),IR=BigInt(8);function Jr(e,t){const r=e%t;return r>=rn?r:t+r}function Fn(e,t,r){let n=e;for(;t-- >rn;)n*=n,n%=r;return n}function $w(e,t){if(e===rn)throw new Error("invert: expected non-zero number");if(t<=rn)throw new Error("invert: expected positive modulus, got "+t);let r=Jr(e,t),n=t,o=rn,i=Vr;for(;r!==rn;){const s=n/r,l=n%r,u=o-i*s;n=r,r=l,o=i,i=u}if(n!==Vr)throw new Error("invert: does not exist");return Jr(o,t)}function OR(e,t){const r=(e.ORDER+Vr)/kR,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw new Error("Cannot find square root");return n}function HV(e,t){const r=(e.ORDER-TR)/IR,n=e.mul(t,el),o=e.pow(n,r),i=e.mul(t,o),a=e.mul(e.mul(i,el),o),s=e.mul(i,e.sub(a,e.ONE));if(!e.eql(e.sqr(s),t))throw new Error("Cannot find square root");return s}function VV(e){if(e1e3)throw new Error("Cannot find square root: probably non-prime P");if(r===1)return OR;let i=o.pow(n,t);const a=(t+Vr)/el;return function(l,u){if(l.is0(u))return u;if(yP(l,u)!==1)throw new Error("Cannot find square root");let c=r,d=l.mul(l.ONE,i),f=l.pow(u,t),p=l.pow(u,a);for(;!l.eql(f,l.ONE);){if(l.is0(f))return l.ZERO;let h=1,m=l.sqr(f);for(;!l.eql(m,l.ONE);)if(h++,m=l.sqr(m),h===c)throw new Error("Cannot find square root");const g=Vr<(n[o]="function",n),t);return py(e,r)}function ZV(e,t,r){if(rrn;)r&Vr&&(n=e.mul(n,o)),o=e.sqr(o),r>>=Vr;return n}function _R(e,t,r=!1){const n=new Array(t.length).fill(r?e.ZERO:void 0),o=t.reduce((a,s,l)=>e.is0(s)?a:(n[l]=a,e.mul(a,s)),e.ONE),i=e.inv(o);return t.reduceRight((a,s,l)=>e.is0(s)?a:(n[l]=e.mul(a,n[l]),e.mul(a,s)),i),n}function yP(e,t){const r=(e.ORDER-Vr)/el,n=e.pow(t,r),o=e.eql(n,e.ONE),i=e.eql(n,e.ZERO),a=e.eql(n,e.neg(e.ONE));if(!o&&!i&&!a)throw new Error("invalid Legendre symbol result");return o?1:i?0:-1}function $R(e,t){t!==void 0&&yf(t);const r=t!==void 0?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function n5(e,t,r=!1,n={}){if(e<=rn)throw new Error("invalid field: expected ORDER > 0, got "+e);const{nBitLength:o,nByteLength:i}=$R(e,t);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let a;const s=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:i,MASK:fy(o),ZERO:rn,ONE:Vr,create:l=>Jr(l,e),isValid:l=>{if(typeof l!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof l);return rn<=l&&ll===rn,isOdd:l=>(l&Vr)===Vr,neg:l=>Jr(-l,e),eql:(l,u)=>l===u,sqr:l=>Jr(l*l,e),add:(l,u)=>Jr(l+u,e),sub:(l,u)=>Jr(l-u,e),mul:(l,u)=>Jr(l*u,e),pow:(l,u)=>ZV(s,l,u),div:(l,u)=>Jr(l*$w(u,e),e),sqrN:l=>l*l,addN:(l,u)=>l+u,subN:(l,u)=>l-u,mulN:(l,u)=>l*u,inv:l=>$w(l,e),sqrt:n.sqrt||(l=>(a||(a=GV(e)),a(s,l))),toBytes:l=>r?AR(l,i):qp(l,i),fromBytes:l=>{if(l.length!==i)throw new Error("Field.fromBytes: expected "+i+" bytes, got "+l.length);return r?PR(l):ml(l)},invertBatch:l=>_R(s,l),cmov:(l,u,c)=>c?u:l});return Object.freeze(s)}function RR(e){if(typeof e!="bigint")throw new Error("field order must be bigint");const t=e.toString(2).length;return Math.ceil(t/8)}function jR(e){const t=RR(e);return t+Math.ceil(t/2)}function YV(e,t,r=!1){const n=e.length,o=RR(t),i=jR(t);if(n<16||n1024)throw new Error("expected "+i+"-1024 bytes of input, got "+n);const a=r?PR(e):ml(e),s=Jr(a,t-Vr)+Vr;return r?AR(s,o):qp(s,o)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const vP=BigInt(0),Rw=BigInt(1);function Rb(e,t){const r=t.negate();return e?r:t}function MR(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw new Error("invalid window size, expected [1.."+t+"], got W="+e)}function jb(e,t){MR(e,t);const r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e,i=fy(e),a=BigInt(e);return{windows:r,windowSize:n,mask:i,maxNumber:o,shiftBy:a}}function bP(e,t,r){const{windowSize:n,mask:o,maxNumber:i,shiftBy:a}=r;let s=Number(e&o),l=e>>a;s>n&&(s-=i,l+=Rw);const u=t*n,c=u+Math.abs(s)-1,d=s===0,f=s<0,p=t%2!==0;return{nextN:l,offset:c,isZero:d,isNeg:f,isNegF:p,offsetF:u}}function XV(e,t){if(!Array.isArray(e))throw new Error("array expected");e.forEach((r,n)=>{if(!(r instanceof t))throw new Error("invalid point at index "+n)})}function QV(e,t){if(!Array.isArray(e))throw new Error("array of scalars expected");e.forEach((r,n)=>{if(!t.isValid(r))throw new Error("invalid scalar at index "+n)})}const Mb=new WeakMap,NR=new WeakMap;function Nb(e){return NR.get(e)||1}function JV(e,t){return{constTimeNegate:Rb,hasPrecomputes(r){return Nb(r)!==1},unsafeLadder(r,n,o=e.ZERO){let i=r;for(;n>vP;)n&Rw&&(o=o.add(i)),i=i.double(),n>>=Rw;return o},precomputeWindow(r,n){const{windows:o,windowSize:i}=jb(n,t),a=[];let s=r,l=s;for(let u=0;u12?l=s-3:s>4?l=s-2:s>0&&(l=2);const u=fy(l),c=new Array(Number(u)+1).fill(a),d=Math.floor((t.BITS-1)/l)*l;let f=a;for(let p=d;p>=0;p-=l){c.fill(a);for(let m=0;m>BigInt(p)&u);c[y]=c[y].add(r[m])}let h=a;for(let m=c.length-1,g=a;m>0;m--)g=g.add(c[m]),h=h.add(g);if(f=f.add(h),p!==0)for(let m=0;m{const{Err:r}=Li;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length&1)throw new r("tlv.encode: unpadded data");const n=t.length/2,o=Rh(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");const i=n>127?Rh(o.length/2|128):"";return Rh(e)+i+o+t},decode(e,t){const{Err:r}=Li;let n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");const o=t[n++],i=!!(o&128);let a=0;if(!i)a=o;else{const l=o&127;if(!l)throw new r("tlv.decode(long): indefinite length not supported");if(l>4)throw new r("tlv.decode(long): byte length is too big");const u=t.subarray(n,n+l);if(u.length!==l)throw new r("tlv.decode: length bytes not complete");if(u[0]===0)throw new r("tlv.decode(long): zero leftmost byte");for(const c of u)a=a<<8|c;if(n+=l,a<128)throw new r("tlv.decode(long): not minimal encoding")}const s=t.subarray(n,n+a);if(s.length!==a)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+a)}}},_int:{encode(e){const{Err:t}=Li;if(e{const A=x.toAffine();return lm(Uint8Array.from([4]),r.toBytes(A.x),r.toBytes(A.y))}),i=t.fromBytes||(S=>{const x=S.subarray(1),P=r.fromBytes(x.subarray(0,r.BYTES)),A=r.fromBytes(x.subarray(r.BYTES,2*r.BYTES));return{x:P,y:A}});function a(S){const{a:x,b:P}=t,A=r.sqr(S),T=r.mul(A,S);return r.add(r.add(T,r.mul(S,x)),P)}function s(S,x){const P=r.sqr(x),A=a(S);return r.eql(P,A)}if(!s(t.Gx,t.Gy))throw new Error("bad curve params: generator point");const l=r.mul(r.pow(t.a,Lb),nG),u=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(l,u)))throw new Error("bad curve params: a or b");function c(S){return r5(S,pr,t.n)}function d(S){const{allowedPrivateKeyLengths:x,nByteLength:P,wrapPrivateKey:A,n:T}=t;if(x&&typeof S!="bigint"){if(Gp(S)&&(S=Ff(S)),typeof S!="string"||!x.includes(S.length))throw new Error("invalid private key");S=S.padStart(P*2,"0")}let I;try{I=typeof S=="bigint"?S:ml(Gn("private key",S,P))}catch{throw new Error("invalid private key, expected hex or "+P+" bytes, got "+typeof S)}return A&&(I=Jr(I,T)),Dc("private key",I,pr,T),I}function f(S){if(!(S instanceof m))throw new Error("ProjectivePoint expected")}const p=gP((S,x)=>{const{px:P,py:A,pz:T}=S;if(r.eql(T,r.ONE))return{x:P,y:A};const I=S.is0();x==null&&(x=I?r.ONE:r.inv(T));const O=r.mul(P,x),_=r.mul(A,x),R=r.mul(T,x);if(I)return{x:r.ZERO,y:r.ZERO};if(!r.eql(R,r.ONE))throw new Error("invZ was invalid");return{x:O,y:_}}),h=gP(S=>{if(S.is0()){if(t.allowInfinityPoint&&!r.is0(S.py))return;throw new Error("bad point: ZERO")}const{x,y:P}=S.toAffine();if(!r.isValid(x)||!r.isValid(P))throw new Error("bad point: x or y not FE");if(!s(x,P))throw new Error("bad point: equation left != right");if(!S.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class m{constructor(x,P,A){if(x==null||!r.isValid(x))throw new Error("x required");if(P==null||!r.isValid(P)||r.is0(P))throw new Error("y required");if(A==null||!r.isValid(A))throw new Error("z required");this.px=x,this.py=P,this.pz=A,Object.freeze(this)}static fromAffine(x){const{x:P,y:A}=x||{};if(!x||!r.isValid(P)||!r.isValid(A))throw new Error("invalid affine point");if(x instanceof m)throw new Error("projective point not allowed");const T=I=>r.eql(I,r.ZERO);return T(P)&&T(A)?m.ZERO:new m(P,A,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(x){const P=_R(r,x.map(A=>A.pz));return x.map((A,T)=>A.toAffine(P[T])).map(m.fromAffine)}static fromHex(x){const P=m.fromAffine(i(Gn("pointHex",x)));return P.assertValidity(),P}static fromPrivateKey(x){return m.BASE.multiply(d(x))}static msm(x,P){return eG(m,n,x,P)}_setWindowSize(x){w.setWindowSize(this,x)}assertValidity(){h(this)}hasEvenY(){const{y:x}=this.toAffine();if(r.isOdd)return!r.isOdd(x);throw new Error("Field doesn't support isOdd")}equals(x){f(x);const{px:P,py:A,pz:T}=this,{px:I,py:O,pz:_}=x,R=r.eql(r.mul(P,_),r.mul(I,T)),E=r.eql(r.mul(A,_),r.mul(O,T));return R&&E}negate(){return new m(this.px,r.neg(this.py),this.pz)}double(){const{a:x,b:P}=t,A=r.mul(P,Lb),{px:T,py:I,pz:O}=this;let _=r.ZERO,R=r.ZERO,E=r.ZERO,M=r.mul(T,T),B=r.mul(I,I),j=r.mul(O,O),N=r.mul(T,I);return N=r.add(N,N),E=r.mul(T,O),E=r.add(E,E),_=r.mul(x,E),R=r.mul(A,j),R=r.add(_,R),_=r.sub(B,R),R=r.add(B,R),R=r.mul(_,R),_=r.mul(N,_),E=r.mul(A,E),j=r.mul(x,j),N=r.sub(M,j),N=r.mul(x,N),N=r.add(N,E),E=r.add(M,M),M=r.add(E,M),M=r.add(M,j),M=r.mul(M,N),R=r.add(R,M),j=r.mul(I,O),j=r.add(j,j),M=r.mul(j,N),_=r.sub(_,M),E=r.mul(j,B),E=r.add(E,E),E=r.add(E,E),new m(_,R,E)}add(x){f(x);const{px:P,py:A,pz:T}=this,{px:I,py:O,pz:_}=x;let R=r.ZERO,E=r.ZERO,M=r.ZERO;const B=t.a,j=r.mul(t.b,Lb);let N=r.mul(P,I),F=r.mul(A,O),D=r.mul(T,_),z=r.add(P,A),W=r.add(I,O);z=r.mul(z,W),W=r.add(N,F),z=r.sub(z,W),W=r.add(P,T);let H=r.add(I,_);return W=r.mul(W,H),H=r.add(N,D),W=r.sub(W,H),H=r.add(A,T),R=r.add(O,_),H=r.mul(H,R),R=r.add(F,D),H=r.sub(H,R),M=r.mul(B,W),R=r.mul(j,D),M=r.add(R,M),R=r.sub(F,M),M=r.add(F,M),E=r.mul(R,M),F=r.add(N,N),F=r.add(F,N),D=r.mul(B,D),W=r.mul(j,W),F=r.add(F,D),D=r.sub(N,D),D=r.mul(B,D),W=r.add(W,D),N=r.mul(F,W),E=r.add(E,N),N=r.mul(H,W),R=r.mul(z,R),R=r.sub(R,N),N=r.mul(z,F),M=r.mul(H,M),M=r.add(M,N),new m(R,E,M)}subtract(x){return this.add(x.negate())}is0(){return this.equals(m.ZERO)}wNAF(x){return w.wNAFCached(this,x,m.normalizeZ)}multiplyUnsafe(x){const{endo:P,n:A}=t;Dc("scalar",x,Ui,A);const T=m.ZERO;if(x===Ui)return T;if(this.is0()||x===pr)return this;if(!P||w.hasPrecomputes(this))return w.wNAFCachedUnsafe(this,x,m.normalizeZ);let{k1neg:I,k1:O,k2neg:_,k2:R}=P.splitScalar(x),E=T,M=T,B=this;for(;O>Ui||R>Ui;)O&pr&&(E=E.add(B)),R&pr&&(M=M.add(B)),B=B.double(),O>>=pr,R>>=pr;return I&&(E=E.negate()),_&&(M=M.negate()),M=new m(r.mul(M.px,P.beta),M.py,M.pz),E.add(M)}multiply(x){const{endo:P,n:A}=t;Dc("scalar",x,pr,A);let T,I;if(P){const{k1neg:O,k1:_,k2neg:R,k2:E}=P.splitScalar(x);let{p:M,f:B}=this.wNAF(_),{p:j,f:N}=this.wNAF(E);M=w.constTimeNegate(O,M),j=w.constTimeNegate(R,j),j=new m(r.mul(j.px,P.beta),j.py,j.pz),T=M.add(j),I=B.add(N)}else{const{p:O,f:_}=this.wNAF(x);T=O,I=_}return m.normalizeZ([T,I])[0]}multiplyAndAddUnsafe(x,P,A){const T=m.BASE,I=(_,R)=>R===Ui||R===pr||!_.equals(T)?_.multiplyUnsafe(R):_.multiply(R),O=I(this,P).add(I(x,A));return O.is0()?void 0:O}toAffine(x){return p(this,x)}isTorsionFree(){const{h:x,isTorsionFree:P}=t;if(x===pr)return!0;if(P)return P(m,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:x,clearCofactor:P}=t;return x===pr?this:P?P(m,this):this.multiplyUnsafe(t.h)}toRawBytes(x=!0){return zf("isCompressed",x),this.assertValidity(),o(m,this,x)}toHex(x=!0){return zf("isCompressed",x),Ff(this.toRawBytes(x))}}m.BASE=new m(t.Gx,t.Gy,r.ONE),m.ZERO=new m(r.ZERO,r.ONE,r.ZERO);const{endo:g,nBitLength:y}=t,w=JV(m,g?Math.ceil(y/2):y);return{CURVE:t,ProjectivePoint:m,normPrivateKeyToScalar:d,weierstrassEquation:a,isWithinCurveOrder:c}}function iG(e){const t=BR(e);return py(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function aG(e){const t=iG(e),{Fp:r,n,nByteLength:o,nBitLength:i}=t,a=r.BYTES+1,s=2*r.BYTES+1;function l(j){return Jr(j,n)}function u(j){return $w(j,n)}const{ProjectivePoint:c,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:p}=oG({...t,toBytes(j,N,F){const D=N.toAffine(),z=r.toBytes(D.x),W=lm;return zf("isCompressed",F),F?W(Uint8Array.from([N.hasEvenY()?2:3]),z):W(Uint8Array.from([4]),z,r.toBytes(D.y))},fromBytes(j){const N=j.length,F=j[0],D=j.subarray(1);if(N===a&&(F===2||F===3)){const z=ml(D);if(!r5(z,pr,r.ORDER))throw new Error("Point is not on curve");const W=f(z);let H;try{H=r.sqrt(W)}catch(re){const Y=re instanceof Error?": "+re.message:"";throw new Error("Point is not on curve"+Y)}const V=(H&pr)===pr;return(F&1)===1!==V&&(H=r.neg(H)),{x:z,y:H}}else if(N===s&&F===4){const z=r.fromBytes(D.subarray(0,r.BYTES)),W=r.fromBytes(D.subarray(r.BYTES,2*r.BYTES));return{x:z,y:W}}else{const z=a,W=s;throw new Error("invalid Point, expected length of "+z+", or uncompressed "+W+", got "+N)}}});function h(j){const N=n>>pr;return j>N}function m(j){return h(j)?l(-j):j}const g=(j,N,F)=>ml(j.slice(N,F));class y{constructor(N,F,D){Dc("r",N,pr,n),Dc("s",F,pr,n),this.r=N,this.s=F,D!=null&&(this.recovery=D),Object.freeze(this)}static fromCompact(N){const F=o;return N=Gn("compactSignature",N,F*2),new y(g(N,0,F),g(N,F,2*F))}static fromDER(N){const{r:F,s:D}=Li.toSig(Gn("DER",N));return new y(F,D)}assertValidity(){}addRecoveryBit(N){return new y(this.r,this.s,N)}recoverPublicKey(N){const{r:F,s:D,recovery:z}=this,W=T(Gn("msgHash",N));if(z==null||![0,1,2,3].includes(z))throw new Error("recovery id invalid");const H=z===2||z===3?F+t.n:F;if(H>=r.ORDER)throw new Error("recovery id 2 or 3 invalid");const V=z&1?"03":"02",Q=c.fromHex(V+Bb(H,r.BYTES)),re=u(H),Y=l(-W*re),Z=l(D*re),ie=c.BASE.multiplyAndAddUnsafe(Q,Y,Z);if(!ie)throw new Error("point at infinify");return ie.assertValidity(),ie}hasHighS(){return h(this.s)}normalizeS(){return this.hasHighS()?new y(this.r,l(-this.s),this.recovery):this}toDERRawBytes(){return sm(this.toDERHex())}toDERHex(){return Li.hexFromSig(this)}toCompactRawBytes(){return sm(this.toCompactHex())}toCompactHex(){const N=o;return Bb(this.r,N)+Bb(this.s,N)}}const w={isValidPrivateKey(j){try{return d(j),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{const j=jR(t.n);return YV(t.randomBytes(j),t.n)},precompute(j=8,N=c.BASE){return N._setWindowSize(j),N.multiply(BigInt(3)),N}};function S(j,N=!0){return c.fromPrivateKey(j).toRawBytes(N)}function x(j){if(typeof j=="bigint")return!1;if(j instanceof c)return!0;const F=Gn("key",j).length,D=r.BYTES,z=D+1,W=2*D+1;if(!(t.allowedPrivateKeyLengths||o===z))return F===z||F===W}function P(j,N,F=!0){if(x(j)===!0)throw new Error("first arg must be private key");if(x(N)===!1)throw new Error("second arg must be public key");return c.fromHex(N).multiply(d(j)).toRawBytes(F)}const A=t.bits2int||function(j){if(j.length>8192)throw new Error("input is too large");const N=ml(j),F=j.length*8-i;return F>0?N>>BigInt(F):N},T=t.bits2int_modN||function(j){return l(A(j))},I=fy(i);function O(j){return Dc("num < 2^"+i,j,Ui,I),qp(j,o)}function _(j,N,F=R){if(["recovered","canonical"].some(G=>G in F))throw new Error("sign() legacy options not supported");const{hash:D,randomBytes:z}=t;let{lowS:W,prehash:H,extraEntropy:V}=F;W==null&&(W=!0),j=Gn("msgHash",j),wP(F),H&&(j=Gn("prehashed msgHash",D(j)));const Q=T(j),re=d(N),Y=[O(re),O(Q)];if(V!=null&&V!==!1){const G=V===!0?z(r.BYTES):V;Y.push(Gn("extraEntropy",G))}const Z=lm(...Y),ie=Q;function me(G){const oe=A(G);if(!p(oe))return;const de=u(oe),q=c.BASE.multiply(oe).toAffine(),Ee=l(q.x);if(Ee===Ui)return;const ce=l(de*l(ie+Ee*re));if(ce===Ui)return;let ue=(q.x===Ee?0:2)|Number(q.y&pr),ye=ce;return W&&h(ce)&&(ye=m(ce),ue^=1),new y(Ee,ye,ue)}return{seed:Z,k2sig:me}}const R={lowS:t.lowS,prehash:!1},E={lowS:t.lowS,prehash:!1};function M(j,N,F=R){const{seed:D,k2sig:z}=_(j,N,F),W=t;return FV(W.hash.outputLen,W.nByteLength,W.hmac)(D,z)}c.BASE._setWindowSize(8);function B(j,N,F,D=E){var ue;const z=j;N=Gn("msgHash",N),F=Gn("publicKey",F);const{lowS:W,prehash:H,format:V}=D;if(wP(D),"strict"in D)throw new Error("options.strict was renamed to lowS");if(V!==void 0&&V!=="compact"&&V!=="der")throw new Error("format must be compact or der");const Q=typeof z=="string"||Gp(z),re=!Q&&!V&&typeof z=="object"&&z!==null&&typeof z.r=="bigint"&&typeof z.s=="bigint";if(!Q&&!re)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Y,Z;try{if(re&&(Y=new y(z.r,z.s)),Q){try{V!=="compact"&&(Y=y.fromDER(z))}catch(ye){if(!(ye instanceof Li.Err))throw ye}!Y&&V!=="der"&&(Y=y.fromCompact(z))}Z=c.fromHex(F)}catch{return!1}if(!Y||W&&Y.hasHighS())return!1;H&&(N=t.hash(N));const{r:ie,s:me}=Y,G=T(N),oe=u(me),de=l(G*oe),q=l(ie*oe),Ee=(ue=c.BASE.multiplyAndAddUnsafe(Z,de,q))==null?void 0:ue.toAffine();return Ee?l(Ee.x)===ie:!1}return{CURVE:t,getPublicKey:S,getSharedSecret:P,sign:M,verify:B,ProjectivePoint:c,Signature:y,utils:w}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function sG(e){return{hash:e,hmac:(t,...r)=>mR(e,t,XF(...r)),randomBytes:QF}}function lG(e,t){const r=n=>aG({...e,...sG(n)});return{...r(t),create:r}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const LR=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),xP=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),cG=BigInt(0),uG=BigInt(1),jw=BigInt(2),SP=(e,t)=>(e+t/jw)/t;function dG(e){const t=LR,r=BigInt(3),n=BigInt(6),o=BigInt(11),i=BigInt(22),a=BigInt(23),s=BigInt(44),l=BigInt(88),u=e*e*e%t,c=u*u*e%t,d=Fn(c,r,t)*c%t,f=Fn(d,r,t)*c%t,p=Fn(f,jw,t)*u%t,h=Fn(p,o,t)*p%t,m=Fn(h,i,t)*h%t,g=Fn(m,s,t)*m%t,y=Fn(g,l,t)*g%t,w=Fn(y,s,t)*m%t,S=Fn(w,r,t)*c%t,x=Fn(S,a,t)*h%t,P=Fn(x,n,t)*u%t,A=Fn(P,jw,t);if(!Mw.eql(Mw.sqr(A),e))throw new Error("Cannot find square root");return A}const Mw=n5(LR,void 0,void 0,{sqrt:dG}),DR=lG({a:cG,b:BigInt(7),Fp:Mw,n:xP,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{const t=xP,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-uG*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=r,a=BigInt("0x100000000000000000000000000000000"),s=SP(i*e,t),l=SP(-n*e,t);let u=Jr(e-s*r-l*o,t),c=Jr(-s*n-l*i,t);const d=u>a,f=c>a;if(d&&(u=t-u),f&&(c=t-c),u>a||c>a)throw new Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:d,k1:u,k2neg:f,k2:c}}}},h8),fG=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:DR},Symbol.toStringTag,{value:"Module"}));function pG({r:e,s:t,to:r="hex",v:n,yParity:o}){const i=(()=>{if(o===0||o===1)return o;if(n&&(n===27n||n===28n||n>=35n))return n%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),a=`0x${new DR.Signature(In(e),In(t)).toCompactHex()}${i===0?"1b":"1c"}`;return r==="hex"?a:Pi(a)}async function hy(e,t){var l,u,c,d;const{address:r,chain:n=e.chain,hash:o,erc6492VerifierAddress:i=t.universalSignatureVerifierAddress??((u=(l=n==null?void 0:n.contracts)==null?void 0:l.erc6492Verifier)==null?void 0:u.address),multicallAddress:a=t.multicallAddress??((d=(c=n==null?void 0:n.contracts)==null?void 0:c.multicall3)==null?void 0:d.address)}=t;if(n!=null&&n.verifyHash)return await n.verifyHash(e,t);const s=(()=>{const f=t.signature;return Ei(f)?f:typeof f=="object"&&"r"in f&&"s"in f?pG(f):ur(f)})();try{return mV(s)?await hG(e,{...t,multicallAddress:a,signature:s}):await mG(e,{...t,verifierAddress:i,signature:s})}catch(f){try{if(Hu(Bp(r),await CS({hash:o,signature:s})))return!0}catch{}if(f instanceof Tl)return!1;throw f}}async function hG(e,t){var g;const{address:r,blockNumber:n,blockTag:o,hash:i,multicallAddress:a}=t,{authorization:s,data:l,signature:u,to:c}=hV(t.signature);if(await Ew(e,{address:r,blockNumber:n,blockTag:o})===Uu(["0xef0100",s.address]))return await gG(e,{address:r,blockNumber:n,blockTag:o,hash:i,signature:u});const f={address:s.address,chainId:Number(s.chainId),nonce:Number(s.nonce),r:je(s.r,{size:32}),s:je(s.s,{size:32}),yParity:s.yParity};if(!await aH({address:r,authorization:f}))throw new Tl;const h=await Se(e,Mo,"readContract")({...a?{address:a}:{code:NS},authorizationList:[f],abi:om,blockNumber:n,blockTag:"pending",functionName:"aggregate3",args:[[...l?[{allowFailure:!0,target:c??r,callData:l}]:[],{allowFailure:!0,target:r,callData:gn({abi:R8,functionName:"isValidSignature",args:[i,u]})}]]}),m=(g=h[h.length-1])==null?void 0:g.returnData;if(m!=null&&m.startsWith("0x1626ba7e"))return!0;throw new Tl}async function mG(e,t){const{address:r,factory:n,factoryData:o,hash:i,signature:a,verifierAddress:s,...l}=t,u=await(async()=>!n&&!o||BV(a)?a:NV({data:o,signature:a,to:n}))(),c=s?{to:s,data:gn({abi:oP,functionName:"isValidSig",args:[r,i,u]}),...l}:{data:oy({abi:oP,args:[r,i,u],bytecode:dW}),...l},{data:d}=await Se(e,iy,"call")(c).catch(f=>{throw f instanceof n8?new Tl:f});if($F(d??"0x0"))return!0;throw new Tl}async function gG(e,t){const{address:r,blockNumber:n,blockTag:o,hash:i,signature:a}=t;if((await Se(e,Mo,"readContract")({address:r,abi:R8,args:[i,a],blockNumber:n,blockTag:o,functionName:"isValidSignature"}).catch(l=>{throw l instanceof o8?new Tl:l})).startsWith("0x1626ba7e"))return!0;throw new Tl}class Tl extends Error{}async function yG(e,{address:t,message:r,factory:n,factoryData:o,signature:i,...a}){const s=HS(r);return Se(e,hy,"verifyHash")({address:t,factory:n,factoryData:o,hash:s,signature:i,...a})}async function vG(e,t){const{address:r,factory:n,factoryData:o,signature:i,message:a,primaryType:s,types:l,domain:u,...c}=t,d=xH({message:a,primaryType:s,types:l,domain:u});return Se(e,hy,"verifyHash")({address:r,factory:n,factoryData:o,hash:d,signature:i,...c})}function zR(e,{emitOnBegin:t=!1,emitMissed:r=!1,onBlockNumber:n,onError:o,poll:i,pollingInterval:a=e.pollingInterval}){const s=typeof i<"u"?i:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc"));let l;return s?(()=>{const d=cr(["watchBlockNumber",e.uid,t,r,a]);return ea(d,{onBlockNumber:n,onError:o},f=>Gu(async()=>{var p;try{const h=await Se(e,Vp,"getBlockNumber")({cacheTime:0});if(l!==void 0){if(h===l)return;if(h-l>1&&r)for(let m=l+1n;ml)&&(f.onBlockNumber(h,l),l=h)}catch(h){(p=f.onError)==null||p.call(f,h)}},{emitOnBegin:t,interval:a}))})():(()=>{const d=cr(["watchBlockNumber",e.uid,t,r]);return ea(d,{onBlockNumber:n,onError:o},f=>{let p=!0,h=()=>p=!1;return(async()=>{try{const m=(()=>{if(e.transport.type==="fallback"){const y=e.transport.transports.find(w=>w.config.type==="webSocket"||w.config.type==="ipc");return y?y.value:e.transport}return e.transport})(),{unsubscribe:g}=await m.subscribe({params:["newHeads"],onData(y){var S;if(!p)return;const w=In((S=y.result)==null?void 0:S.number);f.onBlockNumber(w,l),l=w},onError(y){var w;(w=f.onError)==null||w.call(f,y)}});h=g,p||h()}catch(m){o==null||o(m)}})(),()=>h()})})()}async function FR(e,t){const{checkReplacement:r=!0,confirmations:n=1,hash:o,onReplaced:i,retryCount:a=6,retryDelay:s=({count:P})=>~~(1<{var P;return t.pollingInterval?t.pollingInterval:(P=e.chain)!=null&&P.experimental_preconfirmationTime?e.chain.experimental_preconfirmationTime:e.pollingInterval})();let d,f,p,h=!1,m,g;const{promise:y,resolve:w,reject:S}=BS(),x=l?setTimeout(()=>{g==null||g(),m==null||m(),S(new G7({hash:o}))},l):void 0;return m=ea(u,{onReplaced:i,resolve:w,reject:S},async P=>{if(p=await Se(e,T0,"getTransactionReceipt")({hash:o}).catch(()=>{}),p&&n<=1){clearTimeout(x),P.resolve(p),m==null||m();return}g=Se(e,zR,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:c,async onBlockNumber(A){const T=O=>{clearTimeout(x),g==null||g(),O(),m==null||m()};let I=A;if(!h)try{if(p){if(n>1&&(!p.blockNumber||I-p.blockNumber+1nP.resolve(p));return}if(r&&!d&&(h=!0,await im(async()=>{d=await Se(e,JS,"getTransaction")({hash:o}),d.blockNumber&&(I=d.blockNumber)},{delay:s,retryCount:a}),h=!1),p=await Se(e,T0,"getTransactionReceipt")({hash:o}),n>1&&(!p.blockNumber||I-p.blockNumber+1nP.resolve(p))}catch(O){if(O instanceof e8||O instanceof t8){if(!d){h=!1;return}try{f=d,h=!0;const _=await im(()=>Se(e,Ao,"getBlock")({blockNumber:I,includeTransactions:!0}),{delay:s,retryCount:a,shouldRetry:({error:M})=>M instanceof l8});h=!1;const R=_.transactions.find(({from:M,nonce:B})=>M===f.from&&B===f.nonce);if(!R||(p=await Se(e,T0,"getTransactionReceipt")({hash:R.hash}),n>1&&(!p.blockNumber||I-p.blockNumber+1n{var M;(M=P.onReplaced)==null||M.call(P,{reason:E,replacedTransaction:f,transaction:R,transactionReceipt:p}),P.resolve(p)})}catch(_){T(()=>P.reject(_))}}else T(()=>P.reject(O))}}})}),y}function bG(e,{blockTag:t=e.experimental_blockTag??"latest",emitMissed:r=!1,emitOnBegin:n=!1,onBlock:o,onError:i,includeTransactions:a,poll:s,pollingInterval:l=e.pollingInterval}){const u=typeof s<"u"?s:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),c=a??!1;let d;return u?(()=>{const h=cr(["watchBlocks",e.uid,t,r,n,c,l]);return ea(h,{onBlock:o,onError:i},m=>Gu(async()=>{var g;try{const y=await Se(e,Ao,"getBlock")({blockTag:t,includeTransactions:c});if(y.number!==null&&(d==null?void 0:d.number)!=null){if(y.number===d.number)return;if(y.number-d.number>1&&r)for(let w=(d==null?void 0:d.number)+1n;wd.number)&&(m.onBlock(y,d),d=y)}catch(y){(g=m.onError)==null||g.call(m,y)}},{emitOnBegin:n,interval:l}))})():(()=>{let h=!0,m=!0,g=()=>h=!1;return(async()=>{try{n&&Se(e,Ao,"getBlock")({blockTag:t,includeTransactions:c}).then(S=>{h&&m&&(o(S,void 0),m=!1)}).catch(i);const y=(()=>{if(e.transport.type==="fallback"){const S=e.transport.transports.find(x=>x.config.type==="webSocket"||x.config.type==="ipc");return S?S.value:e.transport}return e.transport})(),{unsubscribe:w}=await y.subscribe({params:["newHeads"],async onData(S){var P;if(!h)return;const x=await Se(e,Ao,"getBlock")({blockNumber:(P=S.result)==null?void 0:P.number,includeTransactions:c}).catch(()=>{});h&&(o(x,d),m=!1,d=x)},onError(S){i==null||i(S)}});g=w,h||g()}catch(y){i==null||i(y)}})(),()=>g()})()}function wG(e,{address:t,args:r,batch:n=!0,event:o,events:i,fromBlock:a,onError:s,onLogs:l,poll:u,pollingInterval:c=e.pollingInterval,strict:d}){const f=typeof u<"u"?u:typeof a=="bigint"?!0:!(e.transport.type==="webSocket"||e.transport.type==="ipc"||e.transport.type==="fallback"&&(e.transport.transports[0].config.type==="webSocket"||e.transport.transports[0].config.type==="ipc")),p=d??!1;return f?(()=>{const g=cr(["watchEvent",t,r,n,e.uid,o,c,a]);return ea(g,{onLogs:l,onError:s},y=>{let w;a!==void 0&&(w=a-1n);let S,x=!1;const P=Gu(async()=>{var A;if(!x){try{S=await Se(e,J8,"createEventFilter")({address:t,args:r,event:o,events:i,strict:p,fromBlock:a})}catch{}x=!0;return}try{let T;if(S)T=await Se(e,ay,"getFilterChanges")({filter:S});else{const I=await Se(e,Vp,"getBlockNumber")({});w&&w!==I?T=await Se(e,jS,"getLogs")({address:t,args:r,event:o,events:i,fromBlock:w+1n,toBlock:I}):T=[],w=I}if(T.length===0)return;if(n)y.onLogs(T);else for(const I of T)y.onLogs([I])}catch(T){S&&T instanceof ds&&(x=!1),(A=y.onError)==null||A.call(y,T)}},{emitOnBegin:!0,interval:c});return async()=>{S&&await Se(e,sy,"uninstallFilter")({filter:S}),P()}})})():(()=>{let g=!0,y=()=>g=!1;return(async()=>{try{const w=(()=>{if(e.transport.type==="fallback"){const A=e.transport.transports.find(T=>T.config.type==="webSocket"||T.config.type==="ipc");return A?A.value:e.transport}return e.transport})(),S=i??(o?[o]:void 0);let x=[];S&&(x=[S.flatMap(T=>Dp({abi:[T],eventName:T.name,args:r}))],o&&(x=x[0]));const{unsubscribe:P}=await w.subscribe({params:["logs",{address:t,topics:x}],onData(A){var I;if(!g)return;const T=A.result;try{const{eventName:O,args:_}=Bf({abi:S??[],data:T.data,topics:T.topics,strict:p}),R=Ji(T,{args:_,eventName:O});l([R])}catch(O){let _,R;if(O instanceof tm||O instanceof pS){if(d)return;_=O.abiItem.name,R=(I=O.abiItem.inputs)==null?void 0:I.some(M=>!("name"in M&&M.name))}const E=Ji(T,{args:R?[]:{},eventName:_});l([E])}},onError(A){s==null||s(A)}});y=P,g||y()}catch(w){s==null||s(w)}})(),()=>y()})()}function xG(e,{batch:t=!0,onError:r,onTransactions:n,poll:o,pollingInterval:i=e.pollingInterval}){return(typeof o<"u"?o:e.transport.type!=="webSocket"&&e.transport.type!=="ipc")?(()=>{const u=cr(["watchPendingTransactions",e.uid,t,i]);return ea(u,{onTransactions:n,onError:r},c=>{let d;const f=Gu(async()=>{var p;try{if(!d)try{d=await Se(e,eR,"createPendingTransactionFilter")({});return}catch(m){throw f(),m}const h=await Se(e,ay,"getFilterChanges")({filter:d});if(h.length===0)return;if(t)c.onTransactions(h);else for(const m of h)c.onTransactions([m])}catch(h){(p=c.onError)==null||p.call(c,h)}},{emitOnBegin:!0,interval:i});return async()=>{d&&await Se(e,sy,"uninstallFilter")({filter:d}),f()}})})():(()=>{let u=!0,c=()=>u=!1;return(async()=>{try{const{unsubscribe:d}=await e.transport.subscribe({params:["newPendingTransactions"],onData(f){if(!u)return;const p=f.result;n([p])},onError(f){r==null||r(f)}});c=d,u||c()}catch(d){r==null||r(d)}})(),()=>c()})()}function SG(e){var d,f,p;const{scheme:t,statement:r,...n}=((d=e.match(CG))==null?void 0:d.groups)??{},{chainId:o,expirationTime:i,issuedAt:a,notBefore:s,requestId:l,...u}=((f=e.match(EG))==null?void 0:f.groups)??{},c=(p=e.split("Resources:")[1])==null?void 0:p.split(` +- `).slice(1);return{...n,...u,...o?{chainId:Number(o)}:{},...i?{expirationTime:new Date(i)}:{},...a?{issuedAt:new Date(a)}:{},...s?{notBefore:new Date(s)}:{},...l?{requestId:l}:{},...c?{resources:c}:{},...t?{scheme:t}:{},...r?{statement:r}:{}}}const CG=/^(?:(?[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)?/,EG=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function PG(e){const{address:t,domain:r,message:n,nonce:o,scheme:i,time:a=new Date}=e;if(r&&n.domain!==r||o&&n.nonce!==o||i&&n.scheme!==i||n.expirationTime&&a>=n.expirationTime||n.notBefore&&aiy(e,t),createAccessList:t=>Q8(e,t),createBlockFilter:()=>YW(e),createContractEventFilter:t=>Z$(e,t),createEventFilter:t=>J8(e,t),createPendingTransactionFilter:()=>eR(e),estimateContractGas:t=>_U(e,t),estimateGas:t=>$S(e,t),getBalance:t=>XW(e,t),getBlobBaseFee:()=>QW(e),getBlock:t=>Ao(e,t),getBlockNumber:t=>Vp(e,t),getBlockTransactionCount:t=>JW(e,t),getBytecode:t=>Ew(e,t),getChainId:()=>Es(e),getCode:t=>Ew(e,t),getContractEvents:t=>v8(e,t),getEip712Domain:t=>tH(e,t),getEnsAddress:t=>jW(e,t),getEnsAvatar:t=>qW(e,t),getEnsName:t=>KW(e,t),getEnsResolver:t=>ZW(e,t),getEnsText:t=>X8(e,t),getFeeHistory:t=>oH(e,t),estimateFeesPerGas:t=>gU(e,t),getFilterChanges:t=>ay(e,t),getFilterLogs:t=>iH(e,t),getGasPrice:()=>kS(e),getLogs:t=>jS(e,t),getProof:t=>xV(e,t),estimateMaxPriorityFeePerGas:t=>mU(e,t),fillTransaction:t=>OS(e,t),getStorageAt:t=>SV(e,t),getTransaction:t=>JS(e,t),getTransactionConfirmations:t=>CV(e,t),getTransactionCount:t=>TS(e,t),getTransactionReceipt:t=>T0(e,t),multicall:t=>EV(e,t),prepareTransactionRequest:t=>Wp(e,t),readContract:t=>Mo(e,t),sendRawTransaction:t=>DS(e,t),sendRawTransactionSync:t=>o5(e,t),simulate:t=>Tw(e,t),simulateBlocks:t=>Tw(e,t),simulateCalls:t=>jV(e,t),simulateContract:t=>vW(e,t),verifyHash:t=>hy(e,t),verifyMessage:t=>yG(e,t),verifySiweMessage:t=>AG(e,t),verifyTypedData:t=>vG(e,t),uninstallFilter:t=>sy(e,t),waitForTransactionReceipt:t=>FR(e,t),watchBlocks:t=>bG(e,t),watchBlockNumber:t=>zR(e,t),watchContractEvent:t=>PW(e,t),watchEvent:t=>wG(e,t),watchPendingTransactions:t=>xG(e,t)}}function gl(e){const{key:t="public",name:r="Public Client"}=e;return q8({...e,key:t,name:r,type:"publicClient"}).extend(kG)}async function TG(e,{chain:t}){const{id:r,name:n,nativeCurrency:o,rpcUrls:i,blockExplorers:a}=t;await e.request({method:"wallet_addEthereumChain",params:[{chainId:je(r),chainName:n,nativeCurrency:o,rpcUrls:i.default.http,blockExplorerUrls:a?Object.values(a).map(({url:s})=>s):void 0}]},{dedupe:!0,retryCount:0})}function IG(e,t){const{abi:r,args:n,bytecode:o,...i}=t,a=oy({abi:r,args:n,bytecode:o});return ly(e,{...i,...i.authorizationList?{to:null}:{},data:a})}async function OG(e){var r;return((r=e.account)==null?void 0:r.type)==="local"?[e.account.address]:(await e.request({method:"eth_accounts"},{dedupe:!0})).map(n=>Np(n))}async function _G(e,t={}){const{account:r=e.account,chainId:n}=t,o=r?Rt(r):void 0,i=n?[o==null?void 0:o.address,[je(n)]]:[o==null?void 0:o.address],a=await e.request({method:"wallet_getCapabilities",params:i}),s={};for(const[l,u]of Object.entries(a)){s[Number(l)]={};for(let[c,d]of Object.entries(u))c==="addSubAccount"&&(c="unstable_addSubAccount"),s[Number(l)][c]=d}return typeof n=="number"?s[n]:s}async function $G(e){return await e.request({method:"wallet_getPermissions"},{dedupe:!0})}async function UR(e,t){var l;const{account:r=e.account,chainId:n,nonce:o}=t;if(!r)throw new Ps({docsPath:"/docs/eip7702/prepareAuthorization"});const i=Rt(r),a=(()=>{if(t.executor)return t.executor==="self"?t.executor:Rt(t.executor)})(),s={address:t.contractAddress??t.address,chainId:n,nonce:o};return typeof s.chainId>"u"&&(s.chainId=((l=e.chain)==null?void 0:l.id)??await Se(e,Es,"getChainId")({})),typeof s.nonce>"u"&&(s.nonce=await Se(e,TS,"getTransactionCount")({address:i.address,blockTag:"pending"}),(a==="self"||a!=null&&a.address&&Hu(a.address,i.address))&&(s.nonce+=1)),s}async function RG(e){return(await e.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map(r=>Bp(r))}async function jG(e,t){return e.request({method:"wallet_requestPermissions",params:[t]},{retryCount:0})}async function MG(e,t){const{chain:r=e.chain}=t,n=t.timeout??Math.max(((r==null?void 0:r.blockTime)??0)*3,5e3),o=await W8(e,t);return await V8(e,{...t,id:o.id,timeout:n})}const Db=new Fu(128);async function WR(e,t){var T,I,O,_,R;const{account:r=e.account,assertChainId:n=!0,chain:o=e.chain,accessList:i,authorizationList:a,blobs:s,data:l,dataSuffix:u=typeof e.dataSuffix=="string"?e.dataSuffix:(T=e.dataSuffix)==null?void 0:T.value,gas:c,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,pollingInterval:g,throwOnReceiptRevert:y,type:w,value:S,...x}=t,P=t.timeout??Math.max(((o==null?void 0:o.blockTime)??0)*3,5e3);if(typeof r>"u")throw new Ps({docsPath:"/docs/actions/wallet/sendTransactionSync"});const A=r?Rt(r):null;try{va(t);const E=await(async()=>{if(t.to)return t.to;if(t.to!==null&&a&&a.length>0)return await ey({authorization:a[0]}).catch(()=>{throw new le("`to` is required. Could not infer from `authorizationList`.")})})();if((A==null?void 0:A.type)==="json-rpc"||A===null){let M;o!==null&&(M=await Se(e,Es,"getChainId")({}),n&&LS({currentChainId:M,chain:o}));const B=(_=(O=(I=e.chain)==null?void 0:I.formatters)==null?void 0:O.transactionRequest)==null?void 0:_.format,N=(B||Cs)({...Wu(x,{format:B}),accessList:i,account:A,authorizationList:a,blobs:s,chainId:M,data:l&&Lr([l,u??"0x"]),gas:c,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,to:E,type:w,value:S},"sendTransaction"),F=Db.get(e.uid),D=F?"wallet_sendTransaction":"eth_sendTransaction",z=await(async()=>{try{return await e.request({method:D,params:[N]},{retryCount:0})}catch(H){if(F===!1)throw H;const V=H;if(V.name==="InvalidInputRpcError"||V.name==="InvalidParamsRpcError"||V.name==="MethodNotFoundRpcError"||V.name==="MethodNotSupportedRpcError")return await e.request({method:"wallet_sendTransaction",params:[N]},{retryCount:0}).then(Q=>(Db.set(e.uid,!0),Q)).catch(Q=>{const re=Q;throw re.name==="MethodNotFoundRpcError"||re.name==="MethodNotSupportedRpcError"?(Db.set(e.uid,!1),V):re});throw V}})(),W=await Se(e,FR,"waitForTransactionReceipt")({checkReplacement:!1,hash:z,pollingInterval:g,timeout:P});if(y&&W.status==="reverted")throw new r8({receipt:W});return W}if((A==null?void 0:A.type)==="local"){const M=await Se(e,Wp,"prepareTransactionRequest")({account:A,accessList:i,authorizationList:a,blobs:s,chain:o,data:l&&Lr([l,u??"0x"]),gas:c,gasPrice:d,maxFeePerBlobGas:f,maxFeePerGas:p,maxPriorityFeePerGas:h,nonce:m,nonceManager:A.nonceManager,parameters:[..._S,"sidecars"],type:w,value:S,...x,to:E}),B=(R=o==null?void 0:o.serializers)==null?void 0:R.transaction,j=await A.signTransaction(M,{serializer:B});return await Se(e,o5,"sendRawTransactionSync")({serializedTransaction:j,throwOnReceiptRevert:y,timeout:t.timeout})}throw(A==null?void 0:A.type)==="smart"?new hl({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new hl({docsPath:"/docs/actions/wallet/sendTransactionSync",type:A==null?void 0:A.type})}catch(E){throw E instanceof hl?E:ry(E,{...t,account:A,chain:t.chain||void 0})}}async function NG(e,t){const{id:r}=t;await e.request({method:"wallet_showCallsStatus",params:[r]})}async function BG(e,t){const{account:r=e.account}=t;if(!r)throw new Ps({docsPath:"/docs/eip7702/signAuthorization"});const n=Rt(r);if(!n.signAuthorization)throw new hl({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:n.type});const o=await UR(e,t);return n.signAuthorization(o)}async function LG(e,{account:t=e.account,message:r}){if(!t)throw new Ps({docsPath:"/docs/actions/wallet/signMessage"});const n=Rt(t);if(n.signMessage)return n.signMessage({message:r});const o=typeof r=="string"?tu(r):r.raw instanceof Uint8Array?$o(r.raw):r.raw;return e.request({method:"personal_sign",params:[o,n.address]},{retryCount:0})}async function DG(e,t){var u,c,d,f;const{account:r=e.account,chain:n=e.chain,...o}=t;if(!r)throw new Ps({docsPath:"/docs/actions/wallet/signTransaction"});const i=Rt(r);va({account:i,...t});const a=await Se(e,Es,"getChainId")({});n!==null&&LS({currentChainId:a,chain:n});const s=(n==null?void 0:n.formatters)||((u=e.chain)==null?void 0:u.formatters),l=((c=s==null?void 0:s.transactionRequest)==null?void 0:c.format)||Cs;return i.signTransaction?i.signTransaction({...o,chainId:a},{serializer:(f=(d=e.chain)==null?void 0:d.serializers)==null?void 0:f.transaction}):await e.request({method:"eth_signTransaction",params:[{...l({...o,account:i},"signTransaction"),chainId:je(a),from:i.address}]},{retryCount:0})}async function zG(e,t){const{account:r=e.account,domain:n,message:o,primaryType:i}=t;if(!r)throw new Ps({docsPath:"/docs/actions/wallet/signTypedData"});const a=Rt(r),s={EIP712Domain:VS({domain:n}),...t.types};if(rR({domain:n,message:o,primaryType:i,types:s}),a.signTypedData)return a.signTypedData({domain:n,message:o,primaryType:i,types:s});const l=bH({domain:n,message:o,primaryType:i,types:s});return e.request({method:"eth_signTypedData_v4",params:[a.address,l]},{retryCount:0})}async function FG(e,{id:t}){await e.request({method:"wallet_switchEthereumChain",params:[{chainId:je(t)}]},{retryCount:0})}async function UG(e,t){return await e.request({method:"wallet_watchAsset",params:t},{retryCount:0})}async function WG(e,t){return Lf.internal(e,WR,"sendTransactionSync",t)}function HG(e){return{addChain:t=>TG(e,t),deployContract:t=>IG(e,t),fillTransaction:t=>OS(e,t),getAddresses:()=>OG(e),getCallsStatus:t=>H8(e,t),getCapabilities:t=>_G(e,t),getChainId:()=>Es(e),getPermissions:()=>$G(e),prepareAuthorization:t=>UR(e,t),prepareTransactionRequest:t=>Wp(e,t),requestAddresses:()=>RG(e),requestPermissions:t=>jG(e,t),sendCalls:t=>W8(e,t),sendCallsSync:t=>MG(e,t),sendRawTransaction:t=>DS(e,t),sendRawTransactionSync:t=>o5(e,t),sendTransaction:t=>ly(e,t),sendTransactionSync:t=>WR(e,t),showCallsStatus:t=>NG(e,t),signAuthorization:t=>BG(e,t),signMessage:t=>LG(e,t),signTransaction:t=>DG(e,t),signTypedData:t=>zG(e,t),switchChain:t=>FG(e,t),waitForCallsStatus:t=>V8(e,t),watchAsset:t=>UG(e,t),writeContract:t=>Lf(e,t),writeContractSync:t=>WG(e,t)}}function Xs(e){const{key:t="wallet",name:r="Wallet Client",transport:n}=e;return q8({...e,key:t,name:r,transport:n,type:"walletClient"}).extend(HG)}function HR({key:e,methods:t,name:r,request:n,retryCount:o=3,retryDelay:i=150,timeout:a,type:s},l){const u=G8();return{config:{key:e,methods:t,name:r,request:n,retryCount:o,retryDelay:i,timeout:a,type:s},request:lH(n,{methods:t,retryCount:o,retryDelay:i,uid:u}),value:l}}function Qs(e,t={}){const{key:r="custom",methods:n,name:o="Custom Provider",retryDelay:i}=t;return({retryCount:a})=>HR({key:r,methods:n,name:o,request:e.request.bind(e),retryCount:t.retryCount??a,retryDelay:i,type:"custom"})}class VG extends le{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function Xa(e,t={}){const{batch:r,fetchFn:n,fetchOptions:o,key:i="http",methods:a,name:s="HTTP JSON-RPC",onFetchRequest:l,onFetchResponse:u,retryDelay:c,raw:d}=t;return({chain:f,retryCount:p,timeout:h})=>{const{batchSize:m=1e3,wait:g=0}=typeof r=="object"?r:{},y=t.retryCount??p,w=h??t.timeout??1e4,S=e||(f==null?void 0:f.rpcUrls.default.http[0]);if(!S)throw new VG;const x=fH(S,{fetchFn:n,fetchOptions:o,onRequest:l,onResponse:u,timeout:w});return HR({key:i,methods:a,name:s,async request({method:P,params:A}){const T={method:P,params:A},{schedule:I}=B8({id:S,wait:g,shouldSplitBatch(E){return E.length>m},fn:E=>x.request({body:E}),sort:(E,M)=>E.id-M.id}),O=async E=>r?I(E):[await x.request({body:E})],[{error:_,result:R}]=await O(T);if(d)return{error:_,result:R};if(_)throw new SS({body:T,error:_,url:S});return R},retryCount:y,retryDelay:c,timeout:w,type:"http"},{fetchOptions:o,url:S})}}function GG(e){return typeof e=="string"?e:(e==null?void 0:e.name)??""}function qG(e){if(e instanceof ArrayBuffer)return new Uint8Array(e);const t=e;return new Uint8Array(t.buffer,t.byteOffset,t.byteLength)}(()=>{const e=globalThis;if(!!!(e.crypto&&e.crypto.subtle&&typeof e.crypto.subtle.digest=="function")){const r={async digest(o,i){if(GG(o).toUpperCase()!=="SHA-256")throw new Error("polyfill only supports SHA-256");const s=qG(i),l=m8(s);return l.buffer.slice(l.byteOffset,l.byteOffset+l.byteLength)}},n=o=>{if(e.crypto&&typeof e.crypto.getRandomValues=="function")return e.crypto.getRandomValues(o);for(let i=0;i>>1,V=D[H];if(0>>1;Ho(Y,W))Zo(ie,Y)?(D[H]=ie,D[Z]=W,H=Z):(D[H]=Y,D[re]=W,H=re);else if(Zo(ie,W))D[H]=ie,D[Z]=W,H=Z;else break e}}return z}function o(D,z){var W=D.sortIndex-z.sortIndex;return W!==0?W:D.id-z.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var a=Date,s=a.now();e.unstable_now=function(){return a.now()-s}}var l=[],u=[],c=1,d=null,f=3,p=!1,h=!1,m=!1,g=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function S(D){for(var z=r(u);z!==null;){if(z.callback===null)n(u);else if(z.startTime<=D)n(u),z.sortIndex=z.expirationTime,t(l,z);else break;z=r(u)}}function x(D){if(m=!1,S(D),!h)if(r(l)!==null)h=!0,N(P);else{var z=r(u);z!==null&&F(x,z.startTime-D)}}function P(D,z){h=!1,m&&(m=!1,y(I),I=-1),p=!0;var W=f;try{for(S(z),d=r(l);d!==null&&(!(d.expirationTime>z)||D&&!R());){var H=d.callback;if(typeof H=="function"){d.callback=null,f=d.priorityLevel;var V=H(d.expirationTime<=z);z=e.unstable_now(),typeof V=="function"?d.callback=V:d===r(l)&&n(l),S(z)}else n(l);d=r(l)}if(d!==null)var Q=!0;else{var re=r(u);re!==null&&F(x,re.startTime-z),Q=!1}return Q}finally{d=null,f=W,p=!1}}var A=!1,T=null,I=-1,O=5,_=-1;function R(){return!(e.unstable_now()-_D||125H?(D.sortIndex=W,t(u,D),r(l)===null&&D===r(u)&&(m?(y(I),I=-1):m=!0,F(x,W-H))):(D.sortIndex=V,t(l,D),h||p||(h=!0,N(P))),D},e.unstable_shouldYield=R,e.unstable_wrapCallback=function(D){var z=f;return function(){var W=f;f=z;try{return D.apply(this,arguments)}finally{f=W}}}})(qR);GR.exports=qR;var KG=GR.exports;/** + * @license React + * react-dom.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 ZG=v,_n=KG;function fe(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Nw=Object.prototype.hasOwnProperty,YG=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,CP={},EP={};function XG(e){return Nw.call(EP,e)?!0:Nw.call(CP,e)?!1:YG.test(e)?EP[e]=!0:(CP[e]=!0,!1)}function QG(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function JG(e,t,r,n){if(t===null||typeof t>"u"||QG(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Yr(e,t,r,n,o,i,a){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=a}var _r={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_r[e]=new Yr(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_r[t]=new Yr(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_r[e]=new Yr(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_r[e]=new Yr(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){_r[e]=new Yr(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_r[e]=new Yr(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_r[e]=new Yr(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_r[e]=new Yr(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_r[e]=new Yr(e,5,!1,e.toLowerCase(),null,!1,!1)});var i5=/[\-:]([a-z])/g;function a5(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(i5,a5);_r[t]=new Yr(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(i5,a5);_r[t]=new Yr(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(i5,a5);_r[t]=new Yr(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_r[e]=new Yr(e,1,!1,e.toLowerCase(),null,!1,!1)});_r.xlinkHref=new Yr("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_r[e]=new Yr(e,1,!1,e.toLowerCase(),null,!0,!0)});function s5(e,t,r,n){var o=_r.hasOwnProperty(t)?_r[t]:null;(o!==null?o.type!==0:n||!(2s||o[a]!==i[s]){var l=` +`+o[a].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=a&&0<=s);break}}}finally{Fb=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Fd(e):""}function eq(e){switch(e.tag){case 5:return Fd(e.type);case 16:return Fd("Lazy");case 13:return Fd("Suspense");case 19:return Fd("SuspenseList");case 0:case 2:case 15:return e=Ub(e.type,!1),e;case 11:return e=Ub(e.type.render,!1),e;case 1:return e=Ub(e.type,!0),e;default:return""}}function zw(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case wc:return"Fragment";case bc:return"Portal";case Bw:return"Profiler";case l5:return"StrictMode";case Lw:return"Suspense";case Dw:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case YR:return(e.displayName||"Context")+".Consumer";case ZR:return(e._context.displayName||"Context")+".Provider";case c5:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case u5:return t=e.displayName||null,t!==null?t:zw(e.type)||"Memo";case Ma:t=e._payload,e=e._init;try{return zw(e(t))}catch{}}return null}function tq(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return zw(t);case 8:return t===l5?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function fs(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function QR(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function rq(e){var t=QR(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Mh(e){e._valueTracker||(e._valueTracker=rq(e))}function JR(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=QR(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function cm(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Fw(e,t){var r=t.checked;return Nt({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function AP(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=fs(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function e3(e,t){t=t.checked,t!=null&&s5(e,"checked",t,!1)}function Uw(e,t){e3(e,t);var r=fs(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Ww(e,t.type,r):t.hasOwnProperty("defaultValue")&&Ww(e,t.type,fs(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function kP(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Ww(e,t,r){(t!=="number"||cm(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Ud=Array.isArray;function zc(e,t,r,n){if(e=e.options,t){t={};for(var o=0;o"+t.valueOf().toString()+"",t=Nh.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function Wf(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var ef={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},nq=["Webkit","ms","Moz","O"];Object.keys(ef).forEach(function(e){nq.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),ef[t]=ef[e]})});function o3(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||ef.hasOwnProperty(e)&&ef[e]?(""+t).trim():t+"px"}function i3(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=o3(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,o):e[r]=o}}var oq=Nt({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gw(e,t){if(t){if(oq[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(fe(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(fe(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(fe(61))}if(t.style!=null&&typeof t.style!="object")throw Error(fe(62))}}function qw(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Kw=null;function d5(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Zw=null,Fc=null,Uc=null;function OP(e){if(e=Yp(e)){if(typeof Zw!="function")throw Error(fe(280));var t=e.stateNode;t&&(t=by(t),Zw(e.stateNode,e.type,t))}}function a3(e){Fc?Uc?Uc.push(e):Uc=[e]:Fc=e}function s3(){if(Fc){var e=Fc,t=Uc;if(Uc=Fc=null,OP(e),t)for(e=0;e>>=0,e===0?32:31-(mq(e)/gq|0)|0}var Bh=64,Lh=4194304;function Wd(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function pm(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,o=e.suspendedLanes,i=e.pingedLanes,a=r&268435455;if(a!==0){var s=a&~o;s!==0?n=Wd(s):(i&=a,i!==0&&(n=Wd(i)))}else a=r&~o,a!==0?n=Wd(a):i!==0&&(n=Wd(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&o)&&(o=n&-n,i=t&-t,o>=i||o===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function Kp(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-ko(t),e[t]=r}function wq(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0=rf),DP=" ",zP=!1;function k3(e,t){switch(e){case"keyup":return Kq.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function T3(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var xc=!1;function Yq(e,t){switch(e){case"compositionend":return T3(t);case"keypress":return t.which!==32?null:(zP=!0,DP);case"textInput":return e=t.data,e===DP&&zP?null:e;default:return null}}function Xq(e,t){if(xc)return e==="compositionend"||!b5&&k3(e,t)?(e=P3(),O0=g5=Wa=null,xc=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1=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=HP(r)}}function $3(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?$3(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function R3(){for(var e=window,t=cm();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=cm(e.document)}return t}function w5(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}function aK(e){var t=R3(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&$3(r.ownerDocument.documentElement,r)){if(n!==null&&w5(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!e.extend&&i>n&&(o=n,n=i,i=o),o=VP(r,i);var a=VP(r,n);o&&a&&(e.rangeCount!==1||e.anchorNode!==o.node||e.anchorOffset!==o.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&(t=t.createRange(),t.setStart(o.node,o.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,Sc=null,tx=null,of=null,rx=!1;function GP(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;rx||Sc==null||Sc!==cm(n)||(n=Sc,"selectionStart"in n&&w5(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),of&&Zf(of,n)||(of=n,n=gm(tx,"onSelect"),0Pc||(e.current=lx[Pc],lx[Pc]=null,Pc--)}function St(e,t){Pc++,lx[Pc]=e.current,e.current=t}var ps={},Dr=ks(ps),sn=ks(!1),Il=ps;function cu(e,t){var r=e.type.contextTypes;if(!r)return ps;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function ln(e){return e=e.childContextTypes,e!=null}function vm(){kt(sn),kt(Dr)}function JP(e,t,r){if(Dr.current!==ps)throw Error(fe(168));St(Dr,t),St(sn,r)}function U3(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in t))throw Error(fe(108,tq(e)||"Unknown",o));return Nt({},r,n)}function bm(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||ps,Il=Dr.current,St(Dr,e),St(sn,sn.current),!0}function eA(e,t,r){var n=e.stateNode;if(!n)throw Error(fe(169));r?(e=U3(e,t,Il),n.__reactInternalMemoizedMergedChildContext=e,kt(sn),kt(Dr),St(Dr,e)):kt(sn),St(sn,r)}var Di=null,wy=!1,r1=!1;function W3(e){Di===null?Di=[e]:Di.push(e)}function vK(e){wy=!0,W3(e)}function Ts(){if(!r1&&Di!==null){r1=!0;var e=0,t=ht;try{var r=Di;for(ht=1;e>=a,o-=a,Wi=1<<32-ko(t)+o|r<I?(O=T,T=null):O=T.sibling;var _=f(y,T,S[I],x);if(_===null){T===null&&(T=O);break}e&&T&&_.alternate===null&&t(y,T),w=i(_,w,I),A===null?P=_:A.sibling=_,A=_,T=O}if(I===S.length)return r(y,T),_t&&Ws(y,I),P;if(T===null){for(;II?(O=T,T=null):O=T.sibling;var R=f(y,T,_.value,x);if(R===null){T===null&&(T=O);break}e&&T&&R.alternate===null&&t(y,T),w=i(R,w,I),A===null?P=R:A.sibling=R,A=R,T=O}if(_.done)return r(y,T),_t&&Ws(y,I),P;if(T===null){for(;!_.done;I++,_=S.next())_=d(y,_.value,x),_!==null&&(w=i(_,w,I),A===null?P=_:A.sibling=_,A=_);return _t&&Ws(y,I),P}for(T=n(y,T);!_.done;I++,_=S.next())_=p(T,y,I,_.value,x),_!==null&&(e&&_.alternate!==null&&T.delete(_.key===null?I:_.key),w=i(_,w,I),A===null?P=_:A.sibling=_,A=_);return e&&T.forEach(function(E){return t(y,E)}),_t&&Ws(y,I),P}function g(y,w,S,x){if(typeof S=="object"&&S!==null&&S.type===wc&&S.key===null&&(S=S.props.children),typeof S=="object"&&S!==null){switch(S.$$typeof){case jh:e:{for(var P=S.key,A=w;A!==null;){if(A.key===P){if(P=S.type,P===wc){if(A.tag===7){r(y,A.sibling),w=o(A,S.props.children),w.return=y,y=w;break e}}else if(A.elementType===P||typeof P=="object"&&P!==null&&P.$$typeof===Ma&&nA(P)===A.type){r(y,A.sibling),w=o(A,S.props),w.ref=wd(y,A,S),w.return=y,y=w;break e}r(y,A);break}else t(y,A);A=A.sibling}S.type===wc?(w=vl(S.props.children,y.mode,x,S.key),w.return=y,y=w):(x=L0(S.type,S.key,S.props,null,y.mode,x),x.ref=wd(y,w,S),x.return=y,y=x)}return a(y);case bc:e:{for(A=S.key;w!==null;){if(w.key===A)if(w.tag===4&&w.stateNode.containerInfo===S.containerInfo&&w.stateNode.implementation===S.implementation){r(y,w.sibling),w=o(w,S.children||[]),w.return=y,y=w;break e}else{r(y,w);break}else t(y,w);w=w.sibling}w=u1(S,y.mode,x),w.return=y,y=w}return a(y);case Ma:return A=S._init,g(y,w,A(S._payload),x)}if(Ud(S))return h(y,w,S,x);if(md(S))return m(y,w,S,x);Vh(y,S)}return typeof S=="string"&&S!==""||typeof S=="number"?(S=""+S,w!==null&&w.tag===6?(r(y,w.sibling),w=o(w,S),w.return=y,y=w):(r(y,w),w=c1(S,y.mode,x),w.return=y,y=w),a(y)):r(y,w)}return g}var du=q3(!0),K3=q3(!1),Sm=ks(null),Cm=null,Tc=null,E5=null;function P5(){E5=Tc=Cm=null}function A5(e){var t=Sm.current;kt(Sm),e._currentValue=t}function dx(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function Hc(e,t){Cm=e,E5=Tc=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(nn=!0),e.firstContext=null)}function ao(e){var t=e._currentValue;if(E5!==e)if(e={context:e,memoizedValue:t,next:null},Tc===null){if(Cm===null)throw Error(fe(308));Tc=e,Cm.dependencies={lanes:0,firstContext:e}}else Tc=Tc.next=e;return t}var rl=null;function k5(e){rl===null?rl=[e]:rl.push(e)}function Z3(e,t,r,n){var o=t.interleaved;return o===null?(r.next=r,k5(t)):(r.next=o.next,o.next=r),t.interleaved=r,na(e,n)}function na(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Na=!1;function T5(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Y3(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Yi(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function rs(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,rt&2){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,na(e,r)}return o=n.interleaved,o===null?(t.next=t,k5(n)):(t.next=o.next,o.next=t),n.interleaved=t,na(e,r)}function $0(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,p5(e,r)}}function oA(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var o=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?o=i=a:i=i.next=a,r=r.next}while(r!==null);i===null?o=i=t:i=i.next=t}else o=i=t;r={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Em(e,t,r,n){var o=e.updateQueue;Na=!1;var i=o.firstBaseUpdate,a=o.lastBaseUpdate,s=o.shared.pending;if(s!==null){o.shared.pending=null;var l=s,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var c=e.alternate;c!==null&&(c=c.updateQueue,s=c.lastBaseUpdate,s!==a&&(s===null?c.firstBaseUpdate=u:s.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=o.baseState;a=0,c=u=l=null,s=i;do{var f=s.lane,p=s.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:p,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var h=e,m=s;switch(f=t,p=r,m.tag){case 1:if(h=m.payload,typeof h=="function"){d=h.call(p,d,f);break e}d=h;break e;case 3:h.flags=h.flags&-65537|128;case 0:if(h=m.payload,f=typeof h=="function"?h.call(p,d,f):h,f==null)break e;d=Nt({},d,f);break e;case 2:Na=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,f=o.effects,f===null?o.effects=[s]:f.push(s))}else p={eventTime:p,lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},c===null?(u=c=p,l=d):c=c.next=p,a|=f;if(s=s.next,s===null){if(s=o.shared.pending,s===null)break;f=s,s=f.next,f.next=null,o.lastBaseUpdate=f,o.shared.pending=null}}while(!0);if(c===null&&(l=d),o.baseState=l,o.firstBaseUpdate=u,o.lastBaseUpdate=c,t=o.shared.interleaved,t!==null){o=t;do a|=o.lane,o=o.next;while(o!==t)}else i===null&&(o.shared.lanes=0);$l|=a,e.lanes=a,e.memoizedState=d}}function iA(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=o1.transition;o1.transition={};try{e(!1),t()}finally{ht=r,o1.transition=n}}function pj(){return so().memoizedState}function SK(e,t,r){var n=os(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},hj(e))mj(t,r);else if(r=Z3(e,t,r,n),r!==null){var o=Gr();To(r,e,n,o),gj(r,t,n)}}function CK(e,t,r){var n=os(e),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(hj(e))mj(t,o);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var a=t.lastRenderedState,s=i(a,r);if(o.hasEagerState=!0,o.eagerState=s,No(s,a)){var l=t.interleaved;l===null?(o.next=o,k5(t)):(o.next=l.next,l.next=o),t.interleaved=o;return}}catch{}finally{}r=Z3(e,t,o,n),r!==null&&(o=Gr(),To(r,e,n,o),gj(r,t,n))}}function hj(e){var t=e.alternate;return e===Mt||t!==null&&t===Mt}function mj(e,t){af=Am=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function gj(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,p5(e,r)}}var km={readContext:ao,useCallback:jr,useContext:jr,useEffect:jr,useImperativeHandle:jr,useInsertionEffect:jr,useLayoutEffect:jr,useMemo:jr,useReducer:jr,useRef:jr,useState:jr,useDebugValue:jr,useDeferredValue:jr,useTransition:jr,useMutableSource:jr,useSyncExternalStore:jr,useId:jr,unstable_isNewReconciler:!1},EK={readContext:ao,useCallback:function(e,t){return ei().memoizedState=[e,t===void 0?null:t],e},useContext:ao,useEffect:sA,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,j0(4194308,4,lj.bind(null,t,e),r)},useLayoutEffect:function(e,t){return j0(4194308,4,e,t)},useInsertionEffect:function(e,t){return j0(4,2,e,t)},useMemo:function(e,t){var r=ei();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=ei();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=SK.bind(null,Mt,e),[n.memoizedState,e]},useRef:function(e){var t=ei();return e={current:e},t.memoizedState=e},useState:aA,useDebugValue:N5,useDeferredValue:function(e){return ei().memoizedState=e},useTransition:function(){var e=aA(!1),t=e[0];return e=xK.bind(null,e[1]),ei().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Mt,o=ei();if(_t){if(r===void 0)throw Error(fe(407));r=r()}else{if(r=t(),yr===null)throw Error(fe(349));_l&30||ej(n,t,r)}o.memoizedState=r;var i={value:r,getSnapshot:t};return o.queue=i,sA(rj.bind(null,n,i,e),[e]),n.flags|=2048,np(9,tj.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=ei(),t=yr.identifierPrefix;if(_t){var r=Hi,n=Wi;r=(n&~(1<<32-ko(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=tp++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=a.createElement(r,{is:n.is}):(e=a.createElement(r),r==="select"&&(a=e,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):e=a.createElementNS(e,r),e[si]=t,e[Qf]=n,Aj(e,t,!1,!1),t.stateNode=e;e:{switch(a=qw(r,n),r){case"dialog":Pt("cancel",e),Pt("close",e),o=n;break;case"iframe":case"object":case"embed":Pt("load",e),o=n;break;case"video":case"audio":for(o=0;ohu&&(t.flags|=128,n=!0,xd(i,!1),t.lanes=4194304)}else{if(!n)if(e=Pm(a),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),xd(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!_t)return Mr(t),null}else 2*Yt()-i.renderingStartTime>hu&&r!==1073741824&&(t.flags|=128,n=!0,xd(i,!1),t.lanes=4194304);i.isBackwards?(a.sibling=t.child,t.child=a):(r=i.last,r!==null?r.sibling=a:t.child=a,i.last=a)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Yt(),t.sibling=null,r=jt.current,St(jt,n?r&1|2:r&1),t):(Mr(t),null);case 22:case 23:return U5(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?wn&1073741824&&(Mr(t),t.subtreeFlags&6&&(t.flags|=8192)):Mr(t),null;case 24:return null;case 25:return null}throw Error(fe(156,t.tag))}function $K(e,t){switch(S5(t),t.tag){case 1:return ln(t.type)&&vm(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return fu(),kt(sn),kt(Dr),_5(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return O5(t),null;case 13:if(kt(jt),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(fe(340));uu()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return kt(jt),null;case 4:return fu(),null;case 10:return A5(t.type._context),null;case 22:case 23:return U5(),null;case 24:return null;default:return null}}var qh=!1,Br=!1,RK=typeof WeakSet=="function"?WeakSet:Set,xe=null;function Ic(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Vt(e,t,n)}else r.current=null}function wx(e,t,r){try{r()}catch(n){Vt(e,t,n)}}var vA=!1;function jK(e,t){if(nx=hm,e=R3(),w5(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,s=-1,l=-1,u=0,c=0,d=e,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(s=a+o),d!==i||n!==0&&d.nodeType!==3||(l=a+n),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===e)break t;if(f===r&&++u===o&&(s=a),f===i&&++c===n&&(l=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(ox={focusedElem:e,selectionRange:r},hm=!1,xe=t;xe!==null;)if(t=xe,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xe=e;else for(;xe!==null;){t=xe;try{var h=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(h!==null){var m=h.memoizedProps,g=h.memoizedState,y=t.stateNode,w=y.getSnapshotBeforeUpdate(t.elementType===t.type?m:bo(t.type,m),g);y.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var S=t.stateNode.containerInfo;S.nodeType===1?S.textContent="":S.nodeType===9&&S.documentElement&&S.removeChild(S.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(fe(163))}}catch(x){Vt(t,t.return,x)}if(e=t.sibling,e!==null){e.return=t.return,xe=e;break}xe=t.return}return h=vA,vA=!1,h}function sf(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&e)===e){var i=o.destroy;o.destroy=void 0,i!==void 0&&wx(t,r,i)}o=o.next}while(o!==n)}}function Cy(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function xx(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Ij(e){var t=e.alternate;t!==null&&(e.alternate=null,Ij(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[si],delete t[Qf],delete t[sx],delete t[gK],delete t[yK])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Oj(e){return e.tag===5||e.tag===3||e.tag===4}function bA(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Oj(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Sx(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=ym));else if(n!==4&&(e=e.child,e!==null))for(Sx(e,t,r),e=e.sibling;e!==null;)Sx(e,t,r),e=e.sibling}function Cx(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(Cx(e,t,r),e=e.sibling;e!==null;)Cx(e,t,r),e=e.sibling}var Er=null,wo=!1;function Oa(e,t,r){for(r=r.child;r!==null;)_j(e,t,r),r=r.sibling}function _j(e,t,r){if(yi&&typeof yi.onCommitFiberUnmount=="function")try{yi.onCommitFiberUnmount(my,r)}catch{}switch(r.tag){case 5:Br||Ic(r,t);case 6:var n=Er,o=wo;Er=null,Oa(e,t,r),Er=n,wo=o,Er!==null&&(wo?(e=Er,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Er.removeChild(r.stateNode));break;case 18:Er!==null&&(wo?(e=Er,r=r.stateNode,e.nodeType===8?t1(e.parentNode,r):e.nodeType===1&&t1(e,r),qf(e)):t1(Er,r.stateNode));break;case 4:n=Er,o=wo,Er=r.stateNode.containerInfo,wo=!0,Oa(e,t,r),Er=n,wo=o;break;case 0:case 11:case 14:case 15:if(!Br&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&wx(r,t,a),o=o.next}while(o!==n)}Oa(e,t,r);break;case 1:if(!Br&&(Ic(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Vt(r,t,s)}Oa(e,t,r);break;case 21:Oa(e,t,r);break;case 22:r.mode&1?(Br=(n=Br)||r.memoizedState!==null,Oa(e,t,r),Br=n):Oa(e,t,r);break;default:Oa(e,t,r)}}function wA(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new RK),t.forEach(function(n){var o=WK.bind(null,e,n);r.has(n)||(r.add(n),n.then(o,o))})}}function yo(e,t){var r=t.deletions;if(r!==null)for(var n=0;no&&(o=a),n&=~i}if(n=o,n=Yt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*NK(n/1960))-n,10e?16:e,Ha===null)var n=!1;else{if(e=Ha,Ha=null,Om=0,rt&6)throw Error(fe(331));var o=rt;for(rt|=4,xe=e.current;xe!==null;){var i=xe,a=i.child;if(xe.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lYt()-z5?yl(e,0):D5|=r),cn(e,t)}function Dj(e,t){t===0&&(e.mode&1?(t=Lh,Lh<<=1,!(Lh&130023424)&&(Lh=4194304)):t=1);var r=Gr();e=na(e,t),e!==null&&(Kp(e,t,r),cn(e,r))}function UK(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Dj(e,r)}function WK(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(fe(314))}n!==null&&n.delete(t),Dj(e,r)}var zj;zj=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||sn.current)nn=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return nn=!1,OK(e,t,r);nn=!!(e.flags&131072)}else nn=!1,_t&&t.flags&1048576&&H3(t,xm,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;M0(e,t),e=t.pendingProps;var o=cu(t,Dr.current);Hc(t,r),o=R5(null,t,n,e,o,r);var i=j5();return t.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ln(n)?(i=!0,bm(t)):i=!1,t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,T5(t),o.updater=Sy,t.stateNode=o,o._reactInternals=t,px(t,n,e,r),t=gx(null,t,n,!0,i,r)):(t.tag=0,_t&&i&&x5(t),Fr(null,t,o,r),t=t.child),t;case 16:n=t.elementType;e:{switch(M0(e,t),e=t.pendingProps,o=n._init,n=o(n._payload),t.type=n,o=t.tag=VK(n),e=bo(n,e),o){case 0:t=mx(null,t,n,e,r);break e;case 1:t=mA(null,t,n,e,r);break e;case 11:t=pA(null,t,n,e,r);break e;case 14:t=hA(null,t,n,bo(n.type,e),r);break e}throw Error(fe(306,n,""))}return t;case 0:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:bo(n,o),mx(e,t,n,o,r);case 1:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:bo(n,o),mA(e,t,n,o,r);case 3:e:{if(Cj(t),e===null)throw Error(fe(387));n=t.pendingProps,i=t.memoizedState,o=i.element,Y3(e,t),Em(t,n,null,r);var a=t.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){o=pu(Error(fe(423)),t),t=gA(e,t,n,r,o);break e}else if(n!==o){o=pu(Error(fe(424)),t),t=gA(e,t,n,r,o);break e}else for(En=ts(t.stateNode.containerInfo.firstChild),An=t,_t=!0,xo=null,r=K3(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(uu(),n===o){t=oa(e,t,r);break e}Fr(e,t,n,r)}t=t.child}return t;case 5:return X3(t),e===null&&ux(t),n=t.type,o=t.pendingProps,i=e!==null?e.memoizedProps:null,a=o.children,ix(n,o)?a=null:i!==null&&ix(n,i)&&(t.flags|=32),Sj(e,t),Fr(e,t,a,r),t.child;case 6:return e===null&&ux(t),null;case 13:return Ej(e,t,r);case 4:return I5(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=du(t,null,n,r):Fr(e,t,n,r),t.child;case 11:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:bo(n,o),pA(e,t,n,o,r);case 7:return Fr(e,t,t.pendingProps,r),t.child;case 8:return Fr(e,t,t.pendingProps.children,r),t.child;case 12:return Fr(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,o=t.pendingProps,i=t.memoizedProps,a=o.value,St(Sm,n._currentValue),n._currentValue=a,i!==null)if(No(i.value,a)){if(i.children===o.children&&!sn.current){t=oa(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=Yi(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),dx(i.return,r,t),s.lanes|=r;break}l=l.next}}else if(i.tag===10)a=i.type===t.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(fe(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),dx(a,r,t),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===t){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}Fr(e,t,o.children,r),t=t.child}return t;case 9:return o=t.type,n=t.pendingProps.children,Hc(t,r),o=ao(o),n=n(o),t.flags|=1,Fr(e,t,n,r),t.child;case 14:return n=t.type,o=bo(n,t.pendingProps),o=bo(n.type,o),hA(e,t,n,o,r);case 15:return wj(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,o=t.pendingProps,o=t.elementType===n?o:bo(n,o),M0(e,t),t.tag=1,ln(n)?(e=!0,bm(t)):e=!1,Hc(t,r),yj(t,n,o),px(t,n,o,r),gx(null,t,n,!0,e,r);case 19:return Pj(e,t,r);case 22:return xj(e,t,r)}throw Error(fe(156,t.tag))};function Fj(e,t){return h3(e,t)}function HK(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Jn(e,t,r,n){return new HK(e,t,r,n)}function H5(e){return e=e.prototype,!(!e||!e.isReactComponent)}function VK(e){if(typeof e=="function")return H5(e)?1:0;if(e!=null){if(e=e.$$typeof,e===c5)return 11;if(e===u5)return 14}return 2}function is(e,t){var r=e.alternate;return r===null?(r=Jn(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function L0(e,t,r,n,o,i){var a=2;if(n=e,typeof e=="function")H5(e)&&(a=1);else if(typeof e=="string")a=5;else e:switch(e){case wc:return vl(r.children,o,i,t);case l5:a=8,o|=8;break;case Bw:return e=Jn(12,r,t,o|2),e.elementType=Bw,e.lanes=i,e;case Lw:return e=Jn(13,r,t,o),e.elementType=Lw,e.lanes=i,e;case Dw:return e=Jn(19,r,t,o),e.elementType=Dw,e.lanes=i,e;case XR:return Py(r,o,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ZR:a=10;break e;case YR:a=9;break e;case c5:a=11;break e;case u5:a=14;break e;case Ma:a=16,n=null;break e}throw Error(fe(130,e==null?e:typeof e,""))}return t=Jn(a,r,t,o),t.elementType=e,t.type=n,t.lanes=i,t}function vl(e,t,r,n){return e=Jn(7,e,n,t),e.lanes=r,e}function Py(e,t,r,n){return e=Jn(22,e,n,t),e.elementType=XR,e.lanes=r,e.stateNode={isHidden:!1},e}function c1(e,t,r){return e=Jn(6,e,null,t),e.lanes=r,e}function u1(e,t,r){return t=Jn(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function GK(e,t,r,n,o){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Hb(0),this.expirationTimes=Hb(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Hb(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function V5(e,t,r,n,o,i,a,s,l){return e=new GK(e,t,r,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Jn(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},T5(i),e}function qK(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(Vj)}catch(e){console.error(e)}}Vj(),VR.exports=Bn;var Qp=VR.exports;const Yh=Ti(Qp);var Gj,TA=Qp;Gj=TA.createRoot,TA.hydrateRoot;const ip={black:"#000",white:"#fff"},Vs={300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828"},rc={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},zi={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",600:"#1e88e5",700:"#1976d2",800:"#1565c0"},nc={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},Ba={100:"#c8e6c9",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},dc={300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",900:"#e65100"},fc={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function ia(e,...t){const r=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(n=>r.searchParams.append("args[]",n)),`Minified MUI error #${e}; visit ${r} for the full message.`}const bi="$$material";function Rm(){return Rm=Object.assign?Object.assign.bind():function(e){for(var t=1;t0?Ar(Zu,--pn):0,mu--,er===10&&(mu=1,_y--),er}function kn(){return er=pn2||sp(er)>3?"":" "}function dZ(e,t){for(;--t&&kn()&&!(er<48||er>102||er>57&&er<65||er>70&&er<97););return Jp(e,D0()+(t<6&&wi()==32&&kn()==32))}function Ix(e){for(;kn();)switch(er){case e:return pn;case 34:case 39:e!==34&&e!==39&&Ix(er);break;case 40:e===41&&Ix(e);break;case 92:kn();break}return pn}function fZ(e,t){for(;kn()&&e+er!==57;)if(e+er===84&&wi()===47)break;return"/*"+Jp(t,pn-1)+"*"+Oy(e===47?e:kn())}function pZ(e){for(;!sp(wi());)kn();return Jp(e,pn)}function hZ(e){return Qj(F0("",null,null,null,[""],e=Xj(e),0,[0],e))}function F0(e,t,r,n,o,i,a,s,l){for(var u=0,c=0,d=a,f=0,p=0,h=0,m=1,g=1,y=1,w=0,S="",x=o,P=i,A=n,T=S;g;)switch(h=w,w=kn()){case 40:if(h!=108&&Ar(T,d-1)==58){Tx(T+=ct(z0(w),"&","&\f"),"&\f")!=-1&&(y=-1);break}case 34:case 39:case 91:T+=z0(w);break;case 9:case 10:case 13:case 32:T+=uZ(h);break;case 92:T+=dZ(D0()-1,7);continue;case 47:switch(wi()){case 42:case 47:Xh(mZ(fZ(kn(),D0()),t,r),l);break;default:T+="/"}break;case 123*m:s[u++]=ni(T)*y;case 125*m:case 59:case 0:switch(w){case 0:case 125:g=0;case 59+c:y==-1&&(T=ct(T,/\f/g,"")),p>0&&ni(T)-d&&Xh(p>32?OA(T+";",n,r,d-1):OA(ct(T," ","")+";",n,r,d-2),l);break;case 59:T+=";";default:if(Xh(A=IA(T,t,r,u,c,o,s,S,x=[],P=[],d),i),w===123)if(c===0)F0(T,t,A,A,x,i,d,s,P);else switch(f===99&&Ar(T,3)===110?100:f){case 100:case 108:case 109:case 115:F0(e,A,A,n&&Xh(IA(e,A,A,0,0,o,s,S,o,x=[],d),P),o,P,d,s,n?x:P);break;default:F0(T,A,A,A,[""],P,0,s,P)}}u=c=p=0,m=y=1,S=T="",d=a;break;case 58:d=1+ni(T),p=h;default:if(m<1){if(w==123)--m;else if(w==125&&m++==0&&cZ()==125)continue}switch(T+=Oy(w),w*m){case 38:y=c>0?1:(T+="\f",-1);break;case 44:s[u++]=(ni(T)-1)*y,y=1;break;case 64:wi()===45&&(T+=z0(kn())),f=wi(),c=d=ni(S=T+=pZ(D0())),w++;break;case 45:h===45&&ni(T)==2&&(m=0)}}return i}function IA(e,t,r,n,o,i,a,s,l,u,c){for(var d=o-1,f=o===0?i:[""],p=X5(f),h=0,m=0,g=0;h0?f[y]+" "+w:ct(w,/&\f/g,f[y])))&&(l[g++]=S);return $y(e,t,r,o===0?Z5:s,l,u,c)}function mZ(e,t,r){return $y(e,t,r,qj,Oy(lZ()),ap(e,2,-2),0)}function OA(e,t,r,n){return $y(e,t,r,Y5,ap(e,0,n),ap(e,n+1,-1),n)}function Gc(e,t){for(var r="",n=X5(e),o=0;o6)switch(Ar(e,t+1)){case 109:if(Ar(e,t+4)!==45)break;case 102:return ct(e,/(.+:)(.+)-([^]+)/,"$1"+lt+"$2-$3$1"+jm+(Ar(e,t+3)==108?"$3":"$2-$3"))+e;case 115:return~Tx(e,"stretch")?e4(ct(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(Ar(e,t+1)!==115)break;case 6444:switch(Ar(e,ni(e)-3-(~Tx(e,"!important")&&10))){case 107:return ct(e,":",":"+lt)+e;case 101:return ct(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+lt+(Ar(e,14)===45?"inline-":"")+"box$3$1"+lt+"$2$3$1"+Nr+"$2box$3")+e}break;case 5936:switch(Ar(e,t+11)){case 114:return lt+e+Nr+ct(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return lt+e+Nr+ct(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return lt+e+Nr+ct(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return lt+e+Nr+e+e}return e}var EZ=function(t,r,n,o){if(t.length>-1&&!t.return)switch(t.type){case Y5:t.return=e4(t.value,t.length);break;case Kj:return Gc([Cd(t,{value:ct(t.value,"@","@"+lt)})],o);case Z5:if(t.length)return sZ(t.props,function(i){switch(aZ(i,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Gc([Cd(t,{props:[ct(i,/:(read-\w+)/,":"+jm+"$1")]})],o);case"::placeholder":return Gc([Cd(t,{props:[ct(i,/:(plac\w+)/,":"+lt+"input-$1")]}),Cd(t,{props:[ct(i,/:(plac\w+)/,":"+jm+"$1")]}),Cd(t,{props:[ct(i,/:(plac\w+)/,Nr+"input-$1")]})],o)}return""})}},PZ=[EZ],AZ=function(t){var r=t.key;if(r==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(m){var g=m.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(m),m.setAttribute("data-s",""))})}var o=t.stylisPlugins||PZ,i={},a,s=[];a=t.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+r+' "]'),function(m){for(var g=m.getAttribute("data-emotion").split(" "),y=1;y=4;++n,o-=4)r=e.charCodeAt(n)&255|(e.charCodeAt(++n)&255)<<8|(e.charCodeAt(++n)&255)<<16|(e.charCodeAt(++n)&255)<<24,r=(r&65535)*1540483477+((r>>>16)*59797<<16),r^=r>>>24,t=(r&65535)*1540483477+((r>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(o){case 3:t^=(e.charCodeAt(n+2)&255)<<16;case 2:t^=(e.charCodeAt(n+1)&255)<<8;case 1:t^=e.charCodeAt(n)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var BZ={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},LZ=/[A-Z]|^ms/g,DZ=/_EMO_([^_]+?)_([^]*?)_EMO_/g,a4=function(t){return t.charCodeAt(1)===45},$A=function(t){return t!=null&&typeof t!="boolean"},d1=Jj(function(e){return a4(e)?e:e.replace(LZ,"-$&").toLowerCase()}),RA=function(t,r){switch(t){case"animation":case"animationName":if(typeof r=="string")return r.replace(DZ,function(n,o,i){return oi={name:o,styles:i,next:oi},o})}return BZ[t]!==1&&!a4(t)&&typeof r=="number"&&r!==0?r+"px":r};function lp(e,t,r){if(r==null)return"";var n=r;if(n.__emotion_styles!==void 0)return n;switch(typeof r){case"boolean":return"";case"object":{var o=r;if(o.anim===1)return oi={name:o.name,styles:o.styles,next:oi},o.name;var i=r;if(i.styles!==void 0){var a=i.next;if(a!==void 0)for(;a!==void 0;)oi={name:a.name,styles:a.styles,next:oi},a=a.next;var s=i.styles+";";return s}return zZ(e,t,r)}case"function":{if(e!==void 0){var l=oi,u=r(e);return oi=l,lp(e,t,u)}break}}var c=r;if(t==null)return c;var d=t[c];return d!==void 0?d:c}function zZ(e,t,r){var n="";if(Array.isArray(r))for(var o=0;o96?ZZ:YZ},LA=function(t,r,n){var o;if(r){var i=r.shouldForwardProp;o=t.__emotion_forwardProp&&i?function(a){return t.__emotion_forwardProp(a)&&i(a)}:i}return typeof o!="function"&&n&&(o=t.__emotion_forwardProp),o},XZ=function(t){var r=t.cache,n=t.serialized,o=t.isStringTag;return t6(r,n,o),l4(function(){return r6(r,n,o)}),null},QZ=function e(t,r){var n=t.__emotion_real===t,o=n&&t.__emotion_base||t,i,a;r!==void 0&&(i=r.label,a=r.target);var s=LA(t,r,n),l=s||BA(o),u=!l("as");return function(){var c=arguments,d=n&&t.__emotion_styles!==void 0?t.__emotion_styles.slice(0):[];if(i!==void 0&&d.push("label:"+i+";"),c[0]==null||c[0].raw===void 0)d.push.apply(d,c);else{var f=c[0];d.push(f[0]);for(var p=c.length,h=1;ht(eY(o)?r:o):t;return b.jsx(GZ,{styles:n})}function d4(e,t){return _x(e,t)}function tY(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const DA=[];function as(e){return DA[0]=e,eh(DA)}var f4={exports:{}},vt={};/** + * @license React + * react-is.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var i6=Symbol.for("react.transitional.element"),a6=Symbol.for("react.portal"),Wy=Symbol.for("react.fragment"),Hy=Symbol.for("react.strict_mode"),Vy=Symbol.for("react.profiler"),Gy=Symbol.for("react.consumer"),qy=Symbol.for("react.context"),Ky=Symbol.for("react.forward_ref"),Zy=Symbol.for("react.suspense"),Yy=Symbol.for("react.suspense_list"),Xy=Symbol.for("react.memo"),Qy=Symbol.for("react.lazy"),rY=Symbol.for("react.view_transition"),nY=Symbol.for("react.client.reference");function po(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case i6:switch(e=e.type,e){case Wy:case Vy:case Hy:case Zy:case Yy:case rY:return e;default:switch(e=e&&e.$$typeof,e){case qy:case Ky:case Qy:case Xy:return e;case Gy:return e;default:return t}}case a6:return t}}}vt.ContextConsumer=Gy;vt.ContextProvider=qy;vt.Element=i6;vt.ForwardRef=Ky;vt.Fragment=Wy;vt.Lazy=Qy;vt.Memo=Xy;vt.Portal=a6;vt.Profiler=Vy;vt.StrictMode=Hy;vt.Suspense=Zy;vt.SuspenseList=Yy;vt.isContextConsumer=function(e){return po(e)===Gy};vt.isContextProvider=function(e){return po(e)===qy};vt.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===i6};vt.isForwardRef=function(e){return po(e)===Ky};vt.isFragment=function(e){return po(e)===Wy};vt.isLazy=function(e){return po(e)===Qy};vt.isMemo=function(e){return po(e)===Xy};vt.isPortal=function(e){return po(e)===a6};vt.isProfiler=function(e){return po(e)===Vy};vt.isStrictMode=function(e){return po(e)===Hy};vt.isSuspense=function(e){return po(e)===Zy};vt.isSuspenseList=function(e){return po(e)===Yy};vt.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===Wy||e===Vy||e===Hy||e===Zy||e===Yy||typeof e=="object"&&e!==null&&(e.$$typeof===Qy||e.$$typeof===Xy||e.$$typeof===qy||e.$$typeof===Gy||e.$$typeof===Ky||e.$$typeof===nY||e.getModuleId!==void 0)};vt.typeOf=po;f4.exports=vt;var p4=f4.exports;function li(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function h4(e){if(v.isValidElement(e)||p4.isValidElementType(e)||!li(e))return e;const t={};return Object.keys(e).forEach(r=>{t[r]=h4(e[r])}),t}function vr(e,t,r={clone:!0}){const n=r.clone?{...e}:e;return li(e)&&li(t)&&Object.keys(t).forEach(o=>{v.isValidElement(t[o])||p4.isValidElementType(t[o])?n[o]=t[o]:li(t[o])&&Object.prototype.hasOwnProperty.call(e,o)&&li(e[o])?n[o]=vr(e[o],t[o],r):r.clone?n[o]=li(t[o])?h4(t[o]):t[o]:n[o]=t[o]}),n}const oY=e=>{const t=Object.keys(e).map(r=>({key:r,val:e[r]}))||[];return t.sort((r,n)=>r.val-n.val),t.reduce((r,n)=>({...r,[n.key]:n.val}),{})};function iY(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:r="px",step:n=5,...o}=e,i=oY(t),a=Object.keys(i);function s(f){return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r})`}function l(f){return`@media (max-width:${(typeof t[f]=="number"?t[f]:f)-n/100}${r})`}function u(f,p){const h=a.indexOf(p);return`@media (min-width:${typeof t[f]=="number"?t[f]:f}${r}) and (max-width:${(h!==-1&&typeof t[a[h]]=="number"?t[a[h]]:p)-n/100}${r})`}function c(f){return a.indexOf(f)+1n.startsWith("@container")).sort((n,o)=>{var a,s;const i=/min-width:\s*([0-9.]+)/;return+(((a=n.match(i))==null?void 0:a[1])||0)-+(((s=o.match(i))==null?void 0:s[1])||0)});return r.length?r.reduce((n,o)=>{const i=t[o];return delete n[o],n[o]=i,n},{...t}):t}function aY(e,t){return t==="@"||t.startsWith("@")&&(e.some(r=>t.startsWith(`@${r}`))||!!t.match(/^@\d/))}function sY(e,t){const r=t.match(/^@([^/]+)?\/?(.+)?$/);if(!r)return null;const[,n,o]=r,i=Number.isNaN(+n)?n||0:+n;return e.containerQueries(o).up(i)}function lY(e){const t=(i,a)=>i.replace("@media",a?`@container ${a}`:"@container");function r(i,a){i.up=(...s)=>t(e.breakpoints.up(...s),a),i.down=(...s)=>t(e.breakpoints.down(...s),a),i.between=(...s)=>t(e.breakpoints.between(...s),a),i.only=(...s)=>t(e.breakpoints.only(...s),a),i.not=(...s)=>{const l=t(e.breakpoints.not(...s),a);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const n={},o=i=>(r(n,i),n);return r(o),{...e,containerQueries:o}}const cY={borderRadius:4};function uf(e,t){return t?vr(e,t,{clone:!1}):e}const Jy={xs:0,sm:600,md:900,lg:1200,xl:1536},FA={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Jy[e]}px)`},uY={containerQueries:e=>({up:t=>{let r=typeof t=="number"?t:Jy[t]||t;return typeof r=="number"&&(r=`${r}px`),e?`@container ${e} (min-width:${r})`:`@container (min-width:${r})`}})};function Bo(e,t,r){const n=e.theme||{};if(Array.isArray(t)){const i=n.breakpoints||FA;return t.reduce((a,s,l)=>(a[i.up(i.keys[l])]=r(t[l]),a),{})}if(typeof t=="object"){const i=n.breakpoints||FA;return Object.keys(t).reduce((a,s)=>{if(aY(i.keys,s)){const l=sY(n.containerQueries?n:uY,s);l&&(a[l]=r(t[s],s))}else if(Object.keys(i.values||Jy).includes(s)){const l=i.up(s);a[l]=r(t[s],s)}else{const l=s;a[l]=t[l]}return a},{})}return r(t)}function m4(e={}){var r;return((r=e.keys)==null?void 0:r.reduce((n,o)=>{const i=e.up(o);return n[i]={},n},{}))||{}}function $x(e,t){return e.reduce((r,n)=>{const o=r[n];return(!o||Object.keys(o).length===0)&&delete r[n],r},t)}function dY(e,...t){const r=m4(e),n=[r,...t].reduce((o,i)=>vr(o,i),{});return $x(Object.keys(r),n)}function fY(e,t){if(typeof e!="object")return{};const r={},n=Object.keys(t);return Array.isArray(e)?n.forEach((o,i)=>{i{e[o]!=null&&(r[o]=!0)}),r}function f1({values:e,breakpoints:t,base:r}){const n=r||fY(e,t),o=Object.keys(n);if(o.length===0)return e;let i;return o.reduce((a,s,l)=>(Array.isArray(e)?(a[s]=e[l]!=null?e[l]:e[i],i=l):typeof e=="object"?(a[s]=e[s]!=null?e[s]:e[i],i=s):a[s]=e,a),{})}function te(e){if(typeof e!="string")throw new Error(ia(7));return e.charAt(0).toUpperCase()+e.slice(1)}function ii(e,t,r=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&r){const n=`vars.${t}`.split(".").reduce((o,i)=>o&&o[i]?o[i]:null,e);if(n!=null)return n}return t.split(".").reduce((n,o)=>n&&n[o]!=null?n[o]:null,e)}function Mm(e,t,r,n=r){let o;return typeof e=="function"?o=e(r):Array.isArray(e)?o=e[r]||n:o=ii(e,r)||n,t&&(o=t(o,n,e)),o}function Xt(e){const{prop:t,cssProperty:r=e.prop,themeKey:n,transform:o}=e,i=a=>{if(a[t]==null)return null;const s=a[t],l=a.theme,u=ii(l,n)||{};return Bo(a,s,d=>{let f=Mm(u,o,d);return d===f&&typeof d=="string"&&(f=Mm(u,o,`${t}${d==="default"?"":te(d)}`,d)),r===!1?f:{[r]:f}})};return i.propTypes={},i.filterProps=[t],i}function pY(e){const t={};return r=>(t[r]===void 0&&(t[r]=e(r)),t[r])}const hY={m:"margin",p:"padding"},mY={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},UA={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},gY=pY(e=>{if(e.length>2)if(UA[e])e=UA[e];else return[e];const[t,r]=e.split(""),n=hY[t],o=mY[r]||"";return Array.isArray(o)?o.map(i=>n+i):[n+o]}),s6=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],l6=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...s6,...l6];function rh(e,t,r,n){const o=ii(e,t,!0)??r;return typeof o=="number"||typeof o=="string"?i=>typeof i=="string"?i:typeof o=="string"?o.startsWith("var(")&&i===0?0:o.startsWith("var(")&&i===1?o:`calc(${i} * ${o})`:o*i:Array.isArray(o)?i=>{if(typeof i=="string")return i;const a=Math.abs(i),s=o[a];return i>=0?s:typeof s=="number"?-s:typeof s=="string"&&s.startsWith("var(")?`calc(-1 * ${s})`:`-${s}`}:typeof o=="function"?o:()=>{}}function ev(e){return rh(e,"spacing",8)}function jl(e,t){return typeof t=="string"||t==null?t:e(t)}function yY(e,t){return r=>e.reduce((n,o)=>(n[o]=jl(t,r),n),{})}function vY(e,t,r,n){if(!t.includes(r))return null;const o=gY(r),i=yY(o,n),a=e[r];return Bo(e,a,i)}function g4(e,t){const r=ev(e.theme);return Object.keys(e).map(n=>vY(e,t,n,r)).reduce(uf,{})}function zt(e){return g4(e,s6)}zt.propTypes={};zt.filterProps=s6;function Ft(e){return g4(e,l6)}Ft.propTypes={};Ft.filterProps=l6;function y4(e=8,t=ev({spacing:e})){if(e.mui)return e;const r=(...n)=>(n.length===0?[1]:n).map(i=>{const a=t(i);return typeof a=="number"?`${a}px`:a}).join(" ");return r.mui=!0,r}function tv(...e){const t=e.reduce((n,o)=>(o.filterProps.forEach(i=>{n[i]=o}),n),{}),r=n=>Object.keys(n).reduce((o,i)=>t[i]?uf(o,t[i](n)):o,{});return r.propTypes={},r.filterProps=e.reduce((n,o)=>n.concat(o.filterProps),[]),r}function Xn(e){return typeof e!="number"?e:`${e}px solid`}function ho(e,t){return Xt({prop:e,themeKey:"borders",transform:t})}const bY=ho("border",Xn),wY=ho("borderTop",Xn),xY=ho("borderRight",Xn),SY=ho("borderBottom",Xn),CY=ho("borderLeft",Xn),EY=ho("borderColor"),PY=ho("borderTopColor"),AY=ho("borderRightColor"),kY=ho("borderBottomColor"),TY=ho("borderLeftColor"),IY=ho("outline",Xn),OY=ho("outlineColor"),rv=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=rh(e.theme,"shape.borderRadius",4),r=n=>({borderRadius:jl(t,n)});return Bo(e,e.borderRadius,r)}return null};rv.propTypes={};rv.filterProps=["borderRadius"];tv(bY,wY,xY,SY,CY,EY,PY,AY,kY,TY,rv,IY,OY);const nv=e=>{if(e.gap!==void 0&&e.gap!==null){const t=rh(e.theme,"spacing",8),r=n=>({gap:jl(t,n)});return Bo(e,e.gap,r)}return null};nv.propTypes={};nv.filterProps=["gap"];const ov=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=rh(e.theme,"spacing",8),r=n=>({columnGap:jl(t,n)});return Bo(e,e.columnGap,r)}return null};ov.propTypes={};ov.filterProps=["columnGap"];const iv=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=rh(e.theme,"spacing",8),r=n=>({rowGap:jl(t,n)});return Bo(e,e.rowGap,r)}return null};iv.propTypes={};iv.filterProps=["rowGap"];const _Y=Xt({prop:"gridColumn"}),$Y=Xt({prop:"gridRow"}),RY=Xt({prop:"gridAutoFlow"}),jY=Xt({prop:"gridAutoColumns"}),MY=Xt({prop:"gridAutoRows"}),NY=Xt({prop:"gridTemplateColumns"}),BY=Xt({prop:"gridTemplateRows"}),LY=Xt({prop:"gridTemplateAreas"}),DY=Xt({prop:"gridArea"});tv(nv,ov,iv,_Y,$Y,RY,jY,MY,NY,BY,LY,DY);function qc(e,t){return t==="grey"?t:e}const zY=Xt({prop:"color",themeKey:"palette",transform:qc}),FY=Xt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:qc}),UY=Xt({prop:"backgroundColor",themeKey:"palette",transform:qc});tv(zY,FY,UY);function Sn(e){return e<=1&&e!==0?`${e*100}%`:e}const WY=Xt({prop:"width",transform:Sn}),c6=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=r=>{var o,i,a,s,l;const n=((a=(i=(o=e.theme)==null?void 0:o.breakpoints)==null?void 0:i.values)==null?void 0:a[r])||Jy[r];return n?((l=(s=e.theme)==null?void 0:s.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${n}${e.theme.breakpoints.unit}`}:{maxWidth:n}:{maxWidth:Sn(r)}};return Bo(e,e.maxWidth,t)}return null};c6.filterProps=["maxWidth"];const HY=Xt({prop:"minWidth",transform:Sn}),VY=Xt({prop:"height",transform:Sn}),GY=Xt({prop:"maxHeight",transform:Sn}),qY=Xt({prop:"minHeight",transform:Sn});Xt({prop:"size",cssProperty:"width",transform:Sn});Xt({prop:"size",cssProperty:"height",transform:Sn});const KY=Xt({prop:"boxSizing"});tv(WY,c6,HY,VY,GY,qY,KY);const nh={border:{themeKey:"borders",transform:Xn},borderTop:{themeKey:"borders",transform:Xn},borderRight:{themeKey:"borders",transform:Xn},borderBottom:{themeKey:"borders",transform:Xn},borderLeft:{themeKey:"borders",transform:Xn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Xn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:rv},color:{themeKey:"palette",transform:qc},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:qc},backgroundColor:{themeKey:"palette",transform:qc},p:{style:Ft},pt:{style:Ft},pr:{style:Ft},pb:{style:Ft},pl:{style:Ft},px:{style:Ft},py:{style:Ft},padding:{style:Ft},paddingTop:{style:Ft},paddingRight:{style:Ft},paddingBottom:{style:Ft},paddingLeft:{style:Ft},paddingX:{style:Ft},paddingY:{style:Ft},paddingInline:{style:Ft},paddingInlineStart:{style:Ft},paddingInlineEnd:{style:Ft},paddingBlock:{style:Ft},paddingBlockStart:{style:Ft},paddingBlockEnd:{style:Ft},m:{style:zt},mt:{style:zt},mr:{style:zt},mb:{style:zt},ml:{style:zt},mx:{style:zt},my:{style:zt},margin:{style:zt},marginTop:{style:zt},marginRight:{style:zt},marginBottom:{style:zt},marginLeft:{style:zt},marginX:{style:zt},marginY:{style:zt},marginInline:{style:zt},marginInlineStart:{style:zt},marginInlineEnd:{style:zt},marginBlock:{style:zt},marginBlockStart:{style:zt},marginBlockEnd:{style:zt},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:nv},rowGap:{style:iv},columnGap:{style:ov},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Sn},maxWidth:{style:c6},minWidth:{transform:Sn},height:{transform:Sn},maxHeight:{transform:Sn},minHeight:{transform:Sn},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function ZY(...e){const t=e.reduce((n,o)=>n.concat(Object.keys(o)),[]),r=new Set(t);return e.every(n=>r.size===Object.keys(n).length)}function YY(e,t){return typeof e=="function"?e(t):e}function XY(){function e(r,n,o,i){const a={[r]:n,theme:o},s=i[r];if(!s)return{[r]:n};const{cssProperty:l=r,themeKey:u,transform:c,style:d}=s;if(n==null)return null;if(u==="typography"&&n==="inherit")return{[r]:n};const f=ii(o,u)||{};return d?d(a):Bo(a,n,h=>{let m=Mm(f,c,h);return h===m&&typeof h=="string"&&(m=Mm(f,c,`${r}${h==="default"?"":te(h)}`,h)),l===!1?m:{[l]:m}})}function t(r){const{sx:n,theme:o={},nested:i}=r||{};if(!n)return null;const a=o.unstable_sxConfig??nh;function s(l){let u=l;if(typeof l=="function")u=l(o);else if(typeof l!="object")return l;if(!u)return null;const c=m4(o.breakpoints),d=Object.keys(c);let f=c;return Object.keys(u).forEach(p=>{const h=YY(u[p],o);if(h!=null)if(typeof h=="object")if(a[p])f=uf(f,e(p,h,o,a));else{const m=Bo({theme:o},h,g=>({[p]:g}));ZY(m,h)?f[p]=t({sx:h,theme:o,nested:!0}):f=uf(f,m)}else f=uf(f,e(p,h,o,a))}),!i&&o.modularCssLayers?{"@layer sx":zA(o,$x(d,f))}:zA(o,$x(d,f))}return Array.isArray(n)?n.map(s):s(n)}return t}const hs=XY();hs.filterProps=["sx"];function QY(e,t){var n;const r=this;if(r.vars){if(!((n=r.colorSchemes)!=null&&n[e])||typeof r.getColorSchemeSelector!="function")return{};let o=r.getColorSchemeSelector(e);return o==="&"?t:((o.includes("data-")||o.includes("."))&&(o=`*:where(${o.replace(/\s*&$/,"")}) &`),{[o]:t})}return r.palette.mode===e?t:{}}function Yu(e={},...t){const{breakpoints:r={},palette:n={},spacing:o,shape:i={},...a}=e,s=iY(r),l=y4(o);let u=vr({breakpoints:s,direction:"ltr",components:{},palette:{mode:"light",...n},spacing:l,shape:{...cY,...i}},a);return u=lY(u),u.applyStyles=QY,u=t.reduce((c,d)=>vr(c,d),u),u.unstable_sxConfig={...nh,...a==null?void 0:a.unstable_sxConfig},u.unstable_sx=function(d){return hs({sx:d,theme:this})},u}function JY(e){return Object.keys(e).length===0}function u6(e=null){const t=v.useContext(th);return!t||JY(t)?e:t}const eX=Yu();function oh(e=eX){return u6(e)}function p1(e){const t=as(e);return e!==t&&t.styles?(t.styles.match(/^@layer\s+[^{]*$/)||(t.styles=`@layer global{${t.styles}}`),t):e}function v4({styles:e,themeId:t,defaultTheme:r={}}){const n=oh(r),o=t&&n[t]||n;let i=typeof e=="function"?e(o):e;return o.modularCssLayers&&(Array.isArray(i)?i=i.map(a=>p1(typeof a=="function"?a(o):a)):i=p1(i)),b.jsx(u4,{styles:i})}const tX=e=>{var n;const t={systemProps:{},otherProps:{}},r=((n=e==null?void 0:e.theme)==null?void 0:n.unstable_sxConfig)??nh;return Object.keys(e).forEach(o=>{r[o]?t.systemProps[o]=e[o]:t.otherProps[o]=e[o]}),t};function av(e){const{sx:t,...r}=e,{systemProps:n,otherProps:o}=tX(r);let i;return Array.isArray(t)?i=[n,...t]:typeof t=="function"?i=(...a)=>{const s=t(...a);return li(s)?{...n,...s}:n}:i={...n,...t},{...o,sx:i}}const WA=e=>e,rX=()=>{let e=WA;return{configure(t){e=t},generate(t){return e(t)},reset(){e=WA}}},b4=rX();function w4(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e)){var o=e.length;for(t=0;ts!=="theme"&&s!=="sx"&&s!=="as"})(hs);return v.forwardRef(function(l,u){const c=oh(r),{className:d,component:f="div",...p}=av(l);return b.jsx(i,{as:f,ref:u,className:se(d,o?o(n):n),theme:t&&c[t]||c,...p})})}const oX={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Oe(e,t,r="Mui"){const n=oX[t];return n?`${r}-${n}`:`${b4.generate(e)}-${t}`}function Te(e,t,r="Mui"){const n={};return t.forEach(o=>{n[o]=Oe(e,o,r)}),n}function x4(e){const{variants:t,...r}=e,n={variants:t,style:as(r),isProcessed:!0};return n.style===r||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=as(o.style))}),n}const iX=Yu();function h1(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function ol(e,t){return t&&e&&typeof e=="object"&&e.styles&&!e.styles.startsWith("@layer")&&(e.styles=`@layer ${t}{${String(e.styles)}}`),e}function aX(e){return e?(t,r)=>r[e]:null}function sX(e,t,r){e.theme=cX(e.theme)?r:e.theme[t]||e.theme}function U0(e,t,r){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(o=>U0(e,o,r));if(Array.isArray(n==null?void 0:n.variants)){let o;if(n.isProcessed)o=r?ol(n.style,r):n.style;else{const{variants:i,...a}=n;o=r?ol(as(a),r):a}return S4(e,n.variants,[o],r)}return n!=null&&n.isProcessed?r?ol(as(n.style),r):n.style:r?ol(as(n),r):n}function S4(e,t,r=[],n=void 0){var i;let o;e:for(let a=0;a{tY(s,A=>A.filter(T=>T!==hs));const{name:u,slot:c,skipVariantsResolver:d,skipSx:f,overridesResolver:p=aX(dX(c)),...h}=l,m=u&&u.startsWith("Mui")||c?"components":"custom",g=d!==void 0?d:c&&c!=="Root"&&c!=="root"||!1,y=f||!1;let w=h1;c==="Root"||c==="root"?w=n:c?w=o:uX(s)&&(w=void 0);const S=d4(s,{shouldForwardProp:w,label:lX(),...h}),x=A=>{if(A.__emotion_real===A)return A;if(typeof A=="function")return function(I){return U0(I,A,I.theme.modularCssLayers?m:void 0)};if(li(A)){const T=x4(A);return function(O){return T.variants?U0(O,T,O.theme.modularCssLayers?m:void 0):O.theme.modularCssLayers?ol(T.style,m):T.style}}return A},P=(...A)=>{const T=[],I=A.map(x),O=[];if(T.push(i),u&&p&&O.push(function(M){var F,D;const j=(D=(F=M.theme.components)==null?void 0:F[u])==null?void 0:D.styleOverrides;if(!j)return null;const N={};for(const z in j)N[z]=U0(M,j[z],M.theme.modularCssLayers?"theme":void 0);return p(M,N)}),u&&!g&&O.push(function(M){var N,F;const B=M.theme,j=(F=(N=B==null?void 0:B.components)==null?void 0:N[u])==null?void 0:F.variants;return j?S4(M,j,[],M.theme.modularCssLayers?"theme":void 0):null}),y||O.push(hs),Array.isArray(I[0])){const E=I.shift(),M=new Array(T.length).fill(""),B=new Array(O.length).fill("");let j;j=[...M,...E,...B],j.raw=[...M,...E.raw,...B],T.unshift(j)}const _=[...T,...I,...O],R=S(..._);return s.muiName&&(R.muiName=s.muiName),R};return S.withConfig&&(P.withConfig=S.withConfig),P}}function lX(e,t){return void 0}function cX(e){for(const t in e)return!1;return!0}function uX(e){return typeof e=="string"&&e.charCodeAt(0)>96}function dX(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}const d6=C4();function cp(e,t,r=!1){const n={...t};for(const o in e)if(Object.prototype.hasOwnProperty.call(e,o)){const i=o;if(i==="components"||i==="slots")n[i]={...e[i],...n[i]};else if(i==="componentsProps"||i==="slotProps"){const a=e[i],s=t[i];if(!s)n[i]=a||{};else if(!a)n[i]=s;else{n[i]={...s};for(const l in a)if(Object.prototype.hasOwnProperty.call(a,l)){const u=l;n[i][u]=cp(a[u],s[u],r)}}}else i==="className"&&r&&t.className?n.className=se(e==null?void 0:e.className,t==null?void 0:t.className):i==="style"&&r&&t.style?n.style={...e==null?void 0:e.style,...t==null?void 0:t.style}:n[i]===void 0&&(n[i]=e[i])}return n}function fX(e){const{theme:t,name:r,props:n}=e;return!t||!t.components||!t.components[r]||!t.components[r].defaultProps?n:cp(t.components[r].defaultProps,n)}function f6({props:e,name:t,defaultTheme:r,themeId:n}){let o=oh(r);return n&&(o=o[n]||o),fX({theme:o,name:t,props:e})}const $n=typeof window<"u"?v.useLayoutEffect:v.useEffect;function pX(e,t=Number.MIN_SAFE_INTEGER,r=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,r))}function p6(e,t=0,r=1){return pX(e,t,r)}function hX(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let r=e.match(t);return r&&r[0].length===1&&(r=r.map(n=>n+n)),r?`rgb${r.length===4?"a":""}(${r.map((n,o)=>o<3?parseInt(n,16):Math.round(parseInt(n,16)/255*1e3)/1e3).join(", ")})`:""}function ms(e){if(e.type)return e;if(e.charAt(0)==="#")return ms(hX(e));const t=e.indexOf("("),r=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(r))throw new Error(ia(9,e));let n=e.substring(t+1,e.length-1),o;if(r==="color"){if(n=n.split(" "),o=n.shift(),n.length===4&&n[3].charAt(0)==="/"&&(n[3]=n[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(o))throw new Error(ia(10,o))}else n=n.split(",");return n=n.map(i=>parseFloat(i)),{type:r,values:n,colorSpace:o}}const mX=e=>{const t=ms(e);return t.values.slice(0,3).map((r,n)=>t.type.includes("hsl")&&n!==0?`${r}%`:r).join(" ")},Vd=(e,t)=>{try{return mX(e)}catch{return e}};function sv(e){const{type:t,colorSpace:r}=e;let{values:n}=e;return t.includes("rgb")?n=n.map((o,i)=>i<3?parseInt(o,10):o):t.includes("hsl")&&(n[1]=`${n[1]}%`,n[2]=`${n[2]}%`),t.includes("color")?n=`${r} ${n.join(" ")}`:n=`${n.join(", ")}`,`${t}(${n})`}function E4(e){e=ms(e);const{values:t}=e,r=t[0],n=t[1]/100,o=t[2]/100,i=n*Math.min(o,1-o),a=(u,c=(u+r/30)%12)=>o-i*Math.max(Math.min(c-3,9-c,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(s+="a",l.push(t[3])),sv({type:s,values:l})}function Rx(e){e=ms(e);let t=e.type==="hsl"||e.type==="hsla"?ms(E4(e)).values:e.values;return t=t.map(r=>(e.type!=="color"&&(r/=255),r<=.03928?r/12.92:((r+.055)/1.055)**2.4)),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function gX(e,t){const r=Rx(e),n=Rx(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}function up(e,t){return e=ms(e),t=p6(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,sv(e)}function Ds(e,t,r){try{return up(e,t)}catch{return e}}function lv(e,t){if(e=ms(e),t=p6(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]*=1-t;return sv(e)}function dt(e,t,r){try{return lv(e,t)}catch{return e}}function cv(e,t){if(e=ms(e),t=p6(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(e.type.includes("color"))for(let r=0;r<3;r+=1)e.values[r]+=(1-e.values[r])*t;return sv(e)}function ft(e,t,r){try{return cv(e,t)}catch{return e}}function yX(e,t=.15){return Rx(e)>.5?lv(e,t):cv(e,t)}function Qh(e,t,r){try{return yX(e,t)}catch{return e}}const P4=v.createContext(null);function h6(){return v.useContext(P4)}const vX=typeof Symbol=="function"&&Symbol.for,bX=vX?Symbol.for("mui.nested"):"__THEME_NESTED__";function wX(e,t){return typeof t=="function"?t(e):{...e,...t}}function xX(e){const{children:t,theme:r}=e,n=h6(),o=v.useMemo(()=>{const i=n===null?{...r}:wX(n,r);return i!=null&&(i[bX]=n!==null),i},[r,n]);return b.jsx(P4.Provider,{value:o,children:t})}const A4=v.createContext();function SX({value:e,...t}){return b.jsx(A4.Provider,{value:e??!0,...t})}const ql=()=>v.useContext(A4)??!1,k4=v.createContext(void 0);function CX({value:e,children:t}){return b.jsx(k4.Provider,{value:e,children:t})}function EX(e){const{theme:t,name:r,props:n}=e;if(!t||!t.components||!t.components[r])return n;const o=t.components[r];return o.defaultProps?cp(o.defaultProps,n,t.components.mergeClassNameAndStyle):!o.styleOverrides&&!o.variants?cp(o,n,t.components.mergeClassNameAndStyle):n}function PX({props:e,name:t}){const r=v.useContext(k4);return EX({props:e,name:t,theme:{components:r}})}let HA=0;function AX(e){const[t,r]=v.useState(e),n=e||t;return v.useEffect(()=>{t==null&&(HA+=1,r(`mui-${HA}`))},[t]),n}const kX={...gf},VA=kX.useId;function gs(e){if(VA!==void 0){const t=VA();return e??t}return AX(e)}function TX(e){const t=u6(),r=gs()||"",{modularCssLayers:n}=e;let o="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!n||t!==null?o="":typeof n=="string"?o=n.replace(/mui(?!\.)/g,o):o=`@layer ${o};`,$n(()=>{var s,l;const i=document.querySelector("head");if(!i)return;const a=i.firstChild;if(o){if(a&&((s=a.hasAttribute)!=null&&s.call(a,"data-mui-layer-order"))&&a.getAttribute("data-mui-layer-order")===r)return;const u=document.createElement("style");u.setAttribute("data-mui-layer-order",r),u.textContent=o,i.prepend(u)}else(l=i.querySelector(`style[data-mui-layer-order="${r}"]`))==null||l.remove()},[o,r]),o?b.jsx(v4,{styles:o}):null}const GA={};function qA(e,t,r,n=!1){return v.useMemo(()=>{const o=e&&t[e]||t;if(typeof r=="function"){const i=r(o),a=e?{...t,[e]:i}:i;return n?()=>a:a}return e?{...t,[e]:r}:{...t,...r}},[e,t,r,n])}function T4(e){const{children:t,theme:r,themeId:n}=e,o=u6(GA),i=h6()||GA,a=qA(n,o,r),s=qA(n,i,r,!0),l=(n?a[n]:a).direction==="rtl",u=TX(a);return b.jsx(xX,{theme:s,children:b.jsx(th.Provider,{value:a,children:b.jsx(SX,{value:l,children:b.jsxs(CX,{value:n?a[n].components:a.components,children:[u,t]})})})})}const KA={theme:void 0};function IX(e){let t,r;return function(o){let i=t;return(i===void 0||o.theme!==r)&&(KA.theme=o.theme,i=x4(e(KA)),t=i,r=o.theme),i}}const m6="mode",g6="color-scheme",OX="data-color-scheme";function _X(e){const{defaultMode:t="system",defaultLightColorScheme:r="light",defaultDarkColorScheme:n="dark",modeStorageKey:o=m6,colorSchemeStorageKey:i=g6,attribute:a=OX,colorSchemeNode:s="document.documentElement",nonce:l}=e||{};let u="",c=a;if(a==="class"&&(c=".%s"),a==="data"&&(c="[data-%s]"),c.startsWith(".")){const f=c.substring(1);u+=`${s}.classList.remove('${f}'.replace('%s', light), '${f}'.replace('%s', dark)); + ${s}.classList.add('${f}'.replace('%s', colorScheme));`}const d=c.match(/\[([^[\]]+)\]/);if(d){const[f,p]=d[1].split("=");p||(u+=`${s}.removeAttribute('${f}'.replace('%s', light)); + ${s}.removeAttribute('${f}'.replace('%s', dark));`),u+=` + ${s}.setAttribute('${f}'.replace('%s', colorScheme), ${p?`${p}.replace('%s', colorScheme)`:'""'});`}else c!==".%s"&&(u+=`${s}.setAttribute('${c}', colorScheme);`);return b.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?l:"",dangerouslySetInnerHTML:{__html:`(function() { +try { + let colorScheme = ''; + const mode = localStorage.getItem('${o}') || '${t}'; + const dark = localStorage.getItem('${i}-dark') || '${n}'; + const light = localStorage.getItem('${i}-light') || '${r}'; + if (mode === 'system') { + // handle system mode + const mql = window.matchMedia('(prefers-color-scheme: dark)'); + if (mql.matches) { + colorScheme = dark + } else { + colorScheme = light + } + } + if (mode === 'light') { + colorScheme = light; + } + if (mode === 'dark') { + colorScheme = dark; + } + if (colorScheme) { + ${u} + } +} catch(e){}})();`}},"mui-color-scheme-init")}function $X(){}const RX=({key:e,storageWindow:t})=>(!t&&typeof window<"u"&&(t=window),{get(r){if(typeof window>"u")return;if(!t)return r;let n;try{n=t.localStorage.getItem(e)}catch{}return n||r},set:r=>{if(t)try{t.localStorage.setItem(e,r)}catch{}},subscribe:r=>{if(!t)return $X;const n=o=>{const i=o.newValue;o.key===e&&r(i)};return t.addEventListener("storage",n),()=>{t.removeEventListener("storage",n)}}});function m1(){}function ZA(e){if(typeof window<"u"&&typeof window.matchMedia=="function"&&e==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function I4(e,t){if(e.mode==="light"||e.mode==="system"&&e.systemMode==="light")return t("light");if(e.mode==="dark"||e.mode==="system"&&e.systemMode==="dark")return t("dark")}function jX(e){return I4(e,t=>{if(t==="light")return e.lightColorScheme;if(t==="dark")return e.darkColorScheme})}function MX(e){const{defaultMode:t="light",defaultLightColorScheme:r,defaultDarkColorScheme:n,supportedColorSchemes:o=[],modeStorageKey:i=m6,colorSchemeStorageKey:a=g6,storageWindow:s=typeof window>"u"?void 0:window,storageManager:l=RX,noSsr:u=!1}=e,c=o.join(","),d=o.length>1,f=v.useMemo(()=>l==null?void 0:l({key:i,storageWindow:s}),[l,i,s]),p=v.useMemo(()=>l==null?void 0:l({key:`${a}-light`,storageWindow:s}),[l,a,s]),h=v.useMemo(()=>l==null?void 0:l({key:`${a}-dark`,storageWindow:s}),[l,a,s]),[m,g]=v.useState(()=>{const I=(f==null?void 0:f.get(t))||t,O=(p==null?void 0:p.get(r))||r,_=(h==null?void 0:h.get(n))||n;return{mode:I,systemMode:ZA(I),lightColorScheme:O,darkColorScheme:_}}),[y,w]=v.useState(u||!d);v.useEffect(()=>{w(!0)},[]);const S=jX(m),x=v.useCallback(I=>{g(O=>{if(I===O.mode)return O;const _=I??t;return f==null||f.set(_),{...O,mode:_,systemMode:ZA(_)}})},[f,t]),P=v.useCallback(I=>{I?typeof I=="string"?I&&!c.includes(I)?console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`):g(O=>{const _={...O};return I4(O,R=>{R==="light"&&(p==null||p.set(I),_.lightColorScheme=I),R==="dark"&&(h==null||h.set(I),_.darkColorScheme=I)}),_}):g(O=>{const _={...O},R=I.light===null?r:I.light,E=I.dark===null?n:I.dark;return R&&(c.includes(R)?(_.lightColorScheme=R,p==null||p.set(R)):console.error(`\`${R}\` does not exist in \`theme.colorSchemes\`.`)),E&&(c.includes(E)?(_.darkColorScheme=E,h==null||h.set(E)):console.error(`\`${E}\` does not exist in \`theme.colorSchemes\`.`)),_}):g(O=>(p==null||p.set(r),h==null||h.set(n),{...O,lightColorScheme:r,darkColorScheme:n}))},[c,p,h,r,n]),A=v.useCallback(I=>{m.mode==="system"&&g(O=>{const _=I!=null&&I.matches?"dark":"light";return O.systemMode===_?O:{...O,systemMode:_}})},[m.mode]),T=v.useRef(A);return T.current=A,v.useEffect(()=>{if(typeof window.matchMedia!="function"||!d)return;const I=(..._)=>T.current(..._),O=window.matchMedia("(prefers-color-scheme: dark)");return O.addListener(I),I(O),()=>{O.removeListener(I)}},[d]),v.useEffect(()=>{if(d){const I=(f==null?void 0:f.subscribe(R=>{(!R||["light","dark","system"].includes(R))&&x(R||t)}))||m1,O=(p==null?void 0:p.subscribe(R=>{(!R||c.match(R))&&P({light:R})}))||m1,_=(h==null?void 0:h.subscribe(R=>{(!R||c.match(R))&&P({dark:R})}))||m1;return()=>{I(),O(),_()}}},[P,x,c,t,s,d,f,p,h]),{...m,mode:y?m.mode:void 0,systemMode:y?m.systemMode:void 0,colorScheme:y?S:void 0,setMode:x,setColorScheme:P}}const NX="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function BX(e){const{themeId:t,theme:r={},modeStorageKey:n=m6,colorSchemeStorageKey:o=g6,disableTransitionOnChange:i=!1,defaultColorScheme:a,resolveTheme:s}=e,l={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},u=v.createContext(void 0),c=()=>v.useContext(u)||l,d={},f={};function p(y){var Lt,Kt,bt,or;const{children:w,theme:S,modeStorageKey:x=n,colorSchemeStorageKey:P=o,disableTransitionOnChange:A=i,storageManager:T,storageWindow:I=typeof window>"u"?void 0:window,documentNode:O=typeof document>"u"?void 0:document,colorSchemeNode:_=typeof document>"u"?void 0:document.documentElement,disableNestedContext:R=!1,disableStyleSheetGeneration:E=!1,defaultMode:M="system",forceThemeRerender:B=!1,noSsr:j}=y,N=v.useRef(!1),F=h6(),D=v.useContext(u),z=!!D&&!R,W=v.useMemo(()=>S||(typeof r=="function"?r():r),[S]),H=W[t],V=H||W,{colorSchemes:Q=d,components:re=f,cssVarPrefix:Y}=V,Z=Object.keys(Q).filter($=>!!Q[$]).join(","),ie=v.useMemo(()=>Z.split(","),[Z]),me=typeof a=="string"?a:a.light,G=typeof a=="string"?a:a.dark,oe=Q[me]&&Q[G]?M:((Kt=(Lt=Q[V.defaultColorScheme])==null?void 0:Lt.palette)==null?void 0:Kt.mode)||((bt=V.palette)==null?void 0:bt.mode),{mode:de,setMode:q,systemMode:Ee,lightColorScheme:ce,darkColorScheme:ue,colorScheme:ye,setColorScheme:Pe}=MX({supportedColorSchemes:ie,defaultLightColorScheme:me,defaultDarkColorScheme:G,modeStorageKey:x,colorSchemeStorageKey:P,defaultMode:oe,storageManager:T,storageWindow:I,noSsr:j});let Ne=de,Ue=ye;z&&(Ne=D.mode,Ue=D.colorScheme);let Ke=Ue||V.defaultColorScheme;V.vars&&!B&&(Ke=V.defaultColorScheme);const We=v.useMemo(()=>{var k;const $=((k=V.generateThemeVars)==null?void 0:k.call(V))||V.vars,C={...V,components:re,colorSchemes:Q,cssVarPrefix:Y,vars:$};if(typeof C.generateSpacing=="function"&&(C.spacing=C.generateSpacing()),Ke){const L=Q[Ke];L&&typeof L=="object"&&Object.keys(L).forEach(U=>{L[U]&&typeof L[U]=="object"?C[U]={...C[U],...L[U]}:C[U]=L[U]})}return s?s(C):C},[V,Ke,re,Q,Y]),Ae=V.colorSchemeSelector;$n(()=>{if(Ue&&_&&Ae&&Ae!=="media"){const $=Ae;let C=Ae;if($==="class"&&(C=".%s"),$==="data"&&(C="[data-%s]"),$!=null&&$.startsWith("data-")&&!$.includes("%s")&&(C=`[${$}="%s"]`),C.startsWith("."))_.classList.remove(...ie.map(k=>C.substring(1).replace("%s",k))),_.classList.add(C.substring(1).replace("%s",Ue));else{const k=C.replace("%s",Ue).match(/\[([^\]]+)\]/);if(k){const[L,U]=k[1].split("=");U||ie.forEach(K=>{_.removeAttribute(L.replace(Ue,K))}),_.setAttribute(L,U?U.replace(/"|'/g,""):"")}else _.setAttribute(C,Ue)}}},[Ue,Ae,_,ie]),v.useEffect(()=>{let $;if(A&&N.current&&O){const C=O.createElement("style");C.appendChild(O.createTextNode(NX)),O.head.appendChild(C),window.getComputedStyle(O.body),$=setTimeout(()=>{O.head.removeChild(C)},1)}return()=>{clearTimeout($)}},[Ue,A,O]),v.useEffect(()=>(N.current=!0,()=>{N.current=!1}),[]);const qt=v.useMemo(()=>({allColorSchemes:ie,colorScheme:Ue,darkColorScheme:ue,lightColorScheme:ce,mode:Ne,setColorScheme:Pe,setMode:q,systemMode:Ee}),[ie,Ue,ue,ce,Ne,Pe,q,Ee,We.colorSchemeSelector]);let Xe=!0;(E||V.cssVariables===!1||z&&(F==null?void 0:F.cssVarPrefix)===Y)&&(Xe=!1);const Ct=b.jsxs(v.Fragment,{children:[b.jsx(T4,{themeId:H?t:void 0,theme:We,children:w}),Xe&&b.jsx(u4,{styles:((or=We.generateStyleSheets)==null?void 0:or.call(We))||[]})]});return z?Ct:b.jsx(u.Provider,{value:qt,children:Ct})}const h=typeof a=="string"?a:a.light,m=typeof a=="string"?a:a.dark;return{CssVarsProvider:p,useColorScheme:c,getInitColorSchemeScript:y=>_X({colorSchemeStorageKey:o,defaultLightColorScheme:h,defaultDarkColorScheme:m,modeStorageKey:n,...y})}}function LX(e=""){function t(...n){if(!n.length)return"";const o=n[0];return typeof o=="string"&&!o.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${o}${t(...n.slice(1))})`:`, ${o}`}return(n,...o)=>`var(--${e?`${e}-`:""}${n}${t(...o)})`}const YA=(e,t,r,n=[])=>{let o=e;t.forEach((i,a)=>{a===t.length-1?Array.isArray(o)?o[Number(i)]=r:o&&typeof o=="object"&&(o[i]=r):o&&typeof o=="object"&&(o[i]||(o[i]=n.includes(i)?[]:{}),o=o[i])})},DX=(e,t,r)=>{function n(o,i=[],a=[]){Object.entries(o).forEach(([s,l])=>{(!r||r&&!r([...i,s]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?n(l,[...i,s],Array.isArray(l)?[...a,s]:a):t([...i,s],l,a))})}n(e)},zX=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(n=>e.includes(n))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function g1(e,t){const{prefix:r,shouldSkipGeneratingVar:n}=t||{},o={},i={},a={};return DX(e,(s,l,u)=>{if((typeof l=="string"||typeof l=="number")&&(!n||!n(s,l))){const c=`--${r?`${r}-`:""}${s.join("-")}`,d=zX(s,l);Object.assign(o,{[c]:d}),YA(i,s,`var(${c})`,u),YA(a,s,`var(${c}, ${d})`,u)}},s=>s[0]==="vars"),{css:o,vars:i,varsWithDefaults:a}}function FX(e,t={}){const{getSelector:r=y,disableCssColorScheme:n,colorSchemeSelector:o,enableContrastVars:i}=t,{colorSchemes:a={},components:s,defaultColorScheme:l="light",...u}=e,{vars:c,css:d,varsWithDefaults:f}=g1(u,t);let p=f;const h={},{[l]:m,...g}=a;if(Object.entries(g||{}).forEach(([x,P])=>{const{vars:A,css:T,varsWithDefaults:I}=g1(P,t);p=vr(p,I),h[x]={css:T,vars:A}}),m){const{css:x,vars:P,varsWithDefaults:A}=g1(m,t);p=vr(p,A),h[l]={css:x,vars:P}}function y(x,P){var T,I;let A=o;if(o==="class"&&(A=".%s"),o==="data"&&(A="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(A=`[${o}="%s"]`),x){if(A==="media")return e.defaultColorScheme===x?":root":{[`@media (prefers-color-scheme: ${((I=(T=a[x])==null?void 0:T.palette)==null?void 0:I.mode)||x})`]:{":root":P}};if(A)return e.defaultColorScheme===x?`:root, ${A.replace("%s",String(x))}`:A.replace("%s",String(x))}return":root"}return{vars:p,generateThemeVars:()=>{let x={...c};return Object.entries(h).forEach(([,{vars:P}])=>{x=vr(x,P)}),x},generateStyleSheets:()=>{var O,_;const x=[],P=e.defaultColorScheme||"light";function A(R,E){Object.keys(E).length&&x.push(typeof R=="string"?{[R]:{...E}}:R)}A(r(void 0,{...d}),d);const{[P]:T,...I}=h;if(T){const{css:R}=T,E=(_=(O=a[P])==null?void 0:O.palette)==null?void 0:_.mode,M=!n&&E?{colorScheme:E,...R}:{...R};A(r(P,{...M}),M)}return Object.entries(I).forEach(([R,{css:E}])=>{var j,N;const M=(N=(j=a[R])==null?void 0:j.palette)==null?void 0:N.mode,B=!n&&M?{colorScheme:M,...E}:{...E};A(r(R,{...B}),B)}),i&&x.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),x}}}function UX(e){return function(r){return e==="media"?`@media (prefers-color-scheme: ${r})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${r}"] &`:e==="class"?`.${r} &`:e==="data"?`[data-${r}] &`:`${e.replace("%s",r)} &`:"&"}}function _e(e,t,r=void 0){const n={};for(const o in e){const i=e[o];let a="",s=!0;for(let l=0;l{const{ownerState:r}=e;return[t.root,t[`maxWidth${te(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),VX=e=>f6({props:e,name:"MuiContainer",defaultTheme:WX}),GX=(e,t)=>{const r=l=>Oe(t,l),{classes:n,fixed:o,disableGutters:i,maxWidth:a}=e,s={root:["root",a&&`maxWidth${te(String(a))}`,o&&"fixed",i&&"disableGutters"]};return _e(s,r,n)};function qX(e={}){const{createStyledComponent:t=HX,useThemeProps:r=VX,componentName:n="MuiContainer"}=e,o=t(({theme:a,ownerState:s})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!s.disableGutters&&{paddingLeft:a.spacing(2),paddingRight:a.spacing(2),[a.breakpoints.up("sm")]:{paddingLeft:a.spacing(3),paddingRight:a.spacing(3)}}}),({theme:a,ownerState:s})=>s.fixed&&Object.keys(a.breakpoints.values).reduce((l,u)=>{const c=u,d=a.breakpoints.values[c];return d!==0&&(l[a.breakpoints.up(c)]={maxWidth:`${d}${a.breakpoints.unit}`}),l},{}),({theme:a,ownerState:s})=>({...s.maxWidth==="xs"&&{[a.breakpoints.up("xs")]:{maxWidth:Math.max(a.breakpoints.values.xs,444)}},...s.maxWidth&&s.maxWidth!=="xs"&&{[a.breakpoints.up(s.maxWidth)]:{maxWidth:`${a.breakpoints.values[s.maxWidth]}${a.breakpoints.unit}`}}}));return v.forwardRef(function(s,l){const u=r(s),{className:c,component:d="div",disableGutters:f=!1,fixed:p=!1,maxWidth:h="lg",classes:m,...g}=u,y={...u,component:d,disableGutters:f,fixed:p,maxWidth:h},w=GX(y,n);return b.jsx(o,{as:d,ownerState:y,className:se(w.root,c),ref:l,...g})})}function W0(e,t){var r,n,o;return v.isValidElement(e)&&t.indexOf(e.type.muiName??((o=(n=(r=e.type)==null?void 0:r._payload)==null?void 0:n.value)==null?void 0:o.muiName))!==-1}const KX=(e,t)=>e.filter(r=>t.includes(r)),Xu=(e,t,r)=>{const n=e.keys[0];Array.isArray(t)?t.forEach((o,i)=>{r((a,s)=>{i<=e.keys.length-1&&(i===0?Object.assign(a,s):a[e.up(e.keys[i])]=s)},o)}):t&&typeof t=="object"?(Object.keys(t).length>e.keys.length?e.keys:KX(e.keys,Object.keys(t))).forEach(i=>{if(e.keys.includes(i)){const a=t[i];a!==void 0&&r((s,l)=>{n===i?Object.assign(s,l):s[e.up(i)]=l},a)}}):(typeof t=="number"||typeof t=="string")&&r((o,i)=>{Object.assign(o,i)},t)};function Nm(e){return`--Grid-${e}Spacing`}function uv(e){return`--Grid-parent-${e}Spacing`}const XA="--Grid-columns",Kc="--Grid-parent-columns",ZX=({theme:e,ownerState:t})=>{const r={};return Xu(e.breakpoints,t.size,(n,o)=>{let i={};o==="grow"&&(i={flexBasis:0,flexGrow:1,maxWidth:"100%"}),o==="auto"&&(i={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof o=="number"&&(i={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${o} / var(${Kc}) - (var(${Kc}) - ${o}) * (var(${uv("column")}) / var(${Kc})))`}),n(r,i)}),r},YX=({theme:e,ownerState:t})=>{const r={};return Xu(e.breakpoints,t.offset,(n,o)=>{let i={};o==="auto"&&(i={marginLeft:"auto"}),typeof o=="number"&&(i={marginLeft:o===0?"0px":`calc(100% * ${o} / var(${Kc}) + var(${uv("column")}) * ${o} / var(${Kc}))`}),n(r,i)}),r},XX=({theme:e,ownerState:t})=>{if(!t.container)return{};const r={[XA]:12};return Xu(e.breakpoints,t.columns,(n,o)=>{const i=o??12;n(r,{[XA]:i,"> *":{[Kc]:i}})}),r},QX=({theme:e,ownerState:t})=>{if(!t.container)return{};const r={};return Xu(e.breakpoints,t.rowSpacing,(n,o)=>{var a;const i=typeof o=="string"?o:(a=e.spacing)==null?void 0:a.call(e,o);n(r,{[Nm("row")]:i,"> *":{[uv("row")]:i}})}),r},JX=({theme:e,ownerState:t})=>{if(!t.container)return{};const r={};return Xu(e.breakpoints,t.columnSpacing,(n,o)=>{var a;const i=typeof o=="string"?o:(a=e.spacing)==null?void 0:a.call(e,o);n(r,{[Nm("column")]:i,"> *":{[uv("column")]:i}})}),r},eQ=({theme:e,ownerState:t})=>{if(!t.container)return{};const r={};return Xu(e.breakpoints,t.direction,(n,o)=>{n(r,{flexDirection:o})}),r},tQ=({ownerState:e})=>({minWidth:0,boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",...e.wrap&&e.wrap!=="wrap"&&{flexWrap:e.wrap},gap:`var(${Nm("row")}) var(${Nm("column")})`}}),rQ=e=>{const t=[];return Object.entries(e).forEach(([r,n])=>{n!==!1&&n!==void 0&&t.push(`grid-${r}-${String(n)}`)}),t},nQ=(e,t="xs")=>{function r(n){return n===void 0?!1:typeof n=="string"&&!Number.isNaN(Number(n))||typeof n=="number"&&n>0}if(r(e))return[`spacing-${t}-${String(e)}`];if(typeof e=="object"&&!Array.isArray(e)){const n=[];return Object.entries(e).forEach(([o,i])=>{r(i)&&n.push(`spacing-${o}-${String(i)}`)}),n}return[]},oQ=e=>e===void 0?[]:typeof e=="object"?Object.entries(e).map(([t,r])=>`direction-${t}-${r}`):[`direction-xs-${String(e)}`];function iQ(e,t){e.item!==void 0&&delete e.item,e.zeroMinWidth!==void 0&&delete e.zeroMinWidth,t.keys.forEach(r=>{e[r]!==void 0&&delete e[r]})}const aQ=Yu(),sQ=d6("div",{name:"MuiGrid",slot:"Root"});function lQ(e){return f6({props:e,name:"MuiGrid",defaultTheme:aQ})}function cQ(e={}){const{createStyledComponent:t=sQ,useThemeProps:r=lQ,useTheme:n=oh,componentName:o="MuiGrid"}=e,i=(u,c)=>{const{container:d,direction:f,spacing:p,wrap:h,size:m}=u,g={root:["root",d&&"container",h!=="wrap"&&`wrap-xs-${String(h)}`,...oQ(f),...rQ(m),...d?nQ(p,c.breakpoints.keys[0]):[]]};return _e(g,y=>Oe(o,y),{})};function a(u,c,d=()=>!0){const f={};return u===null||(Array.isArray(u)?u.forEach((p,h)=>{p!==null&&d(p)&&c.keys[h]&&(f[c.keys[h]]=p)}):typeof u=="object"?Object.keys(u).forEach(p=>{const h=u[p];h!=null&&d(h)&&(f[p]=h)}):f[c.keys[0]]=u),f}const s=t(XX,JX,QX,ZX,eQ,tQ,YX),l=v.forwardRef(function(c,d){const f=n(),p=r(c),h=av(p);iQ(h,f.breakpoints);const{className:m,children:g,columns:y=12,container:w=!1,component:S="div",direction:x="row",wrap:P="wrap",size:A={},offset:T={},spacing:I=0,rowSpacing:O=I,columnSpacing:_=I,unstable_level:R=0,...E}=h,M=a(A,f.breakpoints,H=>H!==!1),B=a(T,f.breakpoints),j=c.columns??(R?void 0:y),N=c.spacing??(R?void 0:I),F=c.rowSpacing??c.spacing??(R?void 0:O),D=c.columnSpacing??c.spacing??(R?void 0:_),z={...h,level:R,columns:j,container:w,direction:x,wrap:P,spacing:N,rowSpacing:F,columnSpacing:D,size:M,offset:B},W=i(z,f);return b.jsx(s,{ref:d,as:S,ownerState:z,className:se(W.root,m),...E,children:v.Children.map(g,H=>{var V;return v.isValidElement(H)&&W0(H,["Grid"])&&w&&H.props.container?v.cloneElement(H,{unstable_level:((V=H.props)==null?void 0:V.unstable_level)??R+1}):H})})});return l.muiName="Grid",l}const uQ=Yu(),dQ=d6("div",{name:"MuiStack",slot:"Root"});function fQ(e){return f6({props:e,name:"MuiStack",defaultTheme:uQ})}function pQ(e,t){const r=v.Children.toArray(e).filter(Boolean);return r.reduce((n,o,i)=>(n.push(o),i({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],mQ=({ownerState:e,theme:t})=>{let r={display:"flex",flexDirection:"column",...Bo({theme:t},f1({values:e.direction,breakpoints:t.breakpoints.values}),n=>({flexDirection:n}))};if(e.spacing){const n=ev(t),o=Object.keys(t.breakpoints.values).reduce((l,u)=>((typeof e.spacing=="object"&&e.spacing[u]!=null||typeof e.direction=="object"&&e.direction[u]!=null)&&(l[u]=!0),l),{}),i=f1({values:e.direction,base:o}),a=f1({values:e.spacing,base:o});typeof i=="object"&&Object.keys(i).forEach((l,u,c)=>{if(!i[l]){const f=u>0?i[c[u-1]]:"column";i[l]=f}}),r=vr(r,Bo({theme:t},a,(l,u)=>e.useFlexGap?{gap:jl(n,l)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${hQ(u?i[u]:e.direction)}`]:jl(n,l)}}))}return r=dY(t.breakpoints,r),r};function gQ(e={}){const{createStyledComponent:t=dQ,useThemeProps:r=fQ,componentName:n="MuiStack"}=e,o=()=>_e({root:["root"]},l=>Oe(n,l),{}),i=t(mQ);return v.forwardRef(function(l,u){const c=r(l),d=av(c),{component:f="div",direction:p="column",spacing:h=0,divider:m,children:g,className:y,useFlexGap:w=!1,...S}=d,x={direction:p,spacing:h,useFlexGap:w},P=o();return b.jsx(i,{as:f,ownerState:x,ref:u,className:se(P.root,y),...S,children:m?pQ(g,m):g})})}function O4(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:ip.white,default:ip.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const _4=O4();function $4(){return{text:{primary:ip.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:ip.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const jx=$4();function QA(e,t,r,n){const o=n.light||n,i=n.dark||n*1.5;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:t==="light"?e.light=cv(e.main,o):t==="dark"&&(e.dark=lv(e.main,i)))}function JA(e,t,r,n,o){const i=o.light||o,a=o.dark||o*1.5;t[r]||(t.hasOwnProperty(n)?t[r]=t[n]:r==="light"?t.light=`color-mix(in ${e}, ${t.main}, #fff ${(i*100).toFixed(0)}%)`:r==="dark"&&(t.dark=`color-mix(in ${e}, ${t.main}, #000 ${(a*100).toFixed(0)}%)`))}function yQ(e="light"){return e==="dark"?{main:zi[200],light:zi[50],dark:zi[400]}:{main:zi[700],light:zi[400],dark:zi[800]}}function vQ(e="light"){return e==="dark"?{main:rc[200],light:rc[50],dark:rc[400]}:{main:rc[500],light:rc[300],dark:rc[700]}}function bQ(e="light"){return e==="dark"?{main:Vs[500],light:Vs[300],dark:Vs[700]}:{main:Vs[700],light:Vs[400],dark:Vs[800]}}function wQ(e="light"){return e==="dark"?{main:nc[400],light:nc[300],dark:nc[700]}:{main:nc[700],light:nc[500],dark:nc[900]}}function xQ(e="light"){return e==="dark"?{main:Ba[400],light:Ba[300],dark:Ba[700]}:{main:Ba[800],light:Ba[500],dark:Ba[900]}}function SQ(e="light"){return e==="dark"?{main:dc[400],light:dc[300],dark:dc[700]}:{main:"#ed6c02",light:dc[500],dark:dc[900]}}function CQ(e){return`oklch(from ${e} var(--__l) 0 h / var(--__a))`}function y6(e){const{mode:t="light",contrastThreshold:r=3,tonalOffset:n=.2,colorSpace:o,...i}=e,a=e.primary||yQ(t),s=e.secondary||vQ(t),l=e.error||bQ(t),u=e.info||wQ(t),c=e.success||xQ(t),d=e.warning||SQ(t);function f(g){return o?CQ(g):gX(g,jx.text.primary)>=r?jx.text.primary:_4.text.primary}const p=({color:g,name:y,mainShade:w=500,lightShade:S=300,darkShade:x=700})=>{if(g={...g},!g.main&&g[w]&&(g.main=g[w]),!g.hasOwnProperty("main"))throw new Error(ia(11,y?` (${y})`:"",w));if(typeof g.main!="string")throw new Error(ia(12,y?` (${y})`:"",JSON.stringify(g.main)));return o?(JA(o,g,"light",S,n),JA(o,g,"dark",x,n)):(QA(g,"light",S,n),QA(g,"dark",x,n)),g.contrastText||(g.contrastText=f(g.main)),g};let h;return t==="light"?h=O4():t==="dark"&&(h=$4()),vr({common:{...ip},mode:t,primary:p({color:a,name:"primary"}),secondary:p({color:s,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:p({color:l,name:"error"}),warning:p({color:d,name:"warning"}),info:p({color:u,name:"info"}),success:p({color:c,name:"success"}),grey:fc,contrastThreshold:r,getContrastText:f,augmentColor:p,tonalOffset:n,...h},i)}function EQ(e){const t={};return Object.entries(e).forEach(n=>{const[o,i]=n;typeof i=="object"&&(t[o]=`${i.fontStyle?`${i.fontStyle} `:""}${i.fontVariant?`${i.fontVariant} `:""}${i.fontWeight?`${i.fontWeight} `:""}${i.fontStretch?`${i.fontStretch} `:""}${i.fontSize||""}${i.lineHeight?`/${i.lineHeight} `:""}${i.fontFamily||""}`)}),t}function PQ(e,t){return{toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}},...t}}function AQ(e){return Math.round(e*1e5)/1e5}const ek={textTransform:"uppercase"},tk='"Roboto", "Helvetica", "Arial", sans-serif';function R4(e,t){const{fontFamily:r=tk,fontSize:n=14,fontWeightLight:o=300,fontWeightRegular:i=400,fontWeightMedium:a=500,fontWeightBold:s=700,htmlFontSize:l=16,allVariants:u,pxToRem:c,...d}=typeof t=="function"?t(e):t,f=n/14,p=c||(g=>`${g/l*f}rem`),h=(g,y,w,S,x)=>({fontFamily:r,fontWeight:g,fontSize:p(y),lineHeight:w,...r===tk?{letterSpacing:`${AQ(S/y)}em`}:{},...x,...u}),m={h1:h(o,96,1.167,-1.5),h2:h(o,60,1.2,-.5),h3:h(i,48,1.167,0),h4:h(i,34,1.235,.25),h5:h(i,24,1.334,0),h6:h(a,20,1.6,.15),subtitle1:h(i,16,1.75,.15),subtitle2:h(a,14,1.57,.1),body1:h(i,16,1.5,.15),body2:h(i,14,1.43,.15),button:h(a,14,1.75,.4,ek),caption:h(i,12,1.66,.4),overline:h(i,12,2.66,1,ek),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return vr({htmlFontSize:l,pxToRem:p,fontFamily:r,fontSize:n,fontWeightLight:o,fontWeightRegular:i,fontWeightMedium:a,fontWeightBold:s,...m},d,{clone:!1})}const kQ=.2,TQ=.14,IQ=.12;function It(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${kQ})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${TQ})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${IQ})`].join(",")}const OQ=["none",It(0,2,1,-1,0,1,1,0,0,1,3,0),It(0,3,1,-2,0,2,2,0,0,1,5,0),It(0,3,3,-2,0,3,4,0,0,1,8,0),It(0,2,4,-1,0,4,5,0,0,1,10,0),It(0,3,5,-1,0,5,8,0,0,1,14,0),It(0,3,5,-1,0,6,10,0,0,1,18,0),It(0,4,5,-2,0,7,10,1,0,2,16,1),It(0,5,5,-3,0,8,10,1,0,3,14,2),It(0,5,6,-3,0,9,12,1,0,3,16,2),It(0,6,6,-3,0,10,14,1,0,4,18,3),It(0,6,7,-4,0,11,15,1,0,4,20,3),It(0,7,8,-4,0,12,17,2,0,5,22,4),It(0,7,8,-4,0,13,19,2,0,5,24,4),It(0,7,9,-4,0,14,21,2,0,5,26,4),It(0,8,9,-5,0,15,22,2,0,6,28,5),It(0,8,10,-5,0,16,24,2,0,6,30,5),It(0,8,11,-5,0,17,26,2,0,6,32,5),It(0,9,11,-5,0,18,28,2,0,7,34,6),It(0,9,12,-6,0,19,29,2,0,7,36,6),It(0,10,13,-6,0,20,31,3,0,8,38,7),It(0,10,13,-6,0,21,33,3,0,8,40,7),It(0,10,14,-6,0,22,35,3,0,8,42,7),It(0,11,14,-7,0,23,36,3,0,9,44,8),It(0,11,15,-7,0,24,38,3,0,9,46,8)],_Q={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},j4={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function rk(e){return`${Math.round(e)}ms`}function $Q(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*t**.25+t/5)*10),3e3)}function RQ(e){const t={..._Q,...e.easing},r={...j4,...e.duration};return{getAutoHeightDuration:$Q,create:(o=["all"],i={})=>{const{duration:a=r.standard,easing:s=t.easeInOut,delay:l=0,...u}=i;return(Array.isArray(o)?o:[o]).map(c=>`${c} ${typeof a=="string"?a:rk(a)} ${s} ${typeof l=="string"?l:rk(l)}`).join(",")},...e,easing:t,duration:r}}const jQ={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function MQ(e){return li(e)||typeof e>"u"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function M4(e={}){const t={...e};function r(n){const o=Object.entries(n);for(let i=0;i{if(!Number.isNaN(+e))return+e;const t=e.match(/\d*\.?\d+/g);if(!t)return 0;let r=0;for(let n=0;nvr(h,m),p),p.unstable_sxConfig={...nh,...c==null?void 0:c.unstable_sxConfig},p.unstable_sx=function(m){return hs({sx:m,theme:this})},p.toRuntimeSource=M4,BQ(p),p}function Nx(e){let t;return e<1?t=5.11916*e**2:t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const LQ=[...Array(25)].map((e,t)=>{if(t===0)return"none";const r=Nx(t);return`linear-gradient(rgba(255 255 255 / ${r}), rgba(255 255 255 / ${r}))`});function N4(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function B4(e){return e==="dark"?LQ:[]}function DQ(e){const{palette:t={mode:"light"},opacity:r,overlays:n,colorSpace:o,...i}=e,a=y6({...t,colorSpace:o});return{palette:a,opacity:{...N4(a.mode),...r},overlays:n||B4(a.mode),...i}}function zQ(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const FQ=e=>[...[...Array(25)].map((t,r)=>`--${e?`${e}-`:""}overlays-${r}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],UQ=e=>(t,r)=>{const n=e.rootSelector||":root",o=e.colorSchemeSelector;let i=o;if(o==="class"&&(i=".%s"),o==="data"&&(i="[data-%s]"),o!=null&&o.startsWith("data-")&&!o.includes("%s")&&(i=`[${o}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const a={};return FQ(e.cssVarPrefix).forEach(s=>{a[s]=r[s],delete r[s]}),i==="media"?{[n]:r,"@media (prefers-color-scheme: dark)":{[n]:a}}:i?{[i.replace("%s",t)]:a,[`${n}, ${i.replace("%s",t)}`]:r}:{[n]:{...r,...a}}}if(i&&i!=="media")return`${n}, ${i.replace("%s",String(t))}`}else if(t){if(i==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[n]:r}};if(i)return i.replace("%s",String(t))}return n};function WQ(e,t){t.forEach(r=>{e[r]||(e[r]={})})}function ee(e,t,r){!e[t]&&r&&(e[t]=r)}function Gd(e){return typeof e!="string"||!e.startsWith("hsl")?e:E4(e)}function ji(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Vd(Gd(e[t])))}function HQ(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const Zo=e=>{try{return e()}catch{}},VQ=(e="mui")=>LX(e);function y1(e,t,r,n,o){if(!r)return;r=r===!0?{}:r;const i=o==="dark"?"dark":"light";if(!n){t[o]=DQ({...r,palette:{mode:i,...r==null?void 0:r.palette},colorSpace:e});return}const{palette:a,...s}=Mx({...n,palette:{mode:i,...r==null?void 0:r.palette},colorSpace:e});return t[o]={...r,palette:a,opacity:{...N4(i),...r==null?void 0:r.opacity},overlays:(r==null?void 0:r.overlays)||B4(i)},s}function GQ(e={},...t){const{colorSchemes:r={light:!0},defaultColorScheme:n,disableCssColorScheme:o=!1,cssVarPrefix:i="mui",nativeColor:a=!1,shouldSkipGeneratingVar:s=zQ,colorSchemeSelector:l=r.light&&r.dark?"media":void 0,rootSelector:u=":root",...c}=e,d=Object.keys(r)[0],f=n||(r.light&&d!=="light"?"light":d),p=VQ(i),{[f]:h,light:m,dark:g,...y}=r,w={...y};let S=h;if((f==="dark"&&!("dark"in r)||f==="light"&&!("light"in r))&&(S=!0),!S)throw new Error(ia(21,f));let x;a&&(x="oklch");const P=y1(x,w,S,c,f);m&&!w.light&&y1(x,w,m,void 0,"light"),g&&!w.dark&&y1(x,w,g,void 0,"dark");let A={defaultColorScheme:f,...P,cssVarPrefix:i,colorSchemeSelector:l,rootSelector:u,getCssVar:p,colorSchemes:w,font:{...EQ(P.typography),...P.font},spacing:HQ(c.spacing)};Object.keys(A.colorSchemes).forEach(R=>{const E=A.colorSchemes[R].palette,M=j=>{const N=j.split("-"),F=N[1],D=N[2];return p(j,E[F][D])};E.mode==="light"&&(ee(E.common,"background","#fff"),ee(E.common,"onBackground","#000")),E.mode==="dark"&&(ee(E.common,"background","#000"),ee(E.common,"onBackground","#fff"));function B(j,N,F){if(x){let D;return j===Ds&&(D=`transparent ${((1-F)*100).toFixed(0)}%`),j===dt&&(D=`#000 ${(F*100).toFixed(0)}%`),j===ft&&(D=`#fff ${(F*100).toFixed(0)}%`),`color-mix(in ${x}, ${N}, ${D})`}return j(N,F)}if(WQ(E,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),E.mode==="light"){ee(E.Alert,"errorColor",B(dt,E.error.light,.6)),ee(E.Alert,"infoColor",B(dt,E.info.light,.6)),ee(E.Alert,"successColor",B(dt,E.success.light,.6)),ee(E.Alert,"warningColor",B(dt,E.warning.light,.6)),ee(E.Alert,"errorFilledBg",M("palette-error-main")),ee(E.Alert,"infoFilledBg",M("palette-info-main")),ee(E.Alert,"successFilledBg",M("palette-success-main")),ee(E.Alert,"warningFilledBg",M("palette-warning-main")),ee(E.Alert,"errorFilledColor",Zo(()=>E.getContrastText(E.error.main))),ee(E.Alert,"infoFilledColor",Zo(()=>E.getContrastText(E.info.main))),ee(E.Alert,"successFilledColor",Zo(()=>E.getContrastText(E.success.main))),ee(E.Alert,"warningFilledColor",Zo(()=>E.getContrastText(E.warning.main))),ee(E.Alert,"errorStandardBg",B(ft,E.error.light,.9)),ee(E.Alert,"infoStandardBg",B(ft,E.info.light,.9)),ee(E.Alert,"successStandardBg",B(ft,E.success.light,.9)),ee(E.Alert,"warningStandardBg",B(ft,E.warning.light,.9)),ee(E.Alert,"errorIconColor",M("palette-error-main")),ee(E.Alert,"infoIconColor",M("palette-info-main")),ee(E.Alert,"successIconColor",M("palette-success-main")),ee(E.Alert,"warningIconColor",M("palette-warning-main")),ee(E.AppBar,"defaultBg",M("palette-grey-100")),ee(E.Avatar,"defaultBg",M("palette-grey-400")),ee(E.Button,"inheritContainedBg",M("palette-grey-300")),ee(E.Button,"inheritContainedHoverBg",M("palette-grey-A100")),ee(E.Chip,"defaultBorder",M("palette-grey-400")),ee(E.Chip,"defaultAvatarColor",M("palette-grey-700")),ee(E.Chip,"defaultIconColor",M("palette-grey-700")),ee(E.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),ee(E.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),ee(E.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),ee(E.LinearProgress,"primaryBg",B(ft,E.primary.main,.62)),ee(E.LinearProgress,"secondaryBg",B(ft,E.secondary.main,.62)),ee(E.LinearProgress,"errorBg",B(ft,E.error.main,.62)),ee(E.LinearProgress,"infoBg",B(ft,E.info.main,.62)),ee(E.LinearProgress,"successBg",B(ft,E.success.main,.62)),ee(E.LinearProgress,"warningBg",B(ft,E.warning.main,.62)),ee(E.Skeleton,"bg",x?B(Ds,E.text.primary,.11):`rgba(${M("palette-text-primaryChannel")} / 0.11)`),ee(E.Slider,"primaryTrack",B(ft,E.primary.main,.62)),ee(E.Slider,"secondaryTrack",B(ft,E.secondary.main,.62)),ee(E.Slider,"errorTrack",B(ft,E.error.main,.62)),ee(E.Slider,"infoTrack",B(ft,E.info.main,.62)),ee(E.Slider,"successTrack",B(ft,E.success.main,.62)),ee(E.Slider,"warningTrack",B(ft,E.warning.main,.62));const j=x?B(dt,E.background.default,.6825):Qh(E.background.default,.8);ee(E.SnackbarContent,"bg",j),ee(E.SnackbarContent,"color",Zo(()=>x?jx.text.primary:E.getContrastText(j))),ee(E.SpeedDialAction,"fabHoverBg",Qh(E.background.paper,.15)),ee(E.StepConnector,"border",M("palette-grey-400")),ee(E.StepContent,"border",M("palette-grey-400")),ee(E.Switch,"defaultColor",M("palette-common-white")),ee(E.Switch,"defaultDisabledColor",M("palette-grey-100")),ee(E.Switch,"primaryDisabledColor",B(ft,E.primary.main,.62)),ee(E.Switch,"secondaryDisabledColor",B(ft,E.secondary.main,.62)),ee(E.Switch,"errorDisabledColor",B(ft,E.error.main,.62)),ee(E.Switch,"infoDisabledColor",B(ft,E.info.main,.62)),ee(E.Switch,"successDisabledColor",B(ft,E.success.main,.62)),ee(E.Switch,"warningDisabledColor",B(ft,E.warning.main,.62)),ee(E.TableCell,"border",B(ft,B(Ds,E.divider,1),.88)),ee(E.Tooltip,"bg",B(Ds,E.grey[700],.92))}if(E.mode==="dark"){ee(E.Alert,"errorColor",B(ft,E.error.light,.6)),ee(E.Alert,"infoColor",B(ft,E.info.light,.6)),ee(E.Alert,"successColor",B(ft,E.success.light,.6)),ee(E.Alert,"warningColor",B(ft,E.warning.light,.6)),ee(E.Alert,"errorFilledBg",M("palette-error-dark")),ee(E.Alert,"infoFilledBg",M("palette-info-dark")),ee(E.Alert,"successFilledBg",M("palette-success-dark")),ee(E.Alert,"warningFilledBg",M("palette-warning-dark")),ee(E.Alert,"errorFilledColor",Zo(()=>E.getContrastText(E.error.dark))),ee(E.Alert,"infoFilledColor",Zo(()=>E.getContrastText(E.info.dark))),ee(E.Alert,"successFilledColor",Zo(()=>E.getContrastText(E.success.dark))),ee(E.Alert,"warningFilledColor",Zo(()=>E.getContrastText(E.warning.dark))),ee(E.Alert,"errorStandardBg",B(dt,E.error.light,.9)),ee(E.Alert,"infoStandardBg",B(dt,E.info.light,.9)),ee(E.Alert,"successStandardBg",B(dt,E.success.light,.9)),ee(E.Alert,"warningStandardBg",B(dt,E.warning.light,.9)),ee(E.Alert,"errorIconColor",M("palette-error-main")),ee(E.Alert,"infoIconColor",M("palette-info-main")),ee(E.Alert,"successIconColor",M("palette-success-main")),ee(E.Alert,"warningIconColor",M("palette-warning-main")),ee(E.AppBar,"defaultBg",M("palette-grey-900")),ee(E.AppBar,"darkBg",M("palette-background-paper")),ee(E.AppBar,"darkColor",M("palette-text-primary")),ee(E.Avatar,"defaultBg",M("palette-grey-600")),ee(E.Button,"inheritContainedBg",M("palette-grey-800")),ee(E.Button,"inheritContainedHoverBg",M("palette-grey-700")),ee(E.Chip,"defaultBorder",M("palette-grey-700")),ee(E.Chip,"defaultAvatarColor",M("palette-grey-300")),ee(E.Chip,"defaultIconColor",M("palette-grey-300")),ee(E.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),ee(E.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),ee(E.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),ee(E.LinearProgress,"primaryBg",B(dt,E.primary.main,.5)),ee(E.LinearProgress,"secondaryBg",B(dt,E.secondary.main,.5)),ee(E.LinearProgress,"errorBg",B(dt,E.error.main,.5)),ee(E.LinearProgress,"infoBg",B(dt,E.info.main,.5)),ee(E.LinearProgress,"successBg",B(dt,E.success.main,.5)),ee(E.LinearProgress,"warningBg",B(dt,E.warning.main,.5)),ee(E.Skeleton,"bg",x?B(Ds,E.text.primary,.13):`rgba(${M("palette-text-primaryChannel")} / 0.13)`),ee(E.Slider,"primaryTrack",B(dt,E.primary.main,.5)),ee(E.Slider,"secondaryTrack",B(dt,E.secondary.main,.5)),ee(E.Slider,"errorTrack",B(dt,E.error.main,.5)),ee(E.Slider,"infoTrack",B(dt,E.info.main,.5)),ee(E.Slider,"successTrack",B(dt,E.success.main,.5)),ee(E.Slider,"warningTrack",B(dt,E.warning.main,.5));const j=x?B(ft,E.background.default,.985):Qh(E.background.default,.98);ee(E.SnackbarContent,"bg",j),ee(E.SnackbarContent,"color",Zo(()=>x?_4.text.primary:E.getContrastText(j))),ee(E.SpeedDialAction,"fabHoverBg",Qh(E.background.paper,.15)),ee(E.StepConnector,"border",M("palette-grey-600")),ee(E.StepContent,"border",M("palette-grey-600")),ee(E.Switch,"defaultColor",M("palette-grey-300")),ee(E.Switch,"defaultDisabledColor",M("palette-grey-600")),ee(E.Switch,"primaryDisabledColor",B(dt,E.primary.main,.55)),ee(E.Switch,"secondaryDisabledColor",B(dt,E.secondary.main,.55)),ee(E.Switch,"errorDisabledColor",B(dt,E.error.main,.55)),ee(E.Switch,"infoDisabledColor",B(dt,E.info.main,.55)),ee(E.Switch,"successDisabledColor",B(dt,E.success.main,.55)),ee(E.Switch,"warningDisabledColor",B(dt,E.warning.main,.55)),ee(E.TableCell,"border",B(dt,B(Ds,E.divider,1),.68)),ee(E.Tooltip,"bg",B(Ds,E.grey[700],.92))}ji(E.background,"default"),ji(E.background,"paper"),ji(E.common,"background"),ji(E.common,"onBackground"),ji(E,"divider"),Object.keys(E).forEach(j=>{const N=E[j];j!=="tonalOffset"&&N&&typeof N=="object"&&(N.main&&ee(E[j],"mainChannel",Vd(Gd(N.main))),N.light&&ee(E[j],"lightChannel",Vd(Gd(N.light))),N.dark&&ee(E[j],"darkChannel",Vd(Gd(N.dark))),N.contrastText&&ee(E[j],"contrastTextChannel",Vd(Gd(N.contrastText))),j==="text"&&(ji(E[j],"primary"),ji(E[j],"secondary")),j==="action"&&(N.active&&ji(E[j],"active"),N.selected&&ji(E[j],"selected")))})}),A=t.reduce((R,E)=>vr(R,E),A);const T={prefix:i,disableCssColorScheme:o,shouldSkipGeneratingVar:s,getSelector:UQ(A),enableContrastVars:a},{vars:I,generateThemeVars:O,generateStyleSheets:_}=FX(A,T);return A.vars=I,Object.entries(A.colorSchemes[A.defaultColorScheme]).forEach(([R,E])=>{A[R]=E}),A.generateThemeVars=O,A.generateStyleSheets=_,A.generateSpacing=function(){return y4(c.spacing,ev(this))},A.getColorSchemeSelector=UX(l),A.spacing=A.generateSpacing(),A.shouldSkipGeneratingVar=s,A.unstable_sxConfig={...nh,...c==null?void 0:c.unstable_sxConfig},A.unstable_sx=function(E){return hs({sx:E,theme:this})},A.toRuntimeSource=M4,A}function ok(e,t,r){e.colorSchemes&&r&&(e.colorSchemes[t]={...r!==!0&&r,palette:y6({...r===!0?{}:r.palette,mode:t})})}function dv(e={},...t){const{palette:r,cssVariables:n=!1,colorSchemes:o=r?void 0:{light:!0},defaultColorScheme:i=r==null?void 0:r.mode,...a}=e,s=i||"light",l=o==null?void 0:o[s],u={...o,...r?{[s]:{...typeof l!="boolean"&&l,palette:r}}:void 0};if(n===!1){if(!("colorSchemes"in e))return Mx(e,...t);let c=r;"palette"in e||u[s]&&(u[s]!==!0?c=u[s].palette:s==="dark"&&(c={mode:"dark"}));const d=Mx({...e,palette:c},...t);return d.defaultColorScheme=s,d.colorSchemes=u,d.palette.mode==="light"&&(d.colorSchemes.light={...u.light!==!0&&u.light,palette:d.palette},ok(d,"dark",u.dark)),d.palette.mode==="dark"&&(d.colorSchemes.dark={...u.dark!==!0&&u.dark,palette:d.palette},ok(d,"light",u.light)),d}return!r&&!("light"in u)&&s==="light"&&(u.light=!0),GQ({...a,colorSchemes:u,defaultColorScheme:s,...typeof n!="boolean"&&n},...t)}function qQ(e){return String(e).match(/[\d.\-+]*\s*(.*)/)[1]||""}function KQ(e){return parseFloat(e)}const v6=dv();function Os(){const e=oh(v6);return e[bi]||e}function L4(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const zn=e=>L4(e)&&e!=="classes",J=C4({themeId:bi,defaultTheme:v6,rootShouldForwardProp:zn});function ZQ({theme:e,...t}){const r=bi in e?e[bi]:void 0;return b.jsx(T4,{...t,themeId:r?bi:void 0,theme:r||e})}const Jh={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:YQ}=BX({themeId:bi,theme:()=>dv({cssVariables:!0}),colorSchemeStorageKey:Jh.colorSchemeStorageKey,modeStorageKey:Jh.modeStorageKey,defaultColorScheme:{light:Jh.defaultLightColorScheme,dark:Jh.defaultDarkColorScheme},resolveTheme:e=>{const t={...e,typography:R4(e.palette,e.typography)};return t.unstable_sx=function(n){return hs({sx:n,theme:this})},t}}),XQ=YQ;function QQ({theme:e,...t}){const r=v.useMemo(()=>{if(typeof e=="function")return e;const n=bi in e?e[bi]:e;return"colorSchemes"in n?null:"vars"in n?e:{...e,vars:null}},[e]);return r?b.jsx(ZQ,{theme:r,...t}):b.jsx(XQ,{theme:e,...t})}function ik(...e){return e.reduce((t,r)=>r==null?t:function(...o){t.apply(this,o),r.apply(this,o)},()=>{})}function JQ(e){return b.jsx(v4,{...e,defaultTheme:v6,themeId:bi})}function b6(e){return function(r){return b.jsx(JQ,{styles:typeof e=="function"?n=>e({theme:n,...r}):e})}}function eJ(){return av}const we=IX;function $e(e){return PX(e)}function tJ(e){return Oe("MuiSvgIcon",e)}Te("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const rJ=e=>{const{color:t,fontSize:r,classes:n}=e,o={root:["root",t!=="inherit"&&`color${te(t)}`,`fontSize${te(r)}`]};return _e(o,tJ,n)},nJ=J("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color!=="inherit"&&t[`color${te(r.color)}`],t[`fontSize${te(r.fontSize)}`]]}})(we(({theme:e})=>{var t,r,n,o,i,a,s,l,u,c,d,f,p,h;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(n=(r=(e.vars??e).transitions)==null?void 0:r.duration)==null?void 0:n.shorter}),variants:[{props:m=>!m.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((a=(i=e.typography)==null?void 0:i.pxToRem)==null?void 0:a.call(i,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((l=(s=e.typography)==null?void 0:s.pxToRem)==null?void 0:l.call(s,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((c=(u=e.typography)==null?void 0:u.pxToRem)==null?void 0:c.call(u,35))||"2.1875rem"}},...Object.entries((e.vars??e).palette).filter(([,m])=>m&&m.main).map(([m])=>{var g,y;return{props:{color:m},style:{color:(y=(g=(e.vars??e).palette)==null?void 0:g[m])==null?void 0:y.main}}}),{props:{color:"action"},style:{color:(f=(d=(e.vars??e).palette)==null?void 0:d.action)==null?void 0:f.active}},{props:{color:"disabled"},style:{color:(h=(p=(e.vars??e).palette)==null?void 0:p.action)==null?void 0:h.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Bm=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiSvgIcon"}),{children:o,className:i,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:u,inheritViewBox:c=!1,titleAccess:d,viewBox:f="0 0 24 24",...p}=n,h=v.isValidElement(o)&&o.type==="svg",m={...n,color:a,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:c,viewBox:f,hasSvgAsChild:h},g={};c||(g.viewBox=f);const y=rJ(m);return b.jsxs(nJ,{as:s,className:se(y.root,i),focusable:"false",color:u,"aria-hidden":d?void 0:!0,role:d?"img":void 0,ref:r,...g,...p,...h&&o.props,ownerState:m,children:[h?o.props.children:o,d?b.jsx("title",{children:d}):null]})});Bm.muiName="SvgIcon";function Qe(e,t){function r(n,o){return b.jsx(Bm,{"data-testid":void 0,ref:o,...n,children:e})}return r.muiName=Bm.muiName,v.memo(v.forwardRef(r))}function fv(e,t=166){let r;function n(...o){const i=()=>{e.apply(this,o)};clearTimeout(r),r=setTimeout(i,t)}return n.clear=()=>{clearTimeout(r)},n}function hn(e){return e&&e.ownerDocument||document}function Lo(e){return hn(e).defaultView||window}function ak(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function dp(e){const{controlled:t,default:r,name:n,state:o="value"}=e,{current:i}=v.useRef(t!==void 0),[a,s]=v.useState(r),l=i?t:a,u=v.useCallback(c=>{i||s(c)},[]);return[l,u]}function no(e){const t=v.useRef(e);return $n(()=>{t.current=e}),v.useRef((...r)=>(0,t.current)(...r)).current}function nr(...e){const t=v.useRef(void 0),r=v.useCallback(n=>{const o=e.map(i=>{if(i==null)return null;if(typeof i=="function"){const a=i,s=a(n);return typeof s=="function"?s:()=>{a(null)}}return i.current=n,()=>{i.current=null}});return()=>{o.forEach(i=>i==null?void 0:i())}},e);return v.useMemo(()=>e.every(n=>n==null)?null:n=>{t.current&&(t.current(),t.current=void 0),n!=null&&(t.current=r(n))},e)}function oJ(e,t){const r=e.charCodeAt(2);return e[0]==="o"&&e[1]==="n"&&r>=65&&r<=90&&typeof t=="function"}function iJ(e,t){if(!e)return t;function r(a,s){const l={};return Object.keys(s).forEach(u=>{oJ(u,s[u])&&typeof a[u]=="function"&&(l[u]=(...c)=>{a[u](...c),s[u](...c)})}),l}if(typeof e=="function"||typeof t=="function")return a=>{const s=typeof t=="function"?t(a):t,l=typeof e=="function"?e({...a,...s}):e,u=se(a==null?void 0:a.className,s==null?void 0:s.className,l==null?void 0:l.className),c=r(l,s);return{...s,...l,...c,...!!u&&{className:u},...(s==null?void 0:s.style)&&(l==null?void 0:l.style)&&{style:{...s.style,...l.style}},...(s==null?void 0:s.sx)&&(l==null?void 0:l.sx)&&{sx:[...Array.isArray(s.sx)?s.sx:[s.sx],...Array.isArray(l.sx)?l.sx:[l.sx]]}}};const n=t,o=r(e,n),i=se(n==null?void 0:n.className,e==null?void 0:e.className);return{...t,...e,...o,...!!i&&{className:i},...(n==null?void 0:n.style)&&(e==null?void 0:e.style)&&{style:{...n.style,...e.style}},...(n==null?void 0:n.sx)&&(e==null?void 0:e.sx)&&{sx:[...Array.isArray(n.sx)?n.sx:[n.sx],...Array.isArray(e.sx)?e.sx:[e.sx]]}}}function D4(e,t){if(e==null)return{};var r={};for(var n in e)if({}.hasOwnProperty.call(e,n)){if(t.indexOf(n)!==-1)continue;r[n]=e[n]}return r}function Bx(e,t){return Bx=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Bx(e,t)}function z4(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,Bx(e,t)}const sk={disabled:!1},Lm=Po.createContext(null);var aJ=function(t){return t.scrollTop},qd="unmounted",Gs="exited",qs="entering",pc="entered",Lx="exiting",Fo=function(e){z4(t,e);function t(n,o){var i;i=e.call(this,n,o)||this;var a=o,s=a&&!a.isMounting?n.enter:n.appear,l;return i.appearStatus=null,n.in?s?(l=Gs,i.appearStatus=qs):l=pc:n.unmountOnExit||n.mountOnEnter?l=qd:l=Gs,i.state={status:l},i.nextCallback=null,i}t.getDerivedStateFromProps=function(o,i){var a=o.in;return a&&i.status===qd?{status:Gs}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(o){var i=null;if(o!==this.props){var a=this.state.status;this.props.in?a!==qs&&a!==pc&&(i=qs):(a===qs||a===pc)&&(i=Lx)}this.updateStatus(!1,i)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var o=this.props.timeout,i,a,s;return i=a=s=o,o!=null&&typeof o!="number"&&(i=o.exit,a=o.enter,s=o.appear!==void 0?o.appear:a),{exit:i,enter:a,appear:s}},r.updateStatus=function(o,i){if(o===void 0&&(o=!1),i!==null)if(this.cancelNextCallback(),i===qs){if(this.props.unmountOnExit||this.props.mountOnEnter){var a=this.props.nodeRef?this.props.nodeRef.current:Yh.findDOMNode(this);a&&aJ(a)}this.performEnter(o)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Gs&&this.setState({status:qd})},r.performEnter=function(o){var i=this,a=this.props.enter,s=this.context?this.context.isMounting:o,l=this.props.nodeRef?[s]:[Yh.findDOMNode(this),s],u=l[0],c=l[1],d=this.getTimeouts(),f=s?d.appear:d.enter;if(!o&&!a||sk.disabled){this.safeSetState({status:pc},function(){i.props.onEntered(u)});return}this.props.onEnter(u,c),this.safeSetState({status:qs},function(){i.props.onEntering(u,c),i.onTransitionEnd(f,function(){i.safeSetState({status:pc},function(){i.props.onEntered(u,c)})})})},r.performExit=function(){var o=this,i=this.props.exit,a=this.getTimeouts(),s=this.props.nodeRef?void 0:Yh.findDOMNode(this);if(!i||sk.disabled){this.safeSetState({status:Gs},function(){o.props.onExited(s)});return}this.props.onExit(s),this.safeSetState({status:Lx},function(){o.props.onExiting(s),o.onTransitionEnd(a.exit,function(){o.safeSetState({status:Gs},function(){o.props.onExited(s)})})})},r.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(o,i){i=this.setNextCallback(i),this.setState(o,i)},r.setNextCallback=function(o){var i=this,a=!0;return this.nextCallback=function(s){a&&(a=!1,i.nextCallback=null,o(s))},this.nextCallback.cancel=function(){a=!1},this.nextCallback},r.onTransitionEnd=function(o,i){this.setNextCallback(i);var a=this.props.nodeRef?this.props.nodeRef.current:Yh.findDOMNode(this),s=o==null&&!this.props.addEndListener;if(!a||s){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[a,this.nextCallback],u=l[0],c=l[1];this.props.addEndListener(u,c)}o!=null&&setTimeout(this.nextCallback,o)},r.render=function(){var o=this.state.status;if(o===qd)return null;var i=this.props,a=i.children;i.in,i.mountOnEnter,i.unmountOnExit,i.appear,i.enter,i.exit,i.timeout,i.addEndListener,i.onEnter,i.onEntering,i.onEntered,i.onExit,i.onExiting,i.onExited,i.nodeRef;var s=D4(i,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Po.createElement(Lm.Provider,{value:null},typeof a=="function"?a(o,s):Po.cloneElement(Po.Children.only(a),s))},t}(Po.Component);Fo.contextType=Lm;Fo.propTypes={};function oc(){}Fo.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:oc,onEntering:oc,onEntered:oc,onExit:oc,onExiting:oc,onExited:oc};Fo.UNMOUNTED=qd;Fo.EXITED=Gs;Fo.ENTERING=qs;Fo.ENTERED=pc;Fo.EXITING=Lx;function sJ(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function w6(e,t){var r=function(i){return t&&v.isValidElement(i)?t(i):i},n=Object.create(null);return e&&v.Children.map(e,function(o){return o}).forEach(function(o){n[o.key]=r(o)}),n}function lJ(e,t){e=e||{},t=t||{};function r(c){return c in t?t[c]:e[c]}var n=Object.create(null),o=[];for(var i in e)i in t?o.length&&(n[i]=o,o=[]):o.push(i);var a,s={};for(var l in t){if(n[l])for(a=0;a{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});Ls(this,"disposeEffect",()=>this.clear)}static create(){return new pv}start(t,r){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,r()},t)}}function al(){const e=F4(pv.create).current;return hJ(e.disposeEffect),e}const U4=e=>e.scrollTop;function gu(e,t){const{timeout:r,easing:n,style:o={}}=e;return{duration:o.transitionDuration??(typeof r=="number"?r:r[t.mode]||0),easing:o.transitionTimingFunction??(typeof n=="object"?n[t.mode]:n),delay:o.transitionDelay}}function Dm(e){return typeof e=="string"}function W4(e,t,r){return e===void 0||Dm(e)?t:{...t,ownerState:{...t.ownerState,...r}}}function H4(e,t,r){return typeof e=="function"?e(t,r):e}function V4(e,t=[]){if(e===void 0)return{};const r={};return Object.keys(e).filter(n=>n.match(/^on[A-Z]/)&&typeof e[n]=="function"&&!t.includes(n)).forEach(n=>{r[n]=e[n]}),r}function ck(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(r=>!(r.match(/^on[A-Z]/)&&typeof e[r]=="function")).forEach(r=>{t[r]=e[r]}),t}function G4(e){const{getSlotProps:t,additionalProps:r,externalSlotProps:n,externalForwardedProps:o,className:i}=e;if(!t){const p=se(r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),h={...r==null?void 0:r.style,...o==null?void 0:o.style,...n==null?void 0:n.style},m={...r,...o,...n};return p.length>0&&(m.className=p),Object.keys(h).length>0&&(m.style=h),{props:m,internalRef:void 0}}const a=V4({...o,...n}),s=ck(n),l=ck(o),u=t(a),c=se(u==null?void 0:u.className,r==null?void 0:r.className,i,o==null?void 0:o.className,n==null?void 0:n.className),d={...u==null?void 0:u.style,...r==null?void 0:r.style,...o==null?void 0:o.style,...n==null?void 0:n.style},f={...u,...r,...l,...s};return c.length>0&&(f.className=c),Object.keys(d).length>0&&(f.style=d),{props:f,internalRef:u.ref}}function ke(e,t){const{className:r,elementType:n,ownerState:o,externalForwardedProps:i,internalForwardedProps:a,shouldForwardComponentProp:s=!1,...l}=t,{component:u,slots:c={[e]:void 0},slotProps:d={[e]:void 0},...f}=i,p=c[e]||n,h=H4(d[e],o),{props:{component:m,...g},internalRef:y}=G4({className:r,...l,externalForwardedProps:e==="root"?f:void 0,externalSlotProps:h}),w=nr(y,h==null?void 0:h.ref,t.ref),S=e==="root"?m||u:m,x=W4(p,{...e==="root"&&!u&&!c[e]&&a,...e!=="root"&&!c[e]&&a,...g,...S&&!s&&{as:S},...S&&s&&{component:S},ref:w},o);return[p,x]}function mJ(e){return Oe("MuiCollapse",e)}Te("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const gJ=e=>{const{orientation:t,classes:r}=e,n={root:["root",`${t}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${t}`],wrapperInner:["wrapperInner",`${t}`]};return _e(n,mJ,r)},yJ=J("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.orientation],r.state==="entered"&&t.entered,r.state==="exited"&&!r.in&&r.collapsedSize==="0px"&&t.hidden]}})(we(({theme:e})=>({height:0,overflow:"hidden",transition:e.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:e.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:t})=>t.state==="exited"&&!t.in&&t.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),vJ=J("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),bJ=J("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),fp=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiCollapse"}),{addEndListener:o,children:i,className:a,collapsedSize:s="0px",component:l,easing:u,in:c,onEnter:d,onEntered:f,onEntering:p,onExit:h,onExited:m,onExiting:g,orientation:y="vertical",slots:w={},slotProps:S={},style:x,timeout:P=j4.standard,TransitionComponent:A=Fo,...T}=n,I={...n,orientation:y,collapsedSize:s},O=gJ(I),_=Os(),R=al(),E=v.useRef(null),M=v.useRef(),B=typeof s=="number"?`${s}px`:s,j=y==="horizontal",N=j?"width":"height",F=v.useRef(null),D=nr(r,F),z=ue=>ye=>{if(ue){const Pe=F.current;ye===void 0?ue(Pe):ue(Pe,ye)}},W=()=>E.current?E.current[j?"clientWidth":"clientHeight"]:0,H=z((ue,ye)=>{E.current&&j&&(E.current.style.position="absolute"),ue.style[N]=B,d&&d(ue,ye)}),V=z((ue,ye)=>{const Pe=W();E.current&&j&&(E.current.style.position="");const{duration:Ne,easing:Ue}=gu({style:x,timeout:P,easing:u},{mode:"enter"});if(P==="auto"){const Ke=_.transitions.getAutoHeightDuration(Pe);ue.style.transitionDuration=`${Ke}ms`,M.current=Ke}else ue.style.transitionDuration=typeof Ne=="string"?Ne:`${Ne}ms`;ue.style[N]=`${Pe}px`,ue.style.transitionTimingFunction=Ue,p&&p(ue,ye)}),Q=z((ue,ye)=>{ue.style[N]="auto",f&&f(ue,ye)}),re=z(ue=>{ue.style[N]=`${W()}px`,h&&h(ue)}),Y=z(m),Z=z(ue=>{const ye=W(),{duration:Pe,easing:Ne}=gu({style:x,timeout:P,easing:u},{mode:"exit"});if(P==="auto"){const Ue=_.transitions.getAutoHeightDuration(ye);ue.style.transitionDuration=`${Ue}ms`,M.current=Ue}else ue.style.transitionDuration=typeof Pe=="string"?Pe:`${Pe}ms`;ue.style[N]=B,ue.style.transitionTimingFunction=Ne,g&&g(ue)}),ie=ue=>{P==="auto"&&R.start(M.current||0,ue),o&&o(F.current,ue)},me={slots:w,slotProps:S,component:l},[G,oe]=ke("root",{ref:D,className:se(O.root,a),elementType:yJ,externalForwardedProps:me,ownerState:I,additionalProps:{style:{[j?"minWidth":"minHeight"]:B,...x}}}),[de,q]=ke("wrapper",{ref:E,className:O.wrapper,elementType:vJ,externalForwardedProps:me,ownerState:I}),[Ee,ce]=ke("wrapperInner",{className:O.wrapperInner,elementType:bJ,externalForwardedProps:me,ownerState:I});return b.jsx(A,{in:c,onEnter:H,onEntered:Q,onEntering:V,onExit:re,onExited:Y,onExiting:Z,addEndListener:ie,nodeRef:F,timeout:P==="auto"?null:P,...T,children:(ue,{ownerState:ye,...Pe})=>{const Ne={...I,state:ue};return b.jsx(G,{...oe,className:se(oe.className,{entered:O.entered,exited:!c&&B==="0px"&&O.hidden}[ue]),ownerState:Ne,...Pe,children:b.jsx(de,{...q,ownerState:Ne,children:b.jsx(Ee,{...ce,ownerState:Ne,children:i})})})}})});fp&&(fp.muiSupportAuto=!0);function wJ(e){return Oe("MuiPaper",e)}Te("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const xJ=e=>{const{square:t,elevation:r,variant:n,classes:o}=e,i={root:["root",n,!t&&"rounded",n==="elevation"&&`elevation${r}`]};return _e(i,wJ,o)},SJ=J("div",{name:"MuiPaper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],!r.square&&t.rounded,r.variant==="elevation"&&t[`elevation${r.elevation}`]]}})(we(({theme:e})=>({backgroundColor:(e.vars||e).palette.background.paper,color:(e.vars||e).palette.text.primary,transition:e.transitions.create("box-shadow"),variants:[{props:({ownerState:t})=>!t.square,style:{borderRadius:e.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(e.vars||e).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),sr=v.forwardRef(function(t,r){var p;const n=$e({props:t,name:"MuiPaper"}),o=Os(),{className:i,component:a="div",elevation:s=1,square:l=!1,variant:u="elevation",...c}=n,d={...n,component:a,elevation:s,square:l,variant:u},f=xJ(d);return b.jsx(SJ,{as:a,ownerState:d,className:se(f.root,i),ref:r,...c,style:{...u==="elevation"&&{"--Paper-shadow":(o.vars||o).shadows[s],...o.vars&&{"--Paper-overlay":(p=o.vars.overlays)==null?void 0:p[s]},...!o.vars&&o.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${up("#fff",Nx(s))}, ${up("#fff",Nx(s))})`}},...c.style}})}),q4=v.createContext({});function CJ(e){return Oe("MuiAccordion",e)}const e0=Te("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),EJ=e=>{const{classes:t,square:r,expanded:n,disabled:o,disableGutters:i}=e;return _e({root:["root",!r&&"rounded",n&&"expanded",o&&"disabled",!i&&"gutters"],heading:["heading"],region:["region"]},CJ,t)},PJ=J(sr,{name:"MuiAccordion",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${e0.region}`]:t.region},t.root,!r.square&&t.rounded,!r.disableGutters&&t.gutters]}})(we(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{position:"relative",transition:e.transitions.create(["margin"],t),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(e.vars||e).palette.divider,transition:e.transitions.create(["opacity","background-color"],t)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${e0.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${e0.disabled}`]:{backgroundColor:(e.vars||e).palette.action.disabledBackground}}}),we(({theme:e})=>({variants:[{props:t=>!t.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(e.vars||e).shape.borderRadius,borderBottomRightRadius:(e.vars||e).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:t=>!t.disableGutters,style:{[`&.${e0.expanded}`]:{margin:"16px 0"}}}]}))),AJ=J("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),kJ=J("div",{name:"MuiAccordion",slot:"Region"})({}),Dx=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiAccordion"}),{children:o,className:i,defaultExpanded:a=!1,disabled:s=!1,disableGutters:l=!1,expanded:u,onChange:c,slots:d={},slotProps:f={},TransitionComponent:p,TransitionProps:h,...m}=n,[g,y]=dp({controlled:u,default:a,name:"Accordion",state:"expanded"}),w=v.useCallback(z=>{y(!g),c&&c(z,!g)},[g,c,y]),[S,...x]=v.Children.toArray(o),P=v.useMemo(()=>({expanded:g,disabled:s,disableGutters:l,toggle:w}),[g,s,l,w]),A={...n,disabled:s,disableGutters:l,expanded:g},T=EJ(A),I={transition:p,...d},O={transition:h,...f},_={slots:I,slotProps:O},[R,E]=ke("root",{elementType:PJ,externalForwardedProps:{..._,...m},className:se(T.root,i),shouldForwardComponentProp:!0,ownerState:A,ref:r}),[M,B]=ke("heading",{elementType:AJ,externalForwardedProps:_,className:T.heading,ownerState:A}),[j,N]=ke("transition",{elementType:fp,externalForwardedProps:_,ownerState:A}),[F,D]=ke("region",{elementType:kJ,externalForwardedProps:_,ownerState:A,className:T.region,additionalProps:{"aria-labelledby":S.props.id,id:S.props["aria-controls"],role:"region"}});return b.jsxs(R,{...E,children:[b.jsx(M,{...B,children:b.jsx(q4.Provider,{value:P,children:S})}),b.jsx(j,{in:g,timeout:"auto",...N,children:b.jsx(F,{...D,children:x})})]})});function TJ(e){return Oe("MuiAccordionDetails",e)}Te("MuiAccordionDetails",["root"]);const IJ=e=>{const{classes:t}=e;return _e({root:["root"]},TJ,t)},OJ=J("div",{name:"MuiAccordionDetails",slot:"Root"})(we(({theme:e})=>({padding:e.spacing(1,2,2)}))),zx=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiAccordionDetails"}),{className:o,...i}=n,a=n,s=IJ(a);return b.jsx(OJ,{className:se(s.root,o),ref:r,ownerState:a,...i})});function yu(e){try{return e.matches(":focus-visible")}catch{}return!1}class zm{constructor(){Ls(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new zm}static use(){const t=F4(zm.create).current,[r,n]=v.useState(!1);return t.shouldMount=r,t.setShouldMount=n,v.useEffect(t.mountEffect,[r]),t}mount(){return this.mounted||(this.mounted=$J(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(...t){this.mount().then(()=>{var r;return(r=this.ref.current)==null?void 0:r.start(...t)})}stop(...t){this.mount().then(()=>{var r;return(r=this.ref.current)==null?void 0:r.stop(...t)})}pulsate(...t){this.mount().then(()=>{var r;return(r=this.ref.current)==null?void 0:r.pulsate(...t)})}}function _J(){return zm.use()}function $J(){let e,t;const r=new Promise((n,o)=>{e=n,t=o});return r.resolve=e,r.reject=t,r}function RJ(e){const{className:t,classes:r,pulsate:n=!1,rippleX:o,rippleY:i,rippleSize:a,in:s,onExited:l,timeout:u}=e,[c,d]=v.useState(!1),f=se(t,r.ripple,r.rippleVisible,n&&r.ripplePulsate),p={width:a,height:a,top:-(a/2)+i,left:-(a/2)+o},h=se(r.child,c&&r.childLeaving,n&&r.childPulsate);return!s&&!c&&d(!0),v.useEffect(()=>{if(!s&&l!=null){const m=setTimeout(l,u);return()=>{clearTimeout(m)}}},[l,s,u]),b.jsx("span",{className:f,style:p,children:b.jsx("span",{className:h})})}const Kn=Te("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Fx=550,jJ=80,MJ=Ii` + 0% { + transform: scale(0); + opacity: 0.1; + } + + 100% { + transform: scale(1); + opacity: 0.3; + } +`,NJ=Ii` + 0% { + opacity: 1; + } + + 100% { + opacity: 0; + } +`,BJ=Ii` + 0% { + transform: scale(1); + } + + 50% { + transform: scale(0.92); + } + + 100% { + transform: scale(1); + } +`,LJ=J("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),DJ=J(RJ,{name:"MuiTouchRipple",slot:"Ripple"})` + opacity: 0; + position: absolute; + + &.${Kn.rippleVisible} { + opacity: 0.3; + transform: scale(1); + animation-name: ${MJ}; + animation-duration: ${Fx}ms; + animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; + } + + &.${Kn.ripplePulsate} { + animation-duration: ${({theme:e})=>e.transitions.duration.shorter}ms; + } + + & .${Kn.child} { + opacity: 1; + display: block; + width: 100%; + height: 100%; + border-radius: 50%; + background-color: currentColor; + } + + & .${Kn.childLeaving} { + opacity: 0; + animation-name: ${NJ}; + animation-duration: ${Fx}ms; + animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; + } + + & .${Kn.childPulsate} { + position: absolute; + /* @noflip */ + left: 0px; + top: 0; + animation-name: ${BJ}; + animation-duration: 2500ms; + animation-timing-function: ${({theme:e})=>e.transitions.easing.easeInOut}; + animation-iteration-count: infinite; + animation-delay: 200ms; + } +`,zJ=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTouchRipple"}),{center:o=!1,classes:i={},className:a,...s}=n,[l,u]=v.useState([]),c=v.useRef(0),d=v.useRef(null);v.useEffect(()=>{d.current&&(d.current(),d.current=null)},[l]);const f=v.useRef(!1),p=al(),h=v.useRef(null),m=v.useRef(null),g=v.useCallback(x=>{const{pulsate:P,rippleX:A,rippleY:T,rippleSize:I,cb:O}=x;u(_=>[..._,b.jsx(DJ,{classes:{ripple:se(i.ripple,Kn.ripple),rippleVisible:se(i.rippleVisible,Kn.rippleVisible),ripplePulsate:se(i.ripplePulsate,Kn.ripplePulsate),child:se(i.child,Kn.child),childLeaving:se(i.childLeaving,Kn.childLeaving),childPulsate:se(i.childPulsate,Kn.childPulsate)},timeout:Fx,pulsate:P,rippleX:A,rippleY:T,rippleSize:I},c.current)]),c.current+=1,d.current=O},[i]),y=v.useCallback((x={},P={},A=()=>{})=>{const{pulsate:T=!1,center:I=o||P.pulsate,fakeElement:O=!1}=P;if((x==null?void 0:x.type)==="mousedown"&&f.current){f.current=!1;return}(x==null?void 0:x.type)==="touchstart"&&(f.current=!0);const _=O?null:m.current,R=_?_.getBoundingClientRect():{width:0,height:0,left:0,top:0};let E,M,B;if(I||x===void 0||x.clientX===0&&x.clientY===0||!x.clientX&&!x.touches)E=Math.round(R.width/2),M=Math.round(R.height/2);else{const{clientX:j,clientY:N}=x.touches&&x.touches.length>0?x.touches[0]:x;E=Math.round(j-R.left),M=Math.round(N-R.top)}if(I)B=Math.sqrt((2*R.width**2+R.height**2)/3),B%2===0&&(B+=1);else{const j=Math.max(Math.abs((_?_.clientWidth:0)-E),E)*2+2,N=Math.max(Math.abs((_?_.clientHeight:0)-M),M)*2+2;B=Math.sqrt(j**2+N**2)}x!=null&&x.touches?h.current===null&&(h.current=()=>{g({pulsate:T,rippleX:E,rippleY:M,rippleSize:B,cb:A})},p.start(jJ,()=>{h.current&&(h.current(),h.current=null)})):g({pulsate:T,rippleX:E,rippleY:M,rippleSize:B,cb:A})},[o,g,p]),w=v.useCallback(()=>{y({},{pulsate:!0})},[y]),S=v.useCallback((x,P)=>{if(p.clear(),(x==null?void 0:x.type)==="touchend"&&h.current){h.current(),h.current=null,p.start(0,()=>{S(x,P)});return}h.current=null,u(A=>A.length>0?A.slice(1):A),d.current=P},[p]);return v.useImperativeHandle(r,()=>({pulsate:w,start:y,stop:S}),[w,y,S]),b.jsx(LJ,{className:se(Kn.root,i.root,a),ref:m,...s,children:b.jsx(x6,{component:null,exit:!0,children:l})})});function FJ(e){return Oe("MuiButtonBase",e)}const UJ=Te("MuiButtonBase",["root","disabled","focusVisible"]),WJ=e=>{const{disabled:t,focusVisible:r,focusVisibleClassName:n,classes:o}=e,a=_e({root:["root",t&&"disabled",r&&"focusVisible"]},FJ,o);return r&&n&&(a.root+=` ${n}`),a},HJ=J("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${UJ.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),aa=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiButtonBase"}),{action:o,centerRipple:i=!1,children:a,className:s,component:l="button",disabled:u=!1,disableRipple:c=!1,disableTouchRipple:d=!1,focusRipple:f=!1,focusVisibleClassName:p,LinkComponent:h="a",onBlur:m,onClick:g,onContextMenu:y,onDragLeave:w,onFocus:S,onFocusVisible:x,onKeyDown:P,onKeyUp:A,onMouseDown:T,onMouseLeave:I,onMouseUp:O,onTouchEnd:_,onTouchMove:R,onTouchStart:E,tabIndex:M=0,TouchRippleProps:B,touchRippleRef:j,type:N,...F}=n,D=v.useRef(null),z=_J(),W=nr(z.ref,j),[H,V]=v.useState(!1);u&&H&&V(!1),v.useImperativeHandle(o,()=>({focusVisible:()=>{V(!0),D.current.focus()}}),[]);const Q=z.shouldMount&&!c&&!u;v.useEffect(()=>{H&&f&&!c&&z.pulsate()},[c,f,H,z]);const re=Mi(z,"start",T,d),Y=Mi(z,"stop",y,d),Z=Mi(z,"stop",w,d),ie=Mi(z,"stop",O,d),me=Mi(z,"stop",Ae=>{H&&Ae.preventDefault(),I&&I(Ae)},d),G=Mi(z,"start",E,d),oe=Mi(z,"stop",_,d),de=Mi(z,"stop",R,d),q=Mi(z,"stop",Ae=>{yu(Ae.target)||V(!1),m&&m(Ae)},!1),Ee=no(Ae=>{D.current||(D.current=Ae.currentTarget),yu(Ae.target)&&(V(!0),x&&x(Ae)),S&&S(Ae)}),ce=()=>{const Ae=D.current;return l&&l!=="button"&&!(Ae.tagName==="A"&&Ae.href)},ue=no(Ae=>{f&&!Ae.repeat&&H&&Ae.key===" "&&z.stop(Ae,()=>{z.start(Ae)}),Ae.target===Ae.currentTarget&&ce()&&Ae.key===" "&&Ae.preventDefault(),P&&P(Ae),Ae.target===Ae.currentTarget&&ce()&&Ae.key==="Enter"&&!u&&(Ae.preventDefault(),g&&g(Ae))}),ye=no(Ae=>{f&&Ae.key===" "&&H&&!Ae.defaultPrevented&&z.stop(Ae,()=>{z.pulsate(Ae)}),A&&A(Ae),g&&Ae.target===Ae.currentTarget&&ce()&&Ae.key===" "&&!Ae.defaultPrevented&&g(Ae)});let Pe=l;Pe==="button"&&(F.href||F.to)&&(Pe=h);const Ne={};if(Pe==="button"){const Ae=!!F.formAction;Ne.type=N===void 0&&!Ae?"button":N,Ne.disabled=u}else!F.href&&!F.to&&(Ne.role="button"),u&&(Ne["aria-disabled"]=u);const Ue=nr(r,D),Ke={...n,centerRipple:i,component:l,disabled:u,disableRipple:c,disableTouchRipple:d,focusRipple:f,tabIndex:M,focusVisible:H},We=WJ(Ke);return b.jsxs(HJ,{as:Pe,className:se(We.root,s),ownerState:Ke,onBlur:q,onClick:g,onContextMenu:Y,onFocus:Ee,onKeyDown:ue,onKeyUp:ye,onMouseDown:re,onMouseLeave:me,onMouseUp:ie,onDragLeave:Z,onTouchEnd:oe,onTouchMove:de,onTouchStart:G,ref:Ue,tabIndex:u?-1:M,type:N,...Ne,...F,children:[a,Q?b.jsx(zJ,{ref:W,center:i,...B}):null]})});function Mi(e,t,r,n=!1){return no(o=>(r&&r(o),n||e[t](o),!0))}function VJ(e){return Oe("MuiAccordionSummary",e)}const _c=Te("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),GJ=e=>{const{classes:t,expanded:r,disabled:n,disableGutters:o}=e;return _e({root:["root",r&&"expanded",n&&"disabled",!o&&"gutters"],focusVisible:["focusVisible"],content:["content",r&&"expanded",!o&&"contentGutters"],expandIconWrapper:["expandIconWrapper",r&&"expanded"]},VJ,t)},qJ=J(aa,{name:"MuiAccordionSummary",slot:"Root"})(we(({theme:e})=>{const t={duration:e.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:e.spacing(0,2),transition:e.transitions.create(["min-height","background-color"],t),[`&.${_c.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${_c.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`&:hover:not(.${_c.disabled})`]:{cursor:"pointer"},variants:[{props:r=>!r.disableGutters,style:{[`&.${_c.expanded}`]:{minHeight:64}}}]}})),KJ=J("span",{name:"MuiAccordionSummary",slot:"Content"})(we(({theme:e})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:t=>!t.disableGutters,style:{transition:e.transitions.create(["margin"],{duration:e.transitions.duration.shortest}),[`&.${_c.expanded}`]:{margin:"20px 0"}}}]}))),ZJ=J("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(we(({theme:e})=>({display:"flex",color:(e.vars||e).palette.action.active,transform:"rotate(0deg)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shortest}),[`&.${_c.expanded}`]:{transform:"rotate(180deg)"}}))),Ux=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiAccordionSummary"}),{children:o,className:i,expandIcon:a,focusVisibleClassName:s,onClick:l,slots:u,slotProps:c,...d}=n,{disabled:f=!1,disableGutters:p,expanded:h,toggle:m}=v.useContext(q4),g=_=>{m&&m(_),l&&l(_)},y={...n,expanded:h,disabled:f,disableGutters:p},w=GJ(y),S={slots:u,slotProps:c},[x,P]=ke("root",{ref:r,shouldForwardComponentProp:!0,className:se(w.root,i),elementType:qJ,externalForwardedProps:{...S,...d},ownerState:y,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:f,"aria-expanded":h,focusVisibleClassName:se(w.focusVisible,s)},getSlotProps:_=>({..._,onClick:R=>{var E;(E=_.onClick)==null||E.call(_,R),g(R)}})}),[A,T]=ke("content",{className:w.content,elementType:KJ,externalForwardedProps:S,ownerState:y}),[I,O]=ke("expandIconWrapper",{className:w.expandIconWrapper,elementType:ZJ,externalForwardedProps:S,ownerState:y});return b.jsxs(x,{...P,children:[b.jsx(A,{...T,children:o}),a&&b.jsx(I,{...O,children:a})]})});function YJ(e){return typeof e.main=="string"}function XJ(e,t=[]){if(!YJ(e))return!1;for(const r of t)if(!e.hasOwnProperty(r)||typeof e[r]!="string")return!1;return!0}function Tt(e=[]){return([,t])=>t&&XJ(t,e)}function QJ(e){return Oe("MuiAlert",e)}const uk=Te("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function JJ(e){return Oe("MuiCircularProgress",e)}Te("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","track","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const vo=44,Wx=Ii` + 0% { + transform: rotate(0deg); + } + + 100% { + transform: rotate(360deg); + } +`,Hx=Ii` + 0% { + stroke-dasharray: 1px, 200px; + stroke-dashoffset: 0; + } + + 50% { + stroke-dasharray: 100px, 200px; + stroke-dashoffset: -15px; + } + + 100% { + stroke-dasharray: 1px, 200px; + stroke-dashoffset: -126px; + } +`,eee=typeof Wx!="string"?Is` + animation: ${Wx} 1.4s linear infinite; + `:null,tee=typeof Hx!="string"?Is` + animation: ${Hx} 1.4s ease-in-out infinite; + `:null,ree=e=>{const{classes:t,variant:r,color:n,disableShrink:o}=e,i={root:["root",r,`color${te(n)}`],svg:["svg"],track:["track"],circle:["circle",`circle${te(r)}`,o&&"circleDisableShrink"]};return _e(i,JJ,t)},nee=J("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`color${te(r.color)}`]]}})(we(({theme:e})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("transform")}},{props:{variant:"indeterminate"},style:eee||{animation:`${Wx} 1.4s linear infinite`}},...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}}))]}))),oee=J("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),iee=J("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.circle,t[`circle${te(r.variant)}`],r.disableShrink&&t.circleDisableShrink]}})(we(({theme:e})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:e.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:t})=>t.variant==="indeterminate"&&!t.disableShrink,style:tee||{animation:`${Hx} 1.4s ease-in-out infinite`}}]}))),aee=J("circle",{name:"MuiCircularProgress",slot:"Track"})(we(({theme:e})=>({stroke:"currentColor",opacity:(e.vars||e).palette.action.activatedOpacity}))),ys=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiCircularProgress"}),{className:o,color:i="primary",disableShrink:a=!1,enableTrackSlot:s=!1,size:l=40,style:u,thickness:c=3.6,value:d=0,variant:f="indeterminate",...p}=n,h={...n,color:i,disableShrink:a,size:l,thickness:c,value:d,variant:f,enableTrackSlot:s},m=ree(h),g={},y={},w={};if(f==="determinate"){const S=2*Math.PI*((vo-c)/2);g.strokeDasharray=S.toFixed(3),w["aria-valuenow"]=Math.round(d),g.strokeDashoffset=`${((100-d)/100*S).toFixed(3)}px`,y.transform="rotate(-90deg)"}return b.jsx(nee,{className:se(m.root,o),style:{width:l,height:l,...y,...u},ownerState:h,ref:r,role:"progressbar",...w,...p,children:b.jsxs(oee,{className:m.svg,ownerState:h,viewBox:`${vo/2} ${vo/2} ${vo} ${vo}`,children:[s?b.jsx(aee,{className:m.track,ownerState:h,cx:vo,cy:vo,r:(vo-c)/2,fill:"none",strokeWidth:c,"aria-hidden":"true"}):null,b.jsx(iee,{className:m.circle,style:g,ownerState:h,cx:vo,cy:vo,r:(vo-c)/2,fill:"none",strokeWidth:c})]})})});function see(e){return Oe("MuiIconButton",e)}const dk=Te("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),lee=e=>{const{classes:t,disabled:r,color:n,edge:o,size:i,loading:a}=e,s={root:["root",a&&"loading",r&&"disabled",n!=="default"&&`color${te(n)}`,o&&`edge${te(o)}`,`size${te(i)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return _e(s,see,t)},cee=J(aa,{name:"MuiIconButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.loading&&t.loading,r.color!=="default"&&t[`color${te(r.color)}`],r.edge&&t[`edge${te(r.edge)}`],t[`size${te(r.size)}`]]}})(we(({theme:e})=>({textAlign:"center",flex:"0 0 auto",fontSize:e.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(e.vars||e).palette.action.active,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shortest}),variants:[{props:t=>!t.disableRipple,style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),we(({theme:e})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t},style:{color:(e.vars||e).palette[t].main}})),...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t},style:{"--IconButton-hoverBg":e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:e.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:e.typography.pxToRem(28)}}],[`&.${dk.disabled}`]:{backgroundColor:"transparent",color:(e.vars||e).palette.action.disabled},[`&.${dk.loading}`]:{color:"transparent"}}))),uee=J("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(e.vars||e).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),ui=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiIconButton"}),{edge:o=!1,children:i,className:a,color:s="default",disabled:l=!1,disableFocusRipple:u=!1,size:c="medium",id:d,loading:f=null,loadingIndicator:p,...h}=n,m=gs(d),g=p??b.jsx(ys,{"aria-labelledby":m,color:"inherit",size:16}),y={...n,edge:o,color:s,disabled:l,disableFocusRipple:u,loading:f,loadingIndicator:g,size:c},w=lee(y);return b.jsxs(cee,{id:f?m:d,className:se(w.root,a),centerRipple:!0,focusRipple:!u,disabled:l||f,ref:r,...h,ownerState:y,children:[typeof f=="boolean"&&b.jsx("span",{className:w.loadingWrapper,style:{display:"contents"},children:b.jsx(uee,{className:w.loadingIndicator,ownerState:y,children:f&&g})}),i]})}),dee=Qe(b.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),fee=Qe(b.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),pee=Qe(b.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),hee=Qe(b.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),mee=Qe(b.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),gee=e=>{const{variant:t,color:r,severity:n,classes:o}=e,i={root:["root",`color${te(r||n)}`,`${t}${te(r||n)}`,`${t}`],icon:["icon"],message:["message"],action:["action"]};return _e(i,QJ,o)},yee=J(sr,{name:"MuiAlert",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${te(r.color||r.severity)}`]]}})(we(({theme:e})=>{const t=e.palette.mode==="light"?e.darken:e.lighten,r=e.palette.mode==="light"?e.lighten:e.darken;return{...e.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(e.palette).filter(Tt(["light"])).map(([n])=>({props:{colorSeverity:n,variant:"standard"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),backgroundColor:e.vars?e.vars.palette.Alert[`${n}StandardBg`]:r(e.palette[n].light,.9),[`& .${uk.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}})),...Object.entries(e.palette).filter(Tt(["light"])).map(([n])=>({props:{colorSeverity:n,variant:"outlined"},style:{color:e.vars?e.vars.palette.Alert[`${n}Color`]:t(e.palette[n].light,.6),border:`1px solid ${(e.vars||e).palette[n].light}`,[`& .${uk.icon}`]:e.vars?{color:e.vars.palette.Alert[`${n}IconColor`]}:{color:e.palette[n].main}}})),...Object.entries(e.palette).filter(Tt(["dark"])).map(([n])=>({props:{colorSeverity:n,variant:"filled"},style:{fontWeight:e.typography.fontWeightMedium,...e.vars?{color:e.vars.palette.Alert[`${n}FilledColor`],backgroundColor:e.vars.palette.Alert[`${n}FilledBg`]}:{backgroundColor:e.palette.mode==="dark"?e.palette[n].dark:e.palette[n].main,color:e.palette.getContrastText(e.palette[n].main)}}}))]}})),vee=J("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),bee=J("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),wee=J("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),xee={success:b.jsx(dee,{fontSize:"inherit"}),warning:b.jsx(fee,{fontSize:"inherit"}),error:b.jsx(pee,{fontSize:"inherit"}),info:b.jsx(hee,{fontSize:"inherit"})},gr=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiAlert"}),{action:o,children:i,className:a,closeText:s="Close",color:l,components:u={},componentsProps:c={},icon:d,iconMapping:f=xee,onClose:p,role:h="alert",severity:m="success",slotProps:g={},slots:y={},variant:w="standard",...S}=n,x={...n,color:l,severity:m,variant:w,colorSeverity:l||m},P=gee(x),A={slots:{closeButton:u.CloseButton,closeIcon:u.CloseIcon,...y},slotProps:{...c,...g}},[T,I]=ke("root",{ref:r,shouldForwardComponentProp:!0,className:se(P.root,a),elementType:yee,externalForwardedProps:{...A,...S},ownerState:x,additionalProps:{role:h,elevation:0}}),[O,_]=ke("icon",{className:P.icon,elementType:vee,externalForwardedProps:A,ownerState:x}),[R,E]=ke("message",{className:P.message,elementType:bee,externalForwardedProps:A,ownerState:x}),[M,B]=ke("action",{className:P.action,elementType:wee,externalForwardedProps:A,ownerState:x}),[j,N]=ke("closeButton",{elementType:ui,externalForwardedProps:A,ownerState:x}),[F,D]=ke("closeIcon",{elementType:mee,externalForwardedProps:A,ownerState:x});return b.jsxs(T,{...I,children:[d!==!1?b.jsx(O,{..._,children:d||f[m]}):null,b.jsx(R,{...E,children:i}),o!=null?b.jsx(M,{...B,children:o}):null,o==null&&p?b.jsx(M,{...B,children:b.jsx(j,{size:"small","aria-label":s,title:s,color:"inherit",onClick:p,...N,children:b.jsx(F,{fontSize:"small",...D})})}):null]})});function See(e){return Oe("MuiTypography",e)}Te("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const Cee={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},Eee=eJ(),Pee=e=>{const{align:t,gutterBottom:r,noWrap:n,paragraph:o,variant:i,classes:a}=e,s={root:["root",i,e.align!=="inherit"&&`align${te(t)}`,r&&"gutterBottom",n&&"noWrap",o&&"paragraph"]};return _e(s,See,a)},Aee=J("span",{name:"MuiTypography",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.variant&&t[r.variant],r.align!=="inherit"&&t[`align${te(r.align)}`],r.noWrap&&t.noWrap,r.gutterBottom&&t.gutterBottom,r.paragraph&&t.paragraph]}})(we(({theme:e})=>{var t;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(e.typography).filter(([r,n])=>r!=="inherit"&&n&&typeof n=="object").map(([r,n])=>({props:{variant:r},style:n})),...Object.entries(e.palette).filter(Tt()).map(([r])=>({props:{color:r},style:{color:(e.vars||e).palette[r].main}})),...Object.entries(((t=e.palette)==null?void 0:t.text)||{}).filter(([,r])=>typeof r=="string").map(([r])=>({props:{color:`text${te(r)}`},style:{color:(e.vars||e).palette.text[r]}})),{props:({ownerState:r})=>r.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:r})=>r.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:r})=>r.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:r})=>r.paragraph,style:{marginBottom:16}}]}})),fk={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},ae=v.forwardRef(function(t,r){const{color:n,...o}=$e({props:t,name:"MuiTypography"}),i=!Cee[n],a=Eee({...o,...i&&{color:n}}),{align:s="inherit",className:l,component:u,gutterBottom:c=!1,noWrap:d=!1,paragraph:f=!1,variant:p="body1",variantMapping:h=fk,...m}=a,g={...a,align:s,color:n,className:l,component:u,gutterBottom:c,noWrap:d,paragraph:f,variant:p,variantMapping:h},y=u||(f?"p":h[p]||fk[p])||"span",w=Pee(g);return b.jsx(Aee,{as:y,ref:r,className:se(w.root,l),...m,ownerState:g,style:{...s!=="inherit"&&{"--Typography-textAlign":s},...m.style}})});function kee(e){return Oe("MuiAppBar",e)}Te("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const Tee=e=>{const{color:t,position:r,classes:n}=e,o={root:["root",`color${te(t)}`,`position${te(r)}`]};return _e(o,kee,n)},pk=(e,t)=>e?`${e==null?void 0:e.replace(")","")}, ${t})`:t,Iee=J(sr,{name:"MuiAppBar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`position${te(r.position)}`],t[`color${te(r.color)}`]]}})(we(({theme:e})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(e.vars||e).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit",color:"var(--AppBar-color)"}},{props:{color:"default"},style:{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[100],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[100]),...e.applyStyles("dark",{"--AppBar-background":e.vars?e.vars.palette.AppBar.defaultBg:e.palette.grey[900],"--AppBar-color":e.vars?e.vars.palette.text.primary:e.palette.getContrastText(e.palette.grey[900])})}},...Object.entries(e.palette).filter(Tt(["contrastText"])).map(([t])=>({props:{color:t},style:{"--AppBar-background":(e.vars??e).palette[t].main,"--AppBar-color":(e.vars??e).palette[t].contrastText}})),{props:t=>t.enableColorOnDark===!0&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:t=>t.enableColorOnDark===!1&&!["inherit","transparent"].includes(t.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundColor:e.vars?pk(e.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:e.vars?pk(e.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...e.applyStyles("dark",{backgroundImage:"none"})}}]}))),Oee=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiAppBar"}),{className:o,color:i="primary",enableColorOnDark:a=!1,position:s="fixed",...l}=n,u={...n,color:i,position:s,enableColorOnDark:a},c=Tee(u);return b.jsx(Iee,{square:!0,component:"header",ownerState:u,elevation:4,className:se(c.root,o,s==="fixed"&&"mui-fixed"),ref:r,...l})});function K4(e){const t=v.useRef({});return v.useEffect(()=>{t.current=e}),t.current}var un="top",lo="bottom",co="right",dn="left",S6="auto",ih=[un,lo,co,dn],vu="start",pp="end",_ee="clippingParents",Z4="viewport",Ed="popper",$ee="reference",hk=ih.reduce(function(e,t){return e.concat([t+"-"+vu,t+"-"+pp])},[]),Y4=[].concat(ih,[S6]).reduce(function(e,t){return e.concat([t,t+"-"+vu,t+"-"+pp])},[]),Ree="beforeRead",jee="read",Mee="afterRead",Nee="beforeMain",Bee="main",Lee="afterMain",Dee="beforeWrite",zee="write",Fee="afterWrite",Uee=[Ree,jee,Mee,Nee,Bee,Lee,Dee,zee,Fee];function Ai(e){return e?(e.nodeName||"").toLowerCase():null}function Rn(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var t=e.ownerDocument;return t&&t.defaultView||window}return e}function Ml(e){var t=Rn(e).Element;return e instanceof t||e instanceof Element}function oo(e){var t=Rn(e).HTMLElement;return e instanceof t||e instanceof HTMLElement}function C6(e){if(typeof ShadowRoot>"u")return!1;var t=Rn(e).ShadowRoot;return e instanceof t||e instanceof ShadowRoot}function Wee(e){var t=e.state;Object.keys(t.elements).forEach(function(r){var n=t.styles[r]||{},o=t.attributes[r]||{},i=t.elements[r];!oo(i)||!Ai(i)||(Object.assign(i.style,n),Object.keys(o).forEach(function(a){var s=o[a];s===!1?i.removeAttribute(a):i.setAttribute(a,s===!0?"":s)}))})}function Hee(e){var t=e.state,r={popper:{position:t.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(t.elements.popper.style,r.popper),t.styles=r,t.elements.arrow&&Object.assign(t.elements.arrow.style,r.arrow),function(){Object.keys(t.elements).forEach(function(n){var o=t.elements[n],i=t.attributes[n]||{},a=Object.keys(t.styles.hasOwnProperty(n)?t.styles[n]:r[n]),s=a.reduce(function(l,u){return l[u]="",l},{});!oo(o)||!Ai(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(l){o.removeAttribute(l)}))})}}const Vee={name:"applyStyles",enabled:!0,phase:"write",fn:Wee,effect:Hee,requires:["computeStyles"]};function xi(e){return e.split("-")[0]}var bl=Math.max,Fm=Math.min,bu=Math.round;function Vx(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(t){return t.brand+"/"+t.version}).join(" "):navigator.userAgent}function X4(){return!/^((?!chrome|android).)*safari/i.test(Vx())}function wu(e,t,r){t===void 0&&(t=!1),r===void 0&&(r=!1);var n=e.getBoundingClientRect(),o=1,i=1;t&&oo(e)&&(o=e.offsetWidth>0&&bu(n.width)/e.offsetWidth||1,i=e.offsetHeight>0&&bu(n.height)/e.offsetHeight||1);var a=Ml(e)?Rn(e):window,s=a.visualViewport,l=!X4()&&r,u=(n.left+(l&&s?s.offsetLeft:0))/o,c=(n.top+(l&&s?s.offsetTop:0))/i,d=n.width/o,f=n.height/i;return{width:d,height:f,top:c,right:u+d,bottom:c+f,left:u,x:u,y:c}}function E6(e){var t=wu(e),r=e.offsetWidth,n=e.offsetHeight;return Math.abs(t.width-r)<=1&&(r=t.width),Math.abs(t.height-n)<=1&&(n=t.height),{x:e.offsetLeft,y:e.offsetTop,width:r,height:n}}function Q4(e,t){var r=t.getRootNode&&t.getRootNode();if(e.contains(t))return!0;if(r&&C6(r)){var n=t;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function sa(e){return Rn(e).getComputedStyle(e)}function Gee(e){return["table","td","th"].indexOf(Ai(e))>=0}function _s(e){return((Ml(e)?e.ownerDocument:e.document)||window.document).documentElement}function hv(e){return Ai(e)==="html"?e:e.assignedSlot||e.parentNode||(C6(e)?e.host:null)||_s(e)}function mk(e){return!oo(e)||sa(e).position==="fixed"?null:e.offsetParent}function qee(e){var t=/firefox/i.test(Vx()),r=/Trident/i.test(Vx());if(r&&oo(e)){var n=sa(e);if(n.position==="fixed")return null}var o=hv(e);for(C6(o)&&(o=o.host);oo(o)&&["html","body"].indexOf(Ai(o))<0;){var i=sa(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||t&&i.willChange==="filter"||t&&i.filter&&i.filter!=="none")return o;o=o.parentNode}return null}function ah(e){for(var t=Rn(e),r=mk(e);r&&Gee(r)&&sa(r).position==="static";)r=mk(r);return r&&(Ai(r)==="html"||Ai(r)==="body"&&sa(r).position==="static")?t:r||qee(e)||t}function P6(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function df(e,t,r){return bl(e,Fm(t,r))}function Kee(e,t,r){var n=df(e,t,r);return n>r?r:n}function J4(){return{top:0,right:0,bottom:0,left:0}}function eM(e){return Object.assign({},J4(),e)}function tM(e,t){return t.reduce(function(r,n){return r[n]=e,r},{})}var Zee=function(t,r){return t=typeof t=="function"?t(Object.assign({},r.rects,{placement:r.placement})):t,eM(typeof t!="number"?t:tM(t,ih))};function Yee(e){var t,r=e.state,n=e.name,o=e.options,i=r.elements.arrow,a=r.modifiersData.popperOffsets,s=xi(r.placement),l=P6(s),u=[dn,co].indexOf(s)>=0,c=u?"height":"width";if(!(!i||!a)){var d=Zee(o.padding,r),f=E6(i),p=l==="y"?un:dn,h=l==="y"?lo:co,m=r.rects.reference[c]+r.rects.reference[l]-a[l]-r.rects.popper[c],g=a[l]-r.rects.reference[l],y=ah(i),w=y?l==="y"?y.clientHeight||0:y.clientWidth||0:0,S=m/2-g/2,x=d[p],P=w-f[c]-d[h],A=w/2-f[c]/2+S,T=df(x,A,P),I=l;r.modifiersData[n]=(t={},t[I]=T,t.centerOffset=T-A,t)}}function Xee(e){var t=e.state,r=e.options,n=r.element,o=n===void 0?"[data-popper-arrow]":n;o!=null&&(typeof o=="string"&&(o=t.elements.popper.querySelector(o),!o)||Q4(t.elements.popper,o)&&(t.elements.arrow=o))}const Qee={name:"arrow",enabled:!0,phase:"main",fn:Yee,effect:Xee,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function xu(e){return e.split("-")[1]}var Jee={top:"auto",right:"auto",bottom:"auto",left:"auto"};function ete(e,t){var r=e.x,n=e.y,o=t.devicePixelRatio||1;return{x:bu(r*o)/o||0,y:bu(n*o)/o||0}}function gk(e){var t,r=e.popper,n=e.popperRect,o=e.placement,i=e.variation,a=e.offsets,s=e.position,l=e.gpuAcceleration,u=e.adaptive,c=e.roundOffsets,d=e.isFixed,f=a.x,p=f===void 0?0:f,h=a.y,m=h===void 0?0:h,g=typeof c=="function"?c({x:p,y:m}):{x:p,y:m};p=g.x,m=g.y;var y=a.hasOwnProperty("x"),w=a.hasOwnProperty("y"),S=dn,x=un,P=window;if(u){var A=ah(r),T="clientHeight",I="clientWidth";if(A===Rn(r)&&(A=_s(r),sa(A).position!=="static"&&s==="absolute"&&(T="scrollHeight",I="scrollWidth")),A=A,o===un||(o===dn||o===co)&&i===pp){x=lo;var O=d&&A===P&&P.visualViewport?P.visualViewport.height:A[T];m-=O-n.height,m*=l?1:-1}if(o===dn||(o===un||o===lo)&&i===pp){S=co;var _=d&&A===P&&P.visualViewport?P.visualViewport.width:A[I];p-=_-n.width,p*=l?1:-1}}var R=Object.assign({position:s},u&&Jee),E=c===!0?ete({x:p,y:m},Rn(r)):{x:p,y:m};if(p=E.x,m=E.y,l){var M;return Object.assign({},R,(M={},M[x]=w?"0":"",M[S]=y?"0":"",M.transform=(P.devicePixelRatio||1)<=1?"translate("+p+"px, "+m+"px)":"translate3d("+p+"px, "+m+"px, 0)",M))}return Object.assign({},R,(t={},t[x]=w?m+"px":"",t[S]=y?p+"px":"",t.transform="",t))}function tte(e){var t=e.state,r=e.options,n=r.gpuAcceleration,o=n===void 0?!0:n,i=r.adaptive,a=i===void 0?!0:i,s=r.roundOffsets,l=s===void 0?!0:s,u={placement:xi(t.placement),variation:xu(t.placement),popper:t.elements.popper,popperRect:t.rects.popper,gpuAcceleration:o,isFixed:t.options.strategy==="fixed"};t.modifiersData.popperOffsets!=null&&(t.styles.popper=Object.assign({},t.styles.popper,gk(Object.assign({},u,{offsets:t.modifiersData.popperOffsets,position:t.options.strategy,adaptive:a,roundOffsets:l})))),t.modifiersData.arrow!=null&&(t.styles.arrow=Object.assign({},t.styles.arrow,gk(Object.assign({},u,{offsets:t.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:l})))),t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-placement":t.placement})}const rte={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:tte,data:{}};var t0={passive:!0};function nte(e){var t=e.state,r=e.instance,n=e.options,o=n.scroll,i=o===void 0?!0:o,a=n.resize,s=a===void 0?!0:a,l=Rn(t.elements.popper),u=[].concat(t.scrollParents.reference,t.scrollParents.popper);return i&&u.forEach(function(c){c.addEventListener("scroll",r.update,t0)}),s&&l.addEventListener("resize",r.update,t0),function(){i&&u.forEach(function(c){c.removeEventListener("scroll",r.update,t0)}),s&&l.removeEventListener("resize",r.update,t0)}}const ote={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:nte,data:{}};var ite={left:"right",right:"left",bottom:"top",top:"bottom"};function H0(e){return e.replace(/left|right|bottom|top/g,function(t){return ite[t]})}var ate={start:"end",end:"start"};function yk(e){return e.replace(/start|end/g,function(t){return ate[t]})}function A6(e){var t=Rn(e),r=t.pageXOffset,n=t.pageYOffset;return{scrollLeft:r,scrollTop:n}}function k6(e){return wu(_s(e)).left+A6(e).scrollLeft}function ste(e,t){var r=Rn(e),n=_s(e),o=r.visualViewport,i=n.clientWidth,a=n.clientHeight,s=0,l=0;if(o){i=o.width,a=o.height;var u=X4();(u||!u&&t==="fixed")&&(s=o.offsetLeft,l=o.offsetTop)}return{width:i,height:a,x:s+k6(e),y:l}}function lte(e){var t,r=_s(e),n=A6(e),o=(t=e.ownerDocument)==null?void 0:t.body,i=bl(r.scrollWidth,r.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=bl(r.scrollHeight,r.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-n.scrollLeft+k6(e),l=-n.scrollTop;return sa(o||r).direction==="rtl"&&(s+=bl(r.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:l}}function T6(e){var t=sa(e),r=t.overflow,n=t.overflowX,o=t.overflowY;return/auto|scroll|overlay|hidden/.test(r+o+n)}function rM(e){return["html","body","#document"].indexOf(Ai(e))>=0?e.ownerDocument.body:oo(e)&&T6(e)?e:rM(hv(e))}function ff(e,t){var r;t===void 0&&(t=[]);var n=rM(e),o=n===((r=e.ownerDocument)==null?void 0:r.body),i=Rn(n),a=o?[i].concat(i.visualViewport||[],T6(n)?n:[]):n,s=t.concat(a);return o?s:s.concat(ff(hv(a)))}function Gx(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function cte(e,t){var r=wu(e,!1,t==="fixed");return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function vk(e,t,r){return t===Z4?Gx(ste(e,r)):Ml(t)?cte(t,r):Gx(lte(_s(e)))}function ute(e){var t=ff(hv(e)),r=["absolute","fixed"].indexOf(sa(e).position)>=0,n=r&&oo(e)?ah(e):e;return Ml(n)?t.filter(function(o){return Ml(o)&&Q4(o,n)&&Ai(o)!=="body"}):[]}function dte(e,t,r,n){var o=t==="clippingParents"?ute(e):[].concat(t),i=[].concat(o,[r]),a=i[0],s=i.reduce(function(l,u){var c=vk(e,u,n);return l.top=bl(c.top,l.top),l.right=Fm(c.right,l.right),l.bottom=Fm(c.bottom,l.bottom),l.left=bl(c.left,l.left),l},vk(e,a,n));return s.width=s.right-s.left,s.height=s.bottom-s.top,s.x=s.left,s.y=s.top,s}function nM(e){var t=e.reference,r=e.element,n=e.placement,o=n?xi(n):null,i=n?xu(n):null,a=t.x+t.width/2-r.width/2,s=t.y+t.height/2-r.height/2,l;switch(o){case un:l={x:a,y:t.y-r.height};break;case lo:l={x:a,y:t.y+t.height};break;case co:l={x:t.x+t.width,y:s};break;case dn:l={x:t.x-r.width,y:s};break;default:l={x:t.x,y:t.y}}var u=o?P6(o):null;if(u!=null){var c=u==="y"?"height":"width";switch(i){case vu:l[u]=l[u]-(t[c]/2-r[c]/2);break;case pp:l[u]=l[u]+(t[c]/2-r[c]/2);break}}return l}function hp(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=n===void 0?e.placement:n,i=r.strategy,a=i===void 0?e.strategy:i,s=r.boundary,l=s===void 0?_ee:s,u=r.rootBoundary,c=u===void 0?Z4:u,d=r.elementContext,f=d===void 0?Ed:d,p=r.altBoundary,h=p===void 0?!1:p,m=r.padding,g=m===void 0?0:m,y=eM(typeof g!="number"?g:tM(g,ih)),w=f===Ed?$ee:Ed,S=e.rects.popper,x=e.elements[h?w:f],P=dte(Ml(x)?x:x.contextElement||_s(e.elements.popper),l,c,a),A=wu(e.elements.reference),T=nM({reference:A,element:S,placement:o}),I=Gx(Object.assign({},S,T)),O=f===Ed?I:A,_={top:P.top-O.top+y.top,bottom:O.bottom-P.bottom+y.bottom,left:P.left-O.left+y.left,right:O.right-P.right+y.right},R=e.modifiersData.offset;if(f===Ed&&R){var E=R[o];Object.keys(_).forEach(function(M){var B=[co,lo].indexOf(M)>=0?1:-1,j=[un,lo].indexOf(M)>=0?"y":"x";_[M]+=E[j]*B})}return _}function fte(e,t){t===void 0&&(t={});var r=t,n=r.placement,o=r.boundary,i=r.rootBoundary,a=r.padding,s=r.flipVariations,l=r.allowedAutoPlacements,u=l===void 0?Y4:l,c=xu(n),d=c?s?hk:hk.filter(function(h){return xu(h)===c}):ih,f=d.filter(function(h){return u.indexOf(h)>=0});f.length===0&&(f=d);var p=f.reduce(function(h,m){return h[m]=hp(e,{placement:m,boundary:o,rootBoundary:i,padding:a})[xi(m)],h},{});return Object.keys(p).sort(function(h,m){return p[h]-p[m]})}function pte(e){if(xi(e)===S6)return[];var t=H0(e);return[yk(e),t,yk(t)]}function hte(e){var t=e.state,r=e.options,n=e.name;if(!t.modifiersData[n]._skip){for(var o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!0:a,l=r.fallbackPlacements,u=r.padding,c=r.boundary,d=r.rootBoundary,f=r.altBoundary,p=r.flipVariations,h=p===void 0?!0:p,m=r.allowedAutoPlacements,g=t.options.placement,y=xi(g),w=y===g,S=l||(w||!h?[H0(g)]:pte(g)),x=[g].concat(S).reduce(function(re,Y){return re.concat(xi(Y)===S6?fte(t,{placement:Y,boundary:c,rootBoundary:d,padding:u,flipVariations:h,allowedAutoPlacements:m}):Y)},[]),P=t.rects.reference,A=t.rects.popper,T=new Map,I=!0,O=x[0],_=0;_=0,j=B?"width":"height",N=hp(t,{placement:R,boundary:c,rootBoundary:d,altBoundary:f,padding:u}),F=B?M?co:dn:M?lo:un;P[j]>A[j]&&(F=H0(F));var D=H0(F),z=[];if(i&&z.push(N[E]<=0),s&&z.push(N[F]<=0,N[D]<=0),z.every(function(re){return re})){O=R,I=!1;break}T.set(R,z)}if(I)for(var W=h?3:1,H=function(Y){var Z=x.find(function(ie){var me=T.get(ie);if(me)return me.slice(0,Y).every(function(G){return G})});if(Z)return O=Z,"break"},V=W;V>0;V--){var Q=H(V);if(Q==="break")break}t.placement!==O&&(t.modifiersData[n]._skip=!0,t.placement=O,t.reset=!0)}}const mte={name:"flip",enabled:!0,phase:"main",fn:hte,requiresIfExists:["offset"],data:{_skip:!1}};function bk(e,t,r){return r===void 0&&(r={x:0,y:0}),{top:e.top-t.height-r.y,right:e.right-t.width+r.x,bottom:e.bottom-t.height+r.y,left:e.left-t.width-r.x}}function wk(e){return[un,co,lo,dn].some(function(t){return e[t]>=0})}function gte(e){var t=e.state,r=e.name,n=t.rects.reference,o=t.rects.popper,i=t.modifiersData.preventOverflow,a=hp(t,{elementContext:"reference"}),s=hp(t,{altBoundary:!0}),l=bk(a,n),u=bk(s,o,i),c=wk(l),d=wk(u);t.modifiersData[r]={referenceClippingOffsets:l,popperEscapeOffsets:u,isReferenceHidden:c,hasPopperEscaped:d},t.attributes.popper=Object.assign({},t.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":d})}const yte={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:gte};function vte(e,t,r){var n=xi(e),o=[dn,un].indexOf(n)>=0?-1:1,i=typeof r=="function"?r(Object.assign({},t,{placement:e})):r,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[dn,co].indexOf(n)>=0?{x:s,y:a}:{x:a,y:s}}function bte(e){var t=e.state,r=e.options,n=e.name,o=r.offset,i=o===void 0?[0,0]:o,a=Y4.reduce(function(c,d){return c[d]=vte(d,t.rects,i),c},{}),s=a[t.placement],l=s.x,u=s.y;t.modifiersData.popperOffsets!=null&&(t.modifiersData.popperOffsets.x+=l,t.modifiersData.popperOffsets.y+=u),t.modifiersData[n]=a}const wte={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:bte};function xte(e){var t=e.state,r=e.name;t.modifiersData[r]=nM({reference:t.rects.reference,element:t.rects.popper,placement:t.placement})}const Ste={name:"popperOffsets",enabled:!0,phase:"read",fn:xte,data:{}};function Cte(e){return e==="x"?"y":"x"}function Ete(e){var t=e.state,r=e.options,n=e.name,o=r.mainAxis,i=o===void 0?!0:o,a=r.altAxis,s=a===void 0?!1:a,l=r.boundary,u=r.rootBoundary,c=r.altBoundary,d=r.padding,f=r.tether,p=f===void 0?!0:f,h=r.tetherOffset,m=h===void 0?0:h,g=hp(t,{boundary:l,rootBoundary:u,padding:d,altBoundary:c}),y=xi(t.placement),w=xu(t.placement),S=!w,x=P6(y),P=Cte(x),A=t.modifiersData.popperOffsets,T=t.rects.reference,I=t.rects.popper,O=typeof m=="function"?m(Object.assign({},t.rects,{placement:t.placement})):m,_=typeof O=="number"?{mainAxis:O,altAxis:O}:Object.assign({mainAxis:0,altAxis:0},O),R=t.modifiersData.offset?t.modifiersData.offset[t.placement]:null,E={x:0,y:0};if(A){if(i){var M,B=x==="y"?un:dn,j=x==="y"?lo:co,N=x==="y"?"height":"width",F=A[x],D=F+g[B],z=F-g[j],W=p?-I[N]/2:0,H=w===vu?T[N]:I[N],V=w===vu?-I[N]:-T[N],Q=t.elements.arrow,re=p&&Q?E6(Q):{width:0,height:0},Y=t.modifiersData["arrow#persistent"]?t.modifiersData["arrow#persistent"].padding:J4(),Z=Y[B],ie=Y[j],me=df(0,T[N],re[N]),G=S?T[N]/2-W-me-Z-_.mainAxis:H-me-Z-_.mainAxis,oe=S?-T[N]/2+W+me+ie+_.mainAxis:V+me+ie+_.mainAxis,de=t.elements.arrow&&ah(t.elements.arrow),q=de?x==="y"?de.clientTop||0:de.clientLeft||0:0,Ee=(M=R==null?void 0:R[x])!=null?M:0,ce=F+G-Ee-q,ue=F+oe-Ee,ye=df(p?Fm(D,ce):D,F,p?bl(z,ue):z);A[x]=ye,E[x]=ye-F}if(s){var Pe,Ne=x==="x"?un:dn,Ue=x==="x"?lo:co,Ke=A[P],We=P==="y"?"height":"width",Ae=Ke+g[Ne],qt=Ke-g[Ue],Xe=[un,dn].indexOf(y)!==-1,Ct=(Pe=R==null?void 0:R[P])!=null?Pe:0,Lt=Xe?Ae:Ke-T[We]-I[We]-Ct+_.altAxis,Kt=Xe?Ke+T[We]+I[We]-Ct-_.altAxis:qt,bt=p&&Xe?Kee(Lt,Ke,Kt):df(p?Lt:Ae,Ke,p?Kt:qt);A[P]=bt,E[P]=bt-Ke}t.modifiersData[n]=E}}const Pte={name:"preventOverflow",enabled:!0,phase:"main",fn:Ete,requiresIfExists:["offset"]};function Ate(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function kte(e){return e===Rn(e)||!oo(e)?A6(e):Ate(e)}function Tte(e){var t=e.getBoundingClientRect(),r=bu(t.width)/e.offsetWidth||1,n=bu(t.height)/e.offsetHeight||1;return r!==1||n!==1}function Ite(e,t,r){r===void 0&&(r=!1);var n=oo(t),o=oo(t)&&Tte(t),i=_s(t),a=wu(e,o,r),s={scrollLeft:0,scrollTop:0},l={x:0,y:0};return(n||!n&&!r)&&((Ai(t)!=="body"||T6(i))&&(s=kte(t)),oo(t)?(l=wu(t,!0),l.x+=t.clientLeft,l.y+=t.clientTop):i&&(l.x=k6(i))),{x:a.left+s.scrollLeft-l.x,y:a.top+s.scrollTop-l.y,width:a.width,height:a.height}}function Ote(e){var t=new Map,r=new Set,n=[];e.forEach(function(i){t.set(i.name,i)});function o(i){r.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!r.has(s)){var l=t.get(s);l&&o(l)}}),n.push(i)}return e.forEach(function(i){r.has(i.name)||o(i)}),n}function _te(e){var t=Ote(e);return Uee.reduce(function(r,n){return r.concat(t.filter(function(o){return o.phase===n}))},[])}function $te(e){var t;return function(){return t||(t=new Promise(function(r){Promise.resolve().then(function(){t=void 0,r(e())})})),t}}function Rte(e){var t=e.reduce(function(r,n){var o=r[n.name];return r[n.name]=o?Object.assign({},o,n,{options:Object.assign({},o.options,n.options),data:Object.assign({},o.data,n.data)}):n,r},{});return Object.keys(t).map(function(r){return t[r]})}var xk={placement:"bottom",modifiers:[],strategy:"absolute"};function Sk(){for(var e=arguments.length,t=new Array(e),r=0;r=19?((t=e==null?void 0:e.props)==null?void 0:t.ref)||null:(e==null?void 0:e.ref)||null}function Bte(e){return typeof e=="function"?e():e}const oM=v.forwardRef(function(t,r){const{children:n,container:o,disablePortal:i=!1}=t,[a,s]=v.useState(null),l=nr(v.isValidElement(n)?Qu(n):null,r);if($n(()=>{i||s(Bte(o)||document.body)},[o,i]),$n(()=>{if(a&&!i)return ak(r,a),()=>{ak(r,null)}},[r,a,i]),i){if(v.isValidElement(n)){const u={ref:l};return v.cloneElement(n,u)}return n}return a&&Qp.createPortal(n,a)});function Lte(e){return Oe("MuiPopper",e)}Te("MuiPopper",["root"]);function Dte(e,t){if(t==="ltr")return e;switch(e){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return e}}function qx(e){return typeof e=="function"?e():e}function zte(e){return e.nodeType!==void 0}const Fte=e=>{const{classes:t}=e;return _e({root:["root"]},Lte,t)},Ute={},Wte=v.forwardRef(function(t,r){const{anchorEl:n,children:o,direction:i,disablePortal:a,modifiers:s,open:l,placement:u,popperOptions:c,popperRef:d,slotProps:f={},slots:p={},TransitionProps:h,ownerState:m,...g}=t,y=v.useRef(null),w=nr(y,r),S=v.useRef(null),x=nr(S,d),P=v.useRef(x);$n(()=>{P.current=x},[x]),v.useImperativeHandle(d,()=>S.current,[]);const A=Dte(u,i),[T,I]=v.useState(A),[O,_]=v.useState(qx(n));v.useEffect(()=>{S.current&&S.current.forceUpdate()}),v.useEffect(()=>{n&&_(qx(n))},[n]),$n(()=>{if(!O||!l)return;const j=D=>{I(D.placement)};let N=[{name:"preventOverflow",options:{altBoundary:a}},{name:"flip",options:{altBoundary:a}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:D})=>{j(D)}}];s!=null&&(N=N.concat(s)),c&&c.modifiers!=null&&(N=N.concat(c.modifiers));const F=Nte(O,y.current,{placement:A,...c,modifiers:N});return P.current(F),()=>{F.destroy(),P.current(null)}},[O,a,s,l,c,A]);const R={placement:T};h!==null&&(R.TransitionProps=h);const E=Fte(t),M=p.root??"div",B=Su({elementType:M,externalSlotProps:f.root,externalForwardedProps:g,additionalProps:{role:"tooltip",ref:w},ownerState:t,className:E.root});return b.jsx(M,{...B,children:typeof o=="function"?o(R):o})}),Hte=v.forwardRef(function(t,r){const{anchorEl:n,children:o,container:i,direction:a="ltr",disablePortal:s=!1,keepMounted:l=!1,modifiers:u,open:c,placement:d="bottom",popperOptions:f=Ute,popperRef:p,style:h,transition:m=!1,slotProps:g={},slots:y={},...w}=t,[S,x]=v.useState(!0),P=()=>{x(!1)},A=()=>{x(!0)};if(!l&&!c&&(!m||S))return null;let T;if(i)T=i;else if(n){const _=qx(n);T=_&&zte(_)?hn(_).body:hn(null).body}const I=!c&&l&&(!m||S)?"none":void 0,O=m?{in:c,onEnter:P,onExited:A}:void 0;return b.jsx(oM,{disablePortal:s,container:T,children:b.jsx(Wte,{anchorEl:n,direction:a,disablePortal:s,modifiers:u,ref:r,open:m?!S:c,placement:d,popperOptions:f,popperRef:p,slotProps:g,slots:y,...w,style:{position:"fixed",top:0,left:0,display:I,...h},TransitionProps:O,children:o})})}),Vte=J(Hte,{name:"MuiPopper",slot:"Root"})({}),iM=v.forwardRef(function(t,r){const n=ql(),o=$e({props:t,name:"MuiPopper"}),{anchorEl:i,component:a,components:s,componentsProps:l,container:u,disablePortal:c,keepMounted:d,modifiers:f,open:p,placement:h,popperOptions:m,popperRef:g,transition:y,slots:w,slotProps:S,...x}=o,P=(w==null?void 0:w.root)??(s==null?void 0:s.Root),A={anchorEl:i,container:u,disablePortal:c,keepMounted:d,modifiers:f,open:p,placement:h,popperOptions:m,popperRef:g,transition:y,...x};return b.jsx(Vte,{as:a,direction:n?"rtl":"ltr",slots:{root:P},slotProps:S??l,...A,ref:r})}),Gte=Qe(b.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function qte(e){return Oe("MuiChip",e)}const Ze=Te("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),Kte=e=>{const{classes:t,disabled:r,size:n,color:o,iconColor:i,onDelete:a,clickable:s,variant:l}=e,u={root:["root",l,r&&"disabled",`size${te(n)}`,`color${te(o)}`,s&&"clickable",s&&`clickableColor${te(o)}`,a&&"deletable",a&&`deletableColor${te(o)}`,`${l}${te(o)}`],label:["label",`label${te(n)}`],avatar:["avatar",`avatar${te(n)}`,`avatarColor${te(o)}`],icon:["icon",`icon${te(n)}`,`iconColor${te(i)}`],deleteIcon:["deleteIcon",`deleteIcon${te(n)}`,`deleteIconColor${te(o)}`,`deleteIcon${te(l)}Color${te(o)}`]};return _e(u,qte,t)},Zte=J("div",{name:"MuiChip",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e,{color:n,iconColor:o,clickable:i,onDelete:a,size:s,variant:l}=r;return[{[`& .${Ze.avatar}`]:t.avatar},{[`& .${Ze.avatar}`]:t[`avatar${te(s)}`]},{[`& .${Ze.avatar}`]:t[`avatarColor${te(n)}`]},{[`& .${Ze.icon}`]:t.icon},{[`& .${Ze.icon}`]:t[`icon${te(s)}`]},{[`& .${Ze.icon}`]:t[`iconColor${te(o)}`]},{[`& .${Ze.deleteIcon}`]:t.deleteIcon},{[`& .${Ze.deleteIcon}`]:t[`deleteIcon${te(s)}`]},{[`& .${Ze.deleteIcon}`]:t[`deleteIconColor${te(n)}`]},{[`& .${Ze.deleteIcon}`]:t[`deleteIcon${te(l)}Color${te(n)}`]},t.root,t[`size${te(s)}`],t[`color${te(n)}`],i&&t.clickable,i&&n!=="default"&&t[`clickableColor${te(n)}`],a&&t.deletable,a&&n!=="default"&&t[`deletableColor${te(n)}`],t[l],t[`${l}${te(n)}`]]}})(we(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[700]:e.palette.grey[300];return{maxWidth:"100%",fontFamily:e.typography.fontFamily,fontSize:e.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(e.vars||e).palette.text.primary,backgroundColor:(e.vars||e).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:e.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${Ze.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${Ze.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:e.vars?e.vars.palette.Chip.defaultAvatarColor:t,fontSize:e.typography.pxToRem(12)},[`& .${Ze.avatarColorPrimary}`]:{color:(e.vars||e).palette.primary.contrastText,backgroundColor:(e.vars||e).palette.primary.dark},[`& .${Ze.avatarColorSecondary}`]:{color:(e.vars||e).palette.secondary.contrastText,backgroundColor:(e.vars||e).palette.secondary.dark},[`& .${Ze.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:e.typography.pxToRem(10)},[`& .${Ze.icon}`]:{marginLeft:5,marginRight:-6},[`& .${Ze.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:e.alpha((e.vars||e).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:e.alpha((e.vars||e).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${Ze.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${Ze.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(e.palette).filter(Tt(["contrastText"])).map(([r])=>({props:{color:r},style:{backgroundColor:(e.vars||e).palette[r].main,color:(e.vars||e).palette[r].contrastText,[`& .${Ze.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[r].contrastText,.7),"&:hover, &:active":{color:(e.vars||e).palette[r].contrastText}}}})),{props:r=>r.iconColor===r.color,style:{[`& .${Ze.icon}`]:{color:e.vars?e.vars.palette.Chip.defaultIconColor:t}}},{props:r=>r.iconColor===r.color&&r.color!=="default",style:{[`& .${Ze.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${Ze.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}}},...Object.entries(e.palette).filter(Tt(["dark"])).map(([r])=>({props:{color:r,onDelete:!0},style:{[`&.${Ze.focusVisible}`]:{background:(e.vars||e).palette[r].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)},[`&.${Ze.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.action.selected,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)},"&:active":{boxShadow:(e.vars||e).shadows[1]}}},...Object.entries(e.palette).filter(Tt(["dark"])).map(([r])=>({props:{color:r,clickable:!0},style:{[`&:hover, &.${Ze.focusVisible}`]:{backgroundColor:(e.vars||e).palette[r].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:e.vars?`1px solid ${e.vars.palette.Chip.defaultBorder}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[700]}`,[`&.${Ze.clickable}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Ze.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`& .${Ze.avatar}`]:{marginLeft:4},[`& .${Ze.avatarSmall}`]:{marginLeft:2},[`& .${Ze.icon}`]:{marginLeft:4},[`& .${Ze.iconSmall}`]:{marginLeft:2},[`& .${Ze.deleteIcon}`]:{marginRight:5},[`& .${Ze.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(e.palette).filter(Tt()).map(([r])=>({props:{variant:"outlined",color:r},style:{color:(e.vars||e).palette[r].main,border:`1px solid ${e.alpha((e.vars||e).palette[r].main,.7)}`,[`&.${Ze.clickable}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.hoverOpacity)},[`&.${Ze.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette[r].main,(e.vars||e).palette.action.focusOpacity)},[`& .${Ze.deleteIcon}`]:{color:e.alpha((e.vars||e).palette[r].main,.7),"&:hover, &:active":{color:(e.vars||e).palette[r].main}}}}))]}})),Yte=J("span",{name:"MuiChip",slot:"Label",overridesResolver:(e,t)=>{const{ownerState:r}=e,{size:n}=r;return[t.label,t[`label${te(n)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function Ck(e){return e.key==="Backspace"||e.key==="Delete"}const fn=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiChip"}),{avatar:o,className:i,clickable:a,color:s="default",component:l,deleteIcon:u,disabled:c=!1,icon:d,label:f,onClick:p,onDelete:h,onKeyDown:m,onKeyUp:g,size:y="medium",variant:w="filled",tabIndex:S,skipFocusWhenDisabled:x=!1,slots:P={},slotProps:A={},...T}=n,I=v.useRef(null),O=nr(I,r),_=Z=>{Z.stopPropagation(),h&&h(Z)},R=Z=>{Z.currentTarget===Z.target&&Ck(Z)&&Z.preventDefault(),m&&m(Z)},E=Z=>{Z.currentTarget===Z.target&&h&&Ck(Z)&&h(Z),g&&g(Z)},M=a!==!1&&p?!0:a,B=M||h?aa:l||"div",j={...n,component:B,disabled:c,size:y,color:s,iconColor:v.isValidElement(d)&&d.props.color||s,onDelete:!!h,clickable:M,variant:w},N=Kte(j),F=B===aa?{component:l||"div",focusVisibleClassName:N.focusVisible,...h&&{disableRipple:!0}}:{};let D=null;h&&(D=u&&v.isValidElement(u)?v.cloneElement(u,{className:se(u.props.className,N.deleteIcon),onClick:_}):b.jsx(Gte,{className:N.deleteIcon,onClick:_}));let z=null;o&&v.isValidElement(o)&&(z=v.cloneElement(o,{className:se(N.avatar,o.props.className)}));let W=null;d&&v.isValidElement(d)&&(W=v.cloneElement(d,{className:se(N.icon,d.props.className)}));const H={slots:P,slotProps:A},[V,Q]=ke("root",{elementType:Zte,externalForwardedProps:{...H,...T},ownerState:j,shouldForwardComponentProp:!0,ref:O,className:se(N.root,i),additionalProps:{disabled:M&&c?!0:void 0,tabIndex:x&&c?-1:S,...F},getSlotProps:Z=>({...Z,onClick:ie=>{var me;(me=Z.onClick)==null||me.call(Z,ie),p==null||p(ie)},onKeyDown:ie=>{var me;(me=Z.onKeyDown)==null||me.call(Z,ie),R(ie)},onKeyUp:ie=>{var me;(me=Z.onKeyUp)==null||me.call(Z,ie),E(ie)}})}),[re,Y]=ke("label",{elementType:Yte,externalForwardedProps:H,ownerState:j,className:N.label});return b.jsxs(V,{as:B,...Q,children:[z||W,b.jsx(re,{...Y,children:f}),D]})});function r0(e){return parseInt(e,10)||0}const Xte={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function Qte(e){for(const t in e)return!1;return!0}function Ek(e){return Qte(e)||e.outerHeightStyle===0&&!e.overflowing}const Jte=v.forwardRef(function(t,r){const{onChange:n,maxRows:o,minRows:i=1,style:a,value:s,...l}=t,{current:u}=v.useRef(s!=null),c=v.useRef(null),d=nr(r,c),f=v.useRef(null),p=v.useRef(null),h=v.useCallback(()=>{const S=c.current,x=p.current;if(!S||!x)return;const A=Lo(S).getComputedStyle(S);if(A.width==="0px")return{outerHeightStyle:0,overflowing:!1};x.style.width=A.width,x.value=S.value||t.placeholder||"x",x.value.slice(-1)===` +`&&(x.value+=" ");const T=A.boxSizing,I=r0(A.paddingBottom)+r0(A.paddingTop),O=r0(A.borderBottomWidth)+r0(A.borderTopWidth),_=x.scrollHeight;x.value="x";const R=x.scrollHeight;let E=_;i&&(E=Math.max(Number(i)*R,E)),o&&(E=Math.min(Number(o)*R,E)),E=Math.max(E,R);const M=E+(T==="border-box"?I+O:0),B=Math.abs(E-_)<=1;return{outerHeightStyle:M,overflowing:B}},[o,i,t.placeholder]),m=no(()=>{const S=c.current,x=h();if(!S||!x||Ek(x))return!1;const P=x.outerHeightStyle;return f.current!=null&&f.current!==P}),g=v.useCallback(()=>{const S=c.current,x=h();if(!S||!x||Ek(x))return;const P=x.outerHeightStyle;f.current!==P&&(f.current=P,S.style.height=`${P}px`),S.style.overflow=x.overflowing?"hidden":""},[h]),y=v.useRef(-1);$n(()=>{const S=fv(g),x=c==null?void 0:c.current;if(!x)return;const P=Lo(x);P.addEventListener("resize",S);let A;return typeof ResizeObserver<"u"&&(A=new ResizeObserver(()=>{m()&&(A.unobserve(x),cancelAnimationFrame(y.current),g(),y.current=requestAnimationFrame(()=>{A.observe(x)}))}),A.observe(x)),()=>{S.clear(),cancelAnimationFrame(y.current),P.removeEventListener("resize",S),A&&A.disconnect()}},[h,g,m]),$n(()=>{g()});const w=S=>{u||g();const x=S.target,P=x.value.length,A=x.value.endsWith(` +`),T=x.selectionStart===P;A&&T&&x.setSelectionRange(P,P),n&&n(S)};return b.jsxs(v.Fragment,{children:[b.jsx("textarea",{value:s,onChange:w,ref:d,rows:i,style:a,...l}),b.jsx("textarea",{"aria-hidden":!0,className:t.className,readOnly:!0,ref:p,tabIndex:-1,style:{...Xte.shadow,...a,paddingTop:0,paddingBottom:0}})]})});function Kl({props:e,states:t,muiFormControl:r}){return t.reduce((n,o)=>(n[o]=e[o],r&&typeof e[o]>"u"&&(n[o]=r[o]),n),{})}const I6=v.createContext(void 0);function $s(){return v.useContext(I6)}function Pk(e){return e!=null&&!(Array.isArray(e)&&e.length===0)}function Um(e,t=!1){return e&&(Pk(e.value)&&e.value!==""||t&&Pk(e.defaultValue)&&e.defaultValue!=="")}function ere(e){return e.startAdornment}function tre(e){return Oe("MuiInputBase",e)}const Cu=Te("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var Ak;const mv=(e,t)=>{const{ownerState:r}=e;return[t.root,r.formControl&&t.formControl,r.startAdornment&&t.adornedStart,r.endAdornment&&t.adornedEnd,r.error&&t.error,r.size==="small"&&t.sizeSmall,r.multiline&&t.multiline,r.color&&t[`color${te(r.color)}`],r.fullWidth&&t.fullWidth,r.hiddenLabel&&t.hiddenLabel]},gv=(e,t)=>{const{ownerState:r}=e;return[t.input,r.size==="small"&&t.inputSizeSmall,r.multiline&&t.inputMultiline,r.type==="search"&&t.inputTypeSearch,r.startAdornment&&t.inputAdornedStart,r.endAdornment&&t.inputAdornedEnd,r.hiddenLabel&&t.inputHiddenLabel]},rre=e=>{const{classes:t,color:r,disabled:n,error:o,endAdornment:i,focused:a,formControl:s,fullWidth:l,hiddenLabel:u,multiline:c,readOnly:d,size:f,startAdornment:p,type:h}=e,m={root:["root",`color${te(r)}`,n&&"disabled",o&&"error",l&&"fullWidth",a&&"focused",s&&"formControl",f&&f!=="medium"&&`size${te(f)}`,c&&"multiline",p&&"adornedStart",i&&"adornedEnd",u&&"hiddenLabel",d&&"readOnly"],input:["input",n&&"disabled",h==="search"&&"inputTypeSearch",c&&"inputMultiline",f==="small"&&"inputSizeSmall",u&&"inputHiddenLabel",p&&"inputAdornedStart",i&&"inputAdornedEnd",d&&"readOnly"]};return _e(m,tre,t)},yv=J("div",{name:"MuiInputBase",slot:"Root",overridesResolver:mv})(we(({theme:e})=>({...e.typography.body1,color:(e.vars||e).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${Cu.disabled}`]:{color:(e.vars||e).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:t})=>t.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:t,size:r})=>t.multiline&&r==="small",style:{paddingTop:1}},{props:({ownerState:t})=>t.fullWidth,style:{width:"100%"}}]}))),vv=J("input",{name:"MuiInputBase",slot:"Input",overridesResolver:gv})(we(({theme:e})=>{const t=e.palette.mode==="light",r={color:"currentColor",...e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5},transition:e.transitions.create("opacity",{duration:e.transitions.duration.shorter})},n={opacity:"0 !important"},o=e.vars?{opacity:e.vars.opacity.inputPlaceholder}:{opacity:t?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":r,"&::-moz-placeholder":r,"&::-ms-input-placeholder":r,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${Cu.formControl} &`]:{"&::-webkit-input-placeholder":n,"&::-moz-placeholder":n,"&::-ms-input-placeholder":n,"&:focus::-webkit-input-placeholder":o,"&:focus::-moz-placeholder":o,"&:focus::-ms-input-placeholder":o},[`&.${Cu.disabled}`]:{opacity:1,WebkitTextFillColor:(e.vars||e).palette.text.disabled},variants:[{props:({ownerState:i})=>!i.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:i})=>i.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),kk=b6({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),bv=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiInputBase"}),{"aria-describedby":o,autoComplete:i,autoFocus:a,className:s,color:l,components:u={},componentsProps:c={},defaultValue:d,disabled:f,disableInjectingGlobalStyles:p,endAdornment:h,error:m,fullWidth:g=!1,id:y,inputComponent:w="input",inputProps:S={},inputRef:x,margin:P,maxRows:A,minRows:T,multiline:I=!1,name:O,onBlur:_,onChange:R,onClick:E,onFocus:M,onKeyDown:B,onKeyUp:j,placeholder:N,readOnly:F,renderSuffix:D,rows:z,size:W,slotProps:H={},slots:V={},startAdornment:Q,type:re="text",value:Y,...Z}=n,ie=S.value!=null?S.value:Y,{current:me}=v.useRef(ie!=null),G=v.useRef(),oe=v.useCallback(C=>{},[]),de=nr(G,x,S.ref,oe),[q,Ee]=v.useState(!1),ce=$s(),ue=Kl({props:n,muiFormControl:ce,states:["color","disabled","error","hiddenLabel","size","required","filled"]});ue.focused=ce?ce.focused:q,v.useEffect(()=>{!ce&&f&&q&&(Ee(!1),_&&_())},[ce,f,q,_]);const ye=ce&&ce.onFilled,Pe=ce&&ce.onEmpty,Ne=v.useCallback(C=>{Um(C)?ye&&ye():Pe&&Pe()},[ye,Pe]);$n(()=>{me&&Ne({value:ie})},[ie,Ne,me]);const Ue=C=>{M&&M(C),S.onFocus&&S.onFocus(C),ce&&ce.onFocus?ce.onFocus(C):Ee(!0)},Ke=C=>{_&&_(C),S.onBlur&&S.onBlur(C),ce&&ce.onBlur?ce.onBlur(C):Ee(!1)},We=(C,...k)=>{if(!me){const L=C.target||G.current;if(L==null)throw new Error(ia(1));Ne({value:L.value})}S.onChange&&S.onChange(C,...k),R&&R(C,...k)};v.useEffect(()=>{Ne(G.current)},[]);const Ae=C=>{G.current&&C.currentTarget===C.target&&G.current.focus(),E&&E(C)};let qt=w,Xe=S;I&&qt==="input"&&(z?Xe={type:void 0,minRows:z,maxRows:z,...Xe}:Xe={type:void 0,maxRows:A,minRows:T,...Xe},qt=Jte);const Ct=C=>{Ne(C.animationName==="mui-auto-fill-cancel"?G.current:{value:"x"})};v.useEffect(()=>{ce&&ce.setAdornedStart(!!Q)},[ce,Q]);const Lt={...n,color:ue.color||"primary",disabled:ue.disabled,endAdornment:h,error:ue.error,focused:ue.focused,formControl:ce,fullWidth:g,hiddenLabel:ue.hiddenLabel,multiline:I,size:ue.size,startAdornment:Q,type:re},Kt=rre(Lt),bt=V.root||u.Root||yv,or=H.root||c.root||{},$=V.input||u.Input||vv;return Xe={...Xe,...H.input??c.input},b.jsxs(v.Fragment,{children:[!p&&typeof kk=="function"&&(Ak||(Ak=b.jsx(kk,{}))),b.jsxs(bt,{...or,ref:r,onClick:Ae,...Z,...!Dm(bt)&&{ownerState:{...Lt,...or.ownerState}},className:se(Kt.root,or.className,s,F&&"MuiInputBase-readOnly"),children:[Q,b.jsx(I6.Provider,{value:null,children:b.jsx($,{"aria-invalid":ue.error,"aria-describedby":o,autoComplete:i,autoFocus:a,defaultValue:d,disabled:ue.disabled,id:y,onAnimationStart:Ct,name:O,placeholder:N,readOnly:F,required:ue.required,rows:z,value:ie,onKeyDown:B,onKeyUp:j,type:re,...Xe,...!Dm($)&&{as:qt,ownerState:{...Lt,...Xe.ownerState}},ref:de,className:se(Kt.input,Xe.className,F&&"MuiInputBase-readOnly"),onBlur:Ke,onChange:We,onFocus:Ue})}),h,D?D({...ue,startAdornment:Q}):null]})]})});function nre(e){return Oe("MuiInput",e)}const Pd={...Cu,...Te("MuiInput",["root","underline","input"])};function ore(e){return Oe("MuiOutlinedInput",e)}const Yo={...Cu,...Te("MuiOutlinedInput",["root","notchedOutline","input"])};function ire(e){return Oe("MuiFilledInput",e)}const zs={...Cu,...Te("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},are=Qe(b.jsx("path",{d:"M7 10l5 5 5-5z"})),sre={entering:{opacity:1},entered:{opacity:1}},lre=v.forwardRef(function(t,r){const n=Os(),o={enter:n.transitions.duration.enteringScreen,exit:n.transitions.duration.leavingScreen},{addEndListener:i,appear:a=!0,children:s,easing:l,in:u,onEnter:c,onEntered:d,onEntering:f,onExit:p,onExited:h,onExiting:m,style:g,timeout:y=o,TransitionComponent:w=Fo,...S}=t,x=v.useRef(null),P=nr(x,Qu(s),r),A=B=>j=>{if(B){const N=x.current;j===void 0?B(N):B(N,j)}},T=A(f),I=A((B,j)=>{U4(B);const N=gu({style:g,timeout:y,easing:l},{mode:"enter"});B.style.webkitTransition=n.transitions.create("opacity",N),B.style.transition=n.transitions.create("opacity",N),c&&c(B,j)}),O=A(d),_=A(m),R=A(B=>{const j=gu({style:g,timeout:y,easing:l},{mode:"exit"});B.style.webkitTransition=n.transitions.create("opacity",j),B.style.transition=n.transitions.create("opacity",j),p&&p(B)}),E=A(h),M=B=>{i&&i(x.current,B)};return b.jsx(w,{appear:a,in:u,nodeRef:x,onEnter:I,onEntered:O,onEntering:T,onExit:R,onExited:E,onExiting:_,addEndListener:M,timeout:y,...S,children:(B,{ownerState:j,...N})=>v.cloneElement(s,{style:{opacity:0,visibility:B==="exited"&&!u?"hidden":void 0,...sre[B],...g,...s.props.style},ref:P,...N})})});function cre(e){return Oe("MuiBackdrop",e)}Te("MuiBackdrop",["root","invisible"]);const ure=e=>{const{classes:t,invisible:r}=e;return _e({root:["root",r&&"invisible"]},cre,t)},dre=J("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.invisible&&t.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),fre=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiBackdrop"}),{children:o,className:i,component:a="div",invisible:s=!1,open:l,components:u={},componentsProps:c={},slotProps:d={},slots:f={},TransitionComponent:p,transitionDuration:h,...m}=n,g={...n,component:a,invisible:s},y=ure(g),w={transition:p,root:u.Root,...f},S={...c,...d},x={component:a,slots:w,slotProps:S},[P,A]=ke("root",{elementType:dre,externalForwardedProps:x,className:se(y.root,i),ownerState:g}),[T,I]=ke("transition",{elementType:lre,externalForwardedProps:x,ownerState:g});return b.jsx(T,{in:l,timeout:h,...m,...I,children:b.jsx(P,{"aria-hidden":!0,...A,ref:r,children:o})})});function pre(e){const{badgeContent:t,invisible:r=!1,max:n=99,showZero:o=!1}=e,i=K4({badgeContent:t,max:n});let a=r;r===!1&&t===0&&!o&&(a=!0);const{badgeContent:s,max:l=n}=a?i:e,u=s&&Number(s)>l?`${l}+`:s;return{badgeContent:s,invisible:a,max:l,displayValue:u}}function hre(e){return Oe("MuiBadge",e)}const _a=Te("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),v1=10,b1=4,mre=e=>{const{color:t,anchorOrigin:r,invisible:n,overlap:o,variant:i,classes:a={}}=e,s={root:["root"],badge:["badge",i,n&&"invisible",`anchorOrigin${te(r.vertical)}${te(r.horizontal)}`,`anchorOrigin${te(r.vertical)}${te(r.horizontal)}${te(o)}`,`overlap${te(o)}`,t!=="default"&&`color${te(t)}`]};return _e(s,hre,a)},gre=J("span",{name:"MuiBadge",slot:"Root"})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),yre=J("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.badge,t[r.variant],t[`anchorOrigin${te(r.anchorOrigin.vertical)}${te(r.anchorOrigin.horizontal)}${te(r.overlap)}`],r.color!=="default"&&t[`color${te(r.color)}`],r.invisible&&t.invisible]}})(we(({theme:e})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:e.typography.fontFamily,fontWeight:e.typography.fontWeightMedium,fontSize:e.typography.pxToRem(12),minWidth:v1*2,lineHeight:1,padding:"0 6px",height:v1*2,borderRadius:v1,zIndex:1,transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.enteringScreen}),variants:[...Object.entries(e.palette).filter(Tt(["contrastText"])).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main,color:(e.vars||e).palette[t].contrastText}})),{props:{variant:"dot"},style:{borderRadius:b1,height:b1*2,minWidth:b1*2,padding:0}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="right"&&t.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="top"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:t})=>t.anchorOrigin.vertical==="bottom"&&t.anchorOrigin.horizontal==="left"&&t.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${_a.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:e.transitions.create("transform",{easing:e.transitions.easing.easeInOut,duration:e.transitions.duration.leavingScreen})}}]})));function Tk(e){return{vertical:(e==null?void 0:e.vertical)??"top",horizontal:(e==null?void 0:e.horizontal)??"right"}}const vre=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiBadge"}),{anchorOrigin:o,className:i,classes:a,component:s,components:l={},componentsProps:u={},children:c,overlap:d="rectangular",color:f="default",invisible:p=!1,max:h=99,badgeContent:m,slots:g,slotProps:y,showZero:w=!1,variant:S="standard",...x}=n,{badgeContent:P,invisible:A,max:T,displayValue:I}=pre({max:h,invisible:p,badgeContent:m,showZero:w}),O=K4({anchorOrigin:Tk(o),color:f,overlap:d,variant:S,badgeContent:m}),_=A||P==null&&S!=="dot",{color:R=f,overlap:E=d,anchorOrigin:M,variant:B=S}=_?O:n,j=Tk(M),N=B!=="dot"?I:void 0,F={...n,badgeContent:P,invisible:_,max:T,displayValue:N,showZero:w,anchorOrigin:j,color:R,overlap:E,variant:B},D=mre(F),z={slots:{root:(g==null?void 0:g.root)??l.Root,badge:(g==null?void 0:g.badge)??l.Badge},slotProps:{root:(y==null?void 0:y.root)??u.root,badge:(y==null?void 0:y.badge)??u.badge}},[W,H]=ke("root",{elementType:gre,externalForwardedProps:{...z,...x},ownerState:F,className:se(D.root,i),ref:r,additionalProps:{as:s}}),[V,Q]=ke("badge",{elementType:yre,externalForwardedProps:z,ownerState:F,className:D.badge});return b.jsxs(W,{...H,children:[c,b.jsx(V,{...Q,children:N})]})}),bre=Te("MuiBox",["root"]),wre=dv(),ge=nX({themeId:bi,defaultTheme:wre,defaultClassName:bre.root,generateClassName:b4.generate});function xre(e){return Oe("MuiButton",e)}const Fs=Te("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),Sre=v.createContext({}),Cre=v.createContext(void 0),Ere=e=>{const{color:t,disableElevation:r,fullWidth:n,size:o,variant:i,loading:a,loadingPosition:s,classes:l}=e,u={root:["root",a&&"loading",i,`${i}${te(t)}`,`size${te(o)}`,`${i}Size${te(o)}`,`color${te(t)}`,r&&"disableElevation",n&&"fullWidth",a&&`loadingPosition${te(s)}`],startIcon:["icon","startIcon",`iconSize${te(o)}`],endIcon:["icon","endIcon",`iconSize${te(o)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},c=_e(u,xre,l);return{...l,...c}},aM=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],Pre=J(aa,{shouldForwardProp:e=>zn(e)||e==="classes",name:"MuiButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`${r.variant}${te(r.color)}`],t[`size${te(r.size)}`],t[`${r.variant}Size${te(r.size)}`],r.color==="inherit"&&t.colorInherit,r.disableElevation&&t.disableElevation,r.fullWidth&&t.fullWidth,r.loading&&t.loading]}})(we(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[300]:e.palette.grey[800],r=e.palette.mode==="light"?e.palette.grey.A100:e.palette.grey[700];return{...e.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create(["background-color","box-shadow","border-color","color"],{duration:e.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${Fs.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(e.vars||e).shadows[2],"&:hover":{boxShadow:(e.vars||e).shadows[4],"@media (hover: none)":{boxShadow:(e.vars||e).shadows[2]}},"&:active":{boxShadow:(e.vars||e).shadows[8]},[`&.${Fs.focusVisible}`]:{boxShadow:(e.vars||e).shadows[6]},[`&.${Fs.disabled}`]:{color:(e.vars||e).palette.action.disabled,boxShadow:(e.vars||e).shadows[0],backgroundColor:(e.vars||e).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${Fs.disabled}`]:{border:`1px solid ${(e.vars||e).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(e.palette).filter(Tt()).map(([n])=>({props:{color:n},style:{"--variant-textColor":(e.vars||e).palette[n].main,"--variant-outlinedColor":(e.vars||e).palette[n].main,"--variant-outlinedBorder":e.alpha((e.vars||e).palette[n].main,.5),"--variant-containedColor":(e.vars||e).palette[n].contrastText,"--variant-containedBg":(e.vars||e).palette[n].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(e.vars||e).palette[n].dark,"--variant-textBg":e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBorder":(e.vars||e).palette[n].main,"--variant-outlinedBg":e.alpha((e.vars||e).palette[n].main,(e.vars||e).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedBg:t,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":e.vars?e.vars.palette.Button.inheritContainedHoverBg:r,"--variant-textBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity),"--variant-outlinedBg":e.alpha((e.vars||e).palette.text.primary,(e.vars||e).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:e.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:e.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:e.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${Fs.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${Fs.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:e.transitions.create(["background-color","box-shadow","border-color"],{duration:e.transitions.duration.short}),[`&.${Fs.loading}`]:{color:"transparent"}}}]}})),Are=J("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.startIcon,r.loading&&t.startIconLoadingStart,t[`iconSize${te(r.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...aM]})),kre=J("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.endIcon,r.loading&&t.endIconLoadingEnd,t[`iconSize${te(r.size)}`]]}})(({theme:e})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:e.transitions.create(["opacity"],{duration:e.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...aM]})),Tre=J("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:e})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(e.vars||e).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),Ik=J("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Qn=v.forwardRef(function(t,r){const n=v.useContext(Sre),o=v.useContext(Cre),i=cp(n,t),a=$e({props:i,name:"MuiButton"}),{children:s,color:l="primary",component:u="button",className:c,disabled:d=!1,disableElevation:f=!1,disableFocusRipple:p=!1,endIcon:h,focusVisibleClassName:m,fullWidth:g=!1,id:y,loading:w=null,loadingIndicator:S,loadingPosition:x="center",size:P="medium",startIcon:A,type:T,variant:I="text",...O}=a,_=gs(y),R=S??b.jsx(ys,{"aria-labelledby":_,color:"inherit",size:16}),E={...a,color:l,component:u,disabled:d,disableElevation:f,disableFocusRipple:p,fullWidth:g,loading:w,loadingIndicator:R,loadingPosition:x,size:P,type:T,variant:I},M=Ere(E),B=(A||w&&x==="start")&&b.jsx(Are,{className:M.startIcon,ownerState:E,children:A||b.jsx(Ik,{className:M.loadingIconPlaceholder,ownerState:E})}),j=(h||w&&x==="end")&&b.jsx(kre,{className:M.endIcon,ownerState:E,children:h||b.jsx(Ik,{className:M.loadingIconPlaceholder,ownerState:E})}),N=o||"",F=typeof w=="boolean"?b.jsx("span",{className:M.loadingWrapper,style:{display:"contents"},children:w&&b.jsx(Tre,{className:M.loadingIndicator,ownerState:E,children:R})}):null;return b.jsxs(Pre,{ownerState:E,className:se(n.className,M.root,c,N),component:u,disabled:d||w,focusRipple:!p,focusVisibleClassName:se(M.focusVisible,m),ref:r,type:T,id:w?_:y,...O,classes:M,children:[B,x!=="end"&&F,s,x==="end"&&F,j]})});function Ire(e){return Oe("PrivateSwitchBase",e)}Te("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const Ore=e=>{const{classes:t,checked:r,disabled:n,edge:o}=e,i={root:["root",r&&"checked",n&&"disabled",o&&`edge${te(o)}`],input:["input"]};return _e(i,Ire,t)},_re=J(aa,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:e,ownerState:t})=>e==="start"&&t.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:e,ownerState:t})=>e==="end"&&t.size!=="small",style:{marginRight:-12}}]}),$re=J("input",{name:"MuiSwitchBase",shouldForwardProp:zn})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Rre=v.forwardRef(function(t,r){const{autoFocus:n,checked:o,checkedIcon:i,defaultChecked:a,disabled:s,disableFocusRipple:l=!1,edge:u=!1,icon:c,id:d,inputProps:f,inputRef:p,name:h,onBlur:m,onChange:g,onFocus:y,readOnly:w,required:S=!1,tabIndex:x,type:P,value:A,slots:T={},slotProps:I={},...O}=t,[_,R]=dp({controlled:o,default:!!a,name:"SwitchBase",state:"checked"}),E=$s(),M=Y=>{y&&y(Y),E&&E.onFocus&&E.onFocus(Y)},B=Y=>{m&&m(Y),E&&E.onBlur&&E.onBlur(Y)},j=Y=>{if(Y.nativeEvent.defaultPrevented||w)return;const Z=Y.target.checked;R(Z),g&&g(Y,Z)};let N=s;E&&typeof N>"u"&&(N=E.disabled);const F=P==="checkbox"||P==="radio",D={...t,checked:_,disabled:N,disableFocusRipple:l,edge:u},z=Ore(D),W={slots:T,slotProps:{input:f,...I}},[H,V]=ke("root",{ref:r,elementType:_re,className:z.root,shouldForwardComponentProp:!0,externalForwardedProps:{...W,component:"span",...O},getSlotProps:Y=>({...Y,onFocus:Z=>{var ie;(ie=Y.onFocus)==null||ie.call(Y,Z),M(Z)},onBlur:Z=>{var ie;(ie=Y.onBlur)==null||ie.call(Y,Z),B(Z)}}),ownerState:D,additionalProps:{centerRipple:!0,focusRipple:!l,disabled:N,role:void 0,tabIndex:null}}),[Q,re]=ke("input",{ref:p,elementType:$re,className:z.input,externalForwardedProps:W,getSlotProps:Y=>({...Y,onChange:Z=>{var ie;(ie=Y.onChange)==null||ie.call(Y,Z),j(Z)}}),ownerState:D,additionalProps:{autoFocus:n,checked:o,defaultChecked:a,disabled:N,id:F?d:void 0,name:h,readOnly:w,required:S,tabIndex:x,type:P,...P==="checkbox"&&A===void 0?{}:{value:A}}});return b.jsxs(H,{...V,children:[b.jsx(Q,{...re}),_?i:c]})}),Wm=qX({createStyledComponent:J("div",{name:"MuiContainer",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`maxWidth${te(String(r.maxWidth))}`],r.fixed&&t.fixed,r.disableGutters&&t.disableGutters]}}),useThemeProps:e=>$e({props:e,name:"MuiContainer"})}),Kx=typeof b6({})=="function",jre=(e,t)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",...t&&!e.vars&&{colorScheme:e.palette.mode}}),Mre=e=>({color:(e.vars||e).palette.text.primary,...e.typography.body1,backgroundColor:(e.vars||e).palette.background.default,"@media print":{backgroundColor:(e.vars||e).palette.common.white}}),sM=(e,t=!1)=>{var i,a;const r={};t&&e.colorSchemes&&typeof e.getColorSchemeSelector=="function"&&Object.entries(e.colorSchemes).forEach(([s,l])=>{var c,d;const u=e.getColorSchemeSelector(s);u.startsWith("@")?r[u]={":root":{colorScheme:(c=l.palette)==null?void 0:c.mode}}:r[u.replace(/\s*&/,"")]={colorScheme:(d=l.palette)==null?void 0:d.mode}});let n={html:jre(e,t),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:e.typography.fontWeightBold},body:{margin:0,...Mre(e),"&::backdrop":{backgroundColor:(e.vars||e).palette.background.default}},...r};const o=(a=(i=e.components)==null?void 0:i.MuiCssBaseline)==null?void 0:a.styleOverrides;return o&&(n=[n,o]),n},V0="mui-ecs",Nre=e=>{const t=sM(e,!1),r=Array.isArray(t)?t[0]:t;return!e.vars&&r&&(r.html[`:root:has(${V0})`]={colorScheme:e.palette.mode}),e.colorSchemes&&Object.entries(e.colorSchemes).forEach(([n,o])=>{var a,s;const i=e.getColorSchemeSelector(n);i.startsWith("@")?r[i]={[`:root:not(:has(.${V0}))`]:{colorScheme:(a=o.palette)==null?void 0:a.mode}}:r[i.replace(/\s*&/,"")]={[`&:not(:has(.${V0}))`]:{colorScheme:(s=o.palette)==null?void 0:s.mode}}}),t},Bre=b6(Kx?({theme:e,enableColorScheme:t})=>sM(e,t):({theme:e})=>Nre(e));function Lre(e){const t=$e({props:e,name:"MuiCssBaseline"}),{children:r,enableColorScheme:n=!1}=t;return b.jsxs(v.Fragment,{children:[Kx&&b.jsx(Bre,{enableColorScheme:n}),!Kx&&!n&&b.jsx("span",{className:V0,style:{display:"none"}}),r]})}function lM(e=window){const t=e.document.documentElement.clientWidth;return e.innerWidth-t}function Dre(e){const t=hn(e);return t.body===e?Lo(e).innerWidth>t.documentElement.clientWidth:e.scrollHeight>e.clientHeight}function pf(e,t){t?e.setAttribute("aria-hidden","true"):e.removeAttribute("aria-hidden")}function Ok(e){return parseFloat(Lo(e).getComputedStyle(e).paddingRight)||0}function zre(e){const r=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(e.tagName),n=e.tagName==="INPUT"&&e.getAttribute("type")==="hidden";return r||n}function _k(e,t,r,n,o){const i=[t,r,...n];[].forEach.call(e.children,a=>{const s=!i.includes(a),l=!zre(a);s&&l&&pf(a,o)})}function w1(e,t){let r=-1;return e.some((n,o)=>t(n)?(r=o,!0):!1),r}function Fre(e,t){const r=[],n=e.container;if(!t.disableScrollLock){if(Dre(n)){const a=lM(Lo(n));r.push({value:n.style.paddingRight,property:"padding-right",el:n}),n.style.paddingRight=`${Ok(n)+a}px`;const s=hn(n).querySelectorAll(".mui-fixed");[].forEach.call(s,l=>{r.push({value:l.style.paddingRight,property:"padding-right",el:l}),l.style.paddingRight=`${Ok(l)+a}px`})}let i;if(n.parentNode instanceof DocumentFragment)i=hn(n).body;else{const a=n.parentElement,s=Lo(n);i=(a==null?void 0:a.nodeName)==="HTML"&&s.getComputedStyle(a).overflowY==="scroll"?a:n}r.push({value:i.style.overflow,property:"overflow",el:i},{value:i.style.overflowX,property:"overflow-x",el:i},{value:i.style.overflowY,property:"overflow-y",el:i}),i.style.overflow="hidden"}return()=>{r.forEach(({value:i,el:a,property:s})=>{i?a.style.setProperty(s,i):a.style.removeProperty(s)})}}function Ure(e){const t=[];return[].forEach.call(e.children,r=>{r.getAttribute("aria-hidden")==="true"&&t.push(r)}),t}class Wre{constructor(){this.modals=[],this.containers=[]}add(t,r){let n=this.modals.indexOf(t);if(n!==-1)return n;n=this.modals.length,this.modals.push(t),t.modalRef&&pf(t.modalRef,!1);const o=Ure(r);_k(r,t.mount,t.modalRef,o,!0);const i=w1(this.containers,a=>a.container===r);return i!==-1?(this.containers[i].modals.push(t),n):(this.containers.push({modals:[t],container:r,restore:null,hiddenSiblings:o}),n)}mount(t,r){const n=w1(this.containers,i=>i.modals.includes(t)),o=this.containers[n];o.restore||(o.restore=Fre(o,r))}remove(t,r=!0){const n=this.modals.indexOf(t);if(n===-1)return n;const o=w1(this.containers,a=>a.modals.includes(t)),i=this.containers[o];if(i.modals.splice(i.modals.indexOf(t),1),this.modals.splice(n,1),i.modals.length===0)i.restore&&i.restore(),t.modalRef&&pf(t.modalRef,r),_k(i.container,t.mount,t.modalRef,i.hiddenSiblings,!1),this.containers.splice(o,1);else{const a=i.modals[i.modals.length-1];a.modalRef&&pf(a.modalRef,!1)}return n}isTopModal(t){return this.modals.length>0&&this.modals[this.modals.length-1]===t}}function $c(e){var r;let t=e.activeElement;for(;((r=t==null?void 0:t.shadowRoot)==null?void 0:r.activeElement)!=null;)t=t.shadowRoot.activeElement;return t}const Hre=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function Vre(e){const t=parseInt(e.getAttribute("tabindex")||"",10);return Number.isNaN(t)?e.contentEditable==="true"||(e.nodeName==="AUDIO"||e.nodeName==="VIDEO"||e.nodeName==="DETAILS")&&e.getAttribute("tabindex")===null?0:e.tabIndex:t}function Gre(e){if(e.tagName!=="INPUT"||e.type!=="radio"||!e.name)return!1;const t=n=>e.ownerDocument.querySelector(`input[type="radio"]${n}`);let r=t(`[name="${e.name}"]:checked`);return r||(r=t(`[name="${e.name}"]`)),r!==e}function qre(e){return!(e.disabled||e.tagName==="INPUT"&&e.type==="hidden"||Gre(e))}function Kre(e){const t=[],r=[];return Array.from(e.querySelectorAll(Hre)).forEach((n,o)=>{const i=Vre(n);i===-1||!qre(n)||(i===0?t.push(n):r.push({documentOrder:o,tabIndex:i,node:n}))}),r.sort((n,o)=>n.tabIndex===o.tabIndex?n.documentOrder-o.documentOrder:n.tabIndex-o.tabIndex).map(n=>n.node).concat(t)}function Zre(){return!0}function Yre(e){const{children:t,disableAutoFocus:r=!1,disableEnforceFocus:n=!1,disableRestoreFocus:o=!1,getTabbable:i=Kre,isEnabled:a=Zre,open:s}=e,l=v.useRef(!1),u=v.useRef(null),c=v.useRef(null),d=v.useRef(null),f=v.useRef(null),p=v.useRef(!1),h=v.useRef(null),m=nr(Qu(t),h),g=v.useRef(null);v.useEffect(()=>{!s||!h.current||(p.current=!r)},[r,s]),v.useEffect(()=>{if(!s||!h.current)return;const S=hn(h.current),x=$c(S);return h.current.contains(x)||(h.current.hasAttribute("tabIndex")||h.current.setAttribute("tabIndex","-1"),p.current&&h.current.focus()),()=>{o||(d.current&&d.current.focus&&(l.current=!0,d.current.focus()),d.current=null)}},[s]),v.useEffect(()=>{if(!s||!h.current)return;const S=hn(h.current),x=T=>{if(g.current=T,n||!a()||T.key!=="Tab")return;$c(S)===h.current&&T.shiftKey&&(l.current=!0,c.current&&c.current.focus())},P=()=>{var _,R;const T=h.current;if(T===null)return;const I=$c(S);if(!S.hasFocus()||!a()||l.current){l.current=!1;return}if(T.contains(I)||n&&I!==u.current&&I!==c.current)return;if(I!==f.current)f.current=null;else if(f.current!==null)return;if(!p.current)return;let O=[];if((I===u.current||I===c.current)&&(O=i(h.current)),O.length>0){const E=!!((_=g.current)!=null&&_.shiftKey&&((R=g.current)==null?void 0:R.key)==="Tab"),M=O[0],B=O[O.length-1];typeof M!="string"&&typeof B!="string"&&(E?B.focus():M.focus())}else T.focus()};S.addEventListener("focusin",P),S.addEventListener("keydown",x,!0);const A=setInterval(()=>{const T=$c(S);T&&T.tagName==="BODY"&&P()},50);return()=>{clearInterval(A),S.removeEventListener("focusin",P),S.removeEventListener("keydown",x,!0)}},[r,n,o,a,s,i]);const y=S=>{d.current===null&&(d.current=S.relatedTarget),p.current=!0,f.current=S.target;const x=t.props.onFocus;x&&x(S)},w=S=>{d.current===null&&(d.current=S.relatedTarget),p.current=!0};return b.jsxs(v.Fragment,{children:[b.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:u,"data-testid":"sentinelStart"}),v.cloneElement(t,{ref:m,onFocus:y}),b.jsx("div",{tabIndex:s?0:-1,onFocus:w,ref:c,"data-testid":"sentinelEnd"})]})}function Xre(e){return typeof e=="function"?e():e}function Qre(e){return e?e.props.hasOwnProperty("in"):!1}const $k=()=>{},n0=new Wre;function Jre(e){const{container:t,disableEscapeKeyDown:r=!1,disableScrollLock:n=!1,closeAfterTransition:o=!1,onTransitionEnter:i,onTransitionExited:a,children:s,onClose:l,open:u,rootRef:c}=e,d=v.useRef({}),f=v.useRef(null),p=v.useRef(null),h=nr(p,c),[m,g]=v.useState(!u),y=Qre(s);let w=!0;(e["aria-hidden"]==="false"||e["aria-hidden"]===!1)&&(w=!1);const S=()=>hn(f.current),x=()=>(d.current.modalRef=p.current,d.current.mount=f.current,d.current),P=()=>{n0.mount(x(),{disableScrollLock:n}),p.current&&(p.current.scrollTop=0)},A=no(()=>{const j=Xre(t)||S().body;n0.add(x(),j),p.current&&P()}),T=()=>n0.isTopModal(x()),I=no(j=>{f.current=j,j&&(u&&T()?P():p.current&&pf(p.current,w))}),O=v.useCallback(()=>{n0.remove(x(),w)},[w]);v.useEffect(()=>()=>{O()},[O]),v.useEffect(()=>{u?A():(!y||!o)&&O()},[u,O,y,o,A]);const _=j=>N=>{var F;(F=j.onKeyDown)==null||F.call(j,N),!(N.key!=="Escape"||N.which===229||!T())&&(r||(N.stopPropagation(),l&&l(N,"escapeKeyDown")))},R=j=>N=>{var F;(F=j.onClick)==null||F.call(j,N),N.target===N.currentTarget&&l&&l(N,"backdropClick")};return{getRootProps:(j={})=>{const N=V4(e);delete N.onTransitionEnter,delete N.onTransitionExited;const F={...N,...j};return{role:"presentation",...F,onKeyDown:_(F),ref:h}},getBackdropProps:(j={})=>{const N=j;return{"aria-hidden":!0,...N,onClick:R(N),open:u}},getTransitionProps:()=>{const j=()=>{g(!1),i&&i()},N=()=>{g(!0),a&&a(),o&&O()};return{onEnter:ik(j,(s==null?void 0:s.props.onEnter)??$k),onExited:ik(N,(s==null?void 0:s.props.onExited)??$k)}},rootRef:h,portalRef:I,isTopModal:T,exited:m,hasTransition:y}}function ene(e){return Oe("MuiModal",e)}Te("MuiModal",["root","hidden","backdrop"]);const tne=e=>{const{open:t,exited:r,classes:n}=e;return _e({root:["root",!t&&r&&"hidden"],backdrop:["backdrop"]},ene,n)},rne=J("div",{name:"MuiModal",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.open&&r.exited&&t.hidden]}})(we(({theme:e})=>({position:"fixed",zIndex:(e.vars||e).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:t})=>!t.open&&t.exited,style:{visibility:"hidden"}}]}))),nne=J(fre,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),one=v.forwardRef(function(t,r){const n=$e({name:"MuiModal",props:t}),{BackdropComponent:o=nne,BackdropProps:i,classes:a,className:s,closeAfterTransition:l=!1,children:u,container:c,component:d,components:f={},componentsProps:p={},disableAutoFocus:h=!1,disableEnforceFocus:m=!1,disableEscapeKeyDown:g=!1,disablePortal:y=!1,disableRestoreFocus:w=!1,disableScrollLock:S=!1,hideBackdrop:x=!1,keepMounted:P=!1,onClose:A,onTransitionEnter:T,onTransitionExited:I,open:O,slotProps:_={},slots:R={},theme:E,...M}=n,B={...n,closeAfterTransition:l,disableAutoFocus:h,disableEnforceFocus:m,disableEscapeKeyDown:g,disablePortal:y,disableRestoreFocus:w,disableScrollLock:S,hideBackdrop:x,keepMounted:P},{getRootProps:j,getBackdropProps:N,getTransitionProps:F,portalRef:D,isTopModal:z,exited:W,hasTransition:H}=Jre({...B,rootRef:r}),V={...B,exited:W},Q=tne(V),re={};if(u.props.tabIndex===void 0&&(re.tabIndex="-1"),H){const{onEnter:oe,onExited:de}=F();re.onEnter=oe,re.onExited=de}const Y={slots:{root:f.Root,backdrop:f.Backdrop,...R},slotProps:{...p,..._}},[Z,ie]=ke("root",{ref:r,elementType:rne,externalForwardedProps:{...Y,...M,component:d},getSlotProps:j,ownerState:V,className:se(s,Q==null?void 0:Q.root,!V.open&&V.exited&&(Q==null?void 0:Q.hidden))}),[me,G]=ke("backdrop",{ref:i==null?void 0:i.ref,elementType:o,externalForwardedProps:Y,shouldForwardComponentProp:!0,additionalProps:i,getSlotProps:oe=>N({...oe,onClick:de=>{oe!=null&&oe.onClick&&oe.onClick(de)}}),className:se(i==null?void 0:i.className,Q==null?void 0:Q.backdrop),ownerState:V});return!P&&!O&&(!H||W)?null:b.jsx(oM,{ref:D,container:c,disablePortal:y,children:b.jsxs(Z,{...ie,children:[!x&&o?b.jsx(me,{...G}):null,b.jsx(Yre,{disableEnforceFocus:m,disableAutoFocus:h,disableRestoreFocus:w,isEnabled:z,open:O,children:v.cloneElement(u,re)})]})})}),Rk=Te("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),ine=e=>{const{classes:t,disableUnderline:r,startAdornment:n,endAdornment:o,size:i,hiddenLabel:a,multiline:s}=e,l={root:["root",!r&&"underline",n&&"adornedStart",o&&"adornedEnd",i==="small"&&`size${te(i)}`,a&&"hiddenLabel",s&&"multiline"],input:["input"]},u=_e(l,ire,t);return{...t,...u}},ane=J(yv,{shouldForwardProp:e=>zn(e)||e==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...mv(e,t),!r.disableUnderline&&t.underline]}})(we(({theme:e})=>{const t=e.palette.mode==="light",r=t?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",n=t?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",o=t?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",i=t?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n,borderTopLeftRadius:(e.vars||e).shape.borderRadius,borderTopRightRadius:(e.vars||e).shape.borderRadius,transition:e.transitions.create("background-color",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),"&:hover":{backgroundColor:e.vars?e.vars.palette.FilledInput.hoverBg:o,"@media (hover: none)":{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n}},[`&.${zs.focused}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.bg:n},[`&.${zs.disabled}`]:{backgroundColor:e.vars?e.vars.palette.FilledInput.disabledBg:i},variants:[{props:({ownerState:a})=>!a.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${zs.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${zs.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${e.vars?e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline):r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${zs.disabled}, .${zs.error}):before`]:{borderBottom:`1px solid ${(e.vars||e).palette.text.primary}`},[`&.${zs.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Tt()).map(([a])=>{var s;return{props:{disableUnderline:!1,color:a},style:{"&::after":{borderBottom:`2px solid ${(s=(e.vars||e).palette[a])==null?void 0:s.main}`}}}}),{props:({ownerState:a})=>a.startAdornment,style:{paddingLeft:12}},{props:({ownerState:a})=>a.endAdornment,style:{paddingRight:12}},{props:({ownerState:a})=>a.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:a,size:s})=>a.multiline&&s==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:a})=>a.multiline&&a.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:a})=>a.multiline&&a.hiddenLabel&&a.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),sne=J(vv,{name:"MuiFilledInput",slot:"Input",overridesResolver:gv})(we(({theme:e})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:t})=>t.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}},{props:({ownerState:t})=>t.hiddenLabel&&t.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:t})=>t.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),O6=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiFilledInput"}),{disableUnderline:o=!1,components:i={},componentsProps:a,fullWidth:s=!1,hiddenLabel:l,inputComponent:u="input",multiline:c=!1,slotProps:d,slots:f={},type:p="text",...h}=n,m={...n,disableUnderline:o,fullWidth:s,inputComponent:u,multiline:c,type:p},g=ine(n),y={root:{ownerState:m},input:{ownerState:m}},w=d??a?vr(y,d??a):y,S=f.root??i.Root??ane,x=f.input??i.Input??sne;return b.jsx(bv,{slots:{root:S,input:x},slotProps:w,fullWidth:s,inputComponent:u,multiline:c,ref:r,type:p,...h,classes:g})});O6.muiName="Input";function lne(e){return Oe("MuiFormControl",e)}Te("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const cne=e=>{const{classes:t,margin:r,fullWidth:n}=e,o={root:["root",r!=="none"&&`margin${te(r)}`,n&&"fullWidth"]};return _e(o,lne,t)},une=J("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`margin${te(r.margin)}`],r.fullWidth&&t.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),dne=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiFormControl"}),{children:o,className:i,color:a="primary",component:s="div",disabled:l=!1,error:u=!1,focused:c,fullWidth:d=!1,hiddenLabel:f=!1,margin:p="none",required:h=!1,size:m="medium",variant:g="outlined",...y}=n,w={...n,color:a,component:s,disabled:l,error:u,fullWidth:d,hiddenLabel:f,margin:p,required:h,size:m,variant:g},S=cne(w),[x,P]=v.useState(()=>{let j=!1;return o&&v.Children.forEach(o,N=>{if(!W0(N,["Input","Select"]))return;const F=W0(N,["Select"])?N.props.input:N;F&&ere(F.props)&&(j=!0)}),j}),[A,T]=v.useState(()=>{let j=!1;return o&&v.Children.forEach(o,N=>{W0(N,["Input","Select"])&&(Um(N.props,!0)||Um(N.props.inputProps,!0))&&(j=!0)}),j}),[I,O]=v.useState(!1);l&&I&&O(!1);const _=c!==void 0&&!l?c:I;let R;v.useRef(!1);const E=v.useCallback(()=>{T(!0)},[]),M=v.useCallback(()=>{T(!1)},[]),B=v.useMemo(()=>({adornedStart:x,setAdornedStart:P,color:a,disabled:l,error:u,filled:A,focused:_,fullWidth:d,hiddenLabel:f,size:m,onBlur:()=>{O(!1)},onFocus:()=>{O(!0)},onEmpty:M,onFilled:E,registerEffect:R,required:h,variant:g}),[x,a,l,u,A,_,d,f,R,M,E,h,m,g]);return b.jsx(I6.Provider,{value:B,children:b.jsx(une,{as:s,ownerState:w,className:se(S.root,i),ref:r,...y,children:o})})});function fne(e){return Oe("MuiFormControlLabel",e)}const Kd=Te("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),pne=e=>{const{classes:t,disabled:r,labelPlacement:n,error:o,required:i}=e,a={root:["root",r&&"disabled",`labelPlacement${te(n)}`,o&&"error",i&&"required"],label:["label",r&&"disabled"],asterisk:["asterisk",o&&"error"]};return _e(a,fne,t)},hne=J("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${Kd.label}`]:t.label},t.root,t[`labelPlacement${te(r.labelPlacement)}`]]}})(we(({theme:e})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${Kd.disabled}`]:{cursor:"default"},[`& .${Kd.label}`]:{[`&.${Kd.disabled}`]:{color:(e.vars||e).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:t})=>t==="start"||t==="top"||t==="bottom",style:{marginLeft:16}}]}))),mne=J("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(we(({theme:e})=>({[`&.${Kd.error}`]:{color:(e.vars||e).palette.error.main}}))),gne=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiFormControlLabel"}),{checked:o,className:i,componentsProps:a={},control:s,disabled:l,disableTypography:u,inputRef:c,label:d,labelPlacement:f="end",name:p,onChange:h,required:m,slots:g={},slotProps:y={},value:w,...S}=n,x=$s(),P=l??s.props.disabled??(x==null?void 0:x.disabled),A=m??s.props.required,T={disabled:P,required:A};["checked","name","onChange","value","inputRef"].forEach(j=>{typeof s.props[j]>"u"&&typeof n[j]<"u"&&(T[j]=n[j])});const I=Kl({props:n,muiFormControl:x,states:["error"]}),O={...n,disabled:P,labelPlacement:f,required:A,error:I.error},_=pne(O),R={slots:g,slotProps:{...a,...y}},[E,M]=ke("typography",{elementType:ae,externalForwardedProps:R,ownerState:O});let B=d;return B!=null&&B.type!==ae&&!u&&(B=b.jsx(E,{component:"span",...M,className:se(_.label,M==null?void 0:M.className),children:B})),b.jsxs(hne,{className:se(_.root,i),ownerState:O,ref:r,...S,children:[v.cloneElement(s,T),A?b.jsxs("div",{children:[B,b.jsxs(mne,{ownerState:O,"aria-hidden":!0,className:_.asterisk,children:[" ","*"]})]}):B]})});function yne(e){return Oe("MuiFormHelperText",e)}const jk=Te("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var Mk;const vne=e=>{const{classes:t,contained:r,size:n,disabled:o,error:i,filled:a,focused:s,required:l}=e,u={root:["root",o&&"disabled",i&&"error",n&&`size${te(n)}`,r&&"contained",s&&"focused",a&&"filled",l&&"required"]};return _e(u,yne,t)},bne=J("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.size&&t[`size${te(r.size)}`],r.contained&&t.contained,r.filled&&t.filled]}})(we(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${jk.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${jk.error}`]:{color:(e.vars||e).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:t})=>t.contained,style:{marginLeft:14,marginRight:14}}]}))),wne=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiFormHelperText"}),{children:o,className:i,component:a="p",disabled:s,error:l,filled:u,focused:c,margin:d,required:f,variant:p,...h}=n,m=$s(),g=Kl({props:n,muiFormControl:m,states:["variant","size","disabled","error","filled","focused","required"]}),y={...n,component:a,contained:g.variant==="filled"||g.variant==="outlined",variant:g.variant,size:g.size,disabled:g.disabled,error:g.error,filled:g.filled,focused:g.focused,required:g.required};delete y.ownerState;const w=vne(y);return b.jsx(bne,{as:a,className:se(w.root,i),ref:r,...h,ownerState:y,children:o===" "?Mk||(Mk=b.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):o})});function xne(e){return Oe("MuiFormLabel",e)}const hf=Te("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),Sne=e=>{const{classes:t,color:r,focused:n,disabled:o,error:i,filled:a,required:s}=e,l={root:["root",`color${te(r)}`,o&&"disabled",i&&"error",a&&"filled",n&&"focused",s&&"required"],asterisk:["asterisk",i&&"error"]};return _e(l,xne,t)},Cne=J("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.color==="secondary"&&t.colorSecondary,r.filled&&t.filled]}})(we(({theme:e})=>({color:(e.vars||e).palette.text.secondary,...e.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t},style:{[`&.${hf.focused}`]:{color:(e.vars||e).palette[t].main}}})),{props:{},style:{[`&.${hf.disabled}`]:{color:(e.vars||e).palette.text.disabled},[`&.${hf.error}`]:{color:(e.vars||e).palette.error.main}}}]}))),Ene=J("span",{name:"MuiFormLabel",slot:"Asterisk"})(we(({theme:e})=>({[`&.${hf.error}`]:{color:(e.vars||e).palette.error.main}}))),Pne=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiFormLabel"}),{children:o,className:i,color:a,component:s="label",disabled:l,error:u,filled:c,focused:d,required:f,...p}=n,h=$s(),m=Kl({props:n,muiFormControl:h,states:["color","required","focused","disabled","error","filled"]}),g={...n,color:m.color||"primary",component:s,disabled:m.disabled,error:m.error,filled:m.filled,focused:m.focused,required:m.required},y=Sne(g);return b.jsxs(Cne,{as:s,ownerState:g,className:se(y.root,i),ref:r,...p,children:[o,m.required&&b.jsxs(Ene,{ownerState:g,"aria-hidden":!0,className:y.asterisk,children:[" ","*"]})]})}),di=cQ({createStyledComponent:J("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>$e({props:e,name:"MuiGrid"}),useTheme:Os});function Zx(e){return`scale(${e}, ${e**2})`}const Ane={entering:{opacity:1,transform:Zx(1)},entered:{opacity:1,transform:"none"}},x1=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Hm=v.forwardRef(function(t,r){const{addEndListener:n,appear:o=!0,children:i,easing:a,in:s,onEnter:l,onEntered:u,onEntering:c,onExit:d,onExited:f,onExiting:p,style:h,timeout:m="auto",TransitionComponent:g=Fo,...y}=t,w=al(),S=v.useRef(),x=Os(),P=v.useRef(null),A=nr(P,Qu(i),r),T=j=>N=>{if(j){const F=P.current;N===void 0?j(F):j(F,N)}},I=T(c),O=T((j,N)=>{U4(j);const{duration:F,delay:D,easing:z}=gu({style:h,timeout:m,easing:a},{mode:"enter"});let W;m==="auto"?(W=x.transitions.getAutoHeightDuration(j.clientHeight),S.current=W):W=F,j.style.transition=[x.transitions.create("opacity",{duration:W,delay:D}),x.transitions.create("transform",{duration:x1?W:W*.666,delay:D,easing:z})].join(","),l&&l(j,N)}),_=T(u),R=T(p),E=T(j=>{const{duration:N,delay:F,easing:D}=gu({style:h,timeout:m,easing:a},{mode:"exit"});let z;m==="auto"?(z=x.transitions.getAutoHeightDuration(j.clientHeight),S.current=z):z=N,j.style.transition=[x.transitions.create("opacity",{duration:z,delay:F}),x.transitions.create("transform",{duration:x1?z:z*.666,delay:x1?F:F||z*.333,easing:D})].join(","),j.style.opacity=0,j.style.transform=Zx(.75),d&&d(j)}),M=T(f),B=j=>{m==="auto"&&w.start(S.current||0,j),n&&n(P.current,j)};return b.jsx(g,{appear:o,in:s,nodeRef:P,onEnter:O,onEntered:_,onEntering:I,onExit:E,onExited:M,onExiting:R,addEndListener:B,timeout:m==="auto"?null:m,...y,children:(j,{ownerState:N,...F})=>v.cloneElement(i,{style:{opacity:0,transform:Zx(.75),visibility:j==="exited"&&!s?"hidden":void 0,...Ane[j],...h,...i.props.style},ref:A,...F})})});Hm&&(Hm.muiSupportAuto=!0);const kne=e=>{const{classes:t,disableUnderline:r}=e,o=_e({root:["root",!r&&"underline"],input:["input"]},nre,t);return{...t,...o}},Tne=J(yv,{shouldForwardProp:e=>zn(e)||e==="classes",name:"MuiInput",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[...mv(e,t),!r.disableUnderline&&t.underline]}})(we(({theme:e})=>{let r=e.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return e.vars&&(r=e.alpha(e.vars.palette.common.onBackground,e.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:n})=>n.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:n})=>!n.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:e.transitions.create("transform",{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${Pd.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${Pd.error}`]:{"&::before, &::after":{borderBottomColor:(e.vars||e).palette.error.main}},"&::before":{borderBottom:`1px solid ${r}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:e.transitions.create("border-bottom-color",{duration:e.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${Pd.disabled}, .${Pd.error}):before`]:{borderBottom:`2px solid ${(e.vars||e).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${r}`}},[`&.${Pd.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(e.palette).filter(Tt()).map(([n])=>({props:{color:n,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(e.vars||e).palette[n].main}`}}}))]}})),Ine=J(vv,{name:"MuiInput",slot:"Input",overridesResolver:gv})({}),_6=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiInput"}),{disableUnderline:o=!1,components:i={},componentsProps:a,fullWidth:s=!1,inputComponent:l="input",multiline:u=!1,slotProps:c,slots:d={},type:f="text",...p}=n,h=kne(n),g={root:{ownerState:{disableUnderline:o}}},y=c??a?vr(c??a,g):g,w=d.root??i.Root??Tne,S=d.input??i.Input??Ine;return b.jsx(bv,{slots:{root:w,input:S},slotProps:y,fullWidth:s,inputComponent:l,multiline:u,ref:r,type:f,...p,classes:h})});_6.muiName="Input";function One(e){return Oe("MuiInputLabel",e)}Te("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const _ne=e=>{const{classes:t,formControl:r,size:n,shrink:o,disableAnimation:i,variant:a,required:s}=e,l={root:["root",r&&"formControl",!i&&"animated",o&&"shrink",n&&n!=="medium"&&`size${te(n)}`,a],asterisk:[s&&"asterisk"]},u=_e(l,One,t);return{...t,...u}},$ne=J(Pne,{shouldForwardProp:e=>zn(e)||e==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${hf.asterisk}`]:t.asterisk},t.root,r.formControl&&t.formControl,r.size==="small"&&t.sizeSmall,r.shrink&&t.shrink,!r.disableAnimation&&t.animated,r.focused&&t.focused,t[r.variant]]}})(we(({theme:e})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:t})=>t.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:t})=>t.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:t})=>!t.disableAnimation,style:{transition:e.transitions.create(["color","transform","max-width"],{duration:e.transitions.duration.shorter,easing:e.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:t,ownerState:r})=>t==="filled"&&r.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:t,ownerState:r,size:n})=>t==="filled"&&r.shrink&&n==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:t,ownerState:r})=>t==="outlined"&&r.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),Rne=v.forwardRef(function(t,r){const n=$e({name:"MuiInputLabel",props:t}),{disableAnimation:o=!1,margin:i,shrink:a,variant:s,className:l,...u}=n,c=$s();let d=a;typeof d>"u"&&c&&(d=c.filled||c.focused||c.adornedStart);const f=Kl({props:n,muiFormControl:c,states:["size","variant","required","focused"]}),p={...n,disableAnimation:o,formControl:c,shrink:d,size:f.size,variant:f.variant,required:f.required,focused:f.focused},h=_ne(p);return b.jsx($ne,{"data-shrink":d,ref:r,className:se(h.root,l),...u,ownerState:p,classes:h})});function jne(e){return Oe("MuiLinearProgress",e)}Te("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const Yx=4,Xx=Ii` + 0% { + left: -35%; + right: 100%; + } + + 60% { + left: 100%; + right: -90%; + } + + 100% { + left: 100%; + right: -90%; + } +`,Mne=typeof Xx!="string"?Is` + animation: ${Xx} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; + `:null,Qx=Ii` + 0% { + left: -200%; + right: 100%; + } + + 60% { + left: 107%; + right: -8%; + } + + 100% { + left: 107%; + right: -8%; + } +`,Nne=typeof Qx!="string"?Is` + animation: ${Qx} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; + `:null,Jx=Ii` + 0% { + opacity: 1; + background-position: 0 -23px; + } + + 60% { + opacity: 0; + background-position: 0 -23px; + } + + 100% { + opacity: 1; + background-position: -200px -23px; + } +`,Bne=typeof Jx!="string"?Is` + animation: ${Jx} 3s infinite linear; + `:null,Lne=e=>{const{classes:t,variant:r,color:n}=e,o={root:["root",`color${te(n)}`,r],dashed:["dashed",`dashedColor${te(n)}`],bar1:["bar","bar1",`barColor${te(n)}`,(r==="indeterminate"||r==="query")&&"bar1Indeterminate",r==="determinate"&&"bar1Determinate",r==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",r!=="buffer"&&`barColor${te(n)}`,r==="buffer"&&`color${te(n)}`,(r==="indeterminate"||r==="query")&&"bar2Indeterminate",r==="buffer"&&"bar2Buffer"]};return _e(o,jne,t)},$6=(e,t)=>e.vars?e.vars.palette.LinearProgress[`${t}Bg`]:e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.5),Dne=J("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`color${te(r.color)}`],t[r.variant]]}})(we(({theme:e})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t},style:{backgroundColor:$6(e,t)}})),{props:({ownerState:t})=>t.color==="inherit"&&t.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),zne=J("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.dashed,t[`dashedColor${te(r.color)}`]]}})(we(({theme:e})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(e.palette).filter(Tt()).map(([t])=>{const r=$6(e,t);return{props:{color:t},style:{backgroundImage:`radial-gradient(${r} 0%, ${r} 16%, transparent 42%)`}}})]})),Bne||{animation:`${Jx} 3s infinite linear`}),Fne=J("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.bar,t.bar1,t[`barColor${te(r.color)}`],(r.variant==="indeterminate"||r.variant==="query")&&t.bar1Indeterminate,r.variant==="determinate"&&t.bar1Determinate,r.variant==="buffer"&&t.bar1Buffer]}})(we(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t},style:{backgroundColor:(e.vars||e).palette[t].main}})),{props:{variant:"determinate"},style:{transition:`transform .${Yx}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${Yx}s linear`}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:Mne||{animation:`${Xx} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),Une=J("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.bar,t.bar2,t[`barColor${te(r.color)}`],(r.variant==="indeterminate"||r.variant==="query")&&t.bar2Indeterminate,r.variant==="buffer"&&t.bar2Buffer]}})(we(({theme:e})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t},style:{"--LinearProgressBar2-barColor":(e.vars||e).palette[t].main}})),{props:({ownerState:t})=>t.variant!=="buffer"&&t.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:t})=>t.variant!=="buffer"&&t.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{color:t,variant:"buffer"},style:{backgroundColor:$6(e,t),transition:`transform .${Yx}s linear`}})),{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:{width:"auto"}},{props:({ownerState:t})=>t.variant==="indeterminate"||t.variant==="query",style:Nne||{animation:`${Qx} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),Wne=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiLinearProgress"}),{className:o,color:i="primary",value:a,valueBuffer:s,variant:l="indeterminate",...u}=n,c={...n,color:i,variant:l},d=Lne(c),f=ql(),p={},h={bar1:{},bar2:{}};if((l==="determinate"||l==="buffer")&&a!==void 0){p["aria-valuenow"]=Math.round(a),p["aria-valuemin"]=0,p["aria-valuemax"]=100;let m=a-100;f&&(m=-m),h.bar1.transform=`translateX(${m}%)`}if(l==="buffer"&&s!==void 0){let m=(s||0)-100;f&&(m=-m),h.bar2.transform=`translateX(${m}%)`}return b.jsxs(Dne,{className:se(d.root,o),ownerState:c,role:"progressbar",...p,ref:r,...u,children:[l==="buffer"?b.jsx(zne,{className:d.dashed,ownerState:c}):null,b.jsx(Fne,{className:d.bar1,ownerState:c,style:h.bar1}),l==="determinate"?null:b.jsx(Une,{className:d.bar2,ownerState:c,style:h.bar2})]})});function Hne(e){return Oe("MuiLink",e)}const Vne=Te("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),Gne=({theme:e,ownerState:t})=>{const r=t.color;if("colorSpace"in e&&e.colorSpace){const i=ii(e,`palette.${r}.main`)||ii(e,`palette.${r}`)||t.color;return e.alpha(i,.4)}const n=ii(e,`palette.${r}.main`,!1)||ii(e,`palette.${r}`,!1)||t.color,o=ii(e,`palette.${r}.mainChannel`)||ii(e,`palette.${r}Channel`);return"vars"in e&&o?`rgba(${o} / 0.4)`:up(n,.4)},Nk={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},qne=e=>{const{classes:t,component:r,focusVisible:n,underline:o}=e,i={root:["root",`underline${te(o)}`,r==="button"&&"button",n&&"focusVisible"]};return _e(i,Hne,t)},Kne=J(ae,{name:"MuiLink",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[`underline${te(r.underline)}`],r.component==="button"&&t.button]}})(we(({theme:e})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:t,ownerState:r})=>t==="always"&&r.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:t,ownerState:r})=>t==="always"&&r.color==="inherit",style:e.colorSpace?{textDecorationColor:e.alpha("currentColor",.4)}:null},...Object.entries(e.palette).filter(Tt()).map(([t])=>({props:{underline:"always",color:t},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette[t].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":e.alpha((e.vars||e).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(e.vars||e).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${Vne.focusVisible}`]:{outline:"auto"}}}]}))),cM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiLink"}),o=Os(),{className:i,color:a="primary",component:s="a",onBlur:l,onFocus:u,TypographyClasses:c,underline:d="always",variant:f="inherit",sx:p,...h}=n,[m,g]=v.useState(!1),y=P=>{yu(P.target)||g(!1),l&&l(P)},w=P=>{yu(P.target)&&g(!0),u&&u(P)},S={...n,color:a,component:s,focusVisible:m,underline:d,variant:f},x=qne(S);return b.jsx(Kne,{color:a,className:se(x.root,i),classes:c,component:s,onBlur:y,onFocus:w,ref:r,ownerState:S,variant:f,...h,sx:[...Nk[a]===void 0?[{color:a}]:[],...Array.isArray(p)?p:[p]],style:{...h.style,...d==="always"&&a!=="inherit"&&!Nk[a]&&{"--Link-underlineColor":Gne({theme:o,ownerState:S})}}})}),e2=v.createContext({});function Zne(e){return Oe("MuiList",e)}Te("MuiList",["root","padding","dense","subheader"]);const Yne=e=>{const{classes:t,disablePadding:r,dense:n,subheader:o}=e;return _e({root:["root",!r&&"padding",n&&"dense",o&&"subheader"]},Zne,t)},Xne=J("ul",{name:"MuiList",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disablePadding&&t.padding,r.dense&&t.dense,r.subheader&&t.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:e})=>!e.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:e})=>e.subheader,style:{paddingTop:0}}]}),Qne=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiList"}),{children:o,className:i,component:a="ul",dense:s=!1,disablePadding:l=!1,subheader:u,...c}=n,d=v.useMemo(()=>({dense:s}),[s]),f={...n,component:a,dense:s,disablePadding:l},p=Yne(f);return b.jsx(e2.Provider,{value:d,children:b.jsxs(Xne,{as:a,className:se(p.root,i),ref:r,ownerState:f,...c,children:[u,o]})})}),Bk=Te("MuiListItemIcon",["root","alignItemsFlexStart"]),Lk=Te("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function S1(e,t,r){return e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:r?null:e.firstChild}function Dk(e,t,r){return e===t?r?e.firstChild:e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:r?null:e.lastChild}function uM(e,t){if(t===void 0)return!0;let r=e.innerText;return r===void 0&&(r=e.textContent),r=r.trim().toLowerCase(),r.length===0?!1:t.repeating?r[0]===t.keys[0]:r.startsWith(t.keys.join(""))}function Ad(e,t,r,n,o,i){let a=!1,s=o(e,t,t?r:!1);for(;s;){if(s===e.firstChild){if(a)return!1;a=!0}const l=n?!1:s.disabled||s.getAttribute("aria-disabled")==="true";if(!s.hasAttribute("tabindex")||!uM(s,i)||l)s=o(e,s,r);else return s.focus(),!0}return!1}const Jne=v.forwardRef(function(t,r){const{actions:n,autoFocus:o=!1,autoFocusItem:i=!1,children:a,className:s,disabledItemsFocusable:l=!1,disableListWrap:u=!1,onKeyDown:c,variant:d="selectedMenu",...f}=t,p=v.useRef(null),h=v.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});$n(()=>{o&&p.current.focus()},[o]),v.useImperativeHandle(n,()=>({adjustStyleForScrollbar:(S,{direction:x})=>{const P=!p.current.style.width;if(S.clientHeight{const x=p.current,P=S.key;if(S.ctrlKey||S.metaKey||S.altKey){c&&c(S);return}const T=$c(hn(x));if(P==="ArrowDown")S.preventDefault(),Ad(x,T,u,l,S1);else if(P==="ArrowUp")S.preventDefault(),Ad(x,T,u,l,Dk);else if(P==="Home")S.preventDefault(),Ad(x,null,u,l,S1);else if(P==="End")S.preventDefault(),Ad(x,null,u,l,Dk);else if(P.length===1){const I=h.current,O=P.toLowerCase(),_=performance.now();I.keys.length>0&&(_-I.lastTime>500?(I.keys=[],I.repeating=!0,I.previousKeyMatched=!0):I.repeating&&O!==I.keys[0]&&(I.repeating=!1)),I.lastTime=_,I.keys.push(O);const R=T&&!I.repeating&&uM(T,I);I.previousKeyMatched&&(R||Ad(x,T,!1,l,S1,I))?S.preventDefault():I.previousKeyMatched=!1}c&&c(S)},g=nr(p,r);let y=-1;v.Children.forEach(a,(S,x)=>{if(!v.isValidElement(S)){y===x&&(y+=1,y>=a.length&&(y=-1));return}S.props.disabled||(d==="selectedMenu"&&S.props.selected||y===-1)&&(y=x),y===x&&(S.props.disabled||S.props.muiSkipListHighlight||S.type.muiSkipListHighlight)&&(y+=1,y>=a.length&&(y=-1))});const w=v.Children.map(a,(S,x)=>{if(x===y){const P={};return i&&(P.autoFocus=!0),S.props.tabIndex===void 0&&d==="selectedMenu"&&(P.tabIndex=0),v.cloneElement(S,P)}return S});return b.jsx(Qne,{role:"menu",ref:g,className:s,onKeyDown:m,tabIndex:o?0:-1,...f,children:w})});function eoe(e){return Oe("MuiPopover",e)}Te("MuiPopover",["root","paper"]);function zk(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.height/2:t==="bottom"&&(r=e.height),r}function Fk(e,t){let r=0;return typeof t=="number"?r=t:t==="center"?r=e.width/2:t==="right"&&(r=e.width),r}function Uk(e){return[e.horizontal,e.vertical].map(t=>typeof t=="number"?`${t}px`:t).join(" ")}function o0(e){return typeof e=="function"?e():e}const toe=e=>{const{classes:t}=e;return _e({root:["root"],paper:["paper"]},eoe,t)},roe=J(one,{name:"MuiPopover",slot:"Root"})({}),dM=J(sr,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),noe=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiPopover"}),{action:o,anchorEl:i,anchorOrigin:a={vertical:"top",horizontal:"left"},anchorPosition:s,anchorReference:l="anchorEl",children:u,className:c,container:d,elevation:f=8,marginThreshold:p=16,open:h,PaperProps:m={},slots:g={},slotProps:y={},transformOrigin:w={vertical:"top",horizontal:"left"},TransitionComponent:S,transitionDuration:x="auto",TransitionProps:P={},disableScrollLock:A=!1,...T}=n,I=v.useRef(),O={...n,anchorOrigin:a,anchorReference:l,elevation:f,marginThreshold:p,transformOrigin:w,TransitionComponent:S,transitionDuration:x,TransitionProps:P},_=toe(O),R=v.useCallback(()=>{if(l==="anchorPosition")return s;const oe=o0(i),q=(oe&&oe.nodeType===1?oe:hn(I.current).body).getBoundingClientRect();return{top:q.top+zk(q,a.vertical),left:q.left+Fk(q,a.horizontal)}},[i,a.horizontal,a.vertical,s,l]),E=v.useCallback(oe=>({vertical:zk(oe,w.vertical),horizontal:Fk(oe,w.horizontal)}),[w.horizontal,w.vertical]),M=v.useCallback(oe=>{const de={width:oe.offsetWidth,height:oe.offsetHeight},q=E(de);if(l==="none")return{top:null,left:null,transformOrigin:Uk(q)};const Ee=R();let ce=Ee.top-q.vertical,ue=Ee.left-q.horizontal;const ye=ce+de.height,Pe=ue+de.width,Ne=Lo(o0(i)),Ue=Ne.innerHeight-p,Ke=Ne.innerWidth-p;if(p!==null&&ceUe){const We=ye-Ue;ce-=We,q.vertical+=We}if(p!==null&&ueKe){const We=Pe-Ke;ue-=We,q.horizontal+=We}return{top:`${Math.round(ce)}px`,left:`${Math.round(ue)}px`,transformOrigin:Uk(q)}},[i,l,R,E,p]),[B,j]=v.useState(h),N=v.useCallback(()=>{const oe=I.current;if(!oe)return;const de=M(oe);de.top!==null&&oe.style.setProperty("top",de.top),de.left!==null&&(oe.style.left=de.left),oe.style.transformOrigin=de.transformOrigin,j(!0)},[M]);v.useEffect(()=>(A&&window.addEventListener("scroll",N),()=>window.removeEventListener("scroll",N)),[i,A,N]);const F=()=>{N()},D=()=>{j(!1)};v.useEffect(()=>{h&&N()}),v.useImperativeHandle(o,()=>h?{updatePosition:()=>{N()}}:null,[h,N]),v.useEffect(()=>{if(!h)return;const oe=fv(()=>{N()}),de=Lo(o0(i));return de.addEventListener("resize",oe),()=>{oe.clear(),de.removeEventListener("resize",oe)}},[i,h,N]);let z=x;const W={slots:{transition:S,...g},slotProps:{transition:P,paper:m,...y}},[H,V]=ke("transition",{elementType:Hm,externalForwardedProps:W,ownerState:O,getSlotProps:oe=>({...oe,onEntering:(de,q)=>{var Ee;(Ee=oe.onEntering)==null||Ee.call(oe,de,q),F()},onExited:de=>{var q;(q=oe.onExited)==null||q.call(oe,de),D()}}),additionalProps:{appear:!0,in:h}});x==="auto"&&!H.muiSupportAuto&&(z=void 0);const Q=d||(i?hn(o0(i)).body:void 0),[re,{slots:Y,slotProps:Z,...ie}]=ke("root",{ref:r,elementType:roe,externalForwardedProps:{...W,...T},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:g.backdrop},slotProps:{backdrop:iJ(typeof y.backdrop=="function"?y.backdrop(O):y.backdrop,{invisible:!0})},container:Q,open:h},ownerState:O,className:se(_.root,c)}),[me,G]=ke("paper",{ref:I,className:_.paper,elementType:dM,externalForwardedProps:W,shouldForwardComponentProp:!0,additionalProps:{elevation:f,style:B?void 0:{opacity:0}},ownerState:O});return b.jsx(re,{...ie,...!Dm(re)&&{slots:Y,slotProps:Z,disableScrollLock:A},children:b.jsx(H,{...V,timeout:z,children:b.jsx(me,{...G,children:u})})})});function ooe(e){return Oe("MuiMenu",e)}Te("MuiMenu",["root","paper","list"]);const ioe={vertical:"top",horizontal:"right"},aoe={vertical:"top",horizontal:"left"},soe=e=>{const{classes:t}=e;return _e({root:["root"],paper:["paper"],list:["list"]},ooe,t)},loe=J(noe,{shouldForwardProp:e=>zn(e)||e==="classes",name:"MuiMenu",slot:"Root"})({}),coe=J(dM,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),uoe=J(Jne,{name:"MuiMenu",slot:"List"})({outline:0}),fM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiMenu"}),{autoFocus:o=!0,children:i,className:a,disableAutoFocusItem:s=!1,MenuListProps:l={},onClose:u,open:c,PaperProps:d={},PopoverClasses:f,transitionDuration:p="auto",TransitionProps:{onEntering:h,...m}={},variant:g="selectedMenu",slots:y={},slotProps:w={},...S}=n,x=ql(),P={...n,autoFocus:o,disableAutoFocusItem:s,MenuListProps:l,onEntering:h,PaperProps:d,transitionDuration:p,TransitionProps:m,variant:g},A=soe(P),T=o&&!s&&c,I=v.useRef(null),O=(z,W)=>{I.current&&I.current.adjustStyleForScrollbar(z,{direction:x?"rtl":"ltr"}),h&&h(z,W)},_=z=>{z.key==="Tab"&&(z.preventDefault(),u&&u(z,"tabKeyDown"))};let R=-1;v.Children.map(i,(z,W)=>{v.isValidElement(z)&&(z.props.disabled||(g==="selectedMenu"&&z.props.selected||R===-1)&&(R=W))});const E={slots:y,slotProps:{list:l,transition:m,paper:d,...w}},M=Su({elementType:y.root,externalSlotProps:w.root,ownerState:P,className:[A.root,a]}),[B,j]=ke("paper",{className:A.paper,elementType:coe,externalForwardedProps:E,shouldForwardComponentProp:!0,ownerState:P}),[N,F]=ke("list",{className:se(A.list,l.className),elementType:uoe,shouldForwardComponentProp:!0,externalForwardedProps:E,getSlotProps:z=>({...z,onKeyDown:W=>{var H;_(W),(H=z.onKeyDown)==null||H.call(z,W)}}),ownerState:P}),D=typeof E.slotProps.transition=="function"?E.slotProps.transition(P):E.slotProps.transition;return b.jsx(loe,{onClose:u,anchorOrigin:{vertical:"bottom",horizontal:x?"right":"left"},transformOrigin:x?ioe:aoe,slots:{root:y.root,paper:B,backdrop:y.backdrop,...y.transition&&{transition:y.transition}},slotProps:{root:M,paper:j,backdrop:typeof w.backdrop=="function"?w.backdrop(P):w.backdrop,transition:{...D,onEntering:(...z)=>{var W;O(...z),(W=D==null?void 0:D.onEntering)==null||W.call(D,...z)}}},open:c,ref:r,transitionDuration:p,ownerState:P,...S,classes:f,children:b.jsx(N,{actions:I,autoFocus:o&&(R===-1||s),autoFocusItem:T,variant:g,...F,children:i})})});function doe(e){return Oe("MuiMenuItem",e)}const kd=Te("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),foe=(e,t)=>{const{ownerState:r}=e;return[t.root,r.dense&&t.dense,r.divider&&t.divider,!r.disableGutters&&t.gutters]},poe=e=>{const{disabled:t,dense:r,divider:n,disableGutters:o,selected:i,classes:a}=e,l=_e({root:["root",r&&"dense",t&&"disabled",!o&&"gutters",n&&"divider",i&&"selected"]},doe,a);return{...a,...l}},hoe=J(aa,{shouldForwardProp:e=>zn(e)||e==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver:foe})(we(({theme:e})=>({...e.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(e.vars||e).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${kd.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),[`&.${kd.focusVisible}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.focusOpacity}`)}},[`&.${kd.selected}:hover`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity)}},[`&.${kd.focusVisible}`]:{backgroundColor:(e.vars||e).palette.action.focus},[`&.${kd.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity},[`& + .${Rk.root}`]:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},[`& + .${Rk.inset}`]:{marginLeft:52},[`& .${Lk.root}`]:{marginTop:0,marginBottom:0},[`& .${Lk.inset}`]:{paddingLeft:36},[`& .${Bk.root}`]:{minWidth:36},variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:t})=>t.divider,style:{borderBottom:`1px solid ${(e.vars||e).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:t})=>!t.dense,style:{[e.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:t})=>t.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...e.typography.body2,[`& .${Bk.root} svg`]:{fontSize:"1.25rem"}}}]}))),G0=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiMenuItem"}),{autoFocus:o=!1,component:i="li",dense:a=!1,divider:s=!1,disableGutters:l=!1,focusVisibleClassName:u,role:c="menuitem",tabIndex:d,className:f,...p}=n,h=v.useContext(e2),m=v.useMemo(()=>({dense:a||h.dense||!1,disableGutters:l}),[h.dense,a,l]),g=v.useRef(null);$n(()=>{o&&g.current&&g.current.focus()},[o]);const y={...n,dense:m.dense,divider:s,disableGutters:l},w=poe(n),S=nr(g,r);let x;return n.disabled||(x=d!==void 0?d:-1),b.jsx(e2.Provider,{value:m,children:b.jsx(hoe,{ref:S,role:c,tabIndex:x,component:i,focusVisibleClassName:se(w.focusVisible,u),className:se(w.root,f),...p,ownerState:y,classes:w})})});function moe(e){return Oe("MuiNativeSelect",e)}const R6=Te("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),goe=e=>{const{classes:t,variant:r,disabled:n,multiple:o,open:i,error:a}=e,s={select:["select",r,n&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${te(r)}`,i&&"iconOpen",n&&"disabled"]};return _e(s,moe,t)},pM=J("select",{name:"MuiNativeSelect"})(({theme:e})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${R6.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(e.vars||e).palette.background.paper},variants:[{props:({ownerState:t})=>t.variant!=="filled"&&t.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(e.vars||e).shape.borderRadius,"&:focus":{borderRadius:(e.vars||e).shape.borderRadius},"&&&":{paddingRight:32}}}]})),yoe=J(pM,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:zn,overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.select,t[r.variant],r.error&&t.error,{[`&.${R6.multiple}`]:t.multiple}]}})({}),hM=J("svg",{name:"MuiNativeSelect"})(({theme:e})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(e.vars||e).palette.action.active,[`&.${R6.disabled}`]:{color:(e.vars||e).palette.action.disabled},variants:[{props:({ownerState:t})=>t.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),voe=J(hM,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${te(r.variant)}`],r.open&&t.iconOpen]}})({}),boe=v.forwardRef(function(t,r){const{className:n,disabled:o,error:i,IconComponent:a,inputRef:s,variant:l="standard",...u}=t,c={...t,disabled:o,variant:l,error:i},d=goe(c);return b.jsxs(v.Fragment,{children:[b.jsx(yoe,{ownerState:c,className:se(d.select,n),disabled:o,ref:s||r,...u}),t.multiple?null:b.jsx(voe,{as:a,ownerState:c,className:d.icon})]})});var Wk;const woe=J("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:zn})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),xoe=J("legend",{name:"MuiNotchedOutlined",shouldForwardProp:zn})(we(({theme:e})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:t})=>!t.withLabel,style:{padding:0,lineHeight:"11px",transition:e.transitions.create("width",{duration:150,easing:e.transitions.easing.easeOut})}},{props:({ownerState:t})=>t.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:e.transitions.create("max-width",{duration:50,easing:e.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:t})=>t.withLabel&&t.notched,style:{maxWidth:"100%",transition:e.transitions.create("max-width",{duration:100,easing:e.transitions.easing.easeOut,delay:50})}}]})));function Soe(e){const{children:t,classes:r,className:n,label:o,notched:i,...a}=e,s=o!=null&&o!=="",l={...e,notched:i,withLabel:s};return b.jsx(woe,{"aria-hidden":!0,className:n,ownerState:l,...a,children:b.jsx(xoe,{ownerState:l,children:s?b.jsx("span",{children:o}):Wk||(Wk=b.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const Coe=e=>{const{classes:t}=e,n=_e({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},ore,t);return{...t,...n}},Eoe=J(yv,{shouldForwardProp:e=>zn(e)||e==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:mv})(we(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(e.vars||e).shape.borderRadius,[`&:hover .${Yo.notchedOutline}`]:{borderColor:(e.vars||e).palette.text.primary},"@media (hover: none)":{[`&:hover .${Yo.notchedOutline}`]:{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}},[`&.${Yo.focused} .${Yo.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(e.palette).filter(Tt()).map(([r])=>({props:{color:r},style:{[`&.${Yo.focused} .${Yo.notchedOutline}`]:{borderColor:(e.vars||e).palette[r].main}}})),{props:{},style:{[`&.${Yo.error} .${Yo.notchedOutline}`]:{borderColor:(e.vars||e).palette.error.main},[`&.${Yo.disabled} .${Yo.notchedOutline}`]:{borderColor:(e.vars||e).palette.action.disabled}}},{props:({ownerState:r})=>r.startAdornment,style:{paddingLeft:14}},{props:({ownerState:r})=>r.endAdornment,style:{paddingRight:14}},{props:({ownerState:r})=>r.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:r,size:n})=>r.multiline&&n==="small",style:{padding:"8.5px 14px"}}]}})),Poe=J(Soe,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(we(({theme:e})=>{const t=e.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:e.vars?e.alpha(e.vars.palette.common.onBackground,.23):t}})),Aoe=J(vv,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:gv})(we(({theme:e})=>({padding:"16.5px 14px",...!e.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:e.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:e.palette.mode==="light"?null:"#fff",caretColor:e.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...e.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[e.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:t})=>t.multiline,style:{padding:0}},{props:({ownerState:t})=>t.startAdornment,style:{paddingLeft:0}},{props:({ownerState:t})=>t.endAdornment,style:{paddingRight:0}}]}))),j6=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiOutlinedInput"}),{components:o={},fullWidth:i=!1,inputComponent:a="input",label:s,multiline:l=!1,notched:u,slots:c={},slotProps:d={},type:f="text",...p}=n,h=Coe(n),m=$s(),g=Kl({props:n,muiFormControl:m,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),y={...n,color:g.color||"primary",disabled:g.disabled,error:g.error,focused:g.focused,formControl:m,fullWidth:i,hiddenLabel:g.hiddenLabel,multiline:l,size:g.size,type:f},w=c.root??o.Root??Eoe,S=c.input??o.Input??Aoe,[x,P]=ke("notchedOutline",{elementType:Poe,className:h.notchedOutline,shouldForwardComponentProp:!0,ownerState:y,externalForwardedProps:{slots:c,slotProps:d},additionalProps:{label:s!=null&&s!==""&&g.required?b.jsxs(v.Fragment,{children:[s," ","*"]}):s}});return b.jsx(bv,{slots:{root:w,input:S},slotProps:d,renderSuffix:A=>b.jsx(x,{...P,notched:typeof u<"u"?u:!!(A.startAdornment||A.filled||A.focused)}),fullWidth:i,inputComponent:a,multiline:l,ref:r,type:f,...p,classes:{...h,notchedOutline:null}})});j6.muiName="Input";const koe=Qe(b.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})),Toe=Qe(b.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}));function mM(e){return Oe("MuiSelect",e)}const Td=Te("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var Hk;const Ioe=J(pM,{name:"MuiSelect",slot:"Select",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`&.${Td.select}`]:t.select},{[`&.${Td.select}`]:t[r.variant]},{[`&.${Td.error}`]:t.error},{[`&.${Td.multiple}`]:t.multiple}]}})({[`&.${Td.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),Ooe=J(hM,{name:"MuiSelect",slot:"Icon",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.icon,r.variant&&t[`icon${te(r.variant)}`],r.open&&t.iconOpen]}})({}),_oe=J("input",{shouldForwardProp:e=>L4(e)&&e!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function Vk(e,t){return typeof t=="object"&&t!==null?e===t:String(e)===String(t)}function $oe(e){return e==null||typeof e=="string"&&!e.trim()}const Roe=e=>{const{classes:t,variant:r,disabled:n,multiple:o,open:i,error:a}=e,s={select:["select",r,n&&"disabled",o&&"multiple",a&&"error"],icon:["icon",`icon${te(r)}`,i&&"iconOpen",n&&"disabled"],nativeInput:["nativeInput"]};return _e(s,mM,t)},joe=v.forwardRef(function(t,r){var De,tt,Je,ut;const{"aria-describedby":n,"aria-label":o,autoFocus:i,autoWidth:a,children:s,className:l,defaultOpen:u,defaultValue:c,disabled:d,displayEmpty:f,error:p=!1,IconComponent:h,inputRef:m,labelId:g,MenuProps:y={},multiple:w,name:S,onBlur:x,onChange:P,onClose:A,onFocus:T,onKeyDown:I,onMouseDown:O,onOpen:_,open:R,readOnly:E,renderValue:M,required:B,SelectDisplayProps:j={},tabIndex:N,type:F,value:D,variant:z="standard",...W}=t,[H,V]=dp({controlled:D,default:c,name:"Select"}),[Q,re]=dp({controlled:R,default:u,name:"Select"}),Y=v.useRef(null),Z=v.useRef(null),[ie,me]=v.useState(null),{current:G}=v.useRef(R!=null),[oe,de]=v.useState(),q=nr(r,m),Ee=v.useCallback(he=>{Z.current=he,he&&me(he)},[]),ce=ie==null?void 0:ie.parentNode;v.useImperativeHandle(q,()=>({focus:()=>{Z.current.focus()},node:Y.current,value:H}),[H]);const ue=ie!==null&&Q;v.useEffect(()=>{if(!ue||!ce||a||typeof ResizeObserver>"u")return;const he=new ResizeObserver(()=>{de(ce.clientWidth)});return he.observe(ce),()=>{he.disconnect()}},[ue,ce,a]),v.useEffect(()=>{u&&Q&&ie&&!G&&(de(a?null:ce.clientWidth),Z.current.focus())},[ie,a]),v.useEffect(()=>{i&&Z.current.focus()},[i]),v.useEffect(()=>{if(!g)return;const he=hn(Z.current).getElementById(g);if(he){const at=()=>{getSelection().isCollapsed&&Z.current.focus()};return he.addEventListener("click",at),()=>{he.removeEventListener("click",at)}}},[g]);const ye=(he,at)=>{he?_&&_(at):A&&A(at),G||(de(a?null:ce.clientWidth),re(he))},Pe=he=>{O==null||O(he),he.button===0&&(he.preventDefault(),Z.current.focus(),ye(!0,he))},Ne=he=>{ye(!1,he)},Ue=v.Children.toArray(s),Ke=he=>{const at=Ue.find(Zt=>Zt.props.value===he.target.value);at!==void 0&&(V(at.props.value),P&&P(he,at))},We=he=>at=>{let Zt;if(at.currentTarget.hasAttribute("tabindex")){if(w){Zt=Array.isArray(H)?H.slice():[];const Ho=H.indexOf(he.props.value);Ho===-1?Zt.push(he.props.value):Zt.splice(Ho,1)}else Zt=he.props.value;if(he.props.onClick&&he.props.onClick(at),H!==Zt&&(V(Zt),P)){const Ho=at.nativeEvent||at,Ql=new Ho.constructor(Ho.type,Ho);Object.defineProperty(Ql,"target",{writable:!0,value:{value:Zt,name:S}}),P(Ql,he)}w||ye(!1,at)}},Ae=he=>{E||([" ","ArrowUp","ArrowDown","Enter"].includes(he.key)&&(he.preventDefault(),ye(!0,he)),I==null||I(he))},qt=he=>{!ue&&x&&(Object.defineProperty(he,"target",{writable:!0,value:{value:H,name:S}}),x(he))};delete W["aria-invalid"];let Xe,Ct;const Lt=[];let Kt=!1;(Um({value:H})||f)&&(M?Xe=M(H):Kt=!0);const bt=Ue.map(he=>{if(!v.isValidElement(he))return null;let at;if(w){if(!Array.isArray(H))throw new Error(ia(2));at=H.some(Zt=>Vk(Zt,he.props.value)),at&&Kt&&Lt.push(he.props.children)}else at=Vk(H,he.props.value),at&&Kt&&(Ct=he.props.children);return v.cloneElement(he,{"aria-selected":at?"true":"false",onClick:We(he),onKeyUp:Zt=>{Zt.key===" "&&Zt.preventDefault(),he.props.onKeyUp&&he.props.onKeyUp(Zt)},role:"option",selected:at,value:void 0,"data-value":he.props.value})});Kt&&(w?Lt.length===0?Xe=null:Xe=Lt.reduce((he,at,Zt)=>(he.push(at),Zt{const{classes:t}=e,n=_e({root:["root"]},mM,t);return{...t,...n}},M6={name:"MuiSelect",slot:"Root",shouldForwardProp:e=>zn(e)&&e!=="variant"},Noe=J(_6,M6)(""),Boe=J(j6,M6)(""),Loe=J(O6,M6)(""),N6=v.forwardRef(function(t,r){const n=$e({name:"MuiSelect",props:t}),{autoWidth:o=!1,children:i,classes:a={},className:s,defaultOpen:l=!1,displayEmpty:u=!1,IconComponent:c=are,id:d,input:f,inputProps:p,label:h,labelId:m,MenuProps:g,multiple:y=!1,native:w=!1,onClose:S,onOpen:x,open:P,renderValue:A,SelectDisplayProps:T,variant:I="outlined",...O}=n,_=w?boe:joe,R=$s(),E=Kl({props:n,muiFormControl:R,states:["variant","error"]}),M=E.variant||I,B={...n,variant:M,classes:a},j=Moe(B),{root:N,...F}=j,D=f||{standard:b.jsx(Noe,{ownerState:B}),outlined:b.jsx(Boe,{label:h,ownerState:B}),filled:b.jsx(Loe,{ownerState:B})}[M],z=nr(r,Qu(D));return b.jsx(v.Fragment,{children:v.cloneElement(D,{inputComponent:_,inputProps:{children:i,error:E.error,IconComponent:c,variant:M,type:void 0,multiple:y,...w?{id:d}:{autoWidth:o,defaultOpen:l,displayEmpty:u,labelId:m,MenuProps:g,onClose:S,onOpen:x,open:P,renderValue:A,SelectDisplayProps:{id:d,...T}},...p,classes:p?vr(F,p.classes):F,...f?f.props.inputProps:{}},...(y&&w||u)&&M==="outlined"?{notched:!0}:{},ref:z,className:se(D.props.className,s,j.root),...!f&&{variant:M},...O})})});N6.muiName="Select";function Doe(e){return Oe("MuiSkeleton",e)}Te("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const zoe=e=>{const{classes:t,variant:r,animation:n,hasChildren:o,width:i,height:a}=e;return _e({root:["root",r,n,o&&"withChildren",o&&!i&&"fitContent",o&&!a&&"heightAuto"]},Doe,t)},t2=Ii` + 0% { + opacity: 1; + } + + 50% { + opacity: 0.4; + } + + 100% { + opacity: 1; + } +`,r2=Ii` + 0% { + transform: translateX(-100%); + } + + 50% { + /* +0.5s of delay between each loop */ + transform: translateX(100%); + } + + 100% { + transform: translateX(100%); + } +`,Foe=typeof t2!="string"?Is` + animation: ${t2} 2s ease-in-out 0.5s infinite; + `:null,Uoe=typeof r2!="string"?Is` + &::after { + animation: ${r2} 2s linear 0.5s infinite; + } + `:null,Woe=J("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],r.animation!==!1&&t[r.animation],r.hasChildren&&t.withChildren,r.hasChildren&&!r.width&&t.fitContent,r.hasChildren&&!r.height&&t.heightAuto]}})(we(({theme:e})=>{const t=qQ(e.shape.borderRadius)||"px",r=KQ(e.shape.borderRadius);return{display:"block",backgroundColor:e.vars?e.vars.palette.Skeleton.bg:e.alpha(e.palette.text.primary,e.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${r}${t}/${Math.round(r/.6*10)/10}${t}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(e.vars||e).shape.borderRadius}},{props:({ownerState:n})=>n.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:n})=>n.hasChildren&&!n.width,style:{maxWidth:"fit-content"}},{props:({ownerState:n})=>n.hasChildren&&!n.height,style:{height:"auto"}},{props:{animation:"pulse"},style:Foe||{animation:`${t2} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient( + 90deg, + transparent, + ${(e.vars||e).palette.action.hover}, + transparent + )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:Uoe||{"&::after":{animation:`${r2} 2s linear 0.5s infinite`}}}]}})),sl=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiSkeleton"}),{animation:o="pulse",className:i,component:a="span",height:s,style:l,variant:u="text",width:c,...d}=n,f={...n,animation:o,component:a,variant:u,hasChildren:!!d.children},p=zoe(f);return b.jsx(Woe,{as:a,ref:r,className:se(p.root,i),ownerState:f,...d,style:{width:c,height:s,...l}})});function Hoe(e){return Oe("MuiTooltip",e)}const Ut=Te("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function Voe(e){return Math.round(e*1e5)/1e5}const Goe=e=>{const{classes:t,disableInteractive:r,arrow:n,touch:o,placement:i}=e,a={popper:["popper",!r&&"popperInteractive",n&&"popperArrow"],tooltip:["tooltip",n&&"tooltipArrow",o&&"touch",`tooltipPlacement${te(i.split("-")[0])}`],arrow:["arrow"]};return _e(a,Hoe,t)},qoe=J(iM,{name:"MuiTooltip",slot:"Popper",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.popper,!r.disableInteractive&&t.popperInteractive,r.arrow&&t.popperArrow,!r.open&&t.popperClose]}})(we(({theme:e})=>({zIndex:(e.vars||e).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:t})=>!t.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:t})=>!t,style:{pointerEvents:"none"}},{props:({ownerState:t})=>t.arrow,style:{[`&[data-popper-placement*="bottom"] .${Ut.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${Ut.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${Ut.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${Ut.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Ut.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="right"] .${Ut.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Ut.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:t})=>t.arrow&&!!t.isRtl,style:{[`&[data-popper-placement*="left"] .${Ut.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),Koe=J("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.tooltip,r.touch&&t.touch,r.arrow&&t.tooltipArrow,t[`tooltipPlacement${te(r.placement.split("-")[0])}`]]}})(we(({theme:e})=>({backgroundColor:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.92),borderRadius:(e.vars||e).shape.borderRadius,color:(e.vars||e).palette.common.white,fontFamily:e.typography.fontFamily,padding:"4px 8px",fontSize:e.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:e.typography.fontWeightMedium,[`.${Ut.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${Ut.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${Ut.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${Ut.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:t})=>t.arrow,style:{position:"relative",margin:0}},{props:({ownerState:t})=>t.touch,style:{padding:"8px 16px",fontSize:e.typography.pxToRem(14),lineHeight:`${Voe(16/14)}em`,fontWeight:e.typography.fontWeightRegular}},{props:({ownerState:t})=>!t.isRtl,style:{[`.${Ut.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${Ut.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:t})=>!t.isRtl&&t.touch,style:{[`.${Ut.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${Ut.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:t})=>!!t.isRtl,style:{[`.${Ut.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${Ut.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:t})=>!!t.isRtl&&t.touch,style:{[`.${Ut.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${Ut.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Ut.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:t})=>t.touch,style:{[`.${Ut.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),Zoe=J("span",{name:"MuiTooltip",slot:"Arrow"})(we(({theme:e})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:e.vars?e.vars.palette.Tooltip.bg:e.alpha(e.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let i0=!1;const Gk=new pv;let Id={x:0,y:0};function a0(e,t){return(r,...n)=>{t&&t(r,...n),e(r,...n)}}const mp=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTooltip"}),{arrow:o=!1,children:i,classes:a,components:s={},componentsProps:l={},describeChild:u=!1,disableFocusListener:c=!1,disableHoverListener:d=!1,disableInteractive:f=!1,disableTouchListener:p=!1,enterDelay:h=100,enterNextDelay:m=0,enterTouchDelay:g=700,followCursor:y=!1,id:w,leaveDelay:S=0,leaveTouchDelay:x=1500,onClose:P,onOpen:A,open:T,placement:I="bottom",PopperComponent:O,PopperProps:_={},slotProps:R={},slots:E={},title:M,TransitionComponent:B,TransitionProps:j,...N}=n,F=v.isValidElement(i)?i:b.jsx("span",{children:i}),D=Os(),z=ql(),[W,H]=v.useState(),[V,Q]=v.useState(null),re=v.useRef(!1),Y=f||y,Z=al(),ie=al(),me=al(),G=al(),[oe,de]=dp({controlled:T,default:!1,name:"Tooltip",state:"open"});let q=oe;const Ee=gs(w),ce=v.useRef(),ue=no(()=>{ce.current!==void 0&&(document.body.style.WebkitUserSelect=ce.current,ce.current=void 0),G.clear()});v.useEffect(()=>ue,[ue]);const ye=He=>{Gk.clear(),i0=!0,de(!0),A&&!q&&A(He)},Pe=no(He=>{Gk.start(800+S,()=>{i0=!1}),de(!1),P&&q&&P(He),Z.start(D.transitions.duration.shortest,()=>{re.current=!1})}),Ne=He=>{re.current&&He.type!=="touchstart"||(W&&W.removeAttribute("title"),ie.clear(),me.clear(),h||i0&&m?ie.start(i0?m:h,()=>{ye(He)}):ye(He))},Ue=He=>{ie.clear(),me.start(S,()=>{Pe(He)})},[,Ke]=v.useState(!1),We=He=>{yu(He.target)||(Ke(!1),Ue(He))},Ae=He=>{W||H(He.currentTarget),yu(He.target)&&(Ke(!0),Ne(He))},qt=He=>{re.current=!0;const bn=F.props;bn.onTouchStart&&bn.onTouchStart(He)},Xe=He=>{qt(He),me.clear(),Z.clear(),ue(),ce.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",G.start(g,()=>{document.body.style.WebkitUserSelect=ce.current,Ne(He)})},Ct=He=>{F.props.onTouchEnd&&F.props.onTouchEnd(He),ue(),me.start(x,()=>{Pe(He)})};v.useEffect(()=>{if(!q)return;function He(bn){bn.key==="Escape"&&Pe(bn)}return document.addEventListener("keydown",He),()=>{document.removeEventListener("keydown",He)}},[Pe,q]);const Lt=nr(Qu(F),H,r);!M&&M!==0&&(q=!1);const Kt=v.useRef(),bt=He=>{const bn=F.props;bn.onMouseMove&&bn.onMouseMove(He),Id={x:He.clientX,y:He.clientY},Kt.current&&Kt.current.update()},or={},$=typeof M=="string";u?(or.title=!q&&$&&!d?M:null,or["aria-describedby"]=q?Ee:null):(or["aria-label"]=$?M:null,or["aria-labelledby"]=q&&!$?Ee:null);const C={...or,...N,...F.props,className:se(N.className,F.props.className),onTouchStart:qt,ref:Lt,...y?{onMouseMove:bt}:{}},k={};p||(C.onTouchStart=Xe,C.onTouchEnd=Ct),d||(C.onMouseOver=a0(Ne,C.onMouseOver),C.onMouseLeave=a0(Ue,C.onMouseLeave),Y||(k.onMouseOver=Ne,k.onMouseLeave=Ue)),c||(C.onFocus=a0(Ae,C.onFocus),C.onBlur=a0(We,C.onBlur),Y||(k.onFocus=Ae,k.onBlur=We));const L={...n,isRtl:z,arrow:o,disableInteractive:Y,placement:I,PopperComponentProp:O,touch:re.current},U=typeof R.popper=="function"?R.popper(L):R.popper,K=v.useMemo(()=>{var bn,be;let He=[{name:"arrow",enabled:!!V,options:{element:V,padding:4}}];return(bn=_.popperOptions)!=null&&bn.modifiers&&(He=He.concat(_.popperOptions.modifiers)),(be=U==null?void 0:U.popperOptions)!=null&&be.modifiers&&(He=He.concat(U.popperOptions.modifiers)),{..._.popperOptions,...U==null?void 0:U.popperOptions,modifiers:He}},[V,_.popperOptions,U==null?void 0:U.popperOptions]),ne=Goe(L),De=typeof R.transition=="function"?R.transition(L):R.transition,tt={slots:{popper:s.Popper,transition:s.Transition??B,tooltip:s.Tooltip,arrow:s.Arrow,...E},slotProps:{arrow:R.arrow??l.arrow,popper:{..._,...U??l.popper},tooltip:R.tooltip??l.tooltip,transition:{...j,...De??l.transition}}},[Je,ut]=ke("popper",{elementType:qoe,externalForwardedProps:tt,ownerState:L,className:se(ne.popper,_==null?void 0:_.className)}),[he,at]=ke("transition",{elementType:Hm,externalForwardedProps:tt,ownerState:L}),[Zt,Ho]=ke("tooltip",{elementType:Koe,className:ne.tooltip,externalForwardedProps:tt,ownerState:L}),[Ql,hb]=ke("arrow",{elementType:Zoe,className:ne.arrow,externalForwardedProps:tt,ownerState:L,ref:Q});return b.jsxs(v.Fragment,{children:[v.cloneElement(F,C),b.jsx(Je,{as:O??iM,placement:I,anchorEl:y?{getBoundingClientRect:()=>({top:Id.y,left:Id.x,right:Id.x,bottom:Id.y,width:0,height:0})}:W,popperRef:Kt,open:W?q:!1,id:Ee,transition:!0,...k,...ut,popperOptions:K,children:({TransitionProps:He})=>b.jsx(he,{timeout:D.transitions.duration.shorter,...He,...at,children:b.jsxs(Zt,{...Ho,children:[M,o?b.jsx(Ql,{...hb}):null]})})})]})}),ll=gQ({createStyledComponent:J("div",{name:"MuiStack",slot:"Root"}),useThemeProps:e=>$e({props:e,name:"MuiStack"})}),sh=v.createContext({}),wv=v.createContext({});function Yoe(e){return Oe("MuiStep",e)}Te("MuiStep",["root","horizontal","vertical","alternativeLabel","completed"]);const Xoe=e=>{const{classes:t,orientation:r,alternativeLabel:n,completed:o}=e;return _e({root:["root",r,n&&"alternativeLabel",o&&"completed"]},Yoe,t)},Qoe=J("div",{name:"MuiStep",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.orientation],r.alternativeLabel&&t.alternativeLabel,r.completed&&t.completed]}})({variants:[{props:{orientation:"horizontal"},style:{paddingLeft:8,paddingRight:8}},{props:{alternativeLabel:!0},style:{flex:1,position:"relative"}}]}),Joe=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiStep"}),{active:o,children:i,className:a,component:s="div",completed:l,disabled:u,expanded:c=!1,index:d,last:f,...p}=n,{activeStep:h,connector:m,alternativeLabel:g,orientation:y,nonLinear:w}=v.useContext(sh);let[S=!1,x=!1,P=!1]=[o,l,u];h===d?S=o!==void 0?o:!0:!w&&h>d?x=l!==void 0?l:!0:!w&&h({index:d,last:f,expanded:c,icon:d+1,active:S,completed:x,disabled:P}),[d,f,c,S,x,P]),T={...n,active:S,orientation:y,alternativeLabel:g,completed:x,disabled:P,expanded:c,component:s},I=Xoe(T),O=b.jsxs(Qoe,{as:s,className:se(I.root,a),ref:r,ownerState:T,...p,children:[m&&g&&d!==0?m:null,i]});return b.jsx(wv.Provider,{value:A,children:m&&!g&&d!==0?b.jsxs(v.Fragment,{children:[m,O]}):O})}),eie=Qe(b.jsx("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"})),tie=Qe(b.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));function rie(e){return Oe("MuiStepIcon",e)}const C1=Te("MuiStepIcon",["root","active","completed","error","text"]);var qk;const nie=e=>{const{classes:t,active:r,completed:n,error:o}=e;return _e({root:["root",r&&"active",n&&"completed",o&&"error"],text:["text"]},rie,t)},E1=J(Bm,{name:"MuiStepIcon",slot:"Root"})(we(({theme:e})=>({display:"block",transition:e.transitions.create("color",{duration:e.transitions.duration.shortest}),color:(e.vars||e).palette.text.disabled,[`&.${C1.completed}`]:{color:(e.vars||e).palette.primary.main},[`&.${C1.active}`]:{color:(e.vars||e).palette.primary.main},[`&.${C1.error}`]:{color:(e.vars||e).palette.error.main}}))),oie=J("text",{name:"MuiStepIcon",slot:"Text"})(we(({theme:e})=>({fill:(e.vars||e).palette.primary.contrastText,fontSize:e.typography.caption.fontSize,fontFamily:e.typography.fontFamily}))),iie=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiStepIcon"}),{active:o=!1,className:i,completed:a=!1,error:s=!1,icon:l,...u}=n,c={...n,active:o,completed:a,error:s},d=nie(c);if(typeof l=="number"||typeof l=="string"){const f=se(i,d.root);return s?b.jsx(E1,{as:tie,className:f,ref:r,ownerState:c,...u}):a?b.jsx(E1,{as:eie,className:f,ref:r,ownerState:c,...u}):b.jsxs(E1,{className:f,ref:r,ownerState:c,...u,children:[qk||(qk=b.jsx("circle",{cx:"12",cy:"12",r:"12"})),b.jsx(oie,{className:d.text,x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",ownerState:c,children:l})]})}return l});function aie(e){return Oe("MuiStepLabel",e)}const Va=Te("MuiStepLabel",["root","horizontal","vertical","label","active","completed","error","disabled","iconContainer","alternativeLabel","labelContainer"]),sie=e=>{const{classes:t,orientation:r,active:n,completed:o,error:i,disabled:a,alternativeLabel:s}=e;return _e({root:["root",r,i&&"error",a&&"disabled",s&&"alternativeLabel"],label:["label",n&&"active",o&&"completed",i&&"error",a&&"disabled",s&&"alternativeLabel"],iconContainer:["iconContainer",n&&"active",o&&"completed",i&&"error",a&&"disabled",s&&"alternativeLabel"],labelContainer:["labelContainer",s&&"alternativeLabel"]},aie,t)},lie=J("span",{name:"MuiStepLabel",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.orientation]]}})({display:"flex",alignItems:"center",[`&.${Va.alternativeLabel}`]:{flexDirection:"column"},[`&.${Va.disabled}`]:{cursor:"default"},variants:[{props:{orientation:"vertical"},style:{textAlign:"left",padding:"8px 0"}}]}),cie=J("span",{name:"MuiStepLabel",slot:"Label"})(we(({theme:e})=>({...e.typography.body2,display:"block",transition:e.transitions.create("color",{duration:e.transitions.duration.shortest}),[`&.${Va.active}`]:{color:(e.vars||e).palette.text.primary,fontWeight:500},[`&.${Va.completed}`]:{color:(e.vars||e).palette.text.primary,fontWeight:500},[`&.${Va.alternativeLabel}`]:{marginTop:16},[`&.${Va.error}`]:{color:(e.vars||e).palette.error.main}}))),uie=J("span",{name:"MuiStepLabel",slot:"IconContainer"})({flexShrink:0,display:"flex",paddingRight:8,[`&.${Va.alternativeLabel}`]:{paddingRight:0}}),die=J("span",{name:"MuiStepLabel",slot:"LabelContainer"})(we(({theme:e})=>({width:"100%",color:(e.vars||e).palette.text.secondary,[`&.${Va.alternativeLabel}`]:{textAlign:"center"}}))),gM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiStepLabel"}),{children:o,className:i,componentsProps:a={},error:s=!1,icon:l,optional:u,slots:c={},slotProps:d={},StepIconComponent:f,StepIconProps:p,...h}=n,{alternativeLabel:m,orientation:g}=v.useContext(sh),{active:y,disabled:w,completed:S,icon:x}=v.useContext(wv),P=l||x;let A=f;P&&!A&&(A=iie);const T={...n,active:y,alternativeLabel:m,completed:S,disabled:w,error:s,orientation:g},I=sie(T),O={slots:c,slotProps:{stepIcon:p,...a,...d}},[_,R]=ke("root",{elementType:lie,externalForwardedProps:{...O,...h},ownerState:T,ref:r,className:se(I.root,i)}),[E,M]=ke("label",{elementType:cie,externalForwardedProps:O,ownerState:T}),[B,j]=ke("stepIcon",{elementType:A,externalForwardedProps:O,ownerState:T});return b.jsxs(_,{...R,children:[P||B?b.jsx(uie,{className:I.iconContainer,ownerState:T,children:b.jsx(B,{completed:S,active:y,error:s,icon:P,...j})}):null,b.jsxs(die,{className:I.labelContainer,ownerState:T,children:[o?b.jsx(E,{...M,className:se(I.label,M==null?void 0:M.className),children:o}):null,u]})]})});gM.muiName="StepLabel";function fie(e){return Oe("MuiStepConnector",e)}Te("MuiStepConnector",["root","horizontal","vertical","alternativeLabel","active","completed","disabled","line","lineHorizontal","lineVertical"]);const pie=e=>{const{classes:t,orientation:r,alternativeLabel:n,active:o,completed:i,disabled:a}=e,s={root:["root",r,n&&"alternativeLabel",o&&"active",i&&"completed",a&&"disabled"],line:["line",`line${te(r)}`]};return _e(s,fie,t)},hie=J("div",{name:"MuiStepConnector",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.orientation],r.alternativeLabel&&t.alternativeLabel,r.completed&&t.completed]}})({flex:"1 1 auto",variants:[{props:{orientation:"vertical"},style:{marginLeft:12}},{props:{alternativeLabel:!0},style:{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"}}]}),mie=J("span",{name:"MuiStepConnector",slot:"Line",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.line,t[`line${te(r.orientation)}`]]}})(we(({theme:e})=>{const t=e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[600];return{display:"block",borderColor:e.vars?e.vars.palette.StepConnector.border:t,variants:[{props:{orientation:"horizontal"},style:{borderTopStyle:"solid",borderTopWidth:1}},{props:{orientation:"vertical"},style:{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24}}]}})),gie=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiStepConnector"}),{className:o,...i}=n,{alternativeLabel:a,orientation:s="horizontal"}=v.useContext(sh),{active:l,disabled:u,completed:c}=v.useContext(wv),d={...n,alternativeLabel:a,orientation:s,active:l,completed:c,disabled:u},f=pie(d);return b.jsx(hie,{className:se(f.root,o),ref:r,ownerState:d,...i,children:b.jsx(mie,{className:f.line,ownerState:d})})});function yie(e){return Oe("MuiStepContent",e)}Te("MuiStepContent",["root","last","transition"]);const vie=e=>{const{classes:t,last:r}=e;return _e({root:["root",r&&"last"],transition:["transition"]},yie,t)},bie=J("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.last&&t.last]}})(we(({theme:e})=>({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:e.vars?`1px solid ${e.vars.palette.StepContent.border}`:`1px solid ${e.palette.mode==="light"?e.palette.grey[400]:e.palette.grey[600]}`,variants:[{props:{last:!0},style:{borderLeft:"none"}}]}))),wie=J(fp,{name:"MuiStepContent",slot:"Transition"})({}),xie=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiStepContent"}),{children:o,className:i,TransitionComponent:a=fp,transitionDuration:s="auto",TransitionProps:l,slots:u={},slotProps:c={},...d}=n,{orientation:f}=v.useContext(sh),{active:p,last:h,expanded:m}=v.useContext(wv),g={...n,last:h},y=vie(g);let w=s;s==="auto"&&!a.muiSupportAuto&&(w=void 0);const S={slots:u,slotProps:{transition:l,...c}},[x,P]=ke("transition",{elementType:wie,externalForwardedProps:S,ownerState:g,className:y.transition,additionalProps:{in:p||m,timeout:w,unmountOnExit:!0}});return b.jsx(bie,{className:se(y.root,i),ref:r,ownerState:g,...d,children:b.jsx(x,{as:a,...P,children:o})})});function Sie(e){return Oe("MuiStepper",e)}Te("MuiStepper",["root","horizontal","vertical","nonLinear","alternativeLabel"]);const Cie=e=>{const{orientation:t,nonLinear:r,alternativeLabel:n,classes:o}=e;return _e({root:["root",t,r&&"nonLinear",n&&"alternativeLabel"]},Sie,o)},Eie=J("div",{name:"MuiStepper",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.orientation],r.alternativeLabel&&t.alternativeLabel,r.nonLinear&&t.nonLinear]}})({display:"flex",variants:[{props:{orientation:"horizontal"},style:{flexDirection:"row",alignItems:"center"}},{props:{orientation:"vertical"},style:{flexDirection:"column"}},{props:{alternativeLabel:!0},style:{alignItems:"flex-start"}}]}),Pie=b.jsx(gie,{}),Aie=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiStepper"}),{activeStep:o=0,alternativeLabel:i=!1,children:a,className:s,component:l="div",connector:u=Pie,nonLinear:c=!1,orientation:d="horizontal",...f}=n,p={...n,nonLinear:c,alternativeLabel:i,orientation:d,component:l},h=Cie(p),m=v.Children.toArray(a).filter(Boolean),g=m.map((w,S)=>v.cloneElement(w,{index:S,last:S+1===m.length,...w.props})),y=v.useMemo(()=>({activeStep:o,alternativeLabel:i,connector:u,nonLinear:c,orientation:d}),[o,i,u,c,d]);return b.jsx(sh.Provider,{value:y,children:b.jsx(Eie,{as:l,ownerState:p,className:se(h.root,s),ref:r,...f,children:g})})});function kie(e){return Oe("MuiSwitch",e)}const zr=Te("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),Tie=e=>{const{classes:t,edge:r,size:n,color:o,checked:i,disabled:a}=e,s={root:["root",r&&`edge${te(r)}`,`size${te(n)}`],switchBase:["switchBase",`color${te(o)}`,i&&"checked",a&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},l=_e(s,kie,t);return{...t,...l}},Iie=J("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.edge&&t[`edge${te(r.edge)}`],t[`size${te(r.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${zr.thumb}`]:{width:16,height:16},[`& .${zr.switchBase}`]:{padding:4,[`&.${zr.checked}`]:{transform:"translateX(16px)"}}}}]}),Oie=J(Rre,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.switchBase,{[`& .${zr.input}`]:t.input},r.color!=="default"&&t[`color${te(r.color)}`]]}})(we(({theme:e})=>({position:"absolute",top:0,left:0,zIndex:1,color:e.vars?e.vars.palette.Switch.defaultColor:`${e.palette.mode==="light"?e.palette.common.white:e.palette.grey[300]}`,transition:e.transitions.create(["left","transform"],{duration:e.transitions.duration.shortest}),[`&.${zr.checked}`]:{transform:"translateX(20px)"},[`&.${zr.disabled}`]:{color:e.vars?e.vars.palette.Switch.defaultDisabledColor:`${e.palette.mode==="light"?e.palette.grey[100]:e.palette.grey[600]}`},[`&.${zr.checked} + .${zr.track}`]:{opacity:.5},[`&.${zr.disabled} + .${zr.track}`]:{opacity:e.vars?e.vars.opacity.switchTrackDisabled:`${e.palette.mode==="light"?.12:.2}`},[`& .${zr.input}`]:{left:"-100%",width:"300%"}})),we(({theme:e})=>({"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.action.active,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(e.palette).filter(Tt(["light"])).map(([t])=>({props:{color:t},style:{[`&.${zr.checked}`]:{color:(e.vars||e).palette[t].main,"&:hover":{backgroundColor:e.alpha((e.vars||e).palette[t].main,(e.vars||e).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${zr.disabled}`]:{color:e.vars?e.vars.palette.Switch[`${t}DisabledColor`]:`${e.palette.mode==="light"?e.lighten(e.palette[t].main,.62):e.darken(e.palette[t].main,.55)}`}},[`&.${zr.checked} + .${zr.track}`]:{backgroundColor:(e.vars||e).palette[t].main}}}))]}))),_ie=J("span",{name:"MuiSwitch",slot:"Track"})(we(({theme:e})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:e.transitions.create(["opacity","background-color"],{duration:e.transitions.duration.shortest}),backgroundColor:e.vars?e.vars.palette.common.onBackground:`${e.palette.mode==="light"?e.palette.common.black:e.palette.common.white}`,opacity:e.vars?e.vars.opacity.switchTrack:`${e.palette.mode==="light"?.38:.3}`}))),$ie=J("span",{name:"MuiSwitch",slot:"Thumb"})(we(({theme:e})=>({boxShadow:(e.vars||e).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Rie=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiSwitch"}),{className:o,color:i="primary",edge:a=!1,size:s="medium",sx:l,slots:u={},slotProps:c={},...d}=n,f={...n,color:i,edge:a,size:s},p=Tie(f),h={slots:u,slotProps:c},[m,g]=ke("root",{className:se(p.root,o),elementType:Iie,externalForwardedProps:h,ownerState:f,additionalProps:{sx:l}}),[y,w]=ke("thumb",{className:p.thumb,elementType:$ie,externalForwardedProps:h,ownerState:f}),S=b.jsx(y,{...w}),[x,P]=ke("track",{className:p.track,elementType:_ie,externalForwardedProps:h,ownerState:f});return b.jsxs(m,{...g,children:[b.jsx(Oie,{type:"checkbox",icon:S,checkedIcon:S,ref:r,ownerState:f,...d,classes:{...p,root:p.switchBase},slots:{...u.switchBase&&{root:u.switchBase},...u.input&&{input:u.input}},slotProps:{...c.switchBase&&{root:typeof c.switchBase=="function"?c.switchBase(f):c.switchBase},input:{role:"switch"},...c.input&&{input:typeof c.input=="function"?c.input(f):c.input}}}),b.jsx(x,{...P})]})});function jie(e){return Oe("MuiTab",e)}const Un=Te("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),Mie=e=>{const{classes:t,textColor:r,fullWidth:n,wrapped:o,icon:i,label:a,selected:s,disabled:l}=e,u={root:["root",i&&a&&"labelIcon",`textColor${te(r)}`,n&&"fullWidth",o&&"wrapped",s&&"selected",l&&"disabled"],icon:["iconWrapper","icon"]};return _e(u,jie,t)},Nie=J(aa,{name:"MuiTab",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.label&&r.icon&&t.labelIcon,t[`textColor${te(r.textColor)}`],r.fullWidth&&t.fullWidth,r.wrapped&&t.wrapped,{[`& .${Un.iconWrapper}`]:t.iconWrapper},{[`& .${Un.icon}`]:t.icon}]}})(we(({theme:e})=>({...e.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:t})=>t.label&&(t.iconPosition==="top"||t.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:t})=>t.label&&t.iconPosition!=="top"&&t.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:t})=>t.icon&&t.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:t,iconPosition:r})=>t.icon&&t.label&&r==="top",style:{[`& > .${Un.icon}`]:{marginBottom:6}}},{props:({ownerState:t,iconPosition:r})=>t.icon&&t.label&&r==="bottom",style:{[`& > .${Un.icon}`]:{marginTop:6}}},{props:({ownerState:t,iconPosition:r})=>t.icon&&t.label&&r==="start",style:{[`& > .${Un.icon}`]:{marginRight:e.spacing(1)}}},{props:({ownerState:t,iconPosition:r})=>t.icon&&t.label&&r==="end",style:{[`& > .${Un.icon}`]:{marginLeft:e.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${Un.selected}`]:{opacity:1},[`&.${Un.disabled}`]:{opacity:(e.vars||e).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Un.selected}`]:{color:(e.vars||e).palette.primary.main},[`&.${Un.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(e.vars||e).palette.text.secondary,[`&.${Un.selected}`]:{color:(e.vars||e).palette.secondary.main},[`&.${Un.disabled}`]:{color:(e.vars||e).palette.text.disabled}}},{props:({ownerState:t})=>t.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:t})=>t.wrapped,style:{fontSize:e.typography.pxToRem(12)}}]}))),Eu=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTab"}),{className:o,disabled:i=!1,disableFocusRipple:a=!1,fullWidth:s,icon:l,iconPosition:u="top",indicator:c,label:d,onChange:f,onClick:p,onFocus:h,selected:m,selectionFollowsFocus:g,textColor:y="inherit",value:w,wrapped:S=!1,...x}=n,P={...n,disabled:i,disableFocusRipple:a,selected:m,icon:!!l,iconPosition:u,label:!!d,fullWidth:s,textColor:y,wrapped:S},A=Mie(P),T=l&&d&&v.isValidElement(l)?v.cloneElement(l,{className:se(A.icon,l.props.className)}):l,I=_=>{!m&&f&&f(_,w),p&&p(_)},O=_=>{g&&!m&&f&&f(_,w),h&&h(_)};return b.jsxs(Nie,{focusRipple:!a,className:se(A.root,o),ref:r,role:"tab","aria-selected":m,disabled:i,onClick:I,onFocus:O,ownerState:P,tabIndex:m?0:-1,...x,children:[u==="top"||u==="start"?b.jsxs(v.Fragment,{children:[T,d]}):b.jsxs(v.Fragment,{children:[d,T]}),c]})}),yM=v.createContext();function Bie(e){return Oe("MuiTable",e)}Te("MuiTable",["root","stickyHeader"]);const Lie=e=>{const{classes:t,stickyHeader:r}=e;return _e({root:["root",r&&"stickyHeader"]},Bie,t)},Die=J("table",{name:"MuiTable",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.stickyHeader&&t.stickyHeader]}})(we(({theme:e})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...e.typography.body2,padding:e.spacing(2),color:(e.vars||e).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:t})=>t.stickyHeader,style:{borderCollapse:"separate"}}]}))),Kk="table",vM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTable"}),{className:o,component:i=Kk,padding:a="normal",size:s="medium",stickyHeader:l=!1,...u}=n,c={...n,component:i,padding:a,size:s,stickyHeader:l},d=Lie(c),f=v.useMemo(()=>({padding:a,size:s,stickyHeader:l}),[a,s,l]);return b.jsx(yM.Provider,{value:f,children:b.jsx(Die,{as:i,role:i===Kk?null:"table",ref:r,className:se(d.root,o),ownerState:c,...u})})}),xv=v.createContext();function zie(e){return Oe("MuiTableBody",e)}Te("MuiTableBody",["root"]);const Fie=e=>{const{classes:t}=e;return _e({root:["root"]},zie,t)},Uie=J("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),Wie={variant:"body"},Zk="tbody",bM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTableBody"}),{className:o,component:i=Zk,...a}=n,s={...n,component:i},l=Fie(s);return b.jsx(xv.Provider,{value:Wie,children:b.jsx(Uie,{className:se(l.root,o),as:i,ref:r,role:i===Zk?null:"rowgroup",ownerState:s,...a})})});function Hie(e){return Oe("MuiTableCell",e)}const Vie=Te("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),Gie=e=>{const{classes:t,variant:r,align:n,padding:o,size:i,stickyHeader:a}=e,s={root:["root",r,a&&"stickyHeader",n!=="inherit"&&`align${te(n)}`,o!=="normal"&&`padding${te(o)}`,`size${te(i)}`]};return _e(s,Hie,t)},qie=J("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,t[r.variant],t[`size${te(r.size)}`],r.padding!=="normal"&&t[`padding${te(r.padding)}`],r.align!=="inherit"&&t[`align${te(r.align)}`],r.stickyHeader&&t.stickyHeader]}})(we(({theme:e})=>({...e.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:e.vars?`1px solid ${e.vars.palette.TableCell.border}`:`1px solid + ${e.palette.mode==="light"?e.lighten(e.alpha(e.palette.divider,1),.88):e.darken(e.alpha(e.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(e.vars||e).palette.text.primary,lineHeight:e.typography.pxToRem(24),fontWeight:e.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(e.vars||e).palette.text.primary}},{props:{variant:"footer"},style:{color:(e.vars||e).palette.text.secondary,lineHeight:e.typography.pxToRem(21),fontSize:e.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${Vie.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:t})=>t.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(e.vars||e).palette.background.default}}]}))),Wt=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTableCell"}),{align:o="inherit",className:i,component:a,padding:s,scope:l,size:u,sortDirection:c,variant:d,...f}=n,p=v.useContext(yM),h=v.useContext(xv),m=h&&h.variant==="head";let g;a?g=a:g=m?"th":"td";let y=l;g==="td"?y=void 0:!y&&m&&(y="col");const w=d||h&&h.variant,S={...n,align:o,component:g,padding:s||(p&&p.padding?p.padding:"normal"),size:u||(p&&p.size?p.size:"medium"),sortDirection:c,stickyHeader:w==="head"&&p&&p.stickyHeader,variant:w},x=Gie(S);let P=null;return c&&(P=c==="asc"?"ascending":"descending"),b.jsx(qie,{as:g,ref:r,className:se(x.root,i),"aria-sort":P,scope:y,ownerState:S,...f})});function Kie(e){return Oe("MuiTableContainer",e)}Te("MuiTableContainer",["root"]);const Zie=e=>{const{classes:t}=e;return _e({root:["root"]},Kie,t)},Yie=J("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),wM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTableContainer"}),{className:o,component:i="div",...a}=n,s={...n,component:i},l=Zie(s);return b.jsx(Yie,{ref:r,as:i,className:se(l.root,o),ownerState:s,...a})});function Xie(e){return Oe("MuiTableHead",e)}Te("MuiTableHead",["root"]);const Qie=e=>{const{classes:t}=e;return _e({root:["root"]},Xie,t)},Jie=J("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),eae={variant:"head"},Yk="thead",xM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTableHead"}),{className:o,component:i=Yk,...a}=n,s={...n,component:i},l=Qie(s);return b.jsx(xv.Provider,{value:eae,children:b.jsx(Jie,{as:i,className:se(l.root,o),ref:r,role:i===Yk?null:"rowgroup",ownerState:s,...a})})});function tae(e){return Oe("MuiToolbar",e)}Te("MuiToolbar",["root","gutters","regular","dense"]);const rae=e=>{const{classes:t,disableGutters:r,variant:n}=e;return _e({root:["root",!r&&"gutters",n]},tae,t)},nae=J("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,!r.disableGutters&&t.gutters,t[r.variant]]}})(we(({theme:e})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:t})=>!t.disableGutters,style:{paddingLeft:e.spacing(2),paddingRight:e.spacing(2),[e.breakpoints.up("sm")]:{paddingLeft:e.spacing(3),paddingRight:e.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:e.mixins.toolbar}]}))),SM=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiToolbar"}),{className:o,component:i="div",disableGutters:a=!1,variant:s="regular",...l}=n,u={...n,component:i,disableGutters:a,variant:s},c=rae(u);return b.jsx(nae,{as:i,className:se(c.root,o),ref:r,ownerState:u,...l})}),CM=Qe(b.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),EM=Qe(b.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function oae(e){return Oe("MuiTablePaginationActions",e)}Te("MuiTablePaginationActions",["root"]);const iae=e=>{const{classes:t}=e;return _e({root:["root"]},oae,t)},aae=J("div",{name:"MuiTablePaginationActions",slot:"Root"})({}),sae=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTablePaginationActions"}),{backIconButtonProps:o,className:i,count:a,disabled:s=!1,getItemAriaLabel:l,nextIconButtonProps:u,onPageChange:c,page:d,rowsPerPage:f,showFirstButton:p,showLastButton:h,slots:m={},slotProps:g={},...y}=n,w=ql(),x=iae(n),P=Y=>{c(Y,0)},A=Y=>{c(Y,d-1)},T=Y=>{c(Y,d+1)},I=Y=>{c(Y,Math.max(0,Math.ceil(a/f)-1))},O=m.firstButton??ui,_=m.lastButton??ui,R=m.nextButton??ui,E=m.previousButton??ui,M=m.firstButtonIcon??koe,B=m.lastButtonIcon??Toe,j=m.nextButtonIcon??EM,N=m.previousButtonIcon??CM,F=w?_:O,D=w?R:E,z=w?E:R,W=w?O:_,H=w?g.lastButton:g.firstButton,V=w?g.nextButton:g.previousButton,Q=w?g.previousButton:g.nextButton,re=w?g.firstButton:g.lastButton;return b.jsxs(aae,{ref:r,className:se(x.root,i),...y,children:[p&&b.jsx(F,{onClick:P,disabled:s||d===0,"aria-label":l("first",d),title:l("first",d),...H,children:w?b.jsx(B,{...g.lastButtonIcon}):b.jsx(M,{...g.firstButtonIcon})}),b.jsx(D,{onClick:A,disabled:s||d===0,color:"inherit","aria-label":l("previous",d),title:l("previous",d),...V??o,children:w?b.jsx(j,{...g.nextButtonIcon}):b.jsx(N,{...g.previousButtonIcon})}),b.jsx(z,{onClick:T,disabled:s||(a!==-1?d>=Math.ceil(a/f)-1:!1),color:"inherit","aria-label":l("next",d),title:l("next",d),...Q??u,children:w?b.jsx(N,{...g.previousButtonIcon}):b.jsx(j,{...g.nextButtonIcon})}),h&&b.jsx(W,{onClick:I,disabled:s||d>=Math.ceil(a/f)-1,"aria-label":l("last",d),title:l("last",d),...re,children:w?b.jsx(M,{...g.firstButtonIcon}):b.jsx(B,{...g.lastButtonIcon})})]})});function lae(e){return Oe("MuiTablePagination",e)}const mf=Te("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var Xk;const cae=J(Wt,{name:"MuiTablePagination",slot:"Root"})(we(({theme:e})=>({overflow:"auto",color:(e.vars||e).palette.text.primary,fontSize:e.typography.pxToRem(14),"&:last-child":{padding:0}}))),uae=J(SM,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(e,t)=>({[`& .${mf.actions}`]:t.actions,...t.toolbar})})(we(({theme:e})=>({minHeight:52,paddingRight:2,[`${e.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[e.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${mf.actions}`]:{flexShrink:0,marginLeft:20}}))),dae=J("div",{name:"MuiTablePagination",slot:"Spacer"})({flex:"1 1 100%"}),fae=J("p",{name:"MuiTablePagination",slot:"SelectLabel"})(we(({theme:e})=>({...e.typography.body2,flexShrink:0}))),pae=J(N6,{name:"MuiTablePagination",slot:"Select",overridesResolver:(e,t)=>({[`& .${mf.selectIcon}`]:t.selectIcon,[`& .${mf.select}`]:t.select,...t.input,...t.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${mf.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),hae=J(G0,{name:"MuiTablePagination",slot:"MenuItem"})({}),mae=J("p",{name:"MuiTablePagination",slot:"DisplayedRows"})(we(({theme:e})=>({...e.typography.body2,flexShrink:0})));function gae({from:e,to:t,count:r}){return`${e}–${t} of ${r!==-1?r:`more than ${t}`}`}function yae(e){return`Go to ${e} page`}const vae=e=>{const{classes:t}=e;return _e({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},lae,t)},bae=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTablePagination"}),{ActionsComponent:o=sae,backIconButtonProps:i,colSpan:a,component:s=Wt,count:l,disabled:u=!1,getItemAriaLabel:c=yae,labelDisplayedRows:d=gae,labelRowsPerPage:f="Rows per page:",nextIconButtonProps:p,onPageChange:h,onRowsPerPageChange:m,page:g,rowsPerPage:y,rowsPerPageOptions:w=[10,25,50,100],SelectProps:S={},showFirstButton:x=!1,showLastButton:P=!1,slotProps:A={},slots:T={},...I}=n,O=n,_=vae(O),R=(A==null?void 0:A.select)??S,E=R.native?"option":hae;let M;(s===Wt||s==="td")&&(M=a||1e3);const B=gs(R.id),j=gs(R.labelId),N=()=>l===-1?(g+1)*y:y===-1?l:Math.min(l,(g+1)*y),F={slots:T,slotProps:A},[D,z]=ke("root",{ref:r,className:_.root,elementType:cae,externalForwardedProps:{...F,component:s,...I},ownerState:O,additionalProps:{colSpan:M}}),[W,H]=ke("toolbar",{className:_.toolbar,elementType:uae,externalForwardedProps:F,ownerState:O}),[V,Q]=ke("spacer",{className:_.spacer,elementType:dae,externalForwardedProps:F,ownerState:O}),[re,Y]=ke("selectLabel",{className:_.selectLabel,elementType:fae,externalForwardedProps:F,ownerState:O,additionalProps:{id:j}}),[Z,ie]=ke("select",{className:_.select,elementType:pae,externalForwardedProps:F,ownerState:O}),[me,G]=ke("menuItem",{className:_.menuItem,elementType:E,externalForwardedProps:F,ownerState:O}),[oe,de]=ke("displayedRows",{className:_.displayedRows,elementType:mae,externalForwardedProps:F,ownerState:O});return b.jsx(D,{...z,children:b.jsxs(W,{...H,children:[b.jsx(V,{...Q}),w.length>1&&b.jsx(re,{...Y,children:f}),w.length>1&&b.jsx(Z,{variant:"standard",...!R.variant&&{input:Xk||(Xk=b.jsx(bv,{}))},value:y,onChange:m,id:B,labelId:j,...R,classes:{...R.classes,root:se(_.input,_.selectRoot,(R.classes||{}).root),select:se(_.select,(R.classes||{}).select),icon:se(_.selectIcon,(R.classes||{}).icon)},disabled:u,...ie,children:w.map(q=>v.createElement(me,{...G,key:q.label?q.label:q,value:q.value?q.value:q},q.label?q.label:q))}),b.jsx(oe,{...de,children:d({from:l===0?0:g*y+1,to:N(),count:l===-1?-1:l,page:g})}),b.jsx(o,{className:_.actions,backIconButtonProps:i,count:l,nextIconButtonProps:p,onPageChange:h,page:g,rowsPerPage:y,showFirstButton:x,showLastButton:P,slotProps:A.actions,slots:T.actions,getItemAriaLabel:c,disabled:u})]})})});function wae(e){return Oe("MuiTableRow",e)}const Qk=Te("MuiTableRow",["root","selected","hover","head","footer"]),xae=e=>{const{classes:t,selected:r,hover:n,head:o,footer:i}=e;return _e({root:["root",r&&"selected",n&&"hover",o&&"head",i&&"footer"]},wae,t)},Sae=J("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.head&&t.head,r.footer&&t.footer]}})(we(({theme:e})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${Qk.hover}:hover`]:{backgroundColor:(e.vars||e).palette.action.hover},[`&.${Qk.selected}`]:{backgroundColor:e.alpha((e.vars||e).palette.primary.main,(e.vars||e).palette.action.selectedOpacity),"&:hover":{backgroundColor:e.alpha((e.vars||e).palette.primary.main,`${(e.vars||e).palette.action.selectedOpacity} + ${(e.vars||e).palette.action.hoverOpacity}`)}}}))),Jk="tr",Rc=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTableRow"}),{className:o,component:i=Jk,hover:a=!1,selected:s=!1,...l}=n,u=v.useContext(xv),c={...n,component:i,hover:a,selected:s,head:u&&u.variant==="head",footer:u&&u.variant==="footer"},d=xae(c);return b.jsx(Sae,{as:i,ref:r,className:se(d.root,o),role:i===Jk?null:"row",ownerState:c,...l})});function Cae(e){return(1+Math.sin(Math.PI*e-Math.PI/2))/2}function Eae(e,t,r,n={},o=()=>{}){const{ease:i=Cae,duration:a=300}=n;let s=null;const l=t[e];let u=!1;const c=()=>{u=!0},d=f=>{if(u){o(new Error("Animation cancelled"));return}s===null&&(s=f);const p=Math.min(1,(f-s)/a);if(t[e]=i(p)*(r-l)+l,p>=1){requestAnimationFrame(()=>{o(null)});return}requestAnimationFrame(d)};return l===r?(o(new Error("Element already at target position")),c):(requestAnimationFrame(d),c)}const Pae={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function Aae(e){const{onChange:t,...r}=e,n=v.useRef(),o=v.useRef(null),i=()=>{n.current=o.current.offsetHeight-o.current.clientHeight};return $n(()=>{const a=fv(()=>{const l=n.current;i(),l!==n.current&&t(n.current)}),s=Lo(o.current);return s.addEventListener("resize",a),()=>{a.clear(),s.removeEventListener("resize",a)}},[t]),v.useEffect(()=>{i(),t(n.current)},[t]),b.jsx("div",{style:Pae,...r,ref:o})}function kae(e){return Oe("MuiTabScrollButton",e)}const Tae=Te("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),Iae=e=>{const{classes:t,orientation:r,disabled:n}=e;return _e({root:["root",r,n&&"disabled"]},kae,t)},Oae=J(aa,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.root,r.orientation&&t[r.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${Tae.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),_ae=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTabScrollButton"}),{className:o,slots:i={},slotProps:a={},direction:s,orientation:l,disabled:u,...c}=n,d=ql(),f={isRtl:d,...n},p=Iae(f),h=i.StartScrollButtonIcon??CM,m=i.EndScrollButtonIcon??EM,g=Su({elementType:h,externalSlotProps:a.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:f}),y=Su({elementType:m,externalSlotProps:a.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:f});return b.jsx(Oae,{component:"div",className:se(p.root,o),ref:r,role:null,ownerState:f,tabIndex:null,...c,style:{...c.style,...l==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${d?-90:90}deg)`}},children:s==="left"?b.jsx(h,{...g}):b.jsx(m,{...y})})});function $ae(e){return Oe("MuiTabs",e)}const P1=Te("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),eT=(e,t)=>e===t?e.firstChild:t&&t.nextElementSibling?t.nextElementSibling:e.firstChild,tT=(e,t)=>e===t?e.lastChild:t&&t.previousElementSibling?t.previousElementSibling:e.lastChild,s0=(e,t,r)=>{let n=!1,o=r(e,t);for(;o;){if(o===e.firstChild){if(n)return;n=!0}const i=o.disabled||o.getAttribute("aria-disabled")==="true";if(!o.hasAttribute("tabindex")||i)o=r(e,o);else{o.focus();return}}},Rae=e=>{const{vertical:t,fixed:r,hideScrollbar:n,scrollableX:o,scrollableY:i,centered:a,scrollButtonsHideMobile:s,classes:l}=e;return _e({root:["root",t&&"vertical"],scroller:["scroller",r&&"fixed",n&&"hideScrollbar",o&&"scrollableX",i&&"scrollableY"],list:["list","flexContainer",t&&"flexContainerVertical",t&&"vertical",a&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",s&&"scrollButtonsHideMobile"],scrollableX:[o&&"scrollableX"],hideScrollbar:[n&&"hideScrollbar"]},$ae,l)},jae=J("div",{name:"MuiTabs",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[{[`& .${P1.scrollButtons}`]:t.scrollButtons},{[`& .${P1.scrollButtons}`]:r.scrollButtonsHideMobile&&t.scrollButtonsHideMobile},t.root,r.vertical&&t.vertical]}})(we(({theme:e})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:t})=>t.vertical,style:{flexDirection:"column"}},{props:({ownerState:t})=>t.scrollButtonsHideMobile,style:{[`& .${P1.scrollButtons}`]:{[e.breakpoints.down("sm")]:{display:"none"}}}}]}))),Mae=J("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.scroller,r.fixed&&t.fixed,r.hideScrollbar&&t.hideScrollbar,r.scrollableX&&t.scrollableX,r.scrollableY&&t.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:e})=>e.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:e})=>e.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:e})=>e.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:e})=>e.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),Nae=J("div",{name:"MuiTabs",slot:"List",overridesResolver:(e,t)=>{const{ownerState:r}=e;return[t.list,t.flexContainer,r.vertical&&t.flexContainerVertical,r.centered&&t.centered]}})({display:"flex",variants:[{props:({ownerState:e})=>e.vertical,style:{flexDirection:"column"}},{props:({ownerState:e})=>e.centered,style:{justifyContent:"center"}}]}),Bae=J("span",{name:"MuiTabs",slot:"Indicator"})(we(({theme:e})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:e.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(e.vars||e).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(e.vars||e).palette.secondary.main}},{props:({ownerState:t})=>t.vertical,style:{height:"100%",width:2,right:0}}]}))),Lae=J(Aae)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),rT={},B6=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTabs"}),o=Os(),i=ql(),{"aria-label":a,"aria-labelledby":s,action:l,centered:u=!1,children:c,className:d,component:f="div",allowScrollButtonsMobile:p=!1,indicatorColor:h="primary",onChange:m,orientation:g="horizontal",ScrollButtonComponent:y,scrollButtons:w="auto",selectionFollowsFocus:S,slots:x={},slotProps:P={},TabIndicatorProps:A={},TabScrollButtonProps:T={},textColor:I="primary",value:O,variant:_="standard",visibleScrollbar:R=!1,...E}=n,M=_==="scrollable",B=g==="vertical",j=B?"scrollTop":"scrollLeft",N=B?"top":"left",F=B?"bottom":"right",D=B?"clientHeight":"clientWidth",z=B?"height":"width",W={...n,component:f,allowScrollButtonsMobile:p,indicatorColor:h,orientation:g,vertical:B,scrollButtons:w,textColor:I,variant:_,visibleScrollbar:R,fixed:!M,hideScrollbar:M&&!R,scrollableX:M&&!B,scrollableY:M&&B,centered:u&&!M,scrollButtonsHideMobile:!p},H=Rae(W),V=Su({elementType:x.StartScrollButtonIcon,externalSlotProps:P.startScrollButtonIcon,ownerState:W}),Q=Su({elementType:x.EndScrollButtonIcon,externalSlotProps:P.endScrollButtonIcon,ownerState:W}),[re,Y]=v.useState(!1),[Z,ie]=v.useState(rT),[me,G]=v.useState(!1),[oe,de]=v.useState(!1),[q,Ee]=v.useState(!1),[ce,ue]=v.useState({overflow:"hidden",scrollbarWidth:0}),ye=new Map,Pe=v.useRef(null),Ne=v.useRef(null),Ue={slots:x,slotProps:{indicator:A,scrollButtons:T,...P}},Ke=()=>{const be=Pe.current;let Me;if(be){const st=be.getBoundingClientRect();Me={clientWidth:be.clientWidth,scrollLeft:be.scrollLeft,scrollTop:be.scrollTop,scrollWidth:be.scrollWidth,top:st.top,bottom:st.bottom,left:st.left,right:st.right}}let et;if(be&&O!==!1){const st=Ne.current.children;if(st.length>0){const Dt=st[ye.get(O)];et=Dt?Dt.getBoundingClientRect():null}}return{tabsMeta:Me,tabMeta:et}},We=no(()=>{const{tabsMeta:be,tabMeta:Me}=Ke();let et=0,st;B?(st="top",Me&&be&&(et=Me.top-be.top+be.scrollTop)):(st=i?"right":"left",Me&&be&&(et=(i?-1:1)*(Me[st]-be[st]+be.scrollLeft)));const Dt={[st]:et,[z]:Me?Me[z]:0};if(typeof Z[st]!="number"||typeof Z[z]!="number")ie(Dt);else{const Vo=Math.abs(Z[st]-Dt[st]),Bs=Math.abs(Z[z]-Dt[z]);(Vo>=1||Bs>=1)&&ie(Dt)}}),Ae=(be,{animation:Me=!0}={})=>{Me?Eae(j,Pe.current,be,{duration:o.transitions.duration.standard}):Pe.current[j]=be},qt=be=>{let Me=Pe.current[j];B?Me+=be:Me+=be*(i?-1:1),Ae(Me)},Xe=()=>{const be=Pe.current[D];let Me=0;const et=Array.from(Ne.current.children);for(let st=0;stbe){st===0&&(Me=be);break}Me+=Dt[D]}return Me},Ct=()=>{qt(-1*Xe())},Lt=()=>{qt(Xe())},[Kt,{onChange:bt,...or}]=ke("scrollbar",{className:se(H.scrollableX,H.hideScrollbar),elementType:Lae,shouldForwardComponentProp:!0,externalForwardedProps:Ue,ownerState:W}),$=v.useCallback(be=>{bt==null||bt(be),ue({overflow:null,scrollbarWidth:be})},[bt]),[C,k]=ke("scrollButtons",{className:se(H.scrollButtons,T.className),elementType:_ae,externalForwardedProps:Ue,ownerState:W,additionalProps:{orientation:g,slots:{StartScrollButtonIcon:x.startScrollButtonIcon||x.StartScrollButtonIcon,EndScrollButtonIcon:x.endScrollButtonIcon||x.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:V,endScrollButtonIcon:Q}}}),L=()=>{const be={};be.scrollbarSizeListener=M?b.jsx(Kt,{...or,onChange:$}):null;const et=M&&(w==="auto"&&(me||oe)||w===!0);return be.scrollButtonStart=et?b.jsx(C,{direction:i?"right":"left",onClick:Ct,disabled:!me,...k}):null,be.scrollButtonEnd=et?b.jsx(C,{direction:i?"left":"right",onClick:Lt,disabled:!oe,...k}):null,be},U=no(be=>{const{tabsMeta:Me,tabMeta:et}=Ke();if(!(!et||!Me)){if(et[N]Me[F]){const st=Me[j]+(et[F]-Me[F]);Ae(st,{animation:be})}}}),K=no(()=>{M&&w!==!1&&Ee(!q)});v.useEffect(()=>{const be=fv(()=>{Pe.current&&We()});let Me;const et=Vo=>{Vo.forEach(Bs=>{Bs.removedNodes.forEach(dd=>{Me==null||Me.unobserve(dd)}),Bs.addedNodes.forEach(dd=>{Me==null||Me.observe(dd)})}),be(),K()},st=Lo(Pe.current);st.addEventListener("resize",be);let Dt;return typeof ResizeObserver<"u"&&(Me=new ResizeObserver(be),Array.from(Ne.current.children).forEach(Vo=>{Me.observe(Vo)})),typeof MutationObserver<"u"&&(Dt=new MutationObserver(et),Dt.observe(Ne.current,{childList:!0})),()=>{be.clear(),st.removeEventListener("resize",be),Dt==null||Dt.disconnect(),Me==null||Me.disconnect()}},[We,K]),v.useEffect(()=>{const be=Array.from(Ne.current.children),Me=be.length;if(typeof IntersectionObserver<"u"&&Me>0&&M&&w!==!1){const et=be[0],st=be[Me-1],Dt={root:Pe.current,threshold:.99},Vo=mb=>{G(!mb[0].isIntersecting)},Bs=new IntersectionObserver(Vo,Dt);Bs.observe(et);const dd=mb=>{de(!mb[0].isIntersecting)},SE=new IntersectionObserver(dd,Dt);return SE.observe(st),()=>{Bs.disconnect(),SE.disconnect()}}},[M,w,q,c==null?void 0:c.length]),v.useEffect(()=>{Y(!0)},[]),v.useEffect(()=>{We()}),v.useEffect(()=>{U(rT!==Z)},[U,Z]),v.useImperativeHandle(l,()=>({updateIndicator:We,updateScrollButtons:K}),[We,K]);const[ne,De]=ke("indicator",{className:se(H.indicator,A.className),elementType:Bae,externalForwardedProps:Ue,ownerState:W,additionalProps:{style:Z}}),tt=b.jsx(ne,{...De});let Je=0;const ut=v.Children.map(c,be=>{if(!v.isValidElement(be))return null;const Me=be.props.value===void 0?Je:be.props.value;ye.set(Me,Je);const et=Me===O;return Je+=1,v.cloneElement(be,{fullWidth:_==="fullWidth",indicator:et&&!re&&tt,selected:et,selectionFollowsFocus:S,onChange:m,textColor:I,value:Me,...Je===1&&O===!1&&!be.props.tabIndex?{tabIndex:0}:{}})}),he=be=>{if(be.altKey||be.shiftKey||be.ctrlKey||be.metaKey)return;const Me=Ne.current,et=$c(hn(Me));if((et==null?void 0:et.getAttribute("role"))!=="tab")return;let Dt=g==="horizontal"?"ArrowLeft":"ArrowUp",Vo=g==="horizontal"?"ArrowRight":"ArrowDown";switch(g==="horizontal"&&i&&(Dt="ArrowRight",Vo="ArrowLeft"),be.key){case Dt:be.preventDefault(),s0(Me,et,tT);break;case Vo:be.preventDefault(),s0(Me,et,eT);break;case"Home":be.preventDefault(),s0(Me,null,eT);break;case"End":be.preventDefault(),s0(Me,null,tT);break}},at=L(),[Zt,Ho]=ke("root",{ref:r,className:se(H.root,d),elementType:jae,externalForwardedProps:{...Ue,...E,component:f},ownerState:W}),[Ql,hb]=ke("scroller",{ref:Pe,className:H.scroller,elementType:Mae,externalForwardedProps:Ue,ownerState:W,additionalProps:{style:{overflow:ce.overflow,[B?`margin${i?"Left":"Right"}`:"marginBottom"]:R?void 0:-ce.scrollbarWidth}}}),[He,bn]=ke("list",{ref:Ne,className:se(H.list,H.flexContainer),elementType:Nae,externalForwardedProps:Ue,ownerState:W,getSlotProps:be=>({...be,onKeyDown:Me=>{var et;he(Me),(et=be.onKeyDown)==null||et.call(be,Me)}})});return b.jsxs(Zt,{...Ho,children:[at.scrollButtonStart,at.scrollbarSizeListener,b.jsxs(Ql,{...hb,children:[b.jsx(He,{"aria-label":a,"aria-labelledby":s,"aria-orientation":g==="vertical"?"vertical":null,role:"tablist",...bn,children:ut}),re&&tt]}),at.scrollButtonEnd]})});function Dae(e){return Oe("MuiTextField",e)}Te("MuiTextField",["root"]);const zae={standard:_6,filled:O6,outlined:j6},Fae=e=>{const{classes:t}=e;return _e({root:["root"]},Dae,t)},Uae=J(dne,{name:"MuiTextField",slot:"Root"})({}),nT=v.forwardRef(function(t,r){const n=$e({props:t,name:"MuiTextField"}),{autoComplete:o,autoFocus:i=!1,children:a,className:s,color:l="primary",defaultValue:u,disabled:c=!1,error:d=!1,FormHelperTextProps:f,fullWidth:p=!1,helperText:h,id:m,InputLabelProps:g,inputProps:y,InputProps:w,inputRef:S,label:x,maxRows:P,minRows:A,multiline:T=!1,name:I,onBlur:O,onChange:_,onFocus:R,placeholder:E,required:M=!1,rows:B,select:j=!1,SelectProps:N,slots:F={},slotProps:D={},type:z,value:W,variant:H="outlined",...V}=n,Q={...n,autoFocus:i,color:l,disabled:c,error:d,fullWidth:p,multiline:T,required:M,select:j,variant:H},re=Fae(Q),Y=gs(m),Z=h&&Y?`${Y}-helper-text`:void 0,ie=x&&Y?`${Y}-label`:void 0,me=zae[H],G={slots:F,slotProps:{input:w,inputLabel:g,htmlInput:y,formHelperText:f,select:N,...D}},oe={},de=G.slotProps.inputLabel;H==="outlined"&&(de&&typeof de.shrink<"u"&&(oe.notched=de.shrink),oe.label=x),j&&((!N||!N.native)&&(oe.id=void 0),oe["aria-describedby"]=void 0);const[q,Ee]=ke("root",{elementType:Uae,shouldForwardComponentProp:!0,externalForwardedProps:{...G,...V},ownerState:Q,className:se(re.root,s),ref:r,additionalProps:{disabled:c,error:d,fullWidth:p,required:M,color:l,variant:H}}),[ce,ue]=ke("input",{elementType:me,externalForwardedProps:G,additionalProps:oe,ownerState:Q}),[ye,Pe]=ke("inputLabel",{elementType:Rne,externalForwardedProps:G,ownerState:Q}),[Ne,Ue]=ke("htmlInput",{elementType:"input",externalForwardedProps:G,ownerState:Q}),[Ke,We]=ke("formHelperText",{elementType:wne,externalForwardedProps:G,ownerState:Q}),[Ae,qt]=ke("select",{elementType:N6,externalForwardedProps:G,ownerState:Q}),Xe=b.jsx(ce,{"aria-describedby":Z,autoComplete:o,autoFocus:i,defaultValue:u,fullWidth:p,multiline:T,name:I,rows:B,maxRows:P,minRows:A,type:z,value:W,id:Y,inputRef:S,onBlur:O,onChange:_,onFocus:R,placeholder:E,inputProps:Ue,slots:{input:F.htmlInput?Ne:void 0},...ue});return b.jsxs(q,{...Ee,children:[x!=null&&x!==""&&b.jsx(ye,{htmlFor:Y,id:ie,...Pe,children:x}),j?b.jsx(Ae,{"aria-describedby":Z,id:Y,labelId:ie,value:W,input:Xe,...qt,children:a}):Xe,h&&b.jsx(Ke,{id:Z,...We,children:h})]})}),n2=Qe(b.jsx("path",{d:"M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2zm-9-2h10V8H12zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"})),A1=Qe(b.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),o2=Qe(b.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),Vm=Qe(b.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),Gm=Qe(b.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),Wae=Qe(b.jsx("path",{d:"M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2M5 8V7h2v3.82C5.84 10.4 5 9.3 5 8m14 0c0 1.3-.84 2.4-2 2.82V7h2z"})),Hae=Qe(b.jsx("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),i2=Qe(b.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),a2=Qe(b.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24z"})),Sv=Qe(b.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"})),Vae=Qe(b.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"})),oT=Qe(b.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"})),Gae=Qe(b.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),iT=Qe(b.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"})),PM=Qe(b.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"})),aT=Qe(b.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"})),AM=Qe(b.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"})),qae=Qe(b.jsx("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"})),sT=Qe(b.jsx("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2m0 14H4V8h16zm-2-1h-6v-2h6zM7.5 17l-1.41-1.41L8.67 13l-2.59-2.59L7.5 9l4 4z"})),Kae=Qe(b.jsx("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"})),Zae=Qe(b.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"})),lT=Qe(b.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"})),Yae=tR({id:8453,name:"Base",network:"base-mainnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"BaseScan",url:"https://basescan.org"}}}),Zc=tR({id:84532,name:"Base Sepolia",network:"base-sepolia",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"BaseScan",url:"https://sepolia.basescan.org"}}});function L6(e){switch(e){case 8453:return Yae;case 84532:return Zc;default:throw new Error(`Unsupported chain ID: ${e}. Supported chains: 8453 (Base), 84532 (Base Sepolia)`)}}const cT=qg(["function attest((bytes32 schema,(address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 value) data)) returns (bytes32)"]),Xae=qg(["event Attested(address indexed recipient, address indexed attester, bytes32 indexed uid, bytes32 schema)"]);function uT(e,t,r){const n=(e.address??"").toLowerCase()===t.toLowerCase();try{if(n){const o=Bf({abi:Xae,data:e.data,topics:e.topics});if(o.eventName==="Attested"){const i=o.args.uid;if(i&&i!=="0x"&&i.toLowerCase()!==r.toLowerCase())return i}}}catch{}if(n&&Array.isArray(e.topics)&&e.topics.length>=4){const o=e.topics[3];if(o&&o!=="0x"&&o.toLowerCase()!==r.toLowerCase())return o}if(n&&typeof e.data=="string"&&e.data.startsWith("0x")&&e.data.length>=66){const o="0x"+e.data.slice(2,66);if(o&&o!=="0x"&&o.toLowerCase()!==r.toLowerCase())return o}}function Qae(e){return Ss([{type:"string",name:"domain"},{type:"string",name:"username"},{type:"address",name:"wallet"},{type:"string",name:"message"},{type:"bytes",name:"signature"},{type:"string",name:"proof_url"}],[e.domain,e.username,Bp(e.wallet),e.message,e.signature,e.proof_url])}const dT={baseSepolia:e=>{if(!e.EAS_ADDRESS)throw new Error("VITE_EAS_BASE_SEPOLIA_ADDRESS (or VITE_EAS_ADDRESS) is required for Base Sepolia");return{chain:Zc,contract:e.EAS_ADDRESS}},forChain:(e,t)=>{if(!t.EAS_ADDRESS)throw new Error("VITE_EAS_ADDRESS is required");return{chain:L6(e),contract:t.EAS_ADDRESS}}};async function Jae(e,t,r){var c;const n=d=>typeof d=="string"&&/^0x[0-9a-fA-F]{40}$/.test(d);if(!n(t.contract))throw new Error(`EAS contract address invalid: ${String(t.contract)}`);if(!n(e.recipient))throw new Error(`Recipient address invalid: ${String(e.recipient)}`);const o=(r==null?void 0:r.publicClient)??gl({chain:t.chain,transport:Xa(t.chain.rpcUrls.default.http[0])});try{const d=await o.getCode({address:t.contract});if(!d||d==="0x")throw new Error(`No contract code found at EAS address ${t.contract}. Check VITE_EAS_BASE_SEPOLIA_ADDRESS.`)}catch(d){throw d instanceof Error?d:new Error("Failed to resolve EAS contract code")}if(r!=null&&r.aaClient){const d=gn({abi:cT,functionName:"attest",args:[{schema:e.schemaUid,data:{recipient:e.recipient,expirationTime:BigInt(0),revocable:!0,refUID:$o(0,{size:32}),data:e.data,value:BigInt(0)}}]}),f=await r.aaClient.sendUserOp({to:t.contract,data:d,value:0n}),p=await r.aaClient.waitForUserOp(f),h=((c=p==null?void 0:p.receipt)==null?void 0:c.transactionHash)??(p==null?void 0:p.transactionHash)??(p==null?void 0:p.hash)??f;let m;try{const g=await o.waitForTransactionReceipt({hash:h});for(const y of g.logs){const w=uT({address:y.address,data:y.data,topics:y.topics},t.contract,e.schemaUid);if(w){m=w;break}}}catch{}return{txHash:h,attestationUid:m}}const i=(r==null?void 0:r.walletClient)??(window.ethereum?Xs({chain:t.chain,transport:Qs(window.ethereum)}):null);if(!i)throw new Error("No wallet client available");const[a]=await i.getAddresses(),s=await i.writeContract({address:t.contract,abi:cT,functionName:"attest",account:a,args:[{schema:e.schemaUid,data:{recipient:e.recipient,expirationTime:BigInt(0),revocable:!0,refUID:$o(0,{size:32}),data:e.data,value:BigInt(0)}}]}),l=await o.waitForTransactionReceipt({hash:s});let u;for(const d of l.logs){const f=uT({address:d.address,data:d.data,topics:d.topics},t.contract,e.schemaUid);if(f){u=f;break}}return{txHash:s,attestationUid:u}}var kM={},Cv={};Cv.byteLength=rse;Cv.toByteArray=ose;Cv.fromByteArray=sse;var ci=[],qn=[],ese=typeof Uint8Array<"u"?Uint8Array:Array,k1="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var ic=0,tse=k1.length;ic0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function rse(e){var t=TM(e),r=t[0],n=t[1];return(r+n)*3/4-n}function nse(e,t,r){return(t+r)*3/4-r}function ose(e){var t,r=TM(e),n=r[0],o=r[1],i=new ese(nse(e,n,o)),a=0,s=o>0?n-4:n,l;for(l=0;l>16&255,i[a++]=t>>8&255,i[a++]=t&255;return o===2&&(t=qn[e.charCodeAt(l)]<<2|qn[e.charCodeAt(l+1)]>>4,i[a++]=t&255),o===1&&(t=qn[e.charCodeAt(l)]<<10|qn[e.charCodeAt(l+1)]<<4|qn[e.charCodeAt(l+2)]>>2,i[a++]=t>>8&255,i[a++]=t&255),i}function ise(e){return ci[e>>18&63]+ci[e>>12&63]+ci[e>>6&63]+ci[e&63]}function ase(e,t,r){for(var n,o=[],i=t;is?s:a+i));return n===1?(t=e[r-1],o.push(ci[t>>2]+ci[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(ci[t>>10]+ci[t>>4&63]+ci[t<<2&63]+"=")),o.join("")}var D6={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */D6.read=function(e,t,r,n,o){var i,a,s=o*8-n-1,l=(1<>1,c=-7,d=r?o-1:0,f=r?-1:1,p=e[t+d];for(d+=f,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=i*256+e[t+d],d+=f,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=a*256+e[t+d],d+=f,c-=8);if(i===0)i=1-u;else{if(i===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-u}return(p?-1:1)*a*Math.pow(2,i-n)};D6.write=function(e,t,r,n,o,i){var a,s,l,u=i*8-o-1,c=(1<>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,h=n?1:-1,m=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,a=c):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+d>=1?t+=f/l:t+=f*Math.pow(2,1-d),t*l>=2&&(a++,l/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(t*l-1)*Math.pow(2,o),a=a+d):(s=t*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;e[r+p]=s&255,p+=h,s/=256,o-=8);for(a=a<0;e[r+p]=a&255,p+=h,a/=256,u-=8);e[r+p-h]|=m*128};/*! + * The buffer module from node.js, for the browser. + * + * @author Feross Aboukhadijeh + * @license MIT + */(function(e){const t=Cv,r=D6,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=c,e.SlowBuffer=P,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o;const{Uint8Array:i,ArrayBuffer:a,SharedArrayBuffer:s}=globalThis;c.TYPED_ARRAY_SUPPORT=l(),!c.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{const $=new i(1),C={foo:function(){return 42}};return Object.setPrototypeOf(C,i.prototype),Object.setPrototypeOf($,C),$.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function u($){if($>o)throw new RangeError('The value "'+$+'" is invalid for option "size"');const C=new i($);return Object.setPrototypeOf(C,c.prototype),C}function c($,C,k){if(typeof $=="number"){if(typeof C=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return h($)}return d($,C,k)}c.poolSize=8192;function d($,C,k){if(typeof $=="string")return m($,C);if(a.isView($))return y($);if($==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(Ct($,a)||$&&Ct($.buffer,a)||typeof s<"u"&&(Ct($,s)||$&&Ct($.buffer,s)))return w($,C,k);if(typeof $=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const L=$.valueOf&&$.valueOf();if(L!=null&&L!==$)return c.from(L,C,k);const U=S($);if(U)return U;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]=="function")return c.from($[Symbol.toPrimitive]("string"),C,k);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}c.from=function($,C,k){return d($,C,k)},Object.setPrototypeOf(c.prototype,i.prototype),Object.setPrototypeOf(c,i);function f($){if(typeof $!="number")throw new TypeError('"size" argument must be of type number');if($<0)throw new RangeError('The value "'+$+'" is invalid for option "size"')}function p($,C,k){return f($),$<=0?u($):C!==void 0?typeof k=="string"?u($).fill(C,k):u($).fill(C):u($)}c.alloc=function($,C,k){return p($,C,k)};function h($){return f($),u($<0?0:x($)|0)}c.allocUnsafe=function($){return h($)},c.allocUnsafeSlow=function($){return h($)};function m($,C){if((typeof C!="string"||C==="")&&(C="utf8"),!c.isEncoding(C))throw new TypeError("Unknown encoding: "+C);const k=A($,C)|0;let L=u(k);const U=L.write($,C);return U!==k&&(L=L.slice(0,U)),L}function g($){const C=$.length<0?0:x($.length)|0,k=u(C);for(let L=0;L=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return $|0}function P($){return+$!=$&&($=0),c.alloc(+$)}c.isBuffer=function(C){return C!=null&&C._isBuffer===!0&&C!==c.prototype},c.compare=function(C,k){if(Ct(C,i)&&(C=c.from(C,C.offset,C.byteLength)),Ct(k,i)&&(k=c.from(k,k.offset,k.byteLength)),!c.isBuffer(C)||!c.isBuffer(k))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(C===k)return 0;let L=C.length,U=k.length;for(let K=0,ne=Math.min(L,U);KU.length?(c.isBuffer(ne)||(ne=c.from(ne)),ne.copy(U,K)):i.prototype.set.call(U,ne,K);else if(c.isBuffer(ne))ne.copy(U,K);else throw new TypeError('"list" argument must be an Array of Buffers');K+=ne.length}return U};function A($,C){if(c.isBuffer($))return $.length;if(a.isView($)||Ct($,a))return $.byteLength;if(typeof $!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);const k=$.length,L=arguments.length>2&&arguments[2]===!0;if(!L&&k===0)return 0;let U=!1;for(;;)switch(C){case"ascii":case"latin1":case"binary":return k;case"utf8":case"utf-8":return Ke($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return k*2;case"hex":return k>>>1;case"base64":return qt($).length;default:if(U)return L?-1:Ke($).length;C=(""+C).toLowerCase(),U=!0}}c.byteLength=A;function T($,C,k){let L=!1;if((C===void 0||C<0)&&(C=0),C>this.length||((k===void 0||k>this.length)&&(k=this.length),k<=0)||(k>>>=0,C>>>=0,k<=C))return"";for($||($="utf8");;)switch($){case"hex":return V(this,C,k);case"utf8":case"utf-8":return F(this,C,k);case"ascii":return W(this,C,k);case"latin1":case"binary":return H(this,C,k);case"base64":return N(this,C,k);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Q(this,C,k);default:if(L)throw new TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),L=!0}}c.prototype._isBuffer=!0;function I($,C,k){const L=$[C];$[C]=$[k],$[k]=L}c.prototype.swap16=function(){const C=this.length;if(C%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let k=0;kk&&(C+=" ... "),""},n&&(c.prototype[n]=c.prototype.inspect),c.prototype.compare=function(C,k,L,U,K){if(Ct(C,i)&&(C=c.from(C,C.offset,C.byteLength)),!c.isBuffer(C))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof C);if(k===void 0&&(k=0),L===void 0&&(L=C?C.length:0),U===void 0&&(U=0),K===void 0&&(K=this.length),k<0||L>C.length||U<0||K>this.length)throw new RangeError("out of range index");if(U>=K&&k>=L)return 0;if(U>=K)return-1;if(k>=L)return 1;if(k>>>=0,L>>>=0,U>>>=0,K>>>=0,this===C)return 0;let ne=K-U,De=L-k;const tt=Math.min(ne,De),Je=this.slice(U,K),ut=C.slice(k,L);for(let he=0;he2147483647?k=2147483647:k<-2147483648&&(k=-2147483648),k=+k,Lt(k)&&(k=U?0:$.length-1),k<0&&(k=$.length+k),k>=$.length){if(U)return-1;k=$.length-1}else if(k<0)if(U)k=0;else return-1;if(typeof C=="string"&&(C=c.from(C,L)),c.isBuffer(C))return C.length===0?-1:_($,C,k,L,U);if(typeof C=="number")return C=C&255,typeof i.prototype.indexOf=="function"?U?i.prototype.indexOf.call($,C,k):i.prototype.lastIndexOf.call($,C,k):_($,[C],k,L,U);throw new TypeError("val must be string, number or Buffer")}function _($,C,k,L,U){let K=1,ne=$.length,De=C.length;if(L!==void 0&&(L=String(L).toLowerCase(),L==="ucs2"||L==="ucs-2"||L==="utf16le"||L==="utf-16le")){if($.length<2||C.length<2)return-1;K=2,ne/=2,De/=2,k/=2}function tt(ut,he){return K===1?ut[he]:ut.readUInt16BE(he*K)}let Je;if(U){let ut=-1;for(Je=k;Jene&&(k=ne-De),Je=k;Je>=0;Je--){let ut=!0;for(let he=0;heU&&(L=U)):L=U;const K=C.length;L>K/2&&(L=K/2);let ne;for(ne=0;ne>>0,isFinite(L)?(L=L>>>0,U===void 0&&(U="utf8")):(U=L,L=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const K=this.length-k;if((L===void 0||L>K)&&(L=K),C.length>0&&(L<0||k<0)||k>this.length)throw new RangeError("Attempt to write outside buffer bounds");U||(U="utf8");let ne=!1;for(;;)switch(U){case"hex":return R(this,C,k,L);case"utf8":case"utf-8":return E(this,C,k,L);case"ascii":case"latin1":case"binary":return M(this,C,k,L);case"base64":return B(this,C,k,L);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,C,k,L);default:if(ne)throw new TypeError("Unknown encoding: "+U);U=(""+U).toLowerCase(),ne=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function N($,C,k){return C===0&&k===$.length?t.fromByteArray($):t.fromByteArray($.slice(C,k))}function F($,C,k){k=Math.min($.length,k);const L=[];let U=C;for(;U239?4:K>223?3:K>191?2:1;if(U+De<=k){let tt,Je,ut,he;switch(De){case 1:K<128&&(ne=K);break;case 2:tt=$[U+1],(tt&192)===128&&(he=(K&31)<<6|tt&63,he>127&&(ne=he));break;case 3:tt=$[U+1],Je=$[U+2],(tt&192)===128&&(Je&192)===128&&(he=(K&15)<<12|(tt&63)<<6|Je&63,he>2047&&(he<55296||he>57343)&&(ne=he));break;case 4:tt=$[U+1],Je=$[U+2],ut=$[U+3],(tt&192)===128&&(Je&192)===128&&(ut&192)===128&&(he=(K&15)<<18|(tt&63)<<12|(Je&63)<<6|ut&63,he>65535&&he<1114112&&(ne=he))}}ne===null?(ne=65533,De=1):ne>65535&&(ne-=65536,L.push(ne>>>10&1023|55296),ne=56320|ne&1023),L.push(ne),U+=De}return z(L)}const D=4096;function z($){const C=$.length;if(C<=D)return String.fromCharCode.apply(String,$);let k="",L=0;for(;LL)&&(k=L);let U="";for(let K=C;KL&&(C=L),k<0?(k+=L,k<0&&(k=0)):k>L&&(k=L),kk)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(C,k,L){C=C>>>0,k=k>>>0,L||re(C,k,this.length);let U=this[C],K=1,ne=0;for(;++ne>>0,k=k>>>0,L||re(C,k,this.length);let U=this[C+--k],K=1;for(;k>0&&(K*=256);)U+=this[C+--k]*K;return U},c.prototype.readUint8=c.prototype.readUInt8=function(C,k){return C=C>>>0,k||re(C,1,this.length),this[C]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(C,k){return C=C>>>0,k||re(C,2,this.length),this[C]|this[C+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(C,k){return C=C>>>0,k||re(C,2,this.length),this[C]<<8|this[C+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(C,k){return C=C>>>0,k||re(C,4,this.length),(this[C]|this[C+1]<<8|this[C+2]<<16)+this[C+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(C,k){return C=C>>>0,k||re(C,4,this.length),this[C]*16777216+(this[C+1]<<16|this[C+2]<<8|this[C+3])},c.prototype.readBigUInt64LE=bt(function(C){C=C>>>0,ye(C,"offset");const k=this[C],L=this[C+7];(k===void 0||L===void 0)&&Pe(C,this.length-8);const U=k+this[++C]*2**8+this[++C]*2**16+this[++C]*2**24,K=this[++C]+this[++C]*2**8+this[++C]*2**16+L*2**24;return BigInt(U)+(BigInt(K)<>>0,ye(C,"offset");const k=this[C],L=this[C+7];(k===void 0||L===void 0)&&Pe(C,this.length-8);const U=k*2**24+this[++C]*2**16+this[++C]*2**8+this[++C],K=this[++C]*2**24+this[++C]*2**16+this[++C]*2**8+L;return(BigInt(U)<>>0,k=k>>>0,L||re(C,k,this.length);let U=this[C],K=1,ne=0;for(;++ne=K&&(U-=Math.pow(2,8*k)),U},c.prototype.readIntBE=function(C,k,L){C=C>>>0,k=k>>>0,L||re(C,k,this.length);let U=k,K=1,ne=this[C+--U];for(;U>0&&(K*=256);)ne+=this[C+--U]*K;return K*=128,ne>=K&&(ne-=Math.pow(2,8*k)),ne},c.prototype.readInt8=function(C,k){return C=C>>>0,k||re(C,1,this.length),this[C]&128?(255-this[C]+1)*-1:this[C]},c.prototype.readInt16LE=function(C,k){C=C>>>0,k||re(C,2,this.length);const L=this[C]|this[C+1]<<8;return L&32768?L|4294901760:L},c.prototype.readInt16BE=function(C,k){C=C>>>0,k||re(C,2,this.length);const L=this[C+1]|this[C]<<8;return L&32768?L|4294901760:L},c.prototype.readInt32LE=function(C,k){return C=C>>>0,k||re(C,4,this.length),this[C]|this[C+1]<<8|this[C+2]<<16|this[C+3]<<24},c.prototype.readInt32BE=function(C,k){return C=C>>>0,k||re(C,4,this.length),this[C]<<24|this[C+1]<<16|this[C+2]<<8|this[C+3]},c.prototype.readBigInt64LE=bt(function(C){C=C>>>0,ye(C,"offset");const k=this[C],L=this[C+7];(k===void 0||L===void 0)&&Pe(C,this.length-8);const U=this[C+4]+this[C+5]*2**8+this[C+6]*2**16+(L<<24);return(BigInt(U)<>>0,ye(C,"offset");const k=this[C],L=this[C+7];(k===void 0||L===void 0)&&Pe(C,this.length-8);const U=(k<<24)+this[++C]*2**16+this[++C]*2**8+this[++C];return(BigInt(U)<>>0,k||re(C,4,this.length),r.read(this,C,!0,23,4)},c.prototype.readFloatBE=function(C,k){return C=C>>>0,k||re(C,4,this.length),r.read(this,C,!1,23,4)},c.prototype.readDoubleLE=function(C,k){return C=C>>>0,k||re(C,8,this.length),r.read(this,C,!0,52,8)},c.prototype.readDoubleBE=function(C,k){return C=C>>>0,k||re(C,8,this.length),r.read(this,C,!1,52,8)};function Y($,C,k,L,U,K){if(!c.isBuffer($))throw new TypeError('"buffer" argument must be a Buffer instance');if(C>U||C$.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(C,k,L,U){if(C=+C,k=k>>>0,L=L>>>0,!U){const De=Math.pow(2,8*L)-1;Y(this,C,k,L,De,0)}let K=1,ne=0;for(this[k]=C&255;++ne>>0,L=L>>>0,!U){const De=Math.pow(2,8*L)-1;Y(this,C,k,L,De,0)}let K=L-1,ne=1;for(this[k+K]=C&255;--K>=0&&(ne*=256);)this[k+K]=C/ne&255;return k+L},c.prototype.writeUint8=c.prototype.writeUInt8=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,1,255,0),this[k]=C&255,k+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,2,65535,0),this[k]=C&255,this[k+1]=C>>>8,k+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,2,65535,0),this[k]=C>>>8,this[k+1]=C&255,k+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,4,4294967295,0),this[k+3]=C>>>24,this[k+2]=C>>>16,this[k+1]=C>>>8,this[k]=C&255,k+4},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,4,4294967295,0),this[k]=C>>>24,this[k+1]=C>>>16,this[k+2]=C>>>8,this[k+3]=C&255,k+4};function Z($,C,k,L,U){ue(C,L,U,$,k,7);let K=Number(C&BigInt(4294967295));$[k++]=K,K=K>>8,$[k++]=K,K=K>>8,$[k++]=K,K=K>>8,$[k++]=K;let ne=Number(C>>BigInt(32)&BigInt(4294967295));return $[k++]=ne,ne=ne>>8,$[k++]=ne,ne=ne>>8,$[k++]=ne,ne=ne>>8,$[k++]=ne,k}function ie($,C,k,L,U){ue(C,L,U,$,k,7);let K=Number(C&BigInt(4294967295));$[k+7]=K,K=K>>8,$[k+6]=K,K=K>>8,$[k+5]=K,K=K>>8,$[k+4]=K;let ne=Number(C>>BigInt(32)&BigInt(4294967295));return $[k+3]=ne,ne=ne>>8,$[k+2]=ne,ne=ne>>8,$[k+1]=ne,ne=ne>>8,$[k]=ne,k+8}c.prototype.writeBigUInt64LE=bt(function(C,k=0){return Z(this,C,k,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeBigUInt64BE=bt(function(C,k=0){return ie(this,C,k,BigInt(0),BigInt("0xffffffffffffffff"))}),c.prototype.writeIntLE=function(C,k,L,U){if(C=+C,k=k>>>0,!U){const tt=Math.pow(2,8*L-1);Y(this,C,k,L,tt-1,-tt)}let K=0,ne=1,De=0;for(this[k]=C&255;++K>0)-De&255;return k+L},c.prototype.writeIntBE=function(C,k,L,U){if(C=+C,k=k>>>0,!U){const tt=Math.pow(2,8*L-1);Y(this,C,k,L,tt-1,-tt)}let K=L-1,ne=1,De=0;for(this[k+K]=C&255;--K>=0&&(ne*=256);)C<0&&De===0&&this[k+K+1]!==0&&(De=1),this[k+K]=(C/ne>>0)-De&255;return k+L},c.prototype.writeInt8=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,1,127,-128),C<0&&(C=255+C+1),this[k]=C&255,k+1},c.prototype.writeInt16LE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,2,32767,-32768),this[k]=C&255,this[k+1]=C>>>8,k+2},c.prototype.writeInt16BE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,2,32767,-32768),this[k]=C>>>8,this[k+1]=C&255,k+2},c.prototype.writeInt32LE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,4,2147483647,-2147483648),this[k]=C&255,this[k+1]=C>>>8,this[k+2]=C>>>16,this[k+3]=C>>>24,k+4},c.prototype.writeInt32BE=function(C,k,L){return C=+C,k=k>>>0,L||Y(this,C,k,4,2147483647,-2147483648),C<0&&(C=4294967295+C+1),this[k]=C>>>24,this[k+1]=C>>>16,this[k+2]=C>>>8,this[k+3]=C&255,k+4},c.prototype.writeBigInt64LE=bt(function(C,k=0){return Z(this,C,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),c.prototype.writeBigInt64BE=bt(function(C,k=0){return ie(this,C,k,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function me($,C,k,L,U,K){if(k+L>$.length)throw new RangeError("Index out of range");if(k<0)throw new RangeError("Index out of range")}function G($,C,k,L,U){return C=+C,k=k>>>0,U||me($,C,k,4),r.write($,C,k,L,23,4),k+4}c.prototype.writeFloatLE=function(C,k,L){return G(this,C,k,!0,L)},c.prototype.writeFloatBE=function(C,k,L){return G(this,C,k,!1,L)};function oe($,C,k,L,U){return C=+C,k=k>>>0,U||me($,C,k,8),r.write($,C,k,L,52,8),k+8}c.prototype.writeDoubleLE=function(C,k,L){return oe(this,C,k,!0,L)},c.prototype.writeDoubleBE=function(C,k,L){return oe(this,C,k,!1,L)},c.prototype.copy=function(C,k,L,U){if(!c.isBuffer(C))throw new TypeError("argument should be a Buffer");if(L||(L=0),!U&&U!==0&&(U=this.length),k>=C.length&&(k=C.length),k||(k=0),U>0&&U=this.length)throw new RangeError("Index out of range");if(U<0)throw new RangeError("sourceEnd out of bounds");U>this.length&&(U=this.length),C.length-k>>0,L=L===void 0?this.length:L>>>0,C||(C=0);let K;if(typeof C=="number")for(K=k;K2**32?U=Ee(String(k)):typeof k=="bigint"&&(U=String(k),(k>BigInt(2)**BigInt(32)||k<-(BigInt(2)**BigInt(32)))&&(U=Ee(U)),U+="n"),L+=` It must be ${C}. Received ${U}`,L},RangeError);function Ee($){let C="",k=$.length;const L=$[0]==="-"?1:0;for(;k>=L+4;k-=3)C=`_${$.slice(k-3,k)}${C}`;return`${$.slice(0,k)}${C}`}function ce($,C,k){ye(C,"offset"),($[C]===void 0||$[C+k]===void 0)&&Pe(C,$.length-(k+1))}function ue($,C,k,L,U,K){if($>k||$= 0${ne} and < 2${ne} ** ${(K+1)*8}${ne}`:De=`>= -(2${ne} ** ${(K+1)*8-1}${ne}) and < 2 ** ${(K+1)*8-1}${ne}`,new de.ERR_OUT_OF_RANGE("value",De,$)}ce(L,U,K)}function ye($,C){if(typeof $!="number")throw new de.ERR_INVALID_ARG_TYPE(C,"number",$)}function Pe($,C,k){throw Math.floor($)!==$?(ye($,k),new de.ERR_OUT_OF_RANGE("offset","an integer",$)):C<0?new de.ERR_BUFFER_OUT_OF_BOUNDS:new de.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${C}`,$)}const Ne=/[^+/0-9A-Za-z-_]/g;function Ue($){if($=$.split("=")[0],$=$.trim().replace(Ne,""),$.length<2)return"";for(;$.length%4!==0;)$=$+"=";return $}function Ke($,C){C=C||1/0;let k;const L=$.length;let U=null;const K=[];for(let ne=0;ne55295&&k<57344){if(!U){if(k>56319){(C-=3)>-1&&K.push(239,191,189);continue}else if(ne+1===L){(C-=3)>-1&&K.push(239,191,189);continue}U=k;continue}if(k<56320){(C-=3)>-1&&K.push(239,191,189),U=k;continue}k=(U-55296<<10|k-56320)+65536}else U&&(C-=3)>-1&&K.push(239,191,189);if(U=null,k<128){if((C-=1)<0)break;K.push(k)}else if(k<2048){if((C-=2)<0)break;K.push(k>>6|192,k&63|128)}else if(k<65536){if((C-=3)<0)break;K.push(k>>12|224,k>>6&63|128,k&63|128)}else if(k<1114112){if((C-=4)<0)break;K.push(k>>18|240,k>>12&63|128,k>>6&63|128,k&63|128)}else throw new Error("Invalid code point")}return K}function We($){const C=[];for(let k=0;k<$.length;++k)C.push($.charCodeAt(k)&255);return C}function Ae($,C){let k,L,U;const K=[];for(let ne=0;ne<$.length&&!((C-=2)<0);++ne)k=$.charCodeAt(ne),L=k>>8,U=k%256,K.push(U),K.push(L);return K}function qt($){return t.toByteArray(Ue($))}function Xe($,C,k,L){let U;for(U=0;U=C.length||U>=$.length);++U)C[U+k]=$[U];return U}function Ct($,C){return $ instanceof C||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===C.name}function Lt($){return $!==$}const Kt=function(){const $="0123456789abcdef",C=new Array(256);for(let k=0;k<16;++k){const L=k*16;for(let U=0;U<16;++U)C[L+U]=$[k]+$[U]}return C}();function bt($){return typeof BigInt>"u"?or:$}function or(){throw new Error("BigInt not supported")}})(kM);const fT=kM.Buffer;function lse(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var IM={exports:{}},Qt=IM.exports={},ti,ri;function s2(){throw new Error("setTimeout has not been defined")}function l2(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?ti=setTimeout:ti=s2}catch{ti=s2}try{typeof clearTimeout=="function"?ri=clearTimeout:ri=l2}catch{ri=l2}})();function OM(e){if(ti===setTimeout)return setTimeout(e,0);if((ti===s2||!ti)&&setTimeout)return ti=setTimeout,setTimeout(e,0);try{return ti(e,0)}catch{try{return ti.call(null,e,0)}catch{return ti.call(this,e,0)}}}function cse(e){if(ri===clearTimeout)return clearTimeout(e);if((ri===l2||!ri)&&clearTimeout)return ri=clearTimeout,clearTimeout(e);try{return ri(e)}catch{try{return ri.call(null,e)}catch{return ri.call(this,e)}}}var Vi=[],Yc=!1,cl,q0=-1;function use(){!Yc||!cl||(Yc=!1,cl.length?Vi=cl.concat(Vi):q0=-1,Vi.length&&_M())}function _M(){if(!Yc){var e=OM(use);Yc=!0;for(var t=Vi.length;t;){for(cl=Vi,Vi=[];++q01)for(var r=1;r{const[t,r]=v.useState(null),[n,o]=v.useState(null),[i,a]=v.useState(null),[s,l]=v.useState(!1),u=v.useRef(null),c=v.useRef(null);v.useEffect(()=>{(async()=>{{l(!0);return}})()},[]);const d=v.useCallback(async h=>{if(!t)throw new Error("Web3Auth not ready");const m=(h==null?void 0:h.loginProvider)??"github";try{await u.current}catch{}const g=c.current;if(!g)throw new Error("Web3Auth auth adapter missing");const y=await t.connectTo(g,{loginProvider:m});o(y);const w=await mse(y);a(w)},[t]),f=v.useCallback(async()=>{t&&(await t.logout(),o(null),a(null))},[t]),p=v.useMemo(()=>({web3auth:t,provider:n,eoaAddress:i,ready:s,connect:d,disconnect:f}),[t,n,i,s,d,f]);return b.jsx(RM.Provider,{value:p,children:e})};function hse(){const e=v.useContext(RM);if(!e)throw new Error("useWeb3Auth must be used within Web3AuthProvider");return e}async function mse(e){if(!e)return null;try{const t=await e.request({method:"eth_accounts"});if(t!=null&&t.length)return t[0];const r=await e.request({method:"eth_requestAccounts"});return(r==null?void 0:r[0])??null}catch{return null}}var ot;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{const i={};for(const a of o)i[a]=a;return i},e.getValidEnumValues=o=>{const i=e.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(const s of i)a[s]=o[s];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{const i=[];for(const a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(const a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=n,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(ot||(ot={}));var pT;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(pT||(pT={}));const Ie=ot.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),La=e=>{switch(typeof e){case"undefined":return Ie.undefined;case"string":return Ie.string;case"number":return Number.isNaN(e)?Ie.nan:Ie.number;case"boolean":return Ie.boolean;case"function":return Ie.function;case"bigint":return Ie.bigint;case"symbol":return Ie.symbol;case"object":return Array.isArray(e)?Ie.array:e===null?Ie.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?Ie.promise:typeof Map<"u"&&e instanceof Map?Ie.map:typeof Set<"u"&&e instanceof Set?Ie.set:typeof Date<"u"&&e instanceof Date?Ie.date:Ie.object;default:return Ie.unknown}},pe=ot.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class la extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){const r=t||function(i){return i.message},n={_errors:[]},o=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,l=0;for(;lr.message){const r={},n=[];for(const o of this.issues)if(o.path.length>0){const i=o.path[0];r[i]=r[i]||[],r[i].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}la.create=e=>new la(e);const c2=(e,t)=>{let r;switch(e.code){case pe.invalid_type:e.received===Ie.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case pe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,ot.jsonStringifyReplacer)}`;break;case pe.unrecognized_keys:r=`Unrecognized key(s) in object: ${ot.joinValues(e.keys,", ")}`;break;case pe.invalid_union:r="Invalid input";break;case pe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ot.joinValues(e.options)}`;break;case pe.invalid_enum_value:r=`Invalid enum value. Expected ${ot.joinValues(e.options)}, received '${e.received}'`;break;case pe.invalid_arguments:r="Invalid function arguments";break;case pe.invalid_return_type:r="Invalid function return type";break;case pe.invalid_date:r="Invalid date";break;case pe.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:ot.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case pe.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case pe.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case pe.custom:r="Invalid input";break;case pe.invalid_intersection_types:r="Intersection results could not be merged";break;case pe.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case pe.not_finite:r="Number must be finite";break;default:r=t.defaultError,ot.assertNever(e)}return{message:r}};let gse=c2;function yse(){return gse}const vse=e=>{const{data:t,path:r,errorMaps:n,issueData:o}=e,i=[...r,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)s=u(a,{data:t,defaultError:s}).message;return{...o,path:i,message:s}};function ve(e,t){const r=yse(),n=vse({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===c2?void 0:c2].filter(o=>!!o)});e.common.issues.push(n)}class jn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){const n=[];for(const o of r){if(o.status==="aborted")return ze;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static async mergeObjectAsync(t,r){const n=[];for(const o of r){const i=await o.key,a=await o.value;n.push({key:i,value:a})}return jn.mergeObjectSync(t,n)}static mergeObjectSync(t,r){const n={};for(const o of r){const{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return ze;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:t.value,value:n}}}const ze=Object.freeze({status:"aborted"}),Zd=e=>({status:"dirty",value:e}),mo=e=>({status:"valid",value:e}),hT=e=>e.status==="aborted",mT=e=>e.status==="dirty",Pu=e=>e.status==="valid",qm=e=>typeof Promise<"u"&&e instanceof Promise;var Re;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t==null?void 0:t.message})(Re||(Re={}));class vs{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const gT=(e,t)=>{if(Pu(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new la(e.common.issues);return this._error=r,this._error}}};function qe(e){if(!e)return{};const{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,s)=>{const{message:l}=e;return a.code==="invalid_enum_value"?{message:l??s.defaultError}:typeof s.data>"u"?{message:l??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:l??r??s.defaultError}},description:o}}class nt{get description(){return this._def.description}_getType(t){return La(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:La(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new jn,ctx:{common:t.parent.common,data:t.data,parsedType:La(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){const r=this._parse(t);if(qm(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){const r=this._parse(t);return Promise.resolve(r)}parse(t,r){const n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:La(t)},o=this._parseSync({data:t,path:n.path,parent:n});return gT(n,o)}"~validate"(t){var n,o;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:La(t)};if(!this["~standard"].async)try{const i=this._parseSync({data:t,path:[],parent:r});return Pu(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(o=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&o.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(i=>Pu(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(t,r){const n=await this.safeParseAsync(t,r);if(n.success)return n.data;throw n.error}async safeParseAsync(t,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:La(t)},o=this._parse({data:t,path:n.path,parent:n}),i=await(qm(o)?o:Promise.resolve(o));return gT(n,i)}refine(t,r){const n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{const a=t(o),s=()=>i.addIssue({code:pe.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Tu({schema:this,typeName:Fe.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return ss.create(this,this._def)}nullable(){return Iu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Si.create(this)}promise(){return Xm.create(this,this._def)}or(t){return Zm.create([this,t],this._def)}and(t){return Ym.create(this,t,this._def)}transform(t){return new Tu({...qe(this._def),schema:this,typeName:Fe.ZodEffects,effect:{type:"transform",transform:t}})}default(t){const r=typeof t=="function"?t:()=>t;return new f2({...qe(this._def),innerType:this,defaultValue:r,typeName:Fe.ZodDefault})}brand(){return new Fse({typeName:Fe.ZodBranded,type:this,...qe(this._def)})}catch(t){const r=typeof t=="function"?t:()=>t;return new p2({...qe(this._def),innerType:this,catchValue:r,typeName:Fe.ZodCatch})}describe(t){const r=this.constructor;return new r({...this._def,description:t})}pipe(t){return z6.create(this,t)}readonly(){return h2.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const bse=/^c[^\s-]{8,}$/i,wse=/^[0-9a-z]+$/,xse=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Sse=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Cse=/^[a-z0-9_-]{21}$/i,Ese=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Pse=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ase=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,kse="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let T1;const Tse=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Ise=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Ose=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,_se=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,$se=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Rse=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,jM="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",jse=new RegExp(`^${jM}$`);function MM(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);const r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function Mse(e){return new RegExp(`^${MM(e)}$`)}function Nse(e){let t=`${jM}T${MM(e)}`;const r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function Bse(e,t){return!!((t==="v4"||!t)&&Tse.test(e)||(t==="v6"||!t)&&Ose.test(e))}function Lse(e,t){if(!Ese.test(e))return!1;try{const[r]=e.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&(o==null?void 0:o.typ)!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function Dse(e,t){return!!((t==="v4"||!t)&&Ise.test(e)||(t==="v6"||!t)&&_se.test(e))}class Ga extends nt{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==Ie.string){const i=this._getOrReturnCtx(t);return ve(i,{code:pe.invalid_type,expected:Ie.string,received:i.parsedType}),ze}const n=new jn;let o;for(const i of this._def.checks)if(i.kind==="min")t.data.lengthi.value&&(o=this._getOrReturnCtx(t,o),ve(o,{code:pe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const a=t.data.length>i.value,s=t.data.lengtht.test(o),{validation:r,code:pe.invalid_string,...Re.errToObj(n)})}_addCheck(t){return new Ga({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Re.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Re.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Re.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Re.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...Re.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Re.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Re.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Re.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...Re.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...Re.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...Re.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Re.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...Re.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,offset:(t==null?void 0:t.offset)??!1,local:(t==null?void 0:t.local)??!1,...Re.errToObj(t==null?void 0:t.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof(t==null?void 0:t.precision)>"u"?null:t==null?void 0:t.precision,...Re.errToObj(t==null?void 0:t.message)})}duration(t){return this._addCheck({kind:"duration",...Re.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...Re.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r==null?void 0:r.position,...Re.errToObj(r==null?void 0:r.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...Re.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...Re.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...Re.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...Re.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...Re.errToObj(r)})}nonempty(t){return this.min(1,Re.errToObj(t))}trim(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ga({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Ga({checks:[],typeName:Fe.ZodString,coerce:(e==null?void 0:e.coerce)??!1,...qe(e)});function zse(e,t){const r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(e.toFixed(o).replace(".","")),a=Number.parseInt(t.toFixed(o).replace(".",""));return i%a/10**o}class Au extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==Ie.number){const i=this._getOrReturnCtx(t);return ve(i,{code:pe.invalid_type,expected:Ie.number,received:i.parsedType}),ze}let n;const o=new jn;for(const i of this._def.checks)i.kind==="int"?ot.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ve(n,{code:pe.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ve(n,{code:pe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?zse(t.data,i.value)!==0&&(n=this._getOrReturnCtx(t,n),ve(n,{code:pe.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ve(n,{code:pe.not_finite,message:i.message}),o.dirty()):ot.assertNever(i);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,Re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Re.toString(r))}setLimit(t,r,n,o){return new Au({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Re.toString(o)}]})}_addCheck(t){return new Au({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Re.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Re.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:Re.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Re.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Re.toString(t)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuet.kind==="int"||t.kind==="multipleOf"&&ot.isInteger(t.value))}get isFinite(){let t=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.valuenew Au({checks:[],typeName:Fe.ZodNumber,coerce:(e==null?void 0:e.coerce)||!1,...qe(e)});class gp extends nt{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==Ie.bigint)return this._getInvalidInput(t);let n;const o=new jn;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?t.datai.value:t.data>=i.value)&&(n=this._getOrReturnCtx(t,n),ve(n,{code:pe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ve(n,{code:pe.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):ot.assertNever(i);return{status:o.value,value:t.data}}_getInvalidInput(t){const r=this._getOrReturnCtx(t);return ve(r,{code:pe.invalid_type,expected:Ie.bigint,received:r.parsedType}),ze}gte(t,r){return this.setLimit("min",t,!0,Re.toString(r))}gt(t,r){return this.setLimit("min",t,!1,Re.toString(r))}lte(t,r){return this.setLimit("max",t,!0,Re.toString(r))}lt(t,r){return this.setLimit("max",t,!1,Re.toString(r))}setLimit(t,r,n,o){return new gp({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:Re.toString(o)}]})}_addCheck(t){return new gp({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Re.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Re.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Re.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Re.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:Re.toString(r)})}get minValue(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew gp({checks:[],typeName:Fe.ZodBigInt,coerce:(e==null?void 0:e.coerce)??!1,...qe(e)});class u2 extends nt{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==Ie.boolean){const n=this._getOrReturnCtx(t);return ve(n,{code:pe.invalid_type,expected:Ie.boolean,received:n.parsedType}),ze}return mo(t.data)}}u2.create=e=>new u2({typeName:Fe.ZodBoolean,coerce:(e==null?void 0:e.coerce)||!1,...qe(e)});class Km extends nt{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==Ie.date){const i=this._getOrReturnCtx(t);return ve(i,{code:pe.invalid_type,expected:Ie.date,received:i.parsedType}),ze}if(Number.isNaN(t.data.getTime())){const i=this._getOrReturnCtx(t);return ve(i,{code:pe.invalid_date}),ze}const n=new jn;let o;for(const i of this._def.checks)i.kind==="min"?t.data.getTime()i.value&&(o=this._getOrReturnCtx(t,o),ve(o,{code:pe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):ot.assertNever(i);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new Km({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:Re.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:Re.toString(r)})}get minDate(){let t=null;for(const r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(const r of this._def.checks)r.kind==="max"&&(t===null||r.valuenew Km({checks:[],coerce:(e==null?void 0:e.coerce)||!1,typeName:Fe.ZodDate,...qe(e)});class yT extends nt{_parse(t){if(this._getType(t)!==Ie.symbol){const n=this._getOrReturnCtx(t);return ve(n,{code:pe.invalid_type,expected:Ie.symbol,received:n.parsedType}),ze}return mo(t.data)}}yT.create=e=>new yT({typeName:Fe.ZodSymbol,...qe(e)});class vT extends nt{_parse(t){if(this._getType(t)!==Ie.undefined){const n=this._getOrReturnCtx(t);return ve(n,{code:pe.invalid_type,expected:Ie.undefined,received:n.parsedType}),ze}return mo(t.data)}}vT.create=e=>new vT({typeName:Fe.ZodUndefined,...qe(e)});class bT extends nt{_parse(t){if(this._getType(t)!==Ie.null){const n=this._getOrReturnCtx(t);return ve(n,{code:pe.invalid_type,expected:Ie.null,received:n.parsedType}),ze}return mo(t.data)}}bT.create=e=>new bT({typeName:Fe.ZodNull,...qe(e)});class wT extends nt{constructor(){super(...arguments),this._any=!0}_parse(t){return mo(t.data)}}wT.create=e=>new wT({typeName:Fe.ZodAny,...qe(e)});class xT extends nt{constructor(){super(...arguments),this._unknown=!0}_parse(t){return mo(t.data)}}xT.create=e=>new xT({typeName:Fe.ZodUnknown,...qe(e)});class bs extends nt{_parse(t){const r=this._getOrReturnCtx(t);return ve(r,{code:pe.invalid_type,expected:Ie.never,received:r.parsedType}),ze}}bs.create=e=>new bs({typeName:Fe.ZodNever,...qe(e)});class ST extends nt{_parse(t){if(this._getType(t)!==Ie.undefined){const n=this._getOrReturnCtx(t);return ve(n,{code:pe.invalid_type,expected:Ie.void,received:n.parsedType}),ze}return mo(t.data)}}ST.create=e=>new ST({typeName:Fe.ZodVoid,...qe(e)});class Si extends nt{_parse(t){const{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==Ie.array)return ve(r,{code:pe.invalid_type,expected:Ie.array,received:r.parsedType}),ze;if(o.exactLength!==null){const a=r.data.length>o.exactLength.value,s=r.data.lengtho.maxLength.value&&(ve(r,{code:pe.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>o.type._parseAsync(new vs(r,a,r.path,s)))).then(a=>jn.mergeArray(n,a));const i=[...r.data].map((a,s)=>o.type._parseSync(new vs(r,a,r.path,s)));return jn.mergeArray(n,i)}get element(){return this._def.type}min(t,r){return new Si({...this._def,minLength:{value:t,message:Re.toString(r)}})}max(t,r){return new Si({...this._def,maxLength:{value:t,message:Re.toString(r)}})}length(t,r){return new Si({...this._def,exactLength:{value:t,message:Re.toString(r)}})}nonempty(t){return this.min(1,t)}}Si.create=(e,t)=>new Si({type:e,minLength:null,maxLength:null,exactLength:null,typeName:Fe.ZodArray,...qe(t)});function hc(e){if(e instanceof Jt){const t={};for(const r in e.shape){const n=e.shape[r];t[r]=ss.create(hc(n))}return new Jt({...e._def,shape:()=>t})}else return e instanceof Si?new Si({...e._def,type:hc(e.element)}):e instanceof ss?ss.create(hc(e.unwrap())):e instanceof Iu?Iu.create(hc(e.unwrap())):e instanceof Nl?Nl.create(e.items.map(t=>hc(t))):e}class Jt extends nt{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const t=this._def.shape(),r=ot.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==Ie.object){const u=this._getOrReturnCtx(t);return ve(u,{code:pe.invalid_type,expected:Ie.object,received:u.parsedType}),ze}const{status:n,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof bs&&this._def.unknownKeys==="strip"))for(const u in o.data)a.includes(u)||s.push(u);const l=[];for(const u of a){const c=i[u],d=o.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new vs(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof bs){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of s)l.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(u==="strict")s.length>0&&(ve(o,{code:pe.unrecognized_keys,keys:s}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of s){const d=o.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new vs(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>jn.mergeObjectSync(n,u)):jn.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(t){return Re.errToObj,new Jt({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(r,n)=>{var i,a;const o=((a=(i=this._def).errorMap)==null?void 0:a.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:Re.errToObj(t).message??o}:{message:o}}}:{}})}strip(){return new Jt({...this._def,unknownKeys:"strip"})}passthrough(){return new Jt({...this._def,unknownKeys:"passthrough"})}extend(t){return new Jt({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new Jt({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:Fe.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new Jt({...this._def,catchall:t})}pick(t){const r={};for(const n of ot.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Jt({...this._def,shape:()=>r})}omit(t){const r={};for(const n of ot.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new Jt({...this._def,shape:()=>r})}deepPartial(){return hc(this)}partial(t){const r={};for(const n of ot.objectKeys(this.shape)){const o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new Jt({...this._def,shape:()=>r})}required(t){const r={};for(const n of ot.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof ss;)i=i._def.innerType;r[n]=i}return new Jt({...this._def,shape:()=>r})}keyof(){return NM(ot.objectKeys(this.shape))}}Jt.create=(e,t)=>new Jt({shape:()=>e,unknownKeys:"strip",catchall:bs.create(),typeName:Fe.ZodObject,...qe(t)});Jt.strictCreate=(e,t)=>new Jt({shape:()=>e,unknownKeys:"strict",catchall:bs.create(),typeName:Fe.ZodObject,...qe(t)});Jt.lazycreate=(e,t)=>new Jt({shape:e,unknownKeys:"strip",catchall:bs.create(),typeName:Fe.ZodObject,...qe(t)});class Zm extends nt{_parse(t){const{ctx:r}=this._processInputParams(t),n=this._def.options;function o(i){for(const s of i)if(s.result.status==="valid")return s.result;for(const s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;const a=i.map(s=>new la(s.ctx.common.issues));return ve(r,{code:pe.invalid_union,unionErrors:a}),ze}if(r.common.async)return Promise.all(n.map(async i=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(o);{let i;const a=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;const s=a.map(l=>new la(l));return ve(r,{code:pe.invalid_union,unionErrors:s}),ze}}get options(){return this._def.options}}Zm.create=(e,t)=>new Zm({options:e,typeName:Fe.ZodUnion,...qe(t)});function d2(e,t){const r=La(e),n=La(t);if(e===t)return{valid:!0,data:e};if(r===Ie.object&&n===Ie.object){const o=ot.objectKeys(t),i=ot.objectKeys(e).filter(s=>o.indexOf(s)!==-1),a={...e,...t};for(const s of i){const l=d2(e[s],t[s]);if(!l.valid)return{valid:!1};a[s]=l.data}return{valid:!0,data:a}}else if(r===Ie.array&&n===Ie.array){if(e.length!==t.length)return{valid:!1};const o=[];for(let i=0;i{if(hT(i)||hT(a))return ze;const s=d2(i.value,a.value);return s.valid?((mT(i)||mT(a))&&r.dirty(),{status:r.value,value:s.data}):(ve(n,{code:pe.invalid_intersection_types}),ze)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}Ym.create=(e,t,r)=>new Ym({left:e,right:t,typeName:Fe.ZodIntersection,...qe(r)});class Nl extends nt{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ie.array)return ve(n,{code:pe.invalid_type,expected:Ie.array,received:n.parsedType}),ze;if(n.data.lengththis._def.items.length&&(ve(n,{code:pe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((a,s)=>{const l=this._def.items[s]||this._def.rest;return l?l._parse(new vs(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>jn.mergeArray(r,a)):jn.mergeArray(r,i)}get items(){return this._def.items}rest(t){return new Nl({...this._def,rest:t})}}Nl.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Nl({items:e,typeName:Fe.ZodTuple,rest:null,...qe(t)})};class CT extends nt{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ie.map)return ve(n,{code:pe.invalid_type,expected:Ie.map,received:n.parsedType}),ze;const o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,l],u)=>({key:o._parse(new vs(n,s,n.path,[u,"key"])),value:i._parse(new vs(n,l,n.path,[u,"value"]))}));if(n.common.async){const s=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return ze;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),s.set(u.value,c.value)}return{status:r.value,value:s}})}else{const s=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return ze;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),s.set(u.value,c.value)}return{status:r.value,value:s}}}}CT.create=(e,t,r)=>new CT({valueType:t,keyType:e,typeName:Fe.ZodMap,...qe(r)});class yp extends nt{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==Ie.set)return ve(n,{code:pe.invalid_type,expected:Ie.set,received:n.parsedType}),ze;const o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(ve(n,{code:pe.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());const i=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return ze;c.status==="dirty"&&r.dirty(),u.add(c.value)}return{status:r.value,value:u}}const s=[...n.data.values()].map((l,u)=>i._parse(new vs(n,l,n.path,u)));return n.common.async?Promise.all(s).then(l=>a(l)):a(s)}min(t,r){return new yp({...this._def,minSize:{value:t,message:Re.toString(r)}})}max(t,r){return new yp({...this._def,maxSize:{value:t,message:Re.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}}yp.create=(e,t)=>new yp({valueType:e,minSize:null,maxSize:null,typeName:Fe.ZodSet,...qe(t)});class ET extends nt{get schema(){return this._def.getter()}_parse(t){const{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}ET.create=(e,t)=>new ET({getter:e,typeName:Fe.ZodLazy,...qe(t)});class PT extends nt{_parse(t){if(t.data!==this._def.value){const r=this._getOrReturnCtx(t);return ve(r,{received:r.data,code:pe.invalid_literal,expected:this._def.value}),ze}return{status:"valid",value:t.data}}get value(){return this._def.value}}PT.create=(e,t)=>new PT({value:e,typeName:Fe.ZodLiteral,...qe(t)});function NM(e,t){return new ku({values:e,typeName:Fe.ZodEnum,...qe(t)})}class ku extends nt{_parse(t){if(typeof t.data!="string"){const r=this._getOrReturnCtx(t),n=this._def.values;return ve(r,{expected:ot.joinValues(n),received:r.parsedType,code:pe.invalid_type}),ze}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const r=this._getOrReturnCtx(t),n=this._def.values;return ve(r,{received:r.data,code:pe.invalid_enum_value,options:n}),ze}return mo(t.data)}get options(){return this._def.values}get enum(){const t={};for(const r of this._def.values)t[r]=r;return t}get Values(){const t={};for(const r of this._def.values)t[r]=r;return t}get Enum(){const t={};for(const r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return ku.create(t,{...this._def,...r})}exclude(t,r=this._def){return ku.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}}ku.create=NM;class AT extends nt{_parse(t){const r=ot.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==Ie.string&&n.parsedType!==Ie.number){const o=ot.objectValues(r);return ve(n,{expected:ot.joinValues(o),received:n.parsedType,code:pe.invalid_type}),ze}if(this._cache||(this._cache=new Set(ot.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const o=ot.objectValues(r);return ve(n,{received:n.data,code:pe.invalid_enum_value,options:o}),ze}return mo(t.data)}get enum(){return this._def.values}}AT.create=(e,t)=>new AT({values:e,typeName:Fe.ZodNativeEnum,...qe(t)});class Xm extends nt{unwrap(){return this._def.type}_parse(t){const{ctx:r}=this._processInputParams(t);if(r.parsedType!==Ie.promise&&r.common.async===!1)return ve(r,{code:pe.invalid_type,expected:Ie.promise,received:r.parsedType}),ze;const n=r.parsedType===Ie.promise?r.data:Promise.resolve(r.data);return mo(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Xm.create=(e,t)=>new Xm({type:e,typeName:Fe.ZodPromise,...qe(t)});class Tu extends nt{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Fe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ve(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){const a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return ze;const l=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return l.status==="aborted"?ze:l.status==="dirty"||r.value==="dirty"?Zd(l.value):l});{if(r.value==="aborted")return ze;const s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?ze:s.status==="dirty"||r.value==="dirty"?Zd(s.value):s}}if(o.type==="refinement"){const a=s=>{const l=o.refinement(s,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){const s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?ze:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?ze:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Pu(a))return ze;const s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Pu(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):ze);ot.assertNever(o)}}Tu.create=(e,t,r)=>new Tu({schema:e,typeName:Fe.ZodEffects,effect:t,...qe(r)});Tu.createWithPreprocess=(e,t,r)=>new Tu({schema:t,effect:{type:"preprocess",transform:e},typeName:Fe.ZodEffects,...qe(r)});class ss extends nt{_parse(t){return this._getType(t)===Ie.undefined?mo(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}ss.create=(e,t)=>new ss({innerType:e,typeName:Fe.ZodOptional,...qe(t)});class Iu extends nt{_parse(t){return this._getType(t)===Ie.null?mo(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}}Iu.create=(e,t)=>new Iu({innerType:e,typeName:Fe.ZodNullable,...qe(t)});class f2 extends nt{_parse(t){const{ctx:r}=this._processInputParams(t);let n=r.data;return r.parsedType===Ie.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}f2.create=(e,t)=>new f2({innerType:e,typeName:Fe.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...qe(t)});class p2 extends nt{_parse(t){const{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return qm(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new la(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new la(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}p2.create=(e,t)=>new p2({innerType:e,typeName:Fe.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...qe(t)});class kT extends nt{_parse(t){if(this._getType(t)!==Ie.nan){const n=this._getOrReturnCtx(t);return ve(n,{code:pe.invalid_type,expected:Ie.nan,received:n.parsedType}),ze}return{status:"valid",value:t.data}}}kT.create=e=>new kT({typeName:Fe.ZodNaN,...qe(e)});class Fse extends nt{_parse(t){const{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class z6 extends nt{_parse(t){const{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?ze:i.status==="dirty"?(r.dirty(),Zd(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?ze:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new z6({in:t,out:r,typeName:Fe.ZodPipeline})}}class h2 extends nt{_parse(t){const r=this._def.innerType._parse(t),n=o=>(Pu(o)&&(o.value=Object.freeze(o.value)),o);return qm(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}}h2.create=(e,t)=>new h2({innerType:e,typeName:Fe.ZodReadonly,...qe(t)});var Fe;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(Fe||(Fe={}));const xt=Ga.create,Use=Au.create,Wse=u2.create;bs.create;Si.create;const Rs=Jt.create;Zm.create;Ym.create;Nl.create;ku.create;Xm.create;ss.create;Iu.create;const Hse={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Vse=Rs({VITE_CHAIN_ID:xt().optional(),VITE_EAS_SCHEMA_UID:xt().startsWith("0x").length(66).optional(),VITE_EAS_ADDRESS:xt().optional(),VITE_EAS_BASE_SEPOLIA_SCHEMA_UID:xt().startsWith("0x").length(66).optional(),VITE_EAS_BASE_SEPOLIA_ADDRESS:xt().optional(),VITE_ZERODEV_PROJECT_ID:xt().optional(),VITE_ZERODEV_BUNDLER_RPC:xt().url().optional(),VITE_RESOLVER_ADDRESS:xt().optional(),VITE_STANDALONE_ATTESTOR_ADDRESS:xt().optional()});function Wr(){const e=Vse.safeParse(Hse);if(!e.success)return{CHAIN_ID:parseInt("8453"),EAS_SCHEMA_UID:"0x7e4a502d6e04b8ff7a80ac8b852c8b53199fe297ddf092a63fffb2a5a062b1b7",EAS_ADDRESS:void 0,ZERODEV_PROJECT_ID:void 0};const t=parseInt(e.data.VITE_CHAIN_ID??"8453"),r=e.data.VITE_EAS_SCHEMA_UID??e.data.VITE_EAS_BASE_SEPOLIA_SCHEMA_UID??"0x7e4a502d6e04b8ff7a80ac8b852c8b53199fe297ddf092a63fffb2a5a062b1b7";let n=e.data.VITE_EAS_ADDRESS??e.data.VITE_EAS_BASE_SEPOLIA_ADDRESS;return n&&(n.trim().toLowerCase()==="undefined"||n.trim()==="")&&(n=void 0),{CHAIN_ID:t,EAS_SCHEMA_UID:r,EAS_ADDRESS:n,ZERODEV_PROJECT_ID:e.data.VITE_ZERODEV_PROJECT_ID,ZERODEV_BUNDLER_RPC:e.data.VITE_ZERODEV_BUNDLER_RPC,RESOLVER_ADDRESS:e.data.VITE_RESOLVER_ADDRESS,STANDALONE_ATTESTOR_ADDRESS:e.data.VITE_STANDALONE_ATTESTOR_ADDRESS}}async function l0(e,t){const{createKernelAccount:r,createKernelAccountClient:n}=await ja(async()=>{const{createKernelAccount:g,createKernelAccountClient:y}=await import("./index-C3_GJ6Eb.js");return{createKernelAccount:g,createKernelAccountClient:y}},__vite__mapDeps([0,1,2])),{getEntryPoint:o,KERNEL_V3_1:i}=await ja(async()=>{const{getEntryPoint:g,KERNEL_V3_1:y}=await import("./constants-DBcQLFY6.js").then(w=>w.c);return{getEntryPoint:g,KERNEL_V3_1:y}},[]),{signerToEcdsaValidator:a}=await ja(async()=>{const{signerToEcdsaValidator:g}=await import("./index-uTQGe5qG.js");return{signerToEcdsaValidator:g}},__vite__mapDeps([3,1,2])),s=Wr();if(!s.ZERODEV_BUNDLER_RPC)throw new Error("Missing VITE_ZERODEV_BUNDLER_RPC");const l=gl({chain:Zc,transport:Xa(Zc.rpcUrls.default.http[0])}),u=Xs({chain:Zc,transport:Qs(e)}),c=o("0.7"),d=i,f=await a(l,{signer:u,entryPoint:c,kernelVersion:d}),p=await r(l,{entryPoint:c,kernelVersion:d,plugins:{sudo:f}}),h=Xa(s.ZERODEV_BUNDLER_RPC),m=n({account:p,client:l,bundlerTransport:h,userOperation:{estimateFeesPerGas:async()=>{const g=await l.estimateFeesPerGas();return{maxFeePerGas:g.maxFeePerGas??g.gasPrice??0n,maxPriorityFeePerGas:g.maxPriorityFeePerGas??0n}}}});return{getAddress:async()=>p.address,sendUserOp:async({to:g,data:y,value:w})=>await m.sendUserOperation({calls:[{to:g,data:y,value:w??0n}]}),waitForUserOp:async g=>m.waitForUserOperationReceipt({hash:g}),debugTryEp:async g=>{try{const{createKernelAccount:y}=await ja(async()=>{const{createKernelAccount:_}=await import("./index-C3_GJ6Eb.js");return{createKernelAccount:_}},__vite__mapDeps([0,1,2])),{getEntryPoint:w,KERNEL_V3_1:S}=await ja(async()=>{const{getEntryPoint:_,KERNEL_V3_1:R}=await import("./constants-DBcQLFY6.js").then(E=>E.c);return{getEntryPoint:_,KERNEL_V3_1:R}},[]),{signerToEcdsaValidator:x}=await ja(async()=>{const{signerToEcdsaValidator:_}=await import("./index-uTQGe5qG.js");return{signerToEcdsaValidator:_}},__vite__mapDeps([3,1,2])),P=w(g),A=g==="0.6"?"0.2.4":S,T=await x(l,{signer:u,entryPoint:P,kernelVersion:A}),O=await(await y(l,{entryPoint:P,kernelVersion:A,plugins:{sudo:T}})).getAddress();return{ok:!0,message:`EP ${g} constructed (address ${O})`}}catch(y){return{ok:!1,message:y.message??"unknown error"}}}}}function Gse(){const{provider:e,eoaAddress:t,connect:r,disconnect:n}=hse(),o=v.useMemo(()=>Wr(),[]),i=v.useMemo(()=>L6(o.CHAIN_ID),[o.CHAIN_ID]),[a,s]=v.useState(null),[l,u]=v.useState(null),[c,d]=v.useState(!1),[f,p]=v.useState(null),[h,m]=v.useState(null),[g,y]=v.useState(!1),[w,S]=v.useState(!1),[x,P]=v.useState(null),[A,T]=v.useState(null),I=!!a,O=!!h&&!!l,_=v.useCallback(async()=>{var H;P(null);try{const V=typeof window<"u"&&window.ethereum?window.ethereum:null;if(V)try{await((H=V.request)==null?void 0:H.call(V,{method:"eth_requestAccounts"}))}catch{}else await r({loginProvider:"github"})}catch{}try{y(!0);const V=Wr();if(!V.ZERODEV_BUNDLER_RPC)throw new Error("VITE_ZERODEV_BUNDLER_RPC is not set");const Q=await E();try{const G=Xs({chain:i,transport:Qs(Q)}),[oe]=await G.getAddresses();oe&&s(oe)}catch{}const re=await l0(Q,V.ZERODEV_PROJECT_ID??"");m(re);const Y=await re.getAddress();u(Y);const Z=gl({chain:i,transport:Xa(i.rpcUrls.default.http[0])}),[ie,me]=await Promise.all([Z.getCode({address:Y}),Z.getBalance({address:Y})]);d(!!ie&&ie!=="0x"),p(me)}catch(V){P(V.message??"Failed to create smart wallet")}finally{y(!1)}},[r,e]),R=v.useCallback(async()=>{try{await n()}catch{}s(null),u(null),m(null),d(!1),p(null)},[n]),E=v.useCallback(async()=>{const H=typeof window<"u"&&window.ethereum?window.ethereum:null;if(H)return H;if(!e)throw new Error("Web3Auth provider unavailable");return e},[e]),M=v.useCallback(async()=>{const H=await E();return Xs({chain:i,transport:Qs(H)})},[E,i]),B=v.useCallback(async()=>{const H=l;if(!H){d(!1),p(null);return}const V=gl({chain:i,transport:Xa(i.rpcUrls.default.http[0])}),[Q,re]=await Promise.all([V.getCode({address:H}),V.getBalance({address:H})]);d(!!Q&&Q!=="0x"),p(re)},[l,i]),j=v.useCallback(async()=>{if(h)return h;try{const H=Wr();if(!H.ZERODEV_BUNDLER_RPC)return null;const V=await E(),Q=await l0(V,H.ZERODEV_PROJECT_ID??"");if(m(Q),!l){const re=await Q.getAddress();u(re)}return Q}catch(H){return P(H.message??"Failed to initialize AA client"),null}},[h,E,l]),N=v.useCallback(async()=>!!await j(),[j]),F=v.useCallback(async()=>{await r()},[r]),D=v.useCallback(async()=>{P(null);try{S(!0);const H=Wr();if(!H.ZERODEV_BUNDLER_RPC)throw new Error("VITE_ZERODEV_BUNDLER_RPC is not set");let V=h;if(!V){const ie=await E();try{const me=Xs({chain:i,transport:Qs(ie)}),[G]=await me.getAddresses();G&&s(G)}catch{}V=await l0(ie,H.ZERODEV_PROJECT_ID??""),m(V)}const Q=await V.getAddress();u(Q);const re=gl({chain:i,transport:Xa(i.rpcUrls.default.http[0])}),[Y,Z]=await Promise.all([re.getCode({address:Q}),re.getBalance({address:Q})]);d(!!Y&&Y!=="0x"),p(Z)}catch(H){P(H.message??"Failed to open smart wallet")}finally{S(!1)}},[h,e]),z=v.useCallback(async H=>{T("Testing…");try{const V=Wr();if(!V.ZERODEV_BUNDLER_RPC){T("FAIL: VITE_ZERODEV_BUNDLER_RPC is not set");return}let Q=h;if(!Q){const Y=await E();Q=await l0(Y,V.ZERODEV_PROJECT_ID??""),m(Q)}const re=await Q.debugTryEp(H);T(`${re.ok?"OK":"FAIL"}: ${re.message}`)}catch(V){T(`FAIL: ${V.message??"unknown error"}`)}},[h,E]),W=v.useCallback(async({message:H})=>{const V=await E(),Q=Xs({chain:i,transport:Qs(V)});let re;try{re=await Q.getAddresses()}catch{throw new Error("Failed to get wallet addresses. Please make sure your wallet is connected.")}if(!re||re.length===0)throw new Error("No wallet account available for signing. Please connect your wallet.");const[Y]=re;if(!Y)throw new Error("No wallet account available for signing");return await Q.signMessage({account:Y,message:H})},[E]);return v.useEffect(()=>{(async()=>{try{const H=await E(),V=Xs({chain:i,transport:Qs(H)}),[Q]=await V.getAddresses();if(Q){s(Q);return}}catch{}t&&s(t)})()},[t,E]),v.useEffect(()=>{B()},[l,B]),v.useEffect(()=>{const H=V=>{V.length===0&&(s(null),u(null),m(null),d(!1),p(null))};if(typeof window<"u"&&window.ethereum)return window.ethereum.on("accountsChanged",H),()=>{window.ethereum.removeListener("accountsChanged",H)}},[]),{connected:I,address:a,smartAddress:l,connect:_,disconnect:R,signMessage:W,getWalletClient:M,getSmartWalletClient:j,refreshOnchain:B,isContract:c,balanceWei:f,canAttest:O,createSmartWallet:F,provisioning:g,busyOpen:w,openWallet:D,wallets:[],privyUser:null,lastError:x,ensureAa:N,diag:A,testEp:z}}const BM=v.createContext(null),qse=({children:e})=>{const t=Gse();return b.jsx(BM.Provider,{value:t,children:e})},Zl=()=>{const e=v.useContext(BM);if(!e)throw new Error("useWallet must be used within a WalletProvider");return e},Kse=()=>{const e=Zl(),{connected:t,address:r,smartAddress:n,connect:o,disconnect:i,provisioning:a}=e,[s,l]=v.useState(null),u=!!s,c=h=>{t?l(h.currentTarget):o()},d=()=>{l(null)},f=async h=>{try{await navigator.clipboard.writeText(h)}catch{const g=document.createElement("textarea");g.value=h,document.body.appendChild(g),g.select(),document.execCommand("copy"),document.body.removeChild(g)}d()},p=h=>!h||h.length<10?"Connect Wallet":`${h.slice(0,6)}...${h.slice(-4)}`;return t?b.jsxs(b.Fragment,{children:[b.jsx(Qn,{variant:"outlined",onClick:c,sx:{borderRadius:2,textTransform:"none",color:"white",borderColor:"rgba(255, 255, 255, 0.3)","&:hover":{borderColor:"white",bgcolor:"rgba(255, 255, 255, 0.1)"}},children:b.jsxs(ge,{display:"flex",alignItems:"center",gap:1,children:[b.jsx(n2,{fontSize:"small"}),b.jsx(ae,{variant:"body2",fontWeight:500,sx:{color:"white"},children:p(r||"")})]})}),b.jsxs(fM,{anchorEl:s,open:u,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{mt:1,minWidth:200}},children:[r&&b.jsx(G0,{onClick:()=>f(r),children:b.jsxs(ge,{display:"flex",alignItems:"center",gap:1,width:"100%",children:[b.jsx(Gm,{fontSize:"small"}),b.jsxs(ge,{children:[b.jsx(ae,{variant:"body2",color:"text.secondary",children:"EOA Wallet"}),b.jsx(ae,{variant:"body2",fontFamily:"monospace",children:p(r)})]})]})}),n&&b.jsx(G0,{onClick:()=>f(n),children:b.jsxs(ge,{display:"flex",alignItems:"center",gap:1,width:"100%",children:[b.jsx(Gm,{fontSize:"small"}),b.jsxs(ge,{children:[b.jsx(ae,{variant:"body2",color:"text.secondary",children:"Smart Wallet"}),b.jsx(ae,{variant:"body2",fontFamily:"monospace",children:p(n)})]})]})}),b.jsx(G0,{onClick:()=>{i(),d()},children:b.jsxs(ge,{display:"flex",alignItems:"center",gap:1,children:[b.jsx(Hae,{fontSize:"small"}),b.jsx(ae,{variant:"body2",color:"text.secondary",children:"Disconnect"})]})})]})]}):b.jsx(Qn,{variant:"contained",startIcon:b.jsx(n2,{}),onClick:c,disabled:a,sx:{borderRadius:2,textTransform:"none",fontWeight:600},children:a?"Connecting...":"Connect Wallet"})},Zse=({currentPage:e,onPageChange:t})=>{const r=(n,o)=>{t(o)};return b.jsx(Oee,{position:"static",elevation:1,children:b.jsxs(SM,{children:[b.jsx(ae,{variant:"h6",component:"h1",sx:{mr:4},children:"didgit.dev"}),b.jsx(ge,{sx:{flexGrow:1},children:b.jsxs(B6,{value:e,onChange:r,sx:{"& .MuiTab-root":{color:"rgba(255, 255, 255, 0.7)",textTransform:"none",fontWeight:500,minWidth:80,"&.Mui-selected":{color:"white !important"}},"& .MuiTabs-indicator":{backgroundColor:"white"}},children:[b.jsx(Eu,{label:"Register",value:"register"}),b.jsx(Eu,{label:"Settings",value:"settings"})]})}),b.jsx(Kse,{})]})})},Yse=()=>{const{smartAddress:e,connected:t,isContract:r,balanceWei:n,refreshOnchain:o,ensureAa:i,lastError:a,address:s}=Zl(),[l,u]=v.useState(!1),[c,d]=v.useState(!1),[f,p]=v.useState(0),h=Wr(),m=n?parseFloat(Qg(n)):0,g=m>0,y=t&&e&&g,w=h.CHAIN_ID===8453,S=async()=>{d(!0);try{await i(),await o()}catch{}finally{d(!1)}};v.useEffect(()=>{p(T=>T+1),t?S():(u(!1),d(!1))},[t]),v.useEffect(()=>{t&&e&&S()},[t,e]);const x=async()=>{if(e)try{await navigator.clipboard.writeText(e)}catch{const I=document.createElement("textarea");I.value=e,document.body.appendChild(I),I.select(),document.execCommand("copy"),document.body.removeChild(I)}},P=async()=>{u(!0);try{h.CHAIN_ID===84532?window.open(`https://www.coinbase.com/faucets/base-sepolia-faucet?address=${e}`,"_blank"):window.open("https://bridge.base.org/","_blank"),setTimeout(async()=>{await o(),u(!1)},2e3)}catch{u(!1)}},A=T=>`${T.slice(0,6)}...${T.slice(-4)}`;return t?b.jsxs(ge,{children:[b.jsxs(ge,{display:"flex",alignItems:"center",gap:2,mb:2,children:[b.jsx(n2,{color:"primary"}),b.jsx(ae,{variant:"h6",children:"Smart Wallet Status"}),b.jsx(mp,{title:"Refresh status",children:b.jsx(ui,{onClick:S,size:"small",disabled:c,children:c?b.jsx(ys,{size:20}):b.jsx(PM,{})})})]}),e&&b.jsx(sr,{variant:"outlined",sx:{p:2,mb:2},children:b.jsxs(ll,{spacing:2,children:[b.jsxs(ge,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[b.jsxs(ge,{children:[b.jsx(ae,{variant:"body2",color:"text.secondary",children:"Address"}),b.jsx(ae,{variant:"body1",fontFamily:"monospace",children:A(e)})]}),b.jsx(mp,{title:"Copy address",children:b.jsx(ui,{onClick:x,size:"small",children:b.jsx(Gm,{fontSize:"small"})})})]}),b.jsxs(ge,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[b.jsxs(ge,{children:[b.jsx(ae,{variant:"body2",color:"text.secondary",children:"Balance"}),b.jsxs(ae,{variant:"body1",children:[m.toFixed(8)," ETH"]})]}),b.jsx(fn,{icon:g?b.jsx(o2,{}):b.jsx(lT,{}),label:g?"Funded":"Needs Gas",color:g?"success":"warning",size:"small"})]}),b.jsxs(ge,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[b.jsxs(ge,{children:[b.jsx(ae,{variant:"body2",color:"text.secondary",children:"Status"}),b.jsx(ae,{variant:"body1",children:y?"Ready for attestations":"Setup required"})]}),b.jsx(fn,{icon:y?b.jsx(o2,{}):b.jsx(lT,{}),label:y?"Ready":"Not Ready",color:y?"success":"warning",size:"small"})]})]})}),!g&&e&&b.jsxs(gr,{severity:"warning",sx:{mb:2},children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"Wallet Needs Funding"}),b.jsxs(ae,{variant:"body2",sx:{mb:2},children:["Your smart wallet needs ETH to pay for transaction gas on ",w?"Base":"Base Sepolia","."]}),b.jsx(ll,{direction:"row",spacing:1,children:b.jsx(Qn,{variant:"contained",size:"small",onClick:P,disabled:l,startIcon:l?b.jsx(ys,{size:16}):void 0,children:l?w?"Opening Bridge...":"Opening Faucet...":w?"Bridge ETH":"Get Test ETH"})})]}),a&&b.jsx(gr,{severity:"error",sx:{mt:2},children:b.jsx(ae,{variant:"body2",children:a})}),y&&b.jsx(gr,{severity:"success",children:b.jsx(ae,{variant:"body2",children:"āœ… Your smart wallet is ready! You can now create attestations without switching networks."})})]}):b.jsx(gr,{severity:"info",children:"Connect your wallet using the button in the top-right corner to get started."})},Xse={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1},Qse=Rs({VITE_GITHUB_CLIENT_ID:xt().min(1),VITE_GITHUB_REDIRECT_URI:xt().url().optional(),VITE_GITHUB_TOKEN_PROXY:xt().url().optional()});function LM(){const e=Qse.safeParse(Xse);return e.success?{clientId:e.data.VITE_GITHUB_CLIENT_ID,redirectUri:e.data.VITE_GITHUB_REDIRECT_URI??`${window.location.origin}`,tokenProxy:e.data.VITE_GITHUB_TOKEN_PROXY}:{clientId:void 0,redirectUri:void 0}}function Jse(e){const t=new Uint8Array(e);let r="";return t.forEach(n=>r+=String.fromCharCode(n)),btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ele(e){const t=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",t);return Jse(r)}const tle=Rs({access_token:xt(),token_type:xt(),scope:xt().optional()}),TT=Rs({error:xt(),error_description:xt().optional(),error_uri:xt().optional()});async function IT(e){const{tokenProxy:t}=LM(),r=t??`${window.location.origin}/api/github/token`,n=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:e.clientId,code:e.code,redirect_uri:e.redirectUri,code_verifier:e.codeVerifier})});if(!n.ok){try{const s=await n.json(),l=TT.safeParse(s);if(l.success){const u=`${l.data.error}${l.data.error_description?`: ${l.data.error_description}`:""}`;throw new Error(`GitHub token exchange failed: ${n.status} ${u}`)}}catch{}throw new Error(`GitHub token exchange failed: ${n.status}`)}const o=await n.json(),i=TT.safeParse(o);if(i.success){const s=`${i.data.error}${i.data.error_description?`: ${i.data.error_description}`:""}`;throw new Error(s)}const a=tle.safeParse(o);if(!a.success)throw new Error("Unexpected token response");return a.data}const rle=Rs({login:xt(),id:Use(),avatar_url:xt().url().optional()});async function OT(e){const t=await fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${e.access_token}`,Accept:"application/vnd.github+json"}});if(!t.ok)throw new Error("Failed to load user");const r=await t.json(),n=rle.safeParse(r);if(!n.success)throw new Error("Unexpected user payload");return n.data}const DM=v.createContext(void 0),nle=({children:e})=>{const t=LM(),[r,n]=v.useState(null),[o,i]=v.useState(null),[a,s]=v.useState(!1);v.useEffect(()=>{var S;const d=window.location.origin,f=x=>{if(x.origin!==d)return;const P=x.data;if(!P||P.type!=="GH_OAUTH")return;const A=P.code,T=P.state,I=sessionStorage.getItem("gh_oauth_state"),O=sessionStorage.getItem("gh_pkce_verifier");!A||!T||!I||T!==I||!O||!t.clientId||(async()=>{try{s(!0);const _=await IT({clientId:t.clientId,code:A,redirectUri:t.redirectUri??d,codeVerifier:O});n(_);const R=await OT(_);i(R)}finally{sessionStorage.removeItem("gh_oauth_state"),sessionStorage.removeItem("gh_pkce_verifier"),s(!1)}})()};window.addEventListener("message",f);const p=new URL(window.location.href),h=p.searchParams.get("code"),m=p.searchParams.get("state"),g=sessionStorage.getItem("gh_oauth_state"),y=sessionStorage.getItem("gh_pkce_verifier");if(!!window.opener&&h&&m){try{(S=window.opener)==null||S.postMessage({type:"GH_OAUTH",code:h,state:m},d)}finally{window.close()}return()=>window.removeEventListener("message",f)}return h&&m&&g&&m===g&&y&&t.clientId&&(async()=>{try{s(!0);const x=await IT({clientId:t.clientId,code:h,redirectUri:t.redirectUri??d,codeVerifier:y});n(x);const P=await OT(x);i(P)}catch{}finally{p.searchParams.delete("code"),p.searchParams.delete("state"),window.history.replaceState({},"",p.pathname+p.search+p.hash),sessionStorage.removeItem("gh_oauth_state"),sessionStorage.removeItem("gh_pkce_verifier"),s(!1)}})(),()=>window.removeEventListener("message",f)},[t.clientId,t.redirectUri]);const l=v.useCallback(async()=>{if(!t.clientId)throw new Error("VITE_GITHUB_CLIENT_ID is not set");const d=Math.random().toString(36).slice(2),f=crypto.getRandomValues(new Uint8Array(32)).reduce((P,A)=>P+("0"+(A&255).toString(16)).slice(-2),""),p=await ele(f);sessionStorage.setItem("gh_oauth_state",d),sessionStorage.setItem("gh_pkce_verifier",f);const h=t.redirectUri??`${window.location.origin}`,g=`https://github.com/login/oauth/authorize?${new URLSearchParams({client_id:t.clientId,redirect_uri:h,login:"",scope:"read:user gist",state:d,response_type:"code",code_challenge:p,code_challenge_method:"S256",allow_signup:"true"}).toString()}`,y=500,w=650,S=window.screenX+(window.outerWidth-y)/2,x=window.screenY+(window.outerHeight-w)/2.5;window.open(g,"github_oauth",`width=${y},height=${w},left=${S},top=${x}`)},[t.clientId,t.redirectUri]),u=v.useCallback(()=>{i(null),n(null)},[]),c=v.useMemo(()=>({token:r,user:o,connecting:a,connect:l,disconnect:u}),[r,o,a,l,u]);return b.jsx(DM.Provider,{value:c,children:e})};function Ev(){const e=v.useContext(DM);if(!e)throw new Error("useGithubAuth must be used within GithubAuthProvider");return e}function _T(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function ole(...e){return t=>{let r=!1;const n=e.map(o=>{const i=_T(o,t);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o{let{children:i,...a}=n;zM(i)&&typeof Qm=="function"&&(i=Qm(i._payload));const s=v.Children.toArray(i),l=s.find(dle);if(l){const u=l.props.children,c=s.map(d=>d===l?v.Children.count(u)>1?v.Children.only(null):v.isValidElement(u)?u.props.children:null:d);return b.jsx(t,{...a,ref:o,children:v.isValidElement(u)?v.cloneElement(u,void 0,c):null})}return b.jsx(t,{...a,ref:o,children:i})});return r.displayName=`${e}.Slot`,r}var lle=sle("Slot");function cle(e){const t=v.forwardRef((r,n)=>{let{children:o,...i}=r;if(zM(o)&&typeof Qm=="function"&&(o=Qm(o._payload)),v.isValidElement(o)){const a=ple(o),s=fle(i,o.props);return o.type!==v.Fragment&&(s.ref=n?ole(n,a):a),v.cloneElement(o,s)}return v.Children.count(o)>1?v.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var ule=Symbol("radix.slottable");function dle(e){return v.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===ule}function fle(e,t){const r={...t};for(const n in t){const o=e[n],i=t[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...s)=>{const l=i(...s);return o(...s),l}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...e,...r}}function ple(e){var n,o;let t=(n=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:n.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(o=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:o.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}const $T=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,RT=se,hle=(e,t)=>r=>{var n;if((t==null?void 0:t.variants)==null)return RT(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:o,defaultVariants:i}=t,a=Object.keys(o).map(u=>{const c=r==null?void 0:r[u],d=i==null?void 0:i[u];if(c===null)return null;const f=$T(c)||$T(d);return o[u][f]}),s=r&&Object.entries(r).reduce((u,c)=>{let[d,f]=c;return f===void 0||(u[d]=f),u},{}),l=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((u,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(h=>{let[m,g]=h;return Array.isArray(g)?g.includes({...i,...s}[m]):{...i,...s}[m]===g})?[...u,d,f]:u},[]);return RT(e,a,l,r==null?void 0:r.class,r==null?void 0:r.className)},F6="-",mle=e=>{const t=yle(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=e;return{getClassGroupId:a=>{const s=a.split(F6);return s[0]===""&&s.length!==1&&s.shift(),FM(s,t)||gle(a)},getConflictingClassGroupIds:(a,s)=>{const l=r[a]||[];return s&&n[a]?[...l,...n[a]]:l}}},FM=(e,t)=>{var a;if(e.length===0)return t.classGroupId;const r=e[0],n=t.nextPart.get(r),o=n?FM(e.slice(1),n):void 0;if(o)return o;if(t.validators.length===0)return;const i=e.join(F6);return(a=t.validators.find(({validator:s})=>s(i)))==null?void 0:a.classGroupId},jT=/^\[(.+)\]$/,gle=e=>{if(jT.test(e)){const t=jT.exec(e)[1],r=t==null?void 0:t.substring(0,t.indexOf(":"));if(r)return"arbitrary.."+r}},yle=e=>{const{theme:t,prefix:r}=e,n={nextPart:new Map,validators:[]};return ble(Object.entries(e.classGroups),r).forEach(([i,a])=>{m2(a,n,i,t)}),n},m2=(e,t,r,n)=>{e.forEach(o=>{if(typeof o=="string"){const i=o===""?t:MT(t,o);i.classGroupId=r;return}if(typeof o=="function"){if(vle(o)){m2(o(n),t,r,n);return}t.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{m2(a,MT(t,i),r,n)})})},MT=(e,t)=>{let r=e;return t.split(F6).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},vle=e=>e.isThemeGetter,ble=(e,t)=>t?e.map(([r,n])=>{const o=n.map(i=>typeof i=="string"?t+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[t+a,s])):i);return[r,o]}):e,wle=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=new Map,n=new Map;const o=(i,a)=>{r.set(i,a),t++,t>e&&(t=0,n=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=n.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a)}}},UM="!",xle=e=>{const{separator:t,experimentalParseClassName:r}=e,n=t.length===1,o=t[0],i=t.length,a=s=>{const l=[];let u=0,c=0,d;for(let g=0;gc?d-c:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:h,maybePostfixModifierPosition:m}};return r?s=>r({className:s,parseClassName:a}):a},Sle=e=>{if(e.length<=1)return e;const t=[];let r=[];return e.forEach(n=>{n[0]==="["?(t.push(...r.sort(),n),r=[]):r.push(n)}),t.push(...r.sort()),t},Cle=e=>({cache:wle(e.cacheSize),parseClassName:xle(e),...mle(e)}),Ele=/\s+/,Ple=(e,t)=>{const{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=t,i=[],a=e.trim().split(Ele);let s="";for(let l=a.length-1;l>=0;l-=1){const u=a[l],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(u);let h=!!p,m=n(h?f.substring(0,p):f);if(!m){if(!h){s=u+(s.length>0?" "+s:s);continue}if(m=n(f),!m){s=u+(s.length>0?" "+s:s);continue}h=!1}const g=Sle(c).join(":"),y=d?g+UM:g,w=y+m;if(i.includes(w))continue;i.push(w);const S=o(m,h);for(let x=0;x0?" "+s:s)}return s};function Ale(){let e=0,t,r,n="";for(;e{if(typeof e=="string")return e;let t,r="";for(let n=0;nd(c),e());return r=Cle(u),n=r.cache.get,o=r.cache.set,i=s,s(l)}function s(l){const u=n(l);if(u)return u;const c=Ple(l,r);return o(l,c),c}return function(){return i(Ale.apply(null,arguments))}}const Et=e=>{const t=r=>r[e]||[];return t.isThemeGetter=!0,t},HM=/^\[(?:([a-z-]+):)?(.+)\]$/i,Tle=/^\d+\/\d+$/,Ile=new Set(["px","full","screen"]),Ole=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,_le=/\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$/,$le=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,Rle=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,jle=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ni=e=>Xc(e)||Ile.has(e)||Tle.test(e),$a=e=>Ju(e,"length",Ule),Xc=e=>!!e&&!Number.isNaN(Number(e)),I1=e=>Ju(e,"number",Xc),Od=e=>!!e&&Number.isInteger(Number(e)),Mle=e=>e.endsWith("%")&&Xc(e.slice(0,-1)),Ve=e=>HM.test(e),Ra=e=>Ole.test(e),Nle=new Set(["length","size","percentage"]),Ble=e=>Ju(e,Nle,VM),Lle=e=>Ju(e,"position",VM),Dle=new Set(["image","url"]),zle=e=>Ju(e,Dle,Hle),Fle=e=>Ju(e,"",Wle),_d=()=>!0,Ju=(e,t,r)=>{const n=HM.exec(e);return n?n[1]?typeof t=="string"?n[1]===t:t.has(n[1]):r(n[2]):!1},Ule=e=>_le.test(e)&&!$le.test(e),VM=()=>!1,Wle=e=>Rle.test(e),Hle=e=>jle.test(e),Vle=()=>{const e=Et("colors"),t=Et("spacing"),r=Et("blur"),n=Et("brightness"),o=Et("borderColor"),i=Et("borderRadius"),a=Et("borderSpacing"),s=Et("borderWidth"),l=Et("contrast"),u=Et("grayscale"),c=Et("hueRotate"),d=Et("invert"),f=Et("gap"),p=Et("gradientColorStops"),h=Et("gradientColorStopPositions"),m=Et("inset"),g=Et("margin"),y=Et("opacity"),w=Et("padding"),S=Et("saturate"),x=Et("scale"),P=Et("sepia"),A=Et("skew"),T=Et("space"),I=Et("translate"),O=()=>["auto","contain","none"],_=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto",Ve,t],E=()=>[Ve,t],M=()=>["",Ni,$a],B=()=>["auto",Xc,Ve],j=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],N=()=>["solid","dashed","dotted","double","none"],F=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],D=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Ve],W=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[Xc,Ve];return{cacheSize:500,separator:":",theme:{colors:[_d],spacing:[Ni,$a],blur:["none","",Ra,Ve],brightness:H(),borderColor:[e],borderRadius:["none","","full",Ra,Ve],borderSpacing:E(),borderWidth:M(),contrast:H(),grayscale:z(),hueRotate:H(),invert:z(),gap:E(),gradientColorStops:[e],gradientColorStopPositions:[Mle,$a],inset:R(),margin:R(),opacity:H(),padding:E(),saturate:H(),scale:H(),sepia:z(),skew:H(),space:E(),translate:E()},classGroups:{aspect:[{aspect:["auto","square","video",Ve]}],container:["container"],columns:[{columns:[Ra]}],"break-after":[{"break-after":W()}],"break-before":[{"break-before":W()}],"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:[...j(),Ve]}],overflow:[{overflow:_()}],"overflow-x":[{"overflow-x":_()}],"overflow-y":[{"overflow-y":_()}],overscroll:[{overscroll:O()}],"overscroll-x":[{"overscroll-x":O()}],"overscroll-y":[{"overscroll-y":O()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[m]}],"inset-x":[{"inset-x":[m]}],"inset-y":[{"inset-y":[m]}],start:[{start:[m]}],end:[{end:[m]}],top:[{top:[m]}],right:[{right:[m]}],bottom:[{bottom:[m]}],left:[{left:[m]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",Od,Ve]}],basis:[{basis:R()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ve]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",Od,Ve]}],"grid-cols":[{"grid-cols":[_d]}],"col-start-end":[{col:["auto",{span:["full",Od,Ve]},Ve]}],"col-start":[{"col-start":B()}],"col-end":[{"col-end":B()}],"grid-rows":[{"grid-rows":[_d]}],"row-start-end":[{row:["auto",{span:[Od,Ve]},Ve]}],"row-start":[{"row-start":B()}],"row-end":[{"row-end":B()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ve]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ve]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...D()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...D(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...D(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[w]}],px:[{px:[w]}],py:[{py:[w]}],ps:[{ps:[w]}],pe:[{pe:[w]}],pt:[{pt:[w]}],pr:[{pr:[w]}],pb:[{pb:[w]}],pl:[{pl:[w]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[T]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[T]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ve,t]}],"min-w":[{"min-w":[Ve,t,"min","max","fit"]}],"max-w":[{"max-w":[Ve,t,"none","full","min","max","fit","prose",{screen:[Ra]},Ra]}],h:[{h:[Ve,t,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ve,t,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ve,t,"auto","min","max","fit"]}],"font-size":[{text:["base",Ra,$a]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",I1]}],"font-family":[{font:[_d]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ve]}],"line-clamp":[{"line-clamp":["none",Xc,I1]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",Ni,Ve]}],"list-image":[{"list-image":["none",Ve]}],"list-style-type":[{list:["none","disc","decimal",Ve]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[e]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[e]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...N(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",Ni,$a]}],"underline-offset":[{"underline-offset":["auto",Ni,Ve]}],"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:E()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve]}],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",Ve]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...j(),Lle]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",Ble]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},zle]}],"bg-color":[{bg:[e]}],"gradient-from-pos":[{from:[h]}],"gradient-via-pos":[{via:[h]}],"gradient-to-pos":[{to:[h]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],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:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...N(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:N()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[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:["",...N()]}],"outline-offset":[{"outline-offset":[Ni,Ve]}],"outline-w":[{outline:[Ni,$a]}],"outline-color":[{outline:[e]}],"ring-w":[{ring:M()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[e]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[Ni,$a]}],"ring-offset-color":[{"ring-offset":[e]}],shadow:[{shadow:["","inner","none",Ra,Fle]}],"shadow-color":[{shadow:[_d]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...F(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":F()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Ra,Ve]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[S]}],sepia:[{sepia:[P]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[S]}],"backdrop-sepia":[{"backdrop-sepia":[P]}],"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",Ve]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",Ve]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ve]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[x]}],"scale-x":[{"scale-x":[x]}],"scale-y":[{"scale-y":[x]}],rotate:[{rotate:[Od,Ve]}],"translate-x":[{"translate-x":[I]}],"translate-y":[{"translate-y":[I]}],"skew-x":[{"skew-x":[A]}],"skew-y":[{"skew-y":[A]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ve]}],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",Ve]}],"caret-color":[{caret:[e]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":E()}],"scroll-mx":[{"scroll-mx":E()}],"scroll-my":[{"scroll-my":E()}],"scroll-ms":[{"scroll-ms":E()}],"scroll-me":[{"scroll-me":E()}],"scroll-mt":[{"scroll-mt":E()}],"scroll-mr":[{"scroll-mr":E()}],"scroll-mb":[{"scroll-mb":E()}],"scroll-ml":[{"scroll-ml":E()}],"scroll-p":[{"scroll-p":E()}],"scroll-px":[{"scroll-px":E()}],"scroll-py":[{"scroll-py":E()}],"scroll-ps":[{"scroll-ps":E()}],"scroll-pe":[{"scroll-pe":E()}],"scroll-pt":[{"scroll-pt":E()}],"scroll-pr":[{"scroll-pr":E()}],"scroll-pb":[{"scroll-pb":E()}],"scroll-pl":[{"scroll-pl":E()}],"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",Ve]}],fill:[{fill:[e,"none"]}],"stroke-w":[{stroke:[Ni,$a,I1]}],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-s","border-color-e","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"]}}},Gle=kle(Vle);function lh(...e){return Gle(se(e))}const qle=hle("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800",secondary:"bg-blue-600 text-white hover:bg-blue-500",outline:"border border-gray-300 bg-white hover:bg-gray-50",ghost:"hover:bg-gray-100",destructive:"bg-red-600 text-white hover:bg-red-500"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),qa=v.forwardRef(({className:e,variant:t,size:r,asChild:n=!1,...o},i)=>{const a=n?lle:"button";return b.jsx(a,{className:lh(qle({variant:t,size:r,className:e})),ref:i,...o})});qa.displayName="Button";const Kle=()=>{const{user:e,connect:t,disconnect:r,connecting:n}=Ev();return b.jsxs("section",{children:[b.jsx("h3",{className:"text-lg font-semibold mb-2",children:"GitHub"}),e?b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx("img",{src:e.avatar_url||void 0,alt:e.login,className:"h-7 w-7 rounded-full"}),b.jsxs("span",{children:["Logged in as ",b.jsx("strong",{children:e.login})]}),b.jsx(qa,{variant:"ghost",onClick:r,children:"Disconnect"})]}):b.jsxs("div",{className:"flex items-center gap-3",children:[b.jsx(qa,{onClick:t,disabled:n,children:"Connect GitHub"}),b.jsx("span",{className:"text-sm text-gray-500",children:"Scopes: read:user, gist"})]}),!e&&b.jsxs("div",{className:"text-xs text-gray-500 mt-2",children:[b.jsxs("div",{children:["Client ID: ",b.jsx("code",{children:"—"})]}),b.jsxs("div",{children:["Redirect URI: ",b.jsx("code",{children:window.location.origin})]})]})]})},U6=v.forwardRef(({className:e,...t},r)=>b.jsx("input",{className:lh("flex h-9 w-full rounded-md border border-gray-300 bg-white px-3 py-1 text-sm shadow-sm placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 disabled:cursor-not-allowed disabled:opacity-50",e),ref:r,...t}));U6.displayName="Input";function Yd({className:e,...t}){return b.jsx("div",{role:"alert",className:lh("rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-800",e),...t})}const NT=[{type:"function",name:"getIdentityOwner",inputs:[{name:"domain",type:"string"},{name:"username",type:"string"}],outputs:[{name:"",type:"address"}],stateMutability:"view"},{type:"function",name:"setRepositoryPattern",inputs:[{name:"domain",type:"string"},{name:"username",type:"string"},{name:"namespace",type:"string"},{name:"name",type:"string"},{name:"enabled",type:"bool"}],outputs:[],stateMutability:"nonpayable"}],BT=Rs({github_username:xt().min(1).max(39)}),Zle=()=>{const{address:e,smartAddress:t,signMessage:r,connected:n,getWalletClient:o,getSmartWalletClient:i,canAttest:a,isContract:s,balanceWei:l,refreshOnchain:u,ensureAa:c,lastError:d}=Zl(),{user:f,token:p}=Ev(),h=v.useMemo(()=>Wr(),[]),m=!!h.EAS_ADDRESS,g=h.CHAIN_ID===8453,y=g?"https://basescan.org":"https://sepolia.basescan.org",w=g?"https://base.easscan.org":"https://base-sepolia.easscan.org",[S,x]=v.useState({github_username:""}),[P,A]=v.useState(null),[T,I]=v.useState(null),[O,_]=v.useState(!1),[R,E]=v.useState(!1),[M,B]=v.useState(!1),[j,N]=v.useState(null),[F,D]=v.useState(null),[z,W]=v.useState(null),H=Z=>{x(ie=>({...ie,[Z.target.name]:Z.target.value}))};Po.useEffect(()=>{f!=null&&f.login&&x(Z=>({...Z,github_username:f.login.toLowerCase()}))},[f==null?void 0:f.login]);const V=async()=>{var ie;if(N(null),!n||!e)return N("Connect wallet first");const Z=BT.safeParse(S);if(!Z.success)return N(((ie=Z.error.errors[0])==null?void 0:ie.message)??"Invalid input");try{_(!0);const me=`github.com:${Z.data.github_username}`,G=await r({message:me});if(!await vV({message:me,signature:G,address:e}))throw new Error("Signature does not match connected wallet");I(G)}catch(me){N(me.message??"Failed to sign")}finally{_(!1)}},Q=async(Z,ie)=>{const me=h.RESOLVER_ADDRESS;if(!me)throw new Error("Resolver address not configured");await ie.writeContract({address:me,abi:NT,functionName:"setRepositoryPattern",args:["github.com",Z,"*","*",!0],gas:BigInt(2e5)})},re=async()=>{var q;if(N(null),D(null),W(null),!n||!e)return N("Connect wallet first");const Z=BT.safeParse(S);if(!Z.success)return N(((q=Z.error.errors[0])==null?void 0:q.message)??"Invalid input");if(!T)return N("Sign your GitHub username first");if(!P)return N("Create a proof gist first");if(!m)return N("EAS contract address not configured (set VITE_EAS_ADDRESS)");const ie=h.RESOLVER_ADDRESS;if(ie)try{const ce=await gl({chain:L6(h.CHAIN_ID),transport:Xa()}).readContract({address:ie,abi:NT,functionName:"getIdentityOwner",args:["github.com",Z.data.github_username]});if(ce&&ce!=="0x0000000000000000000000000000000000000000"){if(ce.toLowerCase()!==(e==null?void 0:e.toLowerCase()))return N(`Username "${Z.data.github_username}" is already registered to a different wallet (${ce.slice(0,6)}...${ce.slice(-4)}). Each username can only be linked to one wallet.`);console.warn("Identity already registered to this wallet, proceeding with re-attestation")}}catch(Ee){console.warn("Could not check resolver for existing identity:",Ee)}const me=t??e;if(!me)return N("No account address available");let G=null;try{G=dT.forChain(h.CHAIN_ID,h)}catch(Ee){return N(Ee.message??"EAS configuration missing")}const oe=/^0x[0-9a-fA-F]{40}$/;if(!oe.test(me))return N("Resolved account address is invalid");if(!oe.test(G.contract))return N("EAS contract address is invalid");const de={domain:"github.com",username:Z.data.github_username,wallet:e,message:`github.com:${Z.data.github_username}`,signature:T,proof_url:P};try{B(!0);let Ee;try{Ee=Qae(de)}catch{return N("Invalid account address for binding")}const ue=await c()?await i():null;if(!ue||!(t??e))throw new Error(d??"AA smart wallet not ready");const ye=await Jae({schemaUid:h.EAS_SCHEMA_UID,data:Ee,recipient:e},G,{aaClient:ue});if(D(ye.txHash),ye.attestationUid){W(ye.attestationUid);try{await Q(Z.data.github_username,ue)}catch(Pe){console.warn("Failed to set default repository pattern:",Pe)}}}catch(Ee){let ce=!1;try{ce=!!await i()}catch{}const ue={eoaAddress:e??null,easContract:(()=>{try{return dT.forChain(h.CHAIN_ID,h).contract}catch{return null}})(),hasAaClient:ce,hasSig:!!T,hasGist:!!P};N(`${Ee.message} +context=${JSON.stringify(ue)}`)}finally{B(!1)}},Y=async()=>{if(N(null),!p)return N("Connect GitHub first");try{E(!0);const Z={domain:"github.com",username:S.github_username,wallet:e??"",message:`github.com:${S.github_username}`,signature:T??"",chain_id:h.CHAIN_ID,schema_uid:h.EAS_SCHEMA_UID},ie=JSON.stringify(Z,null,2),me=await fetch("https://api.github.com/gists",{method:"POST",headers:{Authorization:`Bearer ${p.access_token}`,"Content-Type":"application/json",Accept:"application/vnd.github+json"},body:JSON.stringify({description:"GitHub activity attestation proof",public:!0,files:{"didgit.dev-proof.json":{content:ie}}})});if(!me.ok)throw new Error("Failed to create gist");const G=await me.json();G.html_url&&A(G.html_url)}catch(Z){N(Z.message)}finally{E(!1)}};return b.jsxs("section",{children:[b.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Create GitHub Identity Attestation"}),b.jsxs("div",{className:"max-w-2xl space-y-3",children:[b.jsxs("div",{children:[b.jsx("label",{className:"text-sm text-gray-600",children:'GitHub Username (will sign "github.com:username")'}),b.jsx(U6,{name:"github_username",value:S.github_username,onChange:H,placeholder:"Connect GitHub first",disabled:!0,readOnly:!0})]}),b.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[b.jsx(qa,{onClick:V,disabled:O||!e||!S.github_username,children:O?"Signing…":`Sign "github.com:${S.github_username}"`}),P?b.jsx(qa,{variant:"outline",disabled:!0,children:"didgit.dev-proof.json Created"}):b.jsx(qa,{onClick:Y,disabled:!p||R,variant:"outline",children:R?"Creating Gist…":"Create didgit.dev-proof.json"}),b.jsx(qa,{onClick:re,disabled:!T||!P||M||!m||!(t||e),variant:"secondary",children:M?"Submitting…":"Submit Attestation"})]}),t&&l!==null&&l===0n&&b.jsxs(Yd,{children:["AA wallet has 0 balance on ",g?"Base":"Base Sepolia",". Fund it, then ",b.jsx("button",{className:"underline",onClick:()=>u(),children:"refresh"}),"."]}),!m&&b.jsx(Yd,{children:"EAS contract address is not set. Add VITE_EAS_ADDRESS to .env and reload."}),s&&l!==null&&l===0n&&b.jsx(Yd,{children:"AA wallet has 0 balance. Fund it to proceed."}),P&&b.jsxs("div",{className:"text-sm",children:["Proof Gist: ",b.jsx("a",{className:"text-blue-600 underline",href:P,target:"_blank",rel:"noreferrer",children:P})]}),T&&b.jsxs("div",{className:"text-xs text-gray-500",children:["Signature: ",b.jsx("code",{children:T})]}),F&&b.jsxs("div",{className:"space-y-1",children:[b.jsxs("div",{children:["Tx: ",b.jsx("a",{className:"text-blue-600 underline",href:`${y}/tx/${F}`,target:"_blank",rel:"noreferrer",children:F})]}),z&&b.jsxs("div",{children:["Attestation: ",b.jsx("a",{className:"text-blue-600 underline",href:`${w}/attestation/view/${z}`,target:"_blank",rel:"noreferrer",children:z})]})]}),j&&b.jsx(Yd,{children:j})]})]})};function Yle({className:e,...t}){return b.jsx("div",{className:lh("rounded-lg border border-gray-200 bg-white text-gray-900 shadow-sm",e),...t})}function Xle({className:e,...t}){return b.jsx("div",{className:lh("p-6 pt-0",e),...t})}const Qle=Rs({q:xt().min(1)}),Jle="https://base-sepolia.easscan.org/graphql",ece=()=>{const e=v.useMemo(()=>Wr(),[]),[t,r]=v.useState(""),[n,o]=v.useState(null),[i,a]=v.useState(!1),[s,l]=v.useState(null),u=async()=>{var d;const c=Qle.safeParse({q:t});if(c.success){l(null),o(null),a(!0);try{const m=(((d=(await(await fetch(Jle,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:`query ($schemaId: String!, $q: String!) { + attestations(take: 20, where: { schemaId: { equals: $schemaId }, OR: [ + { decodedDataJson: { contains: $q } }, + { recipient: { equals: $q } } + ] }) { + id + recipient + decodedDataJson + } + }`,variables:{schemaId:e.EAS_SCHEMA_UID,q:c.data.q}})})).json()).data)==null?void 0:d.attestations)??[]).map(g=>({id:g.id,recipient:g.recipient,decoded:tce(g.decodedDataJson)}));o(m)}catch(f){l(f.message)}finally{a(!1)}}};return b.jsxs("section",{children:[b.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Verify"}),b.jsxs("div",{className:"flex gap-2",children:[b.jsx(U6,{placeholder:"Search by username, wallet or URL",value:t,onChange:c=>r(c.target.value)}),b.jsx(qa,{onClick:u,disabled:i,children:"Search"})]}),s&&b.jsx("div",{className:"mt-2",children:b.jsx(Yd,{children:s})}),n&&b.jsxs("div",{className:"grid gap-2 mt-2",children:[n.length===0&&b.jsx("div",{children:"No results."}),n.map(c=>b.jsx(Yle,{children:b.jsxs(Xle,{children:[b.jsxs("div",{children:[b.jsx("strong",{children:"Attestation:"})," ",b.jsx("a",{className:"text-blue-600 underline",href:`https://base-sepolia.easscan.org/attestation/view/${c.id}`,target:"_blank",rel:"noreferrer",children:c.id})]}),b.jsxs("div",{className:"text-sm",children:["Recipient: ",b.jsx("code",{children:c.recipient})]}),c.decoded&&b.jsxs("div",{className:"mt-1 text-sm",children:[b.jsxs("div",{children:["Username: ",b.jsx("code",{children:c.decoded.github_username})]}),b.jsxs("div",{children:["Wallet: ",b.jsx("code",{children:c.decoded.wallet_address})]}),b.jsxs("div",{children:["Gist: ",b.jsx("a",{className:"text-blue-600 underline",href:c.decoded.github_proof_url,target:"_blank",rel:"noreferrer",children:c.decoded.github_proof_url})]})]})]})},c.id))]})]})};function tce(e){var t;if(!e)return null;try{const r=JSON.parse(e),n=new Map;for(const i of r)n.set(i.name,(t=i.value)==null?void 0:t.value);const o={github_username:String(n.get("github_username")??""),wallet_address:String(n.get("wallet_address")??""),github_proof_url:String(n.get("github_proof_url")??""),wallet_signature:String(n.get("wallet_signature")??"")};return!o.github_username||!o.wallet_address?null:o}catch{return null}}var rce=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function GM(e){if(typeof e!="string")return!1;var t=rce;return t.includes(e)}var nce=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],oce=new Set(nce);function qM(e){return typeof e!="string"?!1:oce.has(e)}function KM(e){return typeof e=="string"&&e.startsWith("data-")}function Ou(e){if(typeof e!="object"||e===null)return{};var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(qM(r)||KM(r))&&(t[r]=e[r]);return t}function W6(e){if(e==null)return null;if(v.isValidElement(e)&&typeof e.props=="object"&&e.props!==null){var t=e.props;return Ou(t)}return typeof e=="object"&&!Array.isArray(e)?Ou(e):null}function qr(e){var t={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(qM(r)||KM(r)||GM(r))&&(t[r]=e[r]);return t}function ice(e){return e==null?null:v.isValidElement(e)?qr(e.props):typeof e=="object"&&!Array.isArray(e)?qr(e):null}var ace=["children","width","height","viewBox","className","style","title","desc"];function g2(){return g2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:r,width:n,height:o,viewBox:i,className:a,style:s,title:l,desc:u}=e,c=sce(e,ace),d=i||{width:n,height:o,x:0,y:0},f=se("recharts-surface",a);return v.createElement("svg",g2({},qr(c),{className:f,width:n,height:o,style:s,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height),ref:t}),v.createElement("title",null,l),v.createElement("desc",null,u),r)}),cce=["children","className"];function y2(){return y2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:r,className:n}=e,o=uce(e,cce),i=se("recharts-layer",n);return v.createElement("g",y2({className:i},qr(o),{ref:t}),r)}),fce=v.createContext(null);function wt(e){return function(){return e}}const YM=Math.cos,Jm=Math.sin,Uo=Math.sqrt,eg=Math.PI,Pv=2*eg,v2=Math.PI,b2=2*v2,Ks=1e-6,pce=b2-Ks;function XM(e){this._+=e[0];for(let t=1,r=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return XM;const r=10**t;return function(n){this._+=n[0];for(let o=1,i=n.length;oKs)if(!(Math.abs(d*l-u*c)>Ks)||!i)this._append`L${this._x1=t},${this._y1=r}`;else{let p=n-a,h=o-s,m=l*l+u*u,g=p*p+h*h,y=Math.sqrt(m),w=Math.sqrt(f),S=i*Math.tan((v2-Math.acos((m+f-g)/(2*y*w)))/2),x=S/w,P=S/y;Math.abs(x-1)>Ks&&this._append`L${t+x*c},${r+x*d}`,this._append`A${i},${i},0,0,${+(d*p>c*h)},${this._x1=t+P*l},${this._y1=r+P*u}`}}arc(t,r,n,o,i,a){if(t=+t,r=+r,n=+n,a=!!a,n<0)throw new Error(`negative radius: ${n}`);let s=n*Math.cos(o),l=n*Math.sin(o),u=t+s,c=r+l,d=1^a,f=a?o-i:i-o;this._x1===null?this._append`M${u},${c}`:(Math.abs(this._x1-u)>Ks||Math.abs(this._y1-c)>Ks)&&this._append`L${u},${c}`,n&&(f<0&&(f=f%b2+b2),f>pce?this._append`A${n},${n},0,1,${d},${t-s},${r-l}A${n},${n},0,1,${d},${this._x1=u},${this._y1=c}`:f>Ks&&this._append`A${n},${n},0,${+(f>=v2)},${d},${this._x1=t+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(t,r,n,o){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+r}h${n=+n}v${+o}h${-n}Z`}toString(){return this._}}function H6(e){let t=3;return e.digits=function(r){if(!arguments.length)return t;if(r==null)t=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);t=n}return e},()=>new mce(t)}function V6(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function QM(e){this._context=e}QM.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function Av(e){return new QM(e)}function JM(e){return e[0]}function eN(e){return e[1]}function tN(e,t){var r=wt(!0),n=null,o=Av,i=null,a=H6(s);e=typeof e=="function"?e:e===void 0?JM:wt(e),t=typeof t=="function"?t:t===void 0?eN:wt(t);function s(l){var u,c=(l=V6(l)).length,d,f=!1,p;for(n==null&&(i=o(p=a())),u=0;u<=c;++u)!(u=p;--h)s.point(S[h],x[h]);s.lineEnd(),s.areaEnd()}y&&(S[f]=+e(g,f,d),x[f]=+t(g,f,d),s.point(n?+n(g,f,d):S[f],r?+r(g,f,d):x[f]))}if(w)return s=null,w+""||null}function c(){return tN().defined(o).curve(a).context(i)}return u.x=function(d){return arguments.length?(e=typeof d=="function"?d:wt(+d),n=null,u):e},u.x0=function(d){return arguments.length?(e=typeof d=="function"?d:wt(+d),u):e},u.x1=function(d){return arguments.length?(n=d==null?null:typeof d=="function"?d:wt(+d),u):n},u.y=function(d){return arguments.length?(t=typeof d=="function"?d:wt(+d),r=null,u):t},u.y0=function(d){return arguments.length?(t=typeof d=="function"?d:wt(+d),u):t},u.y1=function(d){return arguments.length?(r=d==null?null:typeof d=="function"?d:wt(+d),u):r},u.lineX0=u.lineY0=function(){return c().x(e).y(t)},u.lineY1=function(){return c().x(e).y(r)},u.lineX1=function(){return c().x(n).y(t)},u.defined=function(d){return arguments.length?(o=typeof d=="function"?d:wt(!!d),u):o},u.curve=function(d){return arguments.length?(a=d,i!=null&&(s=a(i)),u):a},u.context=function(d){return arguments.length?(d==null?i=s=null:s=a(i=d),u):i},u}class rN{constructor(t,r){this._context=t,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,r){switch(t=+t,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,r,t,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,t,this._y0,t,r);break}}this._x0=t,this._y0=r}}function gce(e){return new rN(e,!0)}function yce(e){return new rN(e,!1)}const G6={draw(e,t){const r=Uo(t/eg);e.moveTo(r,0),e.arc(0,0,r,0,Pv)}},vce={draw(e,t){const r=Uo(t/5)/2;e.moveTo(-3*r,-r),e.lineTo(-r,-r),e.lineTo(-r,-3*r),e.lineTo(r,-3*r),e.lineTo(r,-r),e.lineTo(3*r,-r),e.lineTo(3*r,r),e.lineTo(r,r),e.lineTo(r,3*r),e.lineTo(-r,3*r),e.lineTo(-r,r),e.lineTo(-3*r,r),e.closePath()}},nN=Uo(1/3),bce=nN*2,wce={draw(e,t){const r=Uo(t/bce),n=r*nN;e.moveTo(0,-r),e.lineTo(n,0),e.lineTo(0,r),e.lineTo(-n,0),e.closePath()}},xce={draw(e,t){const r=Uo(t),n=-r/2;e.rect(n,n,r,r)}},Sce=.8908130915292852,oN=Jm(eg/10)/Jm(7*eg/10),Cce=Jm(Pv/10)*oN,Ece=-YM(Pv/10)*oN,Pce={draw(e,t){const r=Uo(t*Sce),n=Cce*r,o=Ece*r;e.moveTo(0,-r),e.lineTo(n,o);for(let i=1;i<5;++i){const a=Pv*i/5,s=YM(a),l=Jm(a);e.lineTo(l*r,-s*r),e.lineTo(s*n-l*o,l*n+s*o)}e.closePath()}},O1=Uo(3),Ace={draw(e,t){const r=-Uo(t/(O1*3));e.moveTo(0,r*2),e.lineTo(-O1*r,-r),e.lineTo(O1*r,-r),e.closePath()}},Wn=-.5,Hn=Uo(3)/2,w2=1/Uo(12),kce=(w2/2+1)*3,Tce={draw(e,t){const r=Uo(t/kce),n=r/2,o=r*w2,i=n,a=r*w2+r,s=-i,l=a;e.moveTo(n,o),e.lineTo(i,a),e.lineTo(s,l),e.lineTo(Wn*n-Hn*o,Hn*n+Wn*o),e.lineTo(Wn*i-Hn*a,Hn*i+Wn*a),e.lineTo(Wn*s-Hn*l,Hn*s+Wn*l),e.lineTo(Wn*n+Hn*o,Wn*o-Hn*n),e.lineTo(Wn*i+Hn*a,Wn*a-Hn*i),e.lineTo(Wn*s+Hn*l,Wn*l-Hn*s),e.closePath()}};function Ice(e,t){let r=null,n=H6(o);e=typeof e=="function"?e:wt(e||G6),t=typeof t=="function"?t:wt(t===void 0?64:+t);function o(){let i;if(r||(r=i=n()),e.apply(this,arguments).draw(r,+t.apply(this,arguments)),i)return r=null,i+""||null}return o.type=function(i){return arguments.length?(e=typeof i=="function"?i:wt(i),o):e},o.size=function(i){return arguments.length?(t=typeof i=="function"?i:wt(+i),o):t},o.context=function(i){return arguments.length?(r=i??null,o):r},o}function tg(){}function rg(e,t,r){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+r)/6)}function iN(e){this._context=e}iN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:rg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:rg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function Oce(e){return new iN(e)}function aN(e){this._context=e}aN.prototype={areaStart:tg,areaEnd:tg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:rg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function _ce(e){return new aN(e)}function sN(e){this._context=e}sN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+e)/6,n=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:rg(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function $ce(e){return new sN(e)}function lN(e){this._context=e}lN.prototype={areaStart:tg,areaEnd:tg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function Rce(e){return new lN(e)}function LT(e){return e<0?-1:1}function DT(e,t,r){var n=e._x1-e._x0,o=t-e._x1,i=(e._y1-e._y0)/(n||o<0&&-0),a=(r-e._y1)/(o||n<0&&-0),s=(i*o+a*n)/(n+o);return(LT(i)+LT(a))*Math.min(Math.abs(i),Math.abs(a),.5*Math.abs(s))||0}function zT(e,t){var r=e._x1-e._x0;return r?(3*(e._y1-e._y0)/r-t)/2:t}function _1(e,t,r){var n=e._x0,o=e._y0,i=e._x1,a=e._y1,s=(i-n)/3;e._context.bezierCurveTo(n+s,o+s*t,i-s,a-s*r,i,a)}function ng(e){this._context=e}ng.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:_1(this,this._t0,zT(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var r=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,_1(this,zT(this,r=DT(this,e,t)),r);break;default:_1(this,this._t0,r=DT(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=r}}};function cN(e){this._context=new uN(e)}(cN.prototype=Object.create(ng.prototype)).point=function(e,t){ng.prototype.point.call(this,t,e)};function uN(e){this._context=e}uN.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,r,n,o,i){this._context.bezierCurveTo(t,e,n,r,i,o)}};function jce(e){return new ng(e)}function Mce(e){return new cN(e)}function dN(e){this._context=e}dN.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,r=e.length;if(r)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),r===2)this._context.lineTo(e[1],t[1]);else for(var n=FT(e),o=FT(t),i=0,a=1;a=0;--t)o[t]=(a[t]-o[t+1])/i[t];for(i[r-1]=(e[r]+o[r-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var r=this._x*(1-this._t)+e*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,t)}break}}this._x=e,this._y=t}};function Bce(e){return new kv(e,.5)}function Lce(e){return new kv(e,0)}function Dce(e){return new kv(e,1)}function Bl(e,t){if((a=e.length)>1)for(var r=1,n,o,i=e[t[0]],a,s=i.length;r=0;)r[t]=t;return r}function zce(e,t){return e[t]}function Fce(e){const t=[];return t.key=e,t}function Uce(){var e=wt([]),t=x2,r=Bl,n=zce;function o(i){var a=Array.from(e.apply(this,arguments),Fce),s,l=a.length,u=-1,c;for(const d of i)for(s=0,++u;s0){for(var r,n,o=0,i=e[0].length,a;o0){for(var r=0,n=e[t[0]],o,i=n.length;r0)||!((i=(o=e[t[0]]).length)>0))){for(var r=0,n=1,o,i,a;n1&&arguments[1]!==void 0?arguments[1]:qce,r=10**t,n=Math.round(e*r)/r;return Object.is(n,-0)?0:n}function Ht(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n{var s=r[a-1];return typeof s=="string"?o+s+i:s!==void 0?o+Ka(s)+i:o+i},"")}var fi=e=>e===0?0:e>0?1:-1,ca=e=>typeof e=="number"&&e!=+e,Ll=e=>typeof e=="string"&&e.indexOf("%")===e.length-1,Be=e=>(typeof e=="number"||e instanceof Number)&&!ca(e),ua=e=>Be(e)||typeof e=="string",Kce=0,vp=e=>{var t=++Kce;return"".concat(e||"").concat(t)},ws=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Be(t)&&typeof t!="string")return n;var i;if(Ll(t)){if(r==null)return n;var a=t.indexOf("%");i=r*parseFloat(t.slice(0,a))/100}else i=+t;return ca(i)&&(i=n),o&&r!=null&&i>r&&(i=r),i},mN=e=>{if(!Array.isArray(e))return!1;for(var t=e.length,r={},n=0;nn&&(typeof t=="function"?t(n):hN(n,t))===r)}var $r=e=>e===null||typeof e>"u",uh=e=>$r(e)?e:"".concat(e.charAt(0).toUpperCase()).concat(e.slice(1));function pi(e){return e!=null}function ed(){}var Zce=["type","size","sizeType"];function S2(){return S2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var t="symbol".concat(uh(e));return yN[t]||G6},nue=(e,t,r)=>{if(t==="area")return e;switch(r){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var n=18*tue;return 1.25*e*e*(Math.tan(n)-Math.tan(n*2)*Math.tan(n)**2)}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},oue=(e,t)=>{yN["symbol".concat(uh(e))]=t},vN=e=>{var{type:t="circle",size:r=64,sizeType:n="area"}=e,o=Jce(e,Zce),i=WT(WT({},o),{},{type:t,size:r,sizeType:n}),a="circle";typeof t=="string"&&(a=t);var s=()=>{var f=rue(a),p=Ice().type(f).size(nue(r,n,a)),h=p();if(h!==null)return h},{className:l,cx:u,cy:c}=i,d=qr(i);return Be(u)&&Be(c)&&Be(r)?v.createElement("path",S2({},d,{className:se("recharts-symbols",l),transform:"translate(".concat(u,", ").concat(c,")"),d:s()})):null};vN.registerSymbol=oue;var bN=e=>"radius"in e&&"startAngle"in e&&"endAngle"in e,K6=(e,t)=>{if(!e||typeof e=="function"||typeof e=="boolean")return null;var r=e;if(v.isValidElement(e)&&(r=e.props),typeof r!="object"&&typeof r!="function")return null;var n={};return Object.keys(r).forEach(o=>{GM(o)&&(n[o]=i=>r[o](r,i))}),n};function HT(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function iue(e){for(var t=1;t(a[s]===void 0&&n[s]!==void 0&&(a[s]=n[s]),a),r);return i}var wN={},xN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){const o=new Map;for(let i=0;i=0}e.isLength=t})(EN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=EN;function r(n){return n!=null&&typeof n!="function"&&t.isLength(n.length)}e.isArrayLike=r})(_v);var PN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="object"&&r!==null}e.isObjectLike=t})(PN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_v,r=PN;function n(o){return r.isObjectLike(o)&&t.isArrayLike(o)}e.isArrayLikeObject=n})(CN);var AN={},kN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=Tv;function r(n){return function(o){return t.get(o,n)}}e.property=r})(kN);var TN={},Y6={},IN={},X6={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r!==null&&(typeof r=="object"||typeof r=="function")}e.isObject=t})(X6);var Q6={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null||typeof r!="object"&&typeof r!="function"}e.isPrimitive=t})(Q6);var J6={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n){return r===n||Number.isNaN(r)&&Number.isNaN(n)}e.isEqualsSameValueZero=t})(J6);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=X6,r=Q6,n=J6;function o(c,d,f){return typeof f!="function"?o(c,d,()=>{}):i(c,d,function p(h,m,g,y,w,S){const x=f(h,m,g,y,w,S);return x!==void 0?!!x:i(h,m,p,S)},new Map)}function i(c,d,f,p){if(d===c)return!0;switch(typeof d){case"object":return a(c,d,f,p);case"function":return Object.keys(d).length>0?i(c,{...d},f,p):n.isEqualsSameValueZero(c,d);default:return t.isObject(c)?typeof d=="string"?d==="":!0:n.isEqualsSameValueZero(c,d)}}function a(c,d,f,p){if(d==null)return!0;if(Array.isArray(d))return l(c,d,f,p);if(d instanceof Map)return s(c,d,f,p);if(d instanceof Set)return u(c,d,f,p);const h=Object.keys(d);if(c==null||r.isPrimitive(c))return h.length===0;if(h.length===0)return!0;if(p!=null&&p.has(d))return p.get(d)===c;p==null||p.set(d,c);try{for(let m=0;m{})}e.isMatch=r})(Y6);var ON={},eC={},_N={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Object.getOwnPropertySymbols(r).filter(n=>Object.prototype.propertyIsEnumerable.call(r,n))}e.getSymbols=t})(_N);var $v={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r==null?r===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(r)}e.getTag=t})($v);var tC={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t="[object RegExp]",r="[object String]",n="[object Number]",o="[object Boolean]",i="[object Arguments]",a="[object Symbol]",s="[object Date]",l="[object Map]",u="[object Set]",c="[object Array]",d="[object Function]",f="[object ArrayBuffer]",p="[object Object]",h="[object Error]",m="[object DataView]",g="[object Uint8Array]",y="[object Uint8ClampedArray]",w="[object Uint16Array]",S="[object Uint32Array]",x="[object BigUint64Array]",P="[object Int8Array]",A="[object Int16Array]",T="[object Int32Array]",I="[object BigInt64Array]",O="[object Float32Array]",_="[object Float64Array]";e.argumentsTag=i,e.arrayBufferTag=f,e.arrayTag=c,e.bigInt64ArrayTag=I,e.bigUint64ArrayTag=x,e.booleanTag=o,e.dataViewTag=m,e.dateTag=s,e.errorTag=h,e.float32ArrayTag=O,e.float64ArrayTag=_,e.functionTag=d,e.int16ArrayTag=A,e.int32ArrayTag=T,e.int8ArrayTag=P,e.mapTag=l,e.numberTag=n,e.objectTag=p,e.regexpTag=t,e.setTag=u,e.stringTag=r,e.symbolTag=a,e.uint16ArrayTag=w,e.uint32ArrayTag=S,e.uint8ArrayTag=g,e.uint8ClampedArrayTag=y})(tC);var $N={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return ArrayBuffer.isView(r)&&!(r instanceof DataView)}e.isTypedArray=t})($N);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=_N,r=$v,n=tC,o=Q6,i=$N;function a(c,d){return s(c,void 0,c,new Map,d)}function s(c,d,f,p=new Map,h=void 0){const m=h==null?void 0:h(c,d,f,p);if(m!==void 0)return m;if(o.isPrimitive(c))return c;if(p.has(c))return p.get(c);if(Array.isArray(c)){const g=new Array(c.length);p.set(c,g);for(let y=0;yt.isMatch(i,o)}e.matches=n})(TN);var RN={},jN={},MN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=eC,r=$v,n=tC;function o(i,a){return t.cloneDeepWith(i,(s,l,u,c)=>{const d=a==null?void 0:a(s,l,u,c);if(d!==void 0)return d;if(typeof i=="object"){if(r.getTag(i)===n.objectTag&&typeof i.constructor!="function"){const f={};return c.set(i,f),t.copyProperties(f,i,u,c),f}switch(Object.prototype.toString.call(i)){case n.numberTag:case n.stringTag:case n.booleanTag:{const f=new i.constructor(i==null?void 0:i.valueOf());return t.copyProperties(f,i),f}case n.argumentsTag:{const f={};return t.copyProperties(f,i),f.length=i.length,f[Symbol.iterator]=i[Symbol.iterator],f}default:return}}})}e.cloneDeepWith=o})(MN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=MN;function r(n){return t.cloneDeepWith(n)}e.cloneDeep=r})(jN);var NN={},rC={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=/^(?:0|[1-9]\d*)$/;function r(n,o=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?vue:yue;FN.useSyncExternalStore=_u.useSyncExternalStore!==void 0?_u.useSyncExternalStore:bue;zN.exports=FN;var wue=zN.exports;/** + * @license React + * use-sync-external-store-shim/with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var Rv=v,xue=wue;function Sue(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cue=typeof Object.is=="function"?Object.is:Sue,Eue=xue.useSyncExternalStore,Pue=Rv.useRef,Aue=Rv.useEffect,kue=Rv.useMemo,Tue=Rv.useDebugValue;DN.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var i=Pue(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=kue(function(){function l(p){if(!u){if(u=!0,c=p,p=n(p),o!==void 0&&a.hasValue){var h=a.value;if(o(h,p))return d=h}return d=p}if(h=d,Cue(c,p))return h;var m=n(p);return o!==void 0&&o(h,m)?(c=p,h):(c=p,d=m)}var u=!1,c,d,f=r===void 0?null:r;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,r,n,o]);var s=Eue(e,i[0],i[1]);return Aue(function(){a.hasValue=!0,a.value=s},[s]),Tue(s),s};LN.exports=DN;var Iue=LN.exports,nC=v.createContext(null),Oue=e=>e,Xr=()=>{var e=v.useContext(nC);return e?e.store.dispatch:Oue},K0=()=>{},_ue=()=>K0,$ue=(e,t)=>e===t;function Ge(e){var t=v.useContext(nC),r=v.useMemo(()=>t?n=>{if(n!=null)return e(n)}:K0,[t,e]);return Iue.useSyncExternalStoreWithSelector(t?t.subscription.addNestedSub:_ue,t?t.store.getState:K0,t?t.store.getState:K0,r,$ue)}function Rue(e,t=`expected a function, instead received ${typeof e}`){if(typeof e!="function")throw new TypeError(t)}function jue(e,t=`expected an object, instead received ${typeof e}`){if(typeof e!="object")throw new TypeError(t)}function Mue(e,t="expected all items to be functions, instead received the following types: "){if(!e.every(r=>typeof r=="function")){const r=e.map(n=>typeof n=="function"?`function ${n.name||"unnamed"}()`:typeof n).join(", ");throw new TypeError(`${t}[${r}]`)}}var GT=e=>Array.isArray(e)?e:[e];function Nue(e){const t=Array.isArray(e[0])?e[0]:e;return Mue(t,"createSelector expects all input-selectors to be functions, but received the following types: "),t}function Bue(e,t){const r=[],{length:n}=e;for(let o=0;o{r=u0(),a.resetResultsCount()},a.resultsCount=()=>i,a.resetResultsCount=()=>{i=0},a}function Fue(e,...t){const r=typeof e=="function"?{memoize:e,memoizeOptions:t}:e,n=(...o)=>{let i=0,a=0,s,l={},u=o.pop();typeof u=="object"&&(l=u,u=o.pop()),Rue(u,`createSelector expects an output function after the inputs, but received: [${typeof u}]`);const c={...r,...l},{memoize:d,memoizeOptions:f=[],argsMemoize:p=UN,argsMemoizeOptions:h=[]}=c,m=GT(f),g=GT(h),y=Nue(o),w=d(function(){return i++,u.apply(null,arguments)},...m),S=p(function(){a++;const P=Bue(y,arguments);return s=w.apply(null,P),s},...g);return Object.assign(S,{resultFunc:u,memoizedResultFunc:w,dependencies:y,dependencyRecomputations:()=>a,resetDependencyRecomputations:()=>{a=0},lastResult:()=>s,recomputations:()=>i,resetRecomputations:()=>{i=0},memoize:d,argsMemoize:p})};return Object.assign(n,{withTypes:()=>n}),n}var X=Fue(UN),Uue=Object.assign((e,t=X)=>{jue(e,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof e}`);const r=Object.keys(e),n=r.map(i=>e[i]);return t(n,(...i)=>i.reduce((a,s,l)=>(a[r[l]]=s,a),{}))},{withTypes:()=>Uue}),WN={},HN={},VN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const r=(n,o,i)=>{if(n!==o){const a=t(n),s=t(o);if(a===s&&a===0){if(no)return i==="desc"?-1:1}return i==="desc"?s-a:a-s}return 0};e.compareValues=r})(VN);var GN={},oC={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return typeof r=="symbol"||r instanceof Symbol}e.isSymbol=t})(oC);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oC,r=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,n=/^\w*$/;function o(i,a){return Array.isArray(i)?!1:typeof i=="number"||typeof i=="boolean"||i==null||t.isSymbol(i)?!0:typeof i=="string"&&(n.test(i)||!r.test(i))||a!=null&&Object.hasOwn(a,i)}e.isKey=o})(GN);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=VN,r=GN,n=Ov;function o(i,a,s,l){if(i==null)return[];s=l?void 0:s,Array.isArray(i)||(i=Object.values(i)),Array.isArray(a)||(a=a==null?[null]:[a]),a.length===0&&(a=[null]),Array.isArray(s)||(s=s==null?[]:[s]),s=s.map(p=>String(p));const u=(p,h)=>{let m=p;for(let g=0;gh==null||p==null?h:typeof p=="object"&&"key"in p?Object.hasOwn(h,p.key)?h[p.key]:u(h,p.path):typeof p=="function"?p(h):Array.isArray(p)?u(h,p):typeof h=="object"?h[p]:h,d=a.map(p=>(Array.isArray(p)&&p.length===1&&(p=p[0]),p==null||typeof p=="function"||Array.isArray(p)||r.isKey(p)?p:{key:p,path:n.toPath(p)}));return i.map(p=>({original:p,criteria:d.map(h=>c(h,p))})).slice().sort((p,h)=>{for(let m=0;mp.original)}e.orderBy=o})(HN);var qN={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n=1){const o=[],i=Math.floor(n),a=(s,l)=>{for(let u=0;u1&&n.isIterateeCall(i,a[0],a[1])?a=[]:s>2&&n.isIterateeCall(a[0],a[1],a[2])&&(a=[a[0]]),t.orderBy(i,r.flatten(a),["asc"])}e.sortBy=o})(WN);var Wue=WN.sortBy;const jv=Ti(Wue);var KN=e=>e.legend.settings,Hue=e=>e.legend.size,Vue=e=>e.legend.payload;X([Vue,KN],(e,t)=>{var{itemSorter:r}=t,n=e.flat(1);return r?jv(n,r):n});var d0=1;function Gue(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[t,r]=v.useState({height:0,left:0,top:0,width:0}),n=v.useCallback(o=>{if(o!=null){var i=o.getBoundingClientRect(),a={height:i.height,left:i.left,top:i.top,width:i.width};(Math.abs(a.height-t.height)>d0||Math.abs(a.left-t.left)>d0||Math.abs(a.top-t.top)>d0||Math.abs(a.width-t.width)>d0)&&r({height:a.height,left:a.left,top:a.top,width:a.width})}},[t.width,t.height,t.top,t.left,...e]);return[t,n]}function Cr(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. `}var que=typeof Symbol=="function"&&Symbol.observable||"@@observable",KT=que,R1=()=>Math.random().toString(36).substring(7).split("").join("."),Kue={INIT:`@@redux/INIT${R1()}`,REPLACE:`@@redux/REPLACE${R1()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${R1()}`},og=Kue;function aC(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function ZN(e,t,r){if(typeof e!="function")throw new Error(Cr(2));if(typeof t=="function"&&typeof r=="function"||typeof r=="function"&&typeof arguments[3]=="function")throw new Error(Cr(0));if(typeof t=="function"&&typeof r>"u"&&(r=t,t=void 0),typeof r<"u"){if(typeof r!="function")throw new Error(Cr(1));return r(ZN)(e,t)}let n=e,o=t,i=new Map,a=i,s=0,l=!1;function u(){a===i&&(a=new Map,i.forEach((g,y)=>{a.set(y,g)}))}function c(){if(l)throw new Error(Cr(3));return o}function d(g){if(typeof g!="function")throw new Error(Cr(4));if(l)throw new Error(Cr(5));let y=!0;u();const w=s++;return a.set(w,g),function(){if(y){if(l)throw new Error(Cr(6));y=!1,u(),a.delete(w),i=null}}}function f(g){if(!aC(g))throw new Error(Cr(7));if(typeof g.type>"u")throw new Error(Cr(8));if(typeof g.type!="string")throw new Error(Cr(17));if(l)throw new Error(Cr(9));try{l=!0,o=n(o,g)}finally{l=!1}return(i=a).forEach(w=>{w()}),g}function p(g){if(typeof g!="function")throw new Error(Cr(10));n=g,f({type:og.REPLACE})}function h(){const g=d;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(Cr(11));function w(){const x=y;x.next&&x.next(c())}return w(),{unsubscribe:g(w)}},[KT](){return this}}}return f({type:og.INIT}),{dispatch:f,subscribe:d,getState:c,replaceReducer:p,[KT]:h}}function Zue(e){Object.keys(e).forEach(t=>{const r=e[t];if(typeof r(void 0,{type:og.INIT})>"u")throw new Error(Cr(12));if(typeof r(void 0,{type:og.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Cr(13))})}function YN(e){const t=Object.keys(e),r={};for(let i=0;i"u")throw s&&s.type,new Error(Cr(14));u[d]=h,l=l||h!==p}return l=l||n.length!==Object.keys(a).length,l?u:a}}function ig(...e){return e.length===0?t=>t:e.length===1?e[0]:e.reduce((t,r)=>(...n)=>t(r(...n)))}function Yue(...e){return t=>(r,n)=>{const o=t(r,n);let i=()=>{throw new Error(Cr(15))};const a={getState:o.getState,dispatch:(l,...u)=>i(l,...u)},s=e.map(l=>l(a));return i=ig(...s)(o.dispatch),{...o,dispatch:i}}}function XN(e){return aC(e)&&"type"in e&&typeof e.type=="string"}var QN=Symbol.for("immer-nothing"),ZT=Symbol.for("immer-draftable"),Kr=Symbol.for("immer-state");function So(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Pn=Object,$u=Pn.getPrototypeOf,ag="constructor",Mv="prototype",C2="configurable",sg="enumerable",Z0="writable",bp="value",da=e=>!!e&&!!e[Kr];function Do(e){var t;return e?JN(e)||Bv(e)||!!e[ZT]||!!((t=e[ag])!=null&&t[ZT])||Lv(e)||Dv(e):!1}var Xue=Pn[Mv][ag].toString(),YT=new WeakMap;function JN(e){if(!e||!sC(e))return!1;const t=$u(e);if(t===null||t===Pn[Mv])return!0;const r=Pn.hasOwnProperty.call(t,ag)&&t[ag];if(r===Object)return!0;if(!mc(r))return!1;let n=YT.get(r);return n===void 0&&(n=Function.toString.call(r),YT.set(r,n)),n===Xue}function Nv(e,t,r=!0){dh(e)===0?(r?Reflect.ownKeys(e):Pn.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function dh(e){const t=e[Kr];return t?t.type_:Bv(e)?1:Lv(e)?2:Dv(e)?3:0}var XT=(e,t,r=dh(e))=>r===2?e.has(t):Pn[Mv].hasOwnProperty.call(e,t),E2=(e,t,r=dh(e))=>r===2?e.get(t):e[t],lg=(e,t,r,n=dh(e))=>{n===2?e.set(t,r):n===3?e.add(r):e[t]=r};function Que(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var Bv=Array.isArray,Lv=e=>e instanceof Map,Dv=e=>e instanceof Set,sC=e=>typeof e=="object",mc=e=>typeof e=="function",j1=e=>typeof e=="boolean";function Jue(e){const t=+e;return Number.isInteger(t)&&String(t)===e}var Fi=e=>e.copy_||e.base_,lC=e=>e.modified_?e.copy_:e.base_;function P2(e,t){if(Lv(e))return new Map(e);if(Dv(e))return new Set(e);if(Bv(e))return Array[Mv].slice.call(e);const r=JN(e);if(t===!0||t==="class_only"&&!r){const n=Pn.getOwnPropertyDescriptors(e);delete n[Kr];let o=Reflect.ownKeys(n);for(let i=0;i1&&Pn.defineProperties(e,{set:f0,add:f0,clear:f0,delete:f0}),Pn.freeze(e),t&&Nv(e,(r,n)=>{cC(n,!0)},!1)),e}function ede(){So(2)}var f0={[bp]:ede};function zv(e){return e===null||!sC(e)?!0:Pn.isFrozen(e)}var cg="MapSet",A2="Patches",QT="ArrayMethods",eB={};function Dl(e){const t=eB[e];return t||So(0,e),t}var JT=e=>!!eB[e],wp,tB=()=>wp,tde=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:JT(cg)?Dl(cg):void 0,arrayMethodsPlugin_:JT(QT)?Dl(QT):void 0});function eI(e,t){t&&(e.patchPlugin_=Dl(A2),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function k2(e){T2(e),e.drafts_.forEach(rde),e.drafts_=null}function T2(e){e===wp&&(wp=e.parent_)}var tI=e=>wp=tde(wp,e);function rde(e){const t=e[Kr];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function rI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];if(e!==void 0&&e!==r){r[Kr].modified_&&(k2(t),So(4)),Do(e)&&(e=nI(t,e));const{patchPlugin_:o}=t;o&&o.generateReplacementPatches_(r[Kr].base_,e,t)}else e=nI(t,r);return nde(t,e,!0),k2(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==QN?e:void 0}function nI(e,t){if(zv(t))return t;const r=t[Kr];if(!r)return ug(t,e.handledSet_,e);if(!Fv(r,e))return t;if(!r.modified_)return r.base_;if(!r.finalized_){const{callbacks_:n}=r;if(n)for(;n.length>0;)n.pop()(e);oB(r,e)}return r.copy_}function nde(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&cC(t,r)}function rB(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var Fv=(e,t)=>e.scope_===t,ode=[];function nB(e,t,r,n){const o=Fi(e),i=e.type_;if(n!==void 0&&E2(o,n,i)===t){lg(o,n,r,i);return}if(!e.draftLocations_){const s=e.draftLocations_=new Map;Nv(o,(l,u)=>{if(da(u)){const c=s.get(u)||[];c.push(l),s.set(u,c)}})}const a=e.draftLocations_.get(t)??ode;for(const s of a)lg(o,s,r,i)}function ide(e,t,r){e.callbacks_.push(function(o){var s;const i=t;if(!i||!Fv(i,o))return;(s=o.mapSetPlugin_)==null||s.fixSetContents(i);const a=lC(i);nB(e,i.draft_??i,a,r),oB(i,o)})}function oB(e,t){var n;if(e.modified_&&!e.finalized_&&(e.type_===3||e.type_===1&&e.allIndicesReassigned_||(((n=e.assigned_)==null?void 0:n.size)??0)>0)){const{patchPlugin_:o}=t;if(o){const i=o.getPath(e);i&&o.generatePatches_(e,i,t)}rB(e)}}function ade(e,t,r){const{scope_:n}=e;if(da(r)){const o=r[Kr];Fv(o,n)&&o.callbacks_.push(function(){Y0(e);const a=lC(o);nB(e,r,a,t)})}else Do(r)&&e.callbacks_.push(function(){const i=Fi(e);e.type_===3?i.has(r)&&ug(r,n.handledSet_,n):E2(i,t,e.type_)===r&&n.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&ug(E2(e.copy_,t,e.type_),n.handledSet_,n)})}function ug(e,t,r){return!r.immer_.autoFreeze_&&r.unfinalizedDrafts_<1||da(e)||t.has(e)||!Do(e)||zv(e)||(t.add(e),Nv(e,(n,o)=>{if(da(o)){const i=o[Kr];if(Fv(i,r)){const a=lC(i);lg(e,n,a,e.type_),rB(i)}}else Do(o)&&ug(o,t,r)})),e}function sde(e,t){const r=Bv(e),n={type_:r?1:0,scope_:t?t.scope_:tB(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let o=n,i=dg;r&&(o=[n],i=xp);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,[s,n]}var dg={get(e,t){if(t===Kr)return e;let r=e.scope_.arrayMethodsPlugin_;const n=e.type_===1&&typeof t=="string";if(n&&r!=null&&r.isArrayOperationMethod(t))return r.createMethodInterceptor(e,t);const o=Fi(e);if(!XT(o,t,e.type_))return lde(e,o,t);const i=o[t];if(e.finalized_||!Do(i)||n&&e.operationMethod&&(r!=null&&r.isMutatingArrayMethod(e.operationMethod))&&Jue(t))return i;if(i===M1(e.base_,t)){Y0(e);const a=e.type_===1?+t:t,s=O2(e.scope_,i,e,a);return e.copy_[a]=s}return i},has(e,t){return t in Fi(e)},ownKeys(e){return Reflect.ownKeys(Fi(e))},set(e,t,r){const n=iB(Fi(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=M1(Fi(e),t),i=o==null?void 0:o[Kr];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_.set(t,!1),!0;if(Que(r,o)&&(r!==void 0||XT(e.base_,t,e.type_)))return!0;Y0(e),I2(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_.set(t,!0),ade(e,t,r)),!0},deleteProperty(e,t){return Y0(e),M1(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),I2(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Fi(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{[Z0]:!0,[C2]:e.type_!==1||t!=="length",[sg]:n[sg],[bp]:r[t]}},defineProperty(){So(11)},getPrototypeOf(e){return $u(e.base_)},setPrototypeOf(){So(12)}},xp={};for(let e in dg){let t=dg[e];xp[e]=function(){const r=arguments;return r[0]=r[0][0],t.apply(this,r)}}xp.deleteProperty=function(e,t){return xp.set.call(this,e,t,void 0)};xp.set=function(e,t,r){return dg.set.call(this,e[0],t,r,e[0])};function M1(e,t){const r=e[Kr];return(r?Fi(r):e)[t]}function lde(e,t,r){var o;const n=iB(t,r);return n?bp in n?n[bp]:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function iB(e,t){if(!(t in e))return;let r=$u(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=$u(r)}}function I2(e){e.modified_||(e.modified_=!0,e.parent_&&I2(e.parent_))}function Y0(e){e.copy_||(e.assigned_=new Map,e.copy_=P2(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var cde=class{constructor(t){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(r,n,o)=>{if(mc(r)&&!mc(n)){const a=n;n=r;const s=this;return function(u=a,...c){return s.produce(u,d=>n.call(this,d,...c))}}mc(n)||So(6),o!==void 0&&!mc(o)&&So(7);let i;if(Do(r)){const a=tI(this),s=O2(a,r,void 0);let l=!0;try{i=n(s),l=!1}finally{l?k2(a):T2(a)}return eI(a,o),rI(i,a)}else if(!r||!sC(r)){if(i=n(r),i===void 0&&(i=r),i===QN&&(i=void 0),this.autoFreeze_&&cC(i,!0),o){const a=[],s=[];Dl(A2).generateReplacementPatches_(r,i,{patches_:a,inversePatches_:s}),o(a,s)}return i}else So(1,r)},this.produceWithPatches=(r,n)=>{if(mc(r))return(s,...l)=>this.produceWithPatches(s,u=>r(u,...l));let o,i;return[this.produce(r,n,(s,l)=>{o=s,i=l}),o,i]},j1(t==null?void 0:t.autoFreeze)&&this.setAutoFreeze(t.autoFreeze),j1(t==null?void 0:t.useStrictShallowCopy)&&this.setUseStrictShallowCopy(t.useStrictShallowCopy),j1(t==null?void 0:t.useStrictIteration)&&this.setUseStrictIteration(t.useStrictIteration)}createDraft(t){Do(t)||So(8),da(t)&&(t=Io(t));const r=tI(this),n=O2(r,t,void 0);return n[Kr].isManual_=!0,T2(r),n}finishDraft(t,r){const n=t&&t[Kr];(!n||!n.isManual_)&&So(9);const{scope_:o}=n;return eI(o,r),rI(void 0,o)}setAutoFreeze(t){this.autoFreeze_=t}setUseStrictShallowCopy(t){this.useStrictShallowCopy_=t}setUseStrictIteration(t){this.useStrictIteration_=t}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(t,r){let n;for(n=r.length-1;n>=0;n--){const i=r[n];if(i.path.length===0&&i.op==="replace"){t=i.value;break}}n>-1&&(r=r.slice(n+1));const o=Dl(A2).applyPatches_;return da(t)?o(t,r):this.produce(t,i=>o(i,r))}};function O2(e,t,r,n){const[o,i]=Lv(t)?Dl(cg).proxyMap_(t,r):Dv(t)?Dl(cg).proxySet_(t,r):sde(t,r);return((r==null?void 0:r.scope_)??tB()).drafts_.push(o),i.callbacks_=(r==null?void 0:r.callbacks_)??[],i.key_=n,r&&n!==void 0?ide(r,i,n):i.callbacks_.push(function(l){var c;(c=l.mapSetPlugin_)==null||c.fixSetContents(i);const{patchPlugin_:u}=l;i.modified_&&u&&u.generatePatches_(i,[],l)}),o}function Io(e){return da(e)||So(10,e),aB(e)}function aB(e){if(!Do(e)||zv(e))return e;const t=e[Kr];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=P2(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=P2(e,!0);return Nv(r,(o,i)=>{lg(r,o,aB(i))},n),t&&(t.finalized_=!1),r}var ude=new cde,sB=ude.produce;function lB(e){return({dispatch:r,getState:n})=>o=>i=>typeof i=="function"?i(r,n,e):o(i)}var dde=lB(),fde=lB,pde=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?ig:ig.apply(null,arguments)};function uo(e,t){function r(...n){if(t){let o=t(...n);if(!o)throw new Error(Tn(0));return{type:e,payload:o.payload,..."meta"in o&&{meta:o.meta},..."error"in o&&{error:o.error}}}return{type:e,payload:n[0]}}return r.toString=()=>`${e}`,r.type=e,r.match=n=>XN(n)&&n.type===e,r}var cB=class Xd extends Array{constructor(...t){super(...t),Object.setPrototypeOf(this,Xd.prototype)}static get[Symbol.species](){return Xd}concat(...t){return super.concat.apply(this,t)}prepend(...t){return t.length===1&&Array.isArray(t[0])?new Xd(...t[0].concat(this)):new Xd(...t.concat(this))}};function oI(e){return Do(e)?sB(e,()=>{}):e}function p0(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}function hde(e){return typeof e=="boolean"}var mde=()=>function(t){const{thunk:r=!0,immutableCheck:n=!0,serializableCheck:o=!0,actionCreatorCheck:i=!0}=t??{};let a=new cB;return r&&(hde(r)?a.push(dde):a.push(fde(r.extraArgument))),a},uB="RTK_autoBatch",Ot=()=>e=>({payload:e,meta:{[uB]:!0}}),iI=e=>t=>{setTimeout(t,e)},dB=(e={type:"raf"})=>t=>(...r)=>{const n=t(...r);let o=!0,i=!1,a=!1;const s=new Set,l=e.type==="tick"?queueMicrotask:e.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:iI(10):e.type==="callback"?e.queueNotification:iI(e.timeout),u=()=>{a=!1,i&&(i=!1,s.forEach(c=>c()))};return Object.assign({},n,{subscribe(c){const d=()=>o&&c(),f=n.subscribe(d);return s.add(c),()=>{f(),s.delete(c)}},dispatch(c){var d;try{return o=!((d=c==null?void 0:c.meta)!=null&&d[uB]),i=!o,i&&(a||(a=!0,l(u))),n.dispatch(c)}finally{o=!0}}})},gde=e=>function(r){const{autoBatch:n=!0}=r??{};let o=new cB(e);return n&&o.push(dB(typeof n=="object"?n:void 0)),o};function yde(e){const t=mde(),{reducer:r=void 0,middleware:n,devTools:o=!0,preloadedState:i=void 0,enhancers:a=void 0}=e||{};let s;if(typeof r=="function")s=r;else if(aC(r))s=YN(r);else throw new Error(Tn(1));let l;typeof n=="function"?l=n(t):l=t();let u=ig;o&&(u=pde({trace:!1,...typeof o=="object"&&o}));const c=Yue(...l),d=gde(c);let f=typeof a=="function"?a(d):d();const p=u(...f);return ZN(s,i,p)}function fB(e){const t={},r=[];let n;const o={addCase(i,a){const s=typeof i=="string"?i:i.type;if(!s)throw new Error(Tn(28));if(s in t)throw new Error(Tn(29));return t[s]=a,o},addAsyncThunk(i,a){return a.pending&&(t[i.pending.type]=a.pending),a.rejected&&(t[i.rejected.type]=a.rejected),a.fulfilled&&(t[i.fulfilled.type]=a.fulfilled),a.settled&&r.push({matcher:i.settled,reducer:a.settled}),o},addMatcher(i,a){return r.push({matcher:i,reducer:a}),o},addDefaultCase(i){return n=i,o}};return e(o),[t,r,n]}function vde(e){return typeof e=="function"}function bde(e,t){let[r,n,o]=fB(t),i;if(vde(e))i=()=>oI(e());else{const s=oI(e);i=()=>s}function a(s=i(),l){let u=[r[l.type],...n.filter(({matcher:c})=>c(l)).map(({reducer:c})=>c)];return u.filter(c=>!!c).length===0&&(u=[o]),u.reduce((c,d)=>{if(d)if(da(c)){const p=d(c,l);return p===void 0?c:p}else{if(Do(c))return sB(c,f=>d(f,l));{const f=d(c,l);if(f===void 0){if(c===null)return c;throw Error("A case reducer on a non-draftable value must not return undefined")}return f}}return c},s)}return a.getInitialState=i,a}var wde="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",xde=(e=21)=>{let t="",r=e;for(;r--;)t+=wde[Math.random()*64|0];return t},Sde=Symbol.for("rtk-slice-createasyncthunk");function Cde(e,t){return`${e}/${t}`}function Ede({creators:e}={}){var r;const t=(r=e==null?void 0:e.asyncThunk)==null?void 0:r[Sde];return function(o){const{name:i,reducerPath:a=i}=o;if(!i)throw new Error(Tn(11));typeof fse<"u";const s=(typeof o.reducers=="function"?o.reducers(Ade()):o.reducers)||{},l=Object.keys(s),u={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},c={addCase(x,P){const A=typeof x=="string"?x:x.type;if(!A)throw new Error(Tn(12));if(A in u.sliceCaseReducersByType)throw new Error(Tn(13));return u.sliceCaseReducersByType[A]=P,c},addMatcher(x,P){return u.sliceMatchers.push({matcher:x,reducer:P}),c},exposeAction(x,P){return u.actionCreators[x]=P,c},exposeCaseReducer(x,P){return u.sliceCaseReducersByName[x]=P,c}};l.forEach(x=>{const P=s[x],A={reducerName:x,type:Cde(i,x),createNotation:typeof o.reducers=="function"};Tde(P)?Ode(A,P,c,t):kde(A,P,c)});function d(){const[x={},P=[],A=void 0]=typeof o.extraReducers=="function"?fB(o.extraReducers):[o.extraReducers],T={...x,...u.sliceCaseReducersByType};return bde(o.initialState,I=>{for(let O in T)I.addCase(O,T[O]);for(let O of u.sliceMatchers)I.addMatcher(O.matcher,O.reducer);for(let O of P)I.addMatcher(O.matcher,O.reducer);A&&I.addDefaultCase(A)})}const f=x=>x,p=new Map,h=new WeakMap;let m;function g(x,P){return m||(m=d()),m(x,P)}function y(){return m||(m=d()),m.getInitialState()}function w(x,P=!1){function A(I){let O=I[x];return typeof O>"u"&&P&&(O=p0(h,A,y)),O}function T(I=f){const O=p0(p,P,()=>new WeakMap);return p0(O,I,()=>{const _={};for(const[R,E]of Object.entries(o.selectors??{}))_[R]=Pde(E,I,()=>p0(h,I,y),P);return _})}return{reducerPath:x,getSelectors:T,get selectors(){return T(A)},selectSlice:A}}const S={name:i,reducer:g,actions:u.actionCreators,caseReducers:u.sliceCaseReducersByName,getInitialState:y,...w(a),injectInto(x,{reducerPath:P,...A}={}){const T=P??a;return x.inject({reducerPath:T,reducer:g},A),{...S,...w(T,!0)}}};return S}}function Pde(e,t,r,n){function o(i,...a){let s=t(i);return typeof s>"u"&&n&&(s=r()),e(s,...a)}return o.unwrapped=e,o}var vn=Ede();function Ade(){function e(t,r){return{_reducerDefinitionType:"asyncThunk",payloadCreator:t,...r}}return e.withTypes=()=>e,{reducer(t){return Object.assign({[t.name](...r){return t(...r)}}[t.name],{_reducerDefinitionType:"reducer"})},preparedReducer(t,r){return{_reducerDefinitionType:"reducerWithPrepare",prepare:t,reducer:r}},asyncThunk:e}}function kde({type:e,reducerName:t,createNotation:r},n,o){let i,a;if("reducer"in n){if(r&&!Ide(n))throw new Error(Tn(17));i=n.reducer,a=n.prepare}else i=n;o.addCase(e,i).exposeCaseReducer(t,i).exposeAction(t,a?uo(e,a):uo(e))}function Tde(e){return e._reducerDefinitionType==="asyncThunk"}function Ide(e){return e._reducerDefinitionType==="reducerWithPrepare"}function Ode({type:e,reducerName:t},r,n,o){if(!o)throw new Error(Tn(18));const{payloadCreator:i,fulfilled:a,pending:s,rejected:l,settled:u,options:c}=r,d=o(e,i,c);n.exposeAction(t,d),a&&n.addCase(d.fulfilled,a),s&&n.addCase(d.pending,s),l&&n.addCase(d.rejected,l),u&&n.addMatcher(d.settled,u),n.exposeCaseReducer(t,{fulfilled:a||h0,pending:s||h0,rejected:l||h0,settled:u||h0})}function h0(){}var _de="task",pB="listener",hB="completed",uC="cancelled",$de=`task-${uC}`,Rde=`task-${hB}`,_2=`${pB}-${uC}`,jde=`${pB}-${hB}`,Uv=class{constructor(e){Ls(this,"name","TaskAbortError");Ls(this,"message");this.code=e,this.message=`${_de} ${uC} (reason: ${e})`}},dC=(e,t)=>{if(typeof e!="function")throw new TypeError(Tn(32))},fg=()=>{},mB=(e,t=fg)=>(e.catch(t),e),gB=(e,t)=>(e.addEventListener("abort",t,{once:!0}),()=>e.removeEventListener("abort",t)),wl=e=>{if(e.aborted)throw new Uv(e.reason)};function yB(e,t){let r=fg;return new Promise((n,o)=>{const i=()=>o(new Uv(e.reason));if(e.aborted){i();return}r=gB(e,i),t.finally(()=>r()).then(n,o)}).finally(()=>{r=fg})}var Mde=async(e,t)=>{try{return await Promise.resolve(),{status:"ok",value:await e()}}catch(r){return{status:r instanceof Uv?"cancelled":"rejected",error:r}}finally{t==null||t()}},pg=e=>t=>mB(yB(e,t).then(r=>(wl(e),r))),vB=e=>{const t=pg(e);return r=>t(new Promise(n=>setTimeout(n,r)))},{assign:Qc}=Object,aI={},Wv="listenerMiddleware",Nde=(e,t)=>{const r=n=>gB(e,()=>n.abort(e.reason));return(n,o)=>{dC(n);const i=new AbortController;r(i);const a=Mde(async()=>{wl(e),wl(i.signal);const s=await n({pause:pg(i.signal),delay:vB(i.signal),signal:i.signal});return wl(i.signal),s},()=>i.abort(Rde));return o!=null&&o.autoJoin&&t.push(a.catch(fg)),{result:pg(e)(a),cancel(){i.abort($de)}}}},Bde=(e,t)=>{const r=async(n,o)=>{wl(t);let i=()=>{};const s=[new Promise((l,u)=>{let c=e({predicate:n,effect:(d,f)=>{f.unsubscribe(),l([d,f.getState(),f.getOriginalState()])}});i=()=>{c(),u()}})];o!=null&&s.push(new Promise(l=>setTimeout(l,o,null)));try{const l=await yB(t,Promise.race(s));return wl(t),l}finally{i()}};return(n,o)=>mB(r(n,o))},bB=e=>{let{type:t,actionCreator:r,matcher:n,predicate:o,effect:i}=e;if(t)o=uo(t).match;else if(r)t=r.type,o=r.match;else if(n)o=n;else if(!o)throw new Error(Tn(21));return dC(i),{predicate:o,type:t,effect:i}},wB=Qc(e=>{const{type:t,predicate:r,effect:n}=bB(e);return{id:xde(),effect:n,type:t,predicate:r,pending:new Set,unsubscribe:()=>{throw new Error(Tn(22))}}},{withTypes:()=>wB}),sI=(e,t)=>{const{type:r,effect:n,predicate:o}=bB(t);return Array.from(e.values()).find(i=>(typeof r=="string"?i.type===r:i.predicate===o)&&i.effect===n)},$2=e=>{e.pending.forEach(t=>{t.abort(_2)})},Lde=(e,t)=>()=>{for(const r of t.keys())$2(r);e.clear()},lI=(e,t,r)=>{try{e(t,r)}catch(n){setTimeout(()=>{throw n},0)}},xB=Qc(uo(`${Wv}/add`),{withTypes:()=>xB}),Dde=uo(`${Wv}/removeAll`),SB=Qc(uo(`${Wv}/remove`),{withTypes:()=>SB}),zde=(...e)=>{console.error(`${Wv}/error`,...e)},fh=(e={})=>{const t=new Map,r=new Map,n=p=>{const h=r.get(p)??0;r.set(p,h+1)},o=p=>{const h=r.get(p)??1;h===1?r.delete(p):r.set(p,h-1)},{extra:i,onError:a=zde}=e;dC(a);const s=p=>(p.unsubscribe=()=>t.delete(p.id),t.set(p.id,p),h=>{p.unsubscribe(),h!=null&&h.cancelActive&&$2(p)}),l=p=>{const h=sI(t,p)??wB(p);return s(h)};Qc(l,{withTypes:()=>l});const u=p=>{const h=sI(t,p);return h&&(h.unsubscribe(),p.cancelActive&&$2(h)),!!h};Qc(u,{withTypes:()=>u});const c=async(p,h,m,g)=>{const y=new AbortController,w=Bde(l,y.signal),S=[];try{p.pending.add(y),n(p),await Promise.resolve(p.effect(h,Qc({},m,{getOriginalState:g,condition:(x,P)=>w(x,P).then(Boolean),take:w,delay:vB(y.signal),pause:pg(y.signal),extra:i,signal:y.signal,fork:Nde(y.signal,S),unsubscribe:p.unsubscribe,subscribe:()=>{t.set(p.id,p)},cancelActiveListeners:()=>{p.pending.forEach((x,P,A)=>{x!==y&&(x.abort(_2),A.delete(x))})},cancel:()=>{y.abort(_2),p.pending.delete(y)},throwIfCancelled:()=>{wl(y.signal)}})))}catch(x){x instanceof Uv||lI(a,x,{raisedBy:"effect"})}finally{await Promise.all(S),y.abort(jde),o(p),p.pending.delete(y)}},d=Lde(t,r);return{middleware:p=>h=>m=>{if(!XN(m))return h(m);if(xB.match(m))return l(m.payload);if(Dde.match(m)){d();return}if(SB.match(m))return u(m.payload);let g=p.getState();const y=()=>{if(g===aI)throw new Error(Tn(23));return g};let w;try{if(w=h(m),t.size>0){const S=p.getState(),x=Array.from(t.values());for(const P of x){let A=!1;try{A=P.predicate(m,S,g)}catch(T){A=!1,lI(a,T,{raisedBy:"predicate"})}A&&c(P,m,p,y)}}}finally{g=aI}return w},startListening:l,stopListening:u,clearListeners:d}};function Tn(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. `}var Fde={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},CB=vn({name:"chartLayout",initialState:Fde,reducers:{setLayout(e,t){e.layoutType=t.payload},setChartSize(e,t){e.width=t.payload.width,e.height=t.payload.height},setMargin(e,t){var r,n,o,i;e.margin.top=(r=t.payload.top)!==null&&r!==void 0?r:0,e.margin.right=(n=t.payload.right)!==null&&n!==void 0?n:0,e.margin.bottom=(o=t.payload.bottom)!==null&&o!==void 0?o:0,e.margin.left=(i=t.payload.left)!==null&&i!==void 0?i:0},setScale(e,t){e.scale=t.payload}}}),{setMargin:Ude,setLayout:Wde,setChartSize:Hde,setScale:Vde}=CB.actions,Gde=CB.reducer;function EB(e,t,r){return Array.isArray(e)&&e&&t+r!==0?e.slice(t,r+1):e}function gt(e){return Number.isFinite(e)}function xs(e){return typeof e=="number"&&e>0&&Number.isFinite(e)}function cI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function jc(e){for(var t=1;t{if(t&&r){var{width:n,height:o}=r,{align:i,verticalAlign:a,layout:s}=t;if((s==="vertical"||s==="horizontal"&&a==="middle")&&i!=="center"&&Be(e[i]))return jc(jc({},e),{},{[i]:e[i]+(n||0)});if((s==="horizontal"||s==="vertical"&&i==="center")&&a!=="middle"&&Be(e[a]))return jc(jc({},e),{},{[a]:e[a]+(o||0)})}return e},xa=(e,t)=>e==="horizontal"&&t==="xAxis"||e==="vertical"&&t==="yAxis"||e==="centric"&&t==="angleAxis"||e==="radial"&&t==="radiusAxis",Xde=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var o=0;o=0?(u[0]=i,i+=f,u[1]=i):(u[0]=a,a+=f,u[1]=a)}}}},Qde=e=>{var t,r=e.length;if(!(r<=0)){var n=(t=e[0])===null||t===void 0?void 0:t.length;if(!(n==null||n<=0))for(var o=0;o=0?(l[0]=i,i+=u,l[1]=i):(l[0]=0,l[1]=0)}}}},Jde={sign:Xde,expand:Wce,none:Bl,silhouette:Hce,wiggle:Vce,positive:Qde},efe=(e,t,r)=>{var n,o=(n=Jde[r])!==null&&n!==void 0?n:Bl,i=Uce().keys(t).value((s,l)=>Number(Or(s,l,0))).order(x2).offset(o),a=i(e);return a.forEach((s,l)=>{s.forEach((u,c)=>{var d=Or(e[c],t[l],0);Array.isArray(d)&&d.length===2&&Be(d[0])&&Be(d[1])&&(u[0]=d[0],u[1]=d[1])})}),a};function uI(e){var{axis:t,ticks:r,bandSize:n,entry:o,index:i,dataKey:a}=e;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!$r(o[t.dataKey])){var s=gN(r,"value",o[t.dataKey]);if(s)return s.coordinate+n/2}return r!=null&&r[i]?r[i].coordinate+n/2:null}var l=Or(o,$r(a)?t.dataKey:a),u=t.scale.map(l);return Be(u)?u:null}var tfe=e=>{var t=e.flat(2).filter(Be);return[Math.min(...t),Math.max(...t)]},rfe=e=>[e[0]===1/0?0:e[0],e[1]===-1/0?0:e[1]],nfe=(e,t,r)=>{if(e!=null)return rfe(Object.keys(e).reduce((n,o)=>{var i=e[o];if(!i)return n;var{stackedData:a}=i,s=a.reduce((l,u)=>{var c=EB(u,t,r),d=tfe(c);return!gt(d[0])||!gt(d[1])?l:[Math.min(l[0],d[0]),Math.max(l[1],d[1])]},[1/0,-1/0]);return[Math.min(s[0],n[0]),Math.max(s[1],n[1])]},[1/0,-1/0]))},dI=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,fI=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,hg=(e,t,r)=>{if(e&&e.scale&&e.scale.bandwidth){var n=e.scale.bandwidth();if(!r||n>0)return n}if(e&&t&&t.length>=2){for(var o=jv(t,c=>c.coordinate),i=1/0,a=1,s=o.length;a{if(t==="horizontal")return e.chartX;if(t==="vertical")return e.chartY},ife=(e,t)=>t==="centric"?e.angle:e.radius,Sa=e=>e.layout.width,Ca=e=>e.layout.height,afe=e=>e.layout.scale,AB=e=>e.layout.margin,Hv=X(e=>e.cartesianAxis.xAxis,e=>Object.values(e)),Vv=X(e=>e.cartesianAxis.yAxis,e=>Object.values(e)),sfe="data-recharts-item-index",lfe="data-recharts-item-id",ph=60;function hI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function m0(e){for(var t=1;te.brush.height;function pfe(e){var t=Vv(e);return t.reduce((r,n)=>{if(n.orientation==="left"&&!n.mirror&&!n.hide){var o=typeof n.width=="number"?n.width:ph;return r+o}return r},0)}function hfe(e){var t=Vv(e);return t.reduce((r,n)=>{if(n.orientation==="right"&&!n.mirror&&!n.hide){var o=typeof n.width=="number"?n.width:ph;return r+o}return r},0)}function mfe(e){var t=Hv(e);return t.reduce((r,n)=>n.orientation==="top"&&!n.mirror&&!n.hide?r+n.height:r,0)}function gfe(e){var t=Hv(e);return t.reduce((r,n)=>n.orientation==="bottom"&&!n.mirror&&!n.hide?r+n.height:r,0)}var Rr=X([Sa,Ca,AB,ffe,pfe,hfe,mfe,gfe,KN,Hue],(e,t,r,n,o,i,a,s,l,u)=>{var c={left:(r.left||0)+o,right:(r.right||0)+i},d={top:(r.top||0)+a,bottom:(r.bottom||0)+s},f=m0(m0({},d),c),p=f.bottom;f.bottom+=n,f=Yde(f,l,u);var h=e-f.left-f.right,m=t-f.top-f.bottom;return m0(m0({brushBottom:p},f),{},{width:Math.max(h,0),height:Math.max(m,0)})}),yfe=X(Rr,e=>({x:e.left,y:e.top,width:e.width,height:e.height}));X(Sa,Ca,(e,t)=>({x:0,y:0,width:e,height:t}));var vfe=v.createContext(null),Wo=()=>v.useContext(vfe)!=null,Gv=e=>e.brush,qv=X([Gv,Rr,AB],(e,t,r)=>({height:e.height,x:Be(e.x)?e.x:t.left,y:Be(e.y)?e.y:t.top+t.height+t.brushBottom-((r==null?void 0:r.bottom)||0),width:Be(e.width)?e.width:t.width})),kB={},TB={},IB={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r,n,{signal:o,edges:i}={}){let a,s=null;const l=i!=null&&i.includes("leading"),u=i==null||i.includes("trailing"),c=()=>{s!==null&&(r.apply(a,s),a=void 0,s=null)},d=()=>{u&&c(),m()};let f=null;const p=()=>{f!=null&&clearTimeout(f),f=setTimeout(()=>{f=null,d()},n)},h=()=>{f!==null&&(clearTimeout(f),f=null)},m=()=>{h(),a=void 0,s=null},g=()=>{c()},y=function(...w){if(o!=null&&o.aborted)return;a=this,s=w;const S=f==null;p(),l&&S&&c()};return y.schedule=p,y.cancel=m,y.flush=g,o==null||o.addEventListener("abort",m,{once:!0}),y}e.debounce=t})(IB);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=IB;function r(n,o=0,i={}){typeof i!="object"&&(i={});const{leading:a=!1,trailing:s=!0,maxWait:l}=i,u=Array(2);a&&(u[0]="leading"),s&&(u[1]="trailing");let c,d=null;const f=t.debounce(function(...m){c=n.apply(this,m),d=null},o,{edges:u}),p=function(...m){return l!=null&&(d===null&&(d=Date.now()),Date.now()-d>=l)?(c=n.apply(this,m),d=Date.now(),f.cancel(),f.schedule(),c):(f.apply(this,m),c)},h=()=>(f.flush(),c);return p.cancel=f.cancel,p.flush=h,p}e.debounce=r})(TB);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=TB;function r(n,o=0,i={}){const{leading:a=!0,trailing:s=!0}=i;return t.debounce(n,o,{leading:a,maxWait:o,trailing:s})}e.throttle=r})(kB);var bfe=kB.throttle;const wfe=Ti(bfe);var mI=function(t,r){for(var n=arguments.length,o=new Array(n>2?n-2:0),i=2;io[a++]))}},hi={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},OB=(e,t,r)=>{var{width:n=hi.width,height:o=hi.height,aspect:i,maxHeight:a}=r,s=Ll(n)?e:Number(n),l=Ll(o)?t:Number(o);return i&&i>0&&(s?l=s/i:l&&(s=l*i),a&&l!=null&&l>a&&(l=a)),{calculatedWidth:s,calculatedHeight:l}},xfe={width:0,height:0,overflow:"visible"},Sfe={width:0,overflowX:"visible"},Cfe={height:0,overflowY:"visible"},Efe={},Pfe=e=>{var{width:t,height:r}=e,n=Ll(t),o=Ll(r);return n&&o?xfe:n?Sfe:o?Cfe:Efe};function Afe(e){var{width:t,height:r,aspect:n}=e,o=t,i=r;return o===void 0&&i===void 0?(o=hi.width,i=hi.height):o===void 0?o=n&&n>0?void 0:hi.width:i===void 0&&(i=n&&n>0?void 0:hi.height),{width:o,height:i}}function R2(){return R2=Object.assign?Object.assign.bind():function(e){for(var t=1;t({width:r,height:n}),[r,n]);return Ofe(o)?v.createElement(_B.Provider,{value:o},t):null}var fC=()=>v.useContext(_B),_fe=v.forwardRef((e,t)=>{var{aspect:r,initialDimension:n=hi.initialDimension,width:o,height:i,minWidth:a=hi.minWidth,minHeight:s,maxHeight:l,children:u,debounce:c=hi.debounce,id:d,className:f,onResize:p,style:h={}}=e,m=v.useRef(null),g=v.useRef();g.current=p,v.useImperativeHandle(t,()=>m.current);var[y,w]=v.useState({containerWidth:n.width,containerHeight:n.height}),S=v.useCallback((I,O)=>{w(_=>{var R=Math.round(I),E=Math.round(O);return _.containerWidth===R&&_.containerHeight===E?_:{containerWidth:R,containerHeight:E}})},[]);v.useEffect(()=>{if(m.current==null||typeof ResizeObserver>"u")return ed;var I=E=>{var M,B=E[0];if(B!=null){var{width:j,height:N}=B.contentRect;S(j,N),(M=g.current)===null||M===void 0||M.call(g,j,N)}};c>0&&(I=wfe(I,c,{trailing:!0,leading:!1}));var O=new ResizeObserver(I),{width:_,height:R}=m.current.getBoundingClientRect();return S(_,R),O.observe(m.current),()=>{O.disconnect()}},[S,c]);var{containerWidth:x,containerHeight:P}=y;mI(!r||r>0,"The aspect(%s) must be greater than zero.",r);var{calculatedWidth:A,calculatedHeight:T}=OB(x,P,{width:o,height:i,aspect:r,maxHeight:l});return mI(A!=null&&A>0||T!=null&&T>0,`The width(%s) and height(%s) of chart should be greater than 0, + please check the style of container, or the props width(%s) and height(%s), + or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the + height and width.`,A,T,o,i,a,s,r),v.createElement("div",{id:d?"".concat(d):void 0,className:se("recharts-responsive-container",f),style:yI(yI({},h),{},{width:o,height:i,minWidth:a,minHeight:s,maxHeight:l}),ref:m},v.createElement("div",{style:Pfe({width:o,height:i})},v.createElement($B,{width:A,height:T},u)))}),$fe=v.forwardRef((e,t)=>{var r=fC();if(xs(r.width)&&xs(r.height))return e.children;var{width:n,height:o}=Afe({width:e.width,height:e.height,aspect:e.aspect}),{calculatedWidth:i,calculatedHeight:a}=OB(void 0,void 0,{width:n,height:o,aspect:e.aspect,maxHeight:e.maxHeight});return Be(i)&&Be(a)?v.createElement($B,{width:i,height:a},e.children):v.createElement(_fe,R2({},e,{width:n,height:o,ref:t}))});function pC(e){if(e)return{x:e.x,y:e.y,upperWidth:"upperWidth"in e?e.upperWidth:e.width,lowerWidth:"lowerWidth"in e?e.lowerWidth:e.width,width:e.width,height:e.height}}var Kv=()=>{var e,t=Wo(),r=Ge(yfe),n=Ge(qv),o=(e=Ge(Gv))===null||e===void 0?void 0:e.padding;return!t||!n||!o?r:{width:n.width-o.left-o.right,height:n.height-o.top-o.bottom,x:o.left,y:o.top}},Rfe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},jfe=()=>{var e;return(e=Ge(Rr))!==null&&e!==void 0?e:Rfe},Mfe=()=>Ge(Sa),Nfe=()=>Ge(Ca),Bt=e=>e.layout.layoutType,hh=()=>Ge(Bt),RB=e=>{var t=e.layout.layoutType;if(t==="centric"||t==="radial")return t},Bfe=()=>{var e=hh();return e!==void 0},mh=e=>{var t=Xr(),r=Wo(),{width:n,height:o}=e,i=fC(),a=n,s=o;return i&&(a=i.width>0?i.width:n,s=i.height>0?i.height:o),v.useEffect(()=>{!r&&xs(a)&&xs(s)&&t(Hde({width:a,height:s}))},[t,r,a,s]),null},jB=Symbol.for("immer-nothing"),vI=Symbol.for("immer-draftable"),Mn=Symbol.for("immer-state");function Co(e,...t){throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var Sp=Object.getPrototypeOf;function Ru(e){return!!e&&!!e[Mn]}function zl(e){var t;return e?MB(e)||Array.isArray(e)||!!e[vI]||!!((t=e.constructor)!=null&&t[vI])||gh(e)||Yv(e):!1}var Lfe=Object.prototype.constructor.toString(),bI=new WeakMap;function MB(e){if(!e||typeof e!="object")return!1;const t=Object.getPrototypeOf(e);if(t===null||t===Object.prototype)return!0;const r=Object.hasOwnProperty.call(t,"constructor")&&t.constructor;if(r===Object)return!0;if(typeof r!="function")return!1;let n=bI.get(r);return n===void 0&&(n=Function.toString.call(r),bI.set(r,n)),n===Lfe}function mg(e,t,r=!0){Zv(e)===0?(r?Reflect.ownKeys(e):Object.keys(e)).forEach(o=>{t(o,e[o],e)}):e.forEach((n,o)=>t(o,n,e))}function Zv(e){const t=e[Mn];return t?t.type_:Array.isArray(e)?1:gh(e)?2:Yv(e)?3:0}function j2(e,t){return Zv(e)===2?e.has(t):Object.prototype.hasOwnProperty.call(e,t)}function NB(e,t,r){const n=Zv(e);n===2?e.set(t,r):n===3?e.add(r):e[t]=r}function Dfe(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}function gh(e){return e instanceof Map}function Yv(e){return e instanceof Set}function Zs(e){return e.copy_||e.base_}function M2(e,t){if(gh(e))return new Map(e);if(Yv(e))return new Set(e);if(Array.isArray(e))return Array.prototype.slice.call(e);const r=MB(e);if(t===!0||t==="class_only"&&!r){const n=Object.getOwnPropertyDescriptors(e);delete n[Mn];let o=Reflect.ownKeys(n);for(let i=0;i1&&Object.defineProperties(e,{set:g0,add:g0,clear:g0,delete:g0}),Object.freeze(e),t&&Object.values(e).forEach(r=>hC(r,!0))),e}function zfe(){Co(2)}var g0={value:zfe};function Xv(e){return e===null||typeof e!="object"?!0:Object.isFrozen(e)}var Ffe={};function Fl(e){const t=Ffe[e];return t||Co(0,e),t}var Cp;function BB(){return Cp}function Ufe(e,t){return{drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function wI(e,t){t&&(Fl("Patches"),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function N2(e){B2(e),e.drafts_.forEach(Wfe),e.drafts_=null}function B2(e){e===Cp&&(Cp=e.parent_)}function xI(e){return Cp=Ufe(Cp,e)}function Wfe(e){const t=e[Mn];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function SI(e,t){t.unfinalizedDrafts_=t.drafts_.length;const r=t.drafts_[0];return e!==void 0&&e!==r?(r[Mn].modified_&&(N2(t),Co(4)),zl(e)&&(e=gg(t,e),t.parent_||yg(t,e)),t.patches_&&Fl("Patches").generateReplacementPatches_(r[Mn].base_,e,t.patches_,t.inversePatches_)):e=gg(t,r,[]),N2(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==jB?e:void 0}function gg(e,t,r){if(Xv(t))return t;const n=e.immer_.shouldUseStrictIteration(),o=t[Mn];if(!o)return mg(t,(i,a)=>CI(e,o,t,i,a,r),n),t;if(o.scope_!==e)return t;if(!o.modified_)return yg(e,o.base_,!0),o.base_;if(!o.finalized_){o.finalized_=!0,o.scope_.unfinalizedDrafts_--;const i=o.copy_;let a=i,s=!1;o.type_===3&&(a=new Set(i),i.clear(),s=!0),mg(a,(l,u)=>CI(e,o,i,l,u,r,s),n),yg(e,i,!1),r&&e.patches_&&Fl("Patches").generatePatches_(o,r,e.patches_,e.inversePatches_)}return o.copy_}function CI(e,t,r,n,o,i,a){if(o==null||typeof o!="object"&&!a)return;const s=Xv(o);if(!(s&&!a)){if(Ru(o)){const l=i&&t&&t.type_!==3&&!j2(t.assigned_,n)?i.concat(n):void 0,u=gg(e,o,l);if(NB(r,n,u),Ru(u))e.canAutoFreeze_=!1;else return}else a&&r.add(o);if(zl(o)&&!s){if(!e.immer_.autoFreeze_&&e.unfinalizedDrafts_<1||t&&t.base_&&t.base_[n]===o&&s)return;gg(e,o),(!t||!t.scope_.parent_)&&typeof n!="symbol"&&(gh(r)?r.has(n):Object.prototype.propertyIsEnumerable.call(r,n))&&yg(e,o)}}}function yg(e,t,r=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&hC(t,r)}function Hfe(e,t){const r=Array.isArray(e),n={type_:r?1:0,scope_:t?t.scope_:BB(),modified_:!1,finalized_:!1,assigned_:{},parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1};let o=n,i=mC;r&&(o=[n],i=Ep);const{revoke:a,proxy:s}=Proxy.revocable(o,i);return n.draft_=s,n.revoke_=a,s}var mC={get(e,t){if(t===Mn)return e;const r=Zs(e);if(!j2(r,t))return Vfe(e,r,t);const n=r[t];return e.finalized_||!zl(n)?n:n===N1(e.base_,t)?(B1(e),e.copy_[t]=D2(n,e)):n},has(e,t){return t in Zs(e)},ownKeys(e){return Reflect.ownKeys(Zs(e))},set(e,t,r){const n=LB(Zs(e),t);if(n!=null&&n.set)return n.set.call(e.draft_,r),!0;if(!e.modified_){const o=N1(Zs(e),t),i=o==null?void 0:o[Mn];if(i&&i.base_===r)return e.copy_[t]=r,e.assigned_[t]=!1,!0;if(Dfe(r,o)&&(r!==void 0||j2(e.base_,t)))return!0;B1(e),L2(e)}return e.copy_[t]===r&&(r!==void 0||t in e.copy_)||Number.isNaN(r)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=r,e.assigned_[t]=!0),!0},deleteProperty(e,t){return N1(e.base_,t)!==void 0||t in e.base_?(e.assigned_[t]=!1,B1(e),L2(e)):delete e.assigned_[t],e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const r=Zs(e),n=Reflect.getOwnPropertyDescriptor(r,t);return n&&{writable:!0,configurable:e.type_!==1||t!=="length",enumerable:n.enumerable,value:r[t]}},defineProperty(){Co(11)},getPrototypeOf(e){return Sp(e.base_)},setPrototypeOf(){Co(12)}},Ep={};mg(mC,(e,t)=>{Ep[e]=function(){return arguments[0]=arguments[0][0],t.apply(this,arguments)}});Ep.deleteProperty=function(e,t){return Ep.set.call(this,e,t,void 0)};Ep.set=function(e,t,r){return mC.set.call(this,e[0],t,r,e[0])};function N1(e,t){const r=e[Mn];return(r?Zs(r):e)[t]}function Vfe(e,t,r){var o;const n=LB(t,r);return n?"value"in n?n.value:(o=n.get)==null?void 0:o.call(e.draft_):void 0}function LB(e,t){if(!(t in e))return;let r=Sp(e);for(;r;){const n=Object.getOwnPropertyDescriptor(r,t);if(n)return n;r=Sp(r)}}function L2(e){e.modified_||(e.modified_=!0,e.parent_&&L2(e.parent_))}function B1(e){e.copy_||(e.copy_=M2(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Gfe=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(t,r,n)=>{if(typeof t=="function"&&typeof r!="function"){const i=r;r=t;const a=this;return function(l=i,...u){return a.produce(l,c=>r.call(this,c,...u))}}typeof r!="function"&&Co(6),n!==void 0&&typeof n!="function"&&Co(7);let o;if(zl(t)){const i=xI(this),a=D2(t,void 0);let s=!0;try{o=r(a),s=!1}finally{s?N2(i):B2(i)}return wI(i,n),SI(o,i)}else if(!t||typeof t!="object"){if(o=r(t),o===void 0&&(o=t),o===jB&&(o=void 0),this.autoFreeze_&&hC(o,!0),n){const i=[],a=[];Fl("Patches").generateReplacementPatches_(t,o,i,a),n(i,a)}return o}else Co(1,t)},this.produceWithPatches=(t,r)=>{if(typeof t=="function")return(a,...s)=>this.produceWithPatches(a,l=>t(l,...s));let n,o;return[this.produce(t,r,(a,s)=>{n=a,o=s}),n,o]},typeof(e==null?void 0:e.autoFreeze)=="boolean"&&this.setAutoFreeze(e.autoFreeze),typeof(e==null?void 0:e.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),typeof(e==null?void 0:e.useStrictIteration)=="boolean"&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){zl(e)||Co(8),Ru(e)&&(e=qfe(e));const t=xI(this),r=D2(e,void 0);return r[Mn].isManual_=!0,B2(t),r}finishDraft(e,t){const r=e&&e[Mn];(!r||!r.isManual_)&&Co(9);const{scope_:n}=r;return wI(n,t),SI(void 0,n)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let r;for(r=t.length-1;r>=0;r--){const o=t[r];if(o.path.length===0&&o.op==="replace"){e=o.value;break}}r>-1&&(t=t.slice(r+1));const n=Fl("Patches").applyPatches_;return Ru(e)?n(e,t):this.produce(e,o=>n(o,t))}};function D2(e,t){const r=gh(e)?Fl("MapSet").proxyMap_(e,t):Yv(e)?Fl("MapSet").proxySet_(e,t):Hfe(e,t);return(t?t.scope_:BB()).drafts_.push(r),r}function qfe(e){return Ru(e)||Co(10,e),DB(e)}function DB(e){if(!zl(e)||Xv(e))return e;const t=e[Mn];let r,n=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,r=M2(e,t.scope_.immer_.useStrictShallowCopy_),n=t.scope_.immer_.shouldUseStrictIteration()}else r=M2(e,!0);return mg(r,(o,i)=>{NB(r,o,DB(i))},n),t&&(t.finalized_=!1),r}var Kfe=new Gfe;Kfe.produce;var Zfe={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},zB=vn({name:"legend",initialState:Zfe,reducers:{setLegendSize(e,t){e.size.width=t.payload.width,e.size.height=t.payload.height},setLegendSettings(e,t){e.settings.align=t.payload.align,e.settings.layout=t.payload.layout,e.settings.verticalAlign=t.payload.verticalAlign,e.settings.itemSorter=t.payload.itemSorter},addLegendPayload:{reducer(e,t){e.payload.push(t.payload)},prepare:Ot()},replaceLegendPayload:{reducer(e,t){var{prev:r,next:n}=t.payload,o=Io(e).payload.indexOf(r);o>-1&&(e.payload[o]=n)},prepare:Ot()},removeLegendPayload:{reducer(e,t){var r=Io(e).payload.indexOf(t.payload);r>-1&&e.payload.splice(r,1)},prepare:Ot()}}}),{setLegendSize:OSe,setLegendSettings:_Se,addLegendPayload:Yfe,replaceLegendPayload:Xfe,removeLegendPayload:Qfe}=zB.actions,Jfe=zB.reducer;function z2(){return z2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{separator:t=ac.separator,contentStyle:r,itemStyle:n,labelStyle:o=ac.labelStyle,payload:i,formatter:a,itemSorter:s,wrapperClassName:l,labelClassName:u,label:c,labelFormatter:d,accessibilityLayer:f=ac.accessibilityLayer}=e,p=()=>{if(i&&i.length){var P={padding:0,margin:0},A=(s?jv(i,s):i).map((T,I)=>{if(T.type==="none")return null;var O=T.formatter||a||npe,{value:_,name:R}=T,E=_,M=R;if(O){var B=O(_,R,T,I,i);if(Array.isArray(B))[E,M]=B;else if(B!=null)E=B;else return null}var j=$d($d({},ac.itemStyle),{},{color:T.color||ac.itemStyle.color},n);return v.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(I),style:j},ua(M)?v.createElement("span",{className:"recharts-tooltip-item-name"},M):null,ua(M)?v.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,v.createElement("span",{className:"recharts-tooltip-item-value"},E),v.createElement("span",{className:"recharts-tooltip-item-unit"},T.unit||""))});return v.createElement("ul",{className:"recharts-tooltip-item-list",style:P},A)}return null},h=$d($d({},ac.contentStyle),r),m=$d({margin:0},o),g=!$r(c),y=g?c:"",w=se("recharts-default-tooltip",l),S=se("recharts-tooltip-label",u);g&&d&&i!==void 0&&i!==null&&(y=d(c,i));var x=f?{role:"status","aria-live":"assertive"}:{};return v.createElement("div",z2({className:w,style:h},x),v.createElement("p",{className:S,style:m},v.isValidElement(y)?y:"".concat(y)),p())},Rd="recharts-tooltip-wrapper",ipe={visibility:"hidden"};function ape(e){var{coordinate:t,translateX:r,translateY:n}=e;return se(Rd,{["".concat(Rd,"-right")]:Be(r)&&t&&Be(t.x)&&r>=t.x,["".concat(Rd,"-left")]:Be(r)&&t&&Be(t.x)&&r=t.y,["".concat(Rd,"-top")]:Be(n)&&t&&Be(t.y)&&n0?o:0),d=r[n]+o;if(t[n])return a[n]?c:d;var f=l[n];if(f==null)return 0;if(a[n]){var p=c,h=f;return pg?Math.max(c,f):Math.max(d,f)}function spe(e){var{translateX:t,translateY:r,useTranslate3d:n}=e;return{transform:n?"translate3d(".concat(t,"px, ").concat(r,"px, 0)"):"translate(".concat(t,"px, ").concat(r,"px)")}}function lpe(e){var{allowEscapeViewBox:t,coordinate:r,offsetTop:n,offsetLeft:o,position:i,reverseDirection:a,tooltipBox:s,useTranslate3d:l,viewBox:u}=e,c,d,f;return s.height>0&&s.width>0&&r?(d=PI({allowEscapeViewBox:t,coordinate:r,key:"x",offset:o,position:i,reverseDirection:a,tooltipDimension:s.width,viewBox:u,viewBoxDimension:u.width}),f=PI({allowEscapeViewBox:t,coordinate:r,key:"y",offset:n,position:i,reverseDirection:a,tooltipDimension:s.height,viewBox:u,viewBoxDimension:u.height}),c=spe({translateX:d,translateY:f,useTranslate3d:l})):c=ipe,{cssProperties:c,cssClasses:ape({translateX:d,translateY:f,coordinate:r})}}function AI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function y0(e){for(var t=1;t{if(t.key==="Escape"){var r,n,o,i;this.setState({dismissed:!0,dismissedAtCoordinate:{x:(r=(n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==null&&r!==void 0?r:0,y:(o=(i=this.props.coordinate)===null||i===void 0?void 0:i.y)!==null&&o!==void 0?o:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var t,r;this.state.dismissed&&(((t=this.props.coordinate)===null||t===void 0?void 0:t.x)!==this.state.dismissedAtCoordinate.x||((r=this.props.coordinate)===null||r===void 0?void 0:r.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:t,allowEscapeViewBox:r,animationDuration:n,animationEasing:o,children:i,coordinate:a,hasPayload:s,isAnimationActive:l,offset:u,position:c,reverseDirection:d,useTranslate3d:f,viewBox:p,wrapperStyle:h,lastBoundingBox:m,innerRef:g,hasPortalFromProps:y}=this.props,w=typeof u=="number"?u:u.x,S=typeof u=="number"?u:u.y,{cssClasses:x,cssProperties:P}=lpe({allowEscapeViewBox:r,coordinate:a,offsetLeft:w,offsetTop:S,position:c,reverseDirection:d,tooltipBox:{height:m.height,width:m.width},useTranslate3d:f,viewBox:p}),A=y?{}:y0(y0({transition:l&&t?"transform ".concat(n,"ms ").concat(o):void 0},P),{},{pointerEvents:"none",visibility:!this.state.dismissed&&t&&s?"visible":"hidden",position:"absolute",top:0,left:0}),T=y0(y0({},A),{},{visibility:!this.state.dismissed&&t&&s?"visible":"hidden"},h);return v.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:x,style:T,ref:g},i)}}var FB=()=>{var e;return(e=Ge(t=>t.rootProps.accessibilityLayer))!==null&&e!==void 0?e:!0};function U2(){return U2=Object.assign?Object.assign.bind():function(e){for(var t=1;tgt(e.x)&>(e.y),OI=e=>e.base!=null&&vg(e.base)&&vg(e),jd=e=>e.x,Md=e=>e.y,mpe=(e,t)=>{if(typeof e=="function")return e;var r="curve".concat(uh(e));if((r==="curveMonotone"||r==="curveBump")&&t){var n=II["".concat(r).concat(t==="vertical"?"Y":"X")];if(n)return n}return II[r]||Av},_I={connectNulls:!1,type:"linear"},gpe=e=>{var{type:t=_I.type,points:r=[],baseLine:n,layout:o,connectNulls:i=_I.connectNulls}=e,a=mpe(t,o),s=i?r.filter(vg):r;if(Array.isArray(n)){var l,u=r.map((h,m)=>TI(TI({},h),{},{base:n[m]}));o==="vertical"?l=c0().y(Md).x1(jd).x0(h=>h.base.x):l=c0().x(jd).y1(Md).y0(h=>h.base.y);var c=l.defined(OI).curve(a),d=i?u.filter(OI):u;return c(d)}var f;o==="vertical"&&Be(n)?f=c0().y(Md).x1(jd).x0(n):Be(n)?f=c0().x(jd).y1(Md).y0(n):f=tN().x(jd).y(Md);var p=f.defined(vg).curve(a);return p(s)},UB=e=>{var{className:t,points:r,path:n,pathRef:o}=e,i=hh();if((!r||!r.length)&&!n)return null;var a={type:e.type,points:e.points,baseLine:e.baseLine,layout:e.layout||i,connectNulls:e.connectNulls},s=r&&r.length?gpe(a):n;return v.createElement("path",U2({},Ou(e),K6(e),{className:se("recharts-curve",t),d:s===null?void 0:s,ref:o}))},ype=["x","y","top","left","width","height","className"];function W2(){return W2=Object.assign?Object.assign.bind():function(e){for(var t=1;t"M".concat(e,",").concat(o,"v").concat(n,"M").concat(i,",").concat(t,"h").concat(r),Ppe=e=>{var{x:t=0,y:r=0,top:n=0,left:o=0,width:i=0,height:a=0,className:s}=e,l=Spe(e,ype),u=vpe({x:t,y:r,top:n,left:o,width:i,height:a},l);return!Be(t)||!Be(r)||!Be(i)||!Be(a)||!Be(n)||!Be(o)?null:v.createElement("path",W2({},qr(u),{className:se("recharts-cross",s),d:Epe(t,r,i,a,n,o)}))};function Ape(e,t,r,n){var o=n/2;return{stroke:"none",fill:"#ccc",x:e==="horizontal"?t.x-o:r.left+.5,y:e==="horizontal"?r.top+.5:t.y-o,width:e==="horizontal"?n:r.width-1,height:e==="horizontal"?r.height-1:n}}function RI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function jI(e){for(var t=1;te.replace(/([A-Z])/g,t=>"-".concat(t.toLowerCase())),WB=(e,t,r)=>e.map(n=>"".concat(Ope(n)," ").concat(t,"ms ").concat(r)).join(","),_pe=(e,t)=>[Object.keys(e),Object.keys(t)].reduce((r,n)=>r.filter(o=>n.includes(o))),Pp=(e,t)=>Object.keys(t).reduce((r,n)=>jI(jI({},r),{},{[n]:e(n,t[n])}),{});function MI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function ar(e){for(var t=1;te+(t-e)*r,H2=e=>{var{from:t,to:r}=e;return t!==r},HB=(e,t,r)=>{var n=Pp((o,i)=>{if(H2(i)){var[a,s]=e(i.from,i.to,i.velocity);return ar(ar({},i),{},{from:a,velocity:s})}return i},t);return r<1?Pp((o,i)=>H2(i)&&n[o]!=null?ar(ar({},i),{},{velocity:bg(i.velocity,n[o].velocity,r),from:bg(i.from,n[o].from,r)}):i,t):HB(e,n,r-1)};function Mpe(e,t,r,n,o,i){var a,s=n.reduce((f,p)=>ar(ar({},f),{},{[p]:{from:e[p],velocity:0,to:t[p]}}),{}),l=()=>Pp((f,p)=>p.from,s),u=()=>!Object.values(s).filter(H2).length,c=null,d=f=>{a||(a=f);var p=f-a,h=p/r.dt;s=HB(r,s,h),o(ar(ar(ar({},e),t),l())),a=f,u()||(c=i.setTimeout(d))};return()=>(c=i.setTimeout(d),()=>{var f;(f=c)===null||f===void 0||f()})}function Npe(e,t,r,n,o,i,a){var s=null,l=o.reduce((d,f)=>{var p=e[f],h=t[f];return p==null||h==null?d:ar(ar({},d),{},{[f]:[p,h]})},{}),u,c=d=>{u||(u=d);var f=(d-u)/n,p=Pp((m,g)=>bg(...g,r(f)),l);if(i(ar(ar(ar({},e),t),p)),f<1)s=a.setTimeout(c);else{var h=Pp((m,g)=>bg(...g,r(1)),l);i(ar(ar(ar({},e),t),h))}};return()=>(s=a.setTimeout(c),()=>{var d;(d=s)===null||d===void 0||d()})}const Bpe=(e,t,r,n,o,i)=>{var a=_pe(e,t);return r==null?()=>(o(ar(ar({},e),t)),()=>{}):r.isStepper===!0?Mpe(e,t,r,a,o,i):Npe(e,t,r,n,a,o,i)};var wg=1e-4,VB=(e,t)=>[0,3*e,3*t-6*e,3*e-3*t+1],GB=(e,t)=>e.map((r,n)=>r*t**n).reduce((r,n)=>r+n),NI=(e,t)=>r=>{var n=VB(e,t);return GB(n,r)},Lpe=(e,t)=>r=>{var n=VB(e,t),o=[...n.map((i,a)=>i*a).slice(1),0];return GB(o,r)},Dpe=e=>{var t,r=e.split("(");if(r.length!==2||r[0]!=="cubic-bezier")return null;var n=(t=r[1])===null||t===void 0||(t=t.split(")")[0])===null||t===void 0?void 0:t.split(",");if(n==null||n.length!==4)return null;var o=n.map(i=>parseFloat(i));return[o[0],o[1],o[2],o[3]]},zpe=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var o=NI(e,r),i=NI(t,n),a=Lpe(e,r),s=u=>u>1?1:u<0?0:u,l=u=>{for(var c=u>1?1:u,d=c,f=0;f<8;++f){var p=o(d)-c,h=a(d);if(Math.abs(p-c)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:r=100,damping:n=8,dt:o=17}=t,i=(a,s,l)=>{var u=-(a-s)*r,c=l*n,d=l+(u-c)*o/1e3,f=l*o/1e3+a;return Math.abs(f-s){if(typeof e=="string")switch(e){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return BI(e);case"spring":return Upe();default:if(e.split("(")[0]==="cubic-bezier")return BI(e)}return typeof e=="function"?e:null};function Hpe(e){var t,r=()=>null,n=!1,o=null,i=a=>{if(!n){if(Array.isArray(a)){if(!a.length)return;var s=a,[l,...u]=s;if(typeof l=="number"){o=e.setTimeout(i.bind(null,u),l);return}i(l),o=e.setTimeout(i.bind(null,u));return}typeof a=="string"&&(t=a,r(t)),typeof a=="object"&&(t=a,r(t)),typeof a=="function"&&a()}};return{stop:()=>{n=!0},start:a=>{n=!1,o&&(o(),o=null),i(a)},subscribe:a=>(r=a,()=>{r=()=>null}),getTimeoutController:()=>e}}class Vpe{setTimeout(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=performance.now(),o=null,i=a=>{a-n>=r?t(a):typeof requestAnimationFrame=="function"&&(o=requestAnimationFrame(i))};return o=requestAnimationFrame(i),()=>{o!=null&&cancelAnimationFrame(o)}}}function Gpe(){return Hpe(new Vpe)}var qpe=v.createContext(Gpe);function Kpe(e,t){var r=v.useContext(qpe);return v.useMemo(()=>t??r(e),[e,t,r])}var Zpe=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),gC={isSsr:Zpe()},Ype={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},LI={t:0},L1={t:1};function yC(e){var t=Oi(e,Ype),{isActive:r,canBegin:n,duration:o,easing:i,begin:a,onAnimationEnd:s,onAnimationStart:l,children:u}=t,c=r==="auto"?!gC.isSsr:r,d=Kpe(t.animationId,t.animationManager),[f,p]=v.useState(c?LI:L1),h=v.useRef(null);return v.useEffect(()=>{c||p(L1)},[c]),v.useEffect(()=>{if(!c||!n)return ed;var m=Bpe(LI,L1,Wpe(i),o,p,d.getTimeoutController()),g=()=>{h.current=m()};return d.start([l,a,g,o,s]),()=>{d.stop(),h.current&&h.current(),s()}},[c,n,o,i,a,l,s,d]),u(f.t)}function vC(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",r=v.useRef(vp(t)),n=v.useRef(e);return n.current!==e&&(r.current=vp(t),n.current=e),r.current}var Xpe=["radius"],Qpe=["radius"],DI,zI,FI,UI,WI,HI,VI,GI,qI,KI;function ZI(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function YI(e){for(var t=1;t{var i=Ka(r),a=Ka(n),s=Math.min(Math.abs(i)/2,Math.abs(a)/2),l=a>=0?1:-1,u=i>=0?1:-1,c=a>=0&&i>=0||a<0&&i<0?1:0,d;if(s>0&&Array.isArray(o)){for(var f=[0,0,0,0],p=0,h=4;ps?s:g}d=Ht(DI||(DI=Xo(["M",",",""])),e,t+l*f[0]),f[0]>0&&(d+=Ht(zI||(zI=Xo(["A ",",",",0,0,",",",",",""])),f[0],f[0],c,e+u*f[0],t)),d+=Ht(FI||(FI=Xo(["L ",",",""])),e+r-u*f[1],t),f[1]>0&&(d+=Ht(UI||(UI=Xo(["A ",",",",0,0,",`, + `,",",""])),f[1],f[1],c,e+r,t+l*f[1])),d+=Ht(WI||(WI=Xo(["L ",",",""])),e+r,t+n-l*f[2]),f[2]>0&&(d+=Ht(HI||(HI=Xo(["A ",",",",0,0,",`, + `,",",""])),f[2],f[2],c,e+r-u*f[2],t+n)),d+=Ht(VI||(VI=Xo(["L ",",",""])),e+u*f[3],t+n),f[3]>0&&(d+=Ht(GI||(GI=Xo(["A ",",",",0,0,",`, + `,",",""])),f[3],f[3],c,e,t+n-l*f[3])),d+="Z"}else if(s>0&&o===+o&&o>0){var y=Math.min(s,o);d=Ht(qI||(qI=Xo(["M ",",",` + A `,",",",0,0,",",",",",` + L `,",",` + A `,",",",0,0,",",",",",` + L `,",",` + A `,",",",0,0,",",",",",` + L `,",",` + A `,",",",0,0,",",",","," Z"])),e,t+l*y,y,y,c,e+u*y,t,e+r-u*y,t,y,y,c,e+r,t+l*y,e+r,t+n-l*y,y,y,c,e+r-u*y,t+n,e+u*y,t+n,y,y,c,e,t+n-l*y)}else d=Ht(KI||(KI=Xo(["M ",","," h "," v "," h "," Z"])),e,t,r,n,-r);return d},JI={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},qB=e=>{var t=Oi(e,JI),r=v.useRef(null),[n,o]=v.useState(-1);v.useEffect(()=>{if(r.current&&r.current.getTotalLength)try{var F=r.current.getTotalLength();F&&o(F)}catch{}},[]);var{x:i,y:a,width:s,height:l,radius:u,className:c}=t,{animationEasing:d,animationDuration:f,animationBegin:p,isAnimationActive:h,isUpdateAnimationActive:m}=t,g=v.useRef(s),y=v.useRef(l),w=v.useRef(i),S=v.useRef(a),x=v.useMemo(()=>({x:i,y:a,width:s,height:l,radius:u}),[i,a,s,l,u]),P=vC(x,"rectangle-");if(i!==+i||a!==+a||s!==+s||l!==+l||s===0||l===0)return null;var A=se("recharts-rectangle",c);if(!m){var T=qr(t),{radius:I}=T,O=XI(T,Xpe);return v.createElement("path",xg({},O,{x:Ka(i),y:Ka(a),width:Ka(s),height:Ka(l),radius:typeof u=="number"?u:void 0,className:A,d:QI(i,a,s,l,u)}))}var _=g.current,R=y.current,E=w.current,M=S.current,B="0px ".concat(n===-1?1:n,"px"),j="".concat(n,"px 0px"),N=WB(["strokeDasharray"],f,typeof d=="string"?d:JI.animationEasing);return v.createElement(yC,{animationId:P,key:P,canBegin:n>0,duration:f,easing:d,isActive:m,begin:p},F=>{var D=tn(_,s,F),z=tn(R,l,F),W=tn(E,i,F),H=tn(M,a,F);r.current&&(g.current=D,y.current=z,w.current=W,S.current=H);var V;h?F>0?V={transition:N,strokeDasharray:j}:V={strokeDasharray:B}:V={strokeDasharray:j};var Q=qr(t),{radius:re}=Q,Y=XI(Q,Qpe);return v.createElement("path",xg({},Y,{radius:typeof u=="number"?u:void 0,className:A,d:QI(W,H,D,z,u),ref:r,style:YI(YI({},V),t.style)}))})};function eO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function tO(e){for(var t=1;te*180/Math.PI,Tr=(e,t,r,n)=>({x:e+Math.cos(-Sg*n)*r,y:t+Math.sin(-Sg*n)*r}),she=function(t,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},lhe=(e,t)=>{var{x:r,y:n}=e,{x:o,y:i}=t;return Math.sqrt((r-o)**2+(n-i)**2)},che=(e,t)=>{var{x:r,y:n}=e,{cx:o,cy:i}=t,a=lhe({x:r,y:n},{x:o,y:i});if(a<=0)return{radius:a,angle:0};var s=(r-o)/a,l=Math.acos(s);return n>i&&(l=2*Math.PI-l),{radius:a,angle:ahe(l),angleInRadian:l}},uhe=e=>{var{startAngle:t,endAngle:r}=e,n=Math.floor(t/360),o=Math.floor(r/360),i=Math.min(n,o);return{startAngle:t-i*360,endAngle:r-i*360}},dhe=(e,t)=>{var{startAngle:r,endAngle:n}=t,o=Math.floor(r/360),i=Math.floor(n/360),a=Math.min(o,i);return e+a*360},fhe=(e,t)=>{var{chartX:r,chartY:n}=e,{radius:o,angle:i}=che({x:r,y:n},t),{innerRadius:a,outerRadius:s}=t;if(os||o===0)return null;var{startAngle:l,endAngle:u}=uhe(t),c=i,d;if(l<=u){for(;c>u;)c-=360;for(;c=l&&c<=u}else{for(;c>l;)c-=360;for(;c=u&&c<=l}return d?tO(tO({},t),{},{radius:o,angle:dhe(c,t)}):null};function KB(e){var{cx:t,cy:r,radius:n,startAngle:o,endAngle:i}=e,a=Tr(t,r,n,o),s=Tr(t,r,n,i);return{points:[a,s],cx:t,cy:r,radius:n,startAngle:o,endAngle:i}}var rO,nO,oO,iO,aO,sO,lO;function V2(){return V2=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var r=fi(t-e),n=Math.min(Math.abs(t-e),359.999);return r*n},v0=e=>{var{cx:t,cy:r,radius:n,angle:o,sign:i,isExternal:a,cornerRadius:s,cornerIsExternal:l}=e,u=s*(a?1:-1)+n,c=Math.asin(s/u)/Sg,d=l?o:o+i*c,f=Tr(t,r,u,d),p=Tr(t,r,n,d),h=l?o-i*c:o,m=Tr(t,r,u*Math.cos(c*Sg),h);return{center:f,circleTangency:p,lineTangency:m,theta:c}},ZB=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:o,startAngle:i,endAngle:a}=e,s=phe(i,a),l=i+s,u=Tr(t,r,o,i),c=Tr(t,r,o,l),d=Ht(rO||(rO=ul(["M ",",",` + A `,",",`,0, + `,",",`, + `,",",` + `])),u.x,u.y,o,o,+(Math.abs(s)>180),+(i>l),c.x,c.y);if(n>0){var f=Tr(t,r,n,i),p=Tr(t,r,n,l);d+=Ht(nO||(nO=ul(["L ",",",` + A `,",",`,0, + `,",",`, + `,","," Z"])),p.x,p.y,n,n,+(Math.abs(s)>180),+(i<=l),f.x,f.y)}else d+=Ht(oO||(oO=ul(["L ",","," Z"])),t,r);return d},hhe=e=>{var{cx:t,cy:r,innerRadius:n,outerRadius:o,cornerRadius:i,forceCornerRadius:a,cornerIsExternal:s,startAngle:l,endAngle:u}=e,c=fi(u-l),{circleTangency:d,lineTangency:f,theta:p}=v0({cx:t,cy:r,radius:o,angle:l,sign:c,cornerRadius:i,cornerIsExternal:s}),{circleTangency:h,lineTangency:m,theta:g}=v0({cx:t,cy:r,radius:o,angle:u,sign:-c,cornerRadius:i,cornerIsExternal:s}),y=s?Math.abs(l-u):Math.abs(l-u)-p-g;if(y<0)return a?Ht(iO||(iO=ul(["M ",",",` + a`,",",",0,0,1,",`,0 + a`,",",",0,0,1,",`,0 + `])),f.x,f.y,i,i,i*2,i,i,-i*2):ZB({cx:t,cy:r,innerRadius:n,outerRadius:o,startAngle:l,endAngle:u});var w=Ht(aO||(aO=ul(["M ",",",` + A`,",",",0,0,",",",",",` + A`,",",",0,",",",",",",",` + A`,",",",0,0,",",",",",` + `])),f.x,f.y,i,i,+(c<0),d.x,d.y,o,o,+(y>180),+(c<0),h.x,h.y,i,i,+(c<0),m.x,m.y);if(n>0){var{circleTangency:S,lineTangency:x,theta:P}=v0({cx:t,cy:r,radius:n,angle:l,sign:c,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),{circleTangency:A,lineTangency:T,theta:I}=v0({cx:t,cy:r,radius:n,angle:u,sign:-c,isExternal:!0,cornerRadius:i,cornerIsExternal:s}),O=s?Math.abs(l-u):Math.abs(l-u)-P-I;if(O<0&&i===0)return"".concat(w,"L").concat(t,",").concat(r,"Z");w+=Ht(sO||(sO=ul(["L",",",` + A`,",",",0,0,",",",",",` + A`,",",",0,",",",",",",",` + A`,",",",0,0,",",",",","Z"])),T.x,T.y,i,i,+(c<0),A.x,A.y,n,n,+(O>180),+(c>0),S.x,S.y,i,i,+(c<0),x.x,x.y)}else w+=Ht(lO||(lO=ul(["L",",","Z"])),t,r);return w},mhe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},YB=e=>{var t=Oi(e,mhe),{cx:r,cy:n,innerRadius:o,outerRadius:i,cornerRadius:a,forceCornerRadius:s,cornerIsExternal:l,startAngle:u,endAngle:c,className:d}=t;if(i0&&Math.abs(u-c)<360?m=hhe({cx:r,cy:n,innerRadius:o,outerRadius:i,cornerRadius:Math.min(h,p/2),forceCornerRadius:s,cornerIsExternal:l,startAngle:u,endAngle:c}):m=ZB({cx:r,cy:n,innerRadius:o,outerRadius:i,startAngle:u,endAngle:c}),v.createElement("path",V2({},qr(t),{className:f,d:m}))};function ghe(e,t,r){if(e==="horizontal")return[{x:t.x,y:r.top},{x:t.x,y:r.top+r.height}];if(e==="vertical")return[{x:r.left,y:t.y},{x:r.left+r.width,y:t.y}];if(bN(t)){if(e==="centric"){var{cx:n,cy:o,innerRadius:i,outerRadius:a,angle:s}=t,l=Tr(n,o,i,s),u=Tr(n,o,a,s);return[{x:l.x,y:l.y},{x:u.x,y:u.y}]}return KB(t)}}var XB={},QB={},JB={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=oC;function r(n){return t.isSymbol(n)?NaN:Number(n)}e.toNumber=r})(JB);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=JB;function r(n){return n?(n=t.toNumber(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}e.toFinite=r})(QB);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=iC,r=QB;function n(o,i,a){a&&typeof a!="number"&&t.isIterateeCall(o,i,a)&&(i=a=void 0),o=r.toFinite(o),i===void 0?(i=o,o=0):i=r.toFinite(i),a=a===void 0?ot?1:e>=t?0:NaN}function vhe(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function bC(e){let t,r,n;e.length!==2?(t=ls,r=(s,l)=>ls(e(s),l),n=(s,l)=>e(s)-l):(t=e===ls||e===vhe?e:bhe,r=e,n=e);function o(s,l,u=0,c=s.length){if(u>>1;r(s[d],l)<0?u=d+1:c=d}while(u>>1;r(s[d],l)<=0?u=d+1:c=d}while(uu&&n(s[d-1],l)>-n(s[d],l)?d-1:d}return{left:o,center:a,right:i}}function bhe(){return 0}function t9(e){return e===null?NaN:+e}function*whe(e,t){for(let r of e)r!=null&&(r=+r)>=r&&(yield r)}const xhe=bC(ls),yh=xhe.right;bC(t9).center;class cO extends Map{constructor(t,r=Ehe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),t!=null)for(const[n,o]of t)this.set(n,o)}get(t){return super.get(uO(this,t))}has(t){return super.has(uO(this,t))}set(t,r){return super.set(She(this,t),r)}delete(t){return super.delete(Che(this,t))}}function uO({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):r}function She({_intern:e,_key:t},r){const n=t(r);return e.has(n)?e.get(n):(e.set(n,r),r)}function Che({_intern:e,_key:t},r){const n=t(r);return e.has(n)&&(r=e.get(n),e.delete(n)),r}function Ehe(e){return e!==null&&typeof e=="object"?e.valueOf():e}function Phe(e=ls){if(e===ls)return r9;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,r)=>{const n=e(t,r);return n||n===0?n:(e(r,r)===0)-(e(t,t)===0)}}function r9(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const Ahe=Math.sqrt(50),khe=Math.sqrt(10),The=Math.sqrt(2);function Cg(e,t,r){const n=(t-e)/Math.max(0,r),o=Math.floor(Math.log10(n)),i=n/Math.pow(10,o),a=i>=Ahe?10:i>=khe?5:i>=The?2:1;let s,l,u;return o<0?(u=Math.pow(10,-o)/a,s=Math.round(e*u),l=Math.round(t*u),s/ut&&--l,u=-u):(u=Math.pow(10,o)*a,s=Math.round(e/u),l=Math.round(t/u),s*ut&&--l),l0))return[];if(e===t)return[e];const n=t=o))return[];const s=i-o+1,l=new Array(s);if(n)if(a<0)for(let u=0;u=n)&&(r=n);return r}function fO(e,t){let r;for(const n of e)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function n9(e,t,r=0,n=1/0,o){if(t=Math.floor(t),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(e.length-1,n)),!(r<=t&&t<=n))return e;for(o=o===void 0?r9:Phe(o);n>r;){if(n-r>600){const l=n-r+1,u=t-r+1,c=Math.log(l),d=.5*Math.exp(2*c/3),f=.5*Math.sqrt(c*d*(l-d)/l)*(u-l/2<0?-1:1),p=Math.max(r,Math.floor(t-u*d/l+f)),h=Math.min(n,Math.floor(t+(l-u)*d/l+f));n9(e,t,p,h,o)}const i=e[t];let a=r,s=n;for(Nd(e,r,t),o(e[n],i)>0&&Nd(e,r,n);a0;)--s}o(e[r],i)===0?Nd(e,r,s):(++s,Nd(e,s,n)),s<=t&&(r=s+1),t<=s&&(n=s-1)}return e}function Nd(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function Ihe(e,t,r){if(e=Float64Array.from(whe(e)),!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return fO(e);if(t>=1)return dO(e);var n,o=(n-1)*t,i=Math.floor(o),a=dO(n9(e,i).subarray(0,i+1)),s=fO(e.subarray(i+1));return a+(s-a)*(o-i)}}function Ohe(e,t,r=t9){if(!(!(n=e.length)||isNaN(t=+t))){if(t<=0||n<2)return+r(e[0],0,e);if(t>=1)return+r(e[n-1],n-1,e);var n,o=(n-1)*t,i=Math.floor(o),a=+r(e[i],i,e),s=+r(e[i+1],i+1,e);return a+(s-a)*(o-i)}}function _he(e,t,r){e=+e,t=+t,r=(o=arguments.length)<2?(t=e,e=0,1):o<3?1:+r;for(var n=-1,o=Math.max(0,Math.ceil((t-e)/r))|0,i=new Array(o);++n>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):r===8?b0(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):r===4?b0(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=jhe.exec(e))?new on(t[1],t[2],t[3],1):(t=Mhe.exec(e))?new on(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=Nhe.exec(e))?b0(t[1],t[2],t[3],t[4]):(t=Bhe.exec(e))?b0(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=Lhe.exec(e))?bO(t[1],t[2]/100,t[3]/100,1):(t=Dhe.exec(e))?bO(t[1],t[2]/100,t[3]/100,t[4]):pO.hasOwnProperty(e)?gO(pO[e]):e==="transparent"?new on(NaN,NaN,NaN,0):null}function gO(e){return new on(e>>16&255,e>>8&255,e&255,1)}function b0(e,t,r,n){return n<=0&&(e=t=r=NaN),new on(e,t,r,n)}function Uhe(e){return e instanceof vh||(e=Tp(e)),e?(e=e.rgb(),new on(e.r,e.g,e.b,e.opacity)):new on}function Y2(e,t,r,n){return arguments.length===1?Uhe(e):new on(e,t,r,n??1)}function on(e,t,r,n){this.r=+e,this.g=+t,this.b=+r,this.opacity=+n}SC(on,Y2,i9(vh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Ap:Math.pow(Ap,e),new on(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new on(xl(this.r),xl(this.g),xl(this.b),Pg(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:yO,formatHex:yO,formatHex8:Whe,formatRgb:vO,toString:vO}));function yO(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}`}function Whe(){return`#${dl(this.r)}${dl(this.g)}${dl(this.b)}${dl((isNaN(this.opacity)?1:this.opacity)*255)}`}function vO(){const e=Pg(this.opacity);return`${e===1?"rgb(":"rgba("}${xl(this.r)}, ${xl(this.g)}, ${xl(this.b)}${e===1?")":`, ${e})`}`}function Pg(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function xl(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function dl(e){return e=xl(e),(e<16?"0":"")+e.toString(16)}function bO(e,t,r,n){return n<=0?e=t=r=NaN:r<=0||r>=1?e=t=NaN:t<=0&&(e=NaN),new Eo(e,t,r,n)}function a9(e){if(e instanceof Eo)return new Eo(e.h,e.s,e.l,e.opacity);if(e instanceof vh||(e=Tp(e)),!e)return new Eo;if(e instanceof Eo)return e;e=e.rgb();var t=e.r/255,r=e.g/255,n=e.b/255,o=Math.min(t,r,n),i=Math.max(t,r,n),a=NaN,s=i-o,l=(i+o)/2;return s?(t===i?a=(r-n)/s+(r0&&l<1?0:a,new Eo(a,s,l,e.opacity)}function Hhe(e,t,r,n){return arguments.length===1?a9(e):new Eo(e,t,r,n??1)}function Eo(e,t,r,n){this.h=+e,this.s=+t,this.l=+r,this.opacity=+n}SC(Eo,Hhe,i9(vh,{brighter(e){return e=e==null?Eg:Math.pow(Eg,e),new Eo(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Ap:Math.pow(Ap,e),new Eo(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*t,o=2*r-n;return new on(D1(e>=240?e-240:e+120,o,n),D1(e,o,n),D1(e<120?e+240:e-120,o,n),this.opacity)},clamp(){return new Eo(wO(this.h),w0(this.s),w0(this.l),Pg(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Pg(this.opacity);return`${e===1?"hsl(":"hsla("}${wO(this.h)}, ${w0(this.s)*100}%, ${w0(this.l)*100}%${e===1?")":`, ${e})`}`}}));function wO(e){return e=(e||0)%360,e<0?e+360:e}function w0(e){return Math.max(0,Math.min(1,e||0))}function D1(e,t,r){return(e<60?t+(r-t)*e/60:e<180?r:e<240?t+(r-t)*(240-e)/60:t)*255}const CC=e=>()=>e;function Vhe(e,t){return function(r){return e+r*t}}function Ghe(e,t,r){return e=Math.pow(e,r),t=Math.pow(t,r)-e,r=1/r,function(n){return Math.pow(e+n*t,r)}}function qhe(e){return(e=+e)==1?s9:function(t,r){return r-t?Ghe(t,r,e):CC(isNaN(t)?r:t)}}function s9(e,t){var r=t-e;return r?Vhe(e,r):CC(isNaN(e)?t:e)}const xO=function e(t){var r=qhe(t);function n(o,i){var a=r((o=Y2(o)).r,(i=Y2(i)).r),s=r(o.g,i.g),l=r(o.b,i.b),u=s9(o.opacity,i.opacity);return function(c){return o.r=a(c),o.g=s(c),o.b=l(c),o.opacity=u(c),o+""}}return n.gamma=e,n}(1);function Khe(e,t){t||(t=[]);var r=e?Math.min(t.length,e.length):0,n=t.slice(),o;return function(i){for(o=0;or&&(i=t.slice(r,i),s[a]?s[a]+=i:s[++a]=i),(n=n[0])===(o=o[0])?s[a]?s[a]+=o:s[++a]=o:(s[++a]=null,l.push({i:a,x:Ag(n,o)})),r=z1.lastIndex;return rt&&(r=e,e=t,t=r),function(n){return Math.max(e,Math.min(t,n))}}function i0e(e,t,r){var n=e[0],o=e[1],i=t[0],a=t[1];return o2?a0e:i0e,l=u=null,d}function d(f){return f==null||isNaN(f=+f)?i:(l||(l=s(e.map(n),t,r)))(n(a(f)))}return d.invert=function(f){return a(o((u||(u=s(t,e.map(n),Ag)))(f)))},d.domain=function(f){return arguments.length?(e=Array.from(f,kg),c()):e.slice()},d.range=function(f){return arguments.length?(t=Array.from(f),c()):t.slice()},d.rangeRound=function(f){return t=Array.from(f),r=EC,c()},d.clamp=function(f){return arguments.length?(a=f?!0:Hr,c()):a!==Hr},d.interpolate=function(f){return arguments.length?(r=f,c()):r},d.unknown=function(f){return arguments.length?(i=f,d):i},function(f,p){return n=f,o=p,c()}}function PC(){return Qv()(Hr,Hr)}function s0e(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function Tg(e,t){if(!isFinite(e)||e===0)return null;var r=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"),n=e.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+e.slice(r+1)]}function ju(e){return e=Tg(Math.abs(e)),e?e[1]:NaN}function l0e(e,t){return function(r,n){for(var o=r.length,i=[],a=0,s=e[0],l=0;o>0&&s>0&&(l+s+1>n&&(s=Math.max(1,n-l)),i.push(r.substring(o-=s,o+s)),!((l+=s+1)>n));)s=e[a=(a+1)%e.length];return i.reverse().join(t)}}function c0e(e){return function(t){return t.replace(/[0-9]/g,function(r){return e[+r]})}}var u0e=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ip(e){if(!(t=u0e.exec(e)))throw new Error("invalid format: "+e);var t;return new AC({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Ip.prototype=AC.prototype;function AC(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}AC.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function d0e(e){e:for(var t=e.length,r=1,n=-1,o;r0&&(n=0);break}return n>0?e.slice(0,n)+e.slice(o+1):e}var Ig;function f0e(e,t){var r=Tg(e,t);if(!r)return Ig=void 0,e.toPrecision(t);var n=r[0],o=r[1],i=o-(Ig=Math.max(-8,Math.min(8,Math.floor(o/3)))*3)+1,a=n.length;return i===a?n:i>a?n+new Array(i-a+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+Tg(e,Math.max(0,t+i-1))[0]}function CO(e,t){var r=Tg(e,t);if(!r)return e+"";var n=r[0],o=r[1];return o<0?"0."+new Array(-o).join("0")+n:n.length>o+1?n.slice(0,o+1)+"."+n.slice(o+1):n+new Array(o-n.length+2).join("0")}const EO={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:s0e,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>CO(e*100,t),r:CO,s:f0e,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function PO(e){return e}var AO=Array.prototype.map,kO=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function p0e(e){var t=e.grouping===void 0||e.thousands===void 0?PO:l0e(AO.call(e.grouping,Number),e.thousands+""),r=e.currency===void 0?"":e.currency[0]+"",n=e.currency===void 0?"":e.currency[1]+"",o=e.decimal===void 0?".":e.decimal+"",i=e.numerals===void 0?PO:c0e(AO.call(e.numerals,String)),a=e.percent===void 0?"%":e.percent+"",s=e.minus===void 0?"āˆ’":e.minus+"",l=e.nan===void 0?"NaN":e.nan+"";function u(d,f){d=Ip(d);var p=d.fill,h=d.align,m=d.sign,g=d.symbol,y=d.zero,w=d.width,S=d.comma,x=d.precision,P=d.trim,A=d.type;A==="n"?(S=!0,A="g"):EO[A]||(x===void 0&&(x=12),P=!0,A="g"),(y||p==="0"&&h==="=")&&(y=!0,p="0",h="=");var T=(f&&f.prefix!==void 0?f.prefix:"")+(g==="$"?r:g==="#"&&/[boxX]/.test(A)?"0"+A.toLowerCase():""),I=(g==="$"?n:/[%p]/.test(A)?a:"")+(f&&f.suffix!==void 0?f.suffix:""),O=EO[A],_=/[defgprs%]/.test(A);x=x===void 0?6:/[gprs]/.test(A)?Math.max(1,Math.min(21,x)):Math.max(0,Math.min(20,x));function R(E){var M=T,B=I,j,N,F;if(A==="c")B=O(E)+B,E="";else{E=+E;var D=E<0||1/E<0;if(E=isNaN(E)?l:O(Math.abs(E),x),P&&(E=d0e(E)),D&&+E==0&&m!=="+"&&(D=!1),M=(D?m==="("?m:s:m==="-"||m==="("?"":m)+M,B=(A==="s"&&!isNaN(E)&&Ig!==void 0?kO[8+Ig/3]:"")+B+(D&&m==="("?")":""),_){for(j=-1,N=E.length;++jF||F>57){B=(F===46?o+E.slice(j+1):E.slice(j))+B,E=E.slice(0,j);break}}}S&&!y&&(E=t(E,1/0));var z=M.length+E.length+B.length,W=z>1)+M+E+B+W.slice(z);break;default:E=W+M+E+B;break}return i(E)}return R.toString=function(){return d+""},R}function c(d,f){var p=Math.max(-8,Math.min(8,Math.floor(ju(f)/3)))*3,h=Math.pow(10,-p),m=u((d=Ip(d),d.type="f",d),{suffix:kO[8+p/3]});return function(g){return m(h*g)}}return{format:u,formatPrefix:c}}var x0,kC,l9;h0e({thousands:",",grouping:[3],currency:["$",""]});function h0e(e){return x0=p0e(e),kC=x0.format,l9=x0.formatPrefix,x0}function m0e(e){return Math.max(0,-ju(Math.abs(e)))}function g0e(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ju(t)/3)))*3-ju(Math.abs(e)))}function y0e(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ju(t)-ju(e))+1}function c9(e,t,r,n){var o=K2(e,t,r),i;switch(n=Ip(n??",f"),n.type){case"s":{var a=Math.max(Math.abs(e),Math.abs(t));return n.precision==null&&!isNaN(i=g0e(o,a))&&(n.precision=i),l9(n,a)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=y0e(o,Math.max(Math.abs(e),Math.abs(t))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=m0e(o))&&(n.precision=i-(n.type==="%")*2);break}}return kC(n)}function js(e){var t=e.domain;return e.ticks=function(r){var n=t();return G2(n[0],n[n.length-1],r??10)},e.tickFormat=function(r,n){var o=t();return c9(o[0],o[o.length-1],r??10,n)},e.nice=function(r){r==null&&(r=10);var n=t(),o=0,i=n.length-1,a=n[o],s=n[i],l,u,c=10;for(s0;){if(u=q2(a,s,r),u===l)return n[o]=a,n[i]=s,t(n);if(u>0)a=Math.floor(a/u)*u,s=Math.ceil(s/u)*u;else if(u<0)a=Math.ceil(a*u)/u,s=Math.floor(s*u)/u;else break;l=u}return e},e}function u9(){var e=PC();return e.copy=function(){return bh(e,u9())},go.apply(e,arguments),js(e)}function d9(e){var t;function r(n){return n==null||isNaN(n=+n)?t:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(e=Array.from(n,kg),r):e.slice()},r.unknown=function(n){return arguments.length?(t=n,r):t},r.copy=function(){return d9(e).unknown(t)},e=arguments.length?Array.from(e,kg):[0,1],js(r)}function f9(e,t){e=e.slice();var r=0,n=e.length-1,o=e[r],i=e[n],a;return iMath.pow(e,t)}function S0e(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function OO(e){return(t,r)=>-e(-t,r)}function TC(e){const t=e(TO,IO),r=t.domain;let n=10,o,i;function a(){return o=S0e(n),i=x0e(n),r()[0]<0?(o=OO(o),i=OO(i),e(v0e,b0e)):e(TO,IO),t}return t.base=function(s){return arguments.length?(n=+s,a()):n},t.domain=function(s){return arguments.length?(r(s),a()):r()},t.ticks=s=>{const l=r();let u=l[0],c=l[l.length-1];const d=c0){for(;f<=p;++f)for(h=1;hc)break;y.push(m)}}else for(;f<=p;++f)for(h=n-1;h>=1;--h)if(m=f>0?h/i(-f):h*i(f),!(mc)break;y.push(m)}y.length*2{if(s==null&&(s=10),l==null&&(l=n===10?"s":","),typeof l!="function"&&(!(n%1)&&(l=Ip(l)).precision==null&&(l.trim=!0),l=kC(l)),s===1/0)return l;const u=Math.max(1,n*s/t.ticks().length);return c=>{let d=c/i(Math.round(o(c)));return d*nr(f9(r(),{floor:s=>i(Math.floor(o(s))),ceil:s=>i(Math.ceil(o(s)))})),t}function p9(){const e=TC(Qv()).domain([1,10]);return e.copy=()=>bh(e,p9()).base(e.base()),go.apply(e,arguments),e}function _O(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function $O(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function IC(e){var t=1,r=e(_O(t),$O(t));return r.constant=function(n){return arguments.length?e(_O(t=+n),$O(t)):t},js(r)}function h9(){var e=IC(Qv());return e.copy=function(){return bh(e,h9()).constant(e.constant())},go.apply(e,arguments)}function RO(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function C0e(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function E0e(e){return e<0?-e*e:e*e}function OC(e){var t=e(Hr,Hr),r=1;function n(){return r===1?e(Hr,Hr):r===.5?e(C0e,E0e):e(RO(r),RO(1/r))}return t.exponent=function(o){return arguments.length?(r=+o,n()):r},js(t)}function _C(){var e=OC(Qv());return e.copy=function(){return bh(e,_C()).exponent(e.exponent())},go.apply(e,arguments),e}function P0e(){return _C.apply(null,arguments).exponent(.5)}function jO(e){return Math.sign(e)*e*e}function A0e(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function m9(){var e=PC(),t=[0,1],r=!1,n;function o(i){var a=A0e(e(i));return isNaN(a)?n:r?Math.round(a):a}return o.invert=function(i){return e.invert(jO(i))},o.domain=function(i){return arguments.length?(e.domain(i),o):e.domain()},o.range=function(i){return arguments.length?(e.range((t=Array.from(i,kg)).map(jO)),o):t.slice()},o.rangeRound=function(i){return o.range(i).round(!0)},o.round=function(i){return arguments.length?(r=!!i,o):r},o.clamp=function(i){return arguments.length?(e.clamp(i),o):e.clamp()},o.unknown=function(i){return arguments.length?(n=i,o):n},o.copy=function(){return m9(e.domain(),t).round(r).clamp(e.clamp()).unknown(n)},go.apply(o,arguments),js(o)}function g9(){var e=[],t=[],r=[],n;function o(){var a=0,s=Math.max(1,t.length);for(r=new Array(s-1);++a0?r[s-1]:e[0],s=r?[n[r-1],t]:[n[u-1],n[u]]},a.unknown=function(l){return arguments.length&&(i=l),a},a.thresholds=function(){return n.slice()},a.copy=function(){return y9().domain([e,t]).range(o).unknown(i)},go.apply(js(a),arguments)}function v9(){var e=[.5],t=[0,1],r,n=1;function o(i){return i!=null&&i<=i?t[yh(e,i,0,n)]:r}return o.domain=function(i){return arguments.length?(e=Array.from(i),n=Math.min(e.length,t.length-1),o):e.slice()},o.range=function(i){return arguments.length?(t=Array.from(i),n=Math.min(e.length,t.length-1),o):t.slice()},o.invertExtent=function(i){var a=t.indexOf(i);return[e[a-1],e[a]]},o.unknown=function(i){return arguments.length?(r=i,o):r},o.copy=function(){return v9().domain(e).range(t).unknown(r)},go.apply(o,arguments)}const F1=new Date,U1=new Date;function dr(e,t,r,n){function o(i){return e(i=arguments.length===0?new Date:new Date(+i)),i}return o.floor=i=>(e(i=new Date(+i)),i),o.ceil=i=>(e(i=new Date(i-1)),t(i,1),e(i),i),o.round=i=>{const a=o(i),s=o.ceil(i);return i-a(t(i=new Date(+i),a==null?1:Math.floor(a)),i),o.range=(i,a,s)=>{const l=[];if(i=o.ceil(i),s=s==null?1:Math.floor(s),!(i0))return l;let u;do l.push(u=new Date(+i)),t(i,s),e(i);while(udr(a=>{if(a>=a)for(;e(a),!i(a);)a.setTime(a-1)},(a,s)=>{if(a>=a)if(s<0)for(;++s<=0;)for(;t(a,-1),!i(a););else for(;--s>=0;)for(;t(a,1),!i(a););}),r&&(o.count=(i,a)=>(F1.setTime(+i),U1.setTime(+a),e(F1),e(U1),Math.floor(r(F1,U1))),o.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?o.filter(n?a=>n(a)%i===0:a=>o.count(0,a)%i===0):o)),o}const Og=dr(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);Og.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?dr(t=>{t.setTime(Math.floor(t/e)*e)},(t,r)=>{t.setTime(+t+r*e)},(t,r)=>(r-t)/e):Og);Og.range;const Gi=1e3,eo=Gi*60,qi=eo*60,fa=qi*24,$C=fa*7,MO=fa*30,W1=fa*365,fl=dr(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*Gi)},(e,t)=>(t-e)/Gi,e=>e.getUTCSeconds());fl.range;const RC=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gi)},(e,t)=>{e.setTime(+e+t*eo)},(e,t)=>(t-e)/eo,e=>e.getMinutes());RC.range;const jC=dr(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*eo)},(e,t)=>(t-e)/eo,e=>e.getUTCMinutes());jC.range;const MC=dr(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*Gi-e.getMinutes()*eo)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getHours());MC.range;const NC=dr(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*qi)},(e,t)=>(t-e)/qi,e=>e.getUTCHours());NC.range;const wh=dr(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*eo)/fa,e=>e.getDate()-1);wh.range;const Jv=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fa,e=>e.getUTCDate()-1);Jv.range;const b9=dr(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/fa,e=>Math.floor(e/fa));b9.range;function Yl(e){return dr(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,r)=>{t.setDate(t.getDate()+r*7)},(t,r)=>(r-t-(r.getTimezoneOffset()-t.getTimezoneOffset())*eo)/$C)}const eb=Yl(0),_g=Yl(1),k0e=Yl(2),T0e=Yl(3),Mu=Yl(4),I0e=Yl(5),O0e=Yl(6);eb.range;_g.range;k0e.range;T0e.range;Mu.range;I0e.range;O0e.range;function Xl(e){return dr(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCDate(t.getUTCDate()+r*7)},(t,r)=>(r-t)/$C)}const tb=Xl(0),$g=Xl(1),_0e=Xl(2),$0e=Xl(3),Nu=Xl(4),R0e=Xl(5),j0e=Xl(6);tb.range;$g.range;_0e.range;$0e.range;Nu.range;R0e.range;j0e.range;const BC=dr(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());BC.range;const LC=dr(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());LC.range;const pa=dr(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());pa.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,r)=>{t.setFullYear(t.getFullYear()+r*e)});pa.range;const ha=dr(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());ha.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:dr(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,r)=>{t.setUTCFullYear(t.getUTCFullYear()+r*e)});ha.range;function w9(e,t,r,n,o,i){const a=[[fl,1,Gi],[fl,5,5*Gi],[fl,15,15*Gi],[fl,30,30*Gi],[i,1,eo],[i,5,5*eo],[i,15,15*eo],[i,30,30*eo],[o,1,qi],[o,3,3*qi],[o,6,6*qi],[o,12,12*qi],[n,1,fa],[n,2,2*fa],[r,1,$C],[t,1,MO],[t,3,3*MO],[e,1,W1]];function s(u,c,d){const f=cg).right(a,f);if(p===a.length)return e.every(K2(u/W1,c/W1,d));if(p===0)return Og.every(Math.max(K2(u,c,d),1));const[h,m]=a[f/a[p-1][2]53)return null;"w"in q||(q.w=1),"Z"in q?(ce=V1(Bd(q.y,0,1)),ue=ce.getUTCDay(),ce=ue>4||ue===0?$g.ceil(ce):$g(ce),ce=Jv.offset(ce,(q.V-1)*7),q.y=ce.getUTCFullYear(),q.m=ce.getUTCMonth(),q.d=ce.getUTCDate()+(q.w+6)%7):(ce=H1(Bd(q.y,0,1)),ue=ce.getDay(),ce=ue>4||ue===0?_g.ceil(ce):_g(ce),ce=wh.offset(ce,(q.V-1)*7),q.y=ce.getFullYear(),q.m=ce.getMonth(),q.d=ce.getDate()+(q.w+6)%7)}else("W"in q||"U"in q)&&("w"in q||(q.w="u"in q?q.u%7:"W"in q?1:0),ue="Z"in q?V1(Bd(q.y,0,1)).getUTCDay():H1(Bd(q.y,0,1)).getDay(),q.m=0,q.d="W"in q?(q.w+6)%7+q.W*7-(ue+5)%7:q.w+q.U*7-(ue+6)%7);return"Z"in q?(q.H+=q.Z/100|0,q.M+=q.Z%100,V1(q)):H1(q)}}function I(G,oe,de,q){for(var Ee=0,ce=oe.length,ue=de.length,ye,Pe;Ee=ue)return-1;if(ye=oe.charCodeAt(Ee++),ye===37){if(ye=oe.charAt(Ee++),Pe=P[ye in NO?oe.charAt(Ee++):ye],!Pe||(q=Pe(G,de,q))<0)return-1}else if(ye!=de.charCodeAt(q++))return-1}return q}function O(G,oe,de){var q=u.exec(oe.slice(de));return q?(G.p=c.get(q[0].toLowerCase()),de+q[0].length):-1}function _(G,oe,de){var q=p.exec(oe.slice(de));return q?(G.w=h.get(q[0].toLowerCase()),de+q[0].length):-1}function R(G,oe,de){var q=d.exec(oe.slice(de));return q?(G.w=f.get(q[0].toLowerCase()),de+q[0].length):-1}function E(G,oe,de){var q=y.exec(oe.slice(de));return q?(G.m=w.get(q[0].toLowerCase()),de+q[0].length):-1}function M(G,oe,de){var q=m.exec(oe.slice(de));return q?(G.m=g.get(q[0].toLowerCase()),de+q[0].length):-1}function B(G,oe,de){return I(G,t,oe,de)}function j(G,oe,de){return I(G,r,oe,de)}function N(G,oe,de){return I(G,n,oe,de)}function F(G){return a[G.getDay()]}function D(G){return i[G.getDay()]}function z(G){return l[G.getMonth()]}function W(G){return s[G.getMonth()]}function H(G){return o[+(G.getHours()>=12)]}function V(G){return 1+~~(G.getMonth()/3)}function Q(G){return a[G.getUTCDay()]}function re(G){return i[G.getUTCDay()]}function Y(G){return l[G.getUTCMonth()]}function Z(G){return s[G.getUTCMonth()]}function ie(G){return o[+(G.getUTCHours()>=12)]}function me(G){return 1+~~(G.getUTCMonth()/3)}return{format:function(G){var oe=A(G+="",S);return oe.toString=function(){return G},oe},parse:function(G){var oe=T(G+="",!1);return oe.toString=function(){return G},oe},utcFormat:function(G){var oe=A(G+="",x);return oe.toString=function(){return G},oe},utcParse:function(G){var oe=T(G+="",!0);return oe.toString=function(){return G},oe}}}var NO={"-":"",_:" ",0:"0"},wr=/^\s*\d+/,z0e=/^%/,F0e=/[\\^$*+?|[\]().{}]/g;function it(e,t,r){var n=e<0?"-":"",o=(n?-e:e)+"",i=o.length;return n+(i[t.toLowerCase(),r]))}function W0e(e,t,r){var n=wr.exec(t.slice(r,r+1));return n?(e.w=+n[0],r+n[0].length):-1}function H0e(e,t,r){var n=wr.exec(t.slice(r,r+1));return n?(e.u=+n[0],r+n[0].length):-1}function V0e(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.U=+n[0],r+n[0].length):-1}function G0e(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.V=+n[0],r+n[0].length):-1}function q0e(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.W=+n[0],r+n[0].length):-1}function BO(e,t,r){var n=wr.exec(t.slice(r,r+4));return n?(e.y=+n[0],r+n[0].length):-1}function LO(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function K0e(e,t,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(r,r+6));return n?(e.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Z0e(e,t,r){var n=wr.exec(t.slice(r,r+1));return n?(e.q=n[0]*3-3,r+n[0].length):-1}function Y0e(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.m=n[0]-1,r+n[0].length):-1}function DO(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.d=+n[0],r+n[0].length):-1}function X0e(e,t,r){var n=wr.exec(t.slice(r,r+3));return n?(e.m=0,e.d=+n[0],r+n[0].length):-1}function zO(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.H=+n[0],r+n[0].length):-1}function Q0e(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.M=+n[0],r+n[0].length):-1}function J0e(e,t,r){var n=wr.exec(t.slice(r,r+2));return n?(e.S=+n[0],r+n[0].length):-1}function eme(e,t,r){var n=wr.exec(t.slice(r,r+3));return n?(e.L=+n[0],r+n[0].length):-1}function tme(e,t,r){var n=wr.exec(t.slice(r,r+6));return n?(e.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function rme(e,t,r){var n=z0e.exec(t.slice(r,r+1));return n?r+n[0].length:-1}function nme(e,t,r){var n=wr.exec(t.slice(r));return n?(e.Q=+n[0],r+n[0].length):-1}function ome(e,t,r){var n=wr.exec(t.slice(r));return n?(e.s=+n[0],r+n[0].length):-1}function FO(e,t){return it(e.getDate(),t,2)}function ime(e,t){return it(e.getHours(),t,2)}function ame(e,t){return it(e.getHours()%12||12,t,2)}function sme(e,t){return it(1+wh.count(pa(e),e),t,3)}function x9(e,t){return it(e.getMilliseconds(),t,3)}function lme(e,t){return x9(e,t)+"000"}function cme(e,t){return it(e.getMonth()+1,t,2)}function ume(e,t){return it(e.getMinutes(),t,2)}function dme(e,t){return it(e.getSeconds(),t,2)}function fme(e){var t=e.getDay();return t===0?7:t}function pme(e,t){return it(eb.count(pa(e)-1,e),t,2)}function S9(e){var t=e.getDay();return t>=4||t===0?Mu(e):Mu.ceil(e)}function hme(e,t){return e=S9(e),it(Mu.count(pa(e),e)+(pa(e).getDay()===4),t,2)}function mme(e){return e.getDay()}function gme(e,t){return it(_g.count(pa(e)-1,e),t,2)}function yme(e,t){return it(e.getFullYear()%100,t,2)}function vme(e,t){return e=S9(e),it(e.getFullYear()%100,t,2)}function bme(e,t){return it(e.getFullYear()%1e4,t,4)}function wme(e,t){var r=e.getDay();return e=r>=4||r===0?Mu(e):Mu.ceil(e),it(e.getFullYear()%1e4,t,4)}function xme(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+it(t/60|0,"0",2)+it(t%60,"0",2)}function UO(e,t){return it(e.getUTCDate(),t,2)}function Sme(e,t){return it(e.getUTCHours(),t,2)}function Cme(e,t){return it(e.getUTCHours()%12||12,t,2)}function Eme(e,t){return it(1+Jv.count(ha(e),e),t,3)}function C9(e,t){return it(e.getUTCMilliseconds(),t,3)}function Pme(e,t){return C9(e,t)+"000"}function Ame(e,t){return it(e.getUTCMonth()+1,t,2)}function kme(e,t){return it(e.getUTCMinutes(),t,2)}function Tme(e,t){return it(e.getUTCSeconds(),t,2)}function Ime(e){var t=e.getUTCDay();return t===0?7:t}function Ome(e,t){return it(tb.count(ha(e)-1,e),t,2)}function E9(e){var t=e.getUTCDay();return t>=4||t===0?Nu(e):Nu.ceil(e)}function _me(e,t){return e=E9(e),it(Nu.count(ha(e),e)+(ha(e).getUTCDay()===4),t,2)}function $me(e){return e.getUTCDay()}function Rme(e,t){return it($g.count(ha(e)-1,e),t,2)}function jme(e,t){return it(e.getUTCFullYear()%100,t,2)}function Mme(e,t){return e=E9(e),it(e.getUTCFullYear()%100,t,2)}function Nme(e,t){return it(e.getUTCFullYear()%1e4,t,4)}function Bme(e,t){var r=e.getUTCDay();return e=r>=4||r===0?Nu(e):Nu.ceil(e),it(e.getUTCFullYear()%1e4,t,4)}function Lme(){return"+0000"}function WO(){return"%"}function HO(e){return+e}function VO(e){return Math.floor(+e/1e3)}var sc,P9,A9;Dme({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Dme(e){return sc=D0e(e),P9=sc.format,sc.parse,A9=sc.utcFormat,sc.utcParse,sc}function zme(e){return new Date(e)}function Fme(e){return e instanceof Date?+e:+new Date(+e)}function DC(e,t,r,n,o,i,a,s,l,u){var c=PC(),d=c.invert,f=c.domain,p=u(".%L"),h=u(":%S"),m=u("%I:%M"),g=u("%I %p"),y=u("%a %d"),w=u("%b %d"),S=u("%B"),x=u("%Y");function P(A){return(l(A)t(o/(e.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(o,i)=>Ihe(e,i/n))},r.copy=function(){return O9(t).domain(e)},Ea.apply(r,arguments)}function nb(){var e=0,t=.5,r=1,n=1,o,i,a,s,l,u=Hr,c,d=!1,f;function p(m){return isNaN(m=+m)?f:(m=.5+((m=+c(m))-i)*(n*me.chartData,Gme=X([Ns],e=>{var t=e.chartData!=null?e.chartData.length-1:0;return{chartData:e.chartData,computedData:e.computedData,dataEndIndex:t,dataStartIndex:0}}),UC=(e,t,r,n)=>n?Gme(e):Ns(e);function ma(e){if(Array.isArray(e)&&e.length===2){var[t,r]=e;if(gt(t)&>(r))return!0}return!1}function GO(e,t,r){return r?e:[Math.min(e[0],t[0]),Math.max(e[1],t[1])]}function j9(e,t){if(t&&typeof e!="function"&&Array.isArray(e)&&e.length===2){var[r,n]=e,o,i;if(gt(r))o=r;else if(typeof r=="function")return;if(gt(n))i=n;else if(typeof n=="function")return;var a=[o,i];if(ma(a))return a}}function qme(e,t,r){if(!(!r&&t==null)){if(typeof e=="function"&&t!=null)try{var n=e(t,r);if(ma(n))return GO(n,t,r)}catch{}if(Array.isArray(e)&&e.length===2){var[o,i]=e,a,s;if(o==="auto")t!=null&&(a=Math.min(...t));else if(Be(o))a=o;else if(typeof o=="function")try{t!=null&&(a=o(t==null?void 0:t[0]))}catch{}else if(typeof o=="string"&&dI.test(o)){var l=dI.exec(o);if(l==null||l[1]==null||t==null)a=void 0;else{var u=+l[1];a=t[0]-u}}else a=t==null?void 0:t[0];if(i==="auto")t!=null&&(s=Math.max(...t));else if(Be(i))s=i;else if(typeof i=="function")try{t!=null&&(s=i(t==null?void 0:t[1]))}catch{}else if(typeof i=="string"&&fI.test(i)){var c=fI.exec(i);if(c==null||c[1]==null||t==null)s=void 0;else{var d=+c[1];s=t[1]+d}}else s=t==null?void 0:t[1];var f=[a,s];if(ma(f))return t==null?f:GO(f,t,r)}}}var rd=1e9,Kme={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},HC,$t=!0,fo="[DecimalError] ",Sl=fo+"Invalid argument: ",WC=fo+"Exponent out of range: ",nd=Math.floor,Ys=Math.pow,Zme=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Cn,hr=1e7,At=7,M9=9007199254740991,Rg=nd(M9/At),Ce={};Ce.absoluteValue=Ce.abs=function(){var e=new this.constructor(this);return e.s&&(e.s=1),e};Ce.comparedTo=Ce.cmp=function(e){var t,r,n,o,i=this;if(e=new i.constructor(e),i.s!==e.s)return i.s||-e.s;if(i.e!==e.e)return i.e>e.e^i.s<0?1:-1;for(n=i.d.length,o=e.d.length,t=0,r=ne.d[t]^i.s<0?1:-1;return n===o?0:n>o^i.s<0?1:-1};Ce.decimalPlaces=Ce.dp=function(){var e=this,t=e.d.length-1,r=(t-e.e)*At;if(t=e.d[t],t)for(;t%10==0;t/=10)r--;return r<0?0:r};Ce.dividedBy=Ce.div=function(e){return Xi(this,new this.constructor(e))};Ce.dividedToIntegerBy=Ce.idiv=function(e){var t=this,r=t.constructor;return yt(Xi(t,new r(e),0,1),r.precision)};Ce.equals=Ce.eq=function(e){return!this.cmp(e)};Ce.exponent=function(){return rr(this)};Ce.greaterThan=Ce.gt=function(e){return this.cmp(e)>0};Ce.greaterThanOrEqualTo=Ce.gte=function(e){return this.cmp(e)>=0};Ce.isInteger=Ce.isint=function(){return this.e>this.d.length-2};Ce.isNegative=Ce.isneg=function(){return this.s<0};Ce.isPositive=Ce.ispos=function(){return this.s>0};Ce.isZero=function(){return this.s===0};Ce.lessThan=Ce.lt=function(e){return this.cmp(e)<0};Ce.lessThanOrEqualTo=Ce.lte=function(e){return this.cmp(e)<1};Ce.logarithm=Ce.log=function(e){var t,r=this,n=r.constructor,o=n.precision,i=o+5;if(e===void 0)e=new n(10);else if(e=new n(e),e.s<1||e.eq(Cn))throw Error(fo+"NaN");if(r.s<1)throw Error(fo+(r.s?"NaN":"-Infinity"));return r.eq(Cn)?new n(0):($t=!1,t=Xi(Op(r,i),Op(e,i),i),$t=!0,yt(t,o))};Ce.minus=Ce.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?L9(t,e):N9(t,(e.s=-e.s,e))};Ce.modulo=Ce.mod=function(e){var t,r=this,n=r.constructor,o=n.precision;if(e=new n(e),!e.s)throw Error(fo+"NaN");return r.s?($t=!1,t=Xi(r,e,0,1).times(e),$t=!0,r.minus(t)):yt(new n(r),o)};Ce.naturalExponential=Ce.exp=function(){return B9(this)};Ce.naturalLogarithm=Ce.ln=function(){return Op(this)};Ce.negated=Ce.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ce.plus=Ce.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?N9(t,e):L9(t,(e.s=-e.s,e))};Ce.precision=Ce.sd=function(e){var t,r,n,o=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Sl+e);if(t=rr(o)+1,n=o.d.length-1,r=n*At+1,n=o.d[n],n){for(;n%10==0;n/=10)r--;for(n=o.d[0];n>=10;n/=10)r++}return e&&t>r?t:r};Ce.squareRoot=Ce.sqrt=function(){var e,t,r,n,o,i,a,s=this,l=s.constructor;if(s.s<1){if(!s.s)return new l(0);throw Error(fo+"NaN")}for(e=rr(s),$t=!1,o=Math.sqrt(+s),o==0||o==1/0?(t=mi(s.d),(t.length+e)%2==0&&(t+="0"),o=Math.sqrt(t),e=nd((e+1)/2)-(e<0||e%2),o==1/0?t="5e"+e:(t=o.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new l(t)):n=new l(o.toString()),r=l.precision,o=a=r+3;;)if(i=n,n=i.plus(Xi(s,i,a+2)).times(.5),mi(i.d).slice(0,a)===(t=mi(n.d)).slice(0,a)){if(t=t.slice(a-3,a+1),o==a&&t=="4999"){if(yt(i,r+1,0),i.times(i).eq(s)){n=i;break}}else if(t!="9999")break;a+=4}return $t=!0,yt(n,r)};Ce.times=Ce.mul=function(e){var t,r,n,o,i,a,s,l,u,c=this,d=c.constructor,f=c.d,p=(e=new d(e)).d;if(!c.s||!e.s)return new d(0);for(e.s*=c.s,r=c.e+e.e,l=f.length,u=p.length,l=0;){for(t=0,o=l+n;o>n;)s=i[o]+p[n]*f[o-n-1]+t,i[o--]=s%hr|0,t=s/hr|0;i[o]=(i[o]+t)%hr|0}for(;!i[--a];)i.pop();return t?++r:i.shift(),e.d=i,e.e=r,$t?yt(e,d.precision):e};Ce.toDecimalPlaces=Ce.todp=function(e,t){var r=this,n=r.constructor;return r=new n(r),e===void 0?r:(ki(e,0,rd),t===void 0?t=n.rounding:ki(t,0,8),yt(r,e+rr(r)+1,t))};Ce.toExponential=function(e,t){var r,n=this,o=n.constructor;return e===void 0?r=Ul(n,!0):(ki(e,0,rd),t===void 0?t=o.rounding:ki(t,0,8),n=yt(new o(n),e+1,t),r=Ul(n,!0,e+1)),r};Ce.toFixed=function(e,t){var r,n,o=this,i=o.constructor;return e===void 0?Ul(o):(ki(e,0,rd),t===void 0?t=i.rounding:ki(t,0,8),n=yt(new i(o),e+rr(o)+1,t),r=Ul(n.abs(),!1,e+rr(n)+1),o.isneg()&&!o.isZero()?"-"+r:r)};Ce.toInteger=Ce.toint=function(){var e=this,t=e.constructor;return yt(new t(e),rr(e)+1,t.rounding)};Ce.toNumber=function(){return+this};Ce.toPower=Ce.pow=function(e){var t,r,n,o,i,a,s=this,l=s.constructor,u=12,c=+(e=new l(e));if(!e.s)return new l(Cn);if(s=new l(s),!s.s){if(e.s<1)throw Error(fo+"Infinity");return s}if(s.eq(Cn))return s;if(n=l.precision,e.eq(Cn))return yt(s,n);if(t=e.e,r=e.d.length-1,a=t>=r,i=s.s,a){if((r=c<0?-c:c)<=M9){for(o=new l(Cn),t=Math.ceil(n/At+4),$t=!1;r%2&&(o=o.times(s),KO(o.d,t)),r=nd(r/2),r!==0;)s=s.times(s),KO(s.d,t);return $t=!0,e.s<0?new l(Cn).div(o):yt(o,n)}}else if(i<0)throw Error(fo+"NaN");return i=i<0&&e.d[Math.max(t,r)]&1?-1:1,s.s=1,$t=!1,o=e.times(Op(s,n+u)),$t=!0,o=B9(o),o.s=i,o};Ce.toPrecision=function(e,t){var r,n,o=this,i=o.constructor;return e===void 0?(r=rr(o),n=Ul(o,r<=i.toExpNeg||r>=i.toExpPos)):(ki(e,1,rd),t===void 0?t=i.rounding:ki(t,0,8),o=yt(new i(o),e,t),r=rr(o),n=Ul(o,e<=r||r<=i.toExpNeg,e)),n};Ce.toSignificantDigits=Ce.tosd=function(e,t){var r=this,n=r.constructor;return e===void 0?(e=n.precision,t=n.rounding):(ki(e,1,rd),t===void 0?t=n.rounding:ki(t,0,8)),yt(new n(r),e,t)};Ce.toString=Ce.valueOf=Ce.val=Ce.toJSON=Ce[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=rr(e),r=e.constructor;return Ul(e,t<=r.toExpNeg||t>=r.toExpPos)};function N9(e,t){var r,n,o,i,a,s,l,u,c=e.constructor,d=c.precision;if(!e.s||!t.s)return t.s||(t=new c(e)),$t?yt(t,d):t;if(l=e.d,u=t.d,a=e.e,o=t.e,l=l.slice(),i=a-o,i){for(i<0?(n=l,i=-i,s=u.length):(n=u,o=a,s=l.length),a=Math.ceil(d/At),s=a>s?a+1:s+1,i>s&&(i=s,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(s=l.length,i=u.length,s-i<0&&(i=s,n=u,u=l,l=n),r=0;i;)r=(l[--i]=l[i]+u[i]+r)/hr|0,l[i]%=hr;for(r&&(l.unshift(r),++o),s=l.length;l[--s]==0;)l.pop();return t.d=l,t.e=o,$t?yt(t,d):t}function ki(e,t,r){if(e!==~~e||er)throw Error(Sl+e)}function mi(e){var t,r,n,o=e.length-1,i="",a=e[0];if(o>0){for(i+=a,t=1;ta?1:-1;else for(s=l=0;so[s]?1:-1;break}return l}function r(n,o,i){for(var a=0;i--;)n[i]-=a,a=n[i]1;)n.shift()}return function(n,o,i,a){var s,l,u,c,d,f,p,h,m,g,y,w,S,x,P,A,T,I,O=n.constructor,_=n.s==o.s?1:-1,R=n.d,E=o.d;if(!n.s)return new O(n);if(!o.s)throw Error(fo+"Division by zero");for(l=n.e-o.e,T=E.length,P=R.length,p=new O(_),h=p.d=[],u=0;E[u]==(R[u]||0);)++u;if(E[u]>(R[u]||0)&&--l,i==null?w=i=O.precision:a?w=i+(rr(n)-rr(o))+1:w=i,w<0)return new O(0);if(w=w/At+2|0,u=0,T==1)for(c=0,E=E[0],w++;(u1&&(E=e(E,c),R=e(R,c),T=E.length,P=R.length),x=T,m=R.slice(0,T),g=m.length;g=hr/2&&++A;do c=0,s=t(E,m,T,g),s<0?(y=m[0],T!=g&&(y=y*hr+(m[1]||0)),c=y/A|0,c>1?(c>=hr&&(c=hr-1),d=e(E,c),f=d.length,g=m.length,s=t(d,m,f,g),s==1&&(c--,r(d,T16)throw Error(WC+rr(e));if(!e.s)return new c(Cn);for($t=!1,s=d,a=new c(.03125);e.abs().gte(.1);)e=e.times(a),u+=5;for(n=Math.log(Ys(2,u))/Math.LN10*2+5|0,s+=n,r=o=i=new c(Cn),c.precision=s;;){if(o=yt(o.times(e),s),r=r.times(++l),a=i.plus(Xi(o,r,s)),mi(a.d).slice(0,s)===mi(i.d).slice(0,s)){for(;u--;)i=yt(i.times(i),s);return c.precision=d,t==null?($t=!0,yt(i,d)):i}i=a}}function rr(e){for(var t=e.e*At,r=e.d[0];r>=10;r/=10)t++;return t}function G1(e,t,r){if(t>e.LN10.sd())throw $t=!0,r&&(e.precision=r),Error(fo+"LN10 precision limit exceeded");return yt(new e(e.LN10),t)}function Da(e){for(var t="";e--;)t+="0";return t}function Op(e,t){var r,n,o,i,a,s,l,u,c,d=1,f=10,p=e,h=p.d,m=p.constructor,g=m.precision;if(p.s<1)throw Error(fo+(p.s?"NaN":"-Infinity"));if(p.eq(Cn))return new m(0);if(t==null?($t=!1,u=g):u=t,p.eq(10))return t==null&&($t=!0),G1(m,u);if(u+=f,m.precision=u,r=mi(h),n=r.charAt(0),i=rr(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(e),r=mi(p.d),n=r.charAt(0),d++;i=rr(p),n>1?(p=new m("0."+r),i++):p=new m(n+"."+r.slice(1))}else return l=G1(m,u+2,g).times(i+""),p=Op(new m(n+"."+r.slice(1)),u-f).plus(l),m.precision=g,t==null?($t=!0,yt(p,g)):p;for(s=a=p=Xi(p.minus(Cn),p.plus(Cn),u),c=yt(p.times(p),u),o=3;;){if(a=yt(a.times(c),u),l=s.plus(Xi(a,new m(o),u)),mi(l.d).slice(0,u)===mi(s.d).slice(0,u))return s=s.times(2),i!==0&&(s=s.plus(G1(m,u+2,g).times(i+""))),s=Xi(s,new m(d),u),m.precision=g,t==null?($t=!0,yt(s,g)):s;s=l,o+=2}}function qO(e,t){var r,n,o;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;t.charCodeAt(n)===48;)++n;for(o=t.length;t.charCodeAt(o-1)===48;)--o;if(t=t.slice(n,o),t){if(o-=n,r=r-n-1,e.e=nd(r/At),e.d=[],n=(r+1)%At,r<0&&(n+=At),nRg||e.e<-Rg))throw Error(WC+r)}else e.s=0,e.e=0,e.d=[0];return e}function yt(e,t,r){var n,o,i,a,s,l,u,c,d=e.d;for(a=1,i=d[0];i>=10;i/=10)a++;if(n=t-a,n<0)n+=At,o=t,u=d[c=0];else{if(c=Math.ceil((n+1)/At),i=d.length,c>=i)return e;for(u=i=d[c],a=1;i>=10;i/=10)a++;n%=At,o=n-At+a}if(r!==void 0&&(i=Ys(10,a-o-1),s=u/i%10|0,l=t<0||d[c+1]!==void 0||u%i,l=r<4?(s||l)&&(r==0||r==(e.s<0?3:2)):s>5||s==5&&(r==4||l||r==6&&(n>0?o>0?u/Ys(10,a-o):0:d[c-1])%10&1||r==(e.s<0?8:7))),t<1||!d[0])return l?(i=rr(e),d.length=1,t=t-i-1,d[0]=Ys(10,(At-t%At)%At),e.e=nd(-t/At)||0):(d.length=1,d[0]=e.e=e.s=0),e;if(n==0?(d.length=c,i=1,c--):(d.length=c+1,i=Ys(10,At-n),d[c]=o>0?(u/Ys(10,a-o)%Ys(10,o)|0)*i:0),l)for(;;)if(c==0){(d[0]+=i)==hr&&(d[0]=1,++e.e);break}else{if(d[c]+=i,d[c]!=hr)break;d[c--]=0,i=1}for(n=d.length;d[--n]===0;)d.pop();if($t&&(e.e>Rg||e.e<-Rg))throw Error(WC+rr(e));return e}function L9(e,t){var r,n,o,i,a,s,l,u,c,d,f=e.constructor,p=f.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new f(e),$t?yt(t,p):t;if(l=e.d,d=t.d,n=t.e,u=e.e,l=l.slice(),a=u-n,a){for(c=a<0,c?(r=l,a=-a,s=d.length):(r=d,n=u,s=l.length),o=Math.max(Math.ceil(p/At),s)+2,a>o&&(a=o,r.length=1),r.reverse(),o=a;o--;)r.push(0);r.reverse()}else{for(o=l.length,s=d.length,c=o0;--o)l[s++]=0;for(o=d.length;o>a;){if(l[--o]0?i=i.charAt(0)+"."+i.slice(1)+Da(n):a>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(o<0?"e":"e+")+o):o<0?(i="0."+Da(-o-1)+i,r&&(n=r-a)>0&&(i+=Da(n))):o>=a?(i+=Da(o+1-a),r&&(n=r-o-1)>0&&(i=i+"."+Da(n))):((n=o+1)0&&(o+1===a&&(i+="."),i+=Da(n))),e.s<0?"-"+i:i}function KO(e,t){if(e.length>t)return e.length=t,!0}function D9(e){var t,r,n;function o(i){var a=this;if(!(a instanceof o))return new o(i);if(a.constructor=o,i instanceof o){a.s=i.s,a.e=i.e,a.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Sl+i);if(i>0)a.s=1;else if(i<0)i=-i,a.s=-1;else{a.s=0,a.e=0,a.d=[0];return}if(i===~~i&&i<1e7){a.e=0,a.d=[i];return}return qO(a,i.toString())}else if(typeof i!="string")throw Error(Sl+i);if(i.charCodeAt(0)===45?(i=i.slice(1),a.s=-1):a.s=1,Zme.test(i))qO(a,i);else throw Error(Sl+i)}if(o.prototype=Ce,o.ROUND_UP=0,o.ROUND_DOWN=1,o.ROUND_CEIL=2,o.ROUND_FLOOR=3,o.ROUND_HALF_UP=4,o.ROUND_HALF_DOWN=5,o.ROUND_HALF_EVEN=6,o.ROUND_HALF_CEIL=7,o.ROUND_HALF_FLOOR=8,o.clone=D9,o.config=o.set=Yme,e===void 0&&(e={}),e)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=o[t+1]&&n<=o[t+2])this[r]=n;else throw Error(Sl+r+": "+n);if((n=e[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Sl+r+": "+n);return this}var HC=D9(Kme);Cn=new HC(1);const pt=HC;function z9(e){var t;return e===0?t=1:t=Math.floor(new pt(e).abs().log(10).toNumber())+1,t}function F9(e,t,r){for(var n=new pt(e),o=0,i=[];n.lt(t)&&o<1e5;)i.push(n.toNumber()),n=n.add(r),o++;return i}var U9=e=>{var[t,r]=e,[n,o]=[t,r];return t>r&&([n,o]=[r,t]),[n,o]},W9=(e,t,r)=>{if(e.lte(0))return new pt(0);var n=z9(e.toNumber()),o=new pt(10).pow(n),i=e.div(o),a=n!==1?.05:.1,s=new pt(Math.ceil(i.div(a).toNumber())).add(r).mul(a),l=s.mul(o);return t?new pt(l.toNumber()):new pt(Math.ceil(l.toNumber()))},Xme=(e,t,r)=>{var n=new pt(1),o=new pt(e);if(!o.isint()&&r){var i=Math.abs(e);i<1?(n=new pt(10).pow(z9(e)-1),o=new pt(Math.floor(o.div(n).toNumber())).mul(n)):i>1&&(o=new pt(Math.floor(e)))}else e===0?o=new pt(Math.floor((t-1)/2)):r||(o=new pt(Math.floor(e)));for(var a=Math.floor((t-1)/2),s=[],l=0;l4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((r-t)/(n-1)))return{step:new pt(0),tickMin:new pt(0),tickMax:new pt(0)};var a=W9(new pt(r).sub(t).div(n-1),o,i),s;t<=0&&r>=0?s=new pt(0):(s=new pt(t).add(r).div(2),s=s.sub(new pt(s).mod(a)));var l=Math.ceil(s.sub(t).div(a).toNumber()),u=Math.ceil(new pt(r).sub(s).div(a).toNumber()),c=l+u+1;return c>n?H9(t,r,n,o,i+1):(c0?u+(n-c):u,l=r>0?l:l+(n-c)),{step:a,tickMin:s.sub(new pt(l).mul(a)),tickMax:s.add(new pt(u).mul(a))})},Qme=function(t){var[r,n]=t,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,a=Math.max(o,2),[s,l]=U9([r,n]);if(s===-1/0||l===1/0){var u=l===1/0?[s,...Array(o-1).fill(1/0)]:[...Array(o-1).fill(-1/0),l];return r>n?u.reverse():u}if(s===l)return Xme(s,o,i);var{step:c,tickMin:d,tickMax:f}=H9(s,l,a,i,0),p=F9(d,f.add(new pt(.1).mul(c)),c);return r>n?p.reverse():p},Jme=function(t,r){var[n,o]=t,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[a,s]=U9([n,o]);if(a===-1/0||s===1/0)return[n,o];if(a===s)return[a];var l=Math.max(r,2),u=W9(new pt(s).sub(a).div(l-1),i,0),c=[...F9(new pt(a),new pt(s),u),s];return i===!1&&(c=c.map(d=>Math.round(d))),n>o?c.reverse():c},ege=e=>e.rootProps.barCategoryGap,ob=e=>e.rootProps.stackOffset,V9=e=>e.rootProps.reverseStackOrder,VC=e=>e.options.chartName,GC=e=>e.rootProps.syncId,G9=e=>e.rootProps.syncMethod,qC=e=>e.options.eventEmitter,to={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Us={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},Qo={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},ib=(e,t)=>{if(!(!e||!t))return e!=null&&e.reversed?[t[1],t[0]]:t};function q9(e,t,r){if(r!=="auto")return r;if(e!=null)return xa(e,t)?"category":"number"}function ZO(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function jg(e){for(var t=1;t{if(t!=null)return e.polarAxis.angleAxis[t]},KC=X([oge,RB],(e,t)=>{var r;if(e!=null)return e;var n=(r=q9(t,"angleAxis",YO.type))!==null&&r!==void 0?r:"category";return jg(jg({},YO),{},{type:n})}),ige=(e,t)=>e.polarAxis.radiusAxis[t],ZC=X([ige,RB],(e,t)=>{var r;if(e!=null)return e;var n=(r=q9(t,"radiusAxis",XO.type))!==null&&r!==void 0?r:"category";return jg(jg({},XO),{},{type:n})}),ab=e=>e.polarOptions,YC=X([Sa,Ca,Rr],she),K9=X([ab,YC],(e,t)=>{if(e!=null)return ws(e.innerRadius,t,0)}),Z9=X([ab,YC],(e,t)=>{if(e!=null)return ws(e.outerRadius,t,t*.8)}),age=e=>{if(e==null)return[0,0];var{startAngle:t,endAngle:r}=e;return[t,r]},Y9=X([ab],age);X([KC,Y9],ib);var X9=X([YC,K9,Z9],(e,t,r)=>{if(!(e==null||t==null||r==null))return[t,r]});X([ZC,X9],ib);var Q9=X([Bt,ab,K9,Z9,Sa,Ca],(e,t,r,n,o,i)=>{if(!(e!=="centric"&&e!=="radial"||t==null||r==null||n==null)){var{cx:a,cy:s,startAngle:l,endAngle:u}=t;return{cx:ws(a,o,o/2),cy:ws(s,i,i/2),innerRadius:r,outerRadius:n,startAngle:l,endAngle:u,clockWise:!1}}}),xr=(e,t)=>t,sb=(e,t,r)=>r;function J9(e){return e==null?void 0:e.id}function eL(e,t,r){var{chartData:n=[]}=t,{allowDuplicatedCategory:o,dataKey:i}=r,a=new Map;return e.forEach(s=>{var l,u=(l=s.data)!==null&&l!==void 0?l:n;if(!(u==null||u.length===0)){var c=J9(s);u.forEach((d,f)=>{var p=i==null||o?f:String(Or(d,i,null)),h=Or(d,s.dataKey,0),m;a.has(p)?m=a.get(p):m={},Object.assign(m,{[c]:h}),a.set(p,m)})}}),Array.from(a.values())}function XC(e){return"stackId"in e&&e.stackId!=null&&e.dataKey!=null}var lb=(e,t)=>e===t?!0:e==null||t==null?!1:e[0]===t[0]&&e[1]===t[1];function cb(e,t){return Array.isArray(e)&&Array.isArray(t)&&e.length===0&&t.length===0?!0:e===t}function sge(e,t){if(e.length===t.length){for(var r=0;r{var t=Bt(e);return t==="horizontal"?"xAxis":t==="vertical"?"yAxis":t==="centric"?"angleAxis":"radiusAxis"},od=e=>e.tooltip.settings.axisId;function lge(e){if(e in Qd)return Qd[e]();var t="scale".concat(uh(e));if(t in Qd)return Qd[t]()}function QO(e){var t=e.ticks,r=e.bandwidth,n=e.range(),o=[Math.min(...n),Math.max(...n)];return{domain:()=>e.domain(),range:function(i){function a(){return i.apply(this,arguments)}return a.toString=function(){return i.toString()},a}(()=>o),rangeMin:()=>o[0],rangeMax:()=>o[1],isInRange(i){var a=o[0],s=o[1];return a<=s?i>=a&&i<=s:i>=s&&i<=a},bandwidth:r?()=>r.call(e):void 0,ticks:t?i=>t.call(e,i):void 0,map:(i,a)=>{var s=e(i);if(s!=null){if(e.bandwidth&&a!==null&&a!==void 0&&a.position){var l=e.bandwidth();switch(a.position){case"middle":s+=l/2;break;case"end":s+=l;break}}return s}}}}function JO(e,t,r){if(typeof e=="function")return QO(e.copy().domain(t).range(r));if(e!=null){var n=lge(e);if(n!=null)return n.domain(t).range(r),QO(n)}}var cge=(e,t)=>{if(t!=null)switch(e){case"linear":{if(!ma(t)){for(var r,n,o=0;on)&&(n=i))}return r!==void 0&&n!==void 0?[r,n]:void 0}return t}default:return t}};function e_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Mg(e){for(var t=1;te.cartesianAxis.xAxis[t],Pa=(e,t)=>{var r=pge(e,t);return r??tL},rL={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:J2,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:ph},hge=(e,t)=>e.cartesianAxis.yAxis[t],Aa=(e,t)=>{var r=hge(e,t);return r??rL},mge={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},QC=(e,t)=>{var r=e.cartesianAxis.zAxis[t];return r??mge},Qr=(e,t,r)=>{switch(t){case"xAxis":return Pa(e,r);case"yAxis":return Aa(e,r);case"zAxis":return QC(e,r);case"angleAxis":return KC(e,r);case"radiusAxis":return ZC(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},gge=(e,t,r)=>{switch(t){case"xAxis":return Pa(e,r);case"yAxis":return Aa(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},xh=(e,t,r)=>{switch(t){case"xAxis":return Pa(e,r);case"yAxis":return Aa(e,r);case"angleAxis":return KC(e,r);case"radiusAxis":return ZC(e,r);default:throw new Error("Unexpected axis type: ".concat(t))}},nL=e=>e.graphicalItems.cartesianItems.some(t=>t.type==="bar")||e.graphicalItems.polarItems.some(t=>t.type==="radialBar");function oL(e,t){return r=>{switch(e){case"xAxis":return"xAxisId"in r&&r.xAxisId===t;case"yAxis":return"yAxisId"in r&&r.yAxisId===t;case"zAxis":return"zAxisId"in r&&r.zAxisId===t;case"angleAxis":return"angleAxisId"in r&&r.angleAxisId===t;case"radiusAxis":return"radiusAxisId"in r&&r.radiusAxisId===t;default:return!1}}}var iL=e=>e.graphicalItems.cartesianItems,yge=X([xr,sb],oL),aL=(e,t,r)=>e.filter(r).filter(n=>(t==null?void 0:t.includeHidden)===!0?!0:!n.hide),Sh=X([iL,Qr,yge],aL,{memoizeOptions:{resultEqualityCheck:cb}}),sL=X([Sh],e=>e.filter(t=>t.type==="area"||t.type==="bar").filter(XC)),lL=e=>e.filter(t=>!("stackId"in t)||t.stackId===void 0),vge=X([Sh],lL),cL=e=>e.map(t=>t.data).filter(Boolean).flat(1),bge=X([Sh],cL,{memoizeOptions:{resultEqualityCheck:cb}}),uL=(e,t)=>{var{chartData:r=[],dataStartIndex:n,dataEndIndex:o}=t;return e.length>0?e:r.slice(n,o+1)},JC=X([bge,UC],uL),dL=(e,t,r)=>(t==null?void 0:t.dataKey)!=null?e.map(n=>({value:Or(n,t.dataKey)})):r.length>0?r.map(n=>n.dataKey).flatMap(n=>e.map(o=>({value:Or(o,n)}))):e.map(n=>({value:n})),ub=X([JC,Qr,Sh],dL);function fL(e,t){switch(e){case"xAxis":return t.direction==="x";case"yAxis":return t.direction==="y";default:return!1}}function X0(e){if(ua(e)||e instanceof Date){var t=Number(e);if(gt(t))return t}}function t_(e){if(Array.isArray(e)){var t=[X0(e[0]),X0(e[1])];return ma(t)?t:void 0}var r=X0(e);if(r!=null)return[r,r]}function ga(e){return e.map(X0).filter(pi)}function wge(e,t,r){return!r||typeof t!="number"||ca(t)?[]:r.length?ga(r.flatMap(n=>{var o=Or(e,n.dataKey),i,a;if(Array.isArray(o)?[i,a]=o:i=a=o,!(!gt(i)||!gt(a)))return[t-i,t+a]})):[]}var fr=e=>{var t=Sr(e),r=od(e);return xh(e,t,r)},Ch=X([fr],e=>e==null?void 0:e.dataKey),xge=X([sL,UC,fr],eL),pL=(e,t,r,n)=>{var o={},i=t.reduce((a,s)=>{if(s.stackId==null)return a;var l=a[s.stackId];return l==null&&(l=[]),l.push(s),a[s.stackId]=l,a},o);return Object.fromEntries(Object.entries(i).map(a=>{var[s,l]=a,u=n?[...l].reverse():l,c=u.map(J9);return[s,{stackedData:efe(e,c,r),graphicalItems:u}]}))},Sge=X([xge,sL,ob,V9],pL),hL=(e,t,r,n)=>{var{dataStartIndex:o,dataEndIndex:i}=t;if(n==null&&r!=="zAxis"){var a=nfe(e,o,i);if(!(a!=null&&a[0]===0&&a[1]===0))return a}},Cge=X([Qr],e=>e.allowDataOverflow),eE=e=>{var t;if(e==null||!("domain"in e))return J2;if(e.domain!=null)return e.domain;if("ticks"in e&&e.ticks!=null){if(e.type==="number"){var r=ga(e.ticks);return[Math.min(...r),Math.max(...r)]}if(e.type==="category")return e.ticks.map(String)}return(t=e==null?void 0:e.domain)!==null&&t!==void 0?t:J2},mL=X([Qr],eE),gL=X([mL,Cge],j9),Ege=X([Sge,Ns,xr,gL],hL,{memoizeOptions:{resultEqualityCheck:lb}}),tE=e=>e.errorBars,Pge=(e,t,r)=>e.flatMap(n=>t[n.id]).filter(Boolean).filter(n=>fL(r,n)),Ng=function(){for(var t=arguments.length,r=new Array(t),n=0;n{var i,a;if(r.length>0&&e.forEach(s=>{r.forEach(l=>{var u,c,d=(u=n[l.id])===null||u===void 0?void 0:u.filter(y=>fL(o,y)),f=Or(s,(c=t.dataKey)!==null&&c!==void 0?c:l.dataKey),p=wge(s,f,d);if(p.length>=2){var h=Math.min(...p),m=Math.max(...p);(i==null||ha)&&(a=m)}var g=t_(f);g!=null&&(i=i==null?g[0]:Math.min(i,g[0]),a=a==null?g[1]:Math.max(a,g[1]))})}),(t==null?void 0:t.dataKey)!=null&&e.forEach(s=>{var l=t_(Or(s,t.dataKey));l!=null&&(i=i==null?l[0]:Math.min(i,l[0]),a=a==null?l[1]:Math.max(a,l[1]))}),gt(i)&>(a))return[i,a]},Age=X([JC,Qr,vge,tE,xr],yL,{memoizeOptions:{resultEqualityCheck:lb}});function kge(e){var{value:t}=e;if(ua(t)||t instanceof Date)return t}var Tge=(e,t,r)=>{var n=e.map(kge).filter(o=>o!=null);return r&&(t.dataKey==null||t.allowDuplicatedCategory&&mN(n))?e9(0,e.length):t.allowDuplicatedCategory?n:Array.from(new Set(n))},vL=e=>e.referenceElements.dots,id=(e,t,r)=>e.filter(n=>n.ifOverflow==="extendDomain").filter(n=>t==="xAxis"?n.xAxisId===r:n.yAxisId===r),Ige=X([vL,xr,sb],id),bL=e=>e.referenceElements.areas,Oge=X([bL,xr,sb],id),wL=e=>e.referenceElements.lines,_ge=X([wL,xr,sb],id),xL=(e,t)=>{if(e!=null){var r=ga(e.map(n=>t==="xAxis"?n.x:n.y));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},$ge=X(Ige,xr,xL),SL=(e,t)=>{if(e!=null){var r=ga(e.flatMap(n=>[t==="xAxis"?n.x1:n.y1,t==="xAxis"?n.x2:n.y2]));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Rge=X([Oge,xr],SL);function jge(e){var t;if(e.x!=null)return ga([e.x]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.x);return r==null||r.length===0?[]:ga(r)}function Mge(e){var t;if(e.y!=null)return ga([e.y]);var r=(t=e.segment)===null||t===void 0?void 0:t.map(n=>n.y);return r==null||r.length===0?[]:ga(r)}var CL=(e,t)=>{if(e!=null){var r=e.flatMap(n=>t==="xAxis"?jge(n):Mge(n));if(r.length!==0)return[Math.min(...r),Math.max(...r)]}},Nge=X([_ge,xr],CL),Bge=X($ge,Nge,Rge,(e,t,r)=>Ng(e,r,t)),EL=(e,t,r,n,o,i,a,s)=>{if(r!=null)return r;var l=a==="vertical"&&s==="xAxis"||a==="horizontal"&&s==="yAxis",u=l?Ng(n,i,o):Ng(i,o);return qme(t,u,e.allowDataOverflow)},Lge=X([Qr,mL,gL,Ege,Age,Bge,Bt,xr],EL,{memoizeOptions:{resultEqualityCheck:lb}}),Dge=[0,1],PL=(e,t,r,n,o,i,a)=>{if(!((e==null||r==null||r.length===0)&&a===void 0)){var{dataKey:s,type:l}=e,u=xa(t,i);if(u&&s==null){var c;return e9(0,(c=r==null?void 0:r.length)!==null&&c!==void 0?c:0)}return l==="category"?Tge(n,e,u):o==="expand"?Dge:a}},rE=X([Qr,Bt,JC,ub,ob,xr,Lge],PL);function zge(e){return e in Qd}var AL=(e,t,r)=>{if(e!=null){var{scale:n,type:o}=e;if(n==="auto")return o==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!t)?"point":o==="category"?"band":"linear";if(typeof n=="string"){var i="scale".concat(uh(n));return zge(i)?i:"point"}}},ad=X([Qr,nL,VC],AL);function nE(e,t,r,n){if(!(r==null||n==null))return typeof e.scale=="function"?JO(e.scale,r,n):JO(t,r,n)}var kL=(e,t,r)=>{var n=eE(t);if(!(r!=="auto"&&r!=="linear")){if(t!=null&&t.tickCount&&Array.isArray(n)&&(n[0]==="auto"||n[1]==="auto")&&ma(e))return Qme(e,t.tickCount,t.allowDecimals);if(t!=null&&t.tickCount&&t.type==="number"&&ma(e))return Jme(e,t.tickCount,t.allowDecimals)}},oE=X([rE,xh,ad],kL),TL=(e,t,r,n)=>{if(n!=="angleAxis"&&(e==null?void 0:e.type)==="number"&&ma(t)&&Array.isArray(r)&&r.length>0){var o,i,a=t[0],s=(o=r[0])!==null&&o!==void 0?o:0,l=t[1],u=(i=r[r.length-1])!==null&&i!==void 0?i:0;return[Math.min(a,s),Math.max(l,u)]}return t},Fge=X([Qr,rE,oE,xr],TL),Uge=X(ub,Qr,(e,t)=>{if(!(!t||t.type!=="number")){var r=1/0,n=Array.from(ga(e.map(d=>d.value))).sort((d,f)=>d-f),o=n[0],i=n[n.length-1];if(o==null||i==null)return 1/0;var a=i-o;if(a===0)return 1/0;for(var s=0;so,(e,t,r,n,o)=>{if(!gt(e))return 0;var i=t==="vertical"?n.height:n.width;if(o==="gap")return e*i/2;if(o==="no-gap"){var a=ws(r,e*i),s=e*i/2;return s-a-(s-a)/i*a}return 0}),Wge=(e,t,r)=>{var n=Pa(e,t);return n==null||typeof n.padding!="string"?0:IL(e,"xAxis",t,r,n.padding)},Hge=(e,t,r)=>{var n=Aa(e,t);return n==null||typeof n.padding!="string"?0:IL(e,"yAxis",t,r,n.padding)},Vge=X(Pa,Wge,(e,t)=>{var r,n;if(e==null)return{left:0,right:0};var{padding:o}=e;return typeof o=="string"?{left:t,right:t}:{left:((r=o.left)!==null&&r!==void 0?r:0)+t,right:((n=o.right)!==null&&n!==void 0?n:0)+t}}),Gge=X(Aa,Hge,(e,t)=>{var r,n;if(e==null)return{top:0,bottom:0};var{padding:o}=e;return typeof o=="string"?{top:t,bottom:t}:{top:((r=o.top)!==null&&r!==void 0?r:0)+t,bottom:((n=o.bottom)!==null&&n!==void 0?n:0)+t}}),qge=X([Rr,Vge,qv,Gv,(e,t,r)=>r],(e,t,r,n,o)=>{var{padding:i}=n;return o?[i.left,r.width-i.right]:[e.left+t.left,e.left+e.width-t.right]}),Kge=X([Rr,Bt,Gge,qv,Gv,(e,t,r)=>r],(e,t,r,n,o,i)=>{var{padding:a}=o;return i?[n.height-a.bottom,a.top]:t==="horizontal"?[e.top+e.height-r.bottom,e.top+r.top]:[e.top+r.top,e.top+e.height-r.bottom]}),Eh=(e,t,r,n)=>{var o;switch(t){case"xAxis":return qge(e,r,n);case"yAxis":return Kge(e,r,n);case"zAxis":return(o=QC(e,r))===null||o===void 0?void 0:o.range;case"angleAxis":return Y9(e);case"radiusAxis":return X9(e,r);default:return}},OL=X([Qr,Eh],ib),Zge=X([ad,Fge],cge),db=X([Qr,ad,Zge,OL],nE);X([Sh,tE,xr],Pge);function _L(e,t){return e.idt.id?1:0}var fb=(e,t)=>t,pb=(e,t,r)=>r,Yge=X(Hv,fb,pb,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(_L)),Xge=X(Vv,fb,pb,(e,t,r)=>e.filter(n=>n.orientation===t).filter(n=>n.mirror===r).sort(_L)),$L=(e,t)=>({width:e.width,height:t.height}),Qge=(e,t)=>{var r=typeof t.width=="number"?t.width:ph;return{width:r,height:e.height}};X(Rr,Pa,$L);var Jge=(e,t,r)=>{switch(t){case"top":return e.top;case"bottom":return r-e.bottom;default:return 0}},eye=(e,t,r)=>{switch(t){case"left":return e.left;case"right":return r-e.right;default:return 0}},tye=X(Ca,Rr,Yge,fb,pb,(e,t,r,n,o)=>{var i={},a;return r.forEach(s=>{var l=$L(t,s);a==null&&(a=Jge(t,n,e));var u=n==="top"&&!o||n==="bottom"&&o;i[s.id]=a-Number(u)*l.height,a+=(u?-1:1)*l.height}),i}),rye=X(Sa,Rr,Xge,fb,pb,(e,t,r,n,o)=>{var i={},a;return r.forEach(s=>{var l=Qge(t,s);a==null&&(a=eye(t,n,e));var u=n==="left"&&!o||n==="right"&&o;i[s.id]=a-Number(u)*l.width,a+=(u?-1:1)*l.width}),i}),nye=(e,t)=>{var r=Pa(e,t);if(r!=null)return tye(e,r.orientation,r.mirror)};X([Rr,Pa,nye,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var o=r==null?void 0:r[n];return o==null?{x:e.left,y:0}:{x:e.left,y:o}}});var oye=(e,t)=>{var r=Aa(e,t);if(r!=null)return rye(e,r.orientation,r.mirror)};X([Rr,Aa,oye,(e,t)=>t],(e,t,r,n)=>{if(t!=null){var o=r==null?void 0:r[n];return o==null?{x:0,y:e.top}:{x:o,y:e.top}}});X(Rr,Aa,(e,t)=>{var r=typeof t.width=="number"?t.width:ph;return{width:r,height:e.height}});var RL=(e,t,r,n)=>{if(r!=null){var{allowDuplicatedCategory:o,type:i,dataKey:a}=r,s=xa(e,n),l=t.map(u=>u.value);if(a&&s&&i==="category"&&o&&mN(l))return l}},iE=X([Bt,ub,Qr,xr],RL),jL=(e,t,r,n)=>{if(!(r==null||r.dataKey==null)){var{type:o,scale:i}=r,a=xa(e,n);if(a&&(o==="number"||i!=="auto"))return t.map(s=>s.value)}},aE=X([Bt,ub,xh,xr],jL);X([Bt,gge,ad,db,iE,aE,Eh,oE,xr],(e,t,r,n,o,i,a,s,l)=>{if(t!=null){var u=xa(e,l);return{angle:t.angle,interval:t.interval,minTickGap:t.minTickGap,orientation:t.orientation,tick:t.tick,tickCount:t.tickCount,tickFormatter:t.tickFormatter,ticks:t.ticks,type:t.type,unit:t.unit,axisType:l,categoricalDomain:i,duplicateDomain:o,isCategorical:u,niceTicks:s,range:a,realScaleType:r,scale:n}}});var iye=(e,t,r,n,o,i,a,s,l)=>{if(!(t==null||n==null)){var u=xa(e,l),{type:c,ticks:d,tickCount:f}=t,p=r==="scaleBand"&&typeof n.bandwidth=="function"?n.bandwidth()/2:2,h=c==="category"&&n.bandwidth?n.bandwidth()/p:0;h=l==="angleAxis"&&i!=null&&i.length>=2?fi(i[0]-i[1])*2*h:h;var m=d||o;return m?m.map((g,y)=>{var w=a?a.indexOf(g):g,S=n.map(w);return gt(S)?{index:y,coordinate:S+h,value:g,offset:h}:null}).filter(pi):u&&s?s.map((g,y)=>{var w=n.map(g);return gt(w)?{coordinate:w+h,value:g,index:y,offset:h}:null}).filter(pi):n.ticks?n.ticks(f).map((g,y)=>{var w=n.map(g);return gt(w)?{coordinate:w+h,value:g,index:y,offset:h}:null}).filter(pi):n.domain().map((g,y)=>{var w=n.map(g);return gt(w)?{coordinate:w+h,value:a?a[g]:g,index:y,offset:h}:null}).filter(pi)}};X([Bt,xh,ad,db,oE,Eh,iE,aE,xr],iye);var aye=(e,t,r,n,o,i,a)=>{if(!(t==null||r==null||n==null||n[0]===n[1])){var s=xa(e,a),{tickCount:l}=t,u=0;return u=a==="angleAxis"&&(n==null?void 0:n.length)>=2?fi(n[0]-n[1])*2*u:u,s&&i?i.map((c,d)=>{var f=r.map(c);return gt(f)?{coordinate:f+u,value:c,index:d,offset:u}:null}).filter(pi):r.ticks?r.ticks(l).map((c,d)=>{var f=r.map(c);return gt(f)?{coordinate:f+u,value:c,index:d,offset:u}:null}).filter(pi):r.domain().map((c,d)=>{var f=r.map(c);return gt(f)?{coordinate:f+u,value:o?o[c]:c,index:d,offset:u}:null}).filter(pi)}},ML=X([Bt,xh,db,Eh,iE,aE,xr],aye),NL=X(Qr,db,(e,t)=>{if(!(e==null||t==null))return Mg(Mg({},e),{},{scale:t})}),sye=X([Qr,ad,rE,OL],nE);X((e,t,r)=>QC(e,r),sye,(e,t)=>{if(!(e==null||t==null))return Mg(Mg({},e),{},{scale:t})});var lye=X([Bt,Hv,Vv],(e,t,r)=>{switch(e){case"horizontal":return t.some(n=>n.reversed)?"right-to-left":"left-to-right";case"vertical":return r.some(n=>n.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),BL=e=>e.options.defaultTooltipEventType,LL=e=>e.options.validateTooltipEventTypes;function DL(e,t,r){if(e==null)return t;var n=e?"axis":"item";return r==null?t:r.includes(n)?n:t}function sE(e,t){var r=BL(e),n=LL(e);return DL(t,r,n)}function cye(e){return Ge(t=>sE(t,e))}var zL=(e,t)=>{var r,n=Number(t);if(!(ca(n)||t==null))return n>=0?e==null||(r=e[n])===null||r===void 0?void 0:r.value:void 0},uye=e=>e.tooltip.settings,Ua={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},dye={itemInteraction:{click:Ua,hover:Ua},axisInteraction:{click:Ua,hover:Ua},keyboardInteraction:Ua,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},FL=vn({name:"tooltip",initialState:dye,reducers:{addTooltipEntrySettings:{reducer(e,t){e.tooltipItemPayloads.push(t.payload)},prepare:Ot()},replaceTooltipEntrySettings:{reducer(e,t){var{prev:r,next:n}=t.payload,o=Io(e).tooltipItemPayloads.indexOf(r);o>-1&&(e.tooltipItemPayloads[o]=n)},prepare:Ot()},removeTooltipEntrySettings:{reducer(e,t){var r=Io(e).tooltipItemPayloads.indexOf(t.payload);r>-1&&e.tooltipItemPayloads.splice(r,1)},prepare:Ot()},setTooltipSettingsState(e,t){e.settings=t.payload},setActiveMouseOverItemIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.itemInteraction.hover.active=!0,e.itemInteraction.hover.index=t.payload.activeIndex,e.itemInteraction.hover.dataKey=t.payload.activeDataKey,e.itemInteraction.hover.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.hover.coordinate=t.payload.activeCoordinate},mouseLeaveChart(e){e.itemInteraction.hover.active=!1,e.axisInteraction.hover.active=!1},mouseLeaveItem(e){e.itemInteraction.hover.active=!1},setActiveClickItemIndex(e,t){e.syncInteraction.active=!1,e.itemInteraction.click.active=!0,e.keyboardInteraction.active=!1,e.itemInteraction.click.index=t.payload.activeIndex,e.itemInteraction.click.dataKey=t.payload.activeDataKey,e.itemInteraction.click.graphicalItemId=t.payload.activeGraphicalItemId,e.itemInteraction.click.coordinate=t.payload.activeCoordinate},setMouseOverAxisIndex(e,t){e.syncInteraction.active=!1,e.axisInteraction.hover.active=!0,e.keyboardInteraction.active=!1,e.axisInteraction.hover.index=t.payload.activeIndex,e.axisInteraction.hover.dataKey=t.payload.activeDataKey,e.axisInteraction.hover.coordinate=t.payload.activeCoordinate},setMouseClickAxisIndex(e,t){e.syncInteraction.active=!1,e.keyboardInteraction.active=!1,e.axisInteraction.click.active=!0,e.axisInteraction.click.index=t.payload.activeIndex,e.axisInteraction.click.dataKey=t.payload.activeDataKey,e.axisInteraction.click.coordinate=t.payload.activeCoordinate},setSyncInteraction(e,t){e.syncInteraction=t.payload},setKeyboardInteraction(e,t){e.keyboardInteraction.active=t.payload.active,e.keyboardInteraction.index=t.payload.activeIndex,e.keyboardInteraction.coordinate=t.payload.activeCoordinate}}}),{addTooltipEntrySettings:fye,replaceTooltipEntrySettings:pye,removeTooltipEntrySettings:hye,setTooltipSettingsState:mye,setActiveMouseOverItemIndex:gye,mouseLeaveItem:$Se,mouseLeaveChart:UL,setActiveClickItemIndex:RSe,setMouseOverAxisIndex:WL,setMouseClickAxisIndex:yye,setSyncInteraction:eS,setKeyboardInteraction:tS}=FL.actions,vye=FL.reducer;function r_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function S0(e){for(var t=1;t{if(t==null)return Ua;var o=Sye(e,t,r);if(o==null)return Ua;if(o.active)return o;if(e.keyboardInteraction.active)return e.keyboardInteraction;if(e.syncInteraction.active&&e.syncInteraction.index!=null)return e.syncInteraction;var i=e.settings.active===!0;if(Cye(o)){if(i)return S0(S0({},o),{},{active:!0})}else if(n!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:n,graphicalItemId:void 0};return S0(S0({},Ua),{},{coordinate:o.coordinate})};function Eye(e){if(typeof e=="number")return Number.isFinite(e)?e:void 0;if(e instanceof Date){var t=e.valueOf();return Number.isFinite(t)?t:void 0}var r=Number(e);return Number.isFinite(r)?r:void 0}function Pye(e,t){var r=Eye(e),n=t[0],o=t[1];if(r===void 0)return!1;var i=Math.min(n,o),a=Math.max(n,o);return r>=i&&r<=a}function Aye(e,t,r){if(r==null||t==null)return!0;var n=Or(e,t);return n==null||!ma(r)?!0:Pye(n,r)}var lE=(e,t,r,n)=>{var o=e==null?void 0:e.index;if(o==null)return null;var i=Number(o);if(!gt(i))return o;var a=0,s=1/0;t.length>0&&(s=t.length-1);var l=Math.max(a,Math.min(i,s)),u=t[l];return u==null||Aye(u,r,n)?String(l):null},VL=(e,t,r,n,o,i,a)=>{if(i!=null){var s=a[0],l=s==null?void 0:s.getPosition(i);if(l!=null)return l;var u=o==null?void 0:o[Number(i)];if(u)switch(r){case"horizontal":return{x:u.coordinate,y:(n.top+t)/2};default:return{x:(n.left+e)/2,y:u.coordinate}}}},GL=(e,t,r,n)=>{if(t==="axis")return e.tooltipItemPayloads;if(e.tooltipItemPayloads.length===0)return[];var o;if(r==="hover"?o=e.itemInteraction.hover.graphicalItemId:o=e.itemInteraction.click.graphicalItemId,o==null&&n!=null){var i=e.tooltipItemPayloads[0];return i!=null?[i]:[]}return e.tooltipItemPayloads.filter(a=>{var s;return((s=a.settings)===null||s===void 0?void 0:s.graphicalItemId)===o})},qL=e=>e.options.tooltipPayloadSearcher,sd=e=>e.tooltip;function n_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function o_(e){for(var t=1;t{if(!(t==null||i==null)){var{chartData:s,computedData:l,dataStartIndex:u,dataEndIndex:c}=r,d=[];return e.reduce((f,p)=>{var h,{dataDefinedOnItem:m,settings:g}=p,y=Oye(m,s),w=Array.isArray(y)?EB(y,u,c):y,S=(h=g==null?void 0:g.dataKey)!==null&&h!==void 0?h:n,x=g==null?void 0:g.nameKey,P;if(n&&Array.isArray(w)&&!Array.isArray(w[0])&&a==="axis"?P=gN(w,n,o):P=i(w,t,l,x),Array.isArray(P))P.forEach(T=>{var I=o_(o_({},g),{},{name:T.name,unit:T.unit,color:void 0,fill:void 0});f.push(pI({tooltipEntrySettings:I,dataKey:T.dataKey,payload:T.payload,value:Or(T.payload,T.dataKey),name:T.name}))});else{var A;f.push(pI({tooltipEntrySettings:g,dataKey:S,payload:P,value:Or(P,S),name:(A=Or(P,x))!==null&&A!==void 0?A:g==null?void 0:g.name}))}return f},d)}},cE=X([fr,nL,VC],AL),_ye=X([e=>e.graphicalItems.cartesianItems,e=>e.graphicalItems.polarItems],(e,t)=>[...e,...t]),$ye=X([Sr,od],oL),ld=X([_ye,fr,$ye],aL,{memoizeOptions:{resultEqualityCheck:cb}}),Rye=X([ld],e=>e.filter(XC)),jye=X([ld],cL,{memoizeOptions:{resultEqualityCheck:cb}}),cd=X([jye,Ns],uL),Mye=X([Rye,Ns,fr],eL),uE=X([cd,fr,ld],dL),ZL=X([fr],eE),Nye=X([fr],e=>e.allowDataOverflow),YL=X([ZL,Nye],j9),Bye=X([ld],e=>e.filter(XC)),Lye=X([Mye,Bye,ob,V9],pL),Dye=X([Lye,Ns,Sr,YL],hL),zye=X([ld],lL),Fye=X([cd,fr,zye,tE,Sr],yL,{memoizeOptions:{resultEqualityCheck:lb}}),Uye=X([vL,Sr,od],id),Wye=X([Uye,Sr],xL),Hye=X([bL,Sr,od],id),Vye=X([Hye,Sr],SL),Gye=X([wL,Sr,od],id),qye=X([Gye,Sr],CL),Kye=X([Wye,qye,Vye],Ng),Zye=X([fr,ZL,YL,Dye,Fye,Kye,Bt,Sr],EL),Ph=X([fr,Bt,cd,uE,ob,Sr,Zye],PL),Yye=X([Ph,fr,cE],kL),Xye=X([fr,Ph,Yye,Sr],TL),XL=e=>{var t=Sr(e),r=od(e),n=!1;return Eh(e,t,r,n)},QL=X([fr,XL],ib),JL=X([fr,cE,Xye,QL],nE),Qye=X([Bt,uE,fr,Sr],RL),Jye=X([Bt,uE,fr,Sr],jL),eve=(e,t,r,n,o,i,a,s)=>{if(t){var{type:l}=t,u=xa(e,s);if(n){var c=r==="scaleBand"&&n.bandwidth?n.bandwidth()/2:2,d=l==="category"&&n.bandwidth?n.bandwidth()/c:0;return d=s==="angleAxis"&&o!=null&&(o==null?void 0:o.length)>=2?fi(o[0]-o[1])*2*d:d,u&&a?a.map((f,p)=>{var h=n.map(f);return gt(h)?{coordinate:h+d,value:f,index:p,offset:d}:null}).filter(pi):n.domain().map((f,p)=>{var h=n.map(f);return gt(h)?{coordinate:h+d,value:i?i[f]:f,index:p,offset:d}:null}).filter(pi)}}},ka=X([Bt,fr,cE,JL,XL,Qye,Jye,Sr],eve),dE=X([BL,LL,uye],(e,t,r)=>DL(r.shared,e,t)),eD=e=>e.tooltip.settings.trigger,fE=e=>e.tooltip.settings.defaultIndex,Ah=X([sd,dE,eD,fE],HL),_p=X([Ah,cd,Ch,Ph],lE),tD=X([ka,_p],zL),tve=X([Ah],e=>{if(e)return e.dataKey});X([Ah],e=>{if(e)return e.graphicalItemId});var rD=X([sd,dE,eD,fE],GL),rve=X([Sa,Ca,Bt,Rr,ka,fE,rD],VL),nve=X([Ah,rve],(e,t)=>e!=null&&e.coordinate?e.coordinate:t),ove=X([Ah],e=>{var t;return(t=e==null?void 0:e.active)!==null&&t!==void 0?t:!1}),ive=X([rD,_p,Ns,Ch,tD,qL,dE],KL),ave=X([ive],e=>{if(e!=null){var t=e.map(r=>r.payload).filter(r=>r!=null);return Array.from(new Set(t))}});function i_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function a_(e){for(var t=1;tGe(fr),dve=()=>{var e=uve(),t=Ge(ka),r=Ge(JL);return hg(!e||!r?void 0:a_(a_({},e),{},{scale:r}),t)};function s_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function lc(e){for(var t=1;t{var o=t.find(i=>i&&i.index===r);if(o){if(e==="horizontal")return{x:o.coordinate,y:n.chartY};if(e==="vertical")return{x:n.chartX,y:o.coordinate}}return{x:0,y:0}},gve=(e,t,r,n)=>{var o=t.find(u=>u&&u.index===r);if(o){if(e==="centric"){var i=o.coordinate,{radius:a}=n;return lc(lc(lc({},n),Tr(n.cx,n.cy,a,i)),{},{angle:i,radius:a})}var s=o.coordinate,{angle:l}=n;return lc(lc(lc({},n),Tr(n.cx,n.cy,s,l)),{},{angle:l,radius:s})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function yve(e,t){var{chartX:r,chartY:n}=e;return r>=t.left&&r<=t.left+t.width&&n>=t.top&&n<=t.top+t.height}var nD=(e,t,r,n,o)=>{var i,a=(i=t==null?void 0:t.length)!==null&&i!==void 0?i:0;if(a<=1||e==null)return 0;if(n==="angleAxis"&&o!=null&&Math.abs(Math.abs(o[1]-o[0])-360)<=1e-6)for(var s=0;s0?(l=r[s-1])===null||l===void 0?void 0:l.coordinate:(u=r[a-1])===null||u===void 0?void 0:u.coordinate,h=(c=r[s])===null||c===void 0?void 0:c.coordinate,m=s>=a-1?(d=r[0])===null||d===void 0?void 0:d.coordinate:(f=r[s+1])===null||f===void 0?void 0:f.coordinate,g=void 0;if(!(p==null||h==null||m==null))if(fi(h-p)!==fi(m-h)){var y=[];if(fi(m-h)===fi(o[1]-o[0])){g=m;var w=h+o[1]-o[0];y[0]=Math.min(w,(w+p)/2),y[1]=Math.max(w,(w+p)/2)}else{g=p;var S=m+o[1]-o[0];y[0]=Math.min(h,(S+h)/2),y[1]=Math.max(h,(S+h)/2)}var x=[Math.min(h,(g+h)/2),Math.max(h,(g+h)/2)];if(e>x[0]&&e<=x[1]||e>=y[0]&&e<=y[1]){var P;return(P=r[s])===null||P===void 0?void 0:P.index}}else{var A=Math.min(p,m),T=Math.max(p,m);if(e>(A+h)/2&&e<=(T+h)/2){var I;return(I=r[s])===null||I===void 0?void 0:I.index}}}else if(t)for(var O=0;O(_.coordinate+E.coordinate)/2||O>0&&O(_.coordinate+E.coordinate)/2&&e<=(_.coordinate+R.coordinate)/2)return _.index}}return-1},vve=()=>Ge(VC),pE=(e,t)=>t,oD=(e,t,r)=>r,hE=(e,t,r,n)=>n,bve=X(ka,e=>jv(e,t=>t.coordinate)),mE=X([sd,pE,oD,hE],HL),gE=X([mE,cd,Ch,Ph],lE),wve=(e,t,r)=>{if(t!=null){var n=sd(e);return t==="axis"?r==="hover"?n.axisInteraction.hover.dataKey:n.axisInteraction.click.dataKey:r==="hover"?n.itemInteraction.hover.dataKey:n.itemInteraction.click.dataKey}},iD=X([sd,pE,oD,hE],GL),Bg=X([Sa,Ca,Bt,Rr,ka,hE,iD],VL),xve=X([mE,Bg],(e,t)=>{var r;return(r=e.coordinate)!==null&&r!==void 0?r:t}),aD=X([ka,gE],zL),Sve=X([iD,gE,Ns,Ch,aD,qL,pE],KL),Cve=X([mE,gE],(e,t)=>({isActive:e.active&&t!=null,activeIndex:t})),Eve=(e,t,r,n,o,i,a)=>{if(!(!e||!r||!n||!o)&&yve(e,a)){var s=ofe(e,t),l=nD(s,i,o,r,n),u=mve(t,o,l,e);return{activeIndex:String(l),activeCoordinate:u}}},Pve=(e,t,r,n,o,i,a)=>{if(!(!e||!n||!o||!i||!r)){var s=fhe(e,r);if(s){var l=ife(s,t),u=nD(l,a,i,n,o),c=gve(t,i,u,s);return{activeIndex:String(u),activeCoordinate:c}}}},Ave=(e,t,r,n,o,i,a,s)=>{if(!(!e||!t||!n||!o||!i))return t==="horizontal"||t==="vertical"?Eve(e,t,n,o,i,a,s):Pve(e,t,r,n,o,i,a)},kve=X(e=>e.zIndex.zIndexMap,(e,t)=>t,(e,t,r)=>r,(e,t,r)=>{if(t!=null){var n=e[t];if(n!=null)return r?n.panoramaElement:n.element}}),Tve=X(e=>e.zIndex.zIndexMap,e=>{var t=Object.keys(e).map(n=>parseInt(n,10)).concat(Object.values(to)),r=Array.from(new Set(t));return r.sort((n,o)=>n-o)},{memoizeOptions:{resultEqualityCheck:sge}});function l_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function c_(e){for(var t=1;tc_(c_({},e),{},{[t]:{element:void 0,panoramaElement:void 0,consumers:0}}),$ve)},jve=new Set(Object.values(to));function Mve(e){return jve.has(e)}var sD=vn({name:"zIndex",initialState:Rve,reducers:{registerZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]?e.zIndexMap[r].consumers+=1:e.zIndexMap[r]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:Ot()},unregisterZIndexPortal:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(e.zIndexMap[r].consumers-=1,e.zIndexMap[r].consumers<=0&&!Mve(r)&&delete e.zIndexMap[r])},prepare:Ot()},registerZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r,element:n,isPanorama:o}=t.payload;e.zIndexMap[r]?o?e.zIndexMap[r].panoramaElement=n:e.zIndexMap[r].element=n:e.zIndexMap[r]={consumers:0,element:o?void 0:n,panoramaElement:o?n:void 0}},prepare:Ot()},unregisterZIndexPortalElement:{reducer:(e,t)=>{var{zIndex:r}=t.payload;e.zIndexMap[r]&&(t.payload.isPanorama?e.zIndexMap[r].panoramaElement=void 0:e.zIndexMap[r].element=void 0)},prepare:Ot()}}}),{registerZIndexPortal:Nve,unregisterZIndexPortal:Bve,registerZIndexPortalElement:Lve,unregisterZIndexPortalElement:Dve}=sD.actions,zve=sD.reducer;function ud(e){var{zIndex:t,children:r}=e,n=Bfe(),o=n&&t!==void 0&&t!==0,i=Wo(),a=Xr();v.useLayoutEffect(()=>o?(a(Nve({zIndex:t})),()=>{a(Bve({zIndex:t}))}):ed,[a,t,o]);var s=Ge(l=>kve(l,t,i));return o?s?Qp.createPortal(r,s):null:r}function rS(){return rS=Object.assign?Object.assign.bind():function(e){for(var t=1;tv.useContext(lD),cD={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function o(l,u,c){this.fn=l,this.context=u,this.once=c||!1}function i(l,u,c,d,f){if(typeof c!="function")throw new TypeError("The listener must be a function");var p=new o(c,d||l,f),h=r?r+u:u;return l._events[h]?l._events[h].fn?l._events[h]=[l._events[h],p]:l._events[h].push(p):(l._events[h]=p,l._eventsCount++),l}function a(l,u){--l._eventsCount===0?l._events=new n:delete l._events[u]}function s(){this._events=new n,this._eventsCount=0}s.prototype.eventNames=function(){var u=[],c,d;if(this._eventsCount===0)return u;for(d in c=this._events)t.call(c,d)&&u.push(r?d.slice(1):d);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(c)):u},s.prototype.listeners=function(u){var c=r?r+u:u,d=this._events[c];if(!d)return[];if(d.fn)return[d.fn];for(var f=0,p=d.length,h=new Array(p);f{if(t&&Array.isArray(e)){var r=Number.parseInt(t,10);if(!ca(r))return e[r]}},Xve={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},uD=vn({name:"options",initialState:Xve,reducers:{createEventEmitter:e=>{e.eventEmitter==null&&(e.eventEmitter=Symbol("rechartsEventEmitter"))}}}),Qve=uD.reducer,{createEventEmitter:Jve}=uD.actions;function ebe(e){return e.tooltip.syncInteraction}var tbe={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},dD=vn({name:"chartData",initialState:tbe,reducers:{setChartData(e,t){if(e.chartData=t.payload,t.payload==null){e.dataStartIndex=0,e.dataEndIndex=0;return}t.payload.length>0&&e.dataEndIndex!==t.payload.length-1&&(e.dataEndIndex=t.payload.length-1)},setComputedData(e,t){e.computedData=t.payload},setDataStartEndIndexes(e,t){var{startIndex:r,endIndex:n}=t.payload;r!=null&&(e.dataStartIndex=r),n!=null&&(e.dataEndIndex=n)}}}),{setChartData:f_,setDataStartEndIndexes:rbe,setComputedData:jSe}=dD.actions,nbe=dD.reducer,obe=["x","y"];function p_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function cc(e){for(var t=1;tl.rootProps.className);v.useEffect(()=>{if(e==null)return ed;var l=(u,c,d)=>{if(t!==d&&e===u){if(n==="index"){var f;if(a&&c!==null&&c!==void 0&&(f=c.payload)!==null&&f!==void 0&&f.coordinate&&c.payload.sourceViewBox){var p=c.payload.coordinate,{x:h,y:m}=p,g=lbe(p,obe),{x:y,y:w,width:S,height:x}=c.payload.sourceViewBox,P=cc(cc({},g),{},{x:a.x+(S?(h-y)/S:0)*a.width,y:a.y+(x?(m-w)/x:0)*a.height});r(cc(cc({},c),{},{payload:cc(cc({},c.payload),{},{coordinate:P})}))}else r(c);return}if(o!=null){var A;if(typeof n=="function"){var T={activeTooltipIndex:c.payload.index==null?void 0:Number(c.payload.index),isTooltipActive:c.payload.active,activeIndex:c.payload.index==null?void 0:Number(c.payload.index),activeLabel:c.payload.label,activeDataKey:c.payload.dataKey,activeCoordinate:c.payload.coordinate},I=n(o,T);A=o[I]}else n==="value"&&(A=o.find(N=>String(N.value)===c.payload.label));var{coordinate:O}=c.payload;if(A==null||c.payload.active===!1||O==null||a==null){r(eS({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:_,y:R}=O,E=Math.min(_,a.x+a.width),M=Math.min(R,a.y+a.height),B={x:i==="horizontal"?A.coordinate:E,y:i==="horizontal"?M:A.coordinate},j=eS({active:c.payload.active,coordinate:B,dataKey:c.payload.dataKey,index:String(A.index),label:c.payload.label,sourceViewBox:c.payload.sourceViewBox,graphicalItemId:c.payload.graphicalItemId});r(j)}}};return $p.on(nS,l),()=>{$p.off(nS,l)}},[s,r,t,e,n,o,i,a])}function dbe(){var e=Ge(GC),t=Ge(qC),r=Xr();v.useEffect(()=>{if(e==null)return ed;var n=(o,i,a)=>{t!==a&&e===o&&r(rbe(i))};return $p.on(d_,n),()=>{$p.off(d_,n)}},[r,t,e])}function fbe(){var e=Xr();v.useEffect(()=>{e(Jve())},[e]),ube(),dbe()}function pbe(e,t,r,n,o,i){var a=Ge(p=>wve(p,e,t)),s=Ge(qC),l=Ge(GC),u=Ge(G9),c=Ge(ebe),d=c==null?void 0:c.active,f=Kv();v.useEffect(()=>{if(!d&&l!=null&&s!=null){var p=eS({active:i,coordinate:r,dataKey:a,index:o,label:typeof n=="number"?String(n):n,sourceViewBox:f,graphicalItemId:void 0});$p.emit(nS,l,p,s)}},[d,r,a,o,n,s,l,u,i,f])}function h_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function m_(e){for(var t=1;t{T(mye({shared:w,trigger:S,axisId:A,active:o,defaultIndex:I}))},[T,w,S,A,o,I]);var O=Kv(),_=FB(),R=cye(w),{activeIndex:E,isActive:M}=(t=Ge(ie=>Cve(ie,R,S,I)))!==null&&t!==void 0?t:{},B=Ge(ie=>Sve(ie,R,S,I)),j=Ge(ie=>aD(ie,R,S,I)),N=Ge(ie=>xve(ie,R,S,I)),F=B,D=qve(),z=(r=o??M)!==null&&r!==void 0?r:!1,[W,H]=Gue([F,z]),V=R==="axis"?j:void 0;pbe(R,S,N,V,E,z);var Q=P??D;if(Q==null||O==null||R==null)return null;var re=F??g_;z||(re=g_),u&&re.length&&(re=uue(re.filter(ie=>ie.value!=null&&(ie.hide!==!0||n.includeHidden)),f,ybe));var Y=re.length>0,Z=v.createElement(dpe,{allowEscapeViewBox:i,animationDuration:a,animationEasing:s,isAnimationActive:c,active:z,coordinate:N,hasPayload:Y,offset:d,position:p,reverseDirection:h,useTranslate3d:m,viewBox:O,wrapperStyle:g,lastBoundingBox:W,innerRef:H,hasPortalFromProps:!!P},vbe(l,m_(m_({},n),{},{payload:re,label:V,active:z,activeIndex:E,coordinate:N,accessibilityLayer:_})));return v.createElement(v.Fragment,null,Qp.createPortal(Z,Q),z&&v.createElement(Gve,{cursor:y,tooltipEventType:R,coordinate:N,payload:re,index:E}))}function xbe(e,t,r){return(t=Sbe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Sbe(e){var t=Cbe(e,"string");return typeof t=="symbol"?t:t+""}function Cbe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}class Ebe{constructor(t){xbe(this,"cache",new Map),this.maxSize=t}get(t){var r=this.cache.get(t);return r!==void 0&&(this.cache.delete(t),this.cache.set(t,r)),r}set(t,r){if(this.cache.has(t))this.cache.delete(t);else if(this.cache.size>=this.maxSize){var n=this.cache.keys().next().value;n!=null&&this.cache.delete(n)}this.cache.set(t,r)}clear(){this.cache.clear()}size(){return this.cache.size}}function y_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Pbe(e){for(var t=1;t{try{var r=document.getElementById(b_);r||(r=document.createElement("span"),r.setAttribute("id",b_),r.setAttribute("aria-hidden","true"),document.body.appendChild(r)),Object.assign(r.style,Obe,t),r.textContent="".concat(e);var n=r.getBoundingClientRect();return{width:n.width,height:n.height}}catch{return{width:0,height:0}}},x_=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||gC.isSsr)return{width:0,height:0};if(!fD.enableCache)return w_(t,r);var n=_be(t,r),o=v_.get(n);if(o)return o;var i=w_(t,r);return v_.set(n,i),i},pD;function $be(e,t,r){return(t=Rbe(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function Rbe(e){var t=jbe(e,"string");return typeof t=="symbol"?t:t+""}function jbe(e,t){if(typeof e!="object"||!e)return e;var r=e[Symbol.toPrimitive];if(r!==void 0){var n=r.call(e,t);if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}var S_=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,C_=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Mbe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,Nbe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Bbe={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Lbe=["cm","mm","pt","pc","in","Q","px"];function Dbe(e){return Lbe.includes(e)}var Mc="NaN";function zbe(e,t){return e*Bbe[t]}class Pr{static parse(t){var r,[,n,o]=(r=Nbe.exec(t))!==null&&r!==void 0?r:[];return n==null?Pr.NaN:new Pr(parseFloat(n),o??"")}constructor(t,r){this.num=t,this.unit=r,this.num=t,this.unit=r,ca(t)&&(this.unit=""),r!==""&&!Mbe.test(r)&&(this.num=NaN,this.unit=""),Dbe(r)&&(this.num=zbe(t,r),this.unit="px")}add(t){return this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num+t.num,this.unit)}subtract(t){return this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num-t.num,this.unit)}multiply(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num*t.num,this.unit||t.unit)}divide(t){return this.unit!==""&&t.unit!==""&&this.unit!==t.unit?new Pr(NaN,""):new Pr(this.num/t.num,this.unit||t.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return ca(this.num)}}pD=Pr;$be(Pr,"NaN",new pD(NaN,""));function hD(e){if(e==null||e.includes(Mc))return Mc;for(var t=e;t.includes("*")||t.includes("/");){var r,[,n,o,i]=(r=S_.exec(t))!==null&&r!==void 0?r:[],a=Pr.parse(n??""),s=Pr.parse(i??""),l=o==="*"?a.multiply(s):a.divide(s);if(l.isNaN())return Mc;t=t.replace(S_,l.toString())}for(;t.includes("+")||/.-\d+(?:\.\d+)?/.test(t);){var u,[,c,d,f]=(u=C_.exec(t))!==null&&u!==void 0?u:[],p=Pr.parse(c??""),h=Pr.parse(f??""),m=d==="+"?p.add(h):p.subtract(h);if(m.isNaN())return Mc;t=t.replace(C_,m.toString())}return t}var E_=/\(([^()]*)\)/;function Fbe(e){for(var t=e,r;(r=E_.exec(t))!=null;){var[,n]=r;t=t.replace(E_,hD(n))}return t}function Ube(e){var t=e.replace(/\s+/g,"");return t=Fbe(t),t=hD(t),t}function Wbe(e){try{return Ube(e)}catch{return Mc}}function q1(e){var t=Wbe(e.slice(5,-1));return t===Mc?"":t}var Hbe=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Vbe=["dx","dy","angle","className","breakAll"];function oS(){return oS=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{children:t,breakAll:r,style:n}=e;try{var o=[];$r(t)||(r?o=t.toString().split(""):o=t.toString().split(mD));var i=o.map(s=>({word:s,width:x_(s,n).width})),a=r?0:x_("Ā ",n).width;return{wordsWithComputedWidth:i,spaceWidth:a}}catch{return null}};function qbe(e){return e==="start"||e==="middle"||e==="end"||e==="inherit"}var yD=(e,t,r,n)=>e.reduce((o,i)=>{var{word:a,width:s}=i,l=o[o.length-1];if(l&&s!=null&&(t==null||n||l.width+s+re.reduce((t,r)=>t.width>r.width?t:r),Kbe="…",A_=(e,t,r,n,o,i,a,s)=>{var l=e.slice(0,t),u=gD({breakAll:r,style:n,children:l+Kbe});if(!u)return[!1,[]];var c=yD(u.wordsWithComputedWidth,i,a,s),d=c.length>o||vD(c).width>Number(i);return[d,c]},Zbe=(e,t,r,n,o)=>{var{maxLines:i,children:a,style:s,breakAll:l}=e,u=Be(i),c=String(a),d=yD(t,n,r,o);if(!u||o)return d;var f=d.length>i||vD(d).width>Number(n);if(!f)return d;for(var p=0,h=c.length-1,m=0,g;p<=h&&m<=c.length-1;){var y=Math.floor((p+h)/2),w=y-1,[S,x]=A_(c,w,l,s,i,n,r,o),[P]=A_(c,y,l,s,i,n,r,o);if(!S&&!P&&(p=y+1),S&&P&&(h=y-1),!S&&P){g=x;break}m++}return g||d},k_=e=>{var t=$r(e)?[]:e.toString().split(mD);return[{words:t,width:void 0}]},Ybe=e=>{var{width:t,scaleToFit:r,children:n,style:o,breakAll:i,maxLines:a}=e;if((t||r)&&!gC.isSsr){var s,l,u=gD({breakAll:i,children:n,style:o});if(u){var{wordsWithComputedWidth:c,spaceWidth:d}=u;s=c,l=d}else return k_(n);return Zbe({breakAll:i,children:n,maxLines:a,style:o},s,l,t,!!r)}return k_(n)},bD="#808080",Xbe={angle:0,breakAll:!1,capHeight:"0.71em",fill:bD,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},wD=v.forwardRef((e,t)=>{var r=Oi(e,Xbe),{x:n,y:o,lineHeight:i,capHeight:a,fill:s,scaleToFit:l,textAnchor:u,verticalAnchor:c}=r,d=P_(r,Hbe),f=v.useMemo(()=>Ybe({breakAll:d.breakAll,children:d.children,maxLines:d.maxLines,scaleToFit:l,style:d.style,width:d.width}),[d.breakAll,d.children,d.maxLines,l,d.style,d.width]),{dx:p,dy:h,angle:m,className:g,breakAll:y}=d,w=P_(d,Vbe);if(!ua(n)||!ua(o)||f.length===0)return null;var S=Number(n)+(Be(p)?p:0),x=Number(o)+(Be(h)?h:0);if(!gt(S)||!gt(x))return null;var P;switch(c){case"start":P=q1("calc(".concat(a,")"));break;case"middle":P=q1("calc(".concat((f.length-1)/2," * -").concat(i," + (").concat(a," / 2))"));break;default:P=q1("calc(".concat(f.length-1," * -").concat(i,")"));break}var A=[],T=f[0];if(l&&T!=null){var I=T.width,{width:O}=d;A.push("scale(".concat(Be(O)&&Be(I)?O/I:1,")"))}return m&&A.push("rotate(".concat(m,", ").concat(S,", ").concat(x,")")),A.length&&(w.transform=A.join(" ")),v.createElement("text",oS({},qr(w),{ref:t,x:S,y:x,className:se("recharts-text",g),textAnchor:u,fill:s.includes("url")?bD:s}),f.map((_,R)=>{var E=_.words.join(y?"":" ");return v.createElement("tspan",{x:S,dy:R===0?P:i,key:"".concat(E,"-").concat(R)},E)}))});wD.displayName="Text";function T_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Jo(e){for(var t=1;t{var{viewBox:t,position:r,offset:n=0,parentViewBox:o}=e,{x:i,y:a,height:s,upperWidth:l,lowerWidth:u}=pC(t),c=i,d=i+(l-u)/2,f=(c+d)/2,p=(l+u)/2,h=c+l/2,m=s>=0?1:-1,g=m*n,y=m>0?"end":"start",w=m>0?"start":"end",S=l>=0?1:-1,x=S*n,P=S>0?"end":"start",A=S>0?"start":"end",T=o;if(r==="top"){var I={x:c+l/2,y:a-g,horizontalAnchor:"middle",verticalAnchor:y};return T&&(I.height=Math.max(a-T.y,0),I.width=l),I}if(r==="bottom"){var O={x:d+u/2,y:a+s+g,horizontalAnchor:"middle",verticalAnchor:w};return T&&(O.height=Math.max(T.y+T.height-(a+s),0),O.width=u),O}if(r==="left"){var _={x:f-x,y:a+s/2,horizontalAnchor:P,verticalAnchor:"middle"};return T&&(_.width=Math.max(_.x-T.x,0),_.height=s),_}if(r==="right"){var R={x:f+p+x,y:a+s/2,horizontalAnchor:A,verticalAnchor:"middle"};return T&&(R.width=Math.max(T.x+T.width-R.x,0),R.height=s),R}var E=T?{width:p,height:s}:{};return r==="insideLeft"?Jo({x:f+x,y:a+s/2,horizontalAnchor:A,verticalAnchor:"middle"},E):r==="insideRight"?Jo({x:f+p-x,y:a+s/2,horizontalAnchor:P,verticalAnchor:"middle"},E):r==="insideTop"?Jo({x:c+l/2,y:a+g,horizontalAnchor:"middle",verticalAnchor:w},E):r==="insideBottom"?Jo({x:d+u/2,y:a+s-g,horizontalAnchor:"middle",verticalAnchor:y},E):r==="insideTopLeft"?Jo({x:c+x,y:a+g,horizontalAnchor:A,verticalAnchor:w},E):r==="insideTopRight"?Jo({x:c+l-x,y:a+g,horizontalAnchor:P,verticalAnchor:w},E):r==="insideBottomLeft"?Jo({x:d+x,y:a+s-g,horizontalAnchor:A,verticalAnchor:y},E):r==="insideBottomRight"?Jo({x:d+u-x,y:a+s-g,horizontalAnchor:P,verticalAnchor:y},E):r&&typeof r=="object"&&(Be(r.x)||Ll(r.x))&&(Be(r.y)||Ll(r.y))?Jo({x:i+ws(r.x,p),y:a+ws(r.y,s),horizontalAnchor:"end",verticalAnchor:"end"},E):Jo({x:h,y:a+s/2,horizontalAnchor:"middle",verticalAnchor:"middle"},E)},r1e=["labelRef"],n1e=["content"];function I_(e,t){if(e==null)return{};var r,n,o=o1e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var e=v.useContext(l1e),t=Kv();return e||(t?pC(t):void 0)},u1e=v.createContext(null),d1e=()=>{var e=v.useContext(u1e),t=Ge(Q9);return e||t},f1e=e=>{var{value:t,formatter:r}=e,n=$r(e.children)?t:e.children;return typeof r=="function"?r(n):n},p1e=e=>e!=null&&typeof e=="function",h1e=(e,t)=>{var r=fi(t-e),n=Math.min(Math.abs(t-e),360);return r*n},m1e=(e,t,r,n,o)=>{var{offset:i,className:a}=e,{cx:s,cy:l,innerRadius:u,outerRadius:c,startAngle:d,endAngle:f,clockWise:p}=o,h=(u+c)/2,m=h1e(d,f),g=m>=0?1:-1,y,w;switch(t){case"insideStart":y=d+g*i,w=p;break;case"insideEnd":y=f-g*i,w=!p;break;case"end":y=f+g*i,w=p;break;default:throw new Error("Unsupported position ".concat(t))}w=m<=0?w:!w;var S=Tr(s,l,h,y),x=Tr(s,l,h,y+(w?1:-1)*359),P="M".concat(S.x,",").concat(S.y,` + A`).concat(h,",").concat(h,",0,1,").concat(w?0:1,`, + `).concat(x.x,",").concat(x.y),A=$r(e.id)?vp("recharts-radial-line-"):e.id;return v.createElement("text",Lg({},n,{dominantBaseline:"central",className:se("recharts-radial-bar-label",a)}),v.createElement("defs",null,v.createElement("path",{id:A,d:P})),v.createElement("textPath",{xlinkHref:"#".concat(A)},r))},g1e=(e,t,r)=>{var{cx:n,cy:o,innerRadius:i,outerRadius:a,startAngle:s,endAngle:l}=e,u=(s+l)/2;if(r==="outside"){var{x:c,y:d}=Tr(n,o,a+t,u);return{x:c,y:d,textAnchor:c>=n?"start":"end",verticalAnchor:"middle"}}if(r==="center")return{x:n,y:o,textAnchor:"middle",verticalAnchor:"middle"};if(r==="centerTop")return{x:n,y:o,textAnchor:"middle",verticalAnchor:"start"};if(r==="centerBottom")return{x:n,y:o,textAnchor:"middle",verticalAnchor:"end"};var f=(i+a)/2,{x:p,y:h}=Tr(n,o,f,u);return{x:p,y:h,textAnchor:"middle",verticalAnchor:"middle"}},Q0=e=>e!=null&&"cx"in e&&Be(e.cx),y1e={angle:0,offset:5,zIndex:to.label,position:"middle",textBreakAll:!1};function v1e(e){if(!Q0(e))return e;var{cx:t,cy:r,outerRadius:n}=e,o=n*2;return{x:t-n,y:r-n,width:o,upperWidth:o,lowerWidth:o,height:o}}function xD(e){var t=Oi(e,y1e),{viewBox:r,parentViewBox:n,position:o,value:i,children:a,content:s,className:l="",textBreakAll:u,labelRef:c}=t,d=d1e(),f=c1e(),p=o==="center"?f:d??f,h,m,g;r==null?h=p:Q0(r)?h=r:h=pC(r);var y=v1e(h);if(!h||$r(i)&&$r(a)&&!v.isValidElement(s)&&typeof s!="function")return null;var w=E0(E0({},t),{},{viewBox:h});if(v.isValidElement(s)){var{labelRef:S}=w,x=I_(w,r1e);return v.cloneElement(s,x)}if(typeof s=="function"){var{content:P}=w,A=I_(w,n1e);if(m=v.createElement(s,A),v.isValidElement(m))return m}else m=f1e(t);var T=qr(t);if(Q0(h)){if(o==="insideStart"||o==="insideEnd"||o==="end")return m1e(t,o,m,T,h);g=g1e(h,t.offset,t.position)}else{if(!y)return null;var I=t1e({viewBox:y,position:o,offset:t.offset,parentViewBox:Q0(n)?void 0:n});g=E0(E0({x:I.x,y:I.y,textAnchor:I.horizontalAnchor,verticalAnchor:I.verticalAnchor},I.width!==void 0?{width:I.width}:{}),I.height!==void 0?{height:I.height}:{})}return v.createElement(ud,{zIndex:t.zIndex},v.createElement(wD,Lg({ref:c,className:se("recharts-label",l)},T,g,{textAnchor:qbe(T.textAnchor)?T.textAnchor:g.textAnchor,breakAll:u}),m))}xD.displayName="Label";var SD={},CD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return r[r.length-1]}e.last=t})(CD);var ED={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){return Array.isArray(r)?r:Array.from(r)}e.toArray=t})(ED);(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});const t=CD,r=ED,n=_v;function o(i){if(n.isArrayLike(i))return t.last(r.toArray(i))}e.last=o})(SD);var b1e=SD.last;const w1e=Ti(b1e);var x1e=["valueAccessor"],S1e=["dataKey","clockWise","id","textBreakAll","zIndex"];function Dg(){return Dg=Object.assign?Object.assign.bind():function(e){for(var t=1;tArray.isArray(e.value)?w1e(e.value):e.value,PD=v.createContext(void 0),P1e=PD.Provider,AD=v.createContext(void 0);AD.Provider;function A1e(){return v.useContext(PD)}function k1e(){return v.useContext(AD)}function J0(e){var{valueAccessor:t=E1e}=e,r=__(e,x1e),{dataKey:n,clockWise:o,id:i,textBreakAll:a,zIndex:s}=r,l=__(r,S1e),u=A1e(),c=k1e(),d=u||c;return!d||!d.length?null:v.createElement(ud,{zIndex:s??to.label},v.createElement(ch,{className:"recharts-label-list"},d.map((f,p)=>{var h,m=$r(n)?t(f,p):Or(f.payload,n),g=$r(i)?{}:{id:"".concat(i,"-").concat(p)};return v.createElement(xD,Dg({key:"label-".concat(p)},qr(f),l,g,{fill:(h=r.fill)!==null&&h!==void 0?h:f.fill,parentViewBox:f.parentViewBox,value:m,textBreakAll:a,viewBox:f.viewBox,index:p,zIndex:0}))})))}J0.displayName="LabelList";function T1e(e){var{label:t}=e;return t?t===!0?v.createElement(J0,{key:"labelList-implicit"}):v.isValidElement(t)||p1e(t)?v.createElement(J0,{key:"labelList-implicit",content:t}):typeof t=="object"?v.createElement(J0,Dg({key:"labelList-implicit"},t,{type:String(t.type)})):null:null}function iS(){return iS=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{cx:t,cy:r,r:n,className:o}=e,i=se("recharts-dot",o);return Be(t)&&Be(r)&&Be(n)?v.createElement("circle",iS({},Ou(e),K6(e),{className:i,cx:t,cy:r,r:n})):null},I1e={radiusAxis:{},angleAxis:{}},TD=vn({name:"polarAxis",initialState:I1e,reducers:{addRadiusAxis(e,t){e.radiusAxis[t.payload.id]=t.payload},removeRadiusAxis(e,t){delete e.radiusAxis[t.payload.id]},addAngleAxis(e,t){e.angleAxis[t.payload.id]=t.payload},removeAngleAxis(e,t){delete e.angleAxis[t.payload.id]}}}),{addRadiusAxis:MSe,removeRadiusAxis:NSe,addAngleAxis:BSe,removeAngleAxis:LSe}=TD.actions,O1e=TD.reducer,ID=e=>e&&typeof e=="object"&&"clipDot"in e?!!e.clipDot:!0,OD={};(function(e){Object.defineProperty(e,Symbol.toStringTag,{value:"Module"});function t(r){var o;if(typeof r!="object"||r==null)return!1;if(Object.getPrototypeOf(r)===null)return!0;if(Object.prototype.toString.call(r)!=="[object Object]"){const i=r[Symbol.toStringTag];return i==null||!((o=Object.getOwnPropertyDescriptor(r,Symbol.toStringTag))!=null&&o.writable)?!1:r.toString()===`[object ${i}]`}let n=r;for(;Object.getPrototypeOf(n)!==null;)n=Object.getPrototypeOf(n);return Object.getPrototypeOf(r)===n}e.isPlainObject=t})(OD);var _1e=OD.isPlainObject;const $1e=Ti(_1e);var $_,R_,j_,M_,N_;function B_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function L_(e){for(var t=1;t{var i=r-n,a;return a=Ht($_||($_=zd(["M ",",",""])),e,t),a+=Ht(R_||(R_=zd(["L ",",",""])),e+r,t),a+=Ht(j_||(j_=zd(["L ",",",""])),e+r-i/2,t+o),a+=Ht(M_||(M_=zd(["L ",",",""])),e+r-i/2-n,t+o),a+=Ht(N_||(N_=zd(["L ",","," Z"])),e,t),a},N1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},B1e=e=>{var t=Oi(e,N1e),{x:r,y:n,upperWidth:o,lowerWidth:i,height:a,className:s}=t,{animationEasing:l,animationDuration:u,animationBegin:c,isUpdateAnimationActive:d}=t,f=v.useRef(null),[p,h]=v.useState(-1),m=v.useRef(o),g=v.useRef(i),y=v.useRef(a),w=v.useRef(r),S=v.useRef(n),x=vC(e,"trapezoid-");if(v.useEffect(()=>{if(f.current&&f.current.getTotalLength)try{var B=f.current.getTotalLength();B&&h(B)}catch{}},[]),r!==+r||n!==+n||o!==+o||i!==+i||a!==+a||o===0&&i===0||a===0)return null;var P=se("recharts-trapezoid",s);if(!d)return v.createElement("g",null,v.createElement("path",zg({},qr(t),{className:P,d:D_(r,n,o,i,a)})));var A=m.current,T=g.current,I=y.current,O=w.current,_=S.current,R="0px ".concat(p===-1?1:p,"px"),E="".concat(p,"px 0px"),M=WB(["strokeDasharray"],u,l);return v.createElement(yC,{animationId:x,key:x,canBegin:p>0,duration:u,easing:l,isActive:d,begin:c},B=>{var j=tn(A,o,B),N=tn(T,i,B),F=tn(I,a,B),D=tn(O,r,B),z=tn(_,n,B);f.current&&(m.current=j,g.current=N,y.current=F,w.current=D,S.current=z);var W=B>0?{transition:M,strokeDasharray:E}:{strokeDasharray:R};return v.createElement("path",zg({},qr(t),{className:P,d:D_(D,z,j,N,F),ref:f,style:L_(L_({},W),t.style)}))})},L1e=["option","shapeType","activeClassName"];function D1e(e,t){if(e==null)return{};var r,n,o=z1e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{n||(o.current===null?r(fye(t)):o.current!==t&&r(pye({prev:o.current,next:t})),o.current=t)},[t,r,n]),v.useLayoutEffect(()=>()=>{o.current&&(r(hye(o.current)),o.current=null)},[r]),null}function Z1e(e){var{legendPayload:t}=e,r=Xr(),n=Wo(),o=v.useRef(null);return v.useLayoutEffect(()=>{n||(o.current===null?r(Yfe(t)):o.current!==t&&r(Xfe({prev:o.current,next:t})),o.current=t)},[r,n,t]),v.useLayoutEffect(()=>()=>{o.current&&(r(Qfe(o.current)),o.current=null)},[r]),null}var K1,Y1e=()=>{var[e]=v.useState(()=>vp("uid-"));return e},X1e=(K1=gf.useId)!==null&&K1!==void 0?K1:Y1e;function Q1e(e,t){var r=X1e();return t||(e?"".concat(e,"-").concat(r):r)}var J1e=v.createContext(void 0),ewe=e=>{var{id:t,type:r,children:n}=e,o=Q1e("recharts-".concat(r),t);return v.createElement(J1e.Provider,{value:o},n(o))},twe={cartesianItems:[],polarItems:[]},_D=vn({name:"graphicalItems",initialState:twe,reducers:{addCartesianGraphicalItem:{reducer(e,t){e.cartesianItems.push(t.payload)},prepare:Ot()},replaceCartesianGraphicalItem:{reducer(e,t){var{prev:r,next:n}=t.payload,o=Io(e).cartesianItems.indexOf(r);o>-1&&(e.cartesianItems[o]=n)},prepare:Ot()},removeCartesianGraphicalItem:{reducer(e,t){var r=Io(e).cartesianItems.indexOf(t.payload);r>-1&&e.cartesianItems.splice(r,1)},prepare:Ot()},addPolarGraphicalItem:{reducer(e,t){e.polarItems.push(t.payload)},prepare:Ot()},removePolarGraphicalItem:{reducer(e,t){var r=Io(e).polarItems.indexOf(t.payload);r>-1&&e.polarItems.splice(r,1)},prepare:Ot()}}}),{addCartesianGraphicalItem:rwe,replaceCartesianGraphicalItem:nwe,removeCartesianGraphicalItem:owe,addPolarGraphicalItem:DSe,removePolarGraphicalItem:zSe}=_D.actions,iwe=_D.reducer,awe=e=>{var t=Xr(),r=v.useRef(null);return v.useLayoutEffect(()=>{r.current===null?t(rwe(e)):r.current!==e&&t(nwe({prev:r.current,next:e})),r.current=e},[t,e]),v.useLayoutEffect(()=>()=>{r.current&&(t(owe(r.current)),r.current=null)},[t]),null},swe=v.memo(awe),lwe=["points"];function U_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Z1(e){for(var t=1;t{var g,y,w=Z1(Z1(Z1({r:3},a),d),{},{index:m,cx:(g=h.x)!==null&&g!==void 0?g:void 0,cy:(y=h.y)!==null&&y!==void 0?y:void 0,dataKey:i,value:h.value,payload:h.payload,points:t});return v.createElement(hwe,{key:"dot-".concat(m),option:r,dotProps:w,className:o})}),p={};return s&&l!=null&&(p.clipPath="url(#clipPath-".concat(c?"":"dots-").concat(l,")")),v.createElement(ud,{zIndex:u},v.createElement(ch,Ug({className:n},p),f))}function W_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function H_(e){for(var t=1;t({top:e.top,bottom:e.bottom,left:e.left,right:e.right})),Cwe=X([Swe,Sa,Ca],(e,t,r)=>{if(!(!e||t==null||r==null))return{x:e.left,y:e.top,width:Math.max(0,t-e.left-e.right),height:Math.max(0,r-e.top-e.bottom)}}),yE=()=>Ge(Cwe),Ewe=()=>Ge(ave);function V_(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function Y1(e){for(var t=1;t{var{point:t,childIndex:r,mainColor:n,activeDot:o,dataKey:i,clipPath:a}=e;if(o===!1||t.x==null||t.y==null)return null;var s={index:r,dataKey:i,cx:t.x,cy:t.y,r:4,fill:n??"none",strokeWidth:2,stroke:"#fff",payload:t.payload,value:t.value},l=Y1(Y1(Y1({},s),W6(o)),K6(o)),u;return v.isValidElement(o)?u=v.cloneElement(o,l):typeof o=="function"?u=o(l):u=v.createElement(kD,l),v.createElement(ch,{className:"recharts-active-dot",clipPath:a},u)};function Iwe(e){var{points:t,mainColor:r,activeDot:n,itemDataKey:o,clipPath:i,zIndex:a=to.activeDot}=e,s=Ge(_p),l=Ewe();if(t==null||l==null)return null;var u=t.find(c=>l.includes(c.payload));return $r(u)?null:v.createElement(ud,{zIndex:a},v.createElement(Twe,{point:u,childIndex:Number(s),mainColor:r,dataKey:o,activeDot:n,clipPath:i}))}var Owe=e=>{var{chartData:t}=e,r=Xr(),n=Wo();return v.useEffect(()=>n?()=>{}:(r(f_(t)),()=>{r(f_(void 0))}),[t,r,n]),null},G_={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},RD=vn({name:"brush",initialState:G_,reducers:{setBrushSettings(e,t){return t.payload==null?G_:t.payload}}}),{setBrushSettings:XSe}=RD.actions,_we=RD.reducer,$we={dots:[],areas:[],lines:[]},jD=vn({name:"referenceElements",initialState:$we,reducers:{addDot:(e,t)=>{e.dots.push(t.payload)},removeDot:(e,t)=>{var r=Io(e).dots.findIndex(n=>n===t.payload);r!==-1&&e.dots.splice(r,1)},addArea:(e,t)=>{e.areas.push(t.payload)},removeArea:(e,t)=>{var r=Io(e).areas.findIndex(n=>n===t.payload);r!==-1&&e.areas.splice(r,1)},addLine:(e,t)=>{e.lines.push(t.payload)},removeLine:(e,t)=>{var r=Io(e).lines.findIndex(n=>n===t.payload);r!==-1&&e.lines.splice(r,1)}}}),{addDot:QSe,removeDot:JSe,addArea:e5e,removeArea:t5e,addLine:r5e,removeLine:n5e}=jD.actions,Rwe=jD.reducer,jwe=v.createContext(void 0),Mwe=e=>{var{children:t}=e,[r]=v.useState("".concat(vp("recharts"),"-clip")),n=yE();if(n==null)return null;var{x:o,y:i,width:a,height:s}=n;return v.createElement(jwe.Provider,{value:r},v.createElement("defs",null,v.createElement("clipPath",{id:r},v.createElement("rect",{x:o,y:i,height:s,width:a}))),t)},Nwe={},MD=vn({name:"errorBars",initialState:Nwe,reducers:{addErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]||(e[r]=[]),e[r].push(n)},replaceErrorBar:(e,t)=>{var{itemId:r,prev:n,next:o}=t.payload;e[r]&&(e[r]=e[r].map(i=>i.dataKey===n.dataKey&&i.direction===n.direction?o:i))},removeErrorBar:(e,t)=>{var{itemId:r,errorBar:n}=t.payload;e[r]&&(e[r]=e[r].filter(o=>o.dataKey!==n.dataKey||o.direction!==n.direction))}}}),{addErrorBar:o5e,replaceErrorBar:i5e,removeErrorBar:a5e}=MD.actions,Bwe=MD.reducer,Lwe=["children"];function Dwe(e,t){if(e==null)return{};var r,n,o=zwe(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n({x:0,y:0,value:0}),errorBarOffset:0},Uwe=v.createContext(Fwe);function Wwe(e){var{children:t}=e,r=Dwe(e,Lwe);return v.createElement(Uwe.Provider,{value:r},t)}function ND(e,t){var r,n,o=Ge(u=>Pa(u,e)),i=Ge(u=>Aa(u,t)),a=(r=o==null?void 0:o.allowDataOverflow)!==null&&r!==void 0?r:tL.allowDataOverflow,s=(n=i==null?void 0:i.allowDataOverflow)!==null&&n!==void 0?n:rL.allowDataOverflow,l=a||s;return{needClip:l,needClipX:a,needClipY:s}}function Hwe(e){var{xAxisId:t,yAxisId:r,clipPathId:n}=e,o=yE(),{needClipX:i,needClipY:a,needClip:s}=ND(t,r);if(!s||!o)return null;var{x:l,y:u,width:c,height:d}=o;return v.createElement("clipPath",{id:"clipPath-".concat(n)},v.createElement("rect",{x:i?l:l-c/2,y:a?u:u-d/2,width:i?c:c*2,height:a?d:d*2}))}var BD=(e,t,r,n)=>NL(e,"xAxis",t,n),LD=(e,t,r,n)=>ML(e,"xAxis",t,n),DD=(e,t,r,n)=>NL(e,"yAxis",r,n),zD=(e,t,r,n)=>ML(e,"yAxis",r,n),Vwe=X([Bt,BD,DD,LD,zD],(e,t,r,n,o)=>xa(e,"xAxis")?hg(t,n,!1):hg(r,o,!1)),Gwe=(e,t,r,n,o)=>o;function qwe(e){return e.type==="line"}var Kwe=X([iL,Gwe],(e,t)=>e.filter(qwe).find(r=>r.id===t)),Zwe=X([Bt,BD,DD,LD,zD,Kwe,Vwe,UC],(e,t,r,n,o,i,a,s)=>{var{chartData:l,dataStartIndex:u,dataEndIndex:c}=s;if(!(i==null||t==null||r==null||n==null||o==null||n.length===0||o.length===0||a==null||e!=="horizontal"&&e!=="vertical")){var{dataKey:d,data:f}=i,p;if(f!=null&&f.length>0?p=f:p=l==null?void 0:l.slice(u,c+1),p!=null)return zxe({layout:e,xAxis:t,yAxis:r,xAxisTicks:n,yAxisTicks:o,dataKey:d,bandSize:a,displayedData:p})}});function Ywe(e){var t=W6(e),r=3,n=2;if(t!=null){var{r:o,strokeWidth:i}=t,a=Number(o),s=Number(i);return(Number.isNaN(a)||a<0)&&(a=r),(Number.isNaN(s)||s<0)&&(s=n),{r:a,strokeWidth:s}}return{r,strokeWidth:n}}var Xwe={};/** + * @license React + * use-sync-external-store-with-selector.production.js + * + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + */var kh=v;function Qwe(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Jwe=typeof Object.is=="function"?Object.is:Qwe,exe=kh.useSyncExternalStore,txe=kh.useRef,rxe=kh.useEffect,nxe=kh.useMemo,oxe=kh.useDebugValue;Xwe.useSyncExternalStoreWithSelector=function(e,t,r,n,o){var i=txe(null);if(i.current===null){var a={hasValue:!1,value:null};i.current=a}else a=i.current;i=nxe(function(){function l(p){if(!u){if(u=!0,c=p,p=n(p),o!==void 0&&a.hasValue){var h=a.value;if(o(h,p))return d=h}return d=p}if(h=d,Jwe(c,p))return h;var m=n(p);return o!==void 0&&o(h,m)?(c=p,h):(c=p,d=m)}var u=!1,c,d,f=r===void 0?null:r;return[function(){return l(t())},f===null?void 0:function(){return l(f())}]},[t,r,n,o]);var s=exe(e,i[0],i[1]);return rxe(function(){a.hasValue=!0,a.value=s},[s]),oxe(s),s};function ixe(e){e()}function axe(){let e=null,t=null;return{clear(){e=null,t=null},notify(){ixe(()=>{let r=e;for(;r;)r.callback(),r=r.next})},get(){const r=[];let n=e;for(;n;)r.push(n),n=n.next;return r},subscribe(r){let n=!0;const o=t={callback:r,next:null,prev:t};return o.prev?o.prev.next=o:e=o,function(){!n||e===null||(n=!1,o.next?o.next.prev=o.prev:t=o.prev,o.prev?o.prev.next=o.next:e=o.next)}}}}var q_={notify(){},get:()=>[]};function sxe(e,t){let r,n=q_,o=0,i=!1;function a(m){c();const g=n.subscribe(m);let y=!1;return()=>{y||(y=!0,g(),d())}}function s(){n.notify()}function l(){h.onStateChange&&h.onStateChange()}function u(){return i}function c(){o++,r||(r=e.subscribe(l),n=axe())}function d(){o--,r&&o===0&&(r(),r=void 0,n.clear(),n=q_)}function f(){i||(i=!0,c())}function p(){i&&(i=!1,d())}const h={addNestedSub:a,notifyNestedSubs:s,handleChangeWrapper:l,isSubscribed:u,trySubscribe:f,tryUnsubscribe:p,getListeners:()=>n};return h}var lxe=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",cxe=lxe(),uxe=()=>typeof navigator<"u"&&navigator.product==="ReactNative",dxe=uxe(),fxe=()=>cxe||dxe?v.useLayoutEffect:v.useEffect,pxe=fxe();function K_(e,t){return e===t?e!==0||t!==0||1/e===1/t:e!==e&&t!==t}function hxe(e,t){if(K_(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;const r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(let o=0;o{const l=sxe(o);return{store:o,subscription:l,getServerState:n?()=>n:void 0}},[o,n]),a=v.useMemo(()=>o.getState(),[o]);pxe(()=>{const{subscription:l}=i;return l.onStateChange=l.notifyNestedSubs,l.trySubscribe(),a!==o.getState()&&l.notifyNestedSubs(),()=>{l.tryUnsubscribe(),l.onStateChange=void 0}},[i,a]);const s=r||gxe;return v.createElement(s.Provider,{value:i},t)}var vxe=yxe,bxe=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function wxe(e,t){return e==null&&t==null?!0:typeof e=="number"&&typeof t=="number"?e===t||e!==e&&t!==t:e===t}function FD(e,t){var r=new Set([...Object.keys(e),...Object.keys(t)]);for(var n of r)if(bxe.has(n)){if(e[n]==null&&t[n]==null)continue;if(!hxe(e[n],t[n]))return!1}else if(!wxe(e[n],t[n]))return!1;return!0}var xxe=["id"],Sxe=["type","layout","connectNulls","needClip","shape"],Cxe=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function Rp(){return Rp=Object.assign?Object.assign.bind():function(e){for(var t=1;t{var{dataKey:t,name:r,stroke:n,legendType:o,hide:i}=e;return[{inactive:i,dataKey:t,type:o,color:n,value:PB(r,t),payload:e}]},Ixe=v.memo(e=>{var{dataKey:t,data:r,stroke:n,strokeWidth:o,fill:i,name:a,hide:s,unit:l,tooltipType:u,id:c}=e,d={dataDefinedOnItem:r,getPosition:ed,settings:{stroke:n,strokeWidth:o,fill:i,dataKey:t,nameKey:void 0,name:PB(a,t),hide:s,type:u,color:n,unit:l,graphicalItemId:c}};return v.createElement(K1e,{tooltipEntrySettings:d})}),UD=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function Oxe(e,t){for(var r=e.length%2!==0?[...e,0]:e,n=[],o=0;o{var n=r.reduce((p,h)=>p+h);if(!n)return UD(t,e);for(var o=Math.floor(e/n),i=e%n,a=t-e,s=[],l=0,u=0;li){s=[...r.slice(0,l),i-u];break}}var f=s.length%2===0?[0,a]:[a];return[...Oxe(r,o),...s,...f].map(p=>"".concat(p,"px")).join(", ")};function $xe(e){var{clipPathId:t,points:r,props:n}=e,{dot:o,dataKey:i,needClip:a}=n,{id:s}=n,l=vE(n,xxe),u=Ou(l);return v.createElement(gwe,{points:r,dot:o,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:i,baseProps:u,needClip:a,clipPathId:t})}function Rxe(e){var{showLabels:t,children:r,points:n}=e,o=v.useMemo(()=>n==null?void 0:n.map(i=>{var a,s,l={x:(a=i.x)!==null&&a!==void 0?a:0,y:(s=i.y)!==null&&s!==void 0?s:0,width:0,lowerWidth:0,upperWidth:0,height:0};return ai(ai({},l),{},{value:i.value,payload:i.payload,viewBox:l,parentViewBox:void 0,fill:void 0})}),[n]);return v.createElement(P1e,{value:t?o:void 0},r)}function Y_(e){var{clipPathId:t,pathRef:r,points:n,strokeDasharray:o,props:i}=e,{type:a,layout:s,connectNulls:l,needClip:u,shape:c}=i,d=vE(i,Sxe),f=ai(ai({},qr(d)),{},{fill:"none",className:"recharts-line-curve",clipPath:u?"url(#clipPath-".concat(t,")"):void 0,points:n,type:a,layout:s,connectNulls:l,strokeDasharray:o??i.strokeDasharray});return v.createElement(v.Fragment,null,(n==null?void 0:n.length)>1&&v.createElement(q1e,Rp({shapeType:"curve",option:c},f,{pathRef:r})),v.createElement($xe,{points:n,clipPathId:t,props:i}))}function jxe(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch{return 0}}function Mxe(e){var{clipPathId:t,props:r,pathRef:n,previousPointsRef:o,longestAnimatedLengthRef:i}=e,{points:a,strokeDasharray:s,isAnimationActive:l,animationBegin:u,animationDuration:c,animationEasing:d,animateNewValues:f,width:p,height:h,onAnimationEnd:m,onAnimationStart:g}=r,y=o.current,w=vC(a,"recharts-line-"),S=v.useRef(w),[x,P]=v.useState(!1),A=!x,T=v.useCallback(()=>{typeof m=="function"&&m(),P(!1)},[m]),I=v.useCallback(()=>{typeof g=="function"&&g(),P(!0)},[g]),O=jxe(n.current),_=v.useRef(0);S.current!==w&&(_.current=i.current,S.current=w);var R=_.current;return v.createElement(Rxe,{points:a,showLabels:A},r.children,v.createElement(yC,{animationId:w,begin:u,duration:c,isActive:l,easing:d,onAnimationEnd:T,onAnimationStart:I,key:w},E=>{var M=tn(R,O+R,E),B=Math.min(M,O),j;if(l)if(s){var N="".concat(s).split(/[,\s]+/gim).map(z=>parseFloat(z));j=_xe(B,O,N)}else j=UD(O,B);else j=s==null?void 0:String(s);if(E>0&&O>0&&(o.current=a,i.current=Math.max(i.current,B)),y){var F=y.length/a.length,D=E===1?a:a.map((z,W)=>{var H=Math.floor(W*F);if(y[H]){var V=y[H];return ai(ai({},z),{},{x:tn(V.x,z.x,E),y:tn(V.y,z.y,E)})}return f?ai(ai({},z),{},{x:tn(p*2,z.x,E),y:tn(h/2,z.y,E)}):ai(ai({},z),{},{x:z.x,y:z.y})});return o.current=D,v.createElement(Y_,{props:r,points:D,clipPathId:t,pathRef:n,strokeDasharray:j})}return v.createElement(Y_,{props:r,points:a,clipPathId:t,pathRef:n,strokeDasharray:j})}),v.createElement(T1e,{label:r.label}))}function Nxe(e){var{clipPathId:t,props:r}=e,n=v.useRef(null),o=v.useRef(0),i=v.useRef(null);return v.createElement(Mxe,{props:r,clipPathId:t,previousPointsRef:n,longestAnimatedLengthRef:o,pathRef:i})}var Bxe=(e,t)=>{var r,n;return{x:(r=e.x)!==null&&r!==void 0?r:void 0,y:(n=e.y)!==null&&n!==void 0?n:void 0,value:e.value,errorVal:Or(e.payload,t)}};class Lxe extends v.Component{render(){var{hide:t,dot:r,points:n,className:o,xAxisId:i,yAxisId:a,top:s,left:l,width:u,height:c,id:d,needClip:f,zIndex:p}=this.props;if(t)return null;var h=se("recharts-line",o),m=d,{r:g,strokeWidth:y}=Ywe(r),w=ID(r),S=g*2+y,x=f?"url(#clipPath-".concat(w?"":"dots-").concat(m,")"):void 0;return v.createElement(ud,{zIndex:p},v.createElement(ch,{className:h},f&&v.createElement("defs",null,v.createElement(Hwe,{clipPathId:m,xAxisId:i,yAxisId:a}),!w&&v.createElement("clipPath",{id:"clipPath-dots-".concat(m)},v.createElement("rect",{x:l-S/2,y:s-S/2,width:u+S,height:c+S}))),v.createElement(Wwe,{xAxisId:i,yAxisId:a,data:n,dataPointFormatter:Bxe,errorBarOffset:0},v.createElement(Nxe,{props:this.props,clipPathId:m}))),v.createElement(Iwe,{activeDot:this.props.activeDot,points:n,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:x}))}}var WD={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:to.line,type:"linear"};function Dxe(e){var t=Oi(e,WD),{activeDot:r,animateNewValues:n,animationBegin:o,animationDuration:i,animationEasing:a,connectNulls:s,dot:l,hide:u,isAnimationActive:c,label:d,legendType:f,xAxisId:p,yAxisId:h,id:m}=t,g=vE(t,Cxe),{needClip:y}=ND(p,h),w=yE(),S=hh(),x=Wo(),P=Ge(_=>Zwe(_,p,h,x,m));if(S!=="horizontal"&&S!=="vertical"||P==null||w==null)return null;var{height:A,width:T,x:I,y:O}=w;return v.createElement(Lxe,Rp({},g,{id:m,connectNulls:s,dot:l,activeDot:r,animateNewValues:n,animationBegin:o,animationDuration:i,animationEasing:a,isAnimationActive:c,hide:u,label:d,legendType:f,xAxisId:p,yAxisId:h,points:P,layout:S,height:A,width:T,left:I,top:O,needClip:y}))}function zxe(e){var{layout:t,xAxis:r,yAxis:n,xAxisTicks:o,yAxisTicks:i,dataKey:a,bandSize:s,displayedData:l}=e;return l.map((u,c)=>{var d=Or(u,a);if(t==="horizontal"){var f=uI({axis:r,ticks:o,bandSize:s,entry:u,index:c}),p=$r(d)?null:n.scale.map(d);return{x:f,y:p??null,value:d,payload:u}}var h=$r(d)?null:r.scale.map(d),m=uI({axis:n,ticks:i,bandSize:s,entry:u,index:c});return h==null||m==null?null:{x:h,y:m,value:d,payload:u}}).filter(Boolean)}function Fxe(e){var t=Oi(e,WD),r=Wo();return v.createElement(ewe,{id:t.id,type:"line"},n=>v.createElement(v.Fragment,null,v.createElement(Z1e,{legendPayload:Txe(t)}),v.createElement(Ixe,{dataKey:t.dataKey,data:t.data,stroke:t.stroke,strokeWidth:t.strokeWidth,fill:t.fill,name:t.name,hide:t.hide,unit:t.unit,tooltipType:t.tooltipType,id:n}),v.createElement(swe,{type:"line",id:n,data:t.data,xAxisId:t.xAxisId,yAxisId:t.yAxisId,zAxisId:0,dataKey:t.dataKey,hide:t.hide,isPanorama:r}),v.createElement(Dxe,Rp({},t,{id:n}))))}var HD=v.memo(Fxe,FD);HD.displayName="Line";var Uxe=(e,t)=>t,bE=X([Uxe,Bt,Q9,Sr,QL,ka,bve,Rr],Ave),wE=e=>{var t=e.currentTarget.getBoundingClientRect(),r=t.width/e.currentTarget.offsetWidth,n=t.height/e.currentTarget.offsetHeight;return{chartX:Math.round((e.clientX-t.left)/r),chartY:Math.round((e.clientY-t.top)/n)}},VD=uo("mouseClick"),GD=fh();GD.startListening({actionCreator:VD,effect:(e,t)=>{var r=e.payload,n=bE(t.getState(),wE(r));(n==null?void 0:n.activeIndex)!=null&&t.dispatch(yye({activeIndex:n.activeIndex,activeDataKey:void 0,activeCoordinate:n.activeCoordinate}))}});var aS=uo("mouseMove"),qD=fh(),P0=null;qD.startListening({actionCreator:aS,effect:(e,t)=>{var r=e.payload;P0!==null&&cancelAnimationFrame(P0);var n=wE(r);P0=requestAnimationFrame(()=>{var o=t.getState(),i=sE(o,o.tooltip.settings.shared);if(i==="axis"){var a=bE(o,n);(a==null?void 0:a.activeIndex)!=null?t.dispatch(WL({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate})):t.dispatch(UL())}P0=null})}});function Wxe(e,t){return t instanceof HTMLElement?"HTMLElement <".concat(t.tagName,' class="').concat(t.className,'">'):t===window?"global.window":e==="children"&&typeof t=="object"&&t!==null?"<>":t}var X_={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},KD=vn({name:"rootProps",initialState:X_,reducers:{updateOptions:(e,t)=>{var r;e.accessibilityLayer=t.payload.accessibilityLayer,e.barCategoryGap=t.payload.barCategoryGap,e.barGap=(r=t.payload.barGap)!==null&&r!==void 0?r:X_.barGap,e.barSize=t.payload.barSize,e.maxBarSize=t.payload.maxBarSize,e.stackOffset=t.payload.stackOffset,e.syncId=t.payload.syncId,e.syncMethod=t.payload.syncMethod,e.className=t.payload.className,e.baseValue=t.payload.baseValue,e.reverseStackOrder=t.payload.reverseStackOrder}}}),Hxe=KD.reducer,{updateOptions:Vxe}=KD.actions,Gxe=null,qxe={updatePolarOptions:(e,t)=>t.payload},ZD=vn({name:"polarOptions",initialState:Gxe,reducers:qxe}),{updatePolarOptions:s5e}=ZD.actions,Kxe=ZD.reducer,YD=uo("keyDown"),XD=uo("focus"),xE=fh();xE.startListening({actionCreator:YD,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:o}=r.tooltip,i=e.payload;if(!(i!=="ArrowRight"&&i!=="ArrowLeft"&&i!=="Enter")){var a=lE(o,cd(r),Ch(r),Ph(r)),s=a==null?-1:Number(a);if(!(!Number.isFinite(s)||s<0)){var l=ka(r);if(i==="Enter"){var u=Bg(r,"axis","hover",String(o.index));t.dispatch(tS({active:!o.active,activeIndex:o.index,activeCoordinate:u}));return}var c=lye(r),d=c==="left-to-right"?1:-1,f=i==="ArrowRight"?1:-1,p=s+f*d;if(!(l==null||p>=l.length||p<0)){var h=Bg(r,"axis","hover",String(p));t.dispatch(tS({active:!0,activeIndex:p.toString(),activeCoordinate:h}))}}}}}});xE.startListening({actionCreator:XD,effect:(e,t)=>{var r=t.getState(),n=r.rootProps.accessibilityLayer!==!1;if(n){var{keyboardInteraction:o}=r.tooltip;if(!o.active&&o.index==null){var i="0",a=Bg(r,"axis","hover",String(i));t.dispatch(tS({active:!0,activeIndex:i,activeCoordinate:a}))}}}});var Vn=uo("externalEvent"),QD=fh(),J1=new Map;QD.startListening({actionCreator:Vn,effect:(e,t)=>{var{handler:r,reactEvent:n}=e.payload;if(r!=null){n.persist();var o=n.type,i=J1.get(o);i!==void 0&&cancelAnimationFrame(i);var a=requestAnimationFrame(()=>{try{var s=t.getState(),l={activeCoordinate:nve(s),activeDataKey:tve(s),activeIndex:_p(s),activeLabel:tD(s),activeTooltipIndex:_p(s),isTooltipActive:ove(s)};r(l,n)}finally{J1.delete(o)}});J1.set(o,a)}}});var Zxe=X([sd],e=>e.tooltipItemPayloads),Yxe=X([Zxe,(e,t)=>t,(e,t,r)=>r],(e,t,r)=>{if(t!=null){var n=e.find(i=>i.settings.graphicalItemId===r);if(n!=null){var{getPosition:o}=n;if(o!=null)return o(t)}}}),JD=uo("touchMove"),ez=fh();ez.startListening({actionCreator:JD,effect:(e,t)=>{var r=e.payload;if(!(r.touches==null||r.touches.length===0)){var n=t.getState(),o=sE(n,n.tooltip.settings.shared);if(o==="axis"){var i=r.touches[0];if(i==null)return;var a=bE(n,wE({clientX:i.clientX,clientY:i.clientY,currentTarget:r.currentTarget}));(a==null?void 0:a.activeIndex)!=null&&t.dispatch(WL({activeIndex:a.activeIndex,activeDataKey:void 0,activeCoordinate:a.activeCoordinate}))}else if(o==="item"){var s,l=r.touches[0];if(document.elementFromPoint==null||l==null)return;var u=document.elementFromPoint(l.clientX,l.clientY);if(!u||!u.getAttribute)return;var c=u.getAttribute(sfe),d=(s=u.getAttribute(lfe))!==null&&s!==void 0?s:void 0,f=ld(n).find(m=>m.id===d);if(c==null||f==null||d==null)return;var{dataKey:p}=f,h=Yxe(n,c,d);t.dispatch(gye({activeDataKey:p,activeIndex:c,activeCoordinate:h,activeGraphicalItemId:d}))}}}});var Xxe=YN({brush:_we,cartesianAxis:xwe,chartData:nbe,errorBars:Bwe,graphicalItems:iwe,layout:Gde,legend:Jfe,options:Qve,polarAxis:O1e,polarOptions:Kxe,referenceElements:Rwe,rootProps:Hxe,tooltip:vye,zIndex:zve}),Qxe=function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return yde({reducer:Xxe,preloadedState:t,middleware:n=>{var o;return n({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((o="es6")!==null&&o!==void 0?o:"")}).concat([GD.middleware,qD.middleware,xE.middleware,QD.middleware,ez.middleware])},enhancers:n=>{var o=n;return typeof n=="function"&&(o=n()),o.concat(dB({type:"raf"}))},devTools:{serialize:{replacer:Wxe},name:"recharts-".concat(r)}})};function Jxe(e){var{preloadedState:t,children:r,reduxStoreName:n}=e,o=Wo(),i=v.useRef(null);if(o)return r;i.current==null&&(i.current=Qxe(t,n));var a=nC;return v.createElement(vxe,{context:a,store:i.current},r)}function e2e(e){var{layout:t,margin:r}=e,n=Xr(),o=Wo();return v.useEffect(()=>{o||(n(Wde(t)),n(Ude(r)))},[n,o,t,r]),null}var t2e=v.memo(e2e,FD);function r2e(e){var t=Xr();return v.useEffect(()=>{t(Vxe(e))},[t,e]),null}function Q_(e){var{zIndex:t,isPanorama:r}=e,n=v.useRef(null),o=Xr();return v.useLayoutEffect(()=>(n.current&&o(Lve({zIndex:t,element:n.current,isPanorama:r})),()=>{o(Dve({zIndex:t,isPanorama:r}))}),[o,t,r]),v.createElement("g",{tabIndex:-1,ref:n})}function J_(e){var{children:t,isPanorama:r}=e,n=Ge(Tve);if(!n||n.length===0)return t;var o=n.filter(a=>a<0),i=n.filter(a=>a>0);return v.createElement(v.Fragment,null,o.map(a=>v.createElement(Q_,{key:a,zIndex:a,isPanorama:r})),t,i.map(a=>v.createElement(Q_,{key:a,zIndex:a,isPanorama:r})))}var n2e=["children"];function o2e(e,t){if(e==null)return{};var r,n,o=i2e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var r=Mfe(),n=Nfe(),o=FB();if(!xs(r)||!xs(n))return null;var{children:i,otherAttributes:a,title:s,desc:l}=e,u,c;return a!=null&&(typeof a.tabIndex=="number"?u=a.tabIndex:u=o?0:void 0,typeof a.role=="string"?c=a.role:c=o?"application":void 0),v.createElement(ZM,Wg({},a,{title:s,desc:l,role:c,tabIndex:u,width:r,height:n,style:a2e,ref:t}),i)}),l2e=e=>{var{children:t}=e,r=Ge(qv);if(!r)return null;var{width:n,height:o,y:i,x:a}=r;return v.createElement(ZM,{width:n,height:o,x:a,y:i},t)},e$=v.forwardRef((e,t)=>{var{children:r}=e,n=o2e(e,n2e),o=Wo();return o?v.createElement(l2e,null,v.createElement(J_,{isPanorama:!0},r)):v.createElement(s2e,Wg({ref:t},n),v.createElement(J_,{isPanorama:!1},r))});function c2e(){var e=Xr(),[t,r]=v.useState(null),n=Ge(afe);return v.useEffect(()=>{if(t!=null){var o=t.getBoundingClientRect(),i=o.width/t.offsetWidth;gt(i)&&i!==n&&e(Vde(i))}},[t,e,n]),r}function t$(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),r.push.apply(r,n)}return r}function u2e(e){for(var t=1;t(fbe(),null);function Hg(e){if(typeof e=="number")return e;if(typeof e=="string"){var t=parseFloat(e);if(!Number.isNaN(t))return t}return 0}var m2e=v.forwardRef((e,t)=>{var r,n,o=v.useRef(null),[i,a]=v.useState({containerWidth:Hg((r=e.style)===null||r===void 0?void 0:r.width),containerHeight:Hg((n=e.style)===null||n===void 0?void 0:n.height)}),s=v.useCallback((u,c)=>{a(d=>{var f=Math.round(u),p=Math.round(c);return d.containerWidth===f&&d.containerHeight===p?d:{containerWidth:f,containerHeight:p}})},[]),l=v.useCallback(u=>{if(typeof t=="function"&&t(u),u!=null&&typeof ResizeObserver<"u"){var{width:c,height:d}=u.getBoundingClientRect();s(c,d);var f=h=>{var m=h[0];if(m!=null){var{width:g,height:y}=m.contentRect;s(g,y)}},p=new ResizeObserver(f);p.observe(u),o.current=p}},[t,s]);return v.useEffect(()=>()=>{var u=o.current;u!=null&&u.disconnect()},[s]),v.createElement(v.Fragment,null,v.createElement(mh,{width:i.containerWidth,height:i.containerHeight}),v.createElement("div",cs({ref:l},e)))}),g2e=v.forwardRef((e,t)=>{var{width:r,height:n}=e,[o,i]=v.useState({containerWidth:Hg(r),containerHeight:Hg(n)}),a=v.useCallback((l,u)=>{i(c=>{var d=Math.round(l),f=Math.round(u);return c.containerWidth===d&&c.containerHeight===f?c:{containerWidth:d,containerHeight:f}})},[]),s=v.useCallback(l=>{if(typeof t=="function"&&t(l),l!=null){var{width:u,height:c}=l.getBoundingClientRect();a(u,c)}},[t,a]);return v.createElement(v.Fragment,null,v.createElement(mh,{width:o.containerWidth,height:o.containerHeight}),v.createElement("div",cs({ref:s},e)))}),y2e=v.forwardRef((e,t)=>{var{width:r,height:n}=e;return v.createElement(v.Fragment,null,v.createElement(mh,{width:r,height:n}),v.createElement("div",cs({ref:t},e)))}),v2e=v.forwardRef((e,t)=>{var{width:r,height:n}=e;return typeof r=="string"||typeof n=="string"?v.createElement(g2e,cs({},e,{ref:t})):typeof r=="number"&&typeof n=="number"?v.createElement(y2e,cs({},e,{width:r,height:n,ref:t})):v.createElement(v.Fragment,null,v.createElement(mh,{width:r,height:n}),v.createElement("div",cs({ref:t},e)))});function b2e(e){return e?m2e:v2e}var w2e=v.forwardRef((e,t)=>{var{children:r,className:n,height:o,onClick:i,onContextMenu:a,onDoubleClick:s,onMouseDown:l,onMouseEnter:u,onMouseLeave:c,onMouseMove:d,onMouseUp:f,onTouchEnd:p,onTouchMove:h,onTouchStart:m,style:g,width:y,responsive:w,dispatchTouchEvents:S=!0}=e,x=v.useRef(null),P=Xr(),[A,T]=v.useState(null),[I,O]=v.useState(null),_=c2e(),R=fC(),E=(R==null?void 0:R.width)>0?R.width:y,M=(R==null?void 0:R.height)>0?R.height:o,B=v.useCallback(G=>{_(G),typeof t=="function"&&t(G),T(G),O(G),G!=null&&(x.current=G)},[_,t,T,O]),j=v.useCallback(G=>{P(VD(G)),P(Vn({handler:i,reactEvent:G}))},[P,i]),N=v.useCallback(G=>{P(aS(G)),P(Vn({handler:u,reactEvent:G}))},[P,u]),F=v.useCallback(G=>{P(UL()),P(Vn({handler:c,reactEvent:G}))},[P,c]),D=v.useCallback(G=>{P(aS(G)),P(Vn({handler:d,reactEvent:G}))},[P,d]),z=v.useCallback(()=>{P(XD())},[P]),W=v.useCallback(G=>{P(YD(G.key))},[P]),H=v.useCallback(G=>{P(Vn({handler:a,reactEvent:G}))},[P,a]),V=v.useCallback(G=>{P(Vn({handler:s,reactEvent:G}))},[P,s]),Q=v.useCallback(G=>{P(Vn({handler:l,reactEvent:G}))},[P,l]),re=v.useCallback(G=>{P(Vn({handler:f,reactEvent:G}))},[P,f]),Y=v.useCallback(G=>{P(Vn({handler:m,reactEvent:G}))},[P,m]),Z=v.useCallback(G=>{S&&P(JD(G)),P(Vn({handler:h,reactEvent:G}))},[P,S,h]),ie=v.useCallback(G=>{P(Vn({handler:p,reactEvent:G}))},[P,p]),me=b2e(w);return v.createElement(lD.Provider,{value:A},v.createElement(fce.Provider,{value:I},v.createElement(me,{width:E??(g==null?void 0:g.width),height:M??(g==null?void 0:g.height),className:se("recharts-wrapper",n),style:u2e({position:"relative",cursor:"default",width:E,height:M},g),onClick:j,onContextMenu:H,onDoubleClick:V,onFocus:z,onKeyDown:W,onMouseDown:Q,onMouseEnter:N,onMouseLeave:F,onMouseMove:D,onMouseUp:re,onTouchEnd:ie,onTouchMove:Z,onTouchStart:Y,ref:B},v.createElement(h2e,null),r)))}),x2e=["width","height","responsive","children","className","style","compact","title","desc"];function S2e(e,t){if(e==null)return{};var r,n,o=C2e(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(n=0;n{var{width:r,height:n,responsive:o,children:i,className:a,style:s,compact:l,title:u,desc:c}=e,d=S2e(e,x2e),f=Ou(d);return l?v.createElement(v.Fragment,null,v.createElement(mh,{width:r,height:n}),v.createElement(e$,{otherAttributes:f,title:u,desc:c},i)):v.createElement(w2e,{className:a,style:s,width:r,height:n,responsive:o??!1,onClick:e.onClick,onMouseLeave:e.onMouseLeave,onMouseEnter:e.onMouseEnter,onMouseMove:e.onMouseMove,onMouseDown:e.onMouseDown,onMouseUp:e.onMouseUp,onContextMenu:e.onContextMenu,onDoubleClick:e.onDoubleClick,onTouchStart:e.onTouchStart,onTouchMove:e.onTouchMove,onTouchEnd:e.onTouchEnd},v.createElement(e$,{otherAttributes:f,title:u,desc:c,ref:t},v.createElement(Mwe,null,i)))});function sS(){return sS=Object.assign?Object.assign.bind():function(e){for(var t=1;tv.createElement(k2e,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:T2e,tooltipPayloadSearcher:Yve,categoricalChartProps:e,ref:t}));function O2e(e){switch(e){case 8453:return"https://base.easscan.org/graphql";case 84532:return"https://base-sepolia.easscan.org/graphql";default:return"https://base-sepolia.easscan.org/graphql"}}const _2e="0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af",$2e="0x7425c71616d2959f30296d8e013a8fd23320145b1dfda0718ab0a692087f8782";async function R2e(e){var m,g,y,w;const t=O2e(e),r=` + query GetIdentities($schemaId: String!) { + attestations( + where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } + orderBy: { time: asc } + ) { + id + time + decodedDataJson + } + } + `,n=` + query GetContributions($schemaId: String!) { + attestations( + where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } + orderBy: { time: asc } + ) { + id + time + decodedDataJson + } + } + `,[o,i]=await Promise.all([fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:{schemaId:_2e}})}),fetch(t,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,variables:{schemaId:$2e}})})]);if(!o.ok||!i.ok)throw new Error("EAS API error");const[a,s]=await Promise.all([o.json(),i.json()]),l=((m=a==null?void 0:a.data)==null?void 0:m.attestations)??[],u=((g=s==null?void 0:s.data)==null?void 0:g.attestations)??[],c=new Map;for(const S of l){let x="unknown";try{const T=JSON.parse(S.decodedDataJson).find(I=>I.name==="username");(y=T==null?void 0:T.value)!=null&&y.value&&(x=T.value.value)}catch{}const P=c.get(x);(!P||S.time>P.time)&&c.set(x,{time:S.time})}const d=new Set,f=[];for(const S of u){f.push(S.time);try{const P=JSON.parse(S.decodedDataJson).find(A=>A.name==="repo");(w=P==null?void 0:P.value)!=null&&w.value&&d.add(P.value.value)}catch{}}const p=r$(Array.from(c.values()).map(S=>S.time)),h=r$(f);return{totalIdentities:c.size,totalCommits:u.length,totalRepos:d.size,identityChart:p,commitsChart:h}}function r$(e){const t=[...e].sort((o,i)=>o-i),r=new Map;let n=0;for(const o of t){const i=new Date(o*1e3).toISOString().split("T")[0];n++,r.set(i,n)}return Array.from(r.entries()).map(([o,i])=>({date:new Date(o).toLocaleDateString("en-US",{month:"short",day:"numeric"}),count:i}))}const ew=({icon:e,value:t,label:r,loading:n,error:o,chartData:i,chartColor:a="#00d4aa"})=>b.jsxs(ge,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:140},children:[b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[e,b.jsxs(ge,{children:[n?b.jsx(sl,{variant:"text",width:50,height:36}):o?b.jsx(ae,{variant:"h5",sx:{color:"#ff6b6b"},children:"--"}):b.jsx(ae,{variant:"h5",sx:{color:"white",fontWeight:"bold"},children:t}),b.jsx(ae,{variant:"caption",sx:{color:"rgba(255,255,255,0.7)"},children:r})]})]}),i&&i.length>1&&b.jsx(ge,{sx:{height:50,width:"100%"},children:b.jsx($fe,{width:"100%",height:"100%",children:b.jsxs(I2e,{data:i,children:[b.jsx(HD,{type:"monotone",dataKey:"count",stroke:a,strokeWidth:2,dot:!1}),b.jsx(wbe,{contentStyle:{background:"#1a1a2e",border:"1px solid rgba(255,255,255,0.2)",borderRadius:4,fontSize:12},labelStyle:{color:"rgba(255,255,255,0.7)"},itemStyle:{color:a}})]})})})]}),j2e=()=>{const[e,t]=v.useState({totalIdentities:0,totalCommits:0,totalRepos:0,identityChart:[],commitsChart:[],loading:!0,error:null}),r=Wr();v.useEffect(()=>{R2e(r.CHAIN_ID).then(o=>{t({...o,loading:!1,error:null})}).catch(o=>{console.error("Failed to fetch stats:",o),t(i=>({...i,loading:!1,error:o.message}))})},[r.CHAIN_ID]);const n=r.CHAIN_ID===84532;return b.jsxs(sr,{elevation:3,sx:{p:3,mb:4,background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)",border:"1px solid rgba(255,255,255,0.1)"},children:[b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[b.jsx(Kae,{sx:{color:"#00d4aa"}}),b.jsx(ae,{variant:"h6",sx:{color:"white"},children:"Registry Stats"}),n&&b.jsx(fn,{label:"Testnet",size:"small",sx:{bgcolor:"rgba(255,193,7,0.2)",color:"#ffc107",fontSize:"0.7rem"}})]}),b.jsxs(di,{container:!0,spacing:3,children:[b.jsx(di,{item:!0,xs:12,sm:4,children:b.jsx(ew,{icon:b.jsx(Zae,{sx:{color:"#00d4aa",fontSize:32}}),value:e.totalIdentities,label:"Verified Identities",loading:e.loading,error:!!e.error,chartData:e.identityChart,chartColor:"#00d4aa"})}),b.jsx(di,{item:!0,xs:12,sm:4,children:b.jsx(ew,{icon:b.jsx(Vm,{sx:{color:"#6c5ce7",fontSize:32}}),value:e.totalCommits,label:"Commits Attested",loading:e.loading,error:!!e.error,chartData:e.commitsChart,chartColor:"#6c5ce7"})}),b.jsx(di,{item:!0,xs:12,sm:4,children:b.jsx(ew,{icon:b.jsx(a2,{sx:{color:"#fdcb6e",fontSize:32}}),value:e.totalRepos,label:"Unique Repos",loading:e.loading,error:!!e.error})})]}),b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:2,mt:3,pt:2,borderTop:"1px solid rgba(255,255,255,0.1)"},children:[b.jsx(Sv,{sx:{color:"rgba(255,255,255,0.5)"}}),b.jsxs(ge,{children:[b.jsx(ae,{variant:"body2",component:"a",href:"https://github.com/cyberstorm-dev/didgit/tree/main/skills/didgit-onboarding",target:"_blank",rel:"noopener noreferrer",sx:{color:"#00d4aa",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:"Agent Onboarding →"}),b.jsx(ae,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",display:"block"},children:"Register via CLI in 5 minutes"})]})]}),e.error&&b.jsxs(ae,{variant:"caption",sx:{color:"#ff6b6b",mt:2,display:"block"},children:["Could not load stats: ",e.error]})]})},M2e=()=>b.jsxs(sr,{elevation:3,sx:{p:4,mb:4,background:"linear-gradient(135deg, #0d1117 0%, #161b22 100%)",border:"2px solid #00d4aa",borderRadius:2},children:[b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:2,mb:3},children:[b.jsx(sT,{sx:{color:"#00d4aa",fontSize:32}}),b.jsxs(ge,{children:[b.jsx(ae,{variant:"h5",sx:{color:"white",fontWeight:"bold"},children:"Agent Onboarding"}),b.jsx(ae,{variant:"body2",sx:{color:"rgba(255,255,255,0.7)"},children:"Register via CLI in 5 minutes — no dapp needed"})]}),b.jsx(fn,{label:"Recommended",size:"small",sx:{ml:"auto",bgcolor:"#00d4aa",color:"#000",fontWeight:"bold"}})]}),b.jsxs(ge,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},gap:3,mb:3},children:[b.jsxs(ge,{children:[b.jsx(ae,{variant:"subtitle2",sx:{color:"#00d4aa",mb:1.5,fontWeight:"bold"},children:"Why CLI?"}),b.jsxs(ge,{sx:{display:"flex",flexDirection:"column",gap:1},children:[b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1},children:[b.jsx(qae,{sx:{color:"#00d4aa",fontSize:18}}),b.jsx(ae,{variant:"body2",sx:{color:"rgba(255,255,255,0.9)"},children:"Faster than the web UI"})]}),b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1},children:[b.jsx(Vm,{sx:{color:"#00d4aa",fontSize:18}}),b.jsx(ae,{variant:"body2",sx:{color:"rgba(255,255,255,0.9)"},children:"Scriptable & automatable"})]}),b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1},children:[b.jsx(Sv,{sx:{color:"#00d4aa",fontSize:18}}),b.jsx(ae,{variant:"body2",sx:{color:"rgba(255,255,255,0.9)"},children:"Works with any wallet & GitHub token"})]})]})]}),b.jsxs(ge,{children:[b.jsx(ae,{variant:"subtitle2",sx:{color:"#00d4aa",mb:1.5,fontWeight:"bold"},children:"Quick Start"}),b.jsx(ge,{component:"pre",sx:{bgcolor:"#0d1117",border:"1px solid #30363d",borderRadius:1,p:1.5,fontSize:"0.75rem",color:"#e6edf3",overflow:"auto",fontFamily:"monospace"},children:`# 1. Sign message with your wallet +cast wallet sign "github.com:username" + +# 2. Create proof gist +curl -X POST api.github.com/gists ... + +# 3. Submit attestation +# See full guide →`})]})]}),b.jsxs(ge,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[b.jsx(Qn,{variant:"contained",href:"https://github.com/cyberstorm-dev/didgit/tree/main/skills/didgit-onboarding",target:"_blank",rel:"noopener noreferrer",sx:{bgcolor:"#00d4aa",color:"#000",fontWeight:"bold","&:hover":{bgcolor:"#00b894"}},startIcon:b.jsx(sT,{}),children:"View Full Skill Guide"}),b.jsx(Qn,{variant:"outlined",href:"https://github.com/cyberstorm-dev/didgit/blob/main/docs/AGENT_ONBOARDING.md",target:"_blank",rel:"noopener noreferrer",sx:{borderColor:"rgba(255,255,255,0.3)",color:"rgba(255,255,255,0.9)","&:hover":{borderColor:"#00d4aa",color:"#00d4aa"}},children:"Human Guide"})]})]});function N2e(e){switch(e){case 8453:return"https://base.easscan.org/graphql";case 84532:return"https://base-sepolia.easscan.org/graphql";default:return"https://base-sepolia.easscan.org/graphql"}}function B2e(e){switch(e){case 8453:return"https://base.easscan.org";case 84532:return"https://base-sepolia.easscan.org";default:return"https://base-sepolia.easscan.org"}}const L2e="0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af";async function D2e(e,t,r){var f,p,h,m;const n=N2e(e),i=await fetch(n,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:` + query GetIdentities($schemaId: String!, $skip: Int!, $take: Int!) { + attestations( + where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } + orderBy: { time: desc } + skip: $skip + take: $take + ) { + id + recipient + attester + time + txid + decodedDataJson + } + aggregateAttestation(where: { schemaId: { equals: $schemaId }, revoked: { equals: false } }) { + _count { + _all + } + } + } + `,variables:{schemaId:L2e,skip:t,take:r}})});if(!i.ok)throw new Error(`EAS API error: ${i.status}`);const a=await i.json(),s=((f=a==null?void 0:a.data)==null?void 0:f.attestations)??[],l=((m=(h=(p=a==null?void 0:a.data)==null?void 0:p.aggregateAttestation)==null?void 0:h._count)==null?void 0:m._all)??0,u=s.map(g=>{var w;let y="unknown";try{const x=JSON.parse(g.decodedDataJson).find(P=>P.name==="username");(w=x==null?void 0:x.value)!=null&&w.value&&(y=x.value.value)}catch{}return{id:g.id,username:y,wallet:g.recipient,attestedAt:new Date(g.time*1e3).toISOString(),txHash:g.txid}}),c=new Map;for(const g of u){const y=c.get(g.username);(!y||new Date(g.attestedAt)>new Date(y.attestedAt))&&c.set(g.username,g)}return{identities:Array.from(c.values()),total:l}}function z2e(e){return!e||e.length<10?e:`${e.slice(0,6)}...${e.slice(-4)}`}function F2e(e){return new Date(e).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}const U2e=()=>{const[e,t]=v.useState({identities:[],total:0,loading:!0,error:null}),[r,n]=v.useState(0),[o,i]=v.useState(10),[a,s]=v.useState(null),l=Wr(),u=B2e(l.CHAIN_ID);v.useEffect(()=>{t(p=>({...p,loading:!0,error:null})),D2e(l.CHAIN_ID,r*o,o).then(({identities:p,total:h})=>{t({identities:p,total:h,loading:!1,error:null})}).catch(p=>{console.error("Failed to fetch identities:",p),t(h=>({...h,loading:!1,error:p.message}))})},[l.CHAIN_ID,r,o]);const c=(p,h)=>{n(h)},d=p=>{i(parseInt(p.target.value,10)),n(0)},f=(p,h)=>{navigator.clipboard.writeText(p),s(h),setTimeout(()=>s(null),2e3)};return b.jsxs(sr,{elevation:2,sx:{p:3,mb:4},children:[b.jsxs(ge,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[b.jsx(ae,{variant:"h6",children:"šŸ“‹ Identity Registry"}),b.jsx(fn,{label:`${e.identities.length} verified`,size:"small",color:"success",variant:"outlined"})]}),e.error&&b.jsxs(ae,{color:"error",sx:{mb:2},children:["Failed to load registry: ",e.error]}),b.jsx(wM,{children:b.jsxs(vM,{size:"small",children:[b.jsx(xM,{children:b.jsxs(Rc,{children:[b.jsx(Wt,{children:"GitHub"}),b.jsx(Wt,{children:"Wallet"}),b.jsx(Wt,{children:"Attested"}),b.jsx(Wt,{align:"right",children:"Links"})]})}),b.jsx(bM,{children:e.loading?[...Array(5)].map((p,h)=>b.jsxs(Rc,{children:[b.jsx(Wt,{children:b.jsx(sl,{width:100})}),b.jsx(Wt,{children:b.jsx(sl,{width:120})}),b.jsx(Wt,{children:b.jsx(sl,{width:80})}),b.jsx(Wt,{children:b.jsx(sl,{width:60})})]},h)):e.identities.length===0?b.jsx(Rc,{children:b.jsx(Wt,{colSpan:4,align:"center",children:b.jsx(ae,{variant:"body2",color:"text.secondary",children:"No identities found"})})}):e.identities.map(p=>b.jsxs(Rc,{hover:!0,children:[b.jsx(Wt,{children:b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1},children:[b.jsx(Sv,{sx:{fontSize:16,color:"text.secondary"}}),b.jsx(cM,{href:`https://github.com/${p.username}`,target:"_blank",rel:"noopener noreferrer",sx:{textDecoration:"none"},children:p.username})]})}),b.jsx(Wt,{children:b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:.5},children:[b.jsx(ae,{variant:"body2",sx:{fontFamily:"monospace"},children:z2e(p.wallet)}),b.jsx(mp,{title:a===p.id?"Copied!":"Copy address",children:b.jsx(ui,{size:"small",onClick:()=>f(p.wallet,p.id),children:b.jsx(Gm,{sx:{fontSize:14}})})})]})}),b.jsx(Wt,{children:b.jsx(ae,{variant:"body2",color:"text.secondary",children:F2e(p.attestedAt)})}),b.jsx(Wt,{align:"right",children:b.jsx(mp,{title:"View on EAS",children:b.jsx(ui,{size:"small",href:`${u}/attestation/view/${p.id}`,target:"_blank",rel:"noopener noreferrer",children:b.jsx(Gae,{sx:{fontSize:16}})})})})]},p.id))})]})}),b.jsx(bae,{component:"div",count:e.total,page:r,onPageChange:c,rowsPerPage:o,onRowsPerPageChange:d,rowsPerPageOptions:[5,10,25]})]})},n$="0x0CA6A71045C26087F8dCe6d3F93437f31B81C138";function W2e(){const{smartAddress:e,connected:t,balanceWei:r}=Zl(),[n,o]=v.useState(0),[i,a]=v.useState(!1),[s,l]=v.useState(!1),[u,c]=v.useState(null),[d,f]=v.useState(null),[p,h]=v.useState(null),m=Wr(),g=r?r>0n:!1,y=t&&e&&g;v.useEffect(()=>{o(s?3:g?2:t&&e?1:0)},[t,e,g,s]);const S=[{label:"Connect Wallet",description:"Connect your smart wallet to continue",completed:t&&!!e,action:null},{label:"Fund Wallet",description:"Your wallet needs ETH to pay gas (~$0.01 per attestation)",completed:g,action:null},{label:"Enable Permission",description:"Grant the verifier permission to create attestations on your behalf",completed:s,action:async()=>{if(!e){c("Smart wallet not initialized");return}a(!0),c(null);try{console.log("[permission] User consented to permission for verifier:",n$),console.log("[permission] User kernel address:",e),h("0x0f78222c"),l(!0),o(3)}catch(x){console.error("[permission] Error:",x),c(x.message||"Failed to enable permission")}finally{a(!1)}}},{label:"Ready",description:"Your wallet is configured for automated commit attestations",completed:s,action:null}];return b.jsxs(sr,{elevation:2,sx:{p:3,mb:3},children:[b.jsxs(ge,{display:"flex",alignItems:"center",gap:2,mb:3,children:[b.jsx(aT,{color:"primary"}),b.jsx(ae,{variant:"h6",children:"Enable Automated Attestations"})]}),b.jsxs(gr,{severity:"info",sx:{mb:3},children:[b.jsx(ae,{variant:"body2",gutterBottom:!0,children:b.jsx("strong",{children:"How it works:"})}),b.jsx(ae,{variant:"body2",component:"div",children:b.jsxs("ul",{style:{margin:0,paddingLeft:"1.5em"},children:[b.jsxs("li",{children:["You grant a ",b.jsx("strong",{children:"scoped permission"})," to our verifier service"]}),b.jsxs("li",{children:["The permission only allows calling ",b.jsx("code",{children:"EAS.attest()"})]}),b.jsx("li",{children:"Your smart wallet pays gas, but you don't sign each attestation"}),b.jsxs("li",{children:[b.jsx("strong",{children:"Your wallet is the attester"})," — not a third party"]})]})})]}),b.jsx(Aie,{activeStep:n,orientation:"vertical",children:S.map((x,P)=>b.jsxs(Joe,{completed:x.completed,children:[b.jsx(gM,{optional:x.completed?b.jsx(fn,{icon:b.jsx(o2,{}),label:"Complete",color:"success",size:"small"}):null,children:x.label}),b.jsxs(xie,{children:[b.jsx(ae,{variant:"body2",color:"text.secondary",sx:{mb:2},children:x.description}),x.action&&!x.completed&&b.jsx(Qn,{variant:"contained",onClick:x.action,disabled:i||!y,startIcon:i?b.jsx(ys,{size:20}):b.jsx(aT,{}),children:i?"Enabling...":"Enable Permission"}),P===0&&!t&&b.jsx(gr,{severity:"info",sx:{mt:2},children:'Use the "Connect Wallet" button in the top-right corner'}),P===1&&!g&&e&&b.jsxs(gr,{severity:"warning",sx:{mt:2},children:[b.jsx(ae,{variant:"body2",gutterBottom:!0,children:"Send ETH to your smart wallet:"}),b.jsx(ae,{variant:"body2",fontFamily:"monospace",sx:{wordBreak:"break-all"},children:e}),m.CHAIN_ID===84532&&b.jsx(Qn,{size:"small",sx:{mt:1},href:`https://www.coinbase.com/faucets/base-sepolia-faucet?address=${e}`,target:"_blank",rel:"noopener noreferrer",children:"Get Test ETH"})]})]})]},x.label))}),u&&b.jsx(gr,{severity:"error",sx:{mt:2},children:b.jsx(ae,{variant:"body2",children:u})}),d&&b.jsx(gr,{severity:"success",sx:{mt:2},children:b.jsxs(ae,{variant:"body2",children:["Transaction submitted!"," ",b.jsx(cM,{href:`https://${m.CHAIN_ID===8453?"":"sepolia."}basescan.org/tx/${d}`,target:"_blank",rel:"noopener noreferrer",children:"View on Basescan"})]})}),s&&b.jsxs(gr,{severity:"success",sx:{mt:2},children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"āœ… Automated Attestations Enabled!"}),b.jsx(ae,{variant:"body2",children:"The didgit verifier will automatically attest your commits. Gas will be deducted from your smart wallet balance."})]}),b.jsxs(ge,{sx:{mt:3,p:2,bgcolor:"background.default",borderRadius:1},children:[b.jsx(ae,{variant:"caption",color:"text.secondary",display:"block",gutterBottom:!0,children:b.jsx("strong",{children:"Technical Details:"})}),b.jsxs(ae,{variant:"caption",color:"text.secondary",display:"block",children:["Verifier: ",b.jsx("code",{children:n$})]}),b.jsxs(ae,{variant:"caption",color:"text.secondary",display:"block",children:["Permission Scope: ",b.jsx("code",{children:"EAS.attest()"})," only"]}),p&&b.jsxs(ae,{variant:"caption",color:"text.secondary",display:"block",children:["Permission ID: ",b.jsx("code",{children:p})]}),b.jsx(ae,{variant:"caption",color:"text.secondary",display:"block",children:"Protocol: ZeroDev Kernel v3.1 + Permission Plugin"})]})]})}function H2e(e){switch(e){case 8453:return"https://base.easscan.org/graphql";case 84532:return"https://base-sepolia.easscan.org/graphql";default:return"https://base-sepolia.easscan.org/graphql"}}const V2e="0x7425c71616d2959f30296d8e013a8fd23320145b1dfda0718ab0a692087f8782",G2e="0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af";async function q2e(e,t){var g,y,w,S,x,P,A,T;const r=H2e(e),n=` + query GetContributions($schemaId: String!) { + attestations( + where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } + ) { + id + time + recipient + decodedDataJson + } + } + `,o=` + query GetIdentities($schemaId: String!) { + attestations( + where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } + ) { + recipient + decodedDataJson + } + } + `,[i,a]=await Promise.all([fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:n,variables:{schemaId:V2e}})}),fetch(r,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:o,variables:{schemaId:G2e}})})]);if(!i.ok||!a.ok)throw new Error("EAS API error");const[s,l]=await Promise.all([i.json(),a.json()]),u=((g=s==null?void 0:s.data)==null?void 0:g.attestations)??[],c=((y=l==null?void 0:l.data)==null?void 0:y.attestations)??[],d=new Map;for(const I of c)try{const _=(S=(w=JSON.parse(I.decodedDataJson).find(R=>R.name==="username"))==null?void 0:w.value)==null?void 0:S.value;_&&I.recipient&&d.set(I.recipient.toLowerCase(),_)}catch{}const f=new Map,p=new Map;for(const I of u)try{const O=JSON.parse(I.decodedDataJson),_=O.find(M=>M.name==="repo");if((x=_==null?void 0:_.value)!=null&&x.value){const M=_.value.value;f.set(M,(f.get(M)||0)+1)}const R=(P=I.recipient)==null?void 0:P.toLowerCase(),E=d.get(R)||((T=(A=O.find(M=>M.name==="author"))==null?void 0:A.value)==null?void 0:T.value)||"unknown";p.set(E,(p.get(E)||0)+1)}catch{}const h=Array.from(f.entries()).sort((I,O)=>O[1]-I[1]).slice(0,10).map(([I,O],_)=>({rank:_+1,name:I,count:O})),m=Array.from(p.entries()).sort((I,O)=>O[1]-I[1]).slice(0,10).map(([I,O],_)=>({rank:_+1,name:I,count:O}));return{topRepos:h,topAccounts:m}}const K2e=({rank:e})=>{const r={1:"#FFD700",2:"#C0C0C0",3:"#CD7F32"}[e]||"rgba(255,255,255,0.3)";return b.jsx(ge,{sx:{width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:e<=3?`${r}22`:"transparent",border:`2px solid ${r}`,fontWeight:"bold",fontSize:12,color:r},children:e})},o$=({data:e,loading:t,icon:r,nameLabel:n})=>t?b.jsx(ge,{sx:{p:2},children:[1,2,3,4,5].map(o=>b.jsx(sl,{variant:"rectangular",height:40,sx:{mb:1,borderRadius:1}},o))}):e.length===0?b.jsx(ge,{sx:{p:4,textAlign:"center"},children:b.jsx(ae,{variant:"body2",sx:{color:"rgba(255,255,255,0.5)"},children:"No data yet"})}):b.jsx(wM,{children:b.jsxs(vM,{size:"small",children:[b.jsx(xM,{children:b.jsxs(Rc,{children:[b.jsx(Wt,{sx:{color:"rgba(255,255,255,0.5)",borderColor:"rgba(255,255,255,0.1)",width:50},children:"Rank"}),b.jsx(Wt,{sx:{color:"rgba(255,255,255,0.5)",borderColor:"rgba(255,255,255,0.1)"},children:b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1},children:[r,n]})}),b.jsx(Wt,{align:"right",sx:{color:"rgba(255,255,255,0.5)",borderColor:"rgba(255,255,255,0.1)",width:80},children:"Commits"})]})}),b.jsx(bM,{children:e.map(o=>b.jsxs(Rc,{sx:{"&:hover":{bgcolor:"rgba(255,255,255,0.05)"},"& td":{borderColor:"rgba(255,255,255,0.05)"}},children:[b.jsx(Wt,{children:b.jsx(K2e,{rank:o.rank})}),b.jsx(Wt,{children:b.jsx(ae,{variant:"body2",sx:{color:"white",fontFamily:"monospace",fontSize:"0.85rem"},children:o.name})}),b.jsx(Wt,{align:"right",children:b.jsx(fn,{label:o.count,size:"small",sx:{bgcolor:"rgba(0,212,170,0.2)",color:"#00d4aa",fontWeight:"bold"}})})]},o.name))})]})}),Z2e=()=>{const[e,t]=v.useState({topRepos:[],topAccounts:[],loading:!0,error:null}),[r,n]=v.useState("all"),[o,i]=v.useState(0),a=Wr();return v.useEffect(()=>{t(s=>({...s,loading:!0})),q2e(a.CHAIN_ID).then(s=>{t({...s,loading:!1,error:null})}).catch(s=>{console.error("Failed to fetch leaderboards:",s),t(l=>({...l,loading:!1,error:s.message}))})},[a.CHAIN_ID,r]),b.jsxs(sr,{elevation:2,sx:{mb:3,background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)",border:"1px solid rgba(255,255,255,0.1)",overflow:"hidden"},children:[b.jsx(ge,{sx:{p:2,borderBottom:"1px solid rgba(255,255,255,0.1)"},children:b.jsxs(ge,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:2},children:[b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1},children:[b.jsx(Wae,{sx:{color:"#FFD700"}}),b.jsx(ae,{variant:"h6",sx:{color:"white"},children:"Leaderboards"})]}),b.jsxs(ge,{sx:{display:"flex",gap:1},children:[b.jsx(fn,{label:"All Time",size:"small",onClick:()=>n("all"),sx:{bgcolor:r==="all"?"rgba(0,212,170,0.3)":"rgba(255,255,255,0.1)",color:r==="all"?"#00d4aa":"rgba(255,255,255,0.5)",cursor:"pointer","&:hover":{bgcolor:"rgba(0,212,170,0.2)"}}}),b.jsx(fn,{label:"This Week",size:"small",disabled:!0,sx:{bgcolor:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.3)",cursor:"not-allowed"}}),b.jsx(fn,{label:"This Month",size:"small",disabled:!0,sx:{bgcolor:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.3)",cursor:"not-allowed"}})]})]})}),b.jsxs(B6,{value:o,onChange:(s,l)=>i(l),sx:{borderBottom:"1px solid rgba(255,255,255,0.1)","& .MuiTab-root":{color:"rgba(255,255,255,0.5)","&.Mui-selected":{color:"#00d4aa"}},"& .MuiTabs-indicator":{bgcolor:"#00d4aa"}},children:[b.jsx(Eu,{icon:b.jsx(a2,{sx:{fontSize:18}}),iconPosition:"start",label:"Top Repos",sx:{minHeight:48}}),b.jsx(Eu,{icon:b.jsx(iT,{sx:{fontSize:18}}),iconPosition:"start",label:"Top Contributors",sx:{minHeight:48}})]}),b.jsxs(ge,{sx:{minHeight:300},children:[o===0&&b.jsx(o$,{data:e.topRepos,loading:e.loading,icon:b.jsx(a2,{sx:{fontSize:16,color:"rgba(255,255,255,0.5)"}}),nameLabel:"Repository"}),o===1&&b.jsx(o$,{data:e.topAccounts,loading:e.loading,icon:b.jsx(iT,{sx:{fontSize:16,color:"rgba(255,255,255,0.5)"}}),nameLabel:"Contributor"})]}),e.error&&b.jsx(ge,{sx:{p:2,borderTop:"1px solid rgba(255,255,255,0.1)"},children:b.jsxs(ae,{variant:"caption",sx:{color:"#ff6b6b"},children:["Error loading leaderboards: ",e.error]})})]})},Y2e=()=>{const{connected:e}=Zl();return b.jsxs(Wm,{maxWidth:"lg",sx:{py:4},children:[b.jsx(j2e,{}),b.jsx(Z2e,{}),b.jsx(M2e,{}),b.jsx(U2e,{}),b.jsx(W2e,{}),b.jsxs(Dx,{elevation:1,sx:{mb:2},children:[b.jsx(Ux,{expandIcon:b.jsx(i2,{}),children:b.jsx(ae,{variant:"subtitle1",sx:{fontWeight:"medium"},children:"šŸ” Verify an Identity"})}),b.jsx(zx,{children:b.jsx(ece,{})})]}),b.jsxs(Dx,{elevation:1,sx:{mb:2},children:[b.jsx(Ux,{expandIcon:b.jsx(i2,{}),children:b.jsxs(ge,{sx:{display:"flex",alignItems:"center",gap:1},children:[b.jsx(ae,{variant:"subtitle1",sx:{fontWeight:"medium"},children:"šŸ”§ Manual Registration (Web UI)"}),b.jsx(ae,{variant:"caption",sx:{color:"text.secondary"},children:"— Higher friction, use CLI if possible"})]})}),b.jsxs(zx,{children:[b.jsx(gr,{severity:"info",sx:{mb:3},children:b.jsxs(ae,{variant:"body2",children:["The web UI requires wallet connection and multiple signing steps. For a smoother experience, use the ",b.jsx("strong",{children:"CLI-based agent onboarding"})," above."]})}),b.jsxs(di,{container:!0,spacing:3,sx:{mb:3},children:[b.jsx(di,{item:!0,xs:12,md:6,children:b.jsx(sr,{elevation:2,sx:{p:3,height:"100%"},children:b.jsx(Yse,{},e?"connected":"disconnected")})}),b.jsx(di,{item:!0,xs:12,md:6,children:b.jsx(sr,{elevation:2,sx:{p:3,height:"100%"},children:b.jsx(Kle,{})})})]}),b.jsx(sr,{elevation:2,sx:{p:3,mb:3},children:b.jsx(Zle,{})}),b.jsxs(sr,{elevation:1,sx:{p:3},children:[b.jsx(ae,{variant:"h6",gutterBottom:!0,children:"How it Works (Web UI)"}),b.jsxs(ge,{component:"ol",sx:{pl:2,"& li":{mb:1}},children:[b.jsx(ae,{component:"li",variant:"body2",children:"Connect your wallet using Web3Auth (Google, GitHub, or email)"}),b.jsx(ae,{component:"li",variant:"body2",children:"Connect your GitHub account for identity verification"}),b.jsx(ae,{component:"li",variant:"body2",children:"Fund your smart wallet to cover gas fees (~$0.01)"}),b.jsx(ae,{component:"li",variant:"body2",children:"Sign your GitHub username with your wallet"}),b.jsx(ae,{component:"li",variant:"body2",children:"Create a proof Gist and submit the attestation"})]})]})]})]}),b.jsxs(sr,{elevation:1,sx:{p:3,mt:2},children:[b.jsx(ae,{variant:"h6",gutterBottom:!0,children:"What is didgit.dev?"}),b.jsxs(ae,{variant:"body2",sx:{mb:2},children:["didgit.dev creates ",b.jsx("strong",{children:"on-chain proof"})," linking your GitHub username to your wallet address. This verified identity can be used for:"]}),b.jsxs(ge,{component:"ul",sx:{pl:2,"& li":{mb:.5}},children:[b.jsx(ae,{component:"li",variant:"body2",children:"šŸ† Building portable developer reputation"}),b.jsx(ae,{component:"li",variant:"body2",children:"šŸ’° Receiving bounties and payments to a verified address"}),b.jsx(ae,{component:"li",variant:"body2",children:"šŸ” Accessing gated services that verify identity"}),b.jsx(ae,{component:"li",variant:"body2",children:"šŸ¤– Agent identity — prove your agent controls both accounts"})]}),b.jsxs(ae,{variant:"body2",sx:{mt:2,color:"text.secondary"},children:["Powered by ",b.jsx("a",{href:"https://attest.sh",target:"_blank",rel:"noopener noreferrer",children:"EAS"})," on Base. Built by ",b.jsx("a",{href:"https://cyberstorm.dev",target:"_blank",rel:"noopener noreferrer",children:"cyberstorm.dev"}),"."]})]})]})};function X2e(e){return e.length>0&&e.length<=100}function Q2e(e){return e.length>0&&e.length<=39}function J2e(e){return e.length>0&&e.length<=39}function eSe(e){return e.length>0&&e.length<=100}Rs({domain:xt().min(1).max(100),username:xt().min(1).max(39),namespace:xt().min(1).max(39),name:xt().min(1).max(100),enabled:Wse()});const tSe=({domain:e="github.com",username:t})=>{const{address:r,smartAddress:n,connected:o,getWalletClient:i}=Zl(),{user:a}=Ev(),s=v.useMemo(()=>Wr(),[]),[l,u]=v.useState({namespace:"*",name:"*",enabled:!0}),[c,d]=v.useState("set"),[f,p]=v.useState([]),[h,m]=v.useState({}),[g,y]=v.useState(!1),[w,S]=v.useState(!1),[x,P]=v.useState(null),[A,T]=v.useState(null),[I,O]=v.useState(null),[_,R]=v.useState(!1),E=s.RESOLVER_ADDRESS,M=!!E,B=t||(a==null?void 0:a.login)||"",j=e;v.useEffect(()=>{c==="list"&&!_&&o&&E&&j&&B&&(R(!0),D()),c==="set"&&R(!1)},[c,o,E,j,B]);const N=v.useMemo(()=>gl({chain:Zc,transport:Xa()}),[]),F=()=>{const V={};if(j){if(!X2e(j))return P("Invalid domain format"),!1}else return P("Domain is required"),!1;if(B){if(!Q2e(B))return P("Invalid username format"),!1}else return P("Username is required"),!1;return l.namespace?J2e(l.namespace)||(V.namespace="Invalid namespace format"):V.namespace="Namespace is required",l.name?eSe(l.name)||(V.name="Invalid repository name format"):V.name="Repository name is required",m(V),Object.keys(V).length===0},D=async()=>{if(!(!o||!r||!E||!j||!B))try{S(!0),P(null);const V=await N.readContract({address:E,abi:UsernameUniqueResolverABI,functionName:"getRepositoryPatterns",args:[j,B]});p(V)}catch(V){V.message.includes("NOT_OWNER")?P("You can only view patterns for identities you own"):P(V.message??"Failed to load patterns")}finally{S(!1)}},z=async()=>{if(P(null),O(null),T(null),!!F()){if(!o||!r)return P("Connect wallet first");if(!E)return P("Resolver address not configured");try{y(!0);const V=await i();if(!V)throw new Error("No wallet client available");const Q=await V.writeContract({address:E,abi:UsernameUniqueResolverABI,functionName:"setRepositoryPattern",args:[j,B,l.namespace,l.name,l.enabled],gas:BigInt(2e5)});T(Q),await N.waitForTransactionReceipt({hash:Q}),O(`Repository pattern ${l.enabled?"enabled":"disabled"} successfully!`),R(!1),await D()}catch(V){V.message.includes("NOT_OWNER")?P("You can only set patterns for identities you own"):V.message.includes("IDENTITY_NOT_FOUND")?P("Identity not found. Make sure you have an attestation for this domain/username combination"):P(V.message??"Failed to set repository pattern")}finally{y(!1)}}},W=()=>{u({namespace:"*",name:"*",enabled:!0}),m({}),P(null),O(null),T(null)},H=g||w;return b.jsx(Wm,{maxWidth:"lg",sx:{py:4},children:b.jsxs(sr,{elevation:2,sx:{overflow:"hidden"},children:[b.jsxs(ge,{sx:{p:3,pb:0},children:[b.jsxs(ge,{display:"flex",alignItems:"center",gap:2,mb:2,children:[b.jsx(AM,{color:"primary",fontSize:"large"}),b.jsx(ae,{variant:"h5",fontWeight:600,children:"Repository Pattern Management"})]}),b.jsxs(ae,{variant:"body2",color:"text.secondary",sx:{mb:3},children:["Configure repository patterns to control which repositories can be indexed for attestations. Use wildcards (*) to match multiple repositories.",b.jsx(mp,{title:"Learn about pattern syntax",arrow:!0,children:b.jsx(ui,{size:"small",sx:{ml:1},children:b.jsx(Vae,{fontSize:"small"})})})]})]}),b.jsx(ge,{sx:{borderBottom:1,borderColor:"divider"},children:b.jsxs(B6,{value:c,onChange:(V,Q)=>d(Q),"aria-label":"pattern management tabs",sx:{px:3},children:[b.jsx(Eu,{value:"set",label:"Set Pattern",icon:b.jsx(A1,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:500}}),b.jsx(Eu,{value:"list",label:b.jsx(vre,{badgeContent:f.length,color:"primary",showZero:!1,children:"View Patterns"}),icon:b.jsx(oT,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:500}})]})}),H&&b.jsx(Wne,{sx:{height:2}}),c==="set"&&b.jsxs(ge,{sx:{p:3},children:[b.jsxs(di,{container:!0,spacing:3,children:[b.jsx(di,{item:!0,xs:12,sm:6,children:b.jsx(nT,{fullWidth:!0,label:"Namespace (Owner)",placeholder:"octocat or *",value:l.namespace,onChange:V=>u({...l,namespace:V.target.value}),error:!!h.namespace,helperText:h.namespace||"Repository owner/organization or * for wildcard",disabled:H,variant:"outlined"})}),b.jsx(di,{item:!0,xs:12,sm:6,children:b.jsx(nT,{fullWidth:!0,label:"Repository Name",placeholder:"hello-world or *",value:l.name,onChange:V=>u({...l,name:V.target.value}),error:!!h.name,helperText:h.name||"Repository name or * for wildcard",disabled:H,variant:"outlined"})})]}),b.jsxs(ge,{sx:{mt:3,mb:3},children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"Pattern Preview:"}),b.jsxs(sr,{variant:"outlined",sx:{p:2,bgcolor:"grey.50",fontFamily:"monospace",fontSize:"1rem",display:"flex",alignItems:"center",gap:1},children:[b.jsx(Vm,{fontSize:"small",color:"action"}),b.jsxs(ge,{component:"span",sx:{color:l.enabled?"success.main":"text.disabled"},children:[l.namespace,"/",l.name]}),b.jsx(fn,{label:l.enabled?"Enabled":"Disabled",color:l.enabled?"success":"default",size:"small"})]})]}),b.jsx(gne,{control:b.jsx(Rie,{checked:l.enabled,onChange:V=>u({...l,enabled:V.target.checked}),disabled:H,color:"primary"}),label:b.jsx(ae,{variant:"body1",color:l.enabled?"text.primary":"text.secondary",children:l.enabled?"Enable this pattern":"Disable this pattern"}),sx:{mb:3}}),b.jsxs(ll,{direction:"row",spacing:2,sx:{mb:3},children:[b.jsx(Qn,{variant:"contained",startIcon:g?b.jsx(ys,{size:20}):b.jsx(A1,{}),onClick:z,disabled:H||!M||!o,size:"large",sx:{flex:1},children:g?l.enabled?"Enabling Pattern...":"Disabling Pattern...":l.enabled?"Enable Pattern":"Disable Pattern"}),b.jsx(Qn,{variant:"outlined",onClick:W,disabled:H,size:"large",children:"Reset"})]}),b.jsx(gr,{severity:"info",sx:{borderRadius:2},children:b.jsxs(ge,{children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"Pattern Examples:"}),b.jsxs(ge,{component:"ul",sx:{m:0,pl:2,"& li":{mb:.5}},children:[b.jsxs(ae,{component:"li",variant:"body2",children:[b.jsx(ge,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"octocat/hello-world"})," ","- Specific repository"]}),b.jsxs(ae,{component:"li",variant:"body2",children:[b.jsx(ge,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"octocat/*"})," ","- All repositories from octocat"]}),b.jsxs(ae,{component:"li",variant:"body2",children:[b.jsx(ge,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"*/hello-world"})," ","- hello-world repository from any owner"]}),b.jsxs(ae,{component:"li",variant:"body2",children:[b.jsx(ge,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"*/*"})," ","- All repositories (use with caution)"]})]})]})})]}),c==="list"&&b.jsxs(ge,{sx:{p:3},children:[b.jsxs(ll,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[b.jsxs(ae,{variant:"h6",children:["Current Patterns",f.length>0&&b.jsx(fn,{label:`${f.length} pattern${f.length!==1?"s":""}`,size:"small",sx:{ml:2}})]}),b.jsx(Qn,{variant:"outlined",startIcon:w?b.jsx(ys,{size:20}):b.jsx(PM,{}),onClick:D,disabled:w||!M||!o,size:"small",children:w?"Loading...":"Refresh"})]}),w&&f.length===0&&b.jsx(ll,{spacing:2,children:[...Array(3)].map((V,Q)=>b.jsx(sl,{variant:"rectangular",height:72,sx:{borderRadius:1}},Q))}),f.length>0&&b.jsx(ll,{spacing:2,children:f.map((V,Q)=>b.jsx(sr,{variant:"outlined",sx:{p:3,bgcolor:V.enabled?"success.light":"action.hover",borderColor:V.enabled?"success.main":"divider",borderWidth:V.enabled?2:1,transition:"all 0.2s ease-in-out","&:hover":{elevation:2,transform:"translateY(-1px)"}},children:b.jsxs(ge,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[b.jsxs(ge,{display:"flex",alignItems:"center",gap:2,children:[b.jsx(Vm,{color:V.enabled?"success":"action"}),b.jsxs(ae,{variant:"h6",sx:{fontFamily:"monospace",color:V.enabled?"success.dark":"text.secondary",fontWeight:500},children:[V.namespace,"/",V.name]})]}),b.jsx(fn,{label:V.enabled?"Enabled":"Disabled",color:V.enabled?"success":"default",variant:V.enabled?"filled":"outlined"})]})},Q))}),f.length===0&&!w&&j&&B&&b.jsxs(ge,{sx:{textAlign:"center",py:6},children:[b.jsx(oT,{sx:{fontSize:64,color:"text.disabled",mb:2}}),b.jsx(ae,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No patterns configured"}),b.jsx(ae,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"You haven't set up any repository patterns yet."}),b.jsx(Qn,{variant:"contained",startIcon:b.jsx(A1,{}),onClick:()=>d("set"),children:"Create Your First Pattern"})]})]}),b.jsxs(ge,{sx:{p:3,pt:0},children:[!M&&b.jsxs(gr,{severity:"warning",sx:{mb:2,borderRadius:2},children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"Configuration Required"}),b.jsx(ae,{variant:"body2",children:"Resolver contract address is not configured. Add VITE_RESOLVER_ADDRESS to environment variables."})]}),x&&b.jsxs(gr,{severity:"error",sx:{mb:2,borderRadius:2},children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:x.includes("IDENTITY_NOT_FOUND")?"Identity Not Found":x.includes("NOT_OWNER")?"Permission Denied":"Operation Failed"}),b.jsx(ae,{variant:"body2",children:x.includes("IDENTITY_NOT_FOUND")?"Make sure you have registered this GitHub identity first in the attestation section above.":x.includes("NOT_OWNER")?"You can only manage patterns for GitHub identities that you own.":x})]}),I&&b.jsxs(gr,{severity:"success",sx:{mb:2,borderRadius:2},children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"Success!"}),b.jsx(ae,{variant:"body2",children:I})]}),A&&b.jsx(gr,{severity:"info",sx:{mb:2,borderRadius:2},children:b.jsxs(ge,{children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"Transaction Submitted"}),b.jsx(ae,{variant:"body2",sx:{mb:1},children:"Your pattern update has been submitted to the blockchain."}),b.jsx(Qn,{variant:"text",size:"small",href:`https://sepolia.basescan.org/tx/${A}`,target:"_blank",rel:"noreferrer",sx:{p:0,textTransform:"none"},children:"View on BaseScan →"})]})})]})]})})},rSe=()=>{const{connected:e,address:t}=Zl(),{user:r}=Ev(),[n,o]=v.useState([]),[i,a]=v.useState(!1),s=v.useMemo(()=>Wr(),[]),l=async()=>{var c;if(!(!e||!t)){a(!0);try{const g=(((c=(await(await fetch("https://base-sepolia.easscan.org/graphql",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:`query ($schemaId: String!, $recipient: String!) { + attestations(take: 50, where: { + schemaId: { equals: $schemaId }, + recipient: { equals: $recipient } + }) { + id + recipient + decodedDataJson + } + }`,variables:{schemaId:s.EAS_SCHEMA_UID,recipient:t}})})).json()).data)==null?void 0:c.attestations)??[]).map(y=>{const w=u(y.decodedDataJson);return w!=null&&w.github_username?{domain:"github.com",username:w.github_username,attestationUid:y.id,verified:!0}:null}).filter(Boolean);o(g)}catch(d){console.error("Failed to load identities:",d)}finally{a(!1)}}};function u(c){var d;if(!c)return null;try{const f=JSON.parse(c),p=new Map;for(const m of f)p.set(m.name,(d=m.value)==null?void 0:d.value);const h={github_username:String(p.get("github_username")??""),wallet_address:String(p.get("wallet_address")??""),github_proof_url:String(p.get("github_proof_url")??""),wallet_signature:String(p.get("wallet_signature")??"")};return!h.github_username||!h.wallet_address?null:h}catch{return null}}return v.useEffect(()=>{l()},[e,t]),e?b.jsxs(Wm,{maxWidth:"lg",sx:{py:4},children:[b.jsxs(ge,{display:"flex",alignItems:"center",gap:2,mb:4,children:[b.jsx(AM,{color:"primary",fontSize:"large"}),b.jsx(ae,{variant:"h4",fontWeight:600,children:"GitHub Identity Settings"})]}),b.jsx(ae,{variant:"body1",color:"text.secondary",sx:{mb:4},children:"Manage repository patterns for your verified GitHub identities. Configure which repositories should be indexed for attestations."}),i&&b.jsxs(ge,{display:"flex",alignItems:"center",gap:2,sx:{mb:4},children:[b.jsx(ys,{size:20}),b.jsx(ae,{variant:"body2",color:"text.secondary",children:"Loading your GitHub identities..."})]}),!i&&e&&n.length===0&&b.jsxs(gr,{severity:"info",children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"No GitHub Identities Found"}),b.jsx(ae,{variant:"body2",children:"You haven't registered any GitHub identities yet. Go to the Register page to create your first attestation."})]}),!i&&n.length>0&&b.jsxs(ll,{spacing:3,children:[b.jsxs(ae,{variant:"h6",children:["Your Registered Identities (",n.length,")"]}),n.map((c,d)=>b.jsxs(Dx,{elevation:2,children:[b.jsxs(Ux,{expandIcon:b.jsx(i2,{}),sx:{"& .MuiAccordionSummary-content":{alignItems:"center",gap:2}},children:[b.jsx(Sv,{color:"primary"}),b.jsxs(ge,{sx:{flex:1},children:[b.jsx(ae,{variant:"h6",children:c.username}),b.jsx(ae,{variant:"body2",color:"text.secondary",children:c.domain})]}),b.jsx(fn,{label:c.verified?"Verified":"Pending",color:c.verified?"success":"warning",size:"small"})]}),b.jsx(zx,{children:b.jsxs(ge,{sx:{pt:2},children:[b.jsxs(ae,{variant:"body2",color:"text.secondary",sx:{mb:3},children:["Configure repository patterns for ",c.username,"@",c.domain,". These patterns determine which repositories will be indexed for attestations."]}),b.jsx(tSe,{domain:c.domain,username:c.username})]})})]},`${c.domain}-${c.username}`))]}),b.jsxs(sr,{elevation:1,sx:{p:3,mt:4,bgcolor:"info.light",color:"info.contrastText"},children:[b.jsx(ae,{variant:"h6",gutterBottom:!0,children:"Repository Pattern Information"}),b.jsxs(ge,{component:"ul",sx:{m:0,pl:2},children:[b.jsxs(ae,{component:"li",variant:"body2",sx:{mb:1},children:[b.jsx("strong",{children:"Default Pattern:"})," All new identities start with ",b.jsx("code",{children:"*/*"})," (all repositories enabled)"]}),b.jsxs(ae,{component:"li",variant:"body2",sx:{mb:1},children:[b.jsx("strong",{children:"Wildcard Support:"})," Use ",b.jsx("code",{children:"*"})," to match any namespace or repository name"]}),b.jsxs(ae,{component:"li",variant:"body2",sx:{mb:1},children:[b.jsx("strong",{children:"Specific Patterns:"})," Use exact names like ",b.jsx("code",{children:"myorg/myrepo"})," for precise control"]}),b.jsxs(ae,{component:"li",variant:"body2",children:[b.jsx("strong",{children:"Pattern Priority:"})," More specific patterns take precedence over wildcards"]})]})]})]}):b.jsx(Wm,{maxWidth:"lg",sx:{py:4},children:b.jsxs(gr,{severity:"info",children:[b.jsx(ae,{variant:"subtitle2",gutterBottom:!0,children:"Connect Your Wallet"}),b.jsx(ae,{variant:"body2",children:"Please connect your wallet using the button in the top-right corner to manage your GitHub identity settings."})]})})},nSe=()=>{const[e,t]=v.useState("register"),r=n=>{t(n)};return b.jsxs(ge,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:[b.jsx(Zse,{currentPage:e,onPageChange:r}),b.jsxs(ge,{sx:{flex:1},children:[e==="register"&&b.jsx(Y2e,{}),e==="settings"&&b.jsx(rSe,{})]})]})},oSe=dv({palette:{primary:{main:zi[600],light:zi[400],dark:zi[800]},secondary:{main:fc[600],light:fc[400],dark:fc[800]},success:{main:Ba[600],light:Ba[100]},error:{main:Vs[600]},warning:{main:dc[600]},background:{default:"#f5f5f5",paper:"#ffffff"},text:{primary:fc[900],secondary:fc[600]}},typography:{fontFamily:'"Inter", "Roboto", "Helvetica", "Arial", sans-serif',h6:{fontWeight:600},body2:{fontSize:"0.875rem"}},shape:{borderRadius:8},components:{MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500},contained:{boxShadow:"none","&:hover":{boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}}}},MuiCard:{styleOverrides:{root:{boxShadow:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)"}}},MuiAlert:{styleOverrides:{root:{borderRadius:8}}}}}),iSe=({children:e})=>b.jsxs(QQ,{theme:oSe,children:[b.jsx(Lre,{}),e]}),tz=document.getElementById("root");if(!tz)throw new Error("Root element not found");Gj(tz).render(b.jsx(iSe,{children:b.jsx(pse,{children:b.jsx(qse,{children:b.jsx(nle,{children:b.jsx(nSe,{})})})})}));export{DR as $,yF as A,CF as B,Wl as C,Ss as D,IE as E,TW as F,Mo as G,qg as H,us as I,oy as J,kr as K,q8 as L,In as M,vW as N,Z$ as O,v8 as P,PW as Q,Lf as R,_U as S,Bp as T,cSe as U,ou as V,SV as W,Ei as X,xSe as Y,Fu as Z,Pi as _,q$ as a,fse as a0,Gt as a1,le as a2,Fp as a3,an as a4,L7 as a5,K7 as a6,cw as a7,o8 as a8,Ps as a9,Jd as aA,gU as aa,UR as ab,Rt as ac,ES as ad,Ji as ae,z8 as af,cr as ag,ea as ah,Gu as ai,SS as aj,ds as ak,X7 as al,Jg as am,pG as an,PSe as ao,Xs as ap,Qs as aq,zG as ar,Hl as as,kG as at,SSe as au,ASe as av,xS as aw,cy as ax,OW as ay,iy as az,M$ as b,Uu as c,h7 as d,ySe as e,LG as f,Es as g,Hu as h,io as i,Se as j,gn as k,VS as l,xH as m,je as n,HS as o,Du as p,Ew as q,BG as r,tu as s,$o as t,aH as u,rR as v,zu as w,Lr as x,Lp as y,qo as z}; diff --git a/public/assets/index-CGdEoSbI.js b/public/assets/index-CGdEoSbI.js deleted file mode 100644 index 78413df..0000000 --- a/public/assets/index-CGdEoSbI.js +++ /dev/null @@ -1,504 +0,0 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-3O4qPenO.js","assets/kernelAccountClient-DrOnjQwj.js","assets/constants-VN1kIEzb.js","assets/index-0jpWsoRj.js"])))=>i.map(i=>d[i]); -var On=Object.defineProperty;var Rn=o=>{throw TypeError(o)};var Mn=(o,_,$)=>_ in o?On(o,_,{enumerable:!0,configurable:!0,writable:!0,value:$}):o[_]=$;var vn=(o,_,$)=>Mn(o,typeof _!="symbol"?_+"":_,$),In=(o,_,$)=>_.has(o)||Rn("Cannot "+$);var Vr=(o,_,$)=>(In(o,_,"read from private field"),$?$.call(o):_.get(o)),wn=(o,_,$)=>_.has(o)?Rn("Cannot add the same private member more than once"):_ instanceof WeakSet?_.add(o):_.set(o,$),Gr=(o,_,$,j)=>(In(o,_,"write to private field"),j?j.call(o,$):_.set(o,$),$);function _mergeNamespaces(o,_){for(var $=0;$<_.length;$++){const j=_[$];if(typeof j!="string"&&!Array.isArray(j)){for(const _e in j)if(_e!=="default"&&!(_e in o)){const et=Object.getOwnPropertyDescriptor(j,_e);et&&Object.defineProperty(o,_e,et.get?et:{enumerable:!0,get:()=>j[_e]})}}}return Object.freeze(Object.defineProperty(o,Symbol.toStringTag,{value:"Module"}))}(function(){const _=document.createElement("link").relList;if(_&&_.supports&&_.supports("modulepreload"))return;for(const _e of document.querySelectorAll('link[rel="modulepreload"]'))j(_e);new MutationObserver(_e=>{for(const et of _e)if(et.type==="childList")for(const tt of et.addedNodes)tt.tagName==="LINK"&&tt.rel==="modulepreload"&&j(tt)}).observe(document,{childList:!0,subtree:!0});function $(_e){const et={};return _e.integrity&&(et.integrity=_e.integrity),_e.referrerPolicy&&(et.referrerPolicy=_e.referrerPolicy),_e.crossOrigin==="use-credentials"?et.credentials="include":_e.crossOrigin==="anonymous"?et.credentials="omit":et.credentials="same-origin",et}function j(_e){if(_e.ep)return;_e.ep=!0;const et=$(_e);fetch(_e.href,et)}})();var commonjsGlobal=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};function getDefaultExportFromCjs$1(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}function getAugmentedNamespace(o){if(o.__esModule)return o;var _=o.default;if(typeof _=="function"){var $=function j(){return this instanceof j?Reflect.construct(_,arguments,this.constructor):_.apply(this,arguments)};$.prototype=_.prototype}else $={};return Object.defineProperty($,"__esModule",{value:!0}),Object.keys(o).forEach(function(j){var _e=Object.getOwnPropertyDescriptor(o,j);Object.defineProperty($,j,_e.get?_e:{enumerable:!0,get:function(){return o[j]}})}),$}var jsxRuntime={exports:{}},reactJsxRuntime_production_min={},react={exports:{}},react_production_min={};/** - * @license React - * react.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 l$2=Symbol.for("react.element"),n$2=Symbol.for("react.portal"),p$3=Symbol.for("react.fragment"),q$2=Symbol.for("react.strict_mode"),r$3=Symbol.for("react.profiler"),t$1=Symbol.for("react.provider"),u=Symbol.for("react.context"),v$2=Symbol.for("react.forward_ref"),w$1=Symbol.for("react.suspense"),x$2=Symbol.for("react.memo"),y$2=Symbol.for("react.lazy"),z$2=Symbol.iterator;function A$2(o){return o===null||typeof o!="object"?null:(o=z$2&&o[z$2]||o["@@iterator"],typeof o=="function"?o:null)}var B$1={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C$1=Object.assign,D$1={};function E$2(o,_,$){this.props=o,this.context=_,this.refs=D$1,this.updater=$||B$1}E$2.prototype.isReactComponent={};E$2.prototype.setState=function(o,_){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,_,"setState")};E$2.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function F(){}F.prototype=E$2.prototype;function G$1(o,_,$){this.props=o,this.context=_,this.refs=D$1,this.updater=$||B$1}var H$1=G$1.prototype=new F;H$1.constructor=G$1;C$1(H$1,E$2.prototype);H$1.isPureReactComponent=!0;var I$1=Array.isArray,J=Object.prototype.hasOwnProperty,K$2={current:null},L$1={key:!0,ref:!0,__self:!0,__source:!0};function M$1(o,_,$){var j,_e={},et=null,tt=null;if(_!=null)for(j in _.ref!==void 0&&(tt=_.ref),_.key!==void 0&&(et=""+_.key),_)J.call(_,j)&&!L$1.hasOwnProperty(j)&&(_e[j]=_[j]);var rt=arguments.length-2;if(rt===1)_e.children=$;else if(1(\[(\d*)\])*)$/;function formatAbiParameter(o){let _=o.type;if(tupleRegex.test(o.type)&&"components"in o){_="(";const $=o.components.length;for(let _e=0;_e<$;_e++){const et=o.components[_e];_+=formatAbiParameter(et),_e<$-1&&(_+=", ")}const j=execTyped(tupleRegex,o.type);return _+=`)${(j==null?void 0:j.array)||""}`,formatAbiParameter({...o,type:_})}return"indexed"in o&&o.indexed&&(_=`${_} indexed`),o.name?`${_} ${o.name}`:_}function formatAbiParameters(o){let _="";const $=o.length;for(let j=0;j<$;j++){const _e=o[j];_+=formatAbiParameter(_e),j!==$-1&&(_+=", ")}return _}function formatAbiItem$1(o){var _;return o.type==="function"?`function ${o.name}(${formatAbiParameters(o.inputs)})${o.stateMutability&&o.stateMutability!=="nonpayable"?` ${o.stateMutability}`:""}${(_=o.outputs)!=null&&_.length?` returns (${formatAbiParameters(o.outputs)})`:""}`:o.type==="event"?`event ${o.name}(${formatAbiParameters(o.inputs)})`:o.type==="error"?`error ${o.name}(${formatAbiParameters(o.inputs)})`:o.type==="constructor"?`constructor(${formatAbiParameters(o.inputs)})${o.stateMutability==="payable"?" payable":""}`:o.type==="fallback"?`fallback() external${o.stateMutability==="payable"?" payable":""}`:"receive() external payable"}const errorSignatureRegex=/^error (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function isErrorSignature(o){return errorSignatureRegex.test(o)}function execErrorSignature(o){return execTyped(errorSignatureRegex,o)}const eventSignatureRegex=/^event (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)$/;function isEventSignature(o){return eventSignatureRegex.test(o)}function execEventSignature(o){return execTyped(eventSignatureRegex,o)}const functionSignatureRegex=/^function (?[a-zA-Z$_][a-zA-Z0-9$_]*)\((?.*?)\)(?: (?external|public{1}))?(?: (?pure|view|nonpayable|payable{1}))?(?: returns\s?\((?.*?)\))?$/;function isFunctionSignature(o){return functionSignatureRegex.test(o)}function execFunctionSignature(o){return execTyped(functionSignatureRegex,o)}const structSignatureRegex=/^struct (?[a-zA-Z$_][a-zA-Z0-9$_]*) \{(?.*?)\}$/;function isStructSignature(o){return structSignatureRegex.test(o)}function execStructSignature(o){return execTyped(structSignatureRegex,o)}const constructorSignatureRegex=/^constructor\((?.*?)\)(?:\s(?payable{1}))?$/;function isConstructorSignature(o){return constructorSignatureRegex.test(o)}function execConstructorSignature(o){return execTyped(constructorSignatureRegex,o)}const fallbackSignatureRegex=/^fallback\(\) external(?:\s(?payable{1}))?$/;function isFallbackSignature(o){return fallbackSignatureRegex.test(o)}function execFallbackSignature(o){return execTyped(fallbackSignatureRegex,o)}const receiveSignatureRegex=/^receive\(\) external payable$/;function isReceiveSignature(o){return receiveSignatureRegex.test(o)}const modifiers=new Set(["memory","indexed","storage","calldata"]),eventModifiers=new Set(["indexed"]),functionModifiers=new Set(["calldata","memory","storage"]);class InvalidAbiItemError extends BaseError$2{constructor({signature:_}){super("Failed to parse ABI item.",{details:`parseAbiItem(${JSON.stringify(_,null,2)})`,docsPath:"/api/human#parseabiitem-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiItemError"})}}class UnknownTypeError extends BaseError$2{constructor({type:_}){super("Unknown type.",{metaMessages:[`Type "${_}" 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 UnknownSolidityTypeError extends BaseError$2{constructor({type:_}){super("Unknown type.",{metaMessages:[`Type "${_}" is not a valid ABI type.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSolidityTypeError"})}}class InvalidAbiParametersError extends BaseError$2{constructor({params:_}){super("Failed to parse ABI parameters.",{details:`parseAbiParameters(${JSON.stringify(_,null,2)})`,docsPath:"/api/human#parseabiparameters-1"}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiParametersError"})}}class InvalidParameterError extends BaseError$2{constructor({param:_}){super("Invalid ABI parameter.",{details:_}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParameterError"})}}class SolidityProtectedKeywordError extends BaseError$2{constructor({param:_,name:$}){super("Invalid ABI parameter.",{details:_,metaMessages:[`"${$}" 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 InvalidModifierError extends BaseError$2{constructor({param:_,type:$,modifier:j}){super("Invalid ABI parameter.",{details:_,metaMessages:[`Modifier "${j}" not allowed${$?` in "${$}" type`:""}.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidModifierError"})}}class InvalidFunctionModifierError extends BaseError$2{constructor({param:_,type:$,modifier:j}){super("Invalid ABI parameter.",{details:_,metaMessages:[`Modifier "${j}" not allowed${$?` in "${$}" type`:""}.`,`Data location can only be specified for array, struct, or mapping types, but "${j}" was given.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidFunctionModifierError"})}}class InvalidAbiTypeParameterError extends BaseError$2{constructor({abiParameter:_}){super("Invalid ABI parameter.",{details:JSON.stringify(_,null,2),metaMessages:["ABI parameter type is invalid."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidAbiTypeParameterError"})}}class InvalidSignatureError extends BaseError$2{constructor({signature:_,type:$}){super(`Invalid ${$} signature.`,{details:_}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidSignatureError"})}}class UnknownSignatureError extends BaseError$2{constructor({signature:_}){super("Unknown signature.",{details:_}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"UnknownSignatureError"})}}class InvalidStructSignatureError extends BaseError$2{constructor({signature:_}){super("Invalid struct signature.",{details:_,metaMessages:["No properties exist."]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidStructSignatureError"})}}class CircularReferenceError extends BaseError$2{constructor({type:_}){super("Circular reference detected.",{metaMessages:[`Struct "${_}" is a circular reference.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"CircularReferenceError"})}}class InvalidParenthesisError extends BaseError$2{constructor({current:_,depth:$}){super("Unbalanced parentheses.",{metaMessages:[`"${_.trim()}" has too many ${$>0?"opening":"closing"} parentheses.`],details:`Depth "${$}"`}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidParenthesisError"})}}function getParameterCacheKey(o,_,$){let j="";if($)for(const _e of Object.entries($)){if(!_e)continue;let et="";for(const tt of _e[1])et+=`[${tt.type}${tt.name?`:${tt.name}`:""}]`;j+=`(${_e[0]}{${et}})`}return _?`${_}:${o}${j}`:`${o}${j}`}const parameterCache=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}]]);function parseSignature(o,_={}){if(isFunctionSignature(o))return parseFunctionSignature(o,_);if(isEventSignature(o))return parseEventSignature(o,_);if(isErrorSignature(o))return parseErrorSignature(o,_);if(isConstructorSignature(o))return parseConstructorSignature(o,_);if(isFallbackSignature(o))return parseFallbackSignature(o);if(isReceiveSignature(o))return{type:"receive",stateMutability:"payable"};throw new UnknownSignatureError({signature:o})}function parseFunctionSignature(o,_={}){const $=execFunctionSignature(o);if(!$)throw new InvalidSignatureError({signature:o,type:"function"});const j=splitParameters($.parameters),_e=[],et=j.length;for(let rt=0;rt[a-zA-Z$_][a-zA-Z0-9$_]*(?:\spayable)?)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,abiParameterWithTupleRegex=/^\((?.+?)\)(?(?:\[\d*?\])+?)?(?:\s(?calldata|indexed|memory|storage{1}))?(?:\s(?[a-zA-Z$_][a-zA-Z0-9$_]*))?$/,dynamicIntegerRegex=/^u?int$/;function parseAbiParameter(o,_){var st,at;const $=getParameterCacheKey(o,_==null?void 0:_.type,_==null?void 0:_.structs);if(parameterCache.has($))return parameterCache.get($);const j=isTupleRegex.test(o),_e=execTyped(j?abiParameterWithTupleRegex:abiParameterWithoutTupleRegex,o);if(!_e)throw new InvalidParameterError({param:o});if(_e.name&&isSolidityKeyword(_e.name))throw new SolidityProtectedKeywordError({param:o,name:_e.name});const et=_e.name?{name:_e.name}:{},tt=_e.modifier==="indexed"?{indexed:!0}:{},rt=(_==null?void 0:_.structs)??{};let nt,ot={};if(j){nt="tuple";const lt=splitParameters(_e.type),ct=[],ft=lt.length;for(let dt=0;dt[a-zA-Z$_][a-zA-Z0-9$_]*)(?(?:\[\d*?\])+?)?$/;function resolveStructs(o=[],_={},$=new Set){const j=[],_e=o.length;for(let et=0;et<_e;et++){const tt=o[et];if(isTupleRegex.test(tt.type))j.push(tt);else{const nt=execTyped(typeWithoutTupleRegex,tt.type);if(!(nt!=null&&nt.type))throw new InvalidAbiTypeParameterError({abiParameter:tt});const{array:ot,type:it}=nt;if(it in _){if($.has(it))throw new CircularReferenceError({type:it});j.push({...tt,type:`tuple${ot??""}`,components:resolveStructs(_[it],_,new Set([...$,it]))})}else if(isSolidityType(it))j.push(tt);else throw new UnknownTypeError({type:it})}}return j}function parseAbi(o){const _=parseStructs(o),$=[],j=o.length;for(let _e=0;_e_(o,et)}function formatAbiItem(o,{includeName:_=!1}={}){if(o.type!=="function"&&o.type!=="event"&&o.type!=="error")throw new InvalidDefinitionTypeError(o.type);return`${o.name}(${formatAbiParams(o.inputs,{includeName:_})})`}function formatAbiParams(o,{includeName:_=!1}={}){return o?o.map($=>formatAbiParam($,{includeName:_})).join(_?", ":","):""}function formatAbiParam(o,{includeName:_}){return o.type.startsWith("tuple")?`(${formatAbiParams(o.components,{includeName:_})})${o.type.slice(5)}`:o.type+(_&&o.name?` ${o.name}`:"")}function isHex(o,{strict:_=!0}={}){return!o||typeof o!="string"?!1:_?/^0x[0-9a-fA-F]*$/.test(o):o.startsWith("0x")}function size$3(o){return isHex(o,{strict:!1})?Math.ceil((o.length-2)/2):o.length}const version$4="2.45.1";let errorConfig={getDocsUrl:({docsBaseUrl:o,docsPath:_="",docsSlug:$})=>_?`${o??"https://viem.sh"}${_}${$?`#${$}`:""}`:void 0,version:`viem@${version$4}`},BaseError$1=class Tn extends Error{constructor(_,$={}){var rt;const j=(()=>{var nt;return $.cause instanceof Tn?$.cause.details:(nt=$.cause)!=null&&nt.message?$.cause.message:$.details})(),_e=$.cause instanceof Tn&&$.cause.docsPath||$.docsPath,et=(rt=errorConfig.getDocsUrl)==null?void 0:rt.call(errorConfig,{...$,docsPath:_e}),tt=[_||"An error occurred.","",...$.metaMessages?[...$.metaMessages,""]:[],...et?[`Docs: ${et}`]:[],...j?[`Details: ${j}`]:[],...errorConfig.version?[`Version: ${errorConfig.version}`]:[]].join(` -`);super(tt,$.cause?{cause:$.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:"BaseError"}),this.details=j,this.docsPath=_e,this.metaMessages=$.metaMessages,this.name=$.name??this.name,this.shortMessage=_,this.version=version$4}walk(_){return walk$1(this,_)}};function walk$1(o,_){return _!=null&&_(o)?o:o&&typeof o=="object"&&"cause"in o&&o.cause!==void 0?walk$1(o.cause,_):_?null:o}class AbiConstructorNotFoundError extends BaseError$1{constructor({docsPath:_}){super(["A constructor was not found on the ABI.","Make sure you are using the correct ABI and that the constructor exists on it."].join(` -`),{docsPath:_,name:"AbiConstructorNotFoundError"})}}class AbiConstructorParamsNotFoundError extends BaseError$1{constructor({docsPath:_}){super(["Constructor arguments were provided (`args`), but a constructor parameters (`inputs`) were not found on the ABI.","Make sure you are using the correct ABI, and that the `inputs` attribute on the constructor exists."].join(` -`),{docsPath:_,name:"AbiConstructorParamsNotFoundError"})}}class AbiDecodingDataSizeTooSmallError extends BaseError$1{constructor({data:_,params:$,size:j}){super([`Data size of ${j} bytes is too small for given parameters.`].join(` -`),{metaMessages:[`Params: (${formatAbiParams($,{includeName:!0})})`,`Data: ${_} (${j} bytes)`],name:"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=_,this.params=$,this.size=j}}class AbiDecodingZeroDataError extends BaseError$1{constructor(){super('Cannot decode zero data ("0x") with ABI parameters.',{name:"AbiDecodingZeroDataError"})}}class AbiEncodingArrayLengthMismatchError extends BaseError$1{constructor({expectedLength:_,givenLength:$,type:j}){super([`ABI encoding array length mismatch for type ${j}.`,`Expected length: ${_}`,`Given length: ${$}`].join(` -`),{name:"AbiEncodingArrayLengthMismatchError"})}}class AbiEncodingBytesSizeMismatchError extends BaseError$1{constructor({expectedSize:_,value:$}){super(`Size of bytes "${$}" (bytes${size$3($)}) does not match expected size (bytes${_}).`,{name:"AbiEncodingBytesSizeMismatchError"})}}class AbiEncodingLengthMismatchError extends BaseError$1{constructor({expectedLength:_,givenLength:$}){super(["ABI encoding params/values length mismatch.",`Expected length (params): ${_}`,`Given length (values): ${$}`].join(` -`),{name:"AbiEncodingLengthMismatchError"})}}class AbiErrorInputsNotFoundError extends BaseError$1{constructor(_,{docsPath:$}){super([`Arguments (\`args\`) were provided to "${_}", but "${_}" on the ABI does not contain any parameters (\`inputs\`).`,"Cannot encode error result without knowing what the parameter types are.","Make sure you are using the correct ABI and that the inputs exist on it."].join(` -`),{docsPath:$,name:"AbiErrorInputsNotFoundError"})}}class AbiErrorNotFoundError extends BaseError$1{constructor(_,{docsPath:$}={}){super([`Error ${_?`"${_}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the error exists on it."].join(` -`),{docsPath:$,name:"AbiErrorNotFoundError"})}}class AbiErrorSignatureNotFoundError extends BaseError$1{constructor(_,{docsPath:$}){super([`Encoded error signature "${_}" 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://4byte.sourcify.dev/?q=${_}.`].join(` -`),{docsPath:$,name:"AbiErrorSignatureNotFoundError"}),Object.defineProperty(this,"signature",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.signature=_}}class AbiEventSignatureEmptyTopicsError extends BaseError$1{constructor({docsPath:_}){super("Cannot extract event signature from empty topics.",{docsPath:_,name:"AbiEventSignatureEmptyTopicsError"})}}class AbiEventSignatureNotFoundError extends BaseError$1{constructor(_,{docsPath:$}){super([`Encoded event signature "${_}" 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://4byte.sourcify.dev/?q=${_}.`].join(` -`),{docsPath:$,name:"AbiEventSignatureNotFoundError"})}}class AbiEventNotFoundError extends BaseError$1{constructor(_,{docsPath:$}={}){super([`Event ${_?`"${_}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the event exists on it."].join(` -`),{docsPath:$,name:"AbiEventNotFoundError"})}}class AbiFunctionNotFoundError extends BaseError$1{constructor(_,{docsPath:$}={}){super([`Function ${_?`"${_}" `:""}not found on ABI.`,"Make sure you are using the correct ABI and that the function exists on it."].join(` -`),{docsPath:$,name:"AbiFunctionNotFoundError"})}}class AbiFunctionOutputsNotFoundError extends BaseError$1{constructor(_,{docsPath:$}){super([`Function "${_}" 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."].join(` -`),{docsPath:$,name:"AbiFunctionOutputsNotFoundError"})}}class AbiFunctionSignatureNotFoundError extends BaseError$1{constructor(_,{docsPath:$}){super([`Encoded function signature "${_}" 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://4byte.sourcify.dev/?q=${_}.`].join(` -`),{docsPath:$,name:"AbiFunctionSignatureNotFoundError"})}}class AbiItemAmbiguityError extends BaseError$1{constructor(_,$){super("Found ambiguous types in overloaded ABI items.",{metaMessages:[`\`${_.type}\` in \`${formatAbiItem(_.abiItem)}\`, and`,`\`${$.type}\` in \`${formatAbiItem($.abiItem)}\``,"","These types encode differently and cannot be distinguished at runtime.","Remove one of the ambiguous items in the ABI."],name:"AbiItemAmbiguityError"})}}let BytesSizeMismatchError$1=class extends BaseError$1{constructor({expectedSize:_,givenSize:$}){super(`Expected bytes${_}, got bytes${$}.`,{name:"BytesSizeMismatchError"})}};class DecodeLogDataMismatch extends BaseError$1{constructor({abiItem:_,data:$,params:j,size:_e}){super([`Data size of ${_e} bytes is too small for non-indexed event parameters.`].join(` -`),{metaMessages:[`Params: (${formatAbiParams(j,{includeName:!0})})`,`Data: ${$} (${_e} bytes)`],name:"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=_,this.data=$,this.params=j,this.size=_e}}class DecodeLogTopicsMismatch extends BaseError$1{constructor({abiItem:_,param:$}){super([`Expected a topic for indexed event parameter${$.name?` "${$.name}"`:""} on event "${formatAbiItem(_,{includeName:!0})}".`].join(` -`),{name:"DecodeLogTopicsMismatch"}),Object.defineProperty(this,"abiItem",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.abiItem=_}}class InvalidAbiEncodingTypeError extends BaseError$1{constructor(_,{docsPath:$}){super([`Type "${_}" is not a valid encoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:$,name:"InvalidAbiEncodingType"})}}class InvalidAbiDecodingTypeError extends BaseError$1{constructor(_,{docsPath:$}){super([`Type "${_}" is not a valid decoding type.`,"Please provide a valid ABI type."].join(` -`),{docsPath:$,name:"InvalidAbiDecodingType"})}}let InvalidArrayError$1=class extends BaseError$1{constructor(_){super([`Value "${_}" is not a valid array.`].join(` -`),{name:"InvalidArrayError"})}};class InvalidDefinitionTypeError extends BaseError$1{constructor(_){super([`"${_}" is not a valid definition type.`,'Valid types: "function", "event", "error"'].join(` -`),{name:"InvalidDefinitionTypeError"})}}class UnsupportedPackedAbiType extends BaseError$1{constructor(_){super(`Type "${_}" is not supported for packed encoding.`,{name:"UnsupportedPackedAbiType"})}}class FilterTypeNotSupportedError extends BaseError$1{constructor(_){super(`Filter type "${_}" is not supported.`,{name:"FilterTypeNotSupportedError"})}}let SliceOffsetOutOfBoundsError$1=class extends BaseError$1{constructor({offset:_,position:$,size:j}){super(`Slice ${$==="start"?"starting":"ending"} at offset "${_}" is out-of-bounds (size: ${j}).`,{name:"SliceOffsetOutOfBoundsError"})}},SizeExceedsPaddingSizeError$2=class extends BaseError$1{constructor({size:_,targetSize:$,type:j}){super(`${j.charAt(0).toUpperCase()}${j.slice(1).toLowerCase()} size (${_}) exceeds padding size (${$}).`,{name:"SizeExceedsPaddingSizeError"})}};class InvalidBytesLengthError extends BaseError$1{constructor({size:_,targetSize:$,type:j}){super(`${j.charAt(0).toUpperCase()}${j.slice(1).toLowerCase()} is expected to be ${$} ${j} long, but is ${_} ${j} long.`,{name:"InvalidBytesLengthError"})}}function pad$3(o,{dir:_,size:$=32}={}){return typeof o=="string"?padHex(o,{dir:_,size:$}):padBytes(o,{dir:_,size:$})}function padHex(o,{dir:_,size:$=32}={}){if($===null)return o;const j=o.replace("0x","");if(j.length>$*2)throw new SizeExceedsPaddingSizeError$2({size:Math.ceil(j.length/2),targetSize:$,type:"hex"});return`0x${j[_==="right"?"padEnd":"padStart"]($*2,"0")}`}function padBytes(o,{dir:_,size:$=32}={}){if($===null)return o;if(o.length>$)throw new SizeExceedsPaddingSizeError$2({size:o.length,targetSize:$,type:"bytes"});const j=new Uint8Array($);for(let _e=0;_e<$;_e++){const et=_==="right";j[et?_e:$-_e-1]=o[et?_e:o.length-_e-1]}return j}let IntegerOutOfRangeError$1=class extends BaseError$1{constructor({max:_,min:$,signed:j,size:_e,value:et}){super(`Number "${et}" is not in safe ${_e?`${_e*8}-bit ${j?"signed":"unsigned"} `:""}integer range ${_?`(${$} to ${_})`:`(above ${$})`}`,{name:"IntegerOutOfRangeError"})}},InvalidBytesBooleanError$1=class extends BaseError$1{constructor(_){super(`Bytes value "${_}" is not a valid boolean. The bytes array must contain a single byte of either a 0 or 1 value.`,{name:"InvalidBytesBooleanError"})}};class InvalidHexBooleanError extends BaseError$1{constructor(_){super(`Hex value "${_}" is not a valid boolean. The hex value must be "0x0" (false) or "0x1" (true).`,{name:"InvalidHexBooleanError"})}}let SizeOverflowError$2=class extends BaseError$1{constructor({givenSize:_,maxSize:$}){super(`Size cannot exceed ${$} bytes. Given size: ${_} bytes.`,{name:"SizeOverflowError"})}};function trim$2(o,{dir:_="left"}={}){let $=typeof o=="string"?o.replace("0x",""):o,j=0;for(let _e=0;_e<$.length-1&&$[_==="left"?_e:$.length-_e-1].toString()==="0";_e++)j++;return $=_==="left"?$.slice(j):$.slice(0,$.length-j),typeof o=="string"?($.length===1&&_==="right"&&($=`${$}0`),`0x${$.length%2===1?`0${$}`:$}`):$}function assertSize$2(o,{size:_}){if(size$3(o)>_)throw new SizeOverflowError$2({givenSize:size$3(o),maxSize:_})}function hexToBigInt(o,_={}){const{signed:$}=_;_.size&&assertSize$2(o,{size:_.size});const j=BigInt(o);if(!$)return j;const _e=(o.length-2)/2,et=(1n<_.toString(16).padStart(2,"0"));function toHex$1(o,_={}){return typeof o=="number"||typeof o=="bigint"?numberToHex(o,_):typeof o=="string"?stringToHex(o,_):typeof o=="boolean"?boolToHex(o,_):bytesToHex$4(o,_)}function boolToHex(o,_={}){const $=`0x${Number(o)}`;return typeof _.size=="number"?(assertSize$2($,{size:_.size}),pad$3($,{size:_.size})):$}function bytesToHex$4(o,_={}){let $="";for(let _e=0;_eet||_e=charCodeMap$1.zero&&o<=charCodeMap$1.nine)return o-charCodeMap$1.zero;if(o>=charCodeMap$1.A&&o<=charCodeMap$1.F)return o-(charCodeMap$1.A-10);if(o>=charCodeMap$1.a&&o<=charCodeMap$1.f)return o-(charCodeMap$1.a-10)}function hexToBytes$4(o,_={}){let $=o;_.size&&(assertSize$2($,{size:_.size}),$=pad$3($,{dir:"right",size:_.size}));let j=$.slice(2);j.length%2&&(j=`0${j}`);const _e=j.length/2,et=new Uint8Array(_e);for(let tt=0,rt=0;tt<_e;tt++){const nt=charCodeToBase16$1(j.charCodeAt(rt++)),ot=charCodeToBase16$1(j.charCodeAt(rt++));if(nt===void 0||ot===void 0)throw new BaseError$1(`Invalid byte sequence ("${j[rt-2]}${j[rt-1]}" in "${j}").`);et[tt]=nt*16+ot}return et}function numberToBytes(o,_){const $=numberToHex(o,_);return hexToBytes$4($)}function stringToBytes(o,_={}){const $=encoder$2.encode(o);return typeof _.size=="number"?(assertSize$2($,{size:_.size}),pad$3($,{dir:"right",size:_.size})):$}const U32_MASK64$2=BigInt(2**32-1),_32n$2=BigInt(32);function fromBig$2(o,_=!1){return _?{h:Number(o&U32_MASK64$2),l:Number(o>>_32n$2&U32_MASK64$2)}:{h:Number(o>>_32n$2&U32_MASK64$2)|0,l:Number(o&U32_MASK64$2)|0}}function split$2(o,_=!1){const $=o.length;let j=new Uint32Array($),_e=new Uint32Array($);for(let et=0;et<$;et++){const{h:tt,l:rt}=fromBig$2(o[et],_);[j[et],_e[et]]=[tt,rt]}return[j,_e]}const rotlSH$2=(o,_,$)=>o<<$|_>>>32-$,rotlSL$2=(o,_,$)=>_<<$|o>>>32-$,rotlBH$2=(o,_,$)=>_<<$-32|o>>>64-$,rotlBL$2=(o,_,$)=>o<<$-32|_>>>64-$,crypto$3=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */function isBytes$3(o){return o instanceof Uint8Array||ArrayBuffer.isView(o)&&o.constructor.name==="Uint8Array"}function anumber(o){if(!Number.isSafeInteger(o)||o<0)throw new Error("positive integer expected, got "+o)}function abytes$2(o,..._){if(!isBytes$3(o))throw new Error("Uint8Array expected");if(_.length>0&&!_.includes(o.length))throw new Error("Uint8Array expected of length "+_+", got length="+o.length)}function ahash(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.createHasher");anumber(o.outputLen),anumber(o.blockLen)}function aexists(o,_=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(_&&o.finished)throw new Error("Hash#digest() has already been called")}function aoutput(o,_){abytes$2(o);const $=_.outputLen;if(o.length<$)throw new Error("digestInto() expects output buffer of length at least "+$)}function u32$2(o){return new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4))}function clean(...o){for(let _=0;_>>_}const isLE$2=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;function byteSwap$1(o){return o<<24&4278190080|o<<8&16711680|o>>>8&65280|o>>>24&255}function byteSwap32$1(o){for(let _=0;_o:byteSwap32$1;function utf8ToBytes$2(o){if(typeof o!="string")throw new Error("string expected");return new Uint8Array(new TextEncoder().encode(o))}function toBytes$4(o){return typeof o=="string"&&(o=utf8ToBytes$2(o)),abytes$2(o),o}function concatBytes$6(...o){let _=0;for(let j=0;jo().update(toBytes$4(j)).digest(),$=o();return _.outputLen=$.outputLen,_.blockLen=$.blockLen,_.create=()=>o(),_}function randomBytes$3(o=32){if(crypto$3&&typeof crypto$3.getRandomValues=="function")return crypto$3.getRandomValues(new Uint8Array(o));if(crypto$3&&typeof crypto$3.randomBytes=="function")return Uint8Array.from(crypto$3.randomBytes(o));throw new Error("crypto.getRandomValues must be defined")}const _0n$d=BigInt(0),_1n$h=BigInt(1),_2n$a=BigInt(2),_7n$2=BigInt(7),_256n$2=BigInt(256),_0x71n$2=BigInt(113),SHA3_PI$2=[],SHA3_ROTL$2=[],_SHA3_IOTA$2=[];for(let o=0,_=_1n$h,$=1,j=0;o<24;o++){[$,j]=[j,(2*$+3*j)%5],SHA3_PI$2.push(2*(5*j+$)),SHA3_ROTL$2.push((o+1)*(o+2)/2%64);let _e=_0n$d;for(let et=0;et<7;et++)_=(_<<_1n$h^(_>>_7n$2)*_0x71n$2)%_256n$2,_&_2n$a&&(_e^=_1n$h<<(_1n$h<$>32?rotlBH$2(o,_,$):rotlSH$2(o,_,$),rotlL$2=(o,_,$)=>$>32?rotlBL$2(o,_,$):rotlSL$2(o,_,$);function keccakP$2(o,_=24){const $=new Uint32Array(10);for(let j=24-_;j<24;j++){for(let tt=0;tt<10;tt++)$[tt]=o[tt]^o[tt+10]^o[tt+20]^o[tt+30]^o[tt+40];for(let tt=0;tt<10;tt+=2){const rt=(tt+8)%10,nt=(tt+2)%10,ot=$[nt],it=$[nt+1],st=rotlH$2(ot,it,1)^$[rt],at=rotlL$2(ot,it,1)^$[rt+1];for(let lt=0;lt<50;lt+=10)o[tt+lt]^=st,o[tt+lt+1]^=at}let _e=o[2],et=o[3];for(let tt=0;tt<24;tt++){const rt=SHA3_ROTL$2[tt],nt=rotlH$2(_e,et,rt),ot=rotlL$2(_e,et,rt),it=SHA3_PI$2[tt];_e=o[it],et=o[it+1],o[it]=nt,o[it+1]=ot}for(let tt=0;tt<50;tt+=10){for(let rt=0;rt<10;rt++)$[rt]=o[tt+rt];for(let rt=0;rt<10;rt++)o[tt+rt]^=~$[(rt+2)%10]&$[(rt+4)%10]}o[0]^=SHA3_IOTA_H$2[j],o[1]^=SHA3_IOTA_L$2[j]}clean($)}let Keccak$2=class kn extends Hash$2{constructor(_,$,j,_e=!1,et=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=_,this.suffix=$,this.outputLen=j,this.enableXOF=_e,this.rounds=et,anumber(j),!(0<_&&_<200))throw new Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=u32$2(this.state)}clone(){return this._cloneInto()}keccak(){swap32IfBE(this.state32),keccakP$2(this.state32,this.rounds),swap32IfBE(this.state32),this.posOut=0,this.pos=0}update(_){aexists(this),_=toBytes$4(_),abytes$2(_);const{blockLen:$,state:j}=this,_e=_.length;for(let et=0;et<_e;){const tt=Math.min($-this.pos,_e-et);for(let rt=0;rt=j&&this.keccak();const tt=Math.min(j-this.posOut,et-_e);_.set($.subarray(this.posOut,this.posOut+tt),_e),this.posOut+=tt,_e+=tt}return _}xofInto(_){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(_)}xof(_){return anumber(_),this.xofInto(new Uint8Array(_))}digestInto(_){if(aoutput(_,this),this.finished)throw new Error("digest() was already called");return this.writeInto(_),this.destroy(),_}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,clean(this.state)}_cloneInto(_){const{blockLen:$,suffix:j,outputLen:_e,rounds:et,enableXOF:tt}=this;return _||(_=new kn($,j,_e,tt,et)),_.state32.set(this.state32),_.pos=this.pos,_.posOut=this.posOut,_.finished=this.finished,_.rounds=et,_.suffix=j,_.outputLen=_e,_.enableXOF=tt,_.destroyed=this.destroyed,_}};const gen$2=(o,_,$)=>createHasher(()=>new Keccak$2(_,o,$)),keccak_256$2=gen$2(1,136,256/8);function keccak256$4(o,_){const $=_||"hex",j=keccak_256$2(isHex(o,{strict:!1})?toBytes$5(o):o);return $==="bytes"?j:toHex$1(j)}const hash$9=o=>keccak256$4(toBytes$5(o));function hashSignature(o){return hash$9(o)}function normalizeSignature$1(o){let _=!0,$="",j=0,_e="",et=!1;for(let tt=0;tt{const _=typeof o=="string"?o:formatAbiItem$1(o);return normalizeSignature$1(_)};function toSignatureHash(o){return hashSignature(toSignature(o))}const toEventSelector=toSignatureHash;let InvalidAddressError$1=class extends BaseError$1{constructor({address:_}){super(`Address "${_}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}},LruMap$1=class extends Map{constructor(_){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=_}get(_){const $=super.get(_);return super.has(_)&&$!==void 0&&(this.delete(_),super.set(_,$)),$}set(_,$){if(super.set(_,$),this.maxSize&&this.size>this.maxSize){const j=this.keys().next().value;j&&this.delete(j)}return this}};const checksumAddressCache=new LruMap$1(8192);function checksumAddress(o,_){if(checksumAddressCache.has(`${o}.${_}`))return checksumAddressCache.get(`${o}.${_}`);const $=o.substring(2).toLowerCase(),j=keccak256$4(stringToBytes($),"bytes"),_e=$.split("");for(let tt=0;tt<40;tt+=2)j[tt>>1]>>4>=8&&_e[tt]&&(_e[tt]=_e[tt].toUpperCase()),(j[tt>>1]&15)>=8&&_e[tt+1]&&(_e[tt+1]=_e[tt+1].toUpperCase());const et=`0x${_e.join("")}`;return checksumAddressCache.set(`${o}.${_}`,et),et}function getAddress(o,_){if(!isAddress(o,{strict:!1}))throw new InvalidAddressError$1({address:o});return checksumAddress(o,_)}const addressRegex$1=/^0x[a-fA-F0-9]{40}$/,isAddressCache=new LruMap$1(8192);function isAddress(o,_){const{strict:$=!0}=_??{},j=`${o}.${$}`;if(isAddressCache.has(j))return isAddressCache.get(j);const _e=addressRegex$1.test(o)?o.toLowerCase()===o?!0:$?checksumAddress(o)===o:!0:!1;return isAddressCache.set(j,_e),_e}function concat$2(o){return typeof o[0]=="string"?concatHex(o):concatBytes$5(o)}function concatBytes$5(o){let _=0;for(const _e of o)_+=_e.length;const $=new Uint8Array(_);let j=0;for(const _e of o)$.set(_e,j),j+=_e.length;return $}function concatHex(o){return`0x${o.reduce((_,$)=>_+$.replace("0x",""),"")}`}function slice$4(o,_,$,{strict:j}={}){return isHex(o,{strict:!1})?sliceHex(o,_,$,{strict:j}):sliceBytes(o,_,$,{strict:j})}function assertStartOffset$1(o,_){if(typeof _=="number"&&_>0&&_>size$3(o)-1)throw new SliceOffsetOutOfBoundsError$1({offset:_,position:"start",size:size$3(o)})}function assertEndOffset$1(o,_,$){if(typeof _=="number"&&typeof $=="number"&&size$3(o)!==$-_)throw new SliceOffsetOutOfBoundsError$1({offset:$,position:"end",size:size$3(o)})}function sliceBytes(o,_,$,{strict:j}={}){assertStartOffset$1(o,_);const _e=o.slice(_,$);return j&&assertEndOffset$1(_e,_,$),_e}function sliceHex(o,_,$,{strict:j}={}){assertStartOffset$1(o,_);const _e=`0x${o.replace("0x","").slice((_??0)*2,($??o.length)*2)}`;return j&&assertEndOffset$1(_e,_,$),_e}const arrayRegex$1=/^(.*)\[([0-9]*)\]$/,bytesRegex$1=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex$1=/^(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 encodeAbiParameters(o,_){if(o.length!==_.length)throw new AbiEncodingLengthMismatchError({expectedLength:o.length,givenLength:_.length});const $=prepareParams({params:o,values:_}),j=encodeParams($);return j.length===0?"0x":j}function prepareParams({params:o,values:_}){const $=[];for(let j=0;j0?concat$2([rt,tt]):rt}}if(_e)return{dynamic:!0,encoded:tt}}return{dynamic:!1,encoded:concat$2(et.map(({encoded:tt})=>tt))}}function encodeBytes$1(o,{param:_}){const[,$]=_.type.split("bytes"),j=size$3(o);if(!$){let _e=o;return j%32!==0&&(_e=padHex(_e,{dir:"right",size:Math.ceil((o.length-2)/2/32)*32})),{dynamic:!0,encoded:concat$2([padHex(numberToHex(j,{size:32})),_e])}}if(j!==Number.parseInt($,10))throw new AbiEncodingBytesSizeMismatchError({expectedSize:Number.parseInt($,10),value:o});return{dynamic:!1,encoded:padHex(o,{dir:"right"})}}function encodeBool(o){if(typeof o!="boolean")throw new BaseError$1(`Invalid boolean value: "${o}" (type: ${typeof o}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padHex(boolToHex(o))}}function encodeNumber$1(o,{signed:_,size:$=256}){if(typeof $=="number"){const j=2n**(BigInt($)-(_?1n:0n))-1n,_e=_?-j-1n:0n;if(o>j||o<_e)throw new IntegerOutOfRangeError$1({max:j.toString(),min:_e.toString(),signed:_,size:$/8,value:o.toString()})}return{dynamic:!1,encoded:numberToHex(o,{size:32,signed:_})}}function encodeString$1(o){const _=stringToHex(o),$=Math.ceil(size$3(_)/32),j=[];for(let _e=0;_e<$;_e++)j.push(padHex(slice$4(_,_e*32,(_e+1)*32),{dir:"right"}));return{dynamic:!0,encoded:concat$2([padHex(numberToHex(size$3(_),{size:32})),...j])}}function encodeTuple$1(o,{param:_}){let $=!1;const j=[];for(let _e=0;_e<_.components.length;_e++){const et=_.components[_e],tt=Array.isArray(o)?_e:et.name,rt=prepareParam({param:et,value:o[tt]});j.push(rt),rt.dynamic&&($=!0)}return{dynamic:$,encoded:$?encodeParams(j):concat$2(j.map(({encoded:_e})=>_e))}}function getArrayComponents$1(o){const _=o.match(/^(.*)\[(\d+)?\]$/);return _?[_[2]?Number(_[2]):null,_[1]]:void 0}const toFunctionSelector=o=>slice$4(toSignatureHash(o),0,4);function getAbiItem(o){const{abi:_,args:$=[],name:j}=o,_e=isHex(j,{strict:!1}),et=_.filter(rt=>_e?rt.type==="function"?toFunctionSelector(rt)===j:rt.type==="event"?toEventSelector(rt)===j:!1:"name"in rt&&rt.name===j);if(et.length===0)return;if(et.length===1)return et[0];let tt;for(const rt of et){if(!("inputs"in rt))continue;if(!$||$.length===0){if(!rt.inputs||rt.inputs.length===0)return rt;continue}if(!rt.inputs||rt.inputs.length===0||rt.inputs.length!==$.length)continue;if($.every((ot,it)=>{const st="inputs"in rt&&rt.inputs[it];return st?isArgOfType$1(ot,st):!1})){if(tt&&"inputs"in tt&&tt.inputs){const ot=getAmbiguousTypes$1(rt.inputs,tt.inputs,$);if(ot)throw new AbiItemAmbiguityError({abiItem:rt,type:ot[0]},{abiItem:tt,type:ot[1]})}tt=rt}}return tt||et[0]}function isArgOfType$1(o,_){const $=typeof o,j=_.type;switch(j){case"address":return isAddress(o,{strict:!1});case"bool":return $==="boolean";case"function":return $==="string";case"string":return $==="string";default:return j==="tuple"&&"components"in _?Object.values(_.components).every((_e,et)=>$==="object"&&isArgOfType$1(Object.values(o)[et],_e)):/^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(j)?$==="number"||$==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(j)?$==="string"||o instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(j)?Array.isArray(o)&&o.every(_e=>isArgOfType$1(_e,{..._,type:j.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes$1(o,_,$){for(const j in o){const _e=o[j],et=_[j];if(_e.type==="tuple"&&et.type==="tuple"&&"components"in _e&&"components"in et)return getAmbiguousTypes$1(_e.components,et.components,$[j]);const tt=[_e.type,et.type];if(tt.includes("address")&&tt.includes("bytes20")?!0:tt.includes("address")&&tt.includes("string")?isAddress($[j],{strict:!1}):tt.includes("address")&&tt.includes("bytes")?isAddress($[j],{strict:!1}):!1)return tt}}const docsPath$6="/docs/contract/encodeEventTopics";function encodeEventTopics(o){var nt;const{abi:_,eventName:$,args:j}=o;let _e=_[0];if($){const ot=getAbiItem({abi:_,name:$});if(!ot)throw new AbiEventNotFoundError($,{docsPath:docsPath$6});_e=ot}if(_e.type!=="event")throw new AbiEventNotFoundError(void 0,{docsPath:docsPath$6});const et=formatAbiItem(_e),tt=toEventSelector(et);let rt=[];if(j&&"inputs"in _e){const ot=(nt=_e.inputs)==null?void 0:nt.filter(st=>"indexed"in st&&st.indexed),it=Array.isArray(j)?j:Object.values(j).length>0?(ot==null?void 0:ot.map(st=>j[st.name]))??[]:[];it.length>0&&(rt=(ot==null?void 0:ot.map((st,at)=>Array.isArray(it[at])?it[at].map((lt,ct)=>encodeArg({param:st,value:it[at][ct]})):typeof it[at]<"u"&&it[at]!==null?encodeArg({param:st,value:it[at]}):null))??[])}return[tt,...rt]}function encodeArg({param:o,value:_}){if(o.type==="string"||o.type==="bytes")return keccak256$4(toBytes$5(_));if(o.type==="tuple"||o.type.match(/^(.*)\[(\d+)?\]$/))throw new FilterTypeNotSupportedError(o.type);return encodeAbiParameters([o],[_])}function createFilterRequestScope(o,{method:_}){var j,_e;const $={};return o.transport.type==="fallback"&&((_e=(j=o.transport).onResponse)==null||_e.call(j,({method:et,response:tt,status:rt,transport:nt})=>{rt==="success"&&_===et&&($[tt]=nt.request)})),et=>$[et]||o.request}async function createContractEventFilter(o,_){const{address:$,abi:j,args:_e,eventName:et,fromBlock:tt,strict:rt,toBlock:nt}=_,ot=createFilterRequestScope(o,{method:"eth_newFilter"}),it=et?encodeEventTopics({abi:j,args:_e,eventName:et}):void 0,st=await o.request({method:"eth_newFilter",params:[{address:$,fromBlock:typeof tt=="bigint"?numberToHex(tt):tt,toBlock:typeof nt=="bigint"?numberToHex(nt):nt,topics:it}]});return{abi:j,args:_e,eventName:et,id:st,request:ot(st),strict:!!rt,type:"event"}}function parseAccount(o){return typeof o=="string"?{address:o,type:"json-rpc"}:o}const docsPath$5="/docs/contract/encodeFunctionData";function prepareEncodeFunctionData(o){const{abi:_,args:$,functionName:j}=o;let _e=_[0];if(j){const et=getAbiItem({abi:_,args:$,name:j});if(!et)throw new AbiFunctionNotFoundError(j,{docsPath:docsPath$5});_e=et}if(_e.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$5});return{abi:[_e],functionName:toFunctionSelector(formatAbiItem(_e))}}function encodeFunctionData(o){const{args:_}=o,{abi:$,functionName:j}=(()=>{var rt;return o.abi.length===1&&((rt=o.functionName)!=null&&rt.startsWith("0x"))?o:prepareEncodeFunctionData(o)})(),_e=$[0],et=j,tt="inputs"in _e&&_e.inputs?encodeAbiParameters(_e.inputs,_??[]):void 0;return concatHex([et,tt??"0x"])}const panicReasons={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."},solidityError={inputs:[{name:"message",type:"string"}],name:"Error",type:"error"},solidityPanic={inputs:[{name:"reason",type:"uint256"}],name:"Panic",type:"error"};let NegativeOffsetError$1=class extends BaseError$1{constructor({offset:_}){super(`Offset \`${_}\` cannot be negative.`,{name:"NegativeOffsetError"})}},PositionOutOfBoundsError$1=class extends BaseError$1{constructor({length:_,position:$}){super(`Position \`${$}\` is out of bounds (\`0 < position < ${_}\`).`,{name:"PositionOutOfBoundsError"})}},RecursiveReadLimitExceededError$1=class extends BaseError$1{constructor({count:_,limit:$}){super(`Recursive read limit of \`${$}\` exceeded (recursive read count: \`${_}\`).`,{name:"RecursiveReadLimitExceededError"})}};const staticCursor$1={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 RecursiveReadLimitExceededError$1({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(o){if(o<0||o>this.bytes.length-1)throw new PositionOutOfBoundsError$1({length:this.bytes.length,position:o})},decrementPosition(o){if(o<0)throw new NegativeOffsetError$1({offset:o});const _=this.position-o;this.assertPosition(_),this.position=_},getReadCount(o){return this.positionReadCount.get(o||this.position)||0},incrementPosition(o){if(o<0)throw new NegativeOffsetError$1({offset:o});const _=this.position+o;this.assertPosition(_),this.position=_},inspectByte(o){const _=o??this.position;return this.assertPosition(_),this.bytes[_]},inspectBytes(o,_){const $=_??this.position;return this.assertPosition($+o-1),this.bytes.subarray($,$+o)},inspectUint8(o){const _=o??this.position;return this.assertPosition(_),this.bytes[_]},inspectUint16(o){const _=o??this.position;return this.assertPosition(_+1),this.dataView.getUint16(_)},inspectUint24(o){const _=o??this.position;return this.assertPosition(_+2),(this.dataView.getUint16(_)<<8)+this.dataView.getUint8(_+2)},inspectUint32(o){const _=o??this.position;return this.assertPosition(_+3),this.dataView.getUint32(_)},pushByte(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushBytes(o){this.assertPosition(this.position+o.length-1),this.bytes.set(o,this.position),this.position+=o.length},pushUint8(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushUint16(o){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,o),this.position+=2},pushUint24(o){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,o>>8),this.dataView.setUint8(this.position+2,o&255),this.position+=3},pushUint32(o){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,o),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const o=this.inspectByte();return this.position++,o},readBytes(o,_){this.assertReadLimit(),this._touch();const $=this.inspectBytes(o);return this.position+=_??o,$},readUint8(){this.assertReadLimit(),this._touch();const o=this.inspectUint8();return this.position+=1,o},readUint16(){this.assertReadLimit(),this._touch();const o=this.inspectUint16();return this.position+=2,o},readUint24(){this.assertReadLimit(),this._touch();const o=this.inspectUint24();return this.position+=3,o},readUint32(){this.assertReadLimit(),this._touch();const o=this.inspectUint32();return this.position+=4,o},get remaining(){return this.bytes.length-this.position},setPosition(o){const _=this.position;return this.assertPosition(o),this.position=o,()=>this.position=_},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const o=this.getReadCount();this.positionReadCount.set(this.position,o+1),o>0&&this.recursiveReadCount++}};function createCursor(o,{recursiveReadLimit:_=8192}={}){const $=Object.create(staticCursor$1);return $.bytes=o,$.dataView=new DataView(o.buffer??o,o.byteOffset,o.byteLength),$.positionReadCount=new Map,$.recursiveReadLimit=_,$}function bytesToBigInt$1(o,_={}){typeof _.size<"u"&&assertSize$2(o,{size:_.size});const $=bytesToHex$4(o,_);return hexToBigInt($,_)}function bytesToBool(o,_={}){let $=o;if(typeof _.size<"u"&&(assertSize$2($,{size:_.size}),$=trim$2($)),$.length>1||$[0]>1)throw new InvalidBytesBooleanError$1($);return!!$[0]}function bytesToNumber(o,_={}){typeof _.size<"u"&&assertSize$2(o,{size:_.size});const $=bytesToHex$4(o,_);return hexToNumber$3($,_)}function bytesToString(o,_={}){let $=o;return typeof _.size<"u"&&(assertSize$2($,{size:_.size}),$=trim$2($,{dir:"right"})),new TextDecoder().decode($)}function decodeAbiParameters(o,_){const $=typeof _=="string"?hexToBytes$4(_):_,j=createCursor($);if(size$3($)===0&&o.length>0)throw new AbiDecodingZeroDataError;if(size$3(_)&&size$3(_)<32)throw new AbiDecodingDataSizeTooSmallError({data:typeof _=="string"?_:bytesToHex$4(_),params:o,size:size$3(_)});let _e=0;const et=[];for(let tt=0;tt48?bytesToBigInt$1(_e,{signed:$}):bytesToNumber(_e,{signed:$}),32]}function decodeTuple$1(o,_,{staticPosition:$}){const j=_.components.length===0||_.components.some(({name:tt})=>!tt),_e=j?[]:{};let et=0;if(hasDynamicChild$1(_)){const tt=bytesToNumber(o.readBytes(sizeOfOffset$1)),rt=$+tt;for(let nt=0;nt<_.components.length;++nt){const ot=_.components[nt];o.setPosition(rt+et);const[it,st]=decodeParameter$1(o,ot,{staticPosition:rt});et+=st,_e[j?nt:ot==null?void 0:ot.name]=it}return o.setPosition($+32),[_e,32]}for(let tt=0;tt<_.components.length;++tt){const rt=_.components[tt],[nt,ot]=decodeParameter$1(o,rt,{staticPosition:$});_e[j?tt:rt==null?void 0:rt.name]=nt,et+=ot}return[_e,et]}function decodeString$1(o,{staticPosition:_}){const $=bytesToNumber(o.readBytes(32)),j=_+$;o.setPosition(j);const _e=bytesToNumber(o.readBytes(32));if(_e===0)return o.setPosition(_+32),["",32];const et=o.readBytes(_e,32),tt=bytesToString(trim$2(et));return o.setPosition(_+32),[tt,32]}function hasDynamicChild$1(o){var j;const{type:_}=o;if(_==="string"||_==="bytes"||_.endsWith("[]"))return!0;if(_==="tuple")return(j=o.components)==null?void 0:j.some(hasDynamicChild$1);const $=getArrayComponents$1(o.type);return!!($&&hasDynamicChild$1({...o,type:$[1]}))}function decodeErrorResult(o){const{abi:_,data:$}=o,j=slice$4($,0,4);if(j==="0x")throw new AbiDecodingZeroDataError;const et=[..._||[],solidityError,solidityPanic].find(tt=>tt.type==="error"&&j===toFunctionSelector(formatAbiItem(tt)));if(!et)throw new AbiErrorSignatureNotFoundError(j,{docsPath:"/docs/contract/decodeErrorResult"});return{abiItem:et,args:"inputs"in et&&et.inputs&&et.inputs.length>0?decodeAbiParameters(et.inputs,slice$4($,4)):void 0,errorName:et.name}}const stringify$5=(o,_,$)=>JSON.stringify(o,(j,_e)=>typeof _e=="bigint"?_e.toString():_e,$);function formatAbiItemWithArgs({abiItem:o,args:_,includeFunctionName:$=!0,includeName:j=!1}){if("name"in o&&"inputs"in o&&o.inputs)return`${$?o.name:""}(${o.inputs.map((_e,et)=>`${j&&_e.name?`${_e.name}: `:""}${typeof _[et]=="object"?stringify$5(_[et]):_[et]}`).join(", ")})`}const etherUnits={gwei:9,wei:18},gweiUnits={ether:-9,wei:9};function formatUnits(o,_){let $=o.toString();const j=$.startsWith("-");j&&($=$.slice(1)),$=$.padStart(_,"0");let[_e,et]=[$.slice(0,$.length-_),$.slice($.length-_)];return et=et.replace(/(0+)$/,""),`${j?"-":""}${_e||"0"}${et?`.${et}`:""}`}function formatEther(o,_="wei"){return formatUnits(o,etherUnits[_])}function formatGwei(o,_="wei"){return formatUnits(o,gweiUnits[_])}class AccountStateConflictError extends BaseError$1{constructor({address:_}){super(`State for account "${_}" is set multiple times.`,{name:"AccountStateConflictError"})}}class StateAssignmentConflictError extends BaseError$1{constructor(){super("state and stateDiff are set on the same account.",{name:"StateAssignmentConflictError"})}}function prettyStateMapping(o){return o.reduce((_,{slot:$,value:j})=>`${_} ${$}: ${j} -`,"")}function prettyStateOverride(o){return o.reduce((_,{address:$,...j})=>{let _e=`${_} ${$}: -`;return j.nonce&&(_e+=` nonce: ${j.nonce} -`),j.balance&&(_e+=` balance: ${j.balance} -`),j.code&&(_e+=` code: ${j.code} -`),j.state&&(_e+=` state: -`,_e+=prettyStateMapping(j.state)),j.stateDiff&&(_e+=` stateDiff: -`,_e+=prettyStateMapping(j.stateDiff)),_e},` State Override: -`).slice(0,-1)}function prettyPrint(o){const _=Object.entries(o).map(([j,_e])=>_e===void 0||_e===!1?null:[j,_e]).filter(Boolean),$=_.reduce((j,[_e])=>Math.max(j,_e.length),0);return _.map(([j,_e])=>` ${`${j}:`.padEnd($+1)} ${_e}`).join(` -`)}class InvalidSerializableTransactionError extends BaseError$1{constructor({transaction:_}){super("Cannot infer a transaction type from provided transaction.",{metaMessages:["Provided Transaction:","{",prettyPrint(_),"}","","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","- an EIP-7702 Transaction with `authorizationList`, or","- a Legacy Transaction with `gasPrice`"],name:"InvalidSerializableTransactionError"})}}class TransactionExecutionError extends BaseError$1{constructor(_,{account:$,docsPath:j,chain:_e,data:et,gas:tt,gasPrice:rt,maxFeePerGas:nt,maxPriorityFeePerGas:ot,nonce:it,to:st,value:at}){var ct;const lt=prettyPrint({chain:_e&&`${_e==null?void 0:_e.name} (id: ${_e==null?void 0:_e.id})`,from:$==null?void 0:$.address,to:st,value:typeof at<"u"&&`${formatEther(at)} ${((ct=_e==null?void 0:_e.nativeCurrency)==null?void 0:ct.symbol)||"ETH"}`,data:et,gas:tt,gasPrice:typeof rt<"u"&&`${formatGwei(rt)} gwei`,maxFeePerGas:typeof nt<"u"&&`${formatGwei(nt)} gwei`,maxPriorityFeePerGas:typeof ot<"u"&&`${formatGwei(ot)} gwei`,nonce:it});super(_.shortMessage,{cause:_,docsPath:j,metaMessages:[..._.metaMessages?[..._.metaMessages," "]:[],"Request Arguments:",lt].filter(Boolean),name:"TransactionExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=_}}class TransactionNotFoundError extends BaseError$1{constructor({blockHash:_,blockNumber:$,blockTag:j,hash:_e,index:et}){let tt="Transaction";j&&et!==void 0&&(tt=`Transaction at block time "${j}" at index "${et}"`),_&&et!==void 0&&(tt=`Transaction at block hash "${_}" at index "${et}"`),$&&et!==void 0&&(tt=`Transaction at block number "${$}" at index "${et}"`),_e&&(tt=`Transaction with hash "${_e}"`),super(`${tt} could not be found.`,{name:"TransactionNotFoundError"})}}class TransactionReceiptNotFoundError extends BaseError$1{constructor({hash:_}){super(`Transaction receipt with hash "${_}" could not be found. The Transaction may not be processed on a block yet.`,{name:"TransactionReceiptNotFoundError"})}}class TransactionReceiptRevertedError extends BaseError$1{constructor({receipt:_}){super(`Transaction with hash "${_.transactionHash}" reverted.`,{metaMessages:['The receipt marked the transaction as "reverted". This could mean that the function on the contract you are trying to call threw an error.'," ","You can attempt to extract the revert reason by:","- calling the `simulateContract` or `simulateCalls` Action with the `abi` and `functionName` of the contract","- using the `call` Action with raw `data`"],name:"TransactionReceiptRevertedError"}),Object.defineProperty(this,"receipt",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.receipt=_}}class WaitForTransactionReceiptTimeoutError extends BaseError$1{constructor({hash:_}){super(`Timed out while waiting for transaction with hash "${_}" to be confirmed.`,{name:"WaitForTransactionReceiptTimeoutError"})}}const getContractAddress=o=>o,getUrl=o=>o;class CallExecutionError extends BaseError$1{constructor(_,{account:$,docsPath:j,chain:_e,data:et,gas:tt,gasPrice:rt,maxFeePerGas:nt,maxPriorityFeePerGas:ot,nonce:it,to:st,value:at,stateOverride:lt}){var dt;const ct=$?parseAccount($):void 0;let ft=prettyPrint({from:ct==null?void 0:ct.address,to:st,value:typeof at<"u"&&`${formatEther(at)} ${((dt=_e==null?void 0:_e.nativeCurrency)==null?void 0:dt.symbol)||"ETH"}`,data:et,gas:tt,gasPrice:typeof rt<"u"&&`${formatGwei(rt)} gwei`,maxFeePerGas:typeof nt<"u"&&`${formatGwei(nt)} gwei`,maxPriorityFeePerGas:typeof ot<"u"&&`${formatGwei(ot)} gwei`,nonce:it});lt&&(ft+=` -${prettyStateOverride(lt)}`),super(_.shortMessage,{cause:_,docsPath:j,metaMessages:[..._.metaMessages?[..._.metaMessages," "]:[],"Raw Call Arguments:",ft].filter(Boolean),name:"CallExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=_}}class ContractFunctionExecutionError extends BaseError$1{constructor(_,{abi:$,args:j,contractAddress:_e,docsPath:et,functionName:tt,sender:rt}){const nt=getAbiItem({abi:$,args:j,name:tt}),ot=nt?formatAbiItemWithArgs({abiItem:nt,args:j,includeFunctionName:!1,includeName:!1}):void 0,it=nt?formatAbiItem(nt,{includeName:!0}):void 0,st=prettyPrint({address:_e&&getContractAddress(_e),function:it,args:ot&&ot!=="()"&&`${[...Array((tt==null?void 0:tt.length)??0).keys()].map(()=>" ").join("")}${ot}`,sender:rt});super(_.shortMessage||`An unknown error occurred while executing the contract function "${tt}".`,{cause:_,docsPath:et,metaMessages:[..._.metaMessages?[..._.metaMessages," "]:[],st&&"Contract Call:",st].filter(Boolean),name:"ContractFunctionExecutionError"}),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}),this.abi=$,this.args=j,this.cause=_,this.contractAddress=_e,this.functionName=tt,this.sender=rt}}class ContractFunctionRevertedError extends BaseError$1{constructor({abi:_,data:$,functionName:j,message:_e}){let et,tt,rt,nt;if($&&$!=="0x")try{tt=decodeErrorResult({abi:_,data:$});const{abiItem:it,errorName:st,args:at}=tt;if(st==="Error")nt=at[0];else if(st==="Panic"){const[lt]=at;nt=panicReasons[lt]}else{const lt=it?formatAbiItem(it,{includeName:!0}):void 0,ct=it&&at?formatAbiItemWithArgs({abiItem:it,args:at,includeFunctionName:!1,includeName:!1}):void 0;rt=[lt?`Error: ${lt}`:"",ct&&ct!=="()"?` ${[...Array((st==null?void 0:st.length)??0).keys()].map(()=>" ").join("")}${ct}`:""]}}catch(it){et=it}else _e&&(nt=_e);let ot;et instanceof AbiErrorSignatureNotFoundError&&(ot=et.signature,rt=[`Unable to decode signature "${ot}" 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://4byte.sourcify.dev/?q=${ot}.`]),super(nt&&nt!=="execution reverted"||ot?[`The contract function "${j}" reverted with the following ${ot?"signature":"reason"}:`,nt||ot].join(` -`):`The contract function "${j}" reverted.`,{cause:et,metaMessages:rt,name:"ContractFunctionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"raw",{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=tt,this.raw=$,this.reason=nt,this.signature=ot}}class ContractFunctionZeroDataError extends BaseError$1{constructor({functionName:_}){super(`The contract function "${_}" returned no data ("0x").`,{metaMessages:["This could be due to any of the following:",` - The contract does not have the function "${_}",`," - The parameters passed to the contract function may be invalid, or"," - The address is not a contract."],name:"ContractFunctionZeroDataError"})}}class CounterfactualDeploymentFailedError extends BaseError$1{constructor({factory:_}){super(`Deployment for counterfactual contract call failed${_?` for factory "${_}".`:""}`,{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."],name:"CounterfactualDeploymentFailedError"})}}class RawContractError extends BaseError$1{constructor({data:_,message:$}){super($||"",{name:"RawContractError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:3}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=_}}class HttpRequestError extends BaseError$1{constructor({body:_,cause:$,details:j,headers:_e,status:et,url:tt}){super("HTTP request failed.",{cause:$,details:j,metaMessages:[et&&`Status: ${et}`,`URL: ${getUrl(tt)}`,_&&`Request body: ${stringify$5(_)}`].filter(Boolean),name:"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=_,this.headers=_e,this.status=et,this.url=tt}}class RpcRequestError extends BaseError$1{constructor({body:_,error:$,url:j}){super("RPC Request failed.",{cause:$,details:$.message,metaMessages:[`URL: ${getUrl(j)}`,`Request body: ${stringify$5(_)}`],name:"RpcRequestError"}),Object.defineProperty(this,"code",{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,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.code=$.code,this.data=$.data,this.url=j}}class TimeoutError extends BaseError$1{constructor({body:_,url:$}){super("The request took too long to respond.",{details:"The request timed out.",metaMessages:[`URL: ${getUrl($)}`,`Request body: ${stringify$5(_)}`],name:"TimeoutError"}),Object.defineProperty(this,"url",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.url=$}}const unknownErrorCode=-1;class RpcError extends BaseError$1{constructor(_,{code:$,docsPath:j,metaMessages:_e,name:et,shortMessage:tt}){super(tt,{cause:_,docsPath:j,metaMessages:_e||(_==null?void 0:_.metaMessages),name:et||"RpcError"}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=et||_.name,this.code=_ instanceof RpcRequestError?_.code:$??unknownErrorCode}}class ProviderRpcError extends RpcError{constructor(_,$){super(_,$),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=$.data}}class ParseRpcError extends RpcError{constructor(_){super(_,{code:ParseRpcError.code,name:"ParseRpcError",shortMessage:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."})}}Object.defineProperty(ParseRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32700});class InvalidRequestRpcError extends RpcError{constructor(_){super(_,{code:InvalidRequestRpcError.code,name:"InvalidRequestRpcError",shortMessage:"JSON is not a valid request object."})}}Object.defineProperty(InvalidRequestRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32600});class MethodNotFoundRpcError extends RpcError{constructor(_,{method:$}={}){super(_,{code:MethodNotFoundRpcError.code,name:"MethodNotFoundRpcError",shortMessage:`The method${$?` "${$}"`:""} does not exist / is not available.`})}}Object.defineProperty(MethodNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32601});class InvalidParamsRpcError extends RpcError{constructor(_){super(_,{code:InvalidParamsRpcError.code,name:"InvalidParamsRpcError",shortMessage:["Invalid parameters were provided to the RPC method.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(InvalidParamsRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class InternalRpcError extends RpcError{constructor(_){super(_,{code:InternalRpcError.code,name:"InternalRpcError",shortMessage:"An internal error was received."})}}Object.defineProperty(InternalRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32603});class InvalidInputRpcError extends RpcError{constructor(_){super(_,{code:InvalidInputRpcError.code,name:"InvalidInputRpcError",shortMessage:["Missing or invalid parameters.","Double check you have provided the correct parameters."].join(` -`)})}}Object.defineProperty(InvalidInputRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32e3});class ResourceNotFoundRpcError extends RpcError{constructor(_){super(_,{code:ResourceNotFoundRpcError.code,name:"ResourceNotFoundRpcError",shortMessage:"Requested resource not found."}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"ResourceNotFoundRpcError"})}}Object.defineProperty(ResourceNotFoundRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32001});class ResourceUnavailableRpcError extends RpcError{constructor(_){super(_,{code:ResourceUnavailableRpcError.code,name:"ResourceUnavailableRpcError",shortMessage:"Requested resource not available."})}}Object.defineProperty(ResourceUnavailableRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32002});class TransactionRejectedRpcError extends RpcError{constructor(_){super(_,{code:TransactionRejectedRpcError.code,name:"TransactionRejectedRpcError",shortMessage:"Transaction creation failed."})}}Object.defineProperty(TransactionRejectedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32003});class MethodNotSupportedRpcError extends RpcError{constructor(_,{method:$}={}){super(_,{code:MethodNotSupportedRpcError.code,name:"MethodNotSupportedRpcError",shortMessage:`Method${$?` "${$}"`:""} is not supported.`})}}Object.defineProperty(MethodNotSupportedRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32004});class LimitExceededRpcError extends RpcError{constructor(_){super(_,{code:LimitExceededRpcError.code,name:"LimitExceededRpcError",shortMessage:"Request exceeds defined limit."})}}Object.defineProperty(LimitExceededRpcError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32005});class JsonRpcVersionUnsupportedError extends RpcError{constructor(_){super(_,{code:JsonRpcVersionUnsupportedError.code,name:"JsonRpcVersionUnsupportedError",shortMessage:"Version of JSON-RPC protocol is not supported."})}}Object.defineProperty(JsonRpcVersionUnsupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32006});class UserRejectedRequestError extends ProviderRpcError{constructor(_){super(_,{code:UserRejectedRequestError.code,name:"UserRejectedRequestError",shortMessage:"User rejected the request."})}}Object.defineProperty(UserRejectedRequestError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4001});class UnauthorizedProviderError extends ProviderRpcError{constructor(_){super(_,{code:UnauthorizedProviderError.code,name:"UnauthorizedProviderError",shortMessage:"The requested method and/or account has not been authorized by the user."})}}Object.defineProperty(UnauthorizedProviderError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4100});class UnsupportedProviderMethodError extends ProviderRpcError{constructor(_,{method:$}={}){super(_,{code:UnsupportedProviderMethodError.code,name:"UnsupportedProviderMethodError",shortMessage:`The Provider does not support the requested method${$?` " ${$}"`:""}.`})}}Object.defineProperty(UnsupportedProviderMethodError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4200});class ProviderDisconnectedError extends ProviderRpcError{constructor(_){super(_,{code:ProviderDisconnectedError.code,name:"ProviderDisconnectedError",shortMessage:"The Provider is disconnected from all chains."})}}Object.defineProperty(ProviderDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4900});class ChainDisconnectedError extends ProviderRpcError{constructor(_){super(_,{code:ChainDisconnectedError.code,name:"ChainDisconnectedError",shortMessage:"The Provider is not connected to the requested chain."})}}Object.defineProperty(ChainDisconnectedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4901});class SwitchChainError extends ProviderRpcError{constructor(_){super(_,{code:SwitchChainError.code,name:"SwitchChainError",shortMessage:"An error occurred when attempting to switch chain."})}}Object.defineProperty(SwitchChainError,"code",{enumerable:!0,configurable:!0,writable:!0,value:4902});class UnsupportedNonOptionalCapabilityError extends ProviderRpcError{constructor(_){super(_,{code:UnsupportedNonOptionalCapabilityError.code,name:"UnsupportedNonOptionalCapabilityError",shortMessage:"This Wallet does not support a capability that was not marked as optional."})}}Object.defineProperty(UnsupportedNonOptionalCapabilityError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5700});class UnsupportedChainIdError extends ProviderRpcError{constructor(_){super(_,{code:UnsupportedChainIdError.code,name:"UnsupportedChainIdError",shortMessage:"This Wallet does not support the requested chain ID."})}}Object.defineProperty(UnsupportedChainIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5710});class DuplicateIdError extends ProviderRpcError{constructor(_){super(_,{code:DuplicateIdError.code,name:"DuplicateIdError",shortMessage:"There is already a bundle submitted with this ID."})}}Object.defineProperty(DuplicateIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5720});class UnknownBundleIdError extends ProviderRpcError{constructor(_){super(_,{code:UnknownBundleIdError.code,name:"UnknownBundleIdError",shortMessage:"This bundle id is unknown / has not been submitted"})}}Object.defineProperty(UnknownBundleIdError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5730});class BundleTooLargeError extends ProviderRpcError{constructor(_){super(_,{code:BundleTooLargeError.code,name:"BundleTooLargeError",shortMessage:"The call bundle is too large for the Wallet to process."})}}Object.defineProperty(BundleTooLargeError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5740});class AtomicReadyWalletRejectedUpgradeError extends ProviderRpcError{constructor(_){super(_,{code:AtomicReadyWalletRejectedUpgradeError.code,name:"AtomicReadyWalletRejectedUpgradeError",shortMessage:"The Wallet can support atomicity after an upgrade, but the user rejected the upgrade."})}}Object.defineProperty(AtomicReadyWalletRejectedUpgradeError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5750});class AtomicityNotSupportedError extends ProviderRpcError{constructor(_){super(_,{code:AtomicityNotSupportedError.code,name:"AtomicityNotSupportedError",shortMessage:"The wallet does not support atomic execution but the request requires it."})}}Object.defineProperty(AtomicityNotSupportedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:5760});class UnknownRpcError extends RpcError{constructor(_){super(_,{name:"UnknownRpcError",shortMessage:"An unknown RPC error occurred."})}}const EXECUTION_REVERTED_ERROR_CODE=3;function getContractError(o,{abi:_,address:$,args:j,docsPath:_e,functionName:et,sender:tt}){const rt=o instanceof RawContractError?o:o instanceof BaseError$1?o.walk(ct=>"data"in ct)||o.walk():{},{code:nt,data:ot,details:it,message:st,shortMessage:at}=rt,lt=o instanceof AbiDecodingZeroDataError?new ContractFunctionZeroDataError({functionName:et}):[EXECUTION_REVERTED_ERROR_CODE,InternalRpcError.code].includes(nt)&&(ot||it||st||at)||nt===InvalidInputRpcError.code&&it==="execution reverted"&&ot?new ContractFunctionRevertedError({abi:_,data:typeof ot=="object"?ot.data:ot,functionName:et,message:rt instanceof RpcRequestError?it:at??st}):o;return new ContractFunctionExecutionError(lt,{abi:_,args:j,contractAddress:$,docsPath:_e,functionName:et,sender:tt})}function publicKeyToAddress(o){const _=keccak256$4(`0x${o.substring(4)}`).substring(26);return checksumAddress(`0x${_}`)}const scriptRel="modulepreload",assetsURL=function(o){return"/"+o},seen={},__vitePreload=function(_,$,j){let _e=Promise.resolve();if($&&$.length>0){document.getElementsByTagName("link");const tt=document.querySelector("meta[property=csp-nonce]"),rt=(tt==null?void 0:tt.nonce)||(tt==null?void 0:tt.getAttribute("nonce"));_e=Promise.allSettled($.map(nt=>{if(nt=assetsURL(nt),nt in seen)return;seen[nt]=!0;const ot=nt.endsWith(".css"),it=ot?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${nt}"]${it}`))return;const st=document.createElement("link");if(st.rel=ot?"stylesheet":scriptRel,ot||(st.as="script"),st.crossOrigin="",st.href=nt,rt&&st.setAttribute("nonce",rt),document.head.appendChild(st),ot)return new Promise((at,lt)=>{st.addEventListener("load",at),st.addEventListener("error",()=>lt(new Error(`Unable to preload CSS for ${nt}`)))})}))}function et(tt){const rt=new Event("vite:preloadError",{cancelable:!0});if(rt.payload=tt,window.dispatchEvent(rt),!rt.defaultPrevented)throw tt}return _e.then(tt=>{for(const rt of tt||[])rt.status==="rejected"&&et(rt.reason);return _().catch(et)})};async function recoverPublicKey({hash:o,signature:_}){const $=isHex(o)?o:toHex$1(o),{secp256k1:j}=await __vitePreload(async()=>{const{secp256k1:tt}=await Promise.resolve().then(()=>secp256k1$4);return{secp256k1:tt}},void 0);return`0x${(()=>{if(typeof _=="object"&&"r"in _&&"s"in _){const{r:ot,s:it,v:st,yParity:at}=_,lt=Number(at??st),ct=toRecoveryBit(lt);return new j.Signature(hexToBigInt(ot),hexToBigInt(it)).addRecoveryBit(ct)}const tt=isHex(_)?_:toHex$1(_);if(size$3(tt)!==65)throw new Error("invalid signature length");const rt=hexToNumber$3(`0x${tt.slice(130)}`),nt=toRecoveryBit(rt);return j.Signature.fromCompact(tt.substring(2,130)).addRecoveryBit(nt)})().recoverPublicKey($.substring(2)).toHex(!1)}`}function toRecoveryBit(o){if(o===0||o===1)return o;if(o===27)return 0;if(o===28)return 1;throw new Error("Invalid yParityOrV value")}async function recoverAddress({hash:o,signature:_}){return publicKeyToAddress(await recoverPublicKey({hash:o,signature:_}))}function toRlp(o,_="hex"){const $=getEncodable(o),j=createCursor(new Uint8Array($.length));return $.encode(j),_==="hex"?bytesToHex$4(j.bytes):j.bytes}function getEncodable(o){return Array.isArray(o)?getEncodableList(o.map(_=>getEncodable(_))):getEncodableBytes(o)}function getEncodableList(o){const _=o.reduce((_e,et)=>_e+et.length,0),$=getSizeOfLength(_);return{length:_<=55?1+_:1+$+_,encode(_e){_<=55?_e.pushByte(192+_):(_e.pushByte(247+$),$===1?_e.pushUint8(_):$===2?_e.pushUint16(_):$===3?_e.pushUint24(_):_e.pushUint32(_));for(const{encode:et}of o)et(_e)}}}function getEncodableBytes(o){const _=typeof o=="string"?hexToBytes$4(o):o,$=getSizeOfLength(_.length);return{length:_.length===1&&_[0]<128?1:_.length<=55?1+_.length:1+$+_.length,encode(_e){_.length===1&&_[0]<128?_e.pushBytes(_):_.length<=55?(_e.pushByte(128+_.length),_e.pushBytes(_)):(_e.pushByte(183+$),$===1?_e.pushUint8(_.length):$===2?_e.pushUint16(_.length):$===3?_e.pushUint24(_.length):_e.pushUint32(_.length),_e.pushBytes(_))}}}function getSizeOfLength(o){if(o<2**8)return 1;if(o<2**16)return 2;if(o<2**24)return 3;if(o<2**32)return 4;throw new BaseError$1("Length is too large.")}function hashAuthorization(o){const{chainId:_,nonce:$,to:j}=o,_e=o.contractAddress??o.address,et=keccak256$4(concatHex(["0x05",toRlp([_?numberToHex(_):"0x",_e,$?numberToHex($):"0x"])]));return j==="bytes"?hexToBytes$4(et):et}async function recoverAuthorizationAddress(o){const{authorization:_,signature:$}=o;return recoverAddress({hash:hashAuthorization(_),signature:$??_})}class EstimateGasExecutionError extends BaseError$1{constructor(_,{account:$,docsPath:j,chain:_e,data:et,gas:tt,gasPrice:rt,maxFeePerGas:nt,maxPriorityFeePerGas:ot,nonce:it,to:st,value:at}){var ct;const lt=prettyPrint({from:$==null?void 0:$.address,to:st,value:typeof at<"u"&&`${formatEther(at)} ${((ct=_e==null?void 0:_e.nativeCurrency)==null?void 0:ct.symbol)||"ETH"}`,data:et,gas:tt,gasPrice:typeof rt<"u"&&`${formatGwei(rt)} gwei`,maxFeePerGas:typeof nt<"u"&&`${formatGwei(nt)} gwei`,maxPriorityFeePerGas:typeof ot<"u"&&`${formatGwei(ot)} gwei`,nonce:it});super(_.shortMessage,{cause:_,docsPath:j,metaMessages:[..._.metaMessages?[..._.metaMessages," "]:[],"Estimate Gas Arguments:",lt].filter(Boolean),name:"EstimateGasExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=_}}class ExecutionRevertedError extends BaseError$1{constructor({cause:_,message:$}={}){var _e;const j=(_e=$==null?void 0:$.replace("execution reverted: ",""))==null?void 0:_e.replace("execution reverted","");super(`Execution reverted ${j?`with reason: ${j}`:"for an unknown reason"}.`,{cause:_,name:"ExecutionRevertedError"})}}Object.defineProperty(ExecutionRevertedError,"code",{enumerable:!0,configurable:!0,writable:!0,value:3});Object.defineProperty(ExecutionRevertedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted|gas required exceeds allowance/});class FeeCapTooHighError extends BaseError$1{constructor({cause:_,maxFeePerGas:$}={}){super(`The fee cap (\`maxFeePerGas\`${$?` = ${formatGwei($)} gwei`:""}) cannot be higher than the maximum allowed value (2^256-1).`,{cause:_,name:"FeeCapTooHighError"})}}Object.defineProperty(FeeCapTooHighError,"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 FeeCapTooLowError extends BaseError$1{constructor({cause:_,maxFeePerGas:$}={}){super(`The fee cap (\`maxFeePerGas\`${$?` = ${formatGwei($)}`:""} gwei) cannot be lower than the block base fee.`,{cause:_,name:"FeeCapTooLowError"})}}Object.defineProperty(FeeCapTooLowError,"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 NonceTooHighError extends BaseError$1{constructor({cause:_,nonce:$}={}){super(`Nonce provided for the transaction ${$?`(${$}) `:""}is higher than the next one expected.`,{cause:_,name:"NonceTooHighError"})}}Object.defineProperty(NonceTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too high/});class NonceTooLowError extends BaseError$1{constructor({cause:_,nonce:$}={}){super([`Nonce provided for the transaction ${$?`(${$}) `:""}is lower than the current nonce of the account.`,"Try increasing the nonce or find the latest nonce with `getTransactionCount`."].join(` -`),{cause:_,name:"NonceTooLowError"})}}Object.defineProperty(NonceTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce too low|transaction already imported|already known/});class NonceMaxValueError extends BaseError$1{constructor({cause:_,nonce:$}={}){super(`Nonce provided for the transaction ${$?`(${$}) `:""}exceeds the maximum allowed nonce.`,{cause:_,name:"NonceMaxValueError"})}}Object.defineProperty(NonceMaxValueError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/nonce has max value/});class InsufficientFundsError extends BaseError$1{constructor({cause:_}={}){super(["The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account."].join(` -`),{cause:_,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."],name:"InsufficientFundsError"})}}Object.defineProperty(InsufficientFundsError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/insufficient funds|exceeds transaction sender account balance/});class IntrinsicGasTooHighError extends BaseError$1{constructor({cause:_,gas:$}={}){super(`The amount of gas ${$?`(${$}) `:""}provided for the transaction exceeds the limit allowed for the block.`,{cause:_,name:"IntrinsicGasTooHighError"})}}Object.defineProperty(IntrinsicGasTooHighError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too high|gas limit reached/});class IntrinsicGasTooLowError extends BaseError$1{constructor({cause:_,gas:$}={}){super(`The amount of gas ${$?`(${$}) `:""}provided for the transaction is too low.`,{cause:_,name:"IntrinsicGasTooLowError"})}}Object.defineProperty(IntrinsicGasTooLowError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/intrinsic gas too low/});class TransactionTypeNotSupportedError extends BaseError$1{constructor({cause:_}){super("The transaction type is not supported for this chain.",{cause:_,name:"TransactionTypeNotSupportedError"})}}Object.defineProperty(TransactionTypeNotSupportedError,"nodeMessage",{enumerable:!0,configurable:!0,writable:!0,value:/transaction type not valid/});class TipAboveFeeCapError extends BaseError$1{constructor({cause:_,maxPriorityFeePerGas:$,maxFeePerGas:j}={}){super([`The provided tip (\`maxPriorityFeePerGas\`${$?` = ${formatGwei($)} gwei`:""}) cannot be higher than the fee cap (\`maxFeePerGas\`${j?` = ${formatGwei(j)} gwei`:""}).`].join(` -`),{cause:_,name:"TipAboveFeeCapError"})}}Object.defineProperty(TipAboveFeeCapError,"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 UnknownNodeError extends BaseError$1{constructor({cause:_}){super(`An error occurred while executing: ${_==null?void 0:_.shortMessage}`,{cause:_,name:"UnknownNodeError"})}}function getNodeError(o,_){const $=(o.details||"").toLowerCase(),j=o instanceof BaseError$1?o.walk(_e=>(_e==null?void 0:_e.code)===ExecutionRevertedError.code):o;return j instanceof BaseError$1?new ExecutionRevertedError({cause:o,message:j.details}):ExecutionRevertedError.nodeMessage.test($)?new ExecutionRevertedError({cause:o,message:o.details}):FeeCapTooHighError.nodeMessage.test($)?new FeeCapTooHighError({cause:o,maxFeePerGas:_==null?void 0:_.maxFeePerGas}):FeeCapTooLowError.nodeMessage.test($)?new FeeCapTooLowError({cause:o,maxFeePerGas:_==null?void 0:_.maxFeePerGas}):NonceTooHighError.nodeMessage.test($)?new NonceTooHighError({cause:o,nonce:_==null?void 0:_.nonce}):NonceTooLowError.nodeMessage.test($)?new NonceTooLowError({cause:o,nonce:_==null?void 0:_.nonce}):NonceMaxValueError.nodeMessage.test($)?new NonceMaxValueError({cause:o,nonce:_==null?void 0:_.nonce}):InsufficientFundsError.nodeMessage.test($)?new InsufficientFundsError({cause:o}):IntrinsicGasTooHighError.nodeMessage.test($)?new IntrinsicGasTooHighError({cause:o,gas:_==null?void 0:_.gas}):IntrinsicGasTooLowError.nodeMessage.test($)?new IntrinsicGasTooLowError({cause:o,gas:_==null?void 0:_.gas}):TransactionTypeNotSupportedError.nodeMessage.test($)?new TransactionTypeNotSupportedError({cause:o}):TipAboveFeeCapError.nodeMessage.test($)?new TipAboveFeeCapError({cause:o,maxFeePerGas:_==null?void 0:_.maxFeePerGas,maxPriorityFeePerGas:_==null?void 0:_.maxPriorityFeePerGas}):new UnknownNodeError({cause:o})}function getEstimateGasError(o,{docsPath:_,...$}){const j=(()=>{const _e=getNodeError(o,$);return _e instanceof UnknownNodeError?o:_e})();return new EstimateGasExecutionError(j,{docsPath:_,...$})}function extract$1(o,{format:_}){if(!_)return{};const $={};function j(et){const tt=Object.keys(et);for(const rt of tt)rt in o&&($[rt]=o[rt]),et[rt]&&typeof et[rt]=="object"&&!Array.isArray(et[rt])&&j(et[rt])}const _e=_(o||{});return j(_e),$}const rpcTransactionType={legacy:"0x0",eip2930:"0x1",eip1559:"0x2",eip4844:"0x3",eip7702:"0x4"};function formatTransactionRequest(o,_){const $={};return typeof o.authorizationList<"u"&&($.authorizationList=formatAuthorizationList$1(o.authorizationList)),typeof o.accessList<"u"&&($.accessList=o.accessList),typeof o.blobVersionedHashes<"u"&&($.blobVersionedHashes=o.blobVersionedHashes),typeof o.blobs<"u"&&(typeof o.blobs[0]!="string"?$.blobs=o.blobs.map(j=>bytesToHex$4(j)):$.blobs=o.blobs),typeof o.data<"u"&&($.data=o.data),o.account&&($.from=o.account.address),typeof o.from<"u"&&($.from=o.from),typeof o.gas<"u"&&($.gas=numberToHex(o.gas)),typeof o.gasPrice<"u"&&($.gasPrice=numberToHex(o.gasPrice)),typeof o.maxFeePerBlobGas<"u"&&($.maxFeePerBlobGas=numberToHex(o.maxFeePerBlobGas)),typeof o.maxFeePerGas<"u"&&($.maxFeePerGas=numberToHex(o.maxFeePerGas)),typeof o.maxPriorityFeePerGas<"u"&&($.maxPriorityFeePerGas=numberToHex(o.maxPriorityFeePerGas)),typeof o.nonce<"u"&&($.nonce=numberToHex(o.nonce)),typeof o.to<"u"&&($.to=o.to),typeof o.type<"u"&&($.type=rpcTransactionType[o.type]),typeof o.value<"u"&&($.value=numberToHex(o.value)),$}function formatAuthorizationList$1(o){return o.map(_=>({address:_.address,r:_.r?numberToHex(BigInt(_.r)):_.r,s:_.s?numberToHex(BigInt(_.s)):_.s,chainId:numberToHex(_.chainId),nonce:numberToHex(_.nonce),...typeof _.yParity<"u"?{yParity:numberToHex(_.yParity)}:{},...typeof _.v<"u"&&typeof _.yParity>"u"?{v:numberToHex(_.v)}:{}}))}function serializeStateMapping(o){if(!(!o||o.length===0))return o.reduce((_,{slot:$,value:j})=>{if($.length!==66)throw new InvalidBytesLengthError({size:$.length,targetSize:66,type:"hex"});if(j.length!==66)throw new InvalidBytesLengthError({size:j.length,targetSize:66,type:"hex"});return _[$]=j,_},{})}function serializeAccountStateOverride(o){const{balance:_,nonce:$,state:j,stateDiff:_e,code:et}=o,tt={};if(et!==void 0&&(tt.code=et),_!==void 0&&(tt.balance=numberToHex(_)),$!==void 0&&(tt.nonce=numberToHex($)),j!==void 0&&(tt.state=serializeStateMapping(j)),_e!==void 0){if(tt.state)throw new StateAssignmentConflictError;tt.stateDiff=serializeStateMapping(_e)}return tt}function serializeStateOverride(o){if(!o)return;const _={};for(const{address:$,...j}of o){if(!isAddress($,{strict:!1}))throw new InvalidAddressError$1({address:$});if(_[$])throw new AccountStateConflictError({address:$});_[$]=serializeAccountStateOverride(j)}return _}const maxUint16=2n**16n-1n,maxUint192=2n**192n-1n,maxUint256$1=2n**256n-1n;function assertRequest(o){const{account:_,maxFeePerGas:$,maxPriorityFeePerGas:j,to:_e}=o,et=_?parseAccount(_):void 0;if(et&&!isAddress(et.address))throw new InvalidAddressError$1({address:et.address});if(_e&&!isAddress(_e))throw new InvalidAddressError$1({address:_e});if($&&$>maxUint256$1)throw new FeeCapTooHighError({maxFeePerGas:$});if(j&&$&&j>$)throw new TipAboveFeeCapError({maxFeePerGas:$,maxPriorityFeePerGas:j})}class BaseFeeScalarError extends BaseError$1{constructor(){super("`baseFeeMultiplier` must be greater than 1.",{name:"BaseFeeScalarError"})}}class Eip1559FeesNotSupportedError extends BaseError$1{constructor(){super("Chain does not support EIP-1559 fees.",{name:"Eip1559FeesNotSupportedError"})}}class MaxFeePerGasTooLowError extends BaseError$1{constructor({maxPriorityFeePerGas:_}){super(`\`maxFeePerGas\` cannot be less than the \`maxPriorityFeePerGas\` (${formatGwei(_)} gwei).`,{name:"MaxFeePerGasTooLowError"})}}class BlockNotFoundError extends BaseError$1{constructor({blockHash:_,blockNumber:$}){let j="Block";_&&(j=`Block at hash "${_}"`),$&&(j=`Block at number "${$}"`),super(`${j} could not be found.`,{name:"BlockNotFoundError"})}}const transactionType={"0x0":"legacy","0x1":"eip2930","0x2":"eip1559","0x3":"eip4844","0x4":"eip7702"};function formatTransaction(o,_){const $={...o,blockHash:o.blockHash?o.blockHash:null,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,chainId:o.chainId?hexToNumber$3(o.chainId):void 0,gas:o.gas?BigInt(o.gas):void 0,gasPrice:o.gasPrice?BigInt(o.gasPrice):void 0,maxFeePerBlobGas:o.maxFeePerBlobGas?BigInt(o.maxFeePerBlobGas):void 0,maxFeePerGas:o.maxFeePerGas?BigInt(o.maxFeePerGas):void 0,maxPriorityFeePerGas:o.maxPriorityFeePerGas?BigInt(o.maxPriorityFeePerGas):void 0,nonce:o.nonce?hexToNumber$3(o.nonce):void 0,to:o.to?o.to:null,transactionIndex:o.transactionIndex?Number(o.transactionIndex):null,type:o.type?transactionType[o.type]:void 0,typeHex:o.type?o.type:void 0,value:o.value?BigInt(o.value):void 0,v:o.v?BigInt(o.v):void 0};return o.authorizationList&&($.authorizationList=formatAuthorizationList(o.authorizationList)),$.yParity=(()=>{if(o.yParity)return Number(o.yParity);if(typeof $.v=="bigint"){if($.v===0n||$.v===27n)return 0;if($.v===1n||$.v===28n)return 1;if($.v>=35n)return $.v%2n===0n?1:0}})(),$.type==="legacy"&&(delete $.accessList,delete $.maxFeePerBlobGas,delete $.maxFeePerGas,delete $.maxPriorityFeePerGas,delete $.yParity),$.type==="eip2930"&&(delete $.maxFeePerBlobGas,delete $.maxFeePerGas,delete $.maxPriorityFeePerGas),$.type==="eip1559"&&delete $.maxFeePerBlobGas,$}function formatAuthorizationList(o){return o.map(_=>({address:_.address,chainId:Number(_.chainId),nonce:Number(_.nonce),r:_.r,s:_.s,yParity:Number(_.yParity)}))}function formatBlock(o,_){const $=(o.transactions??[]).map(j=>typeof j=="string"?j:formatTransaction(j));return{...o,baseFeePerGas:o.baseFeePerGas?BigInt(o.baseFeePerGas):null,blobGasUsed:o.blobGasUsed?BigInt(o.blobGasUsed):void 0,difficulty:o.difficulty?BigInt(o.difficulty):void 0,excessBlobGas:o.excessBlobGas?BigInt(o.excessBlobGas):void 0,gasLimit:o.gasLimit?BigInt(o.gasLimit):void 0,gasUsed:o.gasUsed?BigInt(o.gasUsed):void 0,hash:o.hash?o.hash:null,logsBloom:o.logsBloom?o.logsBloom:null,nonce:o.nonce?o.nonce:null,number:o.number?BigInt(o.number):null,size:o.size?BigInt(o.size):void 0,timestamp:o.timestamp?BigInt(o.timestamp):void 0,transactions:$,totalDifficulty:o.totalDifficulty?BigInt(o.totalDifficulty):null}}async function getBlock(o,{blockHash:_,blockNumber:$,blockTag:j=o.experimental_blockTag??"latest",includeTransactions:_e}={}){var ot,it,st;const et=_e??!1,tt=$!==void 0?numberToHex($):void 0;let rt=null;if(_?rt=await o.request({method:"eth_getBlockByHash",params:[_,et]},{dedupe:!0}):rt=await o.request({method:"eth_getBlockByNumber",params:[tt||j,et]},{dedupe:!!tt}),!rt)throw new BlockNotFoundError({blockHash:_,blockNumber:$});return(((st=(it=(ot=o.chain)==null?void 0:ot.formatters)==null?void 0:it.block)==null?void 0:st.format)||formatBlock)(rt,"getBlock")}async function getGasPrice(o){const _=await o.request({method:"eth_gasPrice"});return BigInt(_)}async function estimateMaxPriorityFeePerGas(o,_){return internal_estimateMaxPriorityFeePerGas(o,_)}async function internal_estimateMaxPriorityFeePerGas(o,_){var et,tt;const{block:$,chain:j=o.chain,request:_e}=_||{};try{const rt=((et=j==null?void 0:j.fees)==null?void 0:et.maxPriorityFeePerGas)??((tt=j==null?void 0:j.fees)==null?void 0:tt.defaultPriorityFee);if(typeof rt=="function"){const ot=$||await getAction(o,getBlock,"getBlock")({}),it=await rt({block:ot,client:o,request:_e});if(it===null)throw new Error;return it}if(typeof rt<"u")return rt;const nt=await o.request({method:"eth_maxPriorityFeePerGas"});return hexToBigInt(nt)}catch{const[rt,nt]=await Promise.all([$?Promise.resolve($):getAction(o,getBlock,"getBlock")({}),getAction(o,getGasPrice,"getGasPrice")({})]);if(typeof rt.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const ot=nt-rt.baseFeePerGas;return ot<0n?0n:ot}}async function estimateFeesPerGas(o,_){return internal_estimateFeesPerGas(o,_)}async function internal_estimateFeesPerGas(o,_){var at,lt;const{block:$,chain:j=o.chain,request:_e,type:et="eip1559"}=_||{},tt=await(async()=>{var ct,ft;return typeof((ct=j==null?void 0:j.fees)==null?void 0:ct.baseFeeMultiplier)=="function"?j.fees.baseFeeMultiplier({block:$,client:o,request:_e}):((ft=j==null?void 0:j.fees)==null?void 0:ft.baseFeeMultiplier)??1.2})();if(tt<1)throw new BaseFeeScalarError;const nt=10**(((at=tt.toString().split(".")[1])==null?void 0:at.length)??0),ot=ct=>ct*BigInt(Math.ceil(tt*nt))/BigInt(nt),it=$||await getAction(o,getBlock,"getBlock")({});if(typeof((lt=j==null?void 0:j.fees)==null?void 0:lt.estimateFeesPerGas)=="function"){const ct=await j.fees.estimateFeesPerGas({block:$,client:o,multiply:ot,request:_e,type:et});if(ct!==null)return ct}if(et==="eip1559"){if(typeof it.baseFeePerGas!="bigint")throw new Eip1559FeesNotSupportedError;const ct=typeof(_e==null?void 0:_e.maxPriorityFeePerGas)=="bigint"?_e.maxPriorityFeePerGas:await internal_estimateMaxPriorityFeePerGas(o,{block:it,chain:j,request:_e}),ft=ot(it.baseFeePerGas);return{maxFeePerGas:(_e==null?void 0:_e.maxFeePerGas)??ft+ct,maxPriorityFeePerGas:ct}}return{gasPrice:(_e==null?void 0:_e.gasPrice)??ot(await getAction(o,getGasPrice,"getGasPrice")({}))}}async function getTransactionCount(o,{address:_,blockTag:$="latest",blockNumber:j}){const _e=await o.request({method:"eth_getTransactionCount",params:[_,typeof j=="bigint"?numberToHex(j):$]},{dedupe:!!j});return hexToNumber$3(_e)}function blobsToCommitments(o){const{kzg:_}=o,$=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),j=typeof o.blobs[0]=="string"?o.blobs.map(et=>hexToBytes$4(et)):o.blobs,_e=[];for(const et of j)_e.push(Uint8Array.from(_.blobToKzgCommitment(et)));return $==="bytes"?_e:_e.map(et=>bytesToHex$4(et))}function blobsToProofs(o){const{kzg:_}=o,$=o.to??(typeof o.blobs[0]=="string"?"hex":"bytes"),j=typeof o.blobs[0]=="string"?o.blobs.map(tt=>hexToBytes$4(tt)):o.blobs,_e=typeof o.commitments[0]=="string"?o.commitments.map(tt=>hexToBytes$4(tt)):o.commitments,et=[];for(let tt=0;ttbytesToHex$4(tt))}function setBigUint64$2(o,_,$,j){if(typeof o.setBigUint64=="function")return o.setBigUint64(_,$,j);const _e=BigInt(32),et=BigInt(4294967295),tt=Number($>>_e&et),rt=Number($&et),nt=j?4:0,ot=j?0:4;o.setUint32(_+nt,tt,j),o.setUint32(_+ot,rt,j)}function Chi$2(o,_,$){return o&_^~o&$}function Maj$2(o,_,$){return o&_^o&$^_&$}let HashMD$1=class extends Hash$2{constructor(_,$,j,_e){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=_,this.outputLen=$,this.padOffset=j,this.isLE=_e,this.buffer=new Uint8Array(_),this.view=createView$2(this.buffer)}update(_){aexists(this),_=toBytes$4(_),abytes$2(_);const{view:$,buffer:j,blockLen:_e}=this,et=_.length;for(let tt=0;tt_e-tt&&(this.process(j,0),tt=0);for(let st=tt;st<_e;st++)$[st]=0;setBigUint64$2(j,_e-8,BigInt(this.length*8),et),this.process(j,0);const rt=createView$2(_),nt=this.outputLen;if(nt%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const ot=nt/4,it=this.get();if(ot>it.length)throw new Error("_sha2: outputLen bigger than state");for(let st=0;st>>3,ft=rotr$2(lt,17)^rotr$2(lt,19)^lt>>>10;SHA256_W$2[st]=ft+SHA256_W$2[st-7]+ct+SHA256_W$2[st-16]|0}let{A:j,B:_e,C:et,D:tt,E:rt,F:nt,G:ot,H:it}=this;for(let st=0;st<64;st++){const at=rotr$2(rt,6)^rotr$2(rt,11)^rotr$2(rt,25),lt=it+at+Chi$2(rt,nt,ot)+SHA256_K$2[st]+SHA256_W$2[st]|0,ft=(rotr$2(j,2)^rotr$2(j,13)^rotr$2(j,22))+Maj$2(j,_e,et)|0;it=ot,ot=nt,nt=rt,rt=tt+lt|0,tt=et,et=_e,_e=j,j=lt+ft|0}j=j+this.A|0,_e=_e+this.B|0,et=et+this.C|0,tt=tt+this.D|0,rt=rt+this.E|0,nt=nt+this.F|0,ot=ot+this.G|0,it=it+this.H|0,this.set(j,_e,et,tt,rt,nt,ot,it)}roundClean(){clean(SHA256_W$2)}destroy(){this.set(0,0,0,0,0,0,0,0),clean(this.buffer)}};const sha256$6=createHasher(()=>new SHA256$4),sha256$5=sha256$6;function sha256$4(o,_){return sha256$5(isHex(o,{strict:!1})?toBytes$5(o):o)}function commitmentToVersionedHash(o){const{commitment:_,version:$=1}=o,j=o.to??(typeof _=="string"?"hex":"bytes"),_e=sha256$4(_);return _e.set([$],0),j==="bytes"?_e:bytesToHex$4(_e)}function commitmentsToVersionedHashes(o){const{commitments:_,version:$}=o,j=o.to,_e=[];for(const et of _)_e.push(commitmentToVersionedHash({commitment:et,to:j,version:$}));return _e}const blobsPerTransaction=6,bytesPerFieldElement=32,fieldElementsPerBlob=4096,bytesPerBlob=bytesPerFieldElement*fieldElementsPerBlob,maxBytesPerTransaction=bytesPerBlob*blobsPerTransaction-1-1*fieldElementsPerBlob*blobsPerTransaction;class BlobSizeTooLargeError extends BaseError$1{constructor({maxSize:_,size:$}){super("Blob size is too large.",{metaMessages:[`Max: ${_} bytes`,`Given: ${$} bytes`],name:"BlobSizeTooLargeError"})}}class EmptyBlobError extends BaseError$1{constructor(){super("Blob data must not be empty.",{name:"EmptyBlobError"})}}function toBlobs(o){const _=typeof o.data=="string"?hexToBytes$4(o.data):o.data,$=size$3(_);if(!$)throw new EmptyBlobError;if($>maxBytesPerTransaction)throw new BlobSizeTooLargeError({maxSize:maxBytesPerTransaction,size:$});const j=[];let _e=!0,et=0;for(;_e;){const tt=createCursor(new Uint8Array(bytesPerBlob));let rt=0;for(;rtbytesToHex$4(tt.bytes))}function toBlobSidecars(o){const{data:_,kzg:$,to:j}=o,_e=o.blobs??toBlobs({data:_}),et=o.commitments??blobsToCommitments({blobs:_e,kzg:$,to:j}),tt=o.proofs??blobsToProofs({blobs:_e,commitments:et,kzg:$,to:j}),rt=[];for(let nt=0;nt<_e.length;nt++)rt.push({blob:_e[nt],commitment:et[nt],proof:tt[nt]});return rt}function getTransactionType(o){if(o.type)return o.type;if(typeof o.authorizationList<"u")return"eip7702";if(typeof o.blobs<"u"||typeof o.blobVersionedHashes<"u"||typeof o.maxFeePerBlobGas<"u"||typeof o.sidecars<"u")return"eip4844";if(typeof o.maxFeePerGas<"u"||typeof o.maxPriorityFeePerGas<"u")return"eip1559";if(typeof o.gasPrice<"u")return typeof o.accessList<"u"?"eip2930":"legacy";throw new InvalidSerializableTransactionError({transaction:o})}function getTransactionError(o,{docsPath:_,...$}){const j=(()=>{const _e=getNodeError(o,$);return _e instanceof UnknownNodeError?o:_e})();return new TransactionExecutionError(j,{docsPath:_,...$})}async function getChainId(o){const _=await o.request({method:"eth_chainId"},{dedupe:!0});return hexToNumber$3(_)}async function fillTransaction(o,_){var At,kt,Ot,Tt,ht;const{account:$=o.account,accessList:j,authorizationList:_e,chain:et=o.chain,blobVersionedHashes:tt,blobs:rt,data:nt,gas:ot,gasPrice:it,maxFeePerBlobGas:st,maxFeePerGas:at,maxPriorityFeePerGas:lt,nonce:ct,nonceManager:ft,to:dt,type:pt,value:yt,...vt}=_,wt=await(async()=>{if(!$||!ft||typeof ct<"u")return ct;const bt=parseAccount($),mt=et?et.id:await getAction(o,getChainId,"getChainId")({});return await ft.consume({address:bt.address,chainId:mt,client:o})})();assertRequest(_);const Ct=(kt=(At=et==null?void 0:et.formatters)==null?void 0:At.transactionRequest)==null?void 0:kt.format,Bt=(Ct||formatTransactionRequest)({...extract$1(vt,{format:Ct}),account:$?parseAccount($):void 0,accessList:j,authorizationList:_e,blobs:rt,blobVersionedHashes:tt,data:nt,gas:ot,gasPrice:it,maxFeePerBlobGas:st,maxFeePerGas:at,maxPriorityFeePerGas:lt,nonce:wt,to:dt,type:pt,value:yt},"fillTransaction");try{const bt=await o.request({method:"eth_fillTransaction",params:[Bt]}),gt=(((Tt=(Ot=et==null?void 0:et.formatters)==null?void 0:Ot.transaction)==null?void 0:Tt.format)||formatTransaction)(bt.tx);delete gt.blockHash,delete gt.blockNumber,delete gt.r,delete gt.s,delete gt.transactionIndex,delete gt.v,delete gt.yParity,gt.data=gt.input,gt.gas&&(gt.gas=_.gas??gt.gas),gt.gasPrice&&(gt.gasPrice=_.gasPrice??gt.gasPrice),gt.maxFeePerBlobGas&&(gt.maxFeePerBlobGas=_.maxFeePerBlobGas??gt.maxFeePerBlobGas),gt.maxFeePerGas&&(gt.maxFeePerGas=_.maxFeePerGas??gt.maxFeePerGas),gt.maxPriorityFeePerGas&&(gt.maxPriorityFeePerGas=_.maxPriorityFeePerGas??gt.maxPriorityFeePerGas),gt.nonce&&(gt.nonce=_.nonce??gt.nonce);const xt=await(async()=>{var St,Rt;if(typeof((St=et==null?void 0:et.fees)==null?void 0:St.baseFeeMultiplier)=="function"){const It=await getAction(o,getBlock,"getBlock")({});return et.fees.baseFeeMultiplier({block:It,client:o,request:_})}return((Rt=et==null?void 0:et.fees)==null?void 0:Rt.baseFeeMultiplier)??1.2})();if(xt<1)throw new BaseFeeScalarError;const _t=10**(((ht=xt.toString().split(".")[1])==null?void 0:ht.length)??0),$t=St=>St*BigInt(Math.ceil(xt*_t))/BigInt(_t);return gt.maxFeePerGas&&!_.maxFeePerGas&&(gt.maxFeePerGas=$t(gt.maxFeePerGas)),gt.gasPrice&&!_.gasPrice&&(gt.gasPrice=$t(gt.gasPrice)),{raw:bt.raw,transaction:{from:Bt.from,...gt}}}catch(bt){throw getTransactionError(bt,{..._,chain:o.chain})}}const defaultParameters=["blobVersionedHashes","chainId","fees","gas","nonce","type"],eip1559NetworkCache=new Map,supportsFillTransaction=new LruMap$1(128);async function prepareTransactionRequest(o,_){var wt,Ct,Pt;let $=_;$.account??($.account=o.account),$.parameters??($.parameters=defaultParameters);const{account:j,chain:_e=o.chain,nonceManager:et,parameters:tt}=$,rt=(()=>{if(typeof(_e==null?void 0:_e.prepareTransactionRequest)=="function")return{fn:_e.prepareTransactionRequest,runAt:["beforeFillTransaction"]};if(Array.isArray(_e==null?void 0:_e.prepareTransactionRequest))return{fn:_e.prepareTransactionRequest[0],runAt:_e.prepareTransactionRequest[1].runAt}})();let nt;async function ot(){return nt||(typeof $.chainId<"u"?$.chainId:_e?_e.id:(nt=await getAction(o,getChainId,"getChainId")({}),nt))}const it=j&&parseAccount(j);let st=$.nonce;if(tt.includes("nonce")&&typeof st>"u"&&it&&et){const Bt=await ot();st=await et.consume({address:it.address,chainId:Bt,client:o})}rt!=null&&rt.fn&&((wt=rt.runAt)!=null&&wt.includes("beforeFillTransaction"))&&($=await rt.fn({...$,chain:_e},{phase:"beforeFillTransaction"}),st??(st=$.nonce));const lt=((tt.includes("blobVersionedHashes")||tt.includes("sidecars"))&&$.kzg&&$.blobs||supportsFillTransaction.get(o.uid)===!1||!["fees","gas"].some(At=>tt.includes(At))?!1:!!(tt.includes("chainId")&&typeof $.chainId!="number"||tt.includes("nonce")&&typeof st!="number"||tt.includes("fees")&&typeof $.gasPrice!="bigint"&&(typeof $.maxFeePerGas!="bigint"||typeof $.maxPriorityFeePerGas!="bigint")||tt.includes("gas")&&typeof $.gas!="bigint"))?await getAction(o,fillTransaction,"fillTransaction")({...$,nonce:st}).then(Bt=>{const{chainId:At,from:kt,gas:Ot,gasPrice:Tt,nonce:ht,maxFeePerBlobGas:bt,maxFeePerGas:mt,maxPriorityFeePerGas:gt,type:xt,...Et}=Bt.transaction;return supportsFillTransaction.set(o.uid,!0),{...$,...kt?{from:kt}:{},...xt?{type:xt}:{},...typeof At<"u"?{chainId:At}:{},...typeof Ot<"u"?{gas:Ot}:{},...typeof Tt<"u"?{gasPrice:Tt}:{},...typeof ht<"u"?{nonce:ht}:{},...typeof bt<"u"?{maxFeePerBlobGas:bt}:{},...typeof mt<"u"?{maxFeePerGas:mt}:{},...typeof gt<"u"?{maxPriorityFeePerGas:gt}:{},..."nonceKey"in Et&&typeof Et.nonceKey<"u"?{nonceKey:Et.nonceKey}:{}}}).catch(Bt=>{var Ot;const At=Bt;return At.name!=="TransactionExecutionError"||((Ot=At.walk)==null?void 0:Ot.call(At,Tt=>{const ht=Tt;return ht.name==="MethodNotFoundRpcError"||ht.name==="MethodNotSupportedRpcError"}))&&supportsFillTransaction.set(o.uid,!1),$}):$;st??(st=lt.nonce),$={...lt,...it?{from:it==null?void 0:it.address}:{},...st?{nonce:st}:{}};const{blobs:ct,gas:ft,kzg:dt,type:pt}=$;rt!=null&&rt.fn&&((Ct=rt.runAt)!=null&&Ct.includes("beforeFillParameters"))&&($=await rt.fn({...$,chain:_e},{phase:"beforeFillParameters"}));let yt;async function vt(){return yt||(yt=await getAction(o,getBlock,"getBlock")({blockTag:"latest"}),yt)}if(tt.includes("nonce")&&typeof st>"u"&&it&&!et&&($.nonce=await getAction(o,getTransactionCount,"getTransactionCount")({address:it.address,blockTag:"pending"})),(tt.includes("blobVersionedHashes")||tt.includes("sidecars"))&&ct&&dt){const Bt=blobsToCommitments({blobs:ct,kzg:dt});if(tt.includes("blobVersionedHashes")){const At=commitmentsToVersionedHashes({commitments:Bt,to:"hex"});$.blobVersionedHashes=At}if(tt.includes("sidecars")){const At=blobsToProofs({blobs:ct,commitments:Bt,kzg:dt}),kt=toBlobSidecars({blobs:ct,commitments:Bt,proofs:At,to:"hex"});$.sidecars=kt}}if(tt.includes("chainId")&&($.chainId=await ot()),(tt.includes("fees")||tt.includes("type"))&&typeof pt>"u")try{$.type=getTransactionType($)}catch{let Bt=eip1559NetworkCache.get(o.uid);if(typeof Bt>"u"){const At=await vt();Bt=typeof(At==null?void 0:At.baseFeePerGas)=="bigint",eip1559NetworkCache.set(o.uid,Bt)}$.type=Bt?"eip1559":"legacy"}if(tt.includes("fees"))if($.type!=="legacy"&&$.type!=="eip2930"){if(typeof $.maxFeePerGas>"u"||typeof $.maxPriorityFeePerGas>"u"){const Bt=await vt(),{maxFeePerGas:At,maxPriorityFeePerGas:kt}=await internal_estimateFeesPerGas(o,{block:Bt,chain:_e,request:$});if(typeof $.maxPriorityFeePerGas>"u"&&$.maxFeePerGas&&$.maxFeePerGas"u"){const Bt=await vt(),{gasPrice:At}=await internal_estimateFeesPerGas(o,{block:Bt,chain:_e,request:$,type:"legacy"});$.gasPrice=At}}return tt.includes("gas")&&typeof ft>"u"&&($.gas=await getAction(o,estimateGas,"estimateGas")({...$,account:it,prepare:(it==null?void 0:it.type)==="local"?[]:["blobVersionedHashes"]})),rt!=null&&rt.fn&&((Pt=rt.runAt)!=null&&Pt.includes("afterFillParameters"))&&($=await rt.fn({...$,chain:_e},{phase:"afterFillParameters"})),assertRequest($),delete $.parameters,$}async function estimateGas(o,_){var tt,rt,nt;const{account:$=o.account,prepare:j=!0}=_,_e=$?parseAccount($):void 0,et=(()=>{if(Array.isArray(j))return j;if((_e==null?void 0:_e.type)!=="local")return["blobVersionedHashes"]})();try{const ot=await(async()=>{if(_.to)return _.to;if(_.authorizationList&&_.authorizationList.length>0)return await recoverAuthorizationAddress({authorization:_.authorizationList[0]}).catch(()=>{throw new BaseError$1("`to` is required. Could not infer from `authorizationList`")})})(),{accessList:it,authorizationList:st,blobs:at,blobVersionedHashes:lt,blockNumber:ct,blockTag:ft,data:dt,gas:pt,gasPrice:yt,maxFeePerBlobGas:vt,maxFeePerGas:wt,maxPriorityFeePerGas:Ct,nonce:Pt,value:Bt,stateOverride:At,...kt}=j?await prepareTransactionRequest(o,{..._,parameters:et,to:ot}):_;if(pt&&_.gas!==pt)return pt;const Tt=(typeof ct=="bigint"?numberToHex(ct):void 0)||ft,ht=serializeStateOverride(At);assertRequest(_);const bt=(nt=(rt=(tt=o.chain)==null?void 0:tt.formatters)==null?void 0:rt.transactionRequest)==null?void 0:nt.format,gt=(bt||formatTransactionRequest)({...extract$1(kt,{format:bt}),account:_e,accessList:it,authorizationList:st,blobs:at,blobVersionedHashes:lt,data:dt,gasPrice:yt,maxFeePerBlobGas:vt,maxFeePerGas:wt,maxPriorityFeePerGas:Ct,nonce:Pt,to:ot,value:Bt},"estimateGas");return BigInt(await o.request({method:"eth_estimateGas",params:ht?[gt,Tt??o.experimental_blockTag??"latest",ht]:Tt?[gt,Tt]:[gt]}))}catch(ot){throw getEstimateGasError(ot,{..._,account:_e,chain:o.chain})}}async function estimateContractGas(o,_){var ot;const{abi:$,address:j,args:_e,functionName:et,dataSuffix:tt=typeof o.dataSuffix=="string"?o.dataSuffix:(ot=o.dataSuffix)==null?void 0:ot.value,...rt}=_,nt=encodeFunctionData({abi:$,args:_e,functionName:et});try{return await getAction(o,estimateGas,"estimateGas")({data:`${nt}${tt?tt.replace("0x",""):""}`,to:j,...rt})}catch(it){const st=rt.account?parseAccount(rt.account):void 0;throw getContractError(it,{abi:$,address:j,args:_e,docsPath:"/docs/contract/estimateContractGas",functionName:et,sender:st==null?void 0:st.address})}}function isAddressEqual(o,_){if(!isAddress(o,{strict:!1}))throw new InvalidAddressError$1({address:o});if(!isAddress(_,{strict:!1}))throw new InvalidAddressError$1({address:_});return o.toLowerCase()===_.toLowerCase()}const docsPath$4="/docs/contract/decodeEventLog";function decodeEventLog(o){const{abi:_,data:$,strict:j,topics:_e}=o,et=j??!0,[tt,...rt]=_e;if(!tt)throw new AbiEventSignatureEmptyTopicsError({docsPath:docsPath$4});const nt=_.find(pt=>pt.type==="event"&&tt===toEventSelector(formatAbiItem(pt)));if(!(nt&&"name"in nt)||nt.type!=="event")throw new AbiEventSignatureNotFoundError(tt,{docsPath:docsPath$4});const{name:ot,inputs:it}=nt,st=it==null?void 0:it.some(pt=>!("name"in pt&&pt.name)),at=st?[]:{},lt=it.map((pt,yt)=>[pt,yt]).filter(([pt])=>"indexed"in pt&&pt.indexed),ct=[];for(let pt=0;pt!("indexed"in pt&&pt.indexed)),dt=et?ft:[...ct.map(([pt])=>pt),...ft];if(dt.length>0){if($&&$!=="0x")try{const pt=decodeAbiParameters(dt,$);if(pt){let yt=0;if(!et)for(const[vt,wt]of ct)at[st?wt:vt.name||wt]=pt[yt++];if(st)for(let vt=0;vt0?at:void 0}}function decodeTopic({param:o,value:_}){return o.type==="string"||o.type==="bytes"||o.type==="tuple"||o.type.match(/^(.*)\[(\d+)?\]$/)?_:(decodeAbiParameters([o],_)||[])[0]}function parseEventLogs(o){const{abi:_,args:$,logs:j,strict:_e=!0}=o,et=(()=>{if(o.eventName)return Array.isArray(o.eventName)?o.eventName:[o.eventName]})(),tt=_.filter(rt=>rt.type==="event").map(rt=>({abi:rt,selector:toEventSelector(rt)}));return j.map(rt=>{var st;const nt=tt.filter(at=>rt.topics[0]===at.selector);if(nt.length===0)return null;let ot,it;for(const at of nt)try{ot=decodeEventLog({...rt,abi:[at.abi],strict:!0}),it=at;break}catch{}if(!ot&&!_e){it=nt[0];try{ot=decodeEventLog({data:rt.data,topics:rt.topics,abi:[it.abi],strict:!1})}catch{const at=(st=it.abi.inputs)==null?void 0:st.some(lt=>!("name"in lt&<.name));return{...rt,args:at?[]:{},eventName:it.abi.name}}}return!ot||!it||et&&!et.includes(ot.eventName)||!includesArgs({args:ot.args,inputs:it.abi.inputs,matchArgs:$})?null:{...ot,...rt}}).filter(Boolean)}function includesArgs(o){const{args:_,inputs:$,matchArgs:j}=o;if(!j)return!0;if(!_)return!1;function _e(et,tt,rt){try{return et.type==="address"?isAddressEqual(tt,rt):et.type==="string"||et.type==="bytes"?keccak256$4(toBytes$5(tt))===rt:tt===rt}catch{return!1}}return Array.isArray(_)&&Array.isArray(j)?j.every((et,tt)=>{if(et==null)return!0;const rt=$[tt];return rt?(Array.isArray(et)?et:[et]).some(ot=>_e(rt,ot,_[tt])):!1}):typeof _=="object"&&!Array.isArray(_)&&typeof j=="object"&&!Array.isArray(j)?Object.entries(j).every(([et,tt])=>{if(tt==null)return!0;const rt=$.find(ot=>ot.name===et);return rt?(Array.isArray(tt)?tt:[tt]).some(ot=>_e(rt,ot,_[et])):!1}):!1}function formatLog(o,{args:_,eventName:$}={}){return{...o,blockHash:o.blockHash?o.blockHash:null,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,blockTimestamp:o.blockTimestamp?BigInt(o.blockTimestamp):o.blockTimestamp===null?null:void 0,logIndex:o.logIndex?Number(o.logIndex):null,transactionHash:o.transactionHash?o.transactionHash:null,transactionIndex:o.transactionIndex?Number(o.transactionIndex):null,...$?{args:_,eventName:$}:{}}}async function getLogs(o,{address:_,blockHash:$,fromBlock:j,toBlock:_e,event:et,events:tt,args:rt,strict:nt}={}){const ot=nt??!1,it=tt??(et?[et]:void 0);let st=[];it&&(st=[it.flatMap(ft=>encodeEventTopics({abi:[ft],eventName:ft.name,args:tt?void 0:rt}))],et&&(st=st[0]));let at;$?at=await o.request({method:"eth_getLogs",params:[{address:_,topics:st,blockHash:$}]}):at=await o.request({method:"eth_getLogs",params:[{address:_,topics:st,fromBlock:typeof j=="bigint"?numberToHex(j):j,toBlock:typeof _e=="bigint"?numberToHex(_e):_e}]});const lt=at.map(ct=>formatLog(ct));return it?parseEventLogs({abi:it,args:rt,logs:lt,strict:ot}):lt}async function getContractEvents(o,_){const{abi:$,address:j,args:_e,blockHash:et,eventName:tt,fromBlock:rt,toBlock:nt,strict:ot}=_,it=tt?getAbiItem({abi:$,name:tt}):void 0,st=it?void 0:$.filter(at=>at.type==="event");return getAction(o,getLogs,"getLogs")({address:j,args:_e,blockHash:et,event:it,events:st,fromBlock:rt,toBlock:nt,strict:ot})}const docsPath$3="/docs/contract/decodeFunctionResult";function decodeFunctionResult(o){const{abi:_,args:$,functionName:j,data:_e}=o;let et=_[0];if(j){const rt=getAbiItem({abi:_,args:$,name:j});if(!rt)throw new AbiFunctionNotFoundError(j,{docsPath:docsPath$3});et=rt}if(et.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath:docsPath$3});if(!et.outputs)throw new AbiFunctionOutputsNotFoundError(et.name,{docsPath:docsPath$3});const tt=decodeAbiParameters(et.outputs,_e);if(tt&&tt.length>1)return tt;if(tt&&tt.length===1)return tt[0]}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$c=BigInt(0),_1n$g=BigInt(1);function isBytes$2(o){return o instanceof Uint8Array||ArrayBuffer.isView(o)&&o.constructor.name==="Uint8Array"}function abytes$1(o){if(!isBytes$2(o))throw new Error("Uint8Array expected")}function abool(o,_){if(typeof _!="boolean")throw new Error(o+" boolean expected, got "+_)}function numberToHexUnpadded(o){const _=o.toString(16);return _.length&1?"0"+_:_}function hexToNumber$2(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);return o===""?_0n$c:BigInt("0x"+o)}const hasHexBuiltin=typeof Uint8Array.from([]).toHex=="function"&&typeof Uint8Array.fromHex=="function",hexes$3=Array.from({length:256},(o,_)=>_.toString(16).padStart(2,"0"));function bytesToHex$3(o){if(abytes$1(o),hasHexBuiltin)return o.toHex();let _="";for(let $=0;$=asciis$1._0&&o<=asciis$1._9)return o-asciis$1._0;if(o>=asciis$1.A&&o<=asciis$1.F)return o-(asciis$1.A-10);if(o>=asciis$1.a&&o<=asciis$1.f)return o-(asciis$1.a-10)}function hexToBytes$3(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);if(hasHexBuiltin)return Uint8Array.fromHex(o);const _=o.length,$=_/2;if(_%2)throw new Error("hex string expected, got unpadded hex of length "+_);const j=new Uint8Array($);for(let _e=0,et=0;_e<$;_e++,et+=2){const tt=asciiToBase16$1(o.charCodeAt(et)),rt=asciiToBase16$1(o.charCodeAt(et+1));if(tt===void 0||rt===void 0){const nt=o[et]+o[et+1];throw new Error('hex string expected, got non-hex character "'+nt+'" at index '+et)}j[_e]=tt*16+rt}return j}function bytesToNumberBE$2(o){return hexToNumber$2(bytesToHex$3(o))}function bytesToNumberLE$2(o){return abytes$1(o),hexToNumber$2(bytesToHex$3(Uint8Array.from(o).reverse()))}function numberToBytesBE$2(o,_){return hexToBytes$3(o.toString(16).padStart(_*2,"0"))}function numberToBytesLE$2(o,_){return numberToBytesBE$2(o,_).reverse()}function ensureBytes$2(o,_,$){let j;if(typeof _=="string")try{j=hexToBytes$3(_)}catch(et){throw new Error(o+" must be hex string or Uint8Array, cause: "+et)}else if(isBytes$2(_))j=Uint8Array.from(_);else throw new Error(o+" must be hex string or Uint8Array");const _e=j.length;if(typeof $=="number"&&_e!==$)throw new Error(o+" of length "+$+" expected, got "+_e);return j}function concatBytes$4(...o){let _=0;for(let j=0;jtypeof o=="bigint"&&_0n$c<=o;function inRange(o,_,$){return isPosBig(o)&&isPosBig(_)&&isPosBig($)&&_<=o&&o<$}function aInRange(o,_,$,j){if(!inRange(_,$,j))throw new Error("expected valid "+o+": "+$+" <= n < "+j+", got "+_)}function bitLen(o){let _;for(_=0;o>_0n$c;o>>=_1n$g,_+=1);return _}const bitMask$2=o=>(_1n$g<new Uint8Array(o),u8fr$2=o=>Uint8Array.from(o);function createHmacDrbg$2(o,_,$){if(typeof o!="number"||o<2)throw new Error("hashLen must be a number");if(typeof _!="number"||_<2)throw new Error("qByteLen must be a number");if(typeof $!="function")throw new Error("hmacFn must be a function");let j=u8n$2(o),_e=u8n$2(o),et=0;const tt=()=>{j.fill(1),_e.fill(0),et=0},rt=(...st)=>$(_e,j,...st),nt=(st=u8n$2(0))=>{_e=rt(u8fr$2([0]),st),j=rt(),st.length!==0&&(_e=rt(u8fr$2([1]),st),j=rt())},ot=()=>{if(et++>=1e3)throw new Error("drbg: tried 1000 values");let st=0;const at=[];for(;st<_;){j=rt();const lt=j.slice();at.push(lt),st+=j.length}return concatBytes$4(...at)};return(st,at)=>{tt(),nt(st);let lt;for(;!(lt=at(ot()));)nt();return tt(),lt}}const validatorFns$2={bigint:o=>typeof o=="bigint",function:o=>typeof o=="function",boolean:o=>typeof o=="boolean",string:o=>typeof o=="string",stringOrUint8Array:o=>typeof o=="string"||isBytes$2(o),isSafeInteger:o=>Number.isSafeInteger(o),array:o=>Array.isArray(o),field:(o,_)=>_.Fp.isValid(o),hash:o=>typeof o=="function"&&Number.isSafeInteger(o.outputLen)};function validateObject$5(o,_,$={}){const j=(_e,et,tt)=>{const rt=validatorFns$2[et];if(typeof rt!="function")throw new Error("invalid validator function");const nt=o[_e];if(!(tt&&nt===void 0)&&!rt(nt,o))throw new Error("param "+String(_e)+" is invalid. Expected "+et+", got "+nt)};for(const[_e,et]of Object.entries(_))j(_e,et,!1);for(const[_e,et]of Object.entries($))j(_e,et,!0);return o}function memoized(o){const _=new WeakMap;return($,...j)=>{const _e=_.get($);if(_e!==void 0)return _e;const et=o($,...j);return _.set($,et),et}}const version$3="0.1.1";function getVersion(){return version$3}class BaseError extends Error{static setStaticOptions(_){BaseError.prototype.docsOrigin=_.docsOrigin,BaseError.prototype.showVersion=_.showVersion,BaseError.prototype.version=_.version}constructor(_,$={}){const j=(()=>{var it;if($.cause instanceof BaseError){if($.cause.details)return $.cause.details;if($.cause.shortMessage)return $.cause.shortMessage}return $.cause&&"details"in $.cause&&typeof $.cause.details=="string"?$.cause.details:(it=$.cause)!=null&&it.message?$.cause.message:$.details})(),_e=$.cause instanceof BaseError&&$.cause.docsPath||$.docsPath,et=$.docsOrigin??BaseError.prototype.docsOrigin,tt=`${et}${_e??""}`,rt=!!($.version??BaseError.prototype.showVersion),nt=$.version??BaseError.prototype.version,ot=[_||"An error occurred.",...$.metaMessages?["",...$.metaMessages]:[],...j||_e||rt?["",j?`Details: ${j}`:void 0,_e?`See: ${tt}`:void 0,rt?`Version: ${nt}`:void 0]:[]].filter(it=>typeof it=="string").join(` -`);super(ot,$.cause?{cause:$.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsOrigin",{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,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"showVersion",{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,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.cause=$.cause,this.details=j,this.docs=tt,this.docsOrigin=et,this.docsPath=_e,this.shortMessage=_,this.showVersion=rt,this.version=nt}walk(_){return walk(this,_)}}Object.defineProperty(BaseError,"defaultStaticOptions",{enumerable:!0,configurable:!0,writable:!0,value:{docsOrigin:"https://oxlib.sh",showVersion:!1,version:`ox@${getVersion()}`}});BaseError.setStaticOptions(BaseError.defaultStaticOptions);function walk(o,_){return _!=null&&_(o)?o:o&&typeof o=="object"&&"cause"in o&&o.cause?walk(o.cause,_):_?null:o}function assertSize$1(o,_){if(size$2(o)>_)throw new SizeOverflowError$1({givenSize:size$2(o),maxSize:_})}const charCodeMap={zero:48,nine:57,A:65,F:70,a:97,f:102};function charCodeToBase16(o){if(o>=charCodeMap.zero&&o<=charCodeMap.nine)return o-charCodeMap.zero;if(o>=charCodeMap.A&&o<=charCodeMap.F)return o-(charCodeMap.A-10);if(o>=charCodeMap.a&&o<=charCodeMap.f)return o-(charCodeMap.a-10)}function pad$2(o,_={}){const{dir:$,size:j=32}=_;if(j===0)return o;if(o.length>j)throw new SizeExceedsPaddingSizeError$1({size:o.length,targetSize:j,type:"Bytes"});const _e=new Uint8Array(j);for(let et=0;et_)throw new SizeOverflowError({givenSize:size$1(o),maxSize:_})}function assertStartOffset(o,_){if(typeof _=="number"&&_>0&&_>size$1(o)-1)throw new SliceOffsetOutOfBoundsError({offset:_,position:"start",size:size$1(o)})}function assertEndOffset(o,_,$){if(typeof _=="number"&&typeof $=="number"&&size$1(o)!==$-_)throw new SliceOffsetOutOfBoundsError({offset:$,position:"end",size:size$1(o)})}function pad$1(o,_={}){const{dir:$,size:j=32}=_;if(j===0)return o;const _e=o.replace("0x","");if(_e.length>j*2)throw new SizeExceedsPaddingSizeError({size:Math.ceil(_e.length/2),targetSize:j,type:"Hex"});return`0x${_e[$==="right"?"padEnd":"padStart"](j*2,"0")}`}const bigIntSuffix="#__bigint";function stringify$4(o,_,$){return JSON.stringify(o,(j,_e)=>typeof _e=="bigint"?_e.toString()+bigIntSuffix:_e,$)}const decoder=new TextDecoder,encoder$1=new TextEncoder;function from$a(o){return o instanceof Uint8Array?o:typeof o=="string"?fromHex$1(o):fromArray(o)}function fromArray(o){return o instanceof Uint8Array?o:new Uint8Array(o)}function fromHex$1(o,_={}){const{size:$}=_;let j=o;$&&(assertSize(o,$),j=padRight(o,$));let _e=j.slice(2);_e.length%2&&(_e=`0${_e}`);const et=_e.length/2,tt=new Uint8Array(et);for(let rt=0,nt=0;rt1||j[0]>1)throw new InvalidBytesBooleanError(j);return!!j[0]}function toNumber$2(o,_={}){const{size:$}=_;typeof $<"u"&&assertSize$1(o,$);const j=fromBytes$1(o,_);return toNumber$1(j,_)}function toString$4(o,_={}){const{size:$}=_;let j=o;return typeof $<"u"&&(assertSize$1(j,$),j=trimRight(j)),decoder.decode(j)}function trimLeft(o){return trim$1(o,{dir:"left"})}function trimRight(o){return trim$1(o,{dir:"right"})}class InvalidBytesBooleanError extends BaseError{constructor(_){super(`Bytes value \`${_}\` is not a valid boolean.`,{metaMessages:["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:"Bytes.InvalidBytesBooleanError"})}}let SizeOverflowError$1=class extends BaseError{constructor({givenSize:_,maxSize:$}){super(`Size cannot exceed \`${$}\` bytes. Given size: \`${_}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeOverflowError"})}},SizeExceedsPaddingSizeError$1=class extends BaseError{constructor({size:_,targetSize:$,type:j}){super(`${j.charAt(0).toUpperCase()}${j.slice(1).toLowerCase()} size (\`${_}\`) exceeds padding size (\`${$}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Bytes.SizeExceedsPaddingSizeError"})}};const encoder=new TextEncoder,hexes$2=Array.from({length:256},(o,_)=>_.toString(16).padStart(2,"0"));function assert$n(o,_={}){const{strict:$=!1}=_;if(!o)throw new InvalidHexTypeError(o);if(typeof o!="string")throw new InvalidHexTypeError(o);if($&&!/^0x[0-9a-fA-F]*$/.test(o))throw new InvalidHexValueError(o);if(!o.startsWith("0x"))throw new InvalidHexValueError(o)}function concat$1(...o){return`0x${o.reduce((_,$)=>_+$.replace("0x",""),"")}`}function from$9(o){return o instanceof Uint8Array?fromBytes$1(o):Array.isArray(o)?fromBytes$1(new Uint8Array(o)):o}function fromBoolean(o,_={}){const $=`0x${Number(o)}`;return typeof _.size=="number"?(assertSize($,_.size),padLeft($,_.size)):$}function fromBytes$1(o,_={}){let $="";for(let _e=0;_eet||_e>1n;return j<=tt?j:j-et-1n}function toNumber$1(o,_={}){const{signed:$,size:j}=_;return Number(!$&&!j?o:toBigInt(o,_))}function validate$3(o,_={}){const{strict:$=!1}=_;try{return assert$n(o,{strict:$}),!0}catch{return!1}}class IntegerOutOfRangeError extends BaseError{constructor({max:_,min:$,signed:j,size:_e,value:et}){super(`Number \`${et}\` is not in safe${_e?` ${_e*8}-bit`:""}${j?" signed":" unsigned"} integer range ${_?`(\`${$}\` to \`${_}\`)`:`(above \`${$}\`)`}`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.IntegerOutOfRangeError"})}}class InvalidHexTypeError extends BaseError{constructor(_){super(`Value \`${typeof _=="object"?stringify$4(_):_}\` of type \`${typeof _}\` is an invalid hex type.`,{metaMessages:['Hex types must be represented as `"0x${string}"`.']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexTypeError"})}}class InvalidHexValueError extends BaseError{constructor(_){super(`Value \`${_}\` is an invalid hex value.`,{metaMessages:['Hex values must start with `"0x"` and contain only hexadecimal characters (0-9, a-f, A-F).']}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.InvalidHexValueError"})}}class SizeOverflowError extends BaseError{constructor({givenSize:_,maxSize:$}){super(`Size cannot exceed \`${$}\` bytes. Given size: \`${_}\` bytes.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeOverflowError"})}}class SliceOffsetOutOfBoundsError extends BaseError{constructor({offset:_,position:$,size:j}){super(`Slice ${$==="start"?"starting":"ending"} at offset \`${_}\` is out-of-bounds (size: \`${j}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SliceOffsetOutOfBoundsError"})}}class SizeExceedsPaddingSizeError extends BaseError{constructor({size:_,targetSize:$,type:j}){super(`${j.charAt(0).toUpperCase()}${j.slice(1).toLowerCase()} size (\`${_}\`) exceeds padding size (\`${$}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Hex.SizeExceedsPaddingSizeError"})}}function toRpc$1(o){return{address:o.address,amount:fromNumber(o.amount),index:fromNumber(o.index),validatorIndex:fromNumber(o.validatorIndex)}}function toRpc(o){return{...typeof o.baseFeePerGas=="bigint"&&{baseFeePerGas:fromNumber(o.baseFeePerGas)},...typeof o.blobBaseFee=="bigint"&&{blobBaseFee:fromNumber(o.blobBaseFee)},...typeof o.feeRecipient=="string"&&{feeRecipient:o.feeRecipient},...typeof o.gasLimit=="bigint"&&{gasLimit:fromNumber(o.gasLimit)},...typeof o.number=="bigint"&&{number:fromNumber(o.number)},...typeof o.prevRandao=="bigint"&&{prevRandao:fromNumber(o.prevRandao)},...typeof o.time=="bigint"&&{time:fromNumber(o.time)},...o.withdrawals&&{withdrawals:o.withdrawals.map(toRpc$1)}}}const multicall3Abi=[{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"},{inputs:[],name:"getCurrentBlockTimestamp",outputs:[{internalType:"uint256",name:"timestamp",type:"uint256"}],stateMutability:"view",type:"function"}],batchGatewayAbi=[{name:"query",type:"function",stateMutability:"view",inputs:[{type:"tuple[]",name:"queries",components:[{type:"address",name:"sender"},{type:"string[]",name:"urls"},{type:"bytes",name:"data"}]}],outputs:[{type:"bool[]",name:"failures"},{type:"bytes[]",name:"responses"}]},{name:"HttpError",type:"error",inputs:[{type:"uint16",name:"status"},{type:"string",name:"message"}]}],universalResolverErrors=[{inputs:[{name:"dns",type:"bytes"}],name:"DNSDecodingFailed",type:"error"},{inputs:[{name:"ens",type:"string"}],name:"DNSEncodingFailed",type:"error"},{inputs:[],name:"EmptyAddress",type:"error"},{inputs:[{name:"status",type:"uint16"},{name:"message",type:"string"}],name:"HttpError",type:"error"},{inputs:[],name:"InvalidBatchGatewayResponse",type:"error"},{inputs:[{name:"errorData",type:"bytes"}],name:"ResolverError",type:"error"},{inputs:[{name:"name",type:"bytes"},{name:"resolver",type:"address"}],name:"ResolverNotContract",type:"error"},{inputs:[{name:"name",type:"bytes"}],name:"ResolverNotFound",type:"error"},{inputs:[{name:"primary",type:"string"},{name:"primaryAddress",type:"bytes"}],name:"ReverseAddressMismatch",type:"error"},{inputs:[{internalType:"bytes4",name:"selector",type:"bytes4"}],name:"UnsupportedResolverProfile",type:"error"}],universalResolverResolveAbi=[...universalResolverErrors,{name:"resolveWithGateways",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"}]}],universalResolverReverseAbi=[...universalResolverErrors,{name:"reverseWithGateways",type:"function",stateMutability:"view",inputs:[{type:"bytes",name:"reverseName"},{type:"uint256",name:"coinType"},{type:"string[]",name:"gateways"}],outputs:[{type:"string",name:"resolvedName"},{type:"address",name:"resolver"},{type:"address",name:"reverseResolver"}]}],textResolverAbi=[{name:"text",type:"function",stateMutability:"view",inputs:[{name:"name",type:"bytes32"},{name:"key",type:"string"}],outputs:[{name:"",type:"string"}]}],addressResolverAbi=[{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"}]}],erc1271Abi=[{name:"isValidSignature",type:"function",stateMutability:"view",inputs:[{name:"hash",type:"bytes32"},{name:"signature",type:"bytes"}],outputs:[{name:"",type:"bytes4"}]}],erc6492SignatureValidatorAbi=[{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{name:"_signer",type:"address"},{name:"_hash",type:"bytes32"},{name:"_signature",type:"bytes"}],outputs:[{type:"bool"}],stateMutability:"nonpayable",type:"function",name:"isValidSig"}],erc20Abi=[{type:"event",name:"Approval",inputs:[{indexed:!0,name:"owner",type:"address"},{indexed:!0,name:"spender",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"event",name:"Transfer",inputs:[{indexed:!0,name:"from",type:"address"},{indexed:!0,name:"to",type:"address"},{indexed:!1,name:"value",type:"uint256"}]},{type:"function",name:"allowance",stateMutability:"view",inputs:[{name:"owner",type:"address"},{name:"spender",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"approve",stateMutability:"nonpayable",inputs:[{name:"spender",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"balanceOf",stateMutability:"view",inputs:[{name:"account",type:"address"}],outputs:[{type:"uint256"}]},{type:"function",name:"decimals",stateMutability:"view",inputs:[],outputs:[{type:"uint8"}]},{type:"function",name:"name",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"symbol",stateMutability:"view",inputs:[],outputs:[{type:"string"}]},{type:"function",name:"totalSupply",stateMutability:"view",inputs:[],outputs:[{type:"uint256"}]},{type:"function",name:"transfer",stateMutability:"nonpayable",inputs:[{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]},{type:"function",name:"transferFrom",stateMutability:"nonpayable",inputs:[{name:"sender",type:"address"},{name:"recipient",type:"address"},{name:"amount",type:"uint256"}],outputs:[{type:"bool"}]}],aggregate3Signature="0x82ad56cb",deploylessCallViaBytecodeBytecode="0x608060405234801561001057600080fd5b5060405161018e38038061018e83398101604081905261002f91610124565b6000808351602085016000f59050803b61004857600080fd5b6000808351602085016000855af16040513d6000823e81610067573d81fd5b3d81f35b634e487b7160e01b600052604160045260246000fd5b600082601f83011261009257600080fd5b81516001600160401b038111156100ab576100ab61006b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156100d9576100d961006b565b6040528181528382016020018510156100f157600080fd5b60005b82811015610110576020818601810151838301820152016100f4565b506000918101602001919091529392505050565b6000806040838503121561013757600080fd5b82516001600160401b0381111561014d57600080fd5b61015985828601610081565b602085015190935090506001600160401b0381111561017757600080fd5b61018385828601610081565b915050925092905056fe",deploylessCallViaFactoryBytecode="0x608060405234801561001057600080fd5b506040516102c03803806102c083398101604081905261002f916101e6565b836001600160a01b03163b6000036100e457600080836001600160a01b03168360405161005c9190610270565b6000604051808303816000865af19150503d8060008114610099576040519150601f19603f3d011682016040523d82523d6000602084013e61009e565b606091505b50915091508115806100b857506001600160a01b0386163b155b156100e1578060405163101bb98d60e01b81526004016100d8919061028c565b60405180910390fd5b50505b6000808451602086016000885af16040513d6000823e81610103573d81fd5b3d81f35b80516001600160a01b038116811461011e57600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561015457818101518382015260200161013c565b50506000910152565b600082601f83011261016e57600080fd5b81516001600160401b0381111561018757610187610123565b604051601f8201601f19908116603f011681016001600160401b03811182821017156101b5576101b5610123565b6040528181528382016020018510156101cd57600080fd5b6101de826020830160208701610139565b949350505050565b600080600080608085870312156101fc57600080fd5b61020585610107565b60208601519094506001600160401b0381111561022157600080fd5b61022d8782880161015d565b93505061023c60408601610107565b60608601519092506001600160401b0381111561025857600080fd5b6102648782880161015d565b91505092959194509250565b60008251610282818460208701610139565b9190910192915050565b60208152600082518060208401526102ab816040850160208701610139565b601f01601f1916919091016040019291505056fe",erc6492SignatureValidatorByteCode="0x608060405234801561001057600080fd5b5060405161069438038061069483398101604081905261002f9161051e565b600061003c848484610048565b9050806000526001601ff35b60007f64926492649264926492649264926492649264926492649264926492649264926100748361040c565b036101e7576000606080848060200190518101906100929190610577565b60405192955090935091506000906001600160a01b038516906100b69085906105dd565b6000604051808303816000865af19150503d80600081146100f3576040519150601f19603f3d011682016040523d82523d6000602084013e6100f8565b606091505b50509050876001600160a01b03163b60000361016057806101605760405162461bcd60e51b815260206004820152601e60248201527f5369676e617475726556616c696461746f723a206465706c6f796d656e74000060448201526064015b60405180910390fd5b604051630b135d3f60e11b808252906001600160a01b038a1690631626ba7e90610190908b9087906004016105f9565b602060405180830381865afa1580156101ad573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906101d19190610633565b6001600160e01b03191614945050505050610405565b6001600160a01b0384163b1561027a57604051630b135d3f60e11b808252906001600160a01b03861690631626ba7e9061022790879087906004016105f9565b602060405180830381865afa158015610244573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906102689190610633565b6001600160e01b031916149050610405565b81516041146102df5760405162461bcd60e51b815260206004820152603a602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e6174757265206c656e6774680000000000006064820152608401610157565b6102e7610425565b5060208201516040808401518451859392600091859190811061030c5761030c61065d565b016020015160f81c9050601b811480159061032b57508060ff16601c14155b1561038c5760405162461bcd60e51b815260206004820152603b602482015260008051602061067483398151915260448201527f3a20696e76616c6964207369676e617475726520762076616c756500000000006064820152608401610157565b60408051600081526020810180835289905260ff83169181019190915260608101849052608081018390526001600160a01b0389169060019060a0016020604051602081039080840390855afa1580156103ea573d6000803e3d6000fd5b505050602060405103516001600160a01b0316149450505050505b9392505050565b600060208251101561041d57600080fd5b508051015190565b60405180606001604052806003906020820280368337509192915050565b6001600160a01b038116811461045857600080fd5b50565b634e487b7160e01b600052604160045260246000fd5b60005b8381101561048c578181015183820152602001610474565b50506000910152565b600082601f8301126104a657600080fd5b81516001600160401b038111156104bf576104bf61045b565b604051601f8201601f19908116603f011681016001600160401b03811182821017156104ed576104ed61045b565b60405281815283820160200185101561050557600080fd5b610516826020830160208701610471565b949350505050565b60008060006060848603121561053357600080fd5b835161053e81610443565b6020850151604086015191945092506001600160401b0381111561056157600080fd5b61056d86828701610495565b9150509250925092565b60008060006060848603121561058c57600080fd5b835161059781610443565b60208501519093506001600160401b038111156105b357600080fd5b6105bf86828701610495565b604086015190935090506001600160401b0381111561056157600080fd5b600082516105ef818460208701610471565b9190910192915050565b828152604060208201526000825180604084015261061e816060850160208701610471565b601f01601f1916919091016060019392505050565b60006020828403121561064557600080fd5b81516001600160e01b03198116811461040557600080fd5b634e487b7160e01b600052603260045260246000fdfe5369676e617475726556616c696461746f72237265636f7665725369676e6572",multicall3Bytecode="0x608060405234801561001057600080fd5b506115b9806100206000396000f3fe6080604052600436106100f35760003560e01c80634d2301cc1161008a578063a8b0574e11610059578063a8b0574e14610325578063bce38bd714610350578063c3077fa914610380578063ee82ac5e146103b2576100f3565b80634d2301cc1461026257806372425d9d1461029f57806382ad56cb146102ca57806386d516e8146102fa576100f3565b80633408e470116100c65780633408e470146101af578063399542e9146101da5780633e64a6961461020c57806342cbb15c14610237576100f3565b80630f28c97d146100f8578063174dea7114610123578063252dba421461015357806327e86d6e14610184575b600080fd5b34801561010457600080fd5b5061010d6103ef565b60405161011a9190610c0a565b60405180910390f35b61013d60048036038101906101389190610c94565b6103f7565b60405161014a9190610e94565b60405180910390f35b61016d60048036038101906101689190610f0c565b610615565b60405161017b92919061101b565b60405180910390f35b34801561019057600080fd5b506101996107ab565b6040516101a69190611064565b60405180910390f35b3480156101bb57600080fd5b506101c46107b7565b6040516101d19190610c0a565b60405180910390f35b6101f460048036038101906101ef91906110ab565b6107bf565b6040516102039392919061110b565b60405180910390f35b34801561021857600080fd5b506102216107e1565b60405161022e9190610c0a565b60405180910390f35b34801561024357600080fd5b5061024c6107e9565b6040516102599190610c0a565b60405180910390f35b34801561026e57600080fd5b50610289600480360381019061028491906111a7565b6107f1565b6040516102969190610c0a565b60405180910390f35b3480156102ab57600080fd5b506102b4610812565b6040516102c19190610c0a565b60405180910390f35b6102e460048036038101906102df919061122a565b61081a565b6040516102f19190610e94565b60405180910390f35b34801561030657600080fd5b5061030f6109e4565b60405161031c9190610c0a565b60405180910390f35b34801561033157600080fd5b5061033a6109ec565b6040516103479190611286565b60405180910390f35b61036a600480360381019061036591906110ab565b6109f4565b6040516103779190610e94565b60405180910390f35b61039a60048036038101906103959190610f0c565b610ba6565b6040516103a99392919061110b565b60405180910390f35b3480156103be57600080fd5b506103d960048036038101906103d491906112cd565b610bca565b6040516103e69190611064565b60405180910390f35b600042905090565b60606000808484905090508067ffffffffffffffff81111561041c5761041b6112fa565b5b60405190808252806020026020018201604052801561045557816020015b610442610bd5565b81526020019060019003908161043a5790505b5092503660005b828110156105c957600085828151811061047957610478611329565b5b6020026020010151905087878381811061049657610495611329565b5b90506020028101906104a89190611367565b925060008360400135905080860195508360000160208101906104cb91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16818580606001906104f2919061138f565b604051610500929190611431565b60006040518083038185875af1925050503d806000811461053d576040519150601f19603f3d011682016040523d82523d6000602084013e610542565b606091505b5083600001846020018290528215151515815250505081516020850135176105bc577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260846000fd5b826001019250505061045c565b5082341461060c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610603906114a7565b60405180910390fd5b50505092915050565b6000606043915060008484905090508067ffffffffffffffff81111561063e5761063d6112fa565b5b60405190808252806020026020018201604052801561067157816020015b606081526020019060019003908161065c5790505b5091503660005b828110156107a157600087878381811061069557610694611329565b5b90506020028101906106a791906114c7565b92508260000160208101906106bc91906111a7565b73ffffffffffffffffffffffffffffffffffffffff168380602001906106e2919061138f565b6040516106f0929190611431565b6000604051808303816000865af19150503d806000811461072d576040519150601f19603f3d011682016040523d82523d6000602084013e610732565b606091505b5086848151811061074657610745611329565b5b60200260200101819052819250505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161078c9061153b565b60405180910390fd5b81600101915050610678565b5050509250929050565b60006001430340905090565b600046905090565b6000806060439250434091506107d68686866109f4565b905093509350939050565b600048905090565b600043905090565b60008173ffffffffffffffffffffffffffffffffffffffff16319050919050565b600044905090565b606060008383905090508067ffffffffffffffff81111561083e5761083d6112fa565b5b60405190808252806020026020018201604052801561087757816020015b610864610bd5565b81526020019060019003908161085c5790505b5091503660005b828110156109db57600084828151811061089b5761089a611329565b5b602002602001015190508686838181106108b8576108b7611329565b5b90506020028101906108ca919061155b565b92508260000160208101906108df91906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060400190610905919061138f565b604051610913929190611431565b6000604051808303816000865af19150503d8060008114610950576040519150601f19603f3d011682016040523d82523d6000602084013e610955565b606091505b5082600001836020018290528215151515815250505080516020840135176109cf577f08c379a000000000000000000000000000000000000000000000000000000000600052602060045260176024527f4d756c746963616c6c333a2063616c6c206661696c656400000000000000000060445260646000fd5b8160010191505061087e565b50505092915050565b600045905090565b600041905090565b606060008383905090508067ffffffffffffffff811115610a1857610a176112fa565b5b604051908082528060200260200182016040528015610a5157816020015b610a3e610bd5565b815260200190600190039081610a365790505b5091503660005b82811015610b9c576000848281518110610a7557610a74611329565b5b60200260200101519050868683818110610a9257610a91611329565b5b9050602002810190610aa491906114c7565b9250826000016020810190610ab991906111a7565b73ffffffffffffffffffffffffffffffffffffffff16838060200190610adf919061138f565b604051610aed929190611431565b6000604051808303816000865af19150503d8060008114610b2a576040519150601f19603f3d011682016040523d82523d6000602084013e610b2f565b606091505b508260000183602001829052821515151581525050508715610b90578060000151610b8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b869061153b565b60405180910390fd5b5b81600101915050610a58565b5050509392505050565b6000806060610bb7600186866107bf565b8093508194508295505050509250925092565b600081409050919050565b6040518060400160405280600015158152602001606081525090565b6000819050919050565b610c0481610bf1565b82525050565b6000602082019050610c1f6000830184610bfb565b92915050565b600080fd5b600080fd5b600080fd5b600080fd5b600080fd5b60008083601f840112610c5457610c53610c2f565b5b8235905067ffffffffffffffff811115610c7157610c70610c34565b5b602083019150836020820283011115610c8d57610c8c610c39565b5b9250929050565b60008060208385031215610cab57610caa610c25565b5b600083013567ffffffffffffffff811115610cc957610cc8610c2a565b5b610cd585828601610c3e565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b60008115159050919050565b610d2281610d0d565b82525050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610d62578082015181840152602081019050610d47565b83811115610d71576000848401525b50505050565b6000601f19601f8301169050919050565b6000610d9382610d28565b610d9d8185610d33565b9350610dad818560208601610d44565b610db681610d77565b840191505092915050565b6000604083016000830151610dd96000860182610d19565b5060208301518482036020860152610df18282610d88565b9150508091505092915050565b6000610e0a8383610dc1565b905092915050565b6000602082019050919050565b6000610e2a82610ce1565b610e348185610cec565b935083602082028501610e4685610cfd565b8060005b85811015610e825784840389528151610e638582610dfe565b9450610e6e83610e12565b925060208a01995050600181019050610e4a565b50829750879550505050505092915050565b60006020820190508181036000830152610eae8184610e1f565b905092915050565b60008083601f840112610ecc57610ecb610c2f565b5b8235905067ffffffffffffffff811115610ee957610ee8610c34565b5b602083019150836020820283011115610f0557610f04610c39565b5b9250929050565b60008060208385031215610f2357610f22610c25565b5b600083013567ffffffffffffffff811115610f4157610f40610c2a565b5b610f4d85828601610eb6565b92509250509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6000610f918383610d88565b905092915050565b6000602082019050919050565b6000610fb182610f59565b610fbb8185610f64565b935083602082028501610fcd85610f75565b8060005b858110156110095784840389528151610fea8582610f85565b9450610ff583610f99565b925060208a01995050600181019050610fd1565b50829750879550505050505092915050565b60006040820190506110306000830185610bfb565b81810360208301526110428184610fa6565b90509392505050565b6000819050919050565b61105e8161104b565b82525050565b60006020820190506110796000830184611055565b92915050565b61108881610d0d565b811461109357600080fd5b50565b6000813590506110a58161107f565b92915050565b6000806000604084860312156110c4576110c3610c25565b5b60006110d286828701611096565b935050602084013567ffffffffffffffff8111156110f3576110f2610c2a565b5b6110ff86828701610eb6565b92509250509250925092565b60006060820190506111206000830186610bfb565b61112d6020830185611055565b818103604083015261113f8184610e1f565b9050949350505050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061117482611149565b9050919050565b61118481611169565b811461118f57600080fd5b50565b6000813590506111a18161117b565b92915050565b6000602082840312156111bd576111bc610c25565b5b60006111cb84828501611192565b91505092915050565b60008083601f8401126111ea576111e9610c2f565b5b8235905067ffffffffffffffff81111561120757611206610c34565b5b60208301915083602082028301111561122357611222610c39565b5b9250929050565b6000806020838503121561124157611240610c25565b5b600083013567ffffffffffffffff81111561125f5761125e610c2a565b5b61126b858286016111d4565b92509250509250929050565b61128081611169565b82525050565b600060208201905061129b6000830184611277565b92915050565b6112aa81610bf1565b81146112b557600080fd5b50565b6000813590506112c7816112a1565b92915050565b6000602082840312156112e3576112e2610c25565b5b60006112f1848285016112b8565b91505092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b600080fd5b600080fd5b600080fd5b60008235600160800383360303811261138357611382611358565b5b80830191505092915050565b600080833560016020038436030381126113ac576113ab611358565b5b80840192508235915067ffffffffffffffff8211156113ce576113cd61135d565b5b6020830192506001820236038313156113ea576113e9611362565b5b509250929050565b600081905092915050565b82818337600083830152505050565b600061141883856113f2565b93506114258385846113fd565b82840190509392505050565b600061143e82848661140c565b91508190509392505050565b600082825260208201905092915050565b7f4d756c746963616c6c333a2076616c7565206d69736d61746368000000000000600082015250565b6000611491601a8361144a565b915061149c8261145b565b602082019050919050565b600060208201905081810360008301526114c081611484565b9050919050565b6000823560016040038336030381126114e3576114e2611358565b5b80830191505092915050565b7f4d756c746963616c6c333a2063616c6c206661696c6564000000000000000000600082015250565b600061152560178361144a565b9150611530826114ef565b602082019050919050565b6000602082019050818103600083015261155481611518565b9050919050565b60008235600160600383360303811261157757611576611358565b5b8083019150509291505056fea264697066735822122020c1bc9aacf8e4a6507193432a895a8e77094f45a1395583f07b24e860ef06cd64736f6c634300080c0033";class ChainDoesNotSupportContract extends BaseError$1{constructor({blockNumber:_,chain:$,contract:j}){super(`Chain "${$.name}" does not support contract "${j.name}".`,{metaMessages:["This could be due to any of the following:",..._&&j.blockCreated&&j.blockCreated>_?[`- The contract "${j.name}" was not deployed until block ${j.blockCreated} (current block ${_}).`]:[`- The chain does not have the contract "${j.name}" configured.`]],name:"ChainDoesNotSupportContract"})}}class ChainMismatchError extends BaseError$1{constructor({chain:_,currentChainId:$}){super(`The current chain of the wallet (id: ${$}) does not match the target chain for the transaction (id: ${_.id} – ${_.name}).`,{metaMessages:[`Current Chain ID: ${$}`,`Expected Chain ID: ${_.id} – ${_.name}`],name:"ChainMismatchError"})}}class ChainNotFoundError extends BaseError$1{constructor(){super(["No chain was provided to the request.","Please provide a chain with the `chain` argument on the Action, or by supplying a `chain` to WalletClient."].join(` -`),{name:"ChainNotFoundError"})}}class ClientChainNotConfiguredError extends BaseError$1{constructor(){super("No chain was provided to the Client.",{name:"ClientChainNotConfiguredError"})}}const docsPath$2="/docs/contract/encodeDeployData";function encodeDeployData(o){const{abi:_,args:$,bytecode:j}=o;if(!$||$.length===0)return j;const _e=_.find(tt=>"type"in tt&&tt.type==="constructor");if(!_e)throw new AbiConstructorNotFoundError({docsPath:docsPath$2});if(!("inputs"in _e))throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});if(!_e.inputs||_e.inputs.length===0)throw new AbiConstructorParamsNotFoundError({docsPath:docsPath$2});const et=encodeAbiParameters(_e.inputs,$);return concatHex([j,et])}function getChainContractAddress({blockNumber:o,chain:_,contract:$}){var _e;const j=(_e=_==null?void 0:_.contracts)==null?void 0:_e[$];if(!j)throw new ChainDoesNotSupportContract({chain:_,contract:{name:$}});if(o&&j.blockCreated&&j.blockCreated>o)throw new ChainDoesNotSupportContract({blockNumber:o,chain:_,contract:{name:$,blockCreated:j.blockCreated}});return j.address}function getCallError(o,{docsPath:_,...$}){const j=(()=>{const _e=getNodeError(o,$);return _e instanceof UnknownNodeError?o:_e})();return new CallExecutionError(j,{docsPath:_,...$})}function withResolvers(){let o=()=>{},_=()=>{};return{promise:new Promise((j,_e)=>{o=j,_=_e}),resolve:o,reject:_}}const schedulerCache=new Map;function createBatchScheduler({fn:o,id:_,shouldSplitBatch:$,wait:j=0,sort:_e}){const et=async()=>{const it=nt();tt();const st=it.map(({args:at})=>at);st.length!==0&&o(st).then(at=>{_e&&Array.isArray(at)&&at.sort(_e);for(let lt=0;lt{for(let lt=0;ltschedulerCache.delete(_),rt=()=>nt().map(({args:it})=>it),nt=()=>schedulerCache.get(_)||[],ot=it=>schedulerCache.set(_,[...nt(),it]);return{flush:tt,async schedule(it){const{promise:st,resolve:at,reject:lt}=withResolvers();return($==null?void 0:$([...rt(),it]))&&et(),nt().length>0?(ot({args:it,resolve:at,reject:lt}),st):(ot({args:it,resolve:at,reject:lt}),setTimeout(et,j),st)}}}async function call(o,_){var bt,mt,gt,xt;const{account:$=o.account,authorizationList:j,batch:_e=!!((bt=o.batch)!=null&&bt.multicall),blockNumber:et,blockTag:tt=o.experimental_blockTag??"latest",accessList:rt,blobs:nt,blockOverrides:ot,code:it,data:st,factory:at,factoryData:lt,gas:ct,gasPrice:ft,maxFeePerBlobGas:dt,maxFeePerGas:pt,maxPriorityFeePerGas:yt,nonce:vt,to:wt,value:Ct,stateOverride:Pt,...Bt}=_,At=$?parseAccount($):void 0;if(it&&(at||lt))throw new BaseError$1("Cannot provide both `code` & `factory`/`factoryData` as parameters.");if(it&&wt)throw new BaseError$1("Cannot provide both `code` & `to` as parameters.");const kt=it&&st,Ot=at&<&&wt&&st,Tt=kt||Ot,ht=kt?toDeploylessCallViaBytecodeData({code:it,data:st}):Ot?toDeploylessCallViaFactoryData({data:st,factory:at,factoryData:lt,to:wt}):st;try{assertRequest(_);const _t=(typeof et=="bigint"?numberToHex(et):void 0)||tt,$t=ot?toRpc(ot):void 0,St=serializeStateOverride(Pt),Rt=(xt=(gt=(mt=o.chain)==null?void 0:mt.formatters)==null?void 0:gt.transactionRequest)==null?void 0:xt.format,Mt=(Rt||formatTransactionRequest)({...extract$1(Bt,{format:Rt}),accessList:rt,account:At,authorizationList:j,blobs:nt,data:ht,gas:ct,gasPrice:ft,maxFeePerBlobGas:dt,maxFeePerGas:pt,maxPriorityFeePerGas:yt,nonce:vt,to:Tt?void 0:wt,value:Ct},"call");if(_e&&shouldPerformMulticall({request:Mt})&&!St&&!$t)try{return await scheduleMulticall(o,{...Mt,blockNumber:et,blockTag:tt})}catch(zt){if(!(zt instanceof ClientChainNotConfiguredError)&&!(zt instanceof ChainDoesNotSupportContract))throw zt}const Vt=(()=>{const zt=[Mt,_t];return St&&$t?[...zt,St,$t]:St?[...zt,St]:$t?[...zt,{},$t]:zt})(),Gt=await o.request({method:"eth_call",params:Vt});return Gt==="0x"?{data:void 0}:{data:Gt}}catch(Et){const _t=getRevertErrorData(Et),{offchainLookup:$t,offchainLookupSignature:St}=await __vitePreload(async()=>{const{offchainLookup:Rt,offchainLookupSignature:It}=await import("./ccip-L2KjvZow.js");return{offchainLookup:Rt,offchainLookupSignature:It}},[]);if(o.ccipRead!==!1&&(_t==null?void 0:_t.slice(0,10))===St&&wt)return{data:await $t(o,{data:_t,to:wt})};throw Tt&&(_t==null?void 0:_t.slice(0,10))==="0x101bb98d"?new CounterfactualDeploymentFailedError({factory:at}):getCallError(Et,{..._,account:At,chain:o.chain})}}function shouldPerformMulticall({request:o}){const{data:_,to:$,...j}=o;return!(!_||_.startsWith(aggregate3Signature)||!$||Object.values(j).filter(_e=>typeof _e<"u").length>0)}async function scheduleMulticall(o,_){var ft;const{batchSize:$=1024,deployless:j=!1,wait:_e=0}=typeof((ft=o.batch)==null?void 0:ft.multicall)=="object"?o.batch.multicall:{},{blockNumber:et,blockTag:tt=o.experimental_blockTag??"latest",data:rt,to:nt}=_,ot=(()=>{if(j)return null;if(_.multicallAddress)return _.multicallAddress;if(o.chain)return getChainContractAddress({blockNumber:et,chain:o.chain,contract:"multicall3"});throw new ClientChainNotConfiguredError})(),st=(typeof et=="bigint"?numberToHex(et):void 0)||tt,{schedule:at}=createBatchScheduler({id:`${o.uid}.${st}`,wait:_e,shouldSplitBatch(dt){return dt.reduce((yt,{data:vt})=>yt+(vt.length-2),0)>$*2},fn:async dt=>{const pt=dt.map(wt=>({allowFailure:!0,callData:wt.data,target:wt.to})),yt=encodeFunctionData({abi:multicall3Abi,args:[pt],functionName:"aggregate3"}),vt=await o.request({method:"eth_call",params:[{...ot===null?{data:toDeploylessCallViaBytecodeData({code:multicall3Bytecode,data:yt})}:{to:ot,data:yt}},st]});return decodeFunctionResult({abi:multicall3Abi,args:[pt],functionName:"aggregate3",data:vt||"0x"})}}),[{returnData:lt,success:ct}]=await at({data:rt,to:nt});if(!ct)throw new RawContractError({data:lt});return lt==="0x"?{data:void 0}:{data:lt}}function toDeploylessCallViaBytecodeData(o){const{code:_,data:$}=o;return encodeDeployData({abi:parseAbi(["constructor(bytes, bytes)"]),bytecode:deploylessCallViaBytecodeBytecode,args:[_,$]})}function toDeploylessCallViaFactoryData(o){const{data:_,factory:$,factoryData:j,to:_e}=o;return encodeDeployData({abi:parseAbi(["constructor(address, bytes, address, bytes)"]),bytecode:deploylessCallViaFactoryBytecode,args:[_e,_,$,j]})}function getRevertErrorData(o){var $;if(!(o instanceof BaseError$1))return;const _=o.walk();return typeof(_==null?void 0:_.data)=="object"?($=_.data)==null?void 0:$.data:_.data}async function readContract(o,_){const{abi:$,address:j,args:_e,functionName:et,...tt}=_,rt=encodeFunctionData({abi:$,args:_e,functionName:et});try{const{data:nt}=await getAction(o,call,"call")({...tt,data:rt,to:j});return decodeFunctionResult({abi:$,args:_e,functionName:et,data:nt||"0x"})}catch(nt){throw getContractError(nt,{abi:$,address:j,args:_e,docsPath:"/docs/contract/readContract",functionName:et})}}async function simulateContract(o,_){var it;const{abi:$,address:j,args:_e,functionName:et,dataSuffix:tt=typeof o.dataSuffix=="string"?o.dataSuffix:(it=o.dataSuffix)==null?void 0:it.value,...rt}=_,nt=rt.account?parseAccount(rt.account):o.account,ot=encodeFunctionData({abi:$,args:_e,functionName:et});try{const{data:st}=await getAction(o,call,"call")({batch:!1,data:`${ot}${tt?tt.replace("0x",""):""}`,to:j,...rt,account:nt}),at=decodeFunctionResult({abi:$,args:_e,functionName:et,data:st||"0x"}),lt=$.filter(ct=>"name"in ct&&ct.name===_.functionName);return{result:at,request:{abi:lt,address:j,args:_e,dataSuffix:tt,functionName:et,...rt,account:nt}}}catch(st){throw getContractError(st,{abi:$,address:j,args:_e,docsPath:"/docs/contract/simulateContract",functionName:et,sender:nt==null?void 0:nt.address})}}const listenersCache=new Map,cleanupCache=new Map;let callbackCount=0;function observe(o,_,$){const j=++callbackCount,_e=()=>listenersCache.get(o)||[],et=()=>{const it=_e();listenersCache.set(o,it.filter(st=>st.id!==j))},tt=()=>{const it=_e();if(!it.some(at=>at.id===j))return;const st=cleanupCache.get(o);if(it.length===1&&st){const at=st();at instanceof Promise&&at.catch(()=>{})}et()},rt=_e();if(listenersCache.set(o,[...rt,{id:j,fns:_}]),rt&&rt.length>0)return tt;const nt={};for(const it in _)nt[it]=(...st)=>{var lt,ct;const at=_e();if(at.length!==0)for(const ft of at)(ct=(lt=ft.fns)[it])==null||ct.call(lt,...st)};const ot=$(nt);return typeof ot=="function"&&cleanupCache.set(o,ot),tt}async function wait(o){return new Promise(_=>setTimeout(_,o))}function poll(o,{emitOnBegin:_,initialWaitTime:$,interval:j}){let _e=!0;const et=()=>_e=!1;return(async()=>{let rt;_&&(rt=await o({unpoll:et}));const nt=await($==null?void 0:$(rt))??j;await wait(nt);const ot=async()=>{_e&&(await o({unpoll:et}),await wait(j),ot())};ot()})(),et}const promiseCache$1=new Map,responseCache=new Map;function getCache(o){const _=(_e,et)=>({clear:()=>et.delete(_e),get:()=>et.get(_e),set:tt=>et.set(_e,tt)}),$=_(o,promiseCache$1),j=_(o,responseCache);return{clear:()=>{$.clear(),j.clear()},promise:$,response:j}}async function withCache(o,{cacheKey:_,cacheTime:$=Number.POSITIVE_INFINITY}){const j=getCache(_),_e=j.response.get();if(_e&&$>0&&Date.now()-_e.created.getTime()<$)return _e.data;let et=j.promise.get();et||(et=o(),j.promise.set(et));try{const tt=await et;return j.response.set({created:new Date,data:tt}),tt}finally{j.promise.clear()}}const cacheKey=o=>`blockNumber.${o}`;async function getBlockNumber(o,{cacheTime:_=o.cacheTime}={}){const $=await withCache(()=>o.request({method:"eth_blockNumber"}),{cacheKey:cacheKey(o.uid),cacheTime:_});return BigInt($)}async function getFilterChanges(o,{filter:_}){const $="strict"in _&&_.strict,j=await _.request({method:"eth_getFilterChanges",params:[_.id]});if(typeof j[0]=="string")return j;const _e=j.map(et=>formatLog(et));return!("abi"in _)||!_.abi?_e:parseEventLogs({abi:_.abi,logs:_e,strict:$})}async function uninstallFilter(o,{filter:_}){return _.request({method:"eth_uninstallFilter",params:[_.id]})}function watchContractEvent(o,_){const{abi:$,address:j,args:_e,batch:et=!0,eventName:tt,fromBlock:rt,onError:nt,onLogs:ot,poll:it,pollingInterval:st=o.pollingInterval,strict:at}=_;return(typeof it<"u"?it:typeof rt=="bigint"?!0:!(o.transport.type==="webSocket"||o.transport.type==="ipc"||o.transport.type==="fallback"&&(o.transport.transports[0].config.type==="webSocket"||o.transport.transports[0].config.type==="ipc")))?(()=>{const dt=at??!1,pt=stringify$5(["watchContractEvent",j,_e,et,o.uid,tt,st,dt,rt]);return observe(pt,{onLogs:ot,onError:nt},yt=>{let vt;rt!==void 0&&(vt=rt-1n);let wt,Ct=!1;const Pt=poll(async()=>{var Bt;if(!Ct){try{wt=await getAction(o,createContractEventFilter,"createContractEventFilter")({abi:$,address:j,args:_e,eventName:tt,strict:dt,fromBlock:rt})}catch{}Ct=!0;return}try{let At;if(wt)At=await getAction(o,getFilterChanges,"getFilterChanges")({filter:wt});else{const kt=await getAction(o,getBlockNumber,"getBlockNumber")({});vt&&vt{wt&&await getAction(o,uninstallFilter,"uninstallFilter")({filter:wt}),Pt()}})})():(()=>{const dt=at??!1,pt=stringify$5(["watchContractEvent",j,_e,et,o.uid,tt,st,dt]);let yt=!0,vt=()=>yt=!1;return observe(pt,{onLogs:ot,onError:nt},wt=>((async()=>{try{const Ct=(()=>{if(o.transport.type==="fallback"){const At=o.transport.transports.find(kt=>kt.config.type==="webSocket"||kt.config.type==="ipc");return At?At.value:o.transport}return o.transport})(),Pt=tt?encodeEventTopics({abi:$,eventName:tt,args:_e}):[],{unsubscribe:Bt}=await Ct.subscribe({params:["logs",{address:j,topics:Pt}],onData(At){var Ot;if(!yt)return;const kt=At.result;try{const{eventName:Tt,args:ht}=decodeEventLog({abi:$,data:kt.data,topics:kt.topics,strict:at}),bt=formatLog(kt,{args:ht,eventName:Tt});wt.onLogs([bt])}catch(Tt){let ht,bt;if(Tt instanceof DecodeLogDataMismatch||Tt instanceof DecodeLogTopicsMismatch){if(at)return;ht=Tt.abiItem.name,bt=(Ot=Tt.abiItem.inputs)==null?void 0:Ot.some(gt=>!("name"in gt&>.name))}const mt=formatLog(kt,{args:bt?[]:{},eventName:ht});wt.onLogs([mt])}},onError(At){var kt;(kt=wt.onError)==null||kt.call(wt,At)}});vt=Bt,yt||vt()}catch(Ct){nt==null||nt(Ct)}})(),()=>vt()))})()}class AccountNotFoundError extends BaseError$1{constructor({docsPath:_}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` -`),{docsPath:_,docsSlug:"account",name:"AccountNotFoundError"})}}class AccountTypeNotSupportedError extends BaseError$1{constructor({docsPath:_,metaMessages:$,type:j}){super(`Account type "${j}" is not supported.`,{docsPath:_,metaMessages:$,name:"AccountTypeNotSupportedError"})}}function assertCurrentChain({chain:o,currentChainId:_}){if(!o)throw new ChainNotFoundError;if(_!==o.id)throw new ChainMismatchError({chain:o,currentChainId:_})}async function sendRawTransaction(o,{serializedTransaction:_}){return o.request({method:"eth_sendRawTransaction",params:[_]},{retryCount:0})}const supportsWalletNamespace$1=new LruMap$1(128);async function sendTransaction(o,_){var wt,Ct,Pt,Bt,At;const{account:$=o.account,assertChainId:j=!0,chain:_e=o.chain,accessList:et,authorizationList:tt,blobs:rt,data:nt,dataSuffix:ot=typeof o.dataSuffix=="string"?o.dataSuffix:(wt=o.dataSuffix)==null?void 0:wt.value,gas:it,gasPrice:st,maxFeePerBlobGas:at,maxFeePerGas:lt,maxPriorityFeePerGas:ct,nonce:ft,type:dt,value:pt,...yt}=_;if(typeof $>"u")throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransaction"});const vt=$?parseAccount($):null;try{assertRequest(_);const kt=await(async()=>{if(_.to)return _.to;if(_.to!==null&&tt&&tt.length>0)return await recoverAuthorizationAddress({authorization:tt[0]}).catch(()=>{throw new BaseError$1("`to` is required. Could not infer from `authorizationList`.")})})();if((vt==null?void 0:vt.type)==="json-rpc"||vt===null){let Ot;_e!==null&&(Ot=await getAction(o,getChainId,"getChainId")({}),j&&assertCurrentChain({currentChainId:Ot,chain:_e}));const Tt=(Bt=(Pt=(Ct=o.chain)==null?void 0:Ct.formatters)==null?void 0:Pt.transactionRequest)==null?void 0:Bt.format,bt=(Tt||formatTransactionRequest)({...extract$1(yt,{format:Tt}),accessList:et,account:vt,authorizationList:tt,blobs:rt,chainId:Ot,data:nt&&concat$2([nt,ot??"0x"]),gas:it,gasPrice:st,maxFeePerBlobGas:at,maxFeePerGas:lt,maxPriorityFeePerGas:ct,nonce:ft,to:kt,type:dt,value:pt},"sendTransaction"),mt=supportsWalletNamespace$1.get(o.uid),gt=mt?"wallet_sendTransaction":"eth_sendTransaction";try{return await o.request({method:gt,params:[bt]},{retryCount:0})}catch(xt){if(mt===!1)throw xt;const Et=xt;if(Et.name==="InvalidInputRpcError"||Et.name==="InvalidParamsRpcError"||Et.name==="MethodNotFoundRpcError"||Et.name==="MethodNotSupportedRpcError")return await o.request({method:"wallet_sendTransaction",params:[bt]},{retryCount:0}).then(_t=>(supportsWalletNamespace$1.set(o.uid,!0),_t)).catch(_t=>{const $t=_t;throw $t.name==="MethodNotFoundRpcError"||$t.name==="MethodNotSupportedRpcError"?(supportsWalletNamespace$1.set(o.uid,!1),Et):$t});throw Et}}if((vt==null?void 0:vt.type)==="local"){const Ot=await getAction(o,prepareTransactionRequest,"prepareTransactionRequest")({account:vt,accessList:et,authorizationList:tt,blobs:rt,chain:_e,data:nt&&concat$2([nt,ot??"0x"]),gas:it,gasPrice:st,maxFeePerBlobGas:at,maxFeePerGas:lt,maxPriorityFeePerGas:ct,nonce:ft,nonceManager:vt.nonceManager,parameters:[...defaultParameters,"sidecars"],type:dt,value:pt,...yt,to:kt}),Tt=(At=_e==null?void 0:_e.serializers)==null?void 0:At.transaction,ht=await vt.signTransaction(Ot,{serializer:Tt});return await getAction(o,sendRawTransaction,"sendRawTransaction")({serializedTransaction:ht})}throw(vt==null?void 0:vt.type)==="smart"?new AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransaction",type:vt==null?void 0:vt.type})}catch(kt){throw kt instanceof AccountTypeNotSupportedError?kt:getTransactionError(kt,{..._,account:vt,chain:_.chain||void 0})}}async function writeContract(o,_){return writeContract.internal(o,sendTransaction,"sendTransaction",_)}(function(o){async function _($,j,_e,et){const{abi:tt,account:rt=$.account,address:nt,args:ot,functionName:it,...st}=et;if(typeof rt>"u")throw new AccountNotFoundError({docsPath:"/docs/contract/writeContract"});const at=rt?parseAccount(rt):null,lt=encodeFunctionData({abi:tt,args:ot,functionName:it});try{return await getAction($,j,_e)({data:lt,to:nt,account:at,...st})}catch(ct){throw getContractError(ct,{abi:tt,address:nt,args:ot,docsPath:"/docs/contract/writeContract",functionName:it,sender:at==null?void 0:at.address})}}o.internal=_})(writeContract||(writeContract={}));class BundleFailedError extends BaseError$1{constructor(_){super(`Call bundle failed with status: ${_.statusCode}`,{name:"BundleFailedError"}),Object.defineProperty(this,"result",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.result=_}}function withRetry(o,{delay:_=100,retryCount:$=2,shouldRetry:j=()=>!0}={}){return new Promise((_e,et)=>{const tt=async({count:rt=0}={})=>{const nt=async({error:ot})=>{const it=typeof _=="function"?_({count:rt,error:ot}):_;it&&await wait(it),tt({count:rt+1})};try{const ot=await o();_e(ot)}catch(ot){if(rt<$&&await j({count:rt,error:ot}))return nt({error:ot});et(ot)}};tt()})}const receiptStatuses={"0x0":"reverted","0x1":"success"};function formatTransactionReceipt(o,_){const $={...o,blockNumber:o.blockNumber?BigInt(o.blockNumber):null,contractAddress:o.contractAddress?o.contractAddress:null,cumulativeGasUsed:o.cumulativeGasUsed?BigInt(o.cumulativeGasUsed):null,effectiveGasPrice:o.effectiveGasPrice?BigInt(o.effectiveGasPrice):null,gasUsed:o.gasUsed?BigInt(o.gasUsed):null,logs:o.logs?o.logs.map(j=>formatLog(j)):null,to:o.to?o.to:null,transactionIndex:o.transactionIndex?hexToNumber$3(o.transactionIndex):null,status:o.status?receiptStatuses[o.status]:null,type:o.type?transactionType[o.type]||o.type:null};return o.blobGasPrice&&($.blobGasPrice=BigInt(o.blobGasPrice)),o.blobGasUsed&&($.blobGasUsed=BigInt(o.blobGasUsed)),$}const fallbackMagicIdentifier="0x5792579257925792579257925792579257925792579257925792579257925792",fallbackTransactionErrorMagicIdentifier=numberToHex(0,{size:32});async function sendCalls(o,_){var at;const{account:$=o.account,chain:j=o.chain,experimental_fallback:_e,experimental_fallbackDelay:et=32,forceAtomic:tt=!1,id:rt,version:nt="2.0.0"}=_,ot=$?parseAccount($):null;let it=_.capabilities;o.dataSuffix&&!((at=_.capabilities)!=null&&at.dataSuffix)&&(typeof o.dataSuffix=="string"?it={..._.capabilities,dataSuffix:{value:o.dataSuffix,optional:!0}}:it={..._.capabilities,dataSuffix:{value:o.dataSuffix.value,...o.dataSuffix.required?{}:{optional:!0}}});const st=_.calls.map(lt=>{const ct=lt,ft=ct.abi?encodeFunctionData({abi:ct.abi,functionName:ct.functionName,args:ct.args}):ct.data;return{data:ct.dataSuffix&&ft?concat$2([ft,ct.dataSuffix]):ft,to:ct.to,value:ct.value?numberToHex(ct.value):void 0}});try{const lt=await o.request({method:"wallet_sendCalls",params:[{atomicRequired:tt,calls:st,capabilities:it,chainId:numberToHex(j.id),from:ot==null?void 0:ot.address,id:rt,version:nt}]},{retryCount:0});return typeof lt=="string"?{id:lt}:lt}catch(lt){const ct=lt;if(_e&&(ct.name==="MethodNotFoundRpcError"||ct.name==="MethodNotSupportedRpcError"||ct.name==="UnknownRpcError"||ct.details.toLowerCase().includes("does not exist / is not available")||ct.details.toLowerCase().includes("missing or invalid. request()")||ct.details.toLowerCase().includes("did not match any variant of untagged enum")||ct.details.toLowerCase().includes("account upgraded to unsupported contract")||ct.details.toLowerCase().includes("eip-7702 not supported")||ct.details.toLowerCase().includes("unsupported wc_ method")||ct.details.toLowerCase().includes("feature toggled misconfigured")||ct.details.toLowerCase().includes("jsonrpcengine: response has no error or result for request"))){if(it&&Object.values(it).some(vt=>!vt.optional)){const vt="non-optional `capabilities` are not supported on fallback to `eth_sendTransaction`.";throw new UnsupportedNonOptionalCapabilityError(new BaseError$1(vt,{details:vt}))}if(tt&&st.length>1){const yt="`forceAtomic` is not supported on fallback to `eth_sendTransaction`.";throw new AtomicityNotSupportedError(new BaseError$1(yt,{details:yt}))}const ft=[];for(const yt of st){const vt=sendTransaction(o,{account:ot,chain:j,data:yt.data,to:yt.to,value:yt.value?hexToBigInt(yt.value):void 0});ft.push(vt),et>0&&await new Promise(wt=>setTimeout(wt,et))}const dt=await Promise.allSettled(ft);if(dt.every(yt=>yt.status==="rejected"))throw dt[0].reason;const pt=dt.map(yt=>yt.status==="fulfilled"?yt.value:fallbackTransactionErrorMagicIdentifier);return{id:concat$2([...pt,numberToHex(j.id,{size:32}),fallbackMagicIdentifier])}}throw getTransactionError(lt,{..._,account:ot,chain:_.chain})}}async function getCallsStatus(o,_){async function $(it){if(it.endsWith(fallbackMagicIdentifier.slice(2))){const at=trim$2(sliceHex(it,-64,-32)),lt=sliceHex(it,0,-64).slice(2).match(/.{1,64}/g),ct=await Promise.all(lt.map(dt=>fallbackTransactionErrorMagicIdentifier.slice(2)!==dt?o.request({method:"eth_getTransactionReceipt",params:[`0x${dt}`]},{dedupe:!0}):void 0)),ft=ct.some(dt=>dt===null)?100:ct.every(dt=>(dt==null?void 0:dt.status)==="0x1")?200:ct.every(dt=>(dt==null?void 0:dt.status)==="0x0")?500:600;return{atomic:!1,chainId:hexToNumber$3(at),receipts:ct.filter(Boolean),status:ft,version:"2.0.0"}}return o.request({method:"wallet_getCallsStatus",params:[it]})}const{atomic:j=!1,chainId:_e,receipts:et,version:tt="2.0.0",...rt}=await $(_.id),[nt,ot]=(()=>{const it=rt.status;return it>=100&&it<200?["pending",it]:it>=200&&it<300?["success",it]:it>=300&&it<700?["failure",it]:it==="CONFIRMED"?["success",200]:it==="PENDING"?["pending",100]:[void 0,it]})();return{...rt,atomic:j,chainId:_e?hexToNumber$3(_e):void 0,receipts:(et==null?void 0:et.map(it=>({...it,blockNumber:hexToBigInt(it.blockNumber),gasUsed:hexToBigInt(it.gasUsed),status:receiptStatuses[it.status]})))??[],statusCode:ot,status:nt,version:tt}}async function waitForCallsStatus(o,_){const{id:$,pollingInterval:j=o.pollingInterval,status:_e=({statusCode:ft})=>ft===200||ft>=300,retryCount:et=4,retryDelay:tt=({count:ft})=>~~(1<{const dt=poll(async()=>{const pt=yt=>{clearTimeout(lt),dt(),yt(),ct()};try{const yt=await withRetry(async()=>{const vt=await getAction(o,getCallsStatus,"getCallsStatus")({id:$});if(nt&&vt.status==="failure")throw new BundleFailedError(vt);return vt},{retryCount:et,delay:tt});if(!_e(yt))return;pt(()=>ft.resolve(yt))}catch(yt){pt(()=>ft.reject(yt))}},{interval:j,emitOnBegin:!0});return dt});return lt=rt?setTimeout(()=>{ct(),clearTimeout(lt),at(new WaitForCallsStatusTimeoutError({id:$}))},rt):void 0,await it}class WaitForCallsStatusTimeoutError extends BaseError$1{constructor({id:_}){super(`Timed out while waiting for call bundle with id "${_}" to be confirmed.`,{name:"WaitForCallsStatusTimeoutError"})}}const size=256;let index=size,buffer$2;function uid(o=11){if(!buffer$2||index+o>size*2){buffer$2="",index=0;for(let _=0;_{const Pt=Ct(wt);for(const At in yt)delete Pt[At];const Bt={...wt,...Pt};return Object.assign(Bt,{extend:vt(Bt)})}}return Object.assign(yt,{extend:vt(yt)})}function isNullUniversalResolverError(o){var $,j,_e,et,tt,rt;if(!(o instanceof BaseError$1))return!1;const _=o.walk(nt=>nt instanceof ContractFunctionRevertedError);return _ instanceof ContractFunctionRevertedError?(($=_.data)==null?void 0:$.errorName)==="HttpError"||((j=_.data)==null?void 0:j.errorName)==="ResolverError"||((_e=_.data)==null?void 0:_e.errorName)==="ResolverNotContract"||((et=_.data)==null?void 0:et.errorName)==="ResolverNotFound"||((tt=_.data)==null?void 0:tt.errorName)==="ReverseAddressMismatch"||((rt=_.data)==null?void 0:rt.errorName)==="UnsupportedResolverProfile":!1}function decodeFunctionData(o){const{abi:_,data:$}=o,j=slice$4($,0,4),_e=_.find(et=>et.type==="function"&&j===toFunctionSelector(formatAbiItem(et)));if(!_e)throw new AbiFunctionSignatureNotFoundError(j,{docsPath:"/docs/contract/decodeFunctionData"});return{functionName:_e.name,args:"inputs"in _e&&_e.inputs&&_e.inputs.length>0?decodeAbiParameters(_e.inputs,slice$4($,4)):void 0}}const docsPath$1="/docs/contract/encodeErrorResult";function encodeErrorResult(o){const{abi:_,errorName:$,args:j}=o;let _e=_[0];if($){const nt=getAbiItem({abi:_,args:j,name:$});if(!nt)throw new AbiErrorNotFoundError($,{docsPath:docsPath$1});_e=nt}if(_e.type!=="error")throw new AbiErrorNotFoundError(void 0,{docsPath:docsPath$1});const et=formatAbiItem(_e),tt=toFunctionSelector(et);let rt="0x";if(j&&j.length>0){if(!_e.inputs)throw new AbiErrorInputsNotFoundError(_e.name,{docsPath:docsPath$1});rt=encodeAbiParameters(_e.inputs,j)}return concatHex([tt,rt])}const docsPath="/docs/contract/encodeFunctionResult";function encodeFunctionResult(o){const{abi:_,functionName:$,result:j}=o;let _e=_[0];if($){const tt=getAbiItem({abi:_,name:$});if(!tt)throw new AbiFunctionNotFoundError($,{docsPath});_e=tt}if(_e.type!=="function")throw new AbiFunctionNotFoundError(void 0,{docsPath});if(!_e.outputs)throw new AbiFunctionOutputsNotFoundError(_e.name,{docsPath});const et=(()=>{if(_e.outputs.length===0)return[];if(_e.outputs.length===1)return[j];if(Array.isArray(j))return j;throw new InvalidArrayError$1(j)})();return encodeAbiParameters(_e.outputs,et)}const localBatchGatewayUrl="x-batch-gateway:true";async function localBatchGatewayRequest(o){const{data:_,ccipRequest:$}=o,{args:[j]}=decodeFunctionData({abi:batchGatewayAbi,data:_}),_e=[],et=[];return await Promise.all(j.map(async(tt,rt)=>{try{et[rt]=tt.urls.includes(localBatchGatewayUrl)?await localBatchGatewayRequest({data:tt.data,ccipRequest:$}):await $(tt),_e[rt]=!1}catch(nt){_e[rt]=!0,et[rt]=encodeError(nt)}})),encodeFunctionResult({abi:batchGatewayAbi,functionName:"query",result:[_e,et]})}function encodeError(o){return o.name==="HttpRequestError"&&o.status?encodeErrorResult({abi:batchGatewayAbi,errorName:"HttpError",args:[o.status,o.shortMessage]}):encodeErrorResult({abi:[solidityError],errorName:"Error",args:["shortMessage"in o?o.shortMessage:o.message]})}function encodedLabelToLabelhash(o){if(o.length!==66||o.indexOf("[")!==0||o.indexOf("]")!==65)return null;const _=`0x${o.slice(1,65)}`;return isHex(_)?_:null}function namehash(o){let _=new Uint8Array(32).fill(0);if(!o)return bytesToHex$4(_);const $=o.split(".");for(let j=$.length-1;j>=0;j-=1){const _e=encodedLabelToLabelhash($[j]),et=_e?toBytes$5(_e):keccak256$4(stringToBytes($[j]),"bytes");_=keccak256$4(concat$2([_,et]),"bytes")}return bytesToHex$4(_)}function encodeLabelhash(o){return`[${o.slice(2)}]`}function labelhash(o){const _=new Uint8Array(32).fill(0);return o?encodedLabelToLabelhash(o)||keccak256$4(stringToBytes(o)):bytesToHex$4(_)}function packetToBytes(o){const _=o.replace(/^\.|\.$/gm,"");if(_.length===0)return new Uint8Array(1);const $=new Uint8Array(stringToBytes(_).byteLength+2);let j=0;const _e=_.split(".");for(let et=0;et<_e.length;et++){let tt=stringToBytes(_e[et]);tt.byteLength>255&&(tt=stringToBytes(encodeLabelhash(labelhash(_e[et])))),$[j]=tt.length,$.set(tt,j+1),j+=tt.length+1}return $.byteLength!==j+1?$.slice(0,j+1):$}async function getEnsAddress(o,_){const{blockNumber:$,blockTag:j,coinType:_e,name:et,gatewayUrls:tt,strict:rt}=_,{chain:nt}=o,ot=(()=>{if(_.universalResolverAddress)return _.universalResolverAddress;if(!nt)throw new Error("client chain not configured. universalResolverAddress is required.");return getChainContractAddress({blockNumber:$,chain:nt,contract:"ensUniversalResolver"})})(),it=nt==null?void 0:nt.ensTlds;if(it&&!it.some(at=>et.endsWith(at)))return null;const st=_e!=null?[namehash(et),BigInt(_e)]:[namehash(et)];try{const at=encodeFunctionData({abi:addressResolverAbi,functionName:"addr",args:st}),lt={address:ot,abi:universalResolverResolveAbi,functionName:"resolveWithGateways",args:[toHex$1(packetToBytes(et)),at,tt??[localBatchGatewayUrl]],blockNumber:$,blockTag:j},ft=await getAction(o,readContract,"readContract")(lt);if(ft[0]==="0x")return null;const dt=decodeFunctionResult({abi:addressResolverAbi,args:st,functionName:"addr",data:ft[0]});return dt==="0x"||trim$2(dt)==="0x00"?null:dt}catch(at){if(rt)throw at;if(isNullUniversalResolverError(at))return null;throw at}}class EnsAvatarInvalidMetadataError extends BaseError$1{constructor({data:_}){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(_)}`],name:"EnsAvatarInvalidMetadataError"})}}class EnsAvatarInvalidNftUriError extends BaseError$1{constructor({reason:_}){super(`ENS NFT avatar URI is invalid. ${_}`,{name:"EnsAvatarInvalidNftUriError"})}}class EnsAvatarUriResolutionError extends BaseError$1{constructor({uri:_}){super(`Unable to resolve ENS avatar URI "${_}". The URI may be malformed, invalid, or does not respond with a valid image.`,{name:"EnsAvatarUriResolutionError"})}}class EnsAvatarUnsupportedNamespaceError extends BaseError$1{constructor({namespace:_}){super(`ENS NFT avatar namespace "${_}" is not supported. Must be "erc721" or "erc1155".`,{name:"EnsAvatarUnsupportedNamespaceError"})}}const networkRegex=/(?https?:\/\/[^/]*|ipfs:\/|ipns:\/|ar:\/)?(?\/)?(?ipfs\/|ipns\/)?(?[\w\-.]+)(?\/.*)?/,ipfsHashRegex=/^(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\-.]+))?(?\/.*)?$/,base64Regex$1=/^data:([a-zA-Z\-/+]*);base64,([^"].*)/,dataURIRegex=/^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/;async function isImageUri(o){try{const _=await fetch(o,{method:"HEAD"});if(_.status===200){const $=_.headers.get("content-type");return $==null?void 0:$.startsWith("image/")}return!1}catch(_){return typeof _=="object"&&typeof _.response<"u"||!Object.hasOwn(globalThis,"Image")?!1:new Promise($=>{const j=new Image;j.onload=()=>{$(!0)},j.onerror=()=>{$(!1)},j.src=o})}}function getGateway(o,_){return o?o.endsWith("/")?o.slice(0,-1):o:_}function resolveAvatarUri({uri:o,gatewayUrls:_}){const $=base64Regex$1.test(o);if($)return{uri:o,isOnChain:!0,isEncoded:$};const j=getGateway(_==null?void 0:_.ipfs,"https://ipfs.io"),_e=getGateway(_==null?void 0:_.arweave,"https://arweave.net"),et=o.match(networkRegex),{protocol:tt,subpath:rt,target:nt,subtarget:ot=""}=(et==null?void 0:et.groups)||{},it=tt==="ipns:/"||rt==="ipns/",st=tt==="ipfs:/"||rt==="ipfs/"||ipfsHashRegex.test(o);if(o.startsWith("http")&&!it&&!st){let lt=o;return _!=null&&_.arweave&&(lt=o.replace(/https:\/\/arweave.net/g,_==null?void 0:_.arweave)),{uri:lt,isOnChain:!1,isEncoded:!1}}if((it||st)&&nt)return{uri:`${j}/${it?"ipns":"ipfs"}/${nt}${ot}`,isOnChain:!1,isEncoded:!1};if(tt==="ar:/"&&nt)return{uri:`${_e}/${nt}${ot||""}`,isOnChain:!1,isEncoded:!1};let at=o.replace(dataURIRegex,"");if(at.startsWith("_e.json());return await parseAvatarUri({gatewayUrls:o,uri:getJsonImage($)})}catch{throw new EnsAvatarUriResolutionError({uri:_})}}async function parseAvatarUri({gatewayUrls:o,uri:_}){const{uri:$,isOnChain:j}=resolveAvatarUri({uri:_,gatewayUrls:o});if(j||await isImageUri($))return $;throw new EnsAvatarUriResolutionError({uri:_})}function parseNftUri(o){let _=o;_.startsWith("did:nft:")&&(_=_.replace("did:nft:","").replace(/_/g,"/"));const[$,j,_e]=_.split("/"),[et,tt]=$.split(":"),[rt,nt]=j.split(":");if(!et||et.toLowerCase()!=="eip155")throw new EnsAvatarInvalidNftUriError({reason:"Only EIP-155 supported"});if(!tt)throw new EnsAvatarInvalidNftUriError({reason:"Chain ID not found"});if(!nt)throw new EnsAvatarInvalidNftUriError({reason:"Contract address not found"});if(!_e)throw new EnsAvatarInvalidNftUriError({reason:"Token ID not found"});if(!rt)throw new EnsAvatarInvalidNftUriError({reason:"ERC namespace not found"});return{chainID:Number.parseInt(tt,10),namespace:rt.toLowerCase(),contractAddress:nt,tokenID:_e}}async function getNftTokenUri(o,{nft:_}){if(_.namespace==="erc721")return readContract(o,{address:_.contractAddress,abi:[{name:"tokenURI",type:"function",stateMutability:"view",inputs:[{name:"tokenId",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"tokenURI",args:[BigInt(_.tokenID)]});if(_.namespace==="erc1155")return readContract(o,{address:_.contractAddress,abi:[{name:"uri",type:"function",stateMutability:"view",inputs:[{name:"_id",type:"uint256"}],outputs:[{name:"",type:"string"}]}],functionName:"uri",args:[BigInt(_.tokenID)]});throw new EnsAvatarUnsupportedNamespaceError({namespace:_.namespace})}async function parseAvatarRecord(o,{gatewayUrls:_,record:$}){return/eip155:/i.test($)?parseNftAvatarUri(o,{gatewayUrls:_,record:$}):parseAvatarUri({uri:$,gatewayUrls:_})}async function parseNftAvatarUri(o,{gatewayUrls:_,record:$}){const j=parseNftUri($),_e=await getNftTokenUri(o,{nft:j}),{uri:et,isOnChain:tt,isEncoded:rt}=resolveAvatarUri({uri:_e,gatewayUrls:_});if(tt&&(et.includes("data:application/json;base64,")||et.startsWith("{"))){const ot=rt?atob(et.replace("data:application/json;base64,","")):et,it=JSON.parse(ot);return parseAvatarUri({uri:getJsonImage(it),gatewayUrls:_})}let nt=j.tokenID;return j.namespace==="erc1155"&&(nt=nt.replace("0x","").padStart(64,"0")),getMetadataAvatarUri({gatewayUrls:_,uri:et.replace(/(?:0x)?{id}/,nt)})}async function getEnsText(o,_){const{blockNumber:$,blockTag:j,key:_e,name:et,gatewayUrls:tt,strict:rt}=_,{chain:nt}=o,ot=(()=>{if(_.universalResolverAddress)return _.universalResolverAddress;if(!nt)throw new Error("client chain not configured. universalResolverAddress is required.");return getChainContractAddress({blockNumber:$,chain:nt,contract:"ensUniversalResolver"})})(),it=nt==null?void 0:nt.ensTlds;if(it&&!it.some(st=>et.endsWith(st)))return null;try{const st={address:ot,abi:universalResolverResolveAbi,args:[toHex$1(packetToBytes(et)),encodeFunctionData({abi:textResolverAbi,functionName:"text",args:[namehash(et),_e]}),tt??[localBatchGatewayUrl]],functionName:"resolveWithGateways",blockNumber:$,blockTag:j},lt=await getAction(o,readContract,"readContract")(st);if(lt[0]==="0x")return null;const ct=decodeFunctionResult({abi:textResolverAbi,functionName:"text",data:lt[0]});return ct===""?null:ct}catch(st){if(rt)throw st;if(isNullUniversalResolverError(st))return null;throw st}}async function getEnsAvatar(o,{blockNumber:_,blockTag:$,assetGatewayUrls:j,name:_e,gatewayUrls:et,strict:tt,universalResolverAddress:rt}){const nt=await getAction(o,getEnsText,"getEnsText")({blockNumber:_,blockTag:$,key:"avatar",name:_e,universalResolverAddress:rt,gatewayUrls:et,strict:tt});if(!nt)return null;try{return await parseAvatarRecord(o,{record:nt,gatewayUrls:j})}catch{return null}}async function getEnsName(o,_){const{address:$,blockNumber:j,blockTag:_e,coinType:et=60n,gatewayUrls:tt,strict:rt}=_,{chain:nt}=o,ot=(()=>{if(_.universalResolverAddress)return _.universalResolverAddress;if(!nt)throw new Error("client chain not configured. universalResolverAddress is required.");return getChainContractAddress({blockNumber:j,chain:nt,contract:"ensUniversalResolver"})})();try{const it={address:ot,abi:universalResolverReverseAbi,args:[$,et,tt??[localBatchGatewayUrl]],functionName:"reverseWithGateways",blockNumber:j,blockTag:_e},st=getAction(o,readContract,"readContract"),[at]=await st(it);return at||null}catch(it){if(rt)throw it;if(isNullUniversalResolverError(it))return null;throw it}}async function getEnsResolver(o,_){const{blockNumber:$,blockTag:j,name:_e}=_,{chain:et}=o,tt=(()=>{if(_.universalResolverAddress)return _.universalResolverAddress;if(!et)throw new Error("client chain not configured. universalResolverAddress is required.");return getChainContractAddress({blockNumber:$,chain:et,contract:"ensUniversalResolver"})})(),rt=et==null?void 0:et.ensTlds;if(rt&&!rt.some(ot=>_e.endsWith(ot)))throw new Error(`${_e} is not a valid ENS TLD (${rt==null?void 0:rt.join(", ")}) for chain "${et.name}" (id: ${et.id}).`);const[nt]=await getAction(o,readContract,"readContract")({address:tt,abi:[{inputs:[{type:"bytes"}],name:"findResolver",outputs:[{type:"address"},{type:"bytes32"},{type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"findResolver",args:[toHex$1(packetToBytes(_e))],blockNumber:$,blockTag:j});return nt}async function createAccessList(o,_){var dt,pt,yt;const{account:$=o.account,blockNumber:j,blockTag:_e="latest",blobs:et,data:tt,gas:rt,gasPrice:nt,maxFeePerBlobGas:ot,maxFeePerGas:it,maxPriorityFeePerGas:st,to:at,value:lt,...ct}=_,ft=$?parseAccount($):void 0;try{assertRequest(_);const wt=(typeof j=="bigint"?numberToHex(j):void 0)||_e,Ct=(yt=(pt=(dt=o.chain)==null?void 0:dt.formatters)==null?void 0:pt.transactionRequest)==null?void 0:yt.format,Bt=(Ct||formatTransactionRequest)({...extract$1(ct,{format:Ct}),account:ft,blobs:et,data:tt,gas:rt,gasPrice:nt,maxFeePerBlobGas:ot,maxFeePerGas:it,maxPriorityFeePerGas:st,to:at,value:lt},"createAccessList"),At=await o.request({method:"eth_createAccessList",params:[Bt,wt]});return{accessList:At.accessList,gasUsed:BigInt(At.gasUsed)}}catch(vt){throw getCallError(vt,{..._,account:ft,chain:o.chain})}}async function createBlockFilter(o){const _=createFilterRequestScope(o,{method:"eth_newBlockFilter"}),$=await o.request({method:"eth_newBlockFilter"});return{id:$,request:_($),type:"block"}}async function createEventFilter(o,{address:_,args:$,event:j,events:_e,fromBlock:et,strict:tt,toBlock:rt}={}){const nt=_e??(j?[j]:void 0),ot=createFilterRequestScope(o,{method:"eth_newFilter"});let it=[];nt&&(it=[nt.flatMap(lt=>encodeEventTopics({abi:[lt],eventName:lt.name,args:$}))],j&&(it=it[0]));const st=await o.request({method:"eth_newFilter",params:[{address:_,fromBlock:typeof et=="bigint"?numberToHex(et):et,toBlock:typeof rt=="bigint"?numberToHex(rt):rt,...it.length?{topics:it}:{}}]});return{abi:nt,args:$,eventName:j?j.name:void 0,fromBlock:et,id:st,request:ot(st),strict:!!tt,toBlock:rt,type:"event"}}async function createPendingTransactionFilter(o){const _=createFilterRequestScope(o,{method:"eth_newPendingTransactionFilter"}),$=await o.request({method:"eth_newPendingTransactionFilter"});return{id:$,request:_($),type:"transaction"}}async function getBalance(o,{address:_,blockNumber:$,blockTag:j=o.experimental_blockTag??"latest"}){const _e=typeof $=="bigint"?numberToHex($):void 0,et=await o.request({method:"eth_getBalance",params:[_,_e||j]});return BigInt(et)}async function getBlobBaseFee(o){const _=await o.request({method:"eth_blobBaseFee"});return BigInt(_)}async function getBlockTransactionCount(o,{blockHash:_,blockNumber:$,blockTag:j="latest"}={}){const _e=$!==void 0?numberToHex($):void 0;let et;return _?et=await o.request({method:"eth_getBlockTransactionCountByHash",params:[_]},{dedupe:!0}):et=await o.request({method:"eth_getBlockTransactionCountByNumber",params:[_e||j]},{dedupe:!!_e}),hexToNumber$3(et)}async function getCode(o,{address:_,blockNumber:$,blockTag:j="latest"}){const _e=$!==void 0?numberToHex($):void 0,et=await o.request({method:"eth_getCode",params:[_,_e||j]},{dedupe:!!_e});if(et!=="0x")return et}class Eip712DomainNotFoundError extends BaseError$1{constructor({address:_}){super(`No EIP-712 domain found on contract "${_}".`,{metaMessages:["Ensure that:",`- The contract is deployed at the address "${_}".`,"- `eip712Domain()` function exists on the contract.","- `eip712Domain()` function matches signature to ERC-5267 specification."],name:"Eip712DomainNotFoundError"})}}async function getEip712Domain(o,_){const{address:$,factory:j,factoryData:_e}=_;try{const[et,tt,rt,nt,ot,it,st]=await getAction(o,readContract,"readContract")({abi,address:$,functionName:"eip712Domain",factory:j,factoryData:_e});return{domain:{name:tt,version:rt,chainId:Number(nt),verifyingContract:ot,salt:it},extensions:st,fields:et}}catch(et){const tt=et;throw tt.name==="ContractFunctionExecutionError"&&tt.cause.name==="ContractFunctionZeroDataError"?new Eip712DomainNotFoundError({address:$}):tt}}const abi=[{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"}];function formatFeeHistory(o){var _;return{baseFeePerGas:o.baseFeePerGas.map($=>BigInt($)),gasUsedRatio:o.gasUsedRatio,oldestBlock:BigInt(o.oldestBlock),reward:(_=o.reward)==null?void 0:_.map($=>$.map(j=>BigInt(j)))}}async function getFeeHistory(o,{blockCount:_,blockNumber:$,blockTag:j="latest",rewardPercentiles:_e}){const et=typeof $=="bigint"?numberToHex($):void 0,tt=await o.request({method:"eth_feeHistory",params:[numberToHex(_),et||j,_e]},{dedupe:!!et});return formatFeeHistory(tt)}async function getFilterLogs(o,{filter:_}){const $=_.strict??!1,_e=(await _.request({method:"eth_getFilterLogs",params:[_.id]})).map(et=>formatLog(et));return _.abi?parseEventLogs({abi:_.abi,logs:_e,strict:$}):_e}async function verifyAuthorization({address:o,authorization:_,signature:$}){return isAddressEqual(getAddress(o),await recoverAuthorizationAddress({authorization:_,signature:$}))}const promiseCache=new LruMap$1(8192);function withDedupe(o,{enabled:_=!0,id:$}){if(!_||!$)return o();if(promiseCache.get($))return promiseCache.get($);const j=o().finally(()=>promiseCache.delete($));return promiseCache.set($,j),j}function buildRequest(o,_={}){return async($,j={})=>{var st;const{dedupe:_e=!1,methods:et,retryDelay:tt=150,retryCount:rt=3,uid:nt}={..._,...j},{method:ot}=$;if((st=et==null?void 0:et.exclude)!=null&&st.includes(ot))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:ot});if(et!=null&&et.include&&!et.include.includes(ot))throw new MethodNotSupportedRpcError(new Error("method not supported"),{method:ot});const it=_e?stringToHex(`${nt}.${stringify$5($)}`):void 0;return withDedupe(()=>withRetry(async()=>{try{return await o($)}catch(at){const lt=at;switch(lt.code){case ParseRpcError.code:throw new ParseRpcError(lt);case InvalidRequestRpcError.code:throw new InvalidRequestRpcError(lt);case MethodNotFoundRpcError.code:throw new MethodNotFoundRpcError(lt,{method:$.method});case InvalidParamsRpcError.code:throw new InvalidParamsRpcError(lt);case InternalRpcError.code:throw new InternalRpcError(lt);case InvalidInputRpcError.code:throw new InvalidInputRpcError(lt);case ResourceNotFoundRpcError.code:throw new ResourceNotFoundRpcError(lt);case ResourceUnavailableRpcError.code:throw new ResourceUnavailableRpcError(lt);case TransactionRejectedRpcError.code:throw new TransactionRejectedRpcError(lt);case MethodNotSupportedRpcError.code:throw new MethodNotSupportedRpcError(lt,{method:$.method});case LimitExceededRpcError.code:throw new LimitExceededRpcError(lt);case JsonRpcVersionUnsupportedError.code:throw new JsonRpcVersionUnsupportedError(lt);case UserRejectedRequestError.code:throw new UserRejectedRequestError(lt);case UnauthorizedProviderError.code:throw new UnauthorizedProviderError(lt);case UnsupportedProviderMethodError.code:throw new UnsupportedProviderMethodError(lt);case ProviderDisconnectedError.code:throw new ProviderDisconnectedError(lt);case ChainDisconnectedError.code:throw new ChainDisconnectedError(lt);case SwitchChainError.code:throw new SwitchChainError(lt);case UnsupportedNonOptionalCapabilityError.code:throw new UnsupportedNonOptionalCapabilityError(lt);case UnsupportedChainIdError.code:throw new UnsupportedChainIdError(lt);case DuplicateIdError.code:throw new DuplicateIdError(lt);case UnknownBundleIdError.code:throw new UnknownBundleIdError(lt);case BundleTooLargeError.code:throw new BundleTooLargeError(lt);case AtomicReadyWalletRejectedUpgradeError.code:throw new AtomicReadyWalletRejectedUpgradeError(lt);case AtomicityNotSupportedError.code:throw new AtomicityNotSupportedError(lt);case 5e3:throw new UserRejectedRequestError(lt);default:throw at instanceof BaseError$1?at:new UnknownRpcError(lt)}}},{delay:({count:at,error:lt})=>{var ct;if(lt&< instanceof HttpRequestError){const ft=(ct=lt==null?void 0:lt.headers)==null?void 0:ct.get("Retry-After");if(ft!=null&&ft.match(/\d/))return Number.parseInt(ft,10)*1e3}return~~(1<shouldRetry(at)}),{enabled:_e,id:it})}}function shouldRetry(o){return"code"in o&&typeof o.code=="number"?o.code===-1||o.code===LimitExceededRpcError.code||o.code===InternalRpcError.code:o instanceof HttpRequestError&&o.status?o.status===403||o.status===408||o.status===413||o.status===429||o.status===500||o.status===502||o.status===503||o.status===504:!0}function defineChain(o){const _={formatters:void 0,fees:void 0,serializers:void 0,...o};function $(j){return _e=>{const et=typeof _e=="function"?_e(j):_e,tt={...j,...et};return Object.assign(tt,{extend:$(tt)})}}return Object.assign(_,{extend:$(_)})}function withTimeout(o,{errorInstance:_=new Error("timed out"),timeout:$,signal:j}){return new Promise((_e,et)=>{(async()=>{let tt;try{const rt=new AbortController;$>0&&(tt=setTimeout(()=>{j&&rt.abort()},$)),_e(await o({signal:(rt==null?void 0:rt.signal)||null}))}catch(rt){(rt==null?void 0:rt.name)==="AbortError"&&et(_),et(rt)}finally{clearTimeout(tt)}})()})}function createIdStore(){return{current:0,take(){return this.current++},reset(){this.current=0}}}const idCache=createIdStore();function getHttpRpcClient(o,_={}){const{url:$,headers:j}=parseUrl(o);return{async request(_e){var ct;const{body:et,fetchFn:tt=_.fetchFn??fetch,onRequest:rt=_.onRequest,onResponse:nt=_.onResponse,timeout:ot=_.timeout??1e4}=_e,it={..._.fetchOptions??{},..._e.fetchOptions??{}},{headers:st,method:at,signal:lt}=it;try{const ft=await withTimeout(async({signal:pt})=>{const yt={...it,body:Array.isArray(et)?stringify$5(et.map(Pt=>({jsonrpc:"2.0",id:Pt.id??idCache.take(),...Pt}))):stringify$5({jsonrpc:"2.0",id:et.id??idCache.take(),...et}),headers:{...j,"Content-Type":"application/json",...st},method:at||"POST",signal:lt||(ot>0?pt:null)},vt=new Request($,yt),wt=await(rt==null?void 0:rt(vt,yt))??{...yt,url:$};return await tt(wt.url??$,wt)},{errorInstance:new TimeoutError({body:et,url:$}),timeout:ot,signal:!0});nt&&await nt(ft);let dt;if((ct=ft.headers.get("Content-Type"))!=null&&ct.startsWith("application/json"))dt=await ft.json();else{dt=await ft.text();try{dt=JSON.parse(dt||"{}")}catch(pt){if(ft.ok)throw pt;dt={error:dt}}}if(!ft.ok)throw new HttpRequestError({body:et,details:stringify$5(dt.error)||ft.statusText,headers:ft.headers,status:ft.status,url:$});return dt}catch(ft){throw ft instanceof HttpRequestError||ft instanceof TimeoutError?ft:new HttpRequestError({body:et,cause:ft,url:$})}}}}function parseUrl(o){try{const _=new URL(o),$=(()=>{if(_.username){const j=`${decodeURIComponent(_.username)}:${decodeURIComponent(_.password)}`;return _.username="",_.password="",{url:_.toString(),headers:{Authorization:`Basic ${btoa(j)}`}}}})();return{url:_.toString(),...$}}catch{return{url:o}}}const presignMessagePrefix=`Ethereum Signed Message: -`;function toPrefixedMessage(o){const _=typeof o=="string"?stringToHex(o):typeof o.raw=="string"?o.raw:bytesToHex$4(o.raw),$=stringToHex(`${presignMessagePrefix}${size$3(_)}`);return concat$2([$,_])}function hashMessage$1(o,_){return keccak256$4(toPrefixedMessage(o),_)}class InvalidDomainError extends BaseError$1{constructor({domain:_}){super(`Invalid domain "${stringify$5(_)}".`,{metaMessages:["Must be a valid EIP-712 domain."]})}}class InvalidPrimaryTypeError extends BaseError$1{constructor({primaryType:_,types:$}){super(`Invalid primary type \`${_}\` must be one of \`${JSON.stringify(Object.keys($))}\`.`,{docsPath:"/api/glossary/Errors#typeddatainvalidprimarytypeerror",metaMessages:["Check that the primary type is a key in `types`."]})}}class InvalidStructTypeError extends BaseError$1{constructor({type:_}){super(`Struct type "${_}" is invalid.`,{metaMessages:["Struct type must not be a Solidity type."],name:"InvalidStructTypeError"})}}function serializeTypedData(o){const{domain:_,message:$,primaryType:j,types:_e}=o,et=(nt,ot)=>{const it={...ot};for(const st of nt){const{name:at,type:lt}=st;lt==="address"&&(it[at]=it[at].toLowerCase())}return it},tt=_e.EIP712Domain?_?et(_e.EIP712Domain,_):{}:{},rt=(()=>{if(j!=="EIP712Domain")return et(_e[j],$)})();return stringify$5({domain:tt,message:rt,primaryType:j,types:_e})}function validateTypedData(o){const{domain:_,message:$,primaryType:j,types:_e}=o,et=(tt,rt)=>{for(const nt of tt){const{name:ot,type:it}=nt,st=rt[ot],at=it.match(integerRegex$1);if(at&&(typeof st=="number"||typeof st=="bigint")){const[ft,dt,pt]=at;numberToHex(st,{signed:dt==="int",size:Number.parseInt(pt,10)/8})}if(it==="address"&&typeof st=="string"&&!isAddress(st))throw new InvalidAddressError$1({address:st});const lt=it.match(bytesRegex$1);if(lt){const[ft,dt]=lt;if(dt&&size$3(st)!==Number.parseInt(dt,10))throw new BytesSizeMismatchError$1({expectedSize:Number.parseInt(dt,10),givenSize:size$3(st)})}const ct=_e[it];ct&&(validateReference(it),et(ct,st))}};if(_e.EIP712Domain&&_){if(typeof _!="object")throw new InvalidDomainError({domain:_});et(_e.EIP712Domain,_)}if(j!=="EIP712Domain")if(_e[j])et(_e[j],$);else throw new InvalidPrimaryTypeError({primaryType:j,types:_e})}function getTypesForEIP712Domain({domain:o}){return[typeof(o==null?void 0:o.name)=="string"&&{name:"name",type:"string"},(o==null?void 0:o.version)&&{name:"version",type:"string"},(typeof(o==null?void 0:o.chainId)=="number"||typeof(o==null?void 0:o.chainId)=="bigint")&&{name:"chainId",type:"uint256"},(o==null?void 0:o.verifyingContract)&&{name:"verifyingContract",type:"address"},(o==null?void 0:o.salt)&&{name:"salt",type:"bytes32"}].filter(Boolean)}function domainSeparator({domain:o}){return hashDomain({domain:o,types:{EIP712Domain:getTypesForEIP712Domain({domain:o})}})}function validateReference(o){if(o==="address"||o==="bool"||o==="string"||o.startsWith("bytes")||o.startsWith("uint")||o.startsWith("int"))throw new InvalidStructTypeError({type:o})}function hashTypedData(o){const{domain:_={},message:$,primaryType:j}=o,_e={EIP712Domain:getTypesForEIP712Domain({domain:_}),...o.types};validateTypedData({domain:_,message:$,primaryType:j,types:_e});const et=["0x1901"];return _&&et.push(hashDomain({domain:_,types:_e})),j!=="EIP712Domain"&&et.push(hashStruct({data:$,primaryType:j,types:_e})),keccak256$4(concat$2(et))}function hashDomain({domain:o,types:_}){return hashStruct({data:o,primaryType:"EIP712Domain",types:_})}function hashStruct({data:o,primaryType:_,types:$}){const j=encodeData$1({data:o,primaryType:_,types:$});return keccak256$4(j)}function encodeData$1({data:o,primaryType:_,types:$}){const j=[{type:"bytes32"}],_e=[hashType({primaryType:_,types:$})];for(const et of $[_]){const[tt,rt]=encodeField({types:$,name:et.name,type:et.type,value:o[et.name]});j.push(tt),_e.push(rt)}return encodeAbiParameters(j,_e)}function hashType({primaryType:o,types:_}){const $=toHex$1(encodeType({primaryType:o,types:_}));return keccak256$4($)}function encodeType({primaryType:o,types:_}){let $="";const j=findTypeDependencies({primaryType:o,types:_});j.delete(o);const _e=[o,...Array.from(j).sort()];for(const et of _e)$+=`${et}(${_[et].map(({name:tt,type:rt})=>`${rt} ${tt}`).join(",")})`;return $}function findTypeDependencies({primaryType:o,types:_},$=new Set){const j=o.match(/^\w*/u),_e=j==null?void 0:j[0];if($.has(_e)||_[_e]===void 0)return $;$.add(_e);for(const et of _[_e])findTypeDependencies({primaryType:et.type,types:_},$);return $}function encodeField({types:o,name:_,type:$,value:j}){if(o[$]!==void 0)return[{type:"bytes32"},keccak256$4(encodeData$1({data:j,primaryType:$,types:o}))];if($==="bytes")return[{type:"bytes32"},keccak256$4(j)];if($==="string")return[{type:"bytes32"},keccak256$4(toHex$1(j))];if($.lastIndexOf("]")===$.length-1){const _e=$.slice(0,$.lastIndexOf("[")),et=j.map(tt=>encodeField({name:_,type:_e,types:o,value:tt}));return[{type:"bytes32"},keccak256$4(encodeAbiParameters(et.map(([tt])=>tt),et.map(([,tt])=>tt)))]}return[{type:$},j]}class LruMap extends Map{constructor(_){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=_}get(_){const $=super.get(_);return super.has(_)&&$!==void 0&&(this.delete(_),super.set(_,$)),$}set(_,$){if(super.set(_,$),this.maxSize&&this.size>this.maxSize){const j=this.keys().next().value;j&&this.delete(j)}return this}}const caches={checksum:new LruMap(8192)},checksum$1=caches.checksum;function keccak256$3(o,_={}){const{as:$=typeof o=="string"?"Hex":"Bytes"}=_,j=keccak_256$2(from$a(o));return $==="Bytes"?j:fromBytes$1(j)}const addressRegex=/^0x[a-fA-F0-9]{40}$/;function assert$m(o,_={}){const{strict:$=!0}=_;if(!addressRegex.test(o))throw new InvalidAddressError({address:o,cause:new InvalidInputError});if($){if(o.toLowerCase()===o)return;if(checksum(o)!==o)throw new InvalidAddressError({address:o,cause:new InvalidChecksumError})}}function checksum(o){if(checksum$1.has(o))return checksum$1.get(o);assert$m(o,{strict:!1});const _=o.substring(2).toLowerCase(),$=keccak256$3(fromString$1(_),{as:"Bytes"}),j=_.split("");for(let et=0;et<40;et+=2)$[et>>1]>>4>=8&&j[et]&&(j[et]=j[et].toUpperCase()),($[et>>1]&15)>=8&&j[et+1]&&(j[et+1]=j[et+1].toUpperCase());const _e=`0x${j.join("")}`;return checksum$1.set(o,_e),_e}function validate$2(o,_={}){const{strict:$=!0}=_??{};try{return assert$m(o,{strict:$}),!0}catch{return!1}}class InvalidAddressError extends BaseError{constructor({address:_,cause:$}){super(`Address "${_}" is invalid.`,{cause:$}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidAddressError"})}}class InvalidInputError extends BaseError{constructor(){super("Address is not a 20 byte (40 hexadecimal character) value."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidInputError"})}}class InvalidChecksumError extends BaseError{constructor(){super("Address does not match its checksum counterpart."),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Address.InvalidChecksumError"})}}const arrayRegex=/^(.*)\[([0-9]*)\]$/,bytesRegex=/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/,integerRegex=/^(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)?$/,maxUint256=2n**256n-1n;function decodeParameter(o,_,$){const{checksumAddress:j,staticPosition:_e}=$,et=getArrayComponents(_.type);if(et){const[tt,rt]=et;return decodeArray(o,{..._,type:rt},{checksumAddress:j,length:tt,staticPosition:_e})}if(_.type==="tuple")return decodeTuple(o,_,{checksumAddress:j,staticPosition:_e});if(_.type==="address")return decodeAddress(o,{checksum:j});if(_.type==="bool")return decodeBool(o);if(_.type.startsWith("bytes"))return decodeBytes(o,_,{staticPosition:_e});if(_.type.startsWith("uint")||_.type.startsWith("int"))return decodeNumber(o,_);if(_.type==="string")return decodeString(o,{staticPosition:_e});throw new InvalidTypeError(_.type)}const sizeOfLength=32,sizeOfOffset=32;function decodeAddress(o,_={}){const{checksum:$=!1}=_,j=o.readBytes(32);return[(et=>$?checksum(et):et)(fromBytes$1(slice$3(j,-20))),32]}function decodeArray(o,_,$){const{checksumAddress:j,length:_e,staticPosition:et}=$;if(!_e){const nt=toNumber$2(o.readBytes(sizeOfOffset)),ot=et+nt,it=ot+sizeOfLength;o.setPosition(ot);const st=toNumber$2(o.readBytes(sizeOfLength)),at=hasDynamicChild(_);let lt=0;const ct=[];for(let ft=0;ft48?toBigInt$1(_e,{signed:$}):toNumber$2(_e,{signed:$}),32]}function decodeTuple(o,_,$){const{checksumAddress:j,staticPosition:_e}=$,et=_.components.length===0||_.components.some(({name:nt})=>!nt),tt=et?[]:{};let rt=0;if(hasDynamicChild(_)){const nt=toNumber$2(o.readBytes(sizeOfOffset)),ot=_e+nt;for(let it=0;it<_.components.length;++it){const st=_.components[it];o.setPosition(ot+rt);const[at,lt]=decodeParameter(o,st,{checksumAddress:j,staticPosition:ot});rt+=lt,tt[et?it:st==null?void 0:st.name]=at}return o.setPosition(_e+32),[tt,32]}for(let nt=0;nt<_.components.length;++nt){const ot=_.components[nt],[it,st]=decodeParameter(o,ot,{checksumAddress:j,staticPosition:_e});tt[et?nt:ot==null?void 0:ot.name]=it,rt+=st}return[tt,rt]}function decodeString(o,{staticPosition:_}){const $=toNumber$2(o.readBytes(32)),j=_+$;o.setPosition(j);const _e=toNumber$2(o.readBytes(32));if(_e===0)return o.setPosition(_+32),["",32];const et=o.readBytes(_e,32),tt=toString$4(trimLeft(et));return o.setPosition(_+32),[tt,32]}function prepareParameters({checksumAddress:o,parameters:_,values:$}){const j=[];for(let _e=0;_e<_.length;_e++)j.push(prepareParameter({checksumAddress:o,parameter:_[_e],value:$[_e]}));return j}function prepareParameter({checksumAddress:o=!1,parameter:_,value:$}){const j=_,_e=getArrayComponents(j.type);if(_e){const[et,tt]=_e;return encodeArray($,{checksumAddress:o,length:et,parameter:{...j,type:tt}})}if(j.type==="tuple")return encodeTuple($,{checksumAddress:o,parameter:j});if(j.type==="address")return encodeAddress($,{checksum:o});if(j.type==="bool")return encodeBoolean($);if(j.type.startsWith("uint")||j.type.startsWith("int")){const et=j.type.startsWith("int"),[,,tt="256"]=integerRegex.exec(j.type)??[];return encodeNumber($,{signed:et,size:Number(tt)})}if(j.type.startsWith("bytes"))return encodeBytes($,{type:j.type});if(j.type==="string")return encodeString($);throw new InvalidTypeError(j.type)}function encode$4(o){let _=0;for(let et=0;et0?concat$1(ot,nt):ot}}if(tt)return{dynamic:!0,encoded:nt}}return{dynamic:!1,encoded:concat$1(...rt.map(({encoded:nt})=>nt))}}function encodeBytes(o,{type:_}){const[,$]=_.split("bytes"),j=size$1(o);if(!$){let _e=o;return j%32!==0&&(_e=padRight(_e,Math.ceil((o.length-2)/2/32)*32)),{dynamic:!0,encoded:concat$1(padLeft(fromNumber(j,{size:32})),_e)}}if(j!==Number.parseInt($,10))throw new BytesSizeMismatchError({expectedSize:Number.parseInt($,10),value:o});return{dynamic:!1,encoded:padRight(o)}}function encodeBoolean(o){if(typeof o!="boolean")throw new BaseError(`Invalid boolean value: "${o}" (type: ${typeof o}). Expected: \`true\` or \`false\`.`);return{dynamic:!1,encoded:padLeft(fromBoolean(o))}}function encodeNumber(o,{signed:_,size:$}){if(typeof $=="number"){const j=2n**(BigInt($)-(_?1n:0n))-1n,_e=_?-j-1n:0n;if(o>j||o<_e)throw new IntegerOutOfRangeError({max:j.toString(),min:_e.toString(),signed:_,size:$/8,value:o.toString()})}return{dynamic:!1,encoded:fromNumber(o,{size:32,signed:_})}}function encodeString(o){const _=fromString(o),$=Math.ceil(size$1(_)/32),j=[];for(let _e=0;_e<$;_e++)j.push(padRight(slice$2(_,_e*32,(_e+1)*32)));return{dynamic:!0,encoded:concat$1(padRight(fromNumber(size$1(_),{size:32})),...j)}}function encodeTuple(o,_){const{checksumAddress:$,parameter:j}=_;let _e=!1;const et=[];for(let tt=0;tttt))}}function getArrayComponents(o){const _=o.match(/^(.*)\[(\d+)?\]$/);return _?[_[2]?Number(_[2]):null,_[1]]:void 0}function hasDynamicChild(o){var j;const{type:_}=o;if(_==="string"||_==="bytes"||_.endsWith("[]"))return!0;if(_==="tuple")return(j=o.components)==null?void 0:j.some(hasDynamicChild);const $=getArrayComponents(o.type);return!!($&&hasDynamicChild({...o,type:$[1]}))}const staticCursor={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 RecursiveReadLimitExceededError({count:this.recursiveReadCount+1,limit:this.recursiveReadLimit})},assertPosition(o){if(o<0||o>this.bytes.length-1)throw new PositionOutOfBoundsError({length:this.bytes.length,position:o})},decrementPosition(o){if(o<0)throw new NegativeOffsetError({offset:o});const _=this.position-o;this.assertPosition(_),this.position=_},getReadCount(o){return this.positionReadCount.get(o||this.position)||0},incrementPosition(o){if(o<0)throw new NegativeOffsetError({offset:o});const _=this.position+o;this.assertPosition(_),this.position=_},inspectByte(o){const _=o??this.position;return this.assertPosition(_),this.bytes[_]},inspectBytes(o,_){const $=_??this.position;return this.assertPosition($+o-1),this.bytes.subarray($,$+o)},inspectUint8(o){const _=o??this.position;return this.assertPosition(_),this.bytes[_]},inspectUint16(o){const _=o??this.position;return this.assertPosition(_+1),this.dataView.getUint16(_)},inspectUint24(o){const _=o??this.position;return this.assertPosition(_+2),(this.dataView.getUint16(_)<<8)+this.dataView.getUint8(_+2)},inspectUint32(o){const _=o??this.position;return this.assertPosition(_+3),this.dataView.getUint32(_)},pushByte(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushBytes(o){this.assertPosition(this.position+o.length-1),this.bytes.set(o,this.position),this.position+=o.length},pushUint8(o){this.assertPosition(this.position),this.bytes[this.position]=o,this.position++},pushUint16(o){this.assertPosition(this.position+1),this.dataView.setUint16(this.position,o),this.position+=2},pushUint24(o){this.assertPosition(this.position+2),this.dataView.setUint16(this.position,o>>8),this.dataView.setUint8(this.position+2,o&255),this.position+=3},pushUint32(o){this.assertPosition(this.position+3),this.dataView.setUint32(this.position,o),this.position+=4},readByte(){this.assertReadLimit(),this._touch();const o=this.inspectByte();return this.position++,o},readBytes(o,_){this.assertReadLimit(),this._touch();const $=this.inspectBytes(o);return this.position+=_??o,$},readUint8(){this.assertReadLimit(),this._touch();const o=this.inspectUint8();return this.position+=1,o},readUint16(){this.assertReadLimit(),this._touch();const o=this.inspectUint16();return this.position+=2,o},readUint24(){this.assertReadLimit(),this._touch();const o=this.inspectUint24();return this.position+=3,o},readUint32(){this.assertReadLimit(),this._touch();const o=this.inspectUint32();return this.position+=4,o},get remaining(){return this.bytes.length-this.position},setPosition(o){const _=this.position;return this.assertPosition(o),this.position=o,()=>this.position=_},_touch(){if(this.recursiveReadLimit===Number.POSITIVE_INFINITY)return;const o=this.getReadCount();this.positionReadCount.set(this.position,o+1),o>0&&this.recursiveReadCount++}};function create(o,{recursiveReadLimit:_=8192}={}){const $=Object.create(staticCursor);return $.bytes=o,$.dataView=new DataView(o.buffer,o.byteOffset,o.byteLength),$.positionReadCount=new Map,$.recursiveReadLimit=_,$}class NegativeOffsetError extends BaseError{constructor({offset:_}){super(`Offset \`${_}\` cannot be negative.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.NegativeOffsetError"})}}class PositionOutOfBoundsError extends BaseError{constructor({length:_,position:$}){super(`Position \`${$}\` is out of bounds (\`0 < position < ${_}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.PositionOutOfBoundsError"})}}class RecursiveReadLimitExceededError extends BaseError{constructor({count:_,limit:$}){super(`Recursive read limit of \`${$}\` exceeded (recursive read count: \`${_}\`).`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Cursor.RecursiveReadLimitExceededError"})}}function decode$3(o,_,$={}){const{as:j="Array",checksumAddress:_e=!1}=$,et=typeof _=="string"?fromHex$1(_):_,tt=create(et);if(size$2(et)===0&&o.length>0)throw new ZeroDataError;if(size$2(et)&&size$2(et)<32)throw new DataSizeTooSmallError({data:typeof _=="string"?_:fromBytes$1(_),parameters:o,size:size$2(et)});let rt=0;const nt=j==="Array"?[]:{};for(let ot=0;ot_e?_.create().update(j).digest():j);for(let tt=0;ttnew HMAC$2(o,_).update($).digest();hmac$3.create=(o,_)=>new HMAC$2(o,_);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$b=BigInt(0),_1n$f=BigInt(1),_2n$9=BigInt(2),_3n$5=BigInt(3),_4n$3=BigInt(4),_5n$2=BigInt(5),_8n$2=BigInt(8);function mod$2(o,_){const $=o%_;return $>=_0n$b?$:_+$}function pow2$2(o,_,$){let j=o;for(;_-- >_0n$b;)j*=j,j%=$;return j}function invert$2(o,_){if(o===_0n$b)throw new Error("invert: expected non-zero number");if(_<=_0n$b)throw new Error("invert: expected positive modulus, got "+_);let $=mod$2(o,_),j=_,_e=_0n$b,et=_1n$f;for(;$!==_0n$b;){const rt=j/$,nt=j%$,ot=_e-et*rt;j=$,$=nt,_e=et,et=ot}if(j!==_1n$f)throw new Error("invert: does not exist");return mod$2(_e,_)}function sqrt3mod4(o,_){const $=(o.ORDER+_1n$f)/_4n$3,j=o.pow(_,$);if(!o.eql(o.sqr(j),_))throw new Error("Cannot find square root");return j}function sqrt5mod8(o,_){const $=(o.ORDER-_5n$2)/_8n$2,j=o.mul(_,_2n$9),_e=o.pow(j,$),et=o.mul(_,_e),tt=o.mul(o.mul(et,_2n$9),_e),rt=o.mul(et,o.sub(tt,o.ONE));if(!o.eql(o.sqr(rt),_))throw new Error("Cannot find square root");return rt}function tonelliShanks$2(o){if(o1e3)throw new Error("Cannot find square root: probably non-prime P");if($===1)return sqrt3mod4;let et=_e.pow(j,_);const tt=(_+_1n$f)/_2n$9;return function(nt,ot){if(nt.is0(ot))return ot;if(FpLegendre(nt,ot)!==1)throw new Error("Cannot find square root");let it=$,st=nt.mul(nt.ONE,et),at=nt.pow(ot,_),lt=nt.pow(ot,tt);for(;!nt.eql(at,nt.ONE);){if(nt.is0(at))return nt.ZERO;let ct=1,ft=nt.sqr(at);for(;!nt.eql(ft,nt.ONE);)if(ct++,ft=nt.sqr(ft),ct===it)throw new Error("Cannot find square root");const dt=_1n$f<(j[_e]="function",j),_);return validateObject$5(o,$)}function FpPow$2(o,_,$){if($<_0n$b)throw new Error("invalid exponent, negatives unsupported");if($===_0n$b)return o.ONE;if($===_1n$f)return _;let j=o.ONE,_e=_;for(;$>_0n$b;)$&_1n$f&&(j=o.mul(j,_e)),_e=o.sqr(_e),$>>=_1n$f;return j}function FpInvertBatch$2(o,_,$=!1){const j=new Array(_.length).fill($?o.ZERO:void 0),_e=_.reduce((tt,rt,nt)=>o.is0(rt)?tt:(j[nt]=tt,o.mul(tt,rt)),o.ONE),et=o.inv(_e);return _.reduceRight((tt,rt,nt)=>o.is0(rt)?tt:(j[nt]=o.mul(tt,j[nt]),o.mul(tt,rt)),et),j}function FpLegendre(o,_){const $=(o.ORDER-_1n$f)/_2n$9,j=o.pow(_,$),_e=o.eql(j,o.ONE),et=o.eql(j,o.ZERO),tt=o.eql(j,o.neg(o.ONE));if(!_e&&!et&&!tt)throw new Error("invalid Legendre symbol result");return _e?1:et?0:-1}function nLength$2(o,_){_!==void 0&&anumber(_);const $=_!==void 0?_:o.toString(2).length,j=Math.ceil($/8);return{nBitLength:$,nByteLength:j}}function Field$2(o,_,$=!1,j={}){if(o<=_0n$b)throw new Error("invalid field: expected ORDER > 0, got "+o);const{nBitLength:_e,nByteLength:et}=nLength$2(o,_);if(et>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let tt;const rt=Object.freeze({ORDER:o,isLE:$,BITS:_e,BYTES:et,MASK:bitMask$2(_e),ZERO:_0n$b,ONE:_1n$f,create:nt=>mod$2(nt,o),isValid:nt=>{if(typeof nt!="bigint")throw new Error("invalid field element: expected bigint, got "+typeof nt);return _0n$b<=nt&&ntnt===_0n$b,isOdd:nt=>(nt&_1n$f)===_1n$f,neg:nt=>mod$2(-nt,o),eql:(nt,ot)=>nt===ot,sqr:nt=>mod$2(nt*nt,o),add:(nt,ot)=>mod$2(nt+ot,o),sub:(nt,ot)=>mod$2(nt-ot,o),mul:(nt,ot)=>mod$2(nt*ot,o),pow:(nt,ot)=>FpPow$2(rt,nt,ot),div:(nt,ot)=>mod$2(nt*invert$2(ot,o),o),sqrN:nt=>nt*nt,addN:(nt,ot)=>nt+ot,subN:(nt,ot)=>nt-ot,mulN:(nt,ot)=>nt*ot,inv:nt=>invert$2(nt,o),sqrt:j.sqrt||(nt=>(tt||(tt=FpSqrt$2(o)),tt(rt,nt))),toBytes:nt=>$?numberToBytesLE$2(nt,et):numberToBytesBE$2(nt,et),fromBytes:nt=>{if(nt.length!==et)throw new Error("Field.fromBytes: expected "+et+" bytes, got "+nt.length);return $?bytesToNumberLE$2(nt):bytesToNumberBE$2(nt)},invertBatch:nt=>FpInvertBatch$2(rt,nt),cmov:(nt,ot,it)=>it?ot:nt});return Object.freeze(rt)}function getFieldBytesLength$2(o){if(typeof o!="bigint")throw new Error("field order must be bigint");const _=o.toString(2).length;return Math.ceil(_/8)}function getMinHashLength$2(o){const _=getFieldBytesLength$2(o);return _+Math.ceil(_/2)}function mapHashToField$2(o,_,$=!1){const j=o.length,_e=getFieldBytesLength$2(_),et=getMinHashLength$2(_);if(j<16||j1024)throw new Error("expected "+et+"-1024 bytes of input, got "+j);const tt=$?bytesToNumberLE$2(o):bytesToNumberBE$2(o),rt=mod$2(tt,_-_1n$f)+_1n$f;return $?numberToBytesLE$2(rt,_e):numberToBytesBE$2(rt,_e)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$a=BigInt(0),_1n$e=BigInt(1);function constTimeNegate(o,_){const $=_.negate();return o?$:_}function validateW(o,_){if(!Number.isSafeInteger(o)||o<=0||o>_)throw new Error("invalid window size, expected [1.."+_+"], got W="+o)}function calcWOpts(o,_){validateW(o,_);const $=Math.ceil(_/o)+1,j=2**(o-1),_e=2**o,et=bitMask$2(o),tt=BigInt(o);return{windows:$,windowSize:j,mask:et,maxNumber:_e,shiftBy:tt}}function calcOffsets(o,_,$){const{windowSize:j,mask:_e,maxNumber:et,shiftBy:tt}=$;let rt=Number(o&_e),nt=o>>tt;rt>j&&(rt-=et,nt+=_1n$e);const ot=_*j,it=ot+Math.abs(rt)-1,st=rt===0,at=rt<0,lt=_%2!==0;return{nextN:nt,offset:it,isZero:st,isNeg:at,isNegF:lt,offsetF:ot}}function validateMSMPoints(o,_){if(!Array.isArray(o))throw new Error("array expected");o.forEach(($,j)=>{if(!($ instanceof _))throw new Error("invalid point at index "+j)})}function validateMSMScalars(o,_){if(!Array.isArray(o))throw new Error("array of scalars expected");o.forEach(($,j)=>{if(!_.isValid($))throw new Error("invalid scalar at index "+j)})}const pointPrecomputes=new WeakMap,pointWindowSizes=new WeakMap;function getW(o){return pointWindowSizes.get(o)||1}function wNAF$2(o,_){return{constTimeNegate,hasPrecomputes($){return getW($)!==1},unsafeLadder($,j,_e=o.ZERO){let et=$;for(;j>_0n$a;)j&_1n$e&&(_e=_e.add(et)),et=et.double(),j>>=_1n$e;return _e},precomputeWindow($,j){const{windows:_e,windowSize:et}=calcWOpts(j,_),tt=[];let rt=$,nt=rt;for(let ot=0;ot<_e;ot++){nt=rt,tt.push(nt);for(let it=1;it12?nt=rt-3:rt>4?nt=rt-2:rt>0&&(nt=2);const ot=bitMask$2(nt),it=new Array(Number(ot)+1).fill(tt),st=Math.floor((_.BITS-1)/nt)*nt;let at=tt;for(let lt=st;lt>=0;lt-=nt){it.fill(tt);for(let ft=0;ft>BigInt(lt)&ot);it[pt]=it[pt].add($[ft])}let ct=tt;for(let ft=it.length-1,dt=tt;ft>0;ft--)dt=dt.add(it[ft]),ct=ct.add(dt);if(at=at.add(ct),lt!==0)for(let ft=0;ft{const{Err:$}=DER$2;if(o<0||o>256)throw new $("tlv.encode: wrong tag");if(_.length&1)throw new $("tlv.encode: unpadded data");const j=_.length/2,_e=numberToHexUnpadded(j);if(_e.length/2&128)throw new $("tlv.encode: long form length too big");const et=j>127?numberToHexUnpadded(_e.length/2|128):"";return numberToHexUnpadded(o)+et+_e+_},decode(o,_){const{Err:$}=DER$2;let j=0;if(o<0||o>256)throw new $("tlv.encode: wrong tag");if(_.length<2||_[j++]!==o)throw new $("tlv.decode: wrong tlv");const _e=_[j++],et=!!(_e&128);let tt=0;if(!et)tt=_e;else{const nt=_e&127;if(!nt)throw new $("tlv.decode(long): indefinite length not supported");if(nt>4)throw new $("tlv.decode(long): byte length is too big");const ot=_.subarray(j,j+nt);if(ot.length!==nt)throw new $("tlv.decode: length bytes not complete");if(ot[0]===0)throw new $("tlv.decode(long): zero leftmost byte");for(const it of ot)tt=tt<<8|it;if(j+=nt,tt<128)throw new $("tlv.decode(long): not minimal encoding")}const rt=_.subarray(j,j+tt);if(rt.length!==tt)throw new $("tlv.decode: wrong value length");return{v:rt,l:_.subarray(j+tt)}}},_int:{encode(o){const{Err:_}=DER$2;if(o<_0n$9)throw new _("integer: negative integers are not allowed");let $=numberToHexUnpadded(o);if(Number.parseInt($[0],16)&8&&($="00"+$),$.length&1)throw new _("unexpected DER parsing assertion: unpadded hex");return $},decode(o){const{Err:_}=DER$2;if(o[0]&128)throw new _("invalid signature integer: negative");if(o[0]===0&&!(o[1]&128))throw new _("invalid signature integer: unnecessary leading zero");return bytesToNumberBE$2(o)}},toSig(o){const{Err:_,_int:$,_tlv:j}=DER$2,_e=ensureBytes$2("signature",o),{v:et,l:tt}=j.decode(48,_e);if(tt.length)throw new _("invalid signature: left bytes after parsing");const{v:rt,l:nt}=j.decode(2,et),{v:ot,l:it}=j.decode(2,nt);if(it.length)throw new _("invalid signature: left bytes after parsing");return{r:$.decode(rt),s:$.decode(ot)}},hexFromSig(o){const{_tlv:_,_int:$}=DER$2,j=_.encode(2,$.encode(o.r)),_e=_.encode(2,$.encode(o.s)),et=j+_e;return _.encode(48,et)}};function numToSizedHex(o,_){return bytesToHex$3(numberToBytesBE$2(o,_))}const _0n$9=BigInt(0),_1n$d=BigInt(1);BigInt(2);const _3n$4=BigInt(3),_4n$2=BigInt(4);function weierstrassPoints$2(o){const _=validatePointOpts$2(o),{Fp:$}=_,j=Field$2(_.n,_.nBitLength),_e=_.toBytes||((vt,wt,Ct)=>{const Pt=wt.toAffine();return concatBytes$4(Uint8Array.from([4]),$.toBytes(Pt.x),$.toBytes(Pt.y))}),et=_.fromBytes||(vt=>{const wt=vt.subarray(1),Ct=$.fromBytes(wt.subarray(0,$.BYTES)),Pt=$.fromBytes(wt.subarray($.BYTES,2*$.BYTES));return{x:Ct,y:Pt}});function tt(vt){const{a:wt,b:Ct}=_,Pt=$.sqr(vt),Bt=$.mul(Pt,vt);return $.add($.add(Bt,$.mul(vt,wt)),Ct)}function rt(vt,wt){const Ct=$.sqr(wt),Pt=tt(vt);return $.eql(Ct,Pt)}if(!rt(_.Gx,_.Gy))throw new Error("bad curve params: generator point");const nt=$.mul($.pow(_.a,_3n$4),_4n$2),ot=$.mul($.sqr(_.b),BigInt(27));if($.is0($.add(nt,ot)))throw new Error("bad curve params: a or b");function it(vt){return inRange(vt,_1n$d,_.n)}function st(vt){const{allowedPrivateKeyLengths:wt,nByteLength:Ct,wrapPrivateKey:Pt,n:Bt}=_;if(wt&&typeof vt!="bigint"){if(isBytes$2(vt)&&(vt=bytesToHex$3(vt)),typeof vt!="string"||!wt.includes(vt.length))throw new Error("invalid private key");vt=vt.padStart(Ct*2,"0")}let At;try{At=typeof vt=="bigint"?vt:bytesToNumberBE$2(ensureBytes$2("private key",vt,Ct))}catch{throw new Error("invalid private key, expected hex or "+Ct+" bytes, got "+typeof vt)}return Pt&&(At=mod$2(At,Bt)),aInRange("private key",At,_1n$d,Bt),At}function at(vt){if(!(vt instanceof ft))throw new Error("ProjectivePoint expected")}const lt=memoized((vt,wt)=>{const{px:Ct,py:Pt,pz:Bt}=vt;if($.eql(Bt,$.ONE))return{x:Ct,y:Pt};const At=vt.is0();wt==null&&(wt=At?$.ONE:$.inv(Bt));const kt=$.mul(Ct,wt),Ot=$.mul(Pt,wt),Tt=$.mul(Bt,wt);if(At)return{x:$.ZERO,y:$.ZERO};if(!$.eql(Tt,$.ONE))throw new Error("invZ was invalid");return{x:kt,y:Ot}}),ct=memoized(vt=>{if(vt.is0()){if(_.allowInfinityPoint&&!$.is0(vt.py))return;throw new Error("bad point: ZERO")}const{x:wt,y:Ct}=vt.toAffine();if(!$.isValid(wt)||!$.isValid(Ct))throw new Error("bad point: x or y not FE");if(!rt(wt,Ct))throw new Error("bad point: equation left != right");if(!vt.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0});class ft{constructor(wt,Ct,Pt){if(wt==null||!$.isValid(wt))throw new Error("x required");if(Ct==null||!$.isValid(Ct)||$.is0(Ct))throw new Error("y required");if(Pt==null||!$.isValid(Pt))throw new Error("z required");this.px=wt,this.py=Ct,this.pz=Pt,Object.freeze(this)}static fromAffine(wt){const{x:Ct,y:Pt}=wt||{};if(!wt||!$.isValid(Ct)||!$.isValid(Pt))throw new Error("invalid affine point");if(wt instanceof ft)throw new Error("projective point not allowed");const Bt=At=>$.eql(At,$.ZERO);return Bt(Ct)&&Bt(Pt)?ft.ZERO:new ft(Ct,Pt,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(wt){const Ct=FpInvertBatch$2($,wt.map(Pt=>Pt.pz));return wt.map((Pt,Bt)=>Pt.toAffine(Ct[Bt])).map(ft.fromAffine)}static fromHex(wt){const Ct=ft.fromAffine(et(ensureBytes$2("pointHex",wt)));return Ct.assertValidity(),Ct}static fromPrivateKey(wt){return ft.BASE.multiply(st(wt))}static msm(wt,Ct){return pippenger(ft,j,wt,Ct)}_setWindowSize(wt){yt.setWindowSize(this,wt)}assertValidity(){ct(this)}hasEvenY(){const{y:wt}=this.toAffine();if($.isOdd)return!$.isOdd(wt);throw new Error("Field doesn't support isOdd")}equals(wt){at(wt);const{px:Ct,py:Pt,pz:Bt}=this,{px:At,py:kt,pz:Ot}=wt,Tt=$.eql($.mul(Ct,Ot),$.mul(At,Bt)),ht=$.eql($.mul(Pt,Ot),$.mul(kt,Bt));return Tt&&ht}negate(){return new ft(this.px,$.neg(this.py),this.pz)}double(){const{a:wt,b:Ct}=_,Pt=$.mul(Ct,_3n$4),{px:Bt,py:At,pz:kt}=this;let Ot=$.ZERO,Tt=$.ZERO,ht=$.ZERO,bt=$.mul(Bt,Bt),mt=$.mul(At,At),gt=$.mul(kt,kt),xt=$.mul(Bt,At);return xt=$.add(xt,xt),ht=$.mul(Bt,kt),ht=$.add(ht,ht),Ot=$.mul(wt,ht),Tt=$.mul(Pt,gt),Tt=$.add(Ot,Tt),Ot=$.sub(mt,Tt),Tt=$.add(mt,Tt),Tt=$.mul(Ot,Tt),Ot=$.mul(xt,Ot),ht=$.mul(Pt,ht),gt=$.mul(wt,gt),xt=$.sub(bt,gt),xt=$.mul(wt,xt),xt=$.add(xt,ht),ht=$.add(bt,bt),bt=$.add(ht,bt),bt=$.add(bt,gt),bt=$.mul(bt,xt),Tt=$.add(Tt,bt),gt=$.mul(At,kt),gt=$.add(gt,gt),bt=$.mul(gt,xt),Ot=$.sub(Ot,bt),ht=$.mul(gt,mt),ht=$.add(ht,ht),ht=$.add(ht,ht),new ft(Ot,Tt,ht)}add(wt){at(wt);const{px:Ct,py:Pt,pz:Bt}=this,{px:At,py:kt,pz:Ot}=wt;let Tt=$.ZERO,ht=$.ZERO,bt=$.ZERO;const mt=_.a,gt=$.mul(_.b,_3n$4);let xt=$.mul(Ct,At),Et=$.mul(Pt,kt),_t=$.mul(Bt,Ot),$t=$.add(Ct,Pt),St=$.add(At,kt);$t=$.mul($t,St),St=$.add(xt,Et),$t=$.sub($t,St),St=$.add(Ct,Bt);let Rt=$.add(At,Ot);return St=$.mul(St,Rt),Rt=$.add(xt,_t),St=$.sub(St,Rt),Rt=$.add(Pt,Bt),Tt=$.add(kt,Ot),Rt=$.mul(Rt,Tt),Tt=$.add(Et,_t),Rt=$.sub(Rt,Tt),bt=$.mul(mt,St),Tt=$.mul(gt,_t),bt=$.add(Tt,bt),Tt=$.sub(Et,bt),bt=$.add(Et,bt),ht=$.mul(Tt,bt),Et=$.add(xt,xt),Et=$.add(Et,xt),_t=$.mul(mt,_t),St=$.mul(gt,St),Et=$.add(Et,_t),_t=$.sub(xt,_t),_t=$.mul(mt,_t),St=$.add(St,_t),xt=$.mul(Et,St),ht=$.add(ht,xt),xt=$.mul(Rt,St),Tt=$.mul($t,Tt),Tt=$.sub(Tt,xt),xt=$.mul($t,Et),bt=$.mul(Rt,bt),bt=$.add(bt,xt),new ft(Tt,ht,bt)}subtract(wt){return this.add(wt.negate())}is0(){return this.equals(ft.ZERO)}wNAF(wt){return yt.wNAFCached(this,wt,ft.normalizeZ)}multiplyUnsafe(wt){const{endo:Ct,n:Pt}=_;aInRange("scalar",wt,_0n$9,Pt);const Bt=ft.ZERO;if(wt===_0n$9)return Bt;if(this.is0()||wt===_1n$d)return this;if(!Ct||yt.hasPrecomputes(this))return yt.wNAFCachedUnsafe(this,wt,ft.normalizeZ);let{k1neg:At,k1:kt,k2neg:Ot,k2:Tt}=Ct.splitScalar(wt),ht=Bt,bt=Bt,mt=this;for(;kt>_0n$9||Tt>_0n$9;)kt&_1n$d&&(ht=ht.add(mt)),Tt&_1n$d&&(bt=bt.add(mt)),mt=mt.double(),kt>>=_1n$d,Tt>>=_1n$d;return At&&(ht=ht.negate()),Ot&&(bt=bt.negate()),bt=new ft($.mul(bt.px,Ct.beta),bt.py,bt.pz),ht.add(bt)}multiply(wt){const{endo:Ct,n:Pt}=_;aInRange("scalar",wt,_1n$d,Pt);let Bt,At;if(Ct){const{k1neg:kt,k1:Ot,k2neg:Tt,k2:ht}=Ct.splitScalar(wt);let{p:bt,f:mt}=this.wNAF(Ot),{p:gt,f:xt}=this.wNAF(ht);bt=yt.constTimeNegate(kt,bt),gt=yt.constTimeNegate(Tt,gt),gt=new ft($.mul(gt.px,Ct.beta),gt.py,gt.pz),Bt=bt.add(gt),At=mt.add(xt)}else{const{p:kt,f:Ot}=this.wNAF(wt);Bt=kt,At=Ot}return ft.normalizeZ([Bt,At])[0]}multiplyAndAddUnsafe(wt,Ct,Pt){const Bt=ft.BASE,At=(Ot,Tt)=>Tt===_0n$9||Tt===_1n$d||!Ot.equals(Bt)?Ot.multiplyUnsafe(Tt):Ot.multiply(Tt),kt=At(this,Ct).add(At(wt,Pt));return kt.is0()?void 0:kt}toAffine(wt){return lt(this,wt)}isTorsionFree(){const{h:wt,isTorsionFree:Ct}=_;if(wt===_1n$d)return!0;if(Ct)return Ct(ft,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:wt,clearCofactor:Ct}=_;return wt===_1n$d?this:Ct?Ct(ft,this):this.multiplyUnsafe(_.h)}toRawBytes(wt=!0){return abool("isCompressed",wt),this.assertValidity(),_e(ft,this,wt)}toHex(wt=!0){return abool("isCompressed",wt),bytesToHex$3(this.toRawBytes(wt))}}ft.BASE=new ft(_.Gx,_.Gy,$.ONE),ft.ZERO=new ft($.ZERO,$.ONE,$.ZERO);const{endo:dt,nBitLength:pt}=_,yt=wNAF$2(ft,dt?Math.ceil(pt/2):pt);return{CURVE:_,ProjectivePoint:ft,normPrivateKeyToScalar:st,weierstrassEquation:tt,isWithinCurveOrder:it}}function validateOpts$2(o){const _=validateBasic$2(o);return validateObject$5(_,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,..._})}function weierstrass$2(o){const _=validateOpts$2(o),{Fp:$,n:j,nByteLength:_e,nBitLength:et}=_,tt=$.BYTES+1,rt=2*$.BYTES+1;function nt(gt){return mod$2(gt,j)}function ot(gt){return invert$2(gt,j)}const{ProjectivePoint:it,normPrivateKeyToScalar:st,weierstrassEquation:at,isWithinCurveOrder:lt}=weierstrassPoints$2({..._,toBytes(gt,xt,Et){const _t=xt.toAffine(),$t=$.toBytes(_t.x),St=concatBytes$4;return abool("isCompressed",Et),Et?St(Uint8Array.from([xt.hasEvenY()?2:3]),$t):St(Uint8Array.from([4]),$t,$.toBytes(_t.y))},fromBytes(gt){const xt=gt.length,Et=gt[0],_t=gt.subarray(1);if(xt===tt&&(Et===2||Et===3)){const $t=bytesToNumberBE$2(_t);if(!inRange($t,_1n$d,$.ORDER))throw new Error("Point is not on curve");const St=at($t);let Rt;try{Rt=$.sqrt(St)}catch(Vt){const Gt=Vt instanceof Error?": "+Vt.message:"";throw new Error("Point is not on curve"+Gt)}const It=(Rt&_1n$d)===_1n$d;return(Et&1)===1!==It&&(Rt=$.neg(Rt)),{x:$t,y:Rt}}else if(xt===rt&&Et===4){const $t=$.fromBytes(_t.subarray(0,$.BYTES)),St=$.fromBytes(_t.subarray($.BYTES,2*$.BYTES));return{x:$t,y:St}}else{const $t=tt,St=rt;throw new Error("invalid Point, expected length of "+$t+", or uncompressed "+St+", got "+xt)}}});function ct(gt){const xt=j>>_1n$d;return gt>xt}function ft(gt){return ct(gt)?nt(-gt):gt}const dt=(gt,xt,Et)=>bytesToNumberBE$2(gt.slice(xt,Et));class pt{constructor(xt,Et,_t){aInRange("r",xt,_1n$d,j),aInRange("s",Et,_1n$d,j),this.r=xt,this.s=Et,_t!=null&&(this.recovery=_t),Object.freeze(this)}static fromCompact(xt){const Et=_e;return xt=ensureBytes$2("compactSignature",xt,Et*2),new pt(dt(xt,0,Et),dt(xt,Et,2*Et))}static fromDER(xt){const{r:Et,s:_t}=DER$2.toSig(ensureBytes$2("DER",xt));return new pt(Et,_t)}assertValidity(){}addRecoveryBit(xt){return new pt(this.r,this.s,xt)}recoverPublicKey(xt){const{r:Et,s:_t,recovery:$t}=this,St=Bt(ensureBytes$2("msgHash",xt));if($t==null||![0,1,2,3].includes($t))throw new Error("recovery id invalid");const Rt=$t===2||$t===3?Et+_.n:Et;if(Rt>=$.ORDER)throw new Error("recovery id 2 or 3 invalid");const It=$t&1?"03":"02",Mt=it.fromHex(It+numToSizedHex(Rt,$.BYTES)),Vt=ot(Rt),Gt=nt(-St*Vt),zt=nt(_t*Vt),jt=it.BASE.multiplyAndAddUnsafe(Mt,Gt,zt);if(!jt)throw new Error("point at infinify");return jt.assertValidity(),jt}hasHighS(){return ct(this.s)}normalizeS(){return this.hasHighS()?new pt(this.r,nt(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes$3(this.toDERHex())}toDERHex(){return DER$2.hexFromSig(this)}toCompactRawBytes(){return hexToBytes$3(this.toCompactHex())}toCompactHex(){const xt=_e;return numToSizedHex(this.r,xt)+numToSizedHex(this.s,xt)}}const yt={isValidPrivateKey(gt){try{return st(gt),!0}catch{return!1}},normPrivateKeyToScalar:st,randomPrivateKey:()=>{const gt=getMinHashLength$2(_.n);return mapHashToField$2(_.randomBytes(gt),_.n)},precompute(gt=8,xt=it.BASE){return xt._setWindowSize(gt),xt.multiply(BigInt(3)),xt}};function vt(gt,xt=!0){return it.fromPrivateKey(gt).toRawBytes(xt)}function wt(gt){if(typeof gt=="bigint")return!1;if(gt instanceof it)return!0;const Et=ensureBytes$2("key",gt).length,_t=$.BYTES,$t=_t+1,St=2*_t+1;if(!(_.allowedPrivateKeyLengths||_e===$t))return Et===$t||Et===St}function Ct(gt,xt,Et=!0){if(wt(gt)===!0)throw new Error("first arg must be private key");if(wt(xt)===!1)throw new Error("second arg must be public key");return it.fromHex(xt).multiply(st(gt)).toRawBytes(Et)}const Pt=_.bits2int||function(gt){if(gt.length>8192)throw new Error("input is too large");const xt=bytesToNumberBE$2(gt),Et=gt.length*8-et;return Et>0?xt>>BigInt(Et):xt},Bt=_.bits2int_modN||function(gt){return nt(Pt(gt))},At=bitMask$2(et);function kt(gt){return aInRange("num < 2^"+et,gt,_0n$9,At),numberToBytesBE$2(gt,_e)}function Ot(gt,xt,Et=Tt){if(["recovered","canonical"].some(qt=>qt in Et))throw new Error("sign() legacy options not supported");const{hash:_t,randomBytes:$t}=_;let{lowS:St,prehash:Rt,extraEntropy:It}=Et;St==null&&(St=!0),gt=ensureBytes$2("msgHash",gt),validateSigVerOpts(Et),Rt&&(gt=ensureBytes$2("prehashed msgHash",_t(gt)));const Mt=Bt(gt),Vt=st(xt),Gt=[kt(Vt),kt(Mt)];if(It!=null&&It!==!1){const qt=It===!0?$t($.BYTES):It;Gt.push(ensureBytes$2("extraEntropy",qt))}const zt=concatBytes$4(...Gt),jt=Mt;function Ft(qt){const Xt=Pt(qt);if(!lt(Xt))return;const Ut=ot(Xt),Lt=it.BASE.multiply(Xt).toAffine(),Ht=nt(Lt.x);if(Ht===_0n$9)return;const Kt=nt(Ut*nt(jt+Ht*Vt));if(Kt===_0n$9)return;let Jt=(Lt.x===Ht?0:2)|Number(Lt.y&_1n$d),tr=Kt;return St&&ct(Kt)&&(tr=ft(Kt),Jt^=1),new pt(Ht,tr,Jt)}return{seed:zt,k2sig:Ft}}const Tt={lowS:_.lowS,prehash:!1},ht={lowS:_.lowS,prehash:!1};function bt(gt,xt,Et=Tt){const{seed:_t,k2sig:$t}=Ot(gt,xt,Et),St=_;return createHmacDrbg$2(St.hash.outputLen,St.nByteLength,St.hmac)(_t,$t)}it.BASE._setWindowSize(8);function mt(gt,xt,Et,_t=ht){var Jt;const $t=gt;xt=ensureBytes$2("msgHash",xt),Et=ensureBytes$2("publicKey",Et);const{lowS:St,prehash:Rt,format:It}=_t;if(validateSigVerOpts(_t),"strict"in _t)throw new Error("options.strict was renamed to lowS");if(It!==void 0&&It!=="compact"&&It!=="der")throw new Error("format must be compact or der");const Mt=typeof $t=="string"||isBytes$2($t),Vt=!Mt&&!It&&typeof $t=="object"&&$t!==null&&typeof $t.r=="bigint"&&typeof $t.s=="bigint";if(!Mt&&!Vt)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let Gt,zt;try{if(Vt&&(Gt=new pt($t.r,$t.s)),Mt){try{It!=="compact"&&(Gt=pt.fromDER($t))}catch(tr){if(!(tr instanceof DER$2.Err))throw tr}!Gt&&It!=="der"&&(Gt=pt.fromCompact($t))}zt=it.fromHex(Et)}catch{return!1}if(!Gt||St&&Gt.hasHighS())return!1;Rt&&(xt=_.hash(xt));const{r:jt,s:Ft}=Gt,qt=Bt(xt),Xt=ot(Ft),Ut=nt(qt*Xt),Lt=nt(jt*Xt),Ht=(Jt=it.BASE.multiplyAndAddUnsafe(zt,Ut,Lt))==null?void 0:Jt.toAffine();return Ht?nt(Ht.x)===jt:!1}return{CURVE:_,getPublicKey:vt,getSharedSecret:Ct,sign:bt,verify:mt,ProjectivePoint:it,Signature:pt,utils:yt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash$2(o){return{hash:o,hmac:(_,...$)=>hmac$3(o,_,concatBytes$6(...$)),randomBytes:randomBytes$3}}function createCurve$2(o,_){const $=j=>weierstrass$2({...o,...getHash$2(j)});return{...$(_),create:$}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P$2=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N$2=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_0n$8=BigInt(0),_1n$c=BigInt(1),_2n$8=BigInt(2),divNearest$2=(o,_)=>(o+_/_2n$8)/_;function sqrtMod$2(o){const _=secp256k1P$2,$=BigInt(3),j=BigInt(6),_e=BigInt(11),et=BigInt(22),tt=BigInt(23),rt=BigInt(44),nt=BigInt(88),ot=o*o*o%_,it=ot*ot*o%_,st=pow2$2(it,$,_)*it%_,at=pow2$2(st,$,_)*it%_,lt=pow2$2(at,_2n$8,_)*ot%_,ct=pow2$2(lt,_e,_)*lt%_,ft=pow2$2(ct,et,_)*ct%_,dt=pow2$2(ft,rt,_)*ft%_,pt=pow2$2(dt,nt,_)*dt%_,yt=pow2$2(pt,rt,_)*ft%_,vt=pow2$2(yt,$,_)*it%_,wt=pow2$2(vt,tt,_)*ct%_,Ct=pow2$2(wt,j,_)*ot%_,Pt=pow2$2(Ct,_2n$8,_);if(!Fpk1.eql(Fpk1.sqr(Pt),o))throw new Error("Cannot find square root");return Pt}const Fpk1=Field$2(secp256k1P$2,void 0,void 0,{sqrt:sqrtMod$2}),secp256k1$3=createCurve$2({a:_0n$8,b:BigInt(7),Fp:Fpk1,n:secp256k1N$2,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:o=>{const _=secp256k1N$2,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),j=-_1n$c*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),_e=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),et=$,tt=BigInt("0x100000000000000000000000000000000"),rt=divNearest$2(et*o,_),nt=divNearest$2(-j*o,_);let ot=mod$2(o-rt*$-nt*_e,_),it=mod$2(-rt*j-nt*et,_);const st=ot>tt,at=it>tt;if(st&&(ot=_-ot),at&&(it=_-it),ot>tt||it>tt)throw new Error("splitScalar: Endomorphism failed, k="+o);return{k1neg:st,k1:ot,k2neg:at,k2:it}}}},sha256$6),secp256k1$4=Object.freeze(Object.defineProperty({__proto__:null,secp256k1:secp256k1$3},Symbol.toStringTag,{value:"Module"}));function assert$l(o,_={}){const{recovered:$}=_;if(typeof o.r>"u")throw new MissingPropertiesError({signature:o});if(typeof o.s>"u")throw new MissingPropertiesError({signature:o});if($&&typeof o.yParity>"u")throw new MissingPropertiesError({signature:o});if(o.r<0n||o.r>maxUint256)throw new InvalidRError({value:o.r});if(o.s<0n||o.s>maxUint256)throw new InvalidSError({value:o.s});if(typeof o.yParity=="number"&&o.yParity!==0&&o.yParity!==1)throw new InvalidYParityError({value:o.yParity})}function fromBytes(o){return fromHex(fromBytes$1(o))}function fromHex(o){if(o.length!==130&&o.length!==132)throw new InvalidSerializedSizeError({signature:o});const _=BigInt(slice$2(o,0,32)),$=BigInt(slice$2(o,32,64)),j=(()=>{const _e=+`0x${o.slice(130)}`;if(!Number.isNaN(_e))try{return vToYParity(_e)}catch{throw new InvalidYParityError({value:_e})}})();return typeof j>"u"?{r:_,s:$}:{r:_,s:$,yParity:j}}function extract(o){if(!(typeof o.r>"u")&&!(typeof o.s>"u"))return from$7(o)}function from$7(o){const _=typeof o=="string"?fromHex(o):o instanceof Uint8Array?fromBytes(o):typeof o.r=="string"?fromRpc$1(o):o.v?fromLegacy(o):{r:o.r,s:o.s,...typeof o.yParity<"u"?{yParity:o.yParity}:{}};return assert$l(_),_}function fromLegacy(o){return{r:o.r,s:o.s,yParity:vToYParity(o.v)}}function fromRpc$1(o){const _=(()=>{const $=o.v?Number(o.v):void 0;let j=o.yParity?Number(o.yParity):void 0;if(typeof $=="number"&&typeof j!="number"&&(j=vToYParity($)),typeof j!="number")throw new InvalidYParityError({value:o.yParity});return j})();return{r:BigInt(o.r),s:BigInt(o.s),yParity:_}}function vToYParity(o){if(o===0||o===27)return 0;if(o===1||o===28)return 1;if(o>=35)return o%2===0?1:0;throw new InvalidVError({value:o})}class InvalidSerializedSizeError extends BaseError{constructor({signature:_}){super(`Value \`${_}\` is an invalid signature size.`,{metaMessages:["Expected: 64 bytes or 65 bytes.",`Received ${size$1(from$9(_))} bytes.`]}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSerializedSizeError"})}}class MissingPropertiesError extends BaseError{constructor({signature:_}){super(`Signature \`${stringify$4(_)}\` is missing either an \`r\`, \`s\`, or \`yParity\` property.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.MissingPropertiesError"})}}class InvalidRError extends BaseError{constructor({value:_}){super(`Value \`${_}\` is an invalid r value. r must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidRError"})}}class InvalidSError extends BaseError{constructor({value:_}){super(`Value \`${_}\` is an invalid s value. s must be a positive integer less than 2^256.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidSError"})}}class InvalidYParityError extends BaseError{constructor({value:_}){super(`Value \`${_}\` is an invalid y-parity value. Y-parity must be 0 or 1.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidYParityError"})}}class InvalidVError extends BaseError{constructor({value:_}){super(`Value \`${_}\` is an invalid v value. v must be 27, 28 or >=35.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"Signature.InvalidVError"})}}function from$6(o,_={}){return typeof o.chainId=="string"?fromRpc(o):{...o,..._.signature}}function fromRpc(o){const{address:_,chainId:$,nonce:j}=o,_e=extract(o);return{address:_,chainId:Number($),nonce:BigInt(j),..._e}}const magicBytes$1="0x8010801080108010801080108010801080108010801080108010801080108010",suffixParameters=from$8("(uint256 chainId, address delegation, uint256 nonce, uint8 yParity, uint256 r, uint256 s), address to, bytes data");function assert$k(o){if(typeof o=="string"){if(slice$2(o,-32)!==magicBytes$1)throw new InvalidWrappedSignatureError$1(o)}else assert$l(o.authorization)}function unwrap(o){assert$k(o);const _=toNumber$1(slice$2(o,-64,-32)),$=slice$2(o,-_-64,-64),j=slice$2(o,0,-_-64),[_e,et,tt]=decode$3(suffixParameters,$);return{authorization:from$6({address:_e.delegation,chainId:Number(_e.chainId),nonce:_e.nonce,yParity:_e.yParity,r:_e.r,s:_e.s}),signature:j,...tt&&tt!=="0x"?{data:tt,to:et}:{}}}function validate$1(o){try{return assert$k(o),!0}catch{return!1}}let InvalidWrappedSignatureError$1=class extends BaseError{constructor(_){super(`Value \`${_}\` is an invalid ERC-8010 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc8010.InvalidWrappedSignatureError"})}};async function recoverMessageAddress({message:o,signature:_}){return recoverAddress({hash:hashMessage$1(o),signature:_})}async function verifyMessage$1({address:o,message:_,signature:$}){return isAddressEqual(getAddress(o),await recoverMessageAddress({message:_,signature:$}))}function formatStorageProof(o){return o.map(_=>({..._,value:BigInt(_.value)}))}function formatProof(o){return{...o,balance:o.balance?BigInt(o.balance):void 0,nonce:o.nonce?hexToNumber$3(o.nonce):void 0,storageProof:o.storageProof?formatStorageProof(o.storageProof):void 0}}async function getProof(o,{address:_,blockNumber:$,blockTag:j,storageKeys:_e}){const et=j??"latest",tt=$!==void 0?numberToHex($):void 0,rt=await o.request({method:"eth_getProof",params:[_,_e,tt||et]});return formatProof(rt)}async function getStorageAt(o,{address:_,blockNumber:$,blockTag:j="latest",slot:_e}){const et=$!==void 0?numberToHex($):void 0;return await o.request({method:"eth_getStorageAt",params:[_,_e,et||j]})}async function getTransaction(o,{blockHash:_,blockNumber:$,blockTag:j,hash:_e,index:et,sender:tt,nonce:rt}){var at,lt,ct;const nt=j||"latest",ot=$!==void 0?numberToHex($):void 0;let it=null;if(_e?it=await o.request({method:"eth_getTransactionByHash",params:[_e]},{dedupe:!0}):_?it=await o.request({method:"eth_getTransactionByBlockHashAndIndex",params:[_,numberToHex(et)]},{dedupe:!0}):typeof et=="number"?it=await o.request({method:"eth_getTransactionByBlockNumberAndIndex",params:[ot||nt,numberToHex(et)]},{dedupe:!!ot}):tt&&typeof rt=="number"&&(it=await o.request({method:"eth_getTransactionBySenderAndNonce",params:[tt,numberToHex(rt)]},{dedupe:!0})),!it)throw new TransactionNotFoundError({blockHash:_,blockNumber:$,blockTag:nt,hash:_e,index:et});return(((ct=(lt=(at=o.chain)==null?void 0:at.formatters)==null?void 0:lt.transaction)==null?void 0:ct.format)||formatTransaction)(it,"getTransaction")}async function getTransactionConfirmations(o,{hash:_,transactionReceipt:$}){const[j,_e]=await Promise.all([getAction(o,getBlockNumber,"getBlockNumber")({}),_?getAction(o,getTransaction,"getTransaction")({hash:_}):void 0]),et=($==null?void 0:$.blockNumber)||(_e==null?void 0:_e.blockNumber);return et?j-et+1n:0n}async function getTransactionReceipt(o,{hash:_}){var _e,et,tt;const $=await o.request({method:"eth_getTransactionReceipt",params:[_]},{dedupe:!0});if(!$)throw new TransactionReceiptNotFoundError({hash:_});return(((tt=(et=(_e=o.chain)==null?void 0:_e.formatters)==null?void 0:et.transactionReceipt)==null?void 0:tt.format)||formatTransactionReceipt)($,"getTransactionReceipt")}async function multicall(o,_){var yt;const{account:$,authorizationList:j,allowFailure:_e=!0,blockNumber:et,blockOverrides:tt,blockTag:rt,stateOverride:nt}=_,ot=_.contracts,{batchSize:it=_.batchSize??1024,deployless:st=_.deployless??!1}=typeof((yt=o.batch)==null?void 0:yt.multicall)=="object"?o.batch.multicall:{},at=(()=>{if(_.multicallAddress)return _.multicallAddress;if(st)return null;if(o.chain)return getChainContractAddress({blockNumber:et,chain:o.chain,contract:"multicall3"});throw new Error("client chain not configured. multicallAddress is required.")})(),lt=[[]];let ct=0,ft=0;for(let vt=0;vt0&&ft>it&<[ct].length>0&&(ct++,ft=(At.length-2)/2,lt[ct]=[]),lt[ct]=[...lt[ct],{allowFailure:!0,callData:At,target:Ct}]}catch(At){const kt=getContractError(At,{abi:wt,address:Ct,args:Pt,docsPath:"/docs/contract/multicall",functionName:Bt,sender:$});if(!_e)throw kt;lt[ct]=[...lt[ct],{allowFailure:!0,callData:"0x",target:Ct}]}}const dt=await Promise.allSettled(lt.map(vt=>getAction(o,readContract,"readContract")({...at===null?{code:multicall3Bytecode}:{address:at},abi:multicall3Abi,account:$,args:[vt],authorizationList:j,blockNumber:et,blockOverrides:tt,blockTag:rt,functionName:"aggregate3",stateOverride:nt}))),pt=[];for(let vt=0;vt{const pt=dt,yt=pt.account?parseAccount(pt.account):void 0,vt=pt.abi?encodeFunctionData(pt):pt.data,wt={...pt,account:yt,data:pt.dataSuffix?concat$2([vt||"0x",pt.dataSuffix]):vt,from:pt.from??(yt==null?void 0:yt.address)};return assertRequest(wt),formatTransactionRequest(wt)}),ft=at.stateOverrides?serializeStateOverride(at.stateOverrides):void 0;nt.push({blockOverrides:lt,calls:ct,stateOverrides:ft})}const it=(typeof $=="bigint"?numberToHex($):void 0)||j;return(await o.request({method:"eth_simulateV1",params:[{blockStateCalls:nt,returnFullTransactions:et,traceTransfers:tt,validation:rt},it]})).map((at,lt)=>({...formatBlock(at),calls:at.calls.map((ct,ft)=>{var Ot,Tt;const{abi:dt,args:pt,functionName:yt,to:vt}=_e[lt].calls[ft],wt=((Ot=ct.error)==null?void 0:Ot.data)??ct.returnData,Ct=BigInt(ct.gasUsed),Pt=(Tt=ct.logs)==null?void 0:Tt.map(ht=>formatLog(ht)),Bt=ct.status==="0x1"?"success":"failure",At=dt&&Bt==="success"&&wt!=="0x"?decodeFunctionResult({abi:dt,data:wt,functionName:yt}):null,kt=(()=>{if(Bt==="success")return;let ht;if(wt==="0x"?ht=new AbiDecodingZeroDataError:wt&&(ht=new RawContractError({data:wt})),!!ht)return getContractError(ht,{abi:dt??[],address:vt??"0x",args:pt,functionName:yt??""})})();return{data:wt,gasUsed:Ct,logs:Pt,status:Bt,...Bt==="success"?{result:At}:{error:kt}}})}))}catch(nt){const ot=nt,it=getNodeError(ot,{});throw it instanceof UnknownNodeError?ot:it}}function normalizeSignature(o){let _=!0,$="",j=0,_e="",et=!1;for(let tt=0;ttisArgOfType(Object.values(o)[et],_e)):/^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(j)?$==="number"||$==="bigint":/^bytes([1-9]|1[0-9]|2[0-9]|3[0-2])?$/.test(j)?$==="string"||o instanceof Uint8Array:/[a-z]+[1-9]{0,3}(\[[0-9]{0,}\])+$/.test(j)?Array.isArray(o)&&o.every(_e=>isArgOfType(_e,{..._,type:j.replace(/(\[[0-9]{0,}\])$/,"")})):!1}}function getAmbiguousTypes(o,_,$){for(const j in o){const _e=o[j],et=_[j];if(_e.type==="tuple"&&et.type==="tuple"&&"components"in _e&&"components"in et)return getAmbiguousTypes(_e.components,et.components,$[j]);const tt=[_e.type,et.type];if(tt.includes("address")&&tt.includes("bytes20")?!0:tt.includes("address")&&tt.includes("string")?validate$2($[j],{strict:!1}):tt.includes("address")&&tt.includes("bytes")?validate$2($[j],{strict:!1}):!1)return tt}}function from$5(o,_={}){const{prepare:$=!0}=_,j=Array.isArray(o)||typeof o=="string"?parseAbiItem(o):o;return{...j,...$?{hash:getSignatureHash(j)}:{}}}function fromAbi$2(o,_,$){const{args:j=[],prepare:_e=!0}=$??{},et=validate$3(_,{strict:!1}),tt=o.filter(ot=>et?ot.type==="function"||ot.type==="error"?getSelector$1(ot)===slice$2(_,0,4):ot.type==="event"?getSignatureHash(ot)===_:!1:"name"in ot&&ot.name===_);if(tt.length===0)throw new NotFoundError({name:_});if(tt.length===1)return{...tt[0],..._e?{hash:getSignatureHash(tt[0])}:{}};let rt;for(const ot of tt){if(!("inputs"in ot))continue;if(!j||j.length===0){if(!ot.inputs||ot.inputs.length===0)return{...ot,..._e?{hash:getSignatureHash(ot)}:{}};continue}if(!ot.inputs||ot.inputs.length===0||ot.inputs.length!==j.length)continue;if(j.every((st,at)=>{const lt="inputs"in ot&&ot.inputs[at];return lt?isArgOfType(st,lt):!1})){if(rt&&"inputs"in rt&&rt.inputs){const st=getAmbiguousTypes(ot.inputs,rt.inputs,j);if(st)throw new AmbiguityError({abiItem:ot,type:st[0]},{abiItem:rt,type:st[1]})}rt=ot}}const nt=(()=>{if(rt)return rt;const[ot,...it]=tt;return{...ot,overloads:it}})();if(!nt)throw new NotFoundError({name:_});return{...nt,..._e?{hash:getSignatureHash(nt)}:{}}}function getSelector$1(...o){const _=(()=>{if(Array.isArray(o[0])){const[$,j]=o;return fromAbi$2($,j)}return o[0]})();return slice$2(getSignatureHash(_),0,4)}function getSignature(...o){const _=(()=>{if(Array.isArray(o[0])){const[j,_e]=o;return fromAbi$2(j,_e)}return o[0]})(),$=typeof _=="string"?_:formatAbiItem$1(_);return normalizeSignature($)}function getSignatureHash(...o){const _=(()=>{if(Array.isArray(o[0])){const[$,j]=o;return fromAbi$2($,j)}return o[0]})();return typeof _!="string"&&"hash"in _&&_.hash?_.hash:keccak256$3(fromString(getSignature(_)))}class AmbiguityError extends BaseError{constructor(_,$){super("Found ambiguous types in overloaded ABI Items.",{metaMessages:[`\`${_.type}\` in \`${normalizeSignature(formatAbiItem$1(_.abiItem))}\`, and`,`\`${$.type}\` in \`${normalizeSignature(formatAbiItem$1($.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:"AbiItem.AmbiguityError"})}}class NotFoundError extends BaseError{constructor({name:_,data:$,type:j="item"}){const _e=_?` with name "${_}"`:$?` with data "${$}"`:"";super(`ABI ${j}${_e} not found.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"AbiItem.NotFoundError"})}}function encode$2(...o){var et;const[_,$]=(()=>{if(Array.isArray(o[0])){const[tt,rt]=o;return[fromAbi$1(tt),rt]}return o})(),{bytecode:j,args:_e}=$;return concat$1(j,(et=_.inputs)!=null&&et.length&&(_e!=null&&_e.length)?encode$3(_.inputs,_e):"0x")}function from$4(o){return from$5(o)}function fromAbi$1(o){const _=o.find($=>$.type==="constructor");if(!_)throw new NotFoundError({name:"constructor"});return _}function encodeData(...o){const[_,$=[]]=(()=>{if(Array.isArray(o[0])){const[ot,it,st]=o;return[fromAbi(ot,it,{args:st}),st]}const[rt,nt]=o;return[rt,nt]})(),{overloads:j}=_,_e=j?fromAbi([_,...j],_.name,{args:$}):_,et=getSelector(_e),tt=$.length>0?encode$3(_e.inputs,$):void 0;return tt?concat$1(et,tt):et}function from$3(o,_={}){return from$5(o,_)}function fromAbi(o,_,$){const j=fromAbi$2(o,_,$);if(j.type!=="function")throw new NotFoundError({name:_,type:"function"});return j}function getSelector(o){return getSelector$1(o)}const ethAddress="0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee",zeroAddress="0x0000000000000000000000000000000000000000",getBalanceCode="0x6080604052348015600e575f80fd5b5061016d8061001c5f395ff3fe608060405234801561000f575f80fd5b5060043610610029575f3560e01c8063f8b2cb4f1461002d575b5f80fd5b610047600480360381019061004291906100db565b61005d565b604051610054919061011e565b60405180910390f35b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6100aa82610081565b9050919050565b6100ba816100a0565b81146100c4575f80fd5b50565b5f813590506100d5816100b1565b92915050565b5f602082840312156100f0576100ef61007d565b5b5f6100fd848285016100c7565b91505092915050565b5f819050919050565b61011881610106565b82525050565b5f6020820190506101315f83018461010f565b9291505056fea26469706673582212203b9fe929fe995c7cf9887f0bdba8a36dd78e8b73f149b17d2d9ad7cd09d2dc6264736f6c634300081a0033";async function simulateCalls(o,_){const{blockNumber:$,blockTag:j,calls:_e,stateOverrides:et,traceAssetChanges:tt,traceTransfers:rt,validation:nt}=_,ot=_.account?parseAccount(_.account):void 0;if(tt&&!ot)throw new BaseError$1("`account` is required when `traceAssetChanges` is true");const it=ot?encode$2(from$4("constructor(bytes, bytes)"),{bytecode:deploylessCallViaBytecodeBytecode,args:[getBalanceCode,encodeData(from$3("function getBalance(address)"),[ot.address])]}):void 0,st=tt?await Promise.all(_.calls.map(async _t=>{if(!_t.data&&!_t.abi)return;const{accessList:$t}=await createAccessList(o,{account:ot.address,..._t,data:_t.abi?encodeFunctionData(_t):_t.data});return $t.map(({address:St,storageKeys:Rt})=>Rt.length>0?St:null)})).then(_t=>_t.flat().filter(Boolean)):[],at=await simulateBlocks(o,{blockNumber:$,blockTag:j,blocks:[...tt?[{calls:[{data:it}],stateOverrides:et},{calls:st.map((_t,$t)=>({abi:[from$3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[ot.address],to:_t,from:zeroAddress,nonce:$t})),stateOverrides:[{address:zeroAddress,nonce:0}]}]:[],{calls:[..._e,{}].map(_t=>({..._t,from:ot==null?void 0:ot.address})),stateOverrides:et},...tt?[{calls:[{data:it}]},{calls:st.map((_t,$t)=>({abi:[from$3("function balanceOf(address) returns (uint256)")],functionName:"balanceOf",args:[ot.address],to:_t,from:zeroAddress,nonce:$t})),stateOverrides:[{address:zeroAddress,nonce:0}]},{calls:st.map((_t,$t)=>({to:_t,abi:[from$3("function decimals() returns (uint256)")],functionName:"decimals",from:zeroAddress,nonce:$t})),stateOverrides:[{address:zeroAddress,nonce:0}]},{calls:st.map((_t,$t)=>({to:_t,abi:[from$3("function tokenURI(uint256) returns (string)")],functionName:"tokenURI",args:[0n],from:zeroAddress,nonce:$t})),stateOverrides:[{address:zeroAddress,nonce:0}]},{calls:st.map((_t,$t)=>({to:_t,abi:[from$3("function symbol() returns (string)")],functionName:"symbol",from:zeroAddress,nonce:$t})),stateOverrides:[{address:zeroAddress,nonce:0}]}]:[]],traceTransfers:rt,validation:nt}),lt=tt?at[2]:at[0],[ct,ft,,dt,pt,yt,vt,wt]=tt?at:[],{calls:Ct,...Pt}=lt,Bt=Ct.slice(0,-1)??[],At=(ct==null?void 0:ct.calls)??[],kt=(ft==null?void 0:ft.calls)??[],Ot=[...At,...kt].map(_t=>_t.status==="success"?hexToBigInt(_t.data):null),Tt=(dt==null?void 0:dt.calls)??[],ht=(pt==null?void 0:pt.calls)??[],bt=[...Tt,...ht].map(_t=>_t.status==="success"?hexToBigInt(_t.data):null),mt=((yt==null?void 0:yt.calls)??[]).map(_t=>_t.status==="success"?_t.result:null),gt=((wt==null?void 0:wt.calls)??[]).map(_t=>_t.status==="success"?_t.result:null),xt=((vt==null?void 0:vt.calls)??[]).map(_t=>_t.status==="success"?_t.result:null),Et=[];for(const[_t,$t]of bt.entries()){const St=Ot[_t];if(typeof $t!="bigint"||typeof St!="bigint")continue;const Rt=mt[_t-1],It=gt[_t-1],Mt=xt[_t-1],Vt=_t===0?{address:ethAddress,decimals:18,symbol:"ETH"}:{address:st[_t-1],decimals:Mt||Rt?Number(Rt??1):void 0,symbol:It??void 0};Et.some(Gt=>Gt.token.address===Vt.address)||Et.push({token:Vt,value:{pre:St,post:$t,diff:$t-St}})}return{assetChanges:Et,block:Pt,results:Bt}}const magicBytes="0x6492649264926492649264926492649264926492649264926492649264926492";function assert$j(o){if(slice$2(o,-32)!==magicBytes)throw new InvalidWrappedSignatureError(o)}function wrap(o){const{data:_,signature:$,to:j}=o;return concat$1(encode$3(from$8("address, bytes, bytes"),[j,_,$]),magicBytes)}function validate(o){try{return assert$j(o),!0}catch{return!1}}class InvalidWrappedSignatureError extends BaseError{constructor(_){super(`Value \`${_}\` is an invalid ERC-6492 wrapped signature.`),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"SignatureErc6492.InvalidWrappedSignatureError"})}}function serializeSignature({r:o,s:_,to:$="hex",v:j,yParity:_e}){const et=(()=>{if(_e===0||_e===1)return _e;if(j&&(j===27n||j===28n||j>=35n))return j%2n===0n?1:0;throw new Error("Invalid `v` or `yParity` value")})(),tt=`0x${new secp256k1$3.Signature(hexToBigInt(o),hexToBigInt(_)).toCompactHex()}${et===0?"1b":"1c"}`;return $==="hex"?tt:hexToBytes$4(tt)}async function verifyHash(o,_){var nt,ot,it,st;const{address:$,chain:j=o.chain,hash:_e,erc6492VerifierAddress:et=_.universalSignatureVerifierAddress??((ot=(nt=j==null?void 0:j.contracts)==null?void 0:nt.erc6492Verifier)==null?void 0:ot.address),multicallAddress:tt=_.multicallAddress??((st=(it=j==null?void 0:j.contracts)==null?void 0:it.multicall3)==null?void 0:st.address)}=_;if(j!=null&&j.verifyHash)return await j.verifyHash(o,_);const rt=(()=>{const at=_.signature;return isHex(at)?at:typeof at=="object"&&"r"in at&&"s"in at?serializeSignature(at):bytesToHex$4(at)})();try{return validate$1(rt)?await verifyErc8010(o,{..._,multicallAddress:tt,signature:rt}):await verifyErc6492(o,{..._,verifierAddress:et,signature:rt})}catch(at){try{if(isAddressEqual(getAddress($),await recoverAddress({hash:_e,signature:rt})))return!0}catch{}if(at instanceof VerificationError)return!1;throw at}}async function verifyErc8010(o,_){var dt;const{address:$,blockNumber:j,blockTag:_e,hash:et,multicallAddress:tt}=_,{authorization:rt,data:nt,signature:ot,to:it}=unwrap(_.signature);if(await getCode(o,{address:$,blockNumber:j,blockTag:_e})===concatHex(["0xef0100",rt.address]))return await verifyErc1271(o,{address:$,blockNumber:j,blockTag:_e,hash:et,signature:ot});const at={address:rt.address,chainId:Number(rt.chainId),nonce:Number(rt.nonce),r:numberToHex(rt.r,{size:32}),s:numberToHex(rt.s,{size:32}),yParity:rt.yParity};if(!await verifyAuthorization({address:$,authorization:at}))throw new VerificationError;const ct=await getAction(o,readContract,"readContract")({...tt?{address:tt}:{code:multicall3Bytecode},authorizationList:[at],abi:multicall3Abi,blockNumber:j,blockTag:"pending",functionName:"aggregate3",args:[[...nt?[{allowFailure:!0,target:it??$,callData:nt}]:[],{allowFailure:!0,target:$,callData:encodeFunctionData({abi:erc1271Abi,functionName:"isValidSignature",args:[et,ot]})}]]}),ft=(dt=ct[ct.length-1])==null?void 0:dt.returnData;if(ft!=null&&ft.startsWith("0x1626ba7e"))return!0;throw new VerificationError}async function verifyErc6492(o,_){const{address:$,factory:j,factoryData:_e,hash:et,signature:tt,verifierAddress:rt,...nt}=_,ot=await(async()=>!j&&!_e||validate(tt)?tt:wrap({data:_e,signature:tt,to:j}))(),it=rt?{to:rt,data:encodeFunctionData({abi:erc6492SignatureValidatorAbi,functionName:"isValidSig",args:[$,et,ot]}),...nt}:{data:encodeDeployData({abi:erc6492SignatureValidatorAbi,args:[$,et,ot],bytecode:erc6492SignatureValidatorByteCode}),...nt},{data:st}=await getAction(o,call,"call")(it).catch(at=>{throw at instanceof CallExecutionError?new VerificationError:at});if(hexToBool(st??"0x0"))return!0;throw new VerificationError}async function verifyErc1271(o,_){const{address:$,blockNumber:j,blockTag:_e,hash:et,signature:tt}=_;if((await getAction(o,readContract,"readContract")({address:$,abi:erc1271Abi,args:[et,tt],blockNumber:j,blockTag:_e,functionName:"isValidSignature"}).catch(nt=>{throw nt instanceof ContractFunctionExecutionError?new VerificationError:nt})).startsWith("0x1626ba7e"))return!0;throw new VerificationError}class VerificationError extends Error{}async function verifyMessage(o,{address:_,message:$,factory:j,factoryData:_e,signature:et,...tt}){const rt=hashMessage$1($);return getAction(o,verifyHash,"verifyHash")({address:_,factory:j,factoryData:_e,hash:rt,signature:et,...tt})}async function verifyTypedData(o,_){const{address:$,factory:j,factoryData:_e,signature:et,message:tt,primaryType:rt,types:nt,domain:ot,...it}=_,st=hashTypedData({message:tt,primaryType:rt,types:nt,domain:ot});return getAction(o,verifyHash,"verifyHash")({address:$,factory:j,factoryData:_e,hash:st,signature:et,...it})}function watchBlockNumber(o,{emitOnBegin:_=!1,emitMissed:$=!1,onBlockNumber:j,onError:_e,poll:et,pollingInterval:tt=o.pollingInterval}){const rt=typeof et<"u"?et:!(o.transport.type==="webSocket"||o.transport.type==="ipc"||o.transport.type==="fallback"&&(o.transport.transports[0].config.type==="webSocket"||o.transport.transports[0].config.type==="ipc"));let nt;return rt?(()=>{const st=stringify$5(["watchBlockNumber",o.uid,_,$,tt]);return observe(st,{onBlockNumber:j,onError:_e},at=>poll(async()=>{var lt;try{const ct=await getAction(o,getBlockNumber,"getBlockNumber")({cacheTime:0});if(nt!==void 0){if(ct===nt)return;if(ct-nt>1&&$)for(let ft=nt+1n;ftnt)&&(at.onBlockNumber(ct,nt),nt=ct)}catch(ct){(lt=at.onError)==null||lt.call(at,ct)}},{emitOnBegin:_,interval:tt}))})():(()=>{const st=stringify$5(["watchBlockNumber",o.uid,_,$]);return observe(st,{onBlockNumber:j,onError:_e},at=>{let lt=!0,ct=()=>lt=!1;return(async()=>{try{const ft=(()=>{if(o.transport.type==="fallback"){const pt=o.transport.transports.find(yt=>yt.config.type==="webSocket"||yt.config.type==="ipc");return pt?pt.value:o.transport}return o.transport})(),{unsubscribe:dt}=await ft.subscribe({params:["newHeads"],onData(pt){var vt;if(!lt)return;const yt=hexToBigInt((vt=pt.result)==null?void 0:vt.number);at.onBlockNumber(yt,nt),nt=yt},onError(pt){var yt;(yt=at.onError)==null||yt.call(at,pt)}});ct=dt,lt||ct()}catch(ft){_e==null||_e(ft)}})(),()=>ct()})})()}async function waitForTransactionReceipt(o,_){const{checkReplacement:$=!0,confirmations:j=1,hash:_e,onReplaced:et,retryCount:tt=6,retryDelay:rt=({count:Ct})=>~~(1<{var Ct;return _.pollingInterval?_.pollingInterval:(Ct=o.chain)!=null&&Ct.experimental_preconfirmationTime?o.chain.experimental_preconfirmationTime:o.pollingInterval})();let st,at,lt,ct=!1,ft,dt;const{promise:pt,resolve:yt,reject:vt}=withResolvers(),wt=nt?setTimeout(()=>{dt==null||dt(),ft==null||ft(),vt(new WaitForTransactionReceiptTimeoutError({hash:_e}))},nt):void 0;return ft=observe(ot,{onReplaced:et,resolve:yt,reject:vt},async Ct=>{if(lt=await getAction(o,getTransactionReceipt,"getTransactionReceipt")({hash:_e}).catch(()=>{}),lt&&j<=1){clearTimeout(wt),Ct.resolve(lt),ft==null||ft();return}dt=getAction(o,watchBlockNumber,"watchBlockNumber")({emitMissed:!0,emitOnBegin:!0,poll:!0,pollingInterval:it,async onBlockNumber(Pt){const Bt=kt=>{clearTimeout(wt),dt==null||dt(),kt(),ft==null||ft()};let At=Pt;if(!ct)try{if(lt){if(j>1&&(!lt.blockNumber||At-lt.blockNumber+1nCt.resolve(lt));return}if($&&!st&&(ct=!0,await withRetry(async()=>{st=await getAction(o,getTransaction,"getTransaction")({hash:_e}),st.blockNumber&&(At=st.blockNumber)},{delay:rt,retryCount:tt}),ct=!1),lt=await getAction(o,getTransactionReceipt,"getTransactionReceipt")({hash:_e}),j>1&&(!lt.blockNumber||At-lt.blockNumber+1nCt.resolve(lt))}catch(kt){if(kt instanceof TransactionNotFoundError||kt instanceof TransactionReceiptNotFoundError){if(!st){ct=!1;return}try{at=st,ct=!0;const Ot=await withRetry(()=>getAction(o,getBlock,"getBlock")({blockNumber:At,includeTransactions:!0}),{delay:rt,retryCount:tt,shouldRetry:({error:bt})=>bt instanceof BlockNotFoundError});ct=!1;const Tt=Ot.transactions.find(({from:bt,nonce:mt})=>bt===at.from&&mt===at.nonce);if(!Tt||(lt=await getAction(o,getTransactionReceipt,"getTransactionReceipt")({hash:Tt.hash}),j>1&&(!lt.blockNumber||At-lt.blockNumber+1n{var bt;(bt=Ct.onReplaced)==null||bt.call(Ct,{reason:ht,replacedTransaction:at,transaction:Tt,transactionReceipt:lt}),Ct.resolve(lt)})}catch(Ot){Bt(()=>Ct.reject(Ot))}}else Bt(()=>Ct.reject(kt))}}})}),pt}function watchBlocks(o,{blockTag:_=o.experimental_blockTag??"latest",emitMissed:$=!1,emitOnBegin:j=!1,onBlock:_e,onError:et,includeTransactions:tt,poll:rt,pollingInterval:nt=o.pollingInterval}){const ot=typeof rt<"u"?rt:!(o.transport.type==="webSocket"||o.transport.type==="ipc"||o.transport.type==="fallback"&&(o.transport.transports[0].config.type==="webSocket"||o.transport.transports[0].config.type==="ipc")),it=tt??!1;let st;return ot?(()=>{const ct=stringify$5(["watchBlocks",o.uid,_,$,j,it,nt]);return observe(ct,{onBlock:_e,onError:et},ft=>poll(async()=>{var dt;try{const pt=await getAction(o,getBlock,"getBlock")({blockTag:_,includeTransactions:it});if(pt.number!==null&&(st==null?void 0:st.number)!=null){if(pt.number===st.number)return;if(pt.number-st.number>1&&$)for(let yt=(st==null?void 0:st.number)+1n;ytst.number)&&(ft.onBlock(pt,st),st=pt)}catch(pt){(dt=ft.onError)==null||dt.call(ft,pt)}},{emitOnBegin:j,interval:nt}))})():(()=>{let ct=!0,ft=!0,dt=()=>ct=!1;return(async()=>{try{j&&getAction(o,getBlock,"getBlock")({blockTag:_,includeTransactions:it}).then(vt=>{ct&&ft&&(_e(vt,void 0),ft=!1)}).catch(et);const pt=(()=>{if(o.transport.type==="fallback"){const vt=o.transport.transports.find(wt=>wt.config.type==="webSocket"||wt.config.type==="ipc");return vt?vt.value:o.transport}return o.transport})(),{unsubscribe:yt}=await pt.subscribe({params:["newHeads"],async onData(vt){var Ct;if(!ct)return;const wt=await getAction(o,getBlock,"getBlock")({blockNumber:(Ct=vt.result)==null?void 0:Ct.number,includeTransactions:it}).catch(()=>{});ct&&(_e(wt,st),ft=!1,st=wt)},onError(vt){et==null||et(vt)}});dt=yt,ct||dt()}catch(pt){et==null||et(pt)}})(),()=>dt()})()}function watchEvent(o,{address:_,args:$,batch:j=!0,event:_e,events:et,fromBlock:tt,onError:rt,onLogs:nt,poll:ot,pollingInterval:it=o.pollingInterval,strict:st}){const at=typeof ot<"u"?ot:typeof tt=="bigint"?!0:!(o.transport.type==="webSocket"||o.transport.type==="ipc"||o.transport.type==="fallback"&&(o.transport.transports[0].config.type==="webSocket"||o.transport.transports[0].config.type==="ipc")),lt=st??!1;return at?(()=>{const dt=stringify$5(["watchEvent",_,$,j,o.uid,_e,it,tt]);return observe(dt,{onLogs:nt,onError:rt},pt=>{let yt;tt!==void 0&&(yt=tt-1n);let vt,wt=!1;const Ct=poll(async()=>{var Pt;if(!wt){try{vt=await getAction(o,createEventFilter,"createEventFilter")({address:_,args:$,event:_e,events:et,strict:lt,fromBlock:tt})}catch{}wt=!0;return}try{let Bt;if(vt)Bt=await getAction(o,getFilterChanges,"getFilterChanges")({filter:vt});else{const At=await getAction(o,getBlockNumber,"getBlockNumber")({});yt&&yt!==At?Bt=await getAction(o,getLogs,"getLogs")({address:_,args:$,event:_e,events:et,fromBlock:yt+1n,toBlock:At}):Bt=[],yt=At}if(Bt.length===0)return;if(j)pt.onLogs(Bt);else for(const At of Bt)pt.onLogs([At])}catch(Bt){vt&&Bt instanceof InvalidInputRpcError&&(wt=!1),(Pt=pt.onError)==null||Pt.call(pt,Bt)}},{emitOnBegin:!0,interval:it});return async()=>{vt&&await getAction(o,uninstallFilter,"uninstallFilter")({filter:vt}),Ct()}})})():(()=>{let dt=!0,pt=()=>dt=!1;return(async()=>{try{const yt=(()=>{if(o.transport.type==="fallback"){const Pt=o.transport.transports.find(Bt=>Bt.config.type==="webSocket"||Bt.config.type==="ipc");return Pt?Pt.value:o.transport}return o.transport})(),vt=et??(_e?[_e]:void 0);let wt=[];vt&&(wt=[vt.flatMap(Bt=>encodeEventTopics({abi:[Bt],eventName:Bt.name,args:$}))],_e&&(wt=wt[0]));const{unsubscribe:Ct}=await yt.subscribe({params:["logs",{address:_,topics:wt}],onData(Pt){var At;if(!dt)return;const Bt=Pt.result;try{const{eventName:kt,args:Ot}=decodeEventLog({abi:vt??[],data:Bt.data,topics:Bt.topics,strict:lt}),Tt=formatLog(Bt,{args:Ot,eventName:kt});nt([Tt])}catch(kt){let Ot,Tt;if(kt instanceof DecodeLogDataMismatch||kt instanceof DecodeLogTopicsMismatch){if(st)return;Ot=kt.abiItem.name,Tt=(At=kt.abiItem.inputs)==null?void 0:At.some(bt=>!("name"in bt&&bt.name))}const ht=formatLog(Bt,{args:Tt?[]:{},eventName:Ot});nt([ht])}},onError(Pt){rt==null||rt(Pt)}});pt=Ct,dt||pt()}catch(yt){rt==null||rt(yt)}})(),()=>pt()})()}function watchPendingTransactions(o,{batch:_=!0,onError:$,onTransactions:j,poll:_e,pollingInterval:et=o.pollingInterval}){return(typeof _e<"u"?_e:o.transport.type!=="webSocket"&&o.transport.type!=="ipc")?(()=>{const ot=stringify$5(["watchPendingTransactions",o.uid,_,et]);return observe(ot,{onTransactions:j,onError:$},it=>{let st;const at=poll(async()=>{var lt;try{if(!st)try{st=await getAction(o,createPendingTransactionFilter,"createPendingTransactionFilter")({});return}catch(ft){throw at(),ft}const ct=await getAction(o,getFilterChanges,"getFilterChanges")({filter:st});if(ct.length===0)return;if(_)it.onTransactions(ct);else for(const ft of ct)it.onTransactions([ft])}catch(ct){(lt=it.onError)==null||lt.call(it,ct)}},{emitOnBegin:!0,interval:et});return async()=>{st&&await getAction(o,uninstallFilter,"uninstallFilter")({filter:st}),at()}})})():(()=>{let ot=!0,it=()=>ot=!1;return(async()=>{try{const{unsubscribe:st}=await o.transport.subscribe({params:["newPendingTransactions"],onData(at){if(!ot)return;const lt=at.result;j([lt])},onError(at){$==null||$(at)}});it=st,ot||it()}catch(st){$==null||$(st)}})(),()=>it()})()}function parseSiweMessage(o){var st,at,lt;const{scheme:_,statement:$,...j}=((st=o.match(prefixRegex))==null?void 0:st.groups)??{},{chainId:_e,expirationTime:et,issuedAt:tt,notBefore:rt,requestId:nt,...ot}=((at=o.match(suffixRegex))==null?void 0:at.groups)??{},it=(lt=o.split("Resources:")[1])==null?void 0:lt.split(` -- `).slice(1);return{...j,...ot,..._e?{chainId:Number(_e)}:{},...et?{expirationTime:new Date(et)}:{},...tt?{issuedAt:new Date(tt)}:{},...rt?{notBefore:new Date(rt)}:{},...nt?{requestId:nt}:{},...it?{resources:it}:{},..._?{scheme:_}:{},...$?{statement:$}:{}}}const prefixRegex=/^(?:(?[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)?/,suffixRegex=/(?:URI: (?.+))\n(?:Version: (?.+))\n(?:Chain ID: (?\d+))\n(?:Nonce: (?[a-zA-Z0-9]+))\n(?:Issued At: (?.+))(?:\nExpiration Time: (?.+))?(?:\nNot Before: (?.+))?(?:\nRequest ID: (?.+))?/;function validateSiweMessage(o){const{address:_,domain:$,message:j,nonce:_e,scheme:et,time:tt=new Date}=o;if($&&j.domain!==$||_e&&j.nonce!==_e||et&&j.scheme!==et||j.expirationTime&&tt>=j.expirationTime||j.notBefore&&ttcall(o,_),createAccessList:_=>createAccessList(o,_),createBlockFilter:()=>createBlockFilter(o),createContractEventFilter:_=>createContractEventFilter(o,_),createEventFilter:_=>createEventFilter(o,_),createPendingTransactionFilter:()=>createPendingTransactionFilter(o),estimateContractGas:_=>estimateContractGas(o,_),estimateGas:_=>estimateGas(o,_),getBalance:_=>getBalance(o,_),getBlobBaseFee:()=>getBlobBaseFee(o),getBlock:_=>getBlock(o,_),getBlockNumber:_=>getBlockNumber(o,_),getBlockTransactionCount:_=>getBlockTransactionCount(o,_),getBytecode:_=>getCode(o,_),getChainId:()=>getChainId(o),getCode:_=>getCode(o,_),getContractEvents:_=>getContractEvents(o,_),getEip712Domain:_=>getEip712Domain(o,_),getEnsAddress:_=>getEnsAddress(o,_),getEnsAvatar:_=>getEnsAvatar(o,_),getEnsName:_=>getEnsName(o,_),getEnsResolver:_=>getEnsResolver(o,_),getEnsText:_=>getEnsText(o,_),getFeeHistory:_=>getFeeHistory(o,_),estimateFeesPerGas:_=>estimateFeesPerGas(o,_),getFilterChanges:_=>getFilterChanges(o,_),getFilterLogs:_=>getFilterLogs(o,_),getGasPrice:()=>getGasPrice(o),getLogs:_=>getLogs(o,_),getProof:_=>getProof(o,_),estimateMaxPriorityFeePerGas:_=>estimateMaxPriorityFeePerGas(o,_),fillTransaction:_=>fillTransaction(o,_),getStorageAt:_=>getStorageAt(o,_),getTransaction:_=>getTransaction(o,_),getTransactionConfirmations:_=>getTransactionConfirmations(o,_),getTransactionCount:_=>getTransactionCount(o,_),getTransactionReceipt:_=>getTransactionReceipt(o,_),multicall:_=>multicall(o,_),prepareTransactionRequest:_=>prepareTransactionRequest(o,_),readContract:_=>readContract(o,_),sendRawTransaction:_=>sendRawTransaction(o,_),sendRawTransactionSync:_=>sendRawTransactionSync(o,_),simulate:_=>simulateBlocks(o,_),simulateBlocks:_=>simulateBlocks(o,_),simulateCalls:_=>simulateCalls(o,_),simulateContract:_=>simulateContract(o,_),verifyHash:_=>verifyHash(o,_),verifyMessage:_=>verifyMessage(o,_),verifySiweMessage:_=>verifySiweMessage(o,_),verifyTypedData:_=>verifyTypedData(o,_),uninstallFilter:_=>uninstallFilter(o,_),waitForTransactionReceipt:_=>waitForTransactionReceipt(o,_),watchBlocks:_=>watchBlocks(o,_),watchBlockNumber:_=>watchBlockNumber(o,_),watchContractEvent:_=>watchContractEvent(o,_),watchEvent:_=>watchEvent(o,_),watchPendingTransactions:_=>watchPendingTransactions(o,_)}}function createPublicClient(o){const{key:_="public",name:$="Public Client"}=o;return createClient({...o,key:_,name:$,type:"publicClient"}).extend(publicActions)}async function addChain(o,{chain:_}){const{id:$,name:j,nativeCurrency:_e,rpcUrls:et,blockExplorers:tt}=_;await o.request({method:"wallet_addEthereumChain",params:[{chainId:numberToHex($),chainName:j,nativeCurrency:_e,rpcUrls:et.default.http,blockExplorerUrls:tt?Object.values(tt).map(({url:rt})=>rt):void 0}]},{dedupe:!0,retryCount:0})}function deployContract(o,_){const{abi:$,args:j,bytecode:_e,...et}=_,tt=encodeDeployData({abi:$,args:j,bytecode:_e});return sendTransaction(o,{...et,...et.authorizationList?{to:null}:{},data:tt})}async function getAddresses(o){var $;return(($=o.account)==null?void 0:$.type)==="local"?[o.account.address]:(await o.request({method:"eth_accounts"},{dedupe:!0})).map(j=>checksumAddress(j))}async function getCapabilities(o,_={}){const{account:$=o.account,chainId:j}=_,_e=$?parseAccount($):void 0,et=j?[_e==null?void 0:_e.address,[numberToHex(j)]]:[_e==null?void 0:_e.address],tt=await o.request({method:"wallet_getCapabilities",params:et}),rt={};for(const[nt,ot]of Object.entries(tt)){rt[Number(nt)]={};for(let[it,st]of Object.entries(ot))it==="addSubAccount"&&(it="unstable_addSubAccount"),rt[Number(nt)][it]=st}return typeof j=="number"?rt[j]:rt}async function getPermissions(o){return await o.request({method:"wallet_getPermissions"},{dedupe:!0})}async function prepareAuthorization(o,_){var nt;const{account:$=o.account,chainId:j,nonce:_e}=_;if(!$)throw new AccountNotFoundError({docsPath:"/docs/eip7702/prepareAuthorization"});const et=parseAccount($),tt=(()=>{if(_.executor)return _.executor==="self"?_.executor:parseAccount(_.executor)})(),rt={address:_.contractAddress??_.address,chainId:j,nonce:_e};return typeof rt.chainId>"u"&&(rt.chainId=((nt=o.chain)==null?void 0:nt.id)??await getAction(o,getChainId,"getChainId")({})),typeof rt.nonce>"u"&&(rt.nonce=await getAction(o,getTransactionCount,"getTransactionCount")({address:et.address,blockTag:"pending"}),(tt==="self"||tt!=null&&tt.address&&isAddressEqual(tt.address,et.address))&&(rt.nonce+=1)),rt}async function requestAddresses(o){return(await o.request({method:"eth_requestAccounts"},{dedupe:!0,retryCount:0})).map($=>getAddress($))}async function requestPermissions(o,_){return o.request({method:"wallet_requestPermissions",params:[_]},{retryCount:0})}async function sendCallsSync(o,_){const{chain:$=o.chain}=_,j=_.timeout??Math.max((($==null?void 0:$.blockTime)??0)*3,5e3),_e=await sendCalls(o,_);return await waitForCallsStatus(o,{..._,id:_e.id,timeout:j})}const supportsWalletNamespace=new LruMap$1(128);async function sendTransactionSync(o,_){var Bt,At,kt,Ot,Tt;const{account:$=o.account,assertChainId:j=!0,chain:_e=o.chain,accessList:et,authorizationList:tt,blobs:rt,data:nt,dataSuffix:ot=typeof o.dataSuffix=="string"?o.dataSuffix:(Bt=o.dataSuffix)==null?void 0:Bt.value,gas:it,gasPrice:st,maxFeePerBlobGas:at,maxFeePerGas:lt,maxPriorityFeePerGas:ct,nonce:ft,pollingInterval:dt,throwOnReceiptRevert:pt,type:yt,value:vt,...wt}=_,Ct=_.timeout??Math.max(((_e==null?void 0:_e.blockTime)??0)*3,5e3);if(typeof $>"u")throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/sendTransactionSync"});const Pt=$?parseAccount($):null;try{assertRequest(_);const ht=await(async()=>{if(_.to)return _.to;if(_.to!==null&&tt&&tt.length>0)return await recoverAuthorizationAddress({authorization:tt[0]}).catch(()=>{throw new BaseError$1("`to` is required. Could not infer from `authorizationList`.")})})();if((Pt==null?void 0:Pt.type)==="json-rpc"||Pt===null){let bt;_e!==null&&(bt=await getAction(o,getChainId,"getChainId")({}),j&&assertCurrentChain({currentChainId:bt,chain:_e}));const mt=(Ot=(kt=(At=o.chain)==null?void 0:At.formatters)==null?void 0:kt.transactionRequest)==null?void 0:Ot.format,xt=(mt||formatTransactionRequest)({...extract$1(wt,{format:mt}),accessList:et,account:Pt,authorizationList:tt,blobs:rt,chainId:bt,data:nt&&concat$2([nt,ot??"0x"]),gas:it,gasPrice:st,maxFeePerBlobGas:at,maxFeePerGas:lt,maxPriorityFeePerGas:ct,nonce:ft,to:ht,type:yt,value:vt},"sendTransaction"),Et=supportsWalletNamespace.get(o.uid),_t=Et?"wallet_sendTransaction":"eth_sendTransaction",$t=await(async()=>{try{return await o.request({method:_t,params:[xt]},{retryCount:0})}catch(Rt){if(Et===!1)throw Rt;const It=Rt;if(It.name==="InvalidInputRpcError"||It.name==="InvalidParamsRpcError"||It.name==="MethodNotFoundRpcError"||It.name==="MethodNotSupportedRpcError")return await o.request({method:"wallet_sendTransaction",params:[xt]},{retryCount:0}).then(Mt=>(supportsWalletNamespace.set(o.uid,!0),Mt)).catch(Mt=>{const Vt=Mt;throw Vt.name==="MethodNotFoundRpcError"||Vt.name==="MethodNotSupportedRpcError"?(supportsWalletNamespace.set(o.uid,!1),It):Vt});throw It}})(),St=await getAction(o,waitForTransactionReceipt,"waitForTransactionReceipt")({checkReplacement:!1,hash:$t,pollingInterval:dt,timeout:Ct});if(pt&&St.status==="reverted")throw new TransactionReceiptRevertedError({receipt:St});return St}if((Pt==null?void 0:Pt.type)==="local"){const bt=await getAction(o,prepareTransactionRequest,"prepareTransactionRequest")({account:Pt,accessList:et,authorizationList:tt,blobs:rt,chain:_e,data:nt&&concat$2([nt,ot??"0x"]),gas:it,gasPrice:st,maxFeePerBlobGas:at,maxFeePerGas:lt,maxPriorityFeePerGas:ct,nonce:ft,nonceManager:Pt.nonceManager,parameters:[...defaultParameters,"sidecars"],type:yt,value:vt,...wt,to:ht}),mt=(Tt=_e==null?void 0:_e.serializers)==null?void 0:Tt.transaction,gt=await Pt.signTransaction(bt,{serializer:mt});return await getAction(o,sendRawTransactionSync,"sendRawTransactionSync")({serializedTransaction:gt,throwOnReceiptRevert:pt,timeout:_.timeout})}throw(Pt==null?void 0:Pt.type)==="smart"?new AccountTypeNotSupportedError({metaMessages:["Consider using the `sendUserOperation` Action instead."],docsPath:"/docs/actions/bundler/sendUserOperation",type:"smart"}):new AccountTypeNotSupportedError({docsPath:"/docs/actions/wallet/sendTransactionSync",type:Pt==null?void 0:Pt.type})}catch(ht){throw ht instanceof AccountTypeNotSupportedError?ht:getTransactionError(ht,{..._,account:Pt,chain:_.chain||void 0})}}async function showCallsStatus(o,_){const{id:$}=_;await o.request({method:"wallet_showCallsStatus",params:[$]})}async function signAuthorization(o,_){const{account:$=o.account}=_;if(!$)throw new AccountNotFoundError({docsPath:"/docs/eip7702/signAuthorization"});const j=parseAccount($);if(!j.signAuthorization)throw new AccountTypeNotSupportedError({docsPath:"/docs/eip7702/signAuthorization",metaMessages:["The `signAuthorization` Action does not support JSON-RPC Accounts."],type:j.type});const _e=await prepareAuthorization(o,_);return j.signAuthorization(_e)}async function signMessage$1(o,{account:_=o.account,message:$}){if(!_)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signMessage"});const j=parseAccount(_);if(j.signMessage)return j.signMessage({message:$});const _e=typeof $=="string"?stringToHex($):$.raw instanceof Uint8Array?toHex$1($.raw):$.raw;return o.request({method:"personal_sign",params:[_e,j.address]},{retryCount:0})}async function signTransaction(o,_){var ot,it,st,at;const{account:$=o.account,chain:j=o.chain,..._e}=_;if(!$)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signTransaction"});const et=parseAccount($);assertRequest({account:et,..._});const tt=await getAction(o,getChainId,"getChainId")({});j!==null&&assertCurrentChain({currentChainId:tt,chain:j});const rt=(j==null?void 0:j.formatters)||((ot=o.chain)==null?void 0:ot.formatters),nt=((it=rt==null?void 0:rt.transactionRequest)==null?void 0:it.format)||formatTransactionRequest;return et.signTransaction?et.signTransaction({..._e,chainId:tt},{serializer:(at=(st=o.chain)==null?void 0:st.serializers)==null?void 0:at.transaction}):await o.request({method:"eth_signTransaction",params:[{...nt({..._e,account:et},"signTransaction"),chainId:numberToHex(tt),from:et.address}]},{retryCount:0})}async function signTypedData(o,_){const{account:$=o.account,domain:j,message:_e,primaryType:et}=_;if(!$)throw new AccountNotFoundError({docsPath:"/docs/actions/wallet/signTypedData"});const tt=parseAccount($),rt={EIP712Domain:getTypesForEIP712Domain({domain:j}),..._.types};if(validateTypedData({domain:j,message:_e,primaryType:et,types:rt}),tt.signTypedData)return tt.signTypedData({domain:j,message:_e,primaryType:et,types:rt});const nt=serializeTypedData({domain:j,message:_e,primaryType:et,types:rt});return o.request({method:"eth_signTypedData_v4",params:[tt.address,nt]},{retryCount:0})}async function switchChain(o,{id:_}){await o.request({method:"wallet_switchEthereumChain",params:[{chainId:numberToHex(_)}]},{retryCount:0})}async function watchAsset(o,_){return await o.request({method:"wallet_watchAsset",params:_},{retryCount:0})}async function writeContractSync(o,_){return writeContract.internal(o,sendTransactionSync,"sendTransactionSync",_)}function walletActions(o){return{addChain:_=>addChain(o,_),deployContract:_=>deployContract(o,_),fillTransaction:_=>fillTransaction(o,_),getAddresses:()=>getAddresses(o),getCallsStatus:_=>getCallsStatus(o,_),getCapabilities:_=>getCapabilities(o,_),getChainId:()=>getChainId(o),getPermissions:()=>getPermissions(o),prepareAuthorization:_=>prepareAuthorization(o,_),prepareTransactionRequest:_=>prepareTransactionRequest(o,_),requestAddresses:()=>requestAddresses(o),requestPermissions:_=>requestPermissions(o,_),sendCalls:_=>sendCalls(o,_),sendCallsSync:_=>sendCallsSync(o,_),sendRawTransaction:_=>sendRawTransaction(o,_),sendRawTransactionSync:_=>sendRawTransactionSync(o,_),sendTransaction:_=>sendTransaction(o,_),sendTransactionSync:_=>sendTransactionSync(o,_),showCallsStatus:_=>showCallsStatus(o,_),signAuthorization:_=>signAuthorization(o,_),signMessage:_=>signMessage$1(o,_),signTransaction:_=>signTransaction(o,_),signTypedData:_=>signTypedData(o,_),switchChain:_=>switchChain(o,_),waitForCallsStatus:_=>waitForCallsStatus(o,_),watchAsset:_=>watchAsset(o,_),writeContract:_=>writeContract(o,_),writeContractSync:_=>writeContractSync(o,_)}}function createWalletClient(o){const{key:_="wallet",name:$="Wallet Client",transport:j}=o;return createClient({...o,key:_,name:$,transport:j,type:"walletClient"}).extend(walletActions)}function createTransport({key:o,methods:_,name:$,request:j,retryCount:_e=3,retryDelay:et=150,timeout:tt,type:rt},nt){const ot=uid();return{config:{key:o,methods:_,name:$,request:j,retryCount:_e,retryDelay:et,timeout:tt,type:rt},request:buildRequest(j,{methods:_,retryCount:_e,retryDelay:et,uid:ot}),value:nt}}function custom(o,_={}){const{key:$="custom",methods:j,name:_e="Custom Provider",retryDelay:et}=_;return({retryCount:tt})=>createTransport({key:$,methods:j,name:_e,request:o.request.bind(o),retryCount:_.retryCount??tt,retryDelay:et,type:"custom"})}class UrlRequiredError extends BaseError$1{constructor(){super("No URL was provided to the Transport. Please provide a valid RPC URL to the Transport.",{docsPath:"/docs/clients/intro",name:"UrlRequiredError"})}}function http(o,_={}){const{batch:$,fetchFn:j,fetchOptions:_e,key:et="http",methods:tt,name:rt="HTTP JSON-RPC",onFetchRequest:nt,onFetchResponse:ot,retryDelay:it,raw:st}=_;return({chain:at,retryCount:lt,timeout:ct})=>{const{batchSize:ft=1e3,wait:dt=0}=typeof $=="object"?$:{},pt=_.retryCount??lt,yt=ct??_.timeout??1e4,vt=o||(at==null?void 0:at.rpcUrls.default.http[0]);if(!vt)throw new UrlRequiredError;const wt=getHttpRpcClient(vt,{fetchFn:j,fetchOptions:_e,onRequest:nt,onResponse:ot,timeout:yt});return createTransport({key:et,methods:tt,name:rt,async request({method:Ct,params:Pt}){const Bt={method:Ct,params:Pt},{schedule:At}=createBatchScheduler({id:vt,wait:dt,shouldSplitBatch(ht){return ht.length>ft},fn:ht=>wt.request({body:ht}),sort:(ht,bt)=>ht.id-bt.id}),kt=async ht=>$?At(ht):[await wt.request({body:ht})],[{error:Ot,result:Tt}]=await kt(Bt);if(st)return{error:Ot,result:Tt};if(Ot)throw new RpcRequestError({body:Bt,error:Ot,url:vt});return Tt},retryCount:pt,retryDelay:it,timeout:yt,type:"http"},{fetchOptions:_e,url:vt})}}function algoName(o){return typeof o=="string"?o:(o==null?void 0:o.name)??""}function toBytes$3(o){if(o instanceof ArrayBuffer)return new Uint8Array(o);const _=o;return new Uint8Array(_.buffer,_.byteOffset,_.byteLength)}(()=>{const o=globalThis;if(!!!(o.crypto&&o.crypto.subtle&&typeof o.crypto.subtle.digest=="function")){const $={async digest(_e,et){if(algoName(_e).toUpperCase()!=="SHA-256")throw new Error("polyfill only supports SHA-256");const rt=toBytes$3(et),nt=sha256$4(rt);return nt.buffer.slice(nt.byteOffset,nt.byteOffset+nt.byteLength)}},j=_e=>{if(o.crypto&&typeof o.crypto.getRandomValues=="function")return o.crypto.getRandomValues(_e);for(let et=0;et<_e.length;et++)_e[et]=Math.floor(Math.random()*256);return _e};o.crypto=o.crypto||{},o.crypto.subtle=$,o.crypto.getRandomValues||(o.crypto.getRandomValues=j)}})();var reactDom={exports:{}},reactDom_production_min={},scheduler={exports:{}},scheduler_production_min={};/** - * @license React - * scheduler.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. - */(function(o){function _(_t,$t){var St=_t.length;_t.push($t);e:for(;0>>1,It=_t[Rt];if(0<_e(It,$t))_t[Rt]=$t,_t[St]=It,St=Rt;else break e}}function $(_t){return _t.length===0?null:_t[0]}function j(_t){if(_t.length===0)return null;var $t=_t[0],St=_t.pop();if(St!==$t){_t[0]=St;e:for(var Rt=0,It=_t.length,Mt=It>>>1;Rt_e(Gt,St))zt_e(jt,Gt)?(_t[Rt]=jt,_t[zt]=St,Rt=zt):(_t[Rt]=Gt,_t[Vt]=St,Rt=Vt);else if(zt_e(jt,St))_t[Rt]=jt,_t[zt]=St,Rt=zt;else break e}}return $t}function _e(_t,$t){var St=_t.sortIndex-$t.sortIndex;return St!==0?St:_t.id-$t.id}if(typeof performance=="object"&&typeof performance.now=="function"){var et=performance;o.unstable_now=function(){return et.now()}}else{var tt=Date,rt=tt.now();o.unstable_now=function(){return tt.now()-rt}}var nt=[],ot=[],it=1,st=null,at=3,lt=!1,ct=!1,ft=!1,dt=typeof setTimeout=="function"?setTimeout:null,pt=typeof clearTimeout=="function"?clearTimeout:null,yt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function vt(_t){for(var $t=$(ot);$t!==null;){if($t.callback===null)j(ot);else if($t.startTime<=_t)j(ot),$t.sortIndex=$t.expirationTime,_(nt,$t);else break;$t=$(ot)}}function wt(_t){if(ft=!1,vt(_t),!ct)if($(nt)!==null)ct=!0,xt(Ct);else{var $t=$(ot);$t!==null&&Et(wt,$t.startTime-_t)}}function Ct(_t,$t){ct=!1,ft&&(ft=!1,pt(At),At=-1),lt=!0;var St=at;try{for(vt($t),st=$(nt);st!==null&&(!(st.expirationTime>$t)||_t&&!Tt());){var Rt=st.callback;if(typeof Rt=="function"){st.callback=null,at=st.priorityLevel;var It=Rt(st.expirationTime<=$t);$t=o.unstable_now(),typeof It=="function"?st.callback=It:st===$(nt)&&j(nt),vt($t)}else j(nt);st=$(nt)}if(st!==null)var Mt=!0;else{var Vt=$(ot);Vt!==null&&Et(wt,Vt.startTime-$t),Mt=!1}return Mt}finally{st=null,at=St,lt=!1}}var Pt=!1,Bt=null,At=-1,kt=5,Ot=-1;function Tt(){return!(o.unstable_now()-Ot_t||125<_t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):kt=0<_t?Math.floor(1e3/_t):5},o.unstable_getCurrentPriorityLevel=function(){return at},o.unstable_getFirstCallbackNode=function(){return $(nt)},o.unstable_next=function(_t){switch(at){case 1:case 2:case 3:var $t=3;break;default:$t=at}var St=at;at=$t;try{return _t()}finally{at=St}},o.unstable_pauseExecution=function(){},o.unstable_requestPaint=function(){},o.unstable_runWithPriority=function(_t,$t){switch(_t){case 1:case 2:case 3:case 4:case 5:break;default:_t=3}var St=at;at=_t;try{return $t()}finally{at=St}},o.unstable_scheduleCallback=function(_t,$t,St){var Rt=o.unstable_now();switch(typeof St=="object"&&St!==null?(St=St.delay,St=typeof St=="number"&&0Rt?(_t.sortIndex=St,_(ot,_t),$(nt)===null&&_t===$(ot)&&(ft?(pt(At),At=-1):ft=!0,Et(wt,St-Rt))):(_t.sortIndex=It,_(nt,_t),ct||lt||(ct=!0,xt(Ct))),_t},o.unstable_shouldYield=Tt,o.unstable_wrapCallback=function(_t){var $t=at;return function(){var St=at;at=$t;try{return _t.apply(this,arguments)}finally{at=St}}}})(scheduler_production_min);scheduler.exports=scheduler_production_min;var schedulerExports=scheduler.exports;/** - * @license React - * react-dom.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 aa=reactExports,ca=schedulerExports;function p$1(o){for(var _="https://reactjs.org/docs/error-decoder.html?invariant="+o,$=1;$"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ja=Object.prototype.hasOwnProperty,ka$1=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,la={},ma={};function oa(o){return ja.call(ma,o)?!0:ja.call(la,o)?!1:ka$1.test(o)?ma[o]=!0:(la[o]=!0,!1)}function pa(o,_,$,j){if($!==null&&$.type===0)return!1;switch(typeof _){case"function":case"symbol":return!0;case"boolean":return j?!1:$!==null?!$.acceptsBooleans:(o=o.toLowerCase().slice(0,5),o!=="data-"&&o!=="aria-");default:return!1}}function qa(o,_,$,j){if(_===null||typeof _>"u"||pa(o,_,$,j))return!0;if(j)return!1;if($!==null)switch($.type){case 3:return!_;case 4:return _===!1;case 5:return isNaN(_);case 6:return isNaN(_)||1>_}return!1}function v$1(o,_,$,j,_e,et,tt){this.acceptsBooleans=_===2||_===3||_===4,this.attributeName=j,this.attributeNamespace=_e,this.mustUseProperty=$,this.propertyName=o,this.type=_,this.sanitizeURL=et,this.removeEmptyString=tt}var z$1={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(o){z$1[o]=new v$1(o,0,!1,o,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(o){var _=o[0];z$1[_]=new v$1(_,1,!1,o[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(o){z$1[o]=new v$1(o,2,!1,o.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(o){z$1[o]=new v$1(o,2,!1,o,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(o){z$1[o]=new v$1(o,3,!1,o.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(o){z$1[o]=new v$1(o,3,!0,o,null,!1,!1)});["capture","download"].forEach(function(o){z$1[o]=new v$1(o,4,!1,o,null,!1,!1)});["cols","rows","size","span"].forEach(function(o){z$1[o]=new v$1(o,6,!1,o,null,!1,!1)});["rowSpan","start"].forEach(function(o){z$1[o]=new v$1(o,5,!1,o.toLowerCase(),null,!1,!1)});var ra=/[\-:]([a-z])/g;function sa(o){return o[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(o){var _=o.replace(ra,sa);z$1[_]=new v$1(_,1,!1,o,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(o){var _=o.replace(ra,sa);z$1[_]=new v$1(_,1,!1,o,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(o){var _=o.replace(ra,sa);z$1[_]=new v$1(_,1,!1,o,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(o){z$1[o]=new v$1(o,1,!1,o.toLowerCase(),null,!1,!1)});z$1.xlinkHref=new v$1("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(o){z$1[o]=new v$1(o,1,!1,o.toLowerCase(),null,!0,!0)});function ta(o,_,$,j){var _e=z$1.hasOwnProperty(_)?z$1[_]:null;(_e!==null?_e.type!==0:j||!(2<_.length)||_[0]!=="o"&&_[0]!=="O"||_[1]!=="n"&&_[1]!=="N")&&(qa(_,$,_e,j)&&($=null),j||_e===null?oa(_)&&($===null?o.removeAttribute(_):o.setAttribute(_,""+$)):_e.mustUseProperty?o[_e.propertyName]=$===null?_e.type===3?!1:"":$:(_=_e.attributeName,j=_e.attributeNamespace,$===null?o.removeAttribute(_):(_e=_e.type,$=_e===3||_e===4&&$===!0?"":""+$,j?o.setAttributeNS(j,_,$):o.setAttribute(_,$))))}var ua=aa.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,va=Symbol.for("react.element"),wa=Symbol.for("react.portal"),ya=Symbol.for("react.fragment"),za=Symbol.for("react.strict_mode"),Aa=Symbol.for("react.profiler"),Ba=Symbol.for("react.provider"),Ca=Symbol.for("react.context"),Da=Symbol.for("react.forward_ref"),Ea=Symbol.for("react.suspense"),Fa=Symbol.for("react.suspense_list"),Ga=Symbol.for("react.memo"),Ha=Symbol.for("react.lazy"),Ia=Symbol.for("react.offscreen"),Ja=Symbol.iterator;function Ka(o){return o===null||typeof o!="object"?null:(o=Ja&&o[Ja]||o["@@iterator"],typeof o=="function"?o:null)}var A$1=Object.assign,La;function Ma(o){if(La===void 0)try{throw Error()}catch($){var _=$.stack.trim().match(/\n( *(at )?)/);La=_&&_[1]||""}return` -`+La+o}var Na=!1;function Oa(o,_){if(!o||Na)return"";Na=!0;var $=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(_)if(_=function(){throw Error()},Object.defineProperty(_.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(_,[])}catch(ot){var j=ot}Reflect.construct(o,[],_)}else{try{_.call()}catch(ot){j=ot}o.call(_.prototype)}else{try{throw Error()}catch(ot){j=ot}o()}}catch(ot){if(ot&&j&&typeof ot.stack=="string"){for(var _e=ot.stack.split(` -`),et=j.stack.split(` -`),tt=_e.length-1,rt=et.length-1;1<=tt&&0<=rt&&_e[tt]!==et[rt];)rt--;for(;1<=tt&&0<=rt;tt--,rt--)if(_e[tt]!==et[rt]){if(tt!==1||rt!==1)do if(tt--,rt--,0>rt||_e[tt]!==et[rt]){var nt=` -`+_e[tt].replace(" at new "," at ");return o.displayName&&nt.includes("")&&(nt=nt.replace("",o.displayName)),nt}while(1<=tt&&0<=rt);break}}}finally{Na=!1,Error.prepareStackTrace=$}return(o=o?o.displayName||o.name:"")?Ma(o):""}function Pa(o){switch(o.tag){case 5:return Ma(o.type);case 16:return Ma("Lazy");case 13:return Ma("Suspense");case 19:return Ma("SuspenseList");case 0:case 2:case 15:return o=Oa(o.type,!1),o;case 11:return o=Oa(o.type.render,!1),o;case 1:return o=Oa(o.type,!0),o;default:return""}}function Qa(o){if(o==null)return null;if(typeof o=="function")return o.displayName||o.name||null;if(typeof o=="string")return o;switch(o){case ya:return"Fragment";case wa:return"Portal";case Aa:return"Profiler";case za:return"StrictMode";case Ea:return"Suspense";case Fa:return"SuspenseList"}if(typeof o=="object")switch(o.$$typeof){case Ca:return(o.displayName||"Context")+".Consumer";case Ba:return(o._context.displayName||"Context")+".Provider";case Da:var _=o.render;return o=o.displayName,o||(o=_.displayName||_.name||"",o=o!==""?"ForwardRef("+o+")":"ForwardRef"),o;case Ga:return _=o.displayName||null,_!==null?_:Qa(o.type)||"Memo";case Ha:_=o._payload,o=o._init;try{return Qa(o(_))}catch{}}return null}function Ra(o){var _=o.type;switch(o.tag){case 24:return"Cache";case 9:return(_.displayName||"Context")+".Consumer";case 10:return(_._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return o=_.render,o=o.displayName||o.name||"",_.displayName||(o!==""?"ForwardRef("+o+")":"ForwardRef");case 7:return"Fragment";case 5:return _;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Qa(_);case 8:return _===za?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof _=="function")return _.displayName||_.name||null;if(typeof _=="string")return _}return null}function Sa(o){switch(typeof o){case"boolean":case"number":case"string":case"undefined":return o;case"object":return o;default:return""}}function Ta(o){var _=o.type;return(o=o.nodeName)&&o.toLowerCase()==="input"&&(_==="checkbox"||_==="radio")}function Ua(o){var _=Ta(o)?"checked":"value",$=Object.getOwnPropertyDescriptor(o.constructor.prototype,_),j=""+o[_];if(!o.hasOwnProperty(_)&&typeof $<"u"&&typeof $.get=="function"&&typeof $.set=="function"){var _e=$.get,et=$.set;return Object.defineProperty(o,_,{configurable:!0,get:function(){return _e.call(this)},set:function(tt){j=""+tt,et.call(this,tt)}}),Object.defineProperty(o,_,{enumerable:$.enumerable}),{getValue:function(){return j},setValue:function(tt){j=""+tt},stopTracking:function(){o._valueTracker=null,delete o[_]}}}}function Va(o){o._valueTracker||(o._valueTracker=Ua(o))}function Wa(o){if(!o)return!1;var _=o._valueTracker;if(!_)return!0;var $=_.getValue(),j="";return o&&(j=Ta(o)?o.checked?"true":"false":o.value),o=j,o!==$?(_.setValue(o),!0):!1}function Xa(o){if(o=o||(typeof document<"u"?document:void 0),typeof o>"u")return null;try{return o.activeElement||o.body}catch{return o.body}}function Ya(o,_){var $=_.checked;return A$1({},_,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:$??o._wrapperState.initialChecked})}function Za(o,_){var $=_.defaultValue==null?"":_.defaultValue,j=_.checked!=null?_.checked:_.defaultChecked;$=Sa(_.value!=null?_.value:$),o._wrapperState={initialChecked:j,initialValue:$,controlled:_.type==="checkbox"||_.type==="radio"?_.checked!=null:_.value!=null}}function ab(o,_){_=_.checked,_!=null&&ta(o,"checked",_,!1)}function bb(o,_){ab(o,_);var $=Sa(_.value),j=_.type;if($!=null)j==="number"?($===0&&o.value===""||o.value!=$)&&(o.value=""+$):o.value!==""+$&&(o.value=""+$);else if(j==="submit"||j==="reset"){o.removeAttribute("value");return}_.hasOwnProperty("value")?cb(o,_.type,$):_.hasOwnProperty("defaultValue")&&cb(o,_.type,Sa(_.defaultValue)),_.checked==null&&_.defaultChecked!=null&&(o.defaultChecked=!!_.defaultChecked)}function db(o,_,$){if(_.hasOwnProperty("value")||_.hasOwnProperty("defaultValue")){var j=_.type;if(!(j!=="submit"&&j!=="reset"||_.value!==void 0&&_.value!==null))return;_=""+o._wrapperState.initialValue,$||_===o.value||(o.value=_),o.defaultValue=_}$=o.name,$!==""&&(o.name=""),o.defaultChecked=!!o._wrapperState.initialChecked,$!==""&&(o.name=$)}function cb(o,_,$){(_!=="number"||Xa(o.ownerDocument)!==o)&&($==null?o.defaultValue=""+o._wrapperState.initialValue:o.defaultValue!==""+$&&(o.defaultValue=""+$))}var eb=Array.isArray;function fb(o,_,$,j){if(o=o.options,_){_={};for(var _e=0;_e<$.length;_e++)_["$"+$[_e]]=!0;for($=0;$"+_.valueOf().toString()+"",_=mb.firstChild;o.firstChild;)o.removeChild(o.firstChild);for(;_.firstChild;)o.appendChild(_.firstChild)}});function ob(o,_){if(_){var $=o.firstChild;if($&&$===o.lastChild&&$.nodeType===3){$.nodeValue=_;return}}o.textContent=_}var pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=["Webkit","ms","Moz","O"];Object.keys(pb).forEach(function(o){qb.forEach(function(_){_=_+o.charAt(0).toUpperCase()+o.substring(1),pb[_]=pb[o]})});function rb(o,_,$){return _==null||typeof _=="boolean"||_===""?"":$||typeof _!="number"||_===0||pb.hasOwnProperty(o)&&pb[o]?(""+_).trim():_+"px"}function sb(o,_){o=o.style;for(var $ in _)if(_.hasOwnProperty($)){var j=$.indexOf("--")===0,_e=rb($,_[$],j);$==="float"&&($="cssFloat"),j?o.setProperty($,_e):o[$]=_e}}var tb=A$1({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function ub(o,_){if(_){if(tb[o]&&(_.children!=null||_.dangerouslySetInnerHTML!=null))throw Error(p$1(137,o));if(_.dangerouslySetInnerHTML!=null){if(_.children!=null)throw Error(p$1(60));if(typeof _.dangerouslySetInnerHTML!="object"||!("__html"in _.dangerouslySetInnerHTML))throw Error(p$1(61))}if(_.style!=null&&typeof _.style!="object")throw Error(p$1(62))}}function vb(o,_){if(o.indexOf("-")===-1)return typeof _.is=="string";switch(o){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 wb=null;function xb(o){return o=o.target||o.srcElement||window,o.correspondingUseElement&&(o=o.correspondingUseElement),o.nodeType===3?o.parentNode:o}var yb=null,zb=null,Ab=null;function Bb(o){if(o=Cb(o)){if(typeof yb!="function")throw Error(p$1(280));var _=o.stateNode;_&&(_=Db(_),yb(o.stateNode,o.type,_))}}function Eb(o){zb?Ab?Ab.push(o):Ab=[o]:zb=o}function Fb(){if(zb){var o=zb,_=Ab;if(Ab=zb=null,Bb(o),_)for(o=0;o<_.length;o++)Bb(_[o])}}function Gb(o,_){return o(_)}function Hb(){}var Ib=!1;function Jb(o,_,$){if(Ib)return o(_,$);Ib=!0;try{return Gb(o,_,$)}finally{Ib=!1,(zb!==null||Ab!==null)&&(Hb(),Fb())}}function Kb(o,_){var $=o.stateNode;if($===null)return null;var j=Db($);if(j===null)return null;$=j[_];e:switch(_){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(j=!j.disabled)||(o=o.type,j=!(o==="button"||o==="input"||o==="select"||o==="textarea")),o=!j;break e;default:o=!1}if(o)return null;if($&&typeof $!="function")throw Error(p$1(231,_,typeof $));return $}var Lb=!1;if(ia)try{var Mb={};Object.defineProperty(Mb,"passive",{get:function(){Lb=!0}}),window.addEventListener("test",Mb,Mb),window.removeEventListener("test",Mb,Mb)}catch{Lb=!1}function Nb(o,_,$,j,_e,et,tt,rt,nt){var ot=Array.prototype.slice.call(arguments,3);try{_.apply($,ot)}catch(it){this.onError(it)}}var Ob=!1,Pb=null,Qb=!1,Rb=null,Sb={onError:function(o){Ob=!0,Pb=o}};function Tb(o,_,$,j,_e,et,tt,rt,nt){Ob=!1,Pb=null,Nb.apply(Sb,arguments)}function Ub(o,_,$,j,_e,et,tt,rt,nt){if(Tb.apply(this,arguments),Ob){if(Ob){var ot=Pb;Ob=!1,Pb=null}else throw Error(p$1(198));Qb||(Qb=!0,Rb=ot)}}function Vb(o){var _=o,$=o;if(o.alternate)for(;_.return;)_=_.return;else{o=_;do _=o,_.flags&4098&&($=_.return),o=_.return;while(o)}return _.tag===3?$:null}function Wb(o){if(o.tag===13){var _=o.memoizedState;if(_===null&&(o=o.alternate,o!==null&&(_=o.memoizedState)),_!==null)return _.dehydrated}return null}function Xb(o){if(Vb(o)!==o)throw Error(p$1(188))}function Yb(o){var _=o.alternate;if(!_){if(_=Vb(o),_===null)throw Error(p$1(188));return _!==o?null:o}for(var $=o,j=_;;){var _e=$.return;if(_e===null)break;var et=_e.alternate;if(et===null){if(j=_e.return,j!==null){$=j;continue}break}if(_e.child===et.child){for(et=_e.child;et;){if(et===$)return Xb(_e),o;if(et===j)return Xb(_e),_;et=et.sibling}throw Error(p$1(188))}if($.return!==j.return)$=_e,j=et;else{for(var tt=!1,rt=_e.child;rt;){if(rt===$){tt=!0,$=_e,j=et;break}if(rt===j){tt=!0,j=_e,$=et;break}rt=rt.sibling}if(!tt){for(rt=et.child;rt;){if(rt===$){tt=!0,$=et,j=_e;break}if(rt===j){tt=!0,j=et,$=_e;break}rt=rt.sibling}if(!tt)throw Error(p$1(189))}}if($.alternate!==j)throw Error(p$1(190))}if($.tag!==3)throw Error(p$1(188));return $.stateNode.current===$?o:_}function Zb(o){return o=Yb(o),o!==null?$b(o):null}function $b(o){if(o.tag===5||o.tag===6)return o;for(o=o.child;o!==null;){var _=$b(o);if(_!==null)return _;o=o.sibling}return null}var ac=ca.unstable_scheduleCallback,bc=ca.unstable_cancelCallback,cc=ca.unstable_shouldYield,dc=ca.unstable_requestPaint,B=ca.unstable_now,ec$3=ca.unstable_getCurrentPriorityLevel,fc=ca.unstable_ImmediatePriority,gc=ca.unstable_UserBlockingPriority,hc=ca.unstable_NormalPriority,ic=ca.unstable_LowPriority,jc=ca.unstable_IdlePriority,kc=null,lc=null;function mc(o){if(lc&&typeof lc.onCommitFiberRoot=="function")try{lc.onCommitFiberRoot(kc,o,void 0,(o.current.flags&128)===128)}catch{}}var oc=Math.clz32?Math.clz32:nc,pc=Math.log,qc=Math.LN2;function nc(o){return o>>>=0,o===0?32:31-(pc(o)/qc|0)|0}var rc=64,sc=4194304;function tc(o){switch(o&-o){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: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 o&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return o&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return o}}function uc(o,_){var $=o.pendingLanes;if($===0)return 0;var j=0,_e=o.suspendedLanes,et=o.pingedLanes,tt=$&268435455;if(tt!==0){var rt=tt&~_e;rt!==0?j=tc(rt):(et&=tt,et!==0&&(j=tc(et)))}else tt=$&~_e,tt!==0?j=tc(tt):et!==0&&(j=tc(et));if(j===0)return 0;if(_!==0&&_!==j&&!(_&_e)&&(_e=j&-j,et=_&-_,_e>=et||_e===16&&(et&4194240)!==0))return _;if(j&4&&(j|=$&16),_=o.entangledLanes,_!==0)for(o=o.entanglements,_&=j;0<_;)$=31-oc(_),_e=1<<$,j|=o[$],_&=~_e;return j}function vc(o,_){switch(o){case 1:case 2:case 4:return _+250;case 8:case 16:case 32:case 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 _+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wc(o,_){for(var $=o.suspendedLanes,j=o.pingedLanes,_e=o.expirationTimes,et=o.pendingLanes;0$;$++)_.push(o);return _}function Ac(o,_,$){o.pendingLanes|=_,_!==536870912&&(o.suspendedLanes=0,o.pingedLanes=0),o=o.eventTimes,_=31-oc(_),o[_]=$}function Bc(o,_){var $=o.pendingLanes&~_;o.pendingLanes=_,o.suspendedLanes=0,o.pingedLanes=0,o.expiredLanes&=_,o.mutableReadLanes&=_,o.entangledLanes&=_,_=o.entanglements;var j=o.eventTimes;for(o=o.expirationTimes;0<$;){var _e=31-oc($),et=1<<_e;_[_e]=0,j[_e]=-1,o[_e]=-1,$&=~et}}function Cc(o,_){var $=o.entangledLanes|=_;for(o=o.entanglements;$;){var j=31-oc($),_e=1<=be),ee=" ",fe=!1;function ge(o,_){switch(o){case"keyup":return $d.indexOf(_.keyCode)!==-1;case"keydown":return _.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function he(o){return o=o.detail,typeof o=="object"&&"data"in o?o.data:null}var ie=!1;function je(o,_){switch(o){case"compositionend":return he(_);case"keypress":return _.which!==32?null:(fe=!0,ee);case"textInput":return o=_.data,o===ee&&fe?null:o;default:return null}}function ke(o,_){if(ie)return o==="compositionend"||!ae&&ge(o,_)?(o=nd(),md=ld=kd=null,ie=!1,o):null;switch(o){case"paste":return null;case"keypress":if(!(_.ctrlKey||_.altKey||_.metaKey)||_.ctrlKey&&_.altKey){if(_.char&&1<_.char.length)return _.char;if(_.which)return String.fromCharCode(_.which)}return null;case"compositionend":return de&&_.locale!=="ko"?null:_.data;default:return null}}var le={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 me(o){var _=o&&o.nodeName&&o.nodeName.toLowerCase();return _==="input"?!!le[o.type]:_==="textarea"}function ne(o,_,$,j){Eb(j),_=oe(_,"onChange"),0<_.length&&($=new td("onChange","change",null,$,j),o.push({event:$,listeners:_}))}var pe=null,qe=null;function re$2(o){se(o,0)}function te(o){var _=ue(o);if(Wa(_))return o}function ve(o,_){if(o==="change")return _}var we=!1;if(ia){var xe;if(ia){var ye="oninput"in document;if(!ye){var ze=document.createElement("div");ze.setAttribute("oninput","return;"),ye=typeof ze.oninput=="function"}xe=ye}else xe=!1;we=xe&&(!document.documentMode||9=_)return{node:$,offset:_-o};o=j}e:{for(;$;){if($.nextSibling){$=$.nextSibling;break e}$=$.parentNode}$=void 0}$=Je($)}}function Le(o,_){return o&&_?o===_?!0:o&&o.nodeType===3?!1:_&&_.nodeType===3?Le(o,_.parentNode):"contains"in o?o.contains(_):o.compareDocumentPosition?!!(o.compareDocumentPosition(_)&16):!1:!1}function Me(){for(var o=window,_=Xa();_ instanceof o.HTMLIFrameElement;){try{var $=typeof _.contentWindow.location.href=="string"}catch{$=!1}if($)o=_.contentWindow;else break;_=Xa(o.document)}return _}function Ne(o){var _=o&&o.nodeName&&o.nodeName.toLowerCase();return _&&(_==="input"&&(o.type==="text"||o.type==="search"||o.type==="tel"||o.type==="url"||o.type==="password")||_==="textarea"||o.contentEditable==="true")}function Oe(o){var _=Me(),$=o.focusedElem,j=o.selectionRange;if(_!==$&&$&&$.ownerDocument&&Le($.ownerDocument.documentElement,$)){if(j!==null&&Ne($)){if(_=j.start,o=j.end,o===void 0&&(o=_),"selectionStart"in $)$.selectionStart=_,$.selectionEnd=Math.min(o,$.value.length);else if(o=(_=$.ownerDocument||document)&&_.defaultView||window,o.getSelection){o=o.getSelection();var _e=$.textContent.length,et=Math.min(j.start,_e);j=j.end===void 0?et:Math.min(j.end,_e),!o.extend&&et>j&&(_e=j,j=et,et=_e),_e=Ke($,et);var tt=Ke($,j);_e&&tt&&(o.rangeCount!==1||o.anchorNode!==_e.node||o.anchorOffset!==_e.offset||o.focusNode!==tt.node||o.focusOffset!==tt.offset)&&(_=_.createRange(),_.setStart(_e.node,_e.offset),o.removeAllRanges(),et>j?(o.addRange(_),o.extend(tt.node,tt.offset)):(_.setEnd(tt.node,tt.offset),o.addRange(_)))}}for(_=[],o=$;o=o.parentNode;)o.nodeType===1&&_.push({element:o,left:o.scrollLeft,top:o.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<_.length;$++)o=_[$],o.element.scrollLeft=o.left,o.element.scrollTop=o.top}}var Pe=ia&&"documentMode"in document&&11>=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;function Ue(o,_,$){var j=$.window===$?$.document:$.nodeType===9?$:$.ownerDocument;Te||Qe==null||Qe!==Xa(j)||(j=Qe,"selectionStart"in j&&Ne(j)?j={start:j.selectionStart,end:j.selectionEnd}:(j=(j.ownerDocument&&j.ownerDocument.defaultView||window).getSelection(),j={anchorNode:j.anchorNode,anchorOffset:j.anchorOffset,focusNode:j.focusNode,focusOffset:j.focusOffset}),Se&&Ie(Se,j)||(Se=j,j=oe(Re,"onSelect"),0Tf||(o.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(o,_){Tf++,Sf[Tf]=o.current,o.current=_}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(o,_){var $=o.type.contextTypes;if(!$)return Vf;var j=o.stateNode;if(j&&j.__reactInternalMemoizedUnmaskedChildContext===_)return j.__reactInternalMemoizedMaskedChildContext;var _e={},et;for(et in $)_e[et]=_[et];return j&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=_,o.__reactInternalMemoizedMaskedChildContext=_e),_e}function Zf(o){return o=o.childContextTypes,o!=null}function $f(){E$1(Wf),E$1(H)}function ag(o,_,$){if(H.current!==Vf)throw Error(p$1(168));G(H,_),G(Wf,$)}function bg(o,_,$){var j=o.stateNode;if(_=_.childContextTypes,typeof j.getChildContext!="function")return $;j=j.getChildContext();for(var _e in j)if(!(_e in _))throw Error(p$1(108,Ra(o)||"Unknown",_e));return A$1({},$,j)}function cg(o){return o=(o=o.stateNode)&&o.__reactInternalMemoizedMergedChildContext||Vf,Xf=H.current,G(H,o),G(Wf,Wf.current),!0}function dg(o,_,$){var j=o.stateNode;if(!j)throw Error(p$1(169));$?(o=bg(o,_,Xf),j.__reactInternalMemoizedMergedChildContext=o,E$1(Wf),E$1(H),G(H,o)):E$1(Wf),G(Wf,$)}var eg=null,fg=!1,gg=!1;function hg(o){eg===null?eg=[o]:eg.push(o)}function ig(o){fg=!0,hg(o)}function jg(){if(!gg&&eg!==null){gg=!0;var o=0,_=C;try{var $=eg;for(C=1;o<$.length;o++){var j=$[o];do j=j(!0);while(j!==null)}eg=null,fg=!1}catch(_e){throw eg!==null&&(eg=eg.slice(o+1)),ac(fc,jg),_e}finally{C=_,gg=!1}}return null}var kg=[],lg=0,mg=null,ng=0,og=[],pg=0,qg=null,rg=1,sg="";function tg(o,_){kg[lg++]=ng,kg[lg++]=mg,mg=o,ng=_}function ug(o,_,$){og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,qg=o;var j=rg;o=sg;var _e=32-oc(j)-1;j&=~(1<<_e),$+=1;var et=32-oc(_)+_e;if(30>=tt,_e-=tt,rg=1<<32-oc(_)+_e|$<<_e|j,sg=et+o}else rg=1<At?(kt=Bt,Bt=null):kt=Bt.sibling;var Ot=at(pt,Bt,vt[At],wt);if(Ot===null){Bt===null&&(Bt=kt);break}o&&Bt&&Ot.alternate===null&&_(pt,Bt),yt=et(Ot,yt,At),Pt===null?Ct=Ot:Pt.sibling=Ot,Pt=Ot,Bt=kt}if(At===vt.length)return $(pt,Bt),I&&tg(pt,At),Ct;if(Bt===null){for(;AtAt?(kt=Bt,Bt=null):kt=Bt.sibling;var Tt=at(pt,Bt,Ot.value,wt);if(Tt===null){Bt===null&&(Bt=kt);break}o&&Bt&&Tt.alternate===null&&_(pt,Bt),yt=et(Tt,yt,At),Pt===null?Ct=Tt:Pt.sibling=Tt,Pt=Tt,Bt=kt}if(Ot.done)return $(pt,Bt),I&&tg(pt,At),Ct;if(Bt===null){for(;!Ot.done;At++,Ot=vt.next())Ot=st(pt,Ot.value,wt),Ot!==null&&(yt=et(Ot,yt,At),Pt===null?Ct=Ot:Pt.sibling=Ot,Pt=Ot);return I&&tg(pt,At),Ct}for(Bt=j(pt,Bt);!Ot.done;At++,Ot=vt.next())Ot=lt(Bt,pt,At,Ot.value,wt),Ot!==null&&(o&&Ot.alternate!==null&&Bt.delete(Ot.key===null?At:Ot.key),yt=et(Ot,yt,At),Pt===null?Ct=Ot:Pt.sibling=Ot,Pt=Ot);return o&&Bt.forEach(function(ht){return _(pt,ht)}),I&&tg(pt,At),Ct}function dt(pt,yt,vt,wt){if(typeof vt=="object"&&vt!==null&&vt.type===ya&&vt.key===null&&(vt=vt.props.children),typeof vt=="object"&&vt!==null){switch(vt.$$typeof){case va:e:{for(var Ct=vt.key,Pt=yt;Pt!==null;){if(Pt.key===Ct){if(Ct=vt.type,Ct===ya){if(Pt.tag===7){$(pt,Pt.sibling),yt=_e(Pt,vt.props.children),yt.return=pt,pt=yt;break e}}else if(Pt.elementType===Ct||typeof Ct=="object"&&Ct!==null&&Ct.$$typeof===Ha&&Ng(Ct)===Pt.type){$(pt,Pt.sibling),yt=_e(Pt,vt.props),yt.ref=Lg(pt,Pt,vt),yt.return=pt,pt=yt;break e}$(pt,Pt);break}else _(pt,Pt);Pt=Pt.sibling}vt.type===ya?(yt=Tg(vt.props.children,pt.mode,wt,vt.key),yt.return=pt,pt=yt):(wt=Rg(vt.type,vt.key,vt.props,null,pt.mode,wt),wt.ref=Lg(pt,yt,vt),wt.return=pt,pt=wt)}return tt(pt);case wa:e:{for(Pt=vt.key;yt!==null;){if(yt.key===Pt)if(yt.tag===4&&yt.stateNode.containerInfo===vt.containerInfo&&yt.stateNode.implementation===vt.implementation){$(pt,yt.sibling),yt=_e(yt,vt.children||[]),yt.return=pt,pt=yt;break e}else{$(pt,yt);break}else _(pt,yt);yt=yt.sibling}yt=Sg(vt,pt.mode,wt),yt.return=pt,pt=yt}return tt(pt);case Ha:return Pt=vt._init,dt(pt,yt,Pt(vt._payload),wt)}if(eb(vt))return ct(pt,yt,vt,wt);if(Ka(vt))return ft(pt,yt,vt,wt);Mg(pt,vt)}return typeof vt=="string"&&vt!==""||typeof vt=="number"?(vt=""+vt,yt!==null&&yt.tag===6?($(pt,yt.sibling),yt=_e(yt,vt),yt.return=pt,pt=yt):($(pt,yt),yt=Qg(vt,pt.mode,wt),yt.return=pt,pt=yt),tt(pt)):$(pt,yt)}return dt}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(o){var _=Wg.current;E$1(Wg),o._currentValue=_}function bh(o,_,$){for(;o!==null;){var j=o.alternate;if((o.childLanes&_)!==_?(o.childLanes|=_,j!==null&&(j.childLanes|=_)):j!==null&&(j.childLanes&_)!==_&&(j.childLanes|=_),o===$)break;o=o.return}}function ch(o,_){Xg=o,Zg=Yg=null,o=o.dependencies,o!==null&&o.firstContext!==null&&(o.lanes&_&&(dh$1=!0),o.firstContext=null)}function eh(o){var _=o._currentValue;if(Zg!==o)if(o={context:o,memoizedValue:_,next:null},Yg===null){if(Xg===null)throw Error(p$1(308));Yg=o,Xg.dependencies={lanes:0,firstContext:o}}else Yg=Yg.next=o;return _}var fh=null;function gh(o){fh===null?fh=[o]:fh.push(o)}function hh(o,_,$,j){var _e=_.interleaved;return _e===null?($.next=$,gh(_)):($.next=_e.next,_e.next=$),_.interleaved=$,ih(o,j)}function ih(o,_){o.lanes|=_;var $=o.alternate;for($!==null&&($.lanes|=_),$=o,o=o.return;o!==null;)o.childLanes|=_,$=o.alternate,$!==null&&($.childLanes|=_),$=o,o=o.return;return $.tag===3?$.stateNode:null}var jh=!1;function kh(o){o.updateQueue={baseState:o.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lh(o,_){o=o.updateQueue,_.updateQueue===o&&(_.updateQueue={baseState:o.baseState,firstBaseUpdate:o.firstBaseUpdate,lastBaseUpdate:o.lastBaseUpdate,shared:o.shared,effects:o.effects})}function mh(o,_){return{eventTime:o,lane:_,tag:0,payload:null,callback:null,next:null}}function nh(o,_,$){var j=o.updateQueue;if(j===null)return null;if(j=j.shared,K$1&2){var _e=j.pending;return _e===null?_.next=_:(_.next=_e.next,_e.next=_),j.pending=_,ih(o,$)}return _e=j.interleaved,_e===null?(_.next=_,gh(j)):(_.next=_e.next,_e.next=_),j.interleaved=_,ih(o,$)}function oh(o,_,$){if(_=_.updateQueue,_!==null&&(_=_.shared,($&4194240)!==0)){var j=_.lanes;j&=o.pendingLanes,$|=j,_.lanes=$,Cc(o,$)}}function ph(o,_){var $=o.updateQueue,j=o.alternate;if(j!==null&&(j=j.updateQueue,$===j)){var _e=null,et=null;if($=$.firstBaseUpdate,$!==null){do{var tt={eventTime:$.eventTime,lane:$.lane,tag:$.tag,payload:$.payload,callback:$.callback,next:null};et===null?_e=et=tt:et=et.next=tt,$=$.next}while($!==null);et===null?_e=et=_:et=et.next=_}else _e=et=_;$={baseState:j.baseState,firstBaseUpdate:_e,lastBaseUpdate:et,shared:j.shared,effects:j.effects},o.updateQueue=$;return}o=$.lastBaseUpdate,o===null?$.firstBaseUpdate=_:o.next=_,$.lastBaseUpdate=_}function qh(o,_,$,j){var _e=o.updateQueue;jh=!1;var et=_e.firstBaseUpdate,tt=_e.lastBaseUpdate,rt=_e.shared.pending;if(rt!==null){_e.shared.pending=null;var nt=rt,ot=nt.next;nt.next=null,tt===null?et=ot:tt.next=ot,tt=nt;var it=o.alternate;it!==null&&(it=it.updateQueue,rt=it.lastBaseUpdate,rt!==tt&&(rt===null?it.firstBaseUpdate=ot:rt.next=ot,it.lastBaseUpdate=nt))}if(et!==null){var st=_e.baseState;tt=0,it=ot=nt=null,rt=et;do{var at=rt.lane,lt=rt.eventTime;if((j&at)===at){it!==null&&(it=it.next={eventTime:lt,lane:0,tag:rt.tag,payload:rt.payload,callback:rt.callback,next:null});e:{var ct=o,ft=rt;switch(at=_,lt=$,ft.tag){case 1:if(ct=ft.payload,typeof ct=="function"){st=ct.call(lt,st,at);break e}st=ct;break e;case 3:ct.flags=ct.flags&-65537|128;case 0:if(ct=ft.payload,at=typeof ct=="function"?ct.call(lt,st,at):ct,at==null)break e;st=A$1({},st,at);break e;case 2:jh=!0}}rt.callback!==null&&rt.lane!==0&&(o.flags|=64,at=_e.effects,at===null?_e.effects=[rt]:at.push(rt))}else lt={eventTime:lt,lane:at,tag:rt.tag,payload:rt.payload,callback:rt.callback,next:null},it===null?(ot=it=lt,nt=st):it=it.next=lt,tt|=at;if(rt=rt.next,rt===null){if(rt=_e.shared.pending,rt===null)break;at=rt,rt=at.next,at.next=null,_e.lastBaseUpdate=at,_e.shared.pending=null}}while(!0);if(it===null&&(nt=st),_e.baseState=nt,_e.firstBaseUpdate=ot,_e.lastBaseUpdate=it,_=_e.shared.interleaved,_!==null){_e=_;do tt|=_e.lane,_e=_e.next;while(_e!==_)}else et===null&&(_e.shared.lanes=0);rh$1|=tt,o.lanes=tt,o.memoizedState=st}}function sh$1(o,_,$){if(o=_.effects,_.effects=null,o!==null)for(_=0;_$?$:4,o(!0);var j=Gh.transition;Gh.transition={};try{o(!1),_()}finally{C=$,Gh.transition=j}}function wi(){return Uh().memoizedState}function xi(o,_,$){var j=yi(o);if($={lane:j,action:$,hasEagerState:!1,eagerState:null,next:null},zi(o))Ai(_,$);else if($=hh(o,_,$,j),$!==null){var _e=R$1();gi($,o,j,_e),Bi($,_,j)}}function ii(o,_,$){var j=yi(o),_e={lane:j,action:$,hasEagerState:!1,eagerState:null,next:null};if(zi(o))Ai(_,_e);else{var et=o.alternate;if(o.lanes===0&&(et===null||et.lanes===0)&&(et=_.lastRenderedReducer,et!==null))try{var tt=_.lastRenderedState,rt=et(tt,$);if(_e.hasEagerState=!0,_e.eagerState=rt,He(rt,tt)){var nt=_.interleaved;nt===null?(_e.next=_e,gh(_)):(_e.next=nt.next,nt.next=_e),_.interleaved=_e;return}}catch{}finally{}$=hh(o,_,_e,j),$!==null&&(_e=R$1(),gi($,o,j,_e),Bi($,_,j))}}function zi(o){var _=o.alternate;return o===M||_!==null&&_===M}function Ai(o,_){Jh=Ih=!0;var $=o.pending;$===null?_.next=_:(_.next=$.next,$.next=_),o.pending=_}function Bi(o,_,$){if($&4194240){var j=_.lanes;j&=o.pendingLanes,$|=j,_.lanes=$,Cc(o,$)}}var Rh={readContext:eh,useCallback:P$1,useContext:P$1,useEffect:P$1,useImperativeHandle:P$1,useInsertionEffect:P$1,useLayoutEffect:P$1,useMemo:P$1,useReducer:P$1,useRef:P$1,useState:P$1,useDebugValue:P$1,useDeferredValue:P$1,useTransition:P$1,useMutableSource:P$1,useSyncExternalStore:P$1,useId:P$1,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(o,_){return Th().memoizedState=[o,_===void 0?null:_],o},useContext:eh,useEffect:mi,useImperativeHandle:function(o,_,$){return $=$!=null?$.concat([o]):null,ki(4194308,4,pi$2.bind(null,_,o),$)},useLayoutEffect:function(o,_){return ki(4194308,4,o,_)},useInsertionEffect:function(o,_){return ki(4,2,o,_)},useMemo:function(o,_){var $=Th();return _=_===void 0?null:_,o=o(),$.memoizedState=[o,_],o},useReducer:function(o,_,$){var j=Th();return _=$!==void 0?$(_):_,j.memoizedState=j.baseState=_,o={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:o,lastRenderedState:_},j.queue=o,o=o.dispatch=xi.bind(null,M,o),[j.memoizedState,o]},useRef:function(o){var _=Th();return o={current:o},_.memoizedState=o},useState:hi,useDebugValue:ri,useDeferredValue:function(o){return Th().memoizedState=o},useTransition:function(){var o=hi(!1),_=o[0];return o=vi.bind(null,o[1]),Th().memoizedState=o,[_,o]},useMutableSource:function(){},useSyncExternalStore:function(o,_,$){var j=M,_e=Th();if(I){if($===void 0)throw Error(p$1(407));$=$()}else{if($=_(),Q===null)throw Error(p$1(349));Hh&30||di(j,_,$)}_e.memoizedState=$;var et={value:$,getSnapshot:_};return _e.queue=et,mi(ai.bind(null,j,et,o),[o]),j.flags|=2048,bi(9,ci.bind(null,j,et,$,_),void 0,null),$},useId:function(){var o=Th(),_=Q.identifierPrefix;if(I){var $=sg,j=rg;$=(j&~(1<<32-oc(j)-1)).toString(32)+$,_=":"+_+"R"+$,$=Kh$1++,0<$&&(_+="H"+$.toString(32)),_+=":"}else $=Lh++,_=":"+_+"r"+$.toString(32)+":";return o.memoizedState=_},unstable_isNewReconciler:!1},Ph={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Wh,useRef:ji,useState:function(){return Wh(Vh)},useDebugValue:ri,useDeferredValue:function(o){var _=Uh();return ui(_,N.memoizedState,o)},useTransition:function(){var o=Wh(Vh)[0],_=Uh().memoizedState;return[o,_]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1},Qh={readContext:eh,useCallback:si,useContext:eh,useEffect:$h,useImperativeHandle:qi,useInsertionEffect:ni,useLayoutEffect:oi,useMemo:ti,useReducer:Xh,useRef:ji,useState:function(){return Xh(Vh)},useDebugValue:ri,useDeferredValue:function(o){var _=Uh();return N===null?_.memoizedState=o:ui(_,N.memoizedState,o)},useTransition:function(){var o=Xh(Vh)[0],_=Uh().memoizedState;return[o,_]},useMutableSource:Yh,useSyncExternalStore:Zh,useId:wi,unstable_isNewReconciler:!1};function Ci(o,_){if(o&&o.defaultProps){_=A$1({},_),o=o.defaultProps;for(var $ in o)_[$]===void 0&&(_[$]=o[$]);return _}return _}function Di(o,_,$,j){_=o.memoizedState,$=$(j,_),$=$==null?_:A$1({},_,$),o.memoizedState=$,o.lanes===0&&(o.updateQueue.baseState=$)}var Ei={isMounted:function(o){return(o=o._reactInternals)?Vb(o)===o:!1},enqueueSetState:function(o,_,$){o=o._reactInternals;var j=R$1(),_e=yi(o),et=mh(j,_e);et.payload=_,$!=null&&(et.callback=$),_=nh(o,et,_e),_!==null&&(gi(_,o,_e,j),oh(_,o,_e))},enqueueReplaceState:function(o,_,$){o=o._reactInternals;var j=R$1(),_e=yi(o),et=mh(j,_e);et.tag=1,et.payload=_,$!=null&&(et.callback=$),_=nh(o,et,_e),_!==null&&(gi(_,o,_e,j),oh(_,o,_e))},enqueueForceUpdate:function(o,_){o=o._reactInternals;var $=R$1(),j=yi(o),_e=mh($,j);_e.tag=2,_!=null&&(_e.callback=_),_=nh(o,_e,j),_!==null&&(gi(_,o,j,$),oh(_,o,j))}};function Fi(o,_,$,j,_e,et,tt){return o=o.stateNode,typeof o.shouldComponentUpdate=="function"?o.shouldComponentUpdate(j,et,tt):_.prototype&&_.prototype.isPureReactComponent?!Ie($,j)||!Ie(_e,et):!0}function Gi(o,_,$){var j=!1,_e=Vf,et=_.contextType;return typeof et=="object"&&et!==null?et=eh(et):(_e=Zf(_)?Xf:H.current,j=_.contextTypes,et=(j=j!=null)?Yf(o,_e):Vf),_=new _($,et),o.memoizedState=_.state!==null&&_.state!==void 0?_.state:null,_.updater=Ei,o.stateNode=_,_._reactInternals=o,j&&(o=o.stateNode,o.__reactInternalMemoizedUnmaskedChildContext=_e,o.__reactInternalMemoizedMaskedChildContext=et),_}function Hi(o,_,$,j){o=_.state,typeof _.componentWillReceiveProps=="function"&&_.componentWillReceiveProps($,j),typeof _.UNSAFE_componentWillReceiveProps=="function"&&_.UNSAFE_componentWillReceiveProps($,j),_.state!==o&&Ei.enqueueReplaceState(_,_.state,null)}function Ii(o,_,$,j){var _e=o.stateNode;_e.props=$,_e.state=o.memoizedState,_e.refs={},kh(o);var et=_.contextType;typeof et=="object"&&et!==null?_e.context=eh(et):(et=Zf(_)?Xf:H.current,_e.context=Yf(o,et)),_e.state=o.memoizedState,et=_.getDerivedStateFromProps,typeof et=="function"&&(Di(o,_,et,$),_e.state=o.memoizedState),typeof _.getDerivedStateFromProps=="function"||typeof _e.getSnapshotBeforeUpdate=="function"||typeof _e.UNSAFE_componentWillMount!="function"&&typeof _e.componentWillMount!="function"||(_=_e.state,typeof _e.componentWillMount=="function"&&_e.componentWillMount(),typeof _e.UNSAFE_componentWillMount=="function"&&_e.UNSAFE_componentWillMount(),_!==_e.state&&Ei.enqueueReplaceState(_e,_e.state,null),qh(o,$,_e,j),_e.state=o.memoizedState),typeof _e.componentDidMount=="function"&&(o.flags|=4194308)}function Ji(o,_){try{var $="",j=_;do $+=Pa(j),j=j.return;while(j);var _e=$}catch(et){_e=` -Error generating stack: `+et.message+` -`+et.stack}return{value:o,source:_,stack:_e,digest:null}}function Ki(o,_,$){return{value:o,source:null,stack:$??null,digest:_??null}}function Li(o,_){try{console.error(_.value)}catch($){setTimeout(function(){throw $})}}var Mi=typeof WeakMap=="function"?WeakMap:Map;function Ni(o,_,$){$=mh(-1,$),$.tag=3,$.payload={element:null};var j=_.value;return $.callback=function(){Oi||(Oi=!0,Pi=j),Li(o,_)},$}function Qi(o,_,$){$=mh(-1,$),$.tag=3;var j=o.type.getDerivedStateFromError;if(typeof j=="function"){var _e=_.value;$.payload=function(){return j(_e)},$.callback=function(){Li(o,_)}}var et=o.stateNode;return et!==null&&typeof et.componentDidCatch=="function"&&($.callback=function(){Li(o,_),typeof j!="function"&&(Ri===null?Ri=new Set([this]):Ri.add(this));var tt=_.stack;this.componentDidCatch(_.value,{componentStack:tt!==null?tt:""})}),$}function Si(o,_,$){var j=o.pingCache;if(j===null){j=o.pingCache=new Mi;var _e=new Set;j.set(_,_e)}else _e=j.get(_),_e===void 0&&(_e=new Set,j.set(_,_e));_e.has($)||(_e.add($),o=Ti.bind(null,o,_,$),_.then(o,o))}function Ui(o){do{var _;if((_=o.tag===13)&&(_=o.memoizedState,_=_!==null?_.dehydrated!==null:!0),_)return o;o=o.return}while(o!==null);return null}function Vi(o,_,$,j,_e){return o.mode&1?(o.flags|=65536,o.lanes=_e,o):(o===_?o.flags|=65536:(o.flags|=128,$.flags|=131072,$.flags&=-52805,$.tag===1&&($.alternate===null?$.tag=17:(_=mh(-1,1),_.tag=2,nh($,_,1))),$.lanes|=1),o)}var Wi=ua.ReactCurrentOwner,dh$1=!1;function Xi(o,_,$,j){_.child=o===null?Vg(_,null,$,j):Ug(_,o.child,$,j)}function Yi(o,_,$,j,_e){$=$.render;var et=_.ref;return ch(_,_e),j=Nh(o,_,$,j,et,_e),$=Sh(),o!==null&&!dh$1?(_.updateQueue=o.updateQueue,_.flags&=-2053,o.lanes&=~_e,Zi(o,_,_e)):(I&&$&&vg(_),_.flags|=1,Xi(o,_,j,_e),_.child)}function $i(o,_,$,j,_e){if(o===null){var et=$.type;return typeof et=="function"&&!aj(et)&&et.defaultProps===void 0&&$.compare===null&&$.defaultProps===void 0?(_.tag=15,_.type=et,bj(o,_,et,j,_e)):(o=Rg($.type,null,j,_,_.mode,_e),o.ref=_.ref,o.return=_,_.child=o)}if(et=o.child,!(o.lanes&_e)){var tt=et.memoizedProps;if($=$.compare,$=$!==null?$:Ie,$(tt,j)&&o.ref===_.ref)return Zi(o,_,_e)}return _.flags|=1,o=Pg(et,j),o.ref=_.ref,o.return=_,_.child=o}function bj(o,_,$,j,_e){if(o!==null){var et=o.memoizedProps;if(Ie(et,j)&&o.ref===_.ref)if(dh$1=!1,_.pendingProps=j=et,(o.lanes&_e)!==0)o.flags&131072&&(dh$1=!0);else return _.lanes=o.lanes,Zi(o,_,_e)}return cj(o,_,$,j,_e)}function dj(o,_,$){var j=_.pendingProps,_e=j.children,et=o!==null?o.memoizedState:null;if(j.mode==="hidden")if(!(_.mode&1))_.memoizedState={baseLanes:0,cachePool:null,transitions:null},G(ej,fj),fj|=$;else{if(!($&1073741824))return o=et!==null?et.baseLanes|$:$,_.lanes=_.childLanes=1073741824,_.memoizedState={baseLanes:o,cachePool:null,transitions:null},_.updateQueue=null,G(ej,fj),fj|=o,null;_.memoizedState={baseLanes:0,cachePool:null,transitions:null},j=et!==null?et.baseLanes:$,G(ej,fj),fj|=j}else et!==null?(j=et.baseLanes|$,_.memoizedState=null):j=$,G(ej,fj),fj|=j;return Xi(o,_,_e,$),_.child}function gj(o,_){var $=_.ref;(o===null&&$!==null||o!==null&&o.ref!==$)&&(_.flags|=512,_.flags|=2097152)}function cj(o,_,$,j,_e){var et=Zf($)?Xf:H.current;return et=Yf(_,et),ch(_,_e),$=Nh(o,_,$,j,et,_e),j=Sh(),o!==null&&!dh$1?(_.updateQueue=o.updateQueue,_.flags&=-2053,o.lanes&=~_e,Zi(o,_,_e)):(I&&j&&vg(_),_.flags|=1,Xi(o,_,$,_e),_.child)}function hj(o,_,$,j,_e){if(Zf($)){var et=!0;cg(_)}else et=!1;if(ch(_,_e),_.stateNode===null)ij(o,_),Gi(_,$,j),Ii(_,$,j,_e),j=!0;else if(o===null){var tt=_.stateNode,rt=_.memoizedProps;tt.props=rt;var nt=tt.context,ot=$.contextType;typeof ot=="object"&&ot!==null?ot=eh(ot):(ot=Zf($)?Xf:H.current,ot=Yf(_,ot));var it=$.getDerivedStateFromProps,st=typeof it=="function"||typeof tt.getSnapshotBeforeUpdate=="function";st||typeof tt.UNSAFE_componentWillReceiveProps!="function"&&typeof tt.componentWillReceiveProps!="function"||(rt!==j||nt!==ot)&&Hi(_,tt,j,ot),jh=!1;var at=_.memoizedState;tt.state=at,qh(_,j,tt,_e),nt=_.memoizedState,rt!==j||at!==nt||Wf.current||jh?(typeof it=="function"&&(Di(_,$,it,j),nt=_.memoizedState),(rt=jh||Fi(_,$,rt,j,at,nt,ot))?(st||typeof tt.UNSAFE_componentWillMount!="function"&&typeof tt.componentWillMount!="function"||(typeof tt.componentWillMount=="function"&&tt.componentWillMount(),typeof tt.UNSAFE_componentWillMount=="function"&&tt.UNSAFE_componentWillMount()),typeof tt.componentDidMount=="function"&&(_.flags|=4194308)):(typeof tt.componentDidMount=="function"&&(_.flags|=4194308),_.memoizedProps=j,_.memoizedState=nt),tt.props=j,tt.state=nt,tt.context=ot,j=rt):(typeof tt.componentDidMount=="function"&&(_.flags|=4194308),j=!1)}else{tt=_.stateNode,lh(o,_),rt=_.memoizedProps,ot=_.type===_.elementType?rt:Ci(_.type,rt),tt.props=ot,st=_.pendingProps,at=tt.context,nt=$.contextType,typeof nt=="object"&&nt!==null?nt=eh(nt):(nt=Zf($)?Xf:H.current,nt=Yf(_,nt));var lt=$.getDerivedStateFromProps;(it=typeof lt=="function"||typeof tt.getSnapshotBeforeUpdate=="function")||typeof tt.UNSAFE_componentWillReceiveProps!="function"&&typeof tt.componentWillReceiveProps!="function"||(rt!==st||at!==nt)&&Hi(_,tt,j,nt),jh=!1,at=_.memoizedState,tt.state=at,qh(_,j,tt,_e);var ct=_.memoizedState;rt!==st||at!==ct||Wf.current||jh?(typeof lt=="function"&&(Di(_,$,lt,j),ct=_.memoizedState),(ot=jh||Fi(_,$,ot,j,at,ct,nt)||!1)?(it||typeof tt.UNSAFE_componentWillUpdate!="function"&&typeof tt.componentWillUpdate!="function"||(typeof tt.componentWillUpdate=="function"&&tt.componentWillUpdate(j,ct,nt),typeof tt.UNSAFE_componentWillUpdate=="function"&&tt.UNSAFE_componentWillUpdate(j,ct,nt)),typeof tt.componentDidUpdate=="function"&&(_.flags|=4),typeof tt.getSnapshotBeforeUpdate=="function"&&(_.flags|=1024)):(typeof tt.componentDidUpdate!="function"||rt===o.memoizedProps&&at===o.memoizedState||(_.flags|=4),typeof tt.getSnapshotBeforeUpdate!="function"||rt===o.memoizedProps&&at===o.memoizedState||(_.flags|=1024),_.memoizedProps=j,_.memoizedState=ct),tt.props=j,tt.state=ct,tt.context=nt,j=ot):(typeof tt.componentDidUpdate!="function"||rt===o.memoizedProps&&at===o.memoizedState||(_.flags|=4),typeof tt.getSnapshotBeforeUpdate!="function"||rt===o.memoizedProps&&at===o.memoizedState||(_.flags|=1024),j=!1)}return jj(o,_,$,j,et,_e)}function jj(o,_,$,j,_e,et){gj(o,_);var tt=(_.flags&128)!==0;if(!j&&!tt)return _e&&dg(_,$,!1),Zi(o,_,et);j=_.stateNode,Wi.current=_;var rt=tt&&typeof $.getDerivedStateFromError!="function"?null:j.render();return _.flags|=1,o!==null&&tt?(_.child=Ug(_,o.child,null,et),_.child=Ug(_,null,rt,et)):Xi(o,_,rt,et),_.memoizedState=j.state,_e&&dg(_,$,!0),_.child}function kj(o){var _=o.stateNode;_.pendingContext?ag(o,_.pendingContext,_.pendingContext!==_.context):_.context&&ag(o,_.context,!1),yh(o,_.containerInfo)}function lj(o,_,$,j,_e){return Ig(),Jg(_e),_.flags|=256,Xi(o,_,$,j),_.child}var mj={dehydrated:null,treeContext:null,retryLane:0};function nj(o){return{baseLanes:o,cachePool:null,transitions:null}}function oj(o,_,$){var j=_.pendingProps,_e=L.current,et=!1,tt=(_.flags&128)!==0,rt;if((rt=tt)||(rt=o!==null&&o.memoizedState===null?!1:(_e&2)!==0),rt?(et=!0,_.flags&=-129):(o===null||o.memoizedState!==null)&&(_e|=1),G(L,_e&1),o===null)return Eg(_),o=_.memoizedState,o!==null&&(o=o.dehydrated,o!==null)?(_.mode&1?o.data==="$!"?_.lanes=8:_.lanes=1073741824:_.lanes=1,null):(tt=j.children,o=j.fallback,et?(j=_.mode,et=_.child,tt={mode:"hidden",children:tt},!(j&1)&&et!==null?(et.childLanes=0,et.pendingProps=tt):et=pj(tt,j,0,null),o=Tg(o,j,$,null),et.return=_,o.return=_,et.sibling=o,_.child=et,_.child.memoizedState=nj($),_.memoizedState=mj,o):qj(_,tt));if(_e=o.memoizedState,_e!==null&&(rt=_e.dehydrated,rt!==null))return rj(o,_,tt,j,rt,_e,$);if(et){et=j.fallback,tt=_.mode,_e=o.child,rt=_e.sibling;var nt={mode:"hidden",children:j.children};return!(tt&1)&&_.child!==_e?(j=_.child,j.childLanes=0,j.pendingProps=nt,_.deletions=null):(j=Pg(_e,nt),j.subtreeFlags=_e.subtreeFlags&14680064),rt!==null?et=Pg(rt,et):(et=Tg(et,tt,$,null),et.flags|=2),et.return=_,j.return=_,j.sibling=et,_.child=j,j=et,et=_.child,tt=o.child.memoizedState,tt=tt===null?nj($):{baseLanes:tt.baseLanes|$,cachePool:null,transitions:tt.transitions},et.memoizedState=tt,et.childLanes=o.childLanes&~$,_.memoizedState=mj,j}return et=o.child,o=et.sibling,j=Pg(et,{mode:"visible",children:j.children}),!(_.mode&1)&&(j.lanes=$),j.return=_,j.sibling=null,o!==null&&($=_.deletions,$===null?(_.deletions=[o],_.flags|=16):$.push(o)),_.child=j,_.memoizedState=null,j}function qj(o,_){return _=pj({mode:"visible",children:_},o.mode,0,null),_.return=o,o.child=_}function sj(o,_,$,j){return j!==null&&Jg(j),Ug(_,o.child,null,$),o=qj(_,_.pendingProps.children),o.flags|=2,_.memoizedState=null,o}function rj(o,_,$,j,_e,et,tt){if($)return _.flags&256?(_.flags&=-257,j=Ki(Error(p$1(422))),sj(o,_,tt,j)):_.memoizedState!==null?(_.child=o.child,_.flags|=128,null):(et=j.fallback,_e=_.mode,j=pj({mode:"visible",children:j.children},_e,0,null),et=Tg(et,_e,tt,null),et.flags|=2,j.return=_,et.return=_,j.sibling=et,_.child=j,_.mode&1&&Ug(_,o.child,null,tt),_.child.memoizedState=nj(tt),_.memoizedState=mj,et);if(!(_.mode&1))return sj(o,_,tt,null);if(_e.data==="$!"){if(j=_e.nextSibling&&_e.nextSibling.dataset,j)var rt=j.dgst;return j=rt,et=Error(p$1(419)),j=Ki(et,j,void 0),sj(o,_,tt,j)}if(rt=(tt&o.childLanes)!==0,dh$1||rt){if(j=Q,j!==null){switch(tt&-tt){case 4:_e=2;break;case 16:_e=8;break;case 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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:_e=32;break;case 536870912:_e=268435456;break;default:_e=0}_e=_e&(j.suspendedLanes|tt)?0:_e,_e!==0&&_e!==et.retryLane&&(et.retryLane=_e,ih(o,_e),gi(j,o,_e,-1))}return tj(),j=Ki(Error(p$1(421))),sj(o,_,tt,j)}return _e.data==="$?"?(_.flags|=128,_.child=o.child,_=uj.bind(null,o),_e._reactRetry=_,null):(o=et.treeContext,yg=Lf(_e.nextSibling),xg=_,I=!0,zg=null,o!==null&&(og[pg++]=rg,og[pg++]=sg,og[pg++]=qg,rg=o.id,sg=o.overflow,qg=_),_=qj(_,j.children),_.flags|=4096,_)}function vj(o,_,$){o.lanes|=_;var j=o.alternate;j!==null&&(j.lanes|=_),bh(o.return,_,$)}function wj(o,_,$,j,_e){var et=o.memoizedState;et===null?o.memoizedState={isBackwards:_,rendering:null,renderingStartTime:0,last:j,tail:$,tailMode:_e}:(et.isBackwards=_,et.rendering=null,et.renderingStartTime=0,et.last=j,et.tail=$,et.tailMode=_e)}function xj(o,_,$){var j=_.pendingProps,_e=j.revealOrder,et=j.tail;if(Xi(o,_,j.children,$),j=L.current,j&2)j=j&1|2,_.flags|=128;else{if(o!==null&&o.flags&128)e:for(o=_.child;o!==null;){if(o.tag===13)o.memoizedState!==null&&vj(o,$,_);else if(o.tag===19)vj(o,$,_);else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===_)break e;for(;o.sibling===null;){if(o.return===null||o.return===_)break e;o=o.return}o.sibling.return=o.return,o=o.sibling}j&=1}if(G(L,j),!(_.mode&1))_.memoizedState=null;else switch(_e){case"forwards":for($=_.child,_e=null;$!==null;)o=$.alternate,o!==null&&Ch(o)===null&&(_e=$),$=$.sibling;$=_e,$===null?(_e=_.child,_.child=null):(_e=$.sibling,$.sibling=null),wj(_,!1,_e,$,et);break;case"backwards":for($=null,_e=_.child,_.child=null;_e!==null;){if(o=_e.alternate,o!==null&&Ch(o)===null){_.child=_e;break}o=_e.sibling,_e.sibling=$,$=_e,_e=o}wj(_,!0,$,null,et);break;case"together":wj(_,!1,null,null,void 0);break;default:_.memoizedState=null}return _.child}function ij(o,_){!(_.mode&1)&&o!==null&&(o.alternate=null,_.alternate=null,_.flags|=2)}function Zi(o,_,$){if(o!==null&&(_.dependencies=o.dependencies),rh$1|=_.lanes,!($&_.childLanes))return null;if(o!==null&&_.child!==o.child)throw Error(p$1(153));if(_.child!==null){for(o=_.child,$=Pg(o,o.pendingProps),_.child=$,$.return=_;o.sibling!==null;)o=o.sibling,$=$.sibling=Pg(o,o.pendingProps),$.return=_;$.sibling=null}return _.child}function yj(o,_,$){switch(_.tag){case 3:kj(_),Ig();break;case 5:Ah(_);break;case 1:Zf(_.type)&&cg(_);break;case 4:yh(_,_.stateNode.containerInfo);break;case 10:var j=_.type._context,_e=_.memoizedProps.value;G(Wg,j._currentValue),j._currentValue=_e;break;case 13:if(j=_.memoizedState,j!==null)return j.dehydrated!==null?(G(L,L.current&1),_.flags|=128,null):$&_.child.childLanes?oj(o,_,$):(G(L,L.current&1),o=Zi(o,_,$),o!==null?o.sibling:null);G(L,L.current&1);break;case 19:if(j=($&_.childLanes)!==0,o.flags&128){if(j)return xj(o,_,$);_.flags|=128}if(_e=_.memoizedState,_e!==null&&(_e.rendering=null,_e.tail=null,_e.lastEffect=null),G(L,L.current),j)break;return null;case 22:case 23:return _.lanes=0,dj(o,_,$)}return Zi(o,_,$)}var zj,Aj,Bj,Cj;zj=function(o,_){for(var $=_.child;$!==null;){if($.tag===5||$.tag===6)o.appendChild($.stateNode);else if($.tag!==4&&$.child!==null){$.child.return=$,$=$.child;continue}if($===_)break;for(;$.sibling===null;){if($.return===null||$.return===_)return;$=$.return}$.sibling.return=$.return,$=$.sibling}};Aj=function(){};Bj=function(o,_,$,j){var _e=o.memoizedProps;if(_e!==j){o=_.stateNode,xh(uh.current);var et=null;switch($){case"input":_e=Ya(o,_e),j=Ya(o,j),et=[];break;case"select":_e=A$1({},_e,{value:void 0}),j=A$1({},j,{value:void 0}),et=[];break;case"textarea":_e=gb(o,_e),j=gb(o,j),et=[];break;default:typeof _e.onClick!="function"&&typeof j.onClick=="function"&&(o.onclick=Bf)}ub($,j);var tt;$=null;for(ot in _e)if(!j.hasOwnProperty(ot)&&_e.hasOwnProperty(ot)&&_e[ot]!=null)if(ot==="style"){var rt=_e[ot];for(tt in rt)rt.hasOwnProperty(tt)&&($||($={}),$[tt]="")}else ot!=="dangerouslySetInnerHTML"&&ot!=="children"&&ot!=="suppressContentEditableWarning"&&ot!=="suppressHydrationWarning"&&ot!=="autoFocus"&&(ea.hasOwnProperty(ot)?et||(et=[]):(et=et||[]).push(ot,null));for(ot in j){var nt=j[ot];if(rt=_e!=null?_e[ot]:void 0,j.hasOwnProperty(ot)&&nt!==rt&&(nt!=null||rt!=null))if(ot==="style")if(rt){for(tt in rt)!rt.hasOwnProperty(tt)||nt&&nt.hasOwnProperty(tt)||($||($={}),$[tt]="");for(tt in nt)nt.hasOwnProperty(tt)&&rt[tt]!==nt[tt]&&($||($={}),$[tt]=nt[tt])}else $||(et||(et=[]),et.push(ot,$)),$=nt;else ot==="dangerouslySetInnerHTML"?(nt=nt?nt.__html:void 0,rt=rt?rt.__html:void 0,nt!=null&&rt!==nt&&(et=et||[]).push(ot,nt)):ot==="children"?typeof nt!="string"&&typeof nt!="number"||(et=et||[]).push(ot,""+nt):ot!=="suppressContentEditableWarning"&&ot!=="suppressHydrationWarning"&&(ea.hasOwnProperty(ot)?(nt!=null&&ot==="onScroll"&&D("scroll",o),et||rt===nt||(et=[])):(et=et||[]).push(ot,nt))}$&&(et=et||[]).push("style",$);var ot=et;(_.updateQueue=ot)&&(_.flags|=4)}};Cj=function(o,_,$,j){$!==j&&(_.flags|=4)};function Dj(o,_){if(!I)switch(o.tailMode){case"hidden":_=o.tail;for(var $=null;_!==null;)_.alternate!==null&&($=_),_=_.sibling;$===null?o.tail=null:$.sibling=null;break;case"collapsed":$=o.tail;for(var j=null;$!==null;)$.alternate!==null&&(j=$),$=$.sibling;j===null?_||o.tail===null?o.tail=null:o.tail.sibling=null:j.sibling=null}}function S(o){var _=o.alternate!==null&&o.alternate.child===o.child,$=0,j=0;if(_)for(var _e=o.child;_e!==null;)$|=_e.lanes|_e.childLanes,j|=_e.subtreeFlags&14680064,j|=_e.flags&14680064,_e.return=o,_e=_e.sibling;else for(_e=o.child;_e!==null;)$|=_e.lanes|_e.childLanes,j|=_e.subtreeFlags,j|=_e.flags,_e.return=o,_e=_e.sibling;return o.subtreeFlags|=j,o.childLanes=$,_}function Ej(o,_,$){var j=_.pendingProps;switch(wg(_),_.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return S(_),null;case 1:return Zf(_.type)&&$f(),S(_),null;case 3:return j=_.stateNode,zh(),E$1(Wf),E$1(H),Eh(),j.pendingContext&&(j.context=j.pendingContext,j.pendingContext=null),(o===null||o.child===null)&&(Gg(_)?_.flags|=4:o===null||o.memoizedState.isDehydrated&&!(_.flags&256)||(_.flags|=1024,zg!==null&&(Fj(zg),zg=null))),Aj(o,_),S(_),null;case 5:Bh(_);var _e=xh(wh.current);if($=_.type,o!==null&&_.stateNode!=null)Bj(o,_,$,j,_e),o.ref!==_.ref&&(_.flags|=512,_.flags|=2097152);else{if(!j){if(_.stateNode===null)throw Error(p$1(166));return S(_),null}if(o=xh(uh.current),Gg(_)){j=_.stateNode,$=_.type;var et=_.memoizedProps;switch(j[Of]=_,j[Pf]=et,o=(_.mode&1)!==0,$){case"dialog":D("cancel",j),D("close",j);break;case"iframe":case"object":case"embed":D("load",j);break;case"video":case"audio":for(_e=0;_e<\/script>",o=o.removeChild(o.firstChild)):typeof j.is=="string"?o=tt.createElement($,{is:j.is}):(o=tt.createElement($),$==="select"&&(tt=o,j.multiple?tt.multiple=!0:j.size&&(tt.size=j.size))):o=tt.createElementNS(o,$),o[Of]=_,o[Pf]=j,zj(o,_,!1,!1),_.stateNode=o;e:{switch(tt=vb($,j),$){case"dialog":D("cancel",o),D("close",o),_e=j;break;case"iframe":case"object":case"embed":D("load",o),_e=j;break;case"video":case"audio":for(_e=0;_eGj&&(_.flags|=128,j=!0,Dj(et,!1),_.lanes=4194304)}else{if(!j)if(o=Ch(tt),o!==null){if(_.flags|=128,j=!0,$=o.updateQueue,$!==null&&(_.updateQueue=$,_.flags|=4),Dj(et,!0),et.tail===null&&et.tailMode==="hidden"&&!tt.alternate&&!I)return S(_),null}else 2*B()-et.renderingStartTime>Gj&&$!==1073741824&&(_.flags|=128,j=!0,Dj(et,!1),_.lanes=4194304);et.isBackwards?(tt.sibling=_.child,_.child=tt):($=et.last,$!==null?$.sibling=tt:_.child=tt,et.last=tt)}return et.tail!==null?(_=et.tail,et.rendering=_,et.tail=_.sibling,et.renderingStartTime=B(),_.sibling=null,$=L.current,G(L,j?$&1|2:$&1),_):(S(_),null);case 22:case 23:return Hj(),j=_.memoizedState!==null,o!==null&&o.memoizedState!==null!==j&&(_.flags|=8192),j&&_.mode&1?fj&1073741824&&(S(_),_.subtreeFlags&6&&(_.flags|=8192)):S(_),null;case 24:return null;case 25:return null}throw Error(p$1(156,_.tag))}function Ij(o,_){switch(wg(_),_.tag){case 1:return Zf(_.type)&&$f(),o=_.flags,o&65536?(_.flags=o&-65537|128,_):null;case 3:return zh(),E$1(Wf),E$1(H),Eh(),o=_.flags,o&65536&&!(o&128)?(_.flags=o&-65537|128,_):null;case 5:return Bh(_),null;case 13:if(E$1(L),o=_.memoizedState,o!==null&&o.dehydrated!==null){if(_.alternate===null)throw Error(p$1(340));Ig()}return o=_.flags,o&65536?(_.flags=o&-65537|128,_):null;case 19:return E$1(L),null;case 4:return zh(),null;case 10:return ah(_.type._context),null;case 22:case 23:return Hj(),null;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=typeof WeakSet=="function"?WeakSet:Set,V=null;function Lj(o,_){var $=o.ref;if($!==null)if(typeof $=="function")try{$(null)}catch(j){W(o,_,j)}else $.current=null}function Mj(o,_,$){try{$()}catch(j){W(o,_,j)}}var Nj=!1;function Oj(o,_){if(Cf=dd,o=Me(),Ne(o)){if("selectionStart"in o)var $={start:o.selectionStart,end:o.selectionEnd};else e:{$=($=o.ownerDocument)&&$.defaultView||window;var j=$.getSelection&&$.getSelection();if(j&&j.rangeCount!==0){$=j.anchorNode;var _e=j.anchorOffset,et=j.focusNode;j=j.focusOffset;try{$.nodeType,et.nodeType}catch{$=null;break e}var tt=0,rt=-1,nt=-1,ot=0,it=0,st=o,at=null;t:for(;;){for(var lt;st!==$||_e!==0&&st.nodeType!==3||(rt=tt+_e),st!==et||j!==0&&st.nodeType!==3||(nt=tt+j),st.nodeType===3&&(tt+=st.nodeValue.length),(lt=st.firstChild)!==null;)at=st,st=lt;for(;;){if(st===o)break t;if(at===$&&++ot===_e&&(rt=tt),at===et&&++it===j&&(nt=tt),(lt=st.nextSibling)!==null)break;st=at,at=st.parentNode}st=lt}$=rt===-1||nt===-1?null:{start:rt,end:nt}}else $=null}$=$||{start:0,end:0}}else $=null;for(Df={focusedElem:o,selectionRange:$},dd=!1,V=_;V!==null;)if(_=V,o=_.child,(_.subtreeFlags&1028)!==0&&o!==null)o.return=_,V=o;else for(;V!==null;){_=V;try{var ct=_.alternate;if(_.flags&1024)switch(_.tag){case 0:case 11:case 15:break;case 1:if(ct!==null){var ft=ct.memoizedProps,dt=ct.memoizedState,pt=_.stateNode,yt=pt.getSnapshotBeforeUpdate(_.elementType===_.type?ft:Ci(_.type,ft),dt);pt.__reactInternalSnapshotBeforeUpdate=yt}break;case 3:var vt=_.stateNode.containerInfo;vt.nodeType===1?vt.textContent="":vt.nodeType===9&&vt.documentElement&&vt.removeChild(vt.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p$1(163))}}catch(wt){W(_,_.return,wt)}if(o=_.sibling,o!==null){o.return=_.return,V=o;break}V=_.return}return ct=Nj,Nj=!1,ct}function Pj(o,_,$){var j=_.updateQueue;if(j=j!==null?j.lastEffect:null,j!==null){var _e=j=j.next;do{if((_e.tag&o)===o){var et=_e.destroy;_e.destroy=void 0,et!==void 0&&Mj(_,$,et)}_e=_e.next}while(_e!==j)}}function Qj(o,_){if(_=_.updateQueue,_=_!==null?_.lastEffect:null,_!==null){var $=_=_.next;do{if(($.tag&o)===o){var j=$.create;$.destroy=j()}$=$.next}while($!==_)}}function Rj(o){var _=o.ref;if(_!==null){var $=o.stateNode;switch(o.tag){case 5:o=$;break;default:o=$}typeof _=="function"?_(o):_.current=o}}function Sj(o){var _=o.alternate;_!==null&&(o.alternate=null,Sj(_)),o.child=null,o.deletions=null,o.sibling=null,o.tag===5&&(_=o.stateNode,_!==null&&(delete _[Of],delete _[Pf],delete _[of],delete _[Qf],delete _[Rf])),o.stateNode=null,o.return=null,o.dependencies=null,o.memoizedProps=null,o.memoizedState=null,o.pendingProps=null,o.stateNode=null,o.updateQueue=null}function Tj(o){return o.tag===5||o.tag===3||o.tag===4}function Uj(o){e:for(;;){for(;o.sibling===null;){if(o.return===null||Tj(o.return))return null;o=o.return}for(o.sibling.return=o.return,o=o.sibling;o.tag!==5&&o.tag!==6&&o.tag!==18;){if(o.flags&2||o.child===null||o.tag===4)continue e;o.child.return=o,o=o.child}if(!(o.flags&2))return o.stateNode}}function Vj(o,_,$){var j=o.tag;if(j===5||j===6)o=o.stateNode,_?$.nodeType===8?$.parentNode.insertBefore(o,_):$.insertBefore(o,_):($.nodeType===8?(_=$.parentNode,_.insertBefore(o,$)):(_=$,_.appendChild(o)),$=$._reactRootContainer,$!=null||_.onclick!==null||(_.onclick=Bf));else if(j!==4&&(o=o.child,o!==null))for(Vj(o,_,$),o=o.sibling;o!==null;)Vj(o,_,$),o=o.sibling}function Wj(o,_,$){var j=o.tag;if(j===5||j===6)o=o.stateNode,_?$.insertBefore(o,_):$.appendChild(o);else if(j!==4&&(o=o.child,o!==null))for(Wj(o,_,$),o=o.sibling;o!==null;)Wj(o,_,$),o=o.sibling}var X=null,Xj=!1;function Yj(o,_,$){for($=$.child;$!==null;)Zj(o,_,$),$=$.sibling}function Zj(o,_,$){if(lc&&typeof lc.onCommitFiberUnmount=="function")try{lc.onCommitFiberUnmount(kc,$)}catch{}switch($.tag){case 5:U||Lj($,_);case 6:var j=X,_e=Xj;X=null,Yj(o,_,$),X=j,Xj=_e,X!==null&&(Xj?(o=X,$=$.stateNode,o.nodeType===8?o.parentNode.removeChild($):o.removeChild($)):X.removeChild($.stateNode));break;case 18:X!==null&&(Xj?(o=X,$=$.stateNode,o.nodeType===8?Kf(o.parentNode,$):o.nodeType===1&&Kf(o,$),bd(o)):Kf(X,$.stateNode));break;case 4:j=X,_e=Xj,X=$.stateNode.containerInfo,Xj=!0,Yj(o,_,$),X=j,Xj=_e;break;case 0:case 11:case 14:case 15:if(!U&&(j=$.updateQueue,j!==null&&(j=j.lastEffect,j!==null))){_e=j=j.next;do{var et=_e,tt=et.destroy;et=et.tag,tt!==void 0&&(et&2||et&4)&&Mj($,_,tt),_e=_e.next}while(_e!==j)}Yj(o,_,$);break;case 1:if(!U&&(Lj($,_),j=$.stateNode,typeof j.componentWillUnmount=="function"))try{j.props=$.memoizedProps,j.state=$.memoizedState,j.componentWillUnmount()}catch(rt){W($,_,rt)}Yj(o,_,$);break;case 21:Yj(o,_,$);break;case 22:$.mode&1?(U=(j=U)||$.memoizedState!==null,Yj(o,_,$),U=j):Yj(o,_,$);break;default:Yj(o,_,$)}}function ak(o){var _=o.updateQueue;if(_!==null){o.updateQueue=null;var $=o.stateNode;$===null&&($=o.stateNode=new Kj),_.forEach(function(j){var _e=bk.bind(null,o,j);$.has(j)||($.add(j),j.then(_e,_e))})}}function ck(o,_){var $=_.deletions;if($!==null)for(var j=0;j<$.length;j++){var _e=$[j];try{var et=o,tt=_,rt=tt;e:for(;rt!==null;){switch(rt.tag){case 5:X=rt.stateNode,Xj=!1;break e;case 3:X=rt.stateNode.containerInfo,Xj=!0;break e;case 4:X=rt.stateNode.containerInfo,Xj=!0;break e}rt=rt.return}if(X===null)throw Error(p$1(160));Zj(et,tt,_e),X=null,Xj=!1;var nt=_e.alternate;nt!==null&&(nt.return=null),_e.return=null}catch(ot){W(_e,_,ot)}}if(_.subtreeFlags&12854)for(_=_.child;_!==null;)dk(_,o),_=_.sibling}function dk(o,_){var $=o.alternate,j=o.flags;switch(o.tag){case 0:case 11:case 14:case 15:if(ck(_,o),ek(o),j&4){try{Pj(3,o,o.return),Qj(3,o)}catch(ft){W(o,o.return,ft)}try{Pj(5,o,o.return)}catch(ft){W(o,o.return,ft)}}break;case 1:ck(_,o),ek(o),j&512&&$!==null&&Lj($,$.return);break;case 5:if(ck(_,o),ek(o),j&512&&$!==null&&Lj($,$.return),o.flags&32){var _e=o.stateNode;try{ob(_e,"")}catch(ft){W(o,o.return,ft)}}if(j&4&&(_e=o.stateNode,_e!=null)){var et=o.memoizedProps,tt=$!==null?$.memoizedProps:et,rt=o.type,nt=o.updateQueue;if(o.updateQueue=null,nt!==null)try{rt==="input"&&et.type==="radio"&&et.name!=null&&ab(_e,et),vb(rt,tt);var ot=vb(rt,et);for(tt=0;tt_e&&(_e=tt),j&=~et}if(j=_e,j=B()-j,j=(120>j?120:480>j?480:1080>j?1080:1920>j?1920:3e3>j?3e3:4320>j?4320:1960*lk(j/1960))-j,10o?16:o,wk===null)var j=!1;else{if(o=wk,wk=null,xk=0,K$1&6)throw Error(p$1(331));var _e=K$1;for(K$1|=4,V=o.current;V!==null;){var et=V,tt=et.child;if(V.flags&16){var rt=et.deletions;if(rt!==null){for(var nt=0;ntB()-fk?Kk(o,0):rk|=$),Dk(o,_)}function Yk(o,_){_===0&&(o.mode&1?(_=sc,sc<<=1,!(sc&130023424)&&(sc=4194304)):_=1);var $=R$1();o=ih(o,_),o!==null&&(Ac(o,_,$),Dk(o,$))}function uj(o){var _=o.memoizedState,$=0;_!==null&&($=_.retryLane),Yk(o,$)}function bk(o,_){var $=0;switch(o.tag){case 13:var j=o.stateNode,_e=o.memoizedState;_e!==null&&($=_e.retryLane);break;case 19:j=o.stateNode;break;default:throw Error(p$1(314))}j!==null&&j.delete(_),Yk(o,$)}var Vk;Vk=function(o,_,$){if(o!==null)if(o.memoizedProps!==_.pendingProps||Wf.current)dh$1=!0;else{if(!(o.lanes&$)&&!(_.flags&128))return dh$1=!1,yj(o,_,$);dh$1=!!(o.flags&131072)}else dh$1=!1,I&&_.flags&1048576&&ug(_,ng,_.index);switch(_.lanes=0,_.tag){case 2:var j=_.type;ij(o,_),o=_.pendingProps;var _e=Yf(_,H.current);ch(_,$),_e=Nh(null,_,j,o,_e,$);var et=Sh();return _.flags|=1,typeof _e=="object"&&_e!==null&&typeof _e.render=="function"&&_e.$$typeof===void 0?(_.tag=1,_.memoizedState=null,_.updateQueue=null,Zf(j)?(et=!0,cg(_)):et=!1,_.memoizedState=_e.state!==null&&_e.state!==void 0?_e.state:null,kh(_),_e.updater=Ei,_.stateNode=_e,_e._reactInternals=_,Ii(_,j,o,$),_=jj(null,_,j,!0,et,$)):(_.tag=0,I&&et&&vg(_),Xi(null,_,_e,$),_=_.child),_;case 16:j=_.elementType;e:{switch(ij(o,_),o=_.pendingProps,_e=j._init,j=_e(j._payload),_.type=j,_e=_.tag=Zk(j),o=Ci(j,o),_e){case 0:_=cj(null,_,j,o,$);break e;case 1:_=hj(null,_,j,o,$);break e;case 11:_=Yi(null,_,j,o,$);break e;case 14:_=$i(null,_,j,Ci(j.type,o),$);break e}throw Error(p$1(306,j,""))}return _;case 0:return j=_.type,_e=_.pendingProps,_e=_.elementType===j?_e:Ci(j,_e),cj(o,_,j,_e,$);case 1:return j=_.type,_e=_.pendingProps,_e=_.elementType===j?_e:Ci(j,_e),hj(o,_,j,_e,$);case 3:e:{if(kj(_),o===null)throw Error(p$1(387));j=_.pendingProps,et=_.memoizedState,_e=et.element,lh(o,_),qh(_,j,null,$);var tt=_.memoizedState;if(j=tt.element,et.isDehydrated)if(et={element:j,isDehydrated:!1,cache:tt.cache,pendingSuspenseBoundaries:tt.pendingSuspenseBoundaries,transitions:tt.transitions},_.updateQueue.baseState=et,_.memoizedState=et,_.flags&256){_e=Ji(Error(p$1(423)),_),_=lj(o,_,j,$,_e);break e}else if(j!==_e){_e=Ji(Error(p$1(424)),_),_=lj(o,_,j,$,_e);break e}else for(yg=Lf(_.stateNode.containerInfo.firstChild),xg=_,I=!0,zg=null,$=Vg(_,null,j,$),_.child=$;$;)$.flags=$.flags&-3|4096,$=$.sibling;else{if(Ig(),j===_e){_=Zi(o,_,$);break e}Xi(o,_,j,$)}_=_.child}return _;case 5:return Ah(_),o===null&&Eg(_),j=_.type,_e=_.pendingProps,et=o!==null?o.memoizedProps:null,tt=_e.children,Ef(j,_e)?tt=null:et!==null&&Ef(j,et)&&(_.flags|=32),gj(o,_),Xi(o,_,tt,$),_.child;case 6:return o===null&&Eg(_),null;case 13:return oj(o,_,$);case 4:return yh(_,_.stateNode.containerInfo),j=_.pendingProps,o===null?_.child=Ug(_,null,j,$):Xi(o,_,j,$),_.child;case 11:return j=_.type,_e=_.pendingProps,_e=_.elementType===j?_e:Ci(j,_e),Yi(o,_,j,_e,$);case 7:return Xi(o,_,_.pendingProps,$),_.child;case 8:return Xi(o,_,_.pendingProps.children,$),_.child;case 12:return Xi(o,_,_.pendingProps.children,$),_.child;case 10:e:{if(j=_.type._context,_e=_.pendingProps,et=_.memoizedProps,tt=_e.value,G(Wg,j._currentValue),j._currentValue=tt,et!==null)if(He(et.value,tt)){if(et.children===_e.children&&!Wf.current){_=Zi(o,_,$);break e}}else for(et=_.child,et!==null&&(et.return=_);et!==null;){var rt=et.dependencies;if(rt!==null){tt=et.child;for(var nt=rt.firstContext;nt!==null;){if(nt.context===j){if(et.tag===1){nt=mh(-1,$&-$),nt.tag=2;var ot=et.updateQueue;if(ot!==null){ot=ot.shared;var it=ot.pending;it===null?nt.next=nt:(nt.next=it.next,it.next=nt),ot.pending=nt}}et.lanes|=$,nt=et.alternate,nt!==null&&(nt.lanes|=$),bh(et.return,$,_),rt.lanes|=$;break}nt=nt.next}}else if(et.tag===10)tt=et.type===_.type?null:et.child;else if(et.tag===18){if(tt=et.return,tt===null)throw Error(p$1(341));tt.lanes|=$,rt=tt.alternate,rt!==null&&(rt.lanes|=$),bh(tt,$,_),tt=et.sibling}else tt=et.child;if(tt!==null)tt.return=et;else for(tt=et;tt!==null;){if(tt===_){tt=null;break}if(et=tt.sibling,et!==null){et.return=tt.return,tt=et;break}tt=tt.return}et=tt}Xi(o,_,_e.children,$),_=_.child}return _;case 9:return _e=_.type,j=_.pendingProps.children,ch(_,$),_e=eh(_e),j=j(_e),_.flags|=1,Xi(o,_,j,$),_.child;case 14:return j=_.type,_e=Ci(j,_.pendingProps),_e=Ci(j.type,_e),$i(o,_,j,_e,$);case 15:return bj(o,_,_.type,_.pendingProps,$);case 17:return j=_.type,_e=_.pendingProps,_e=_.elementType===j?_e:Ci(j,_e),ij(o,_),_.tag=1,Zf(j)?(o=!0,cg(_)):o=!1,ch(_,$),Gi(_,j,_e),Ii(_,j,_e,$),jj(null,_,j,!0,o,$);case 19:return xj(o,_,$);case 22:return dj(o,_,$)}throw Error(p$1(156,_.tag))};function Fk(o,_){return ac(o,_)}function $k(o,_,$,j){this.tag=o,this.key=$,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=_,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=j,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Bg(o,_,$,j){return new $k(o,_,$,j)}function aj(o){return o=o.prototype,!(!o||!o.isReactComponent)}function Zk(o){if(typeof o=="function")return aj(o)?1:0;if(o!=null){if(o=o.$$typeof,o===Da)return 11;if(o===Ga)return 14}return 2}function Pg(o,_){var $=o.alternate;return $===null?($=Bg(o.tag,_,o.key,o.mode),$.elementType=o.elementType,$.type=o.type,$.stateNode=o.stateNode,$.alternate=o,o.alternate=$):($.pendingProps=_,$.type=o.type,$.flags=0,$.subtreeFlags=0,$.deletions=null),$.flags=o.flags&14680064,$.childLanes=o.childLanes,$.lanes=o.lanes,$.child=o.child,$.memoizedProps=o.memoizedProps,$.memoizedState=o.memoizedState,$.updateQueue=o.updateQueue,_=o.dependencies,$.dependencies=_===null?null:{lanes:_.lanes,firstContext:_.firstContext},$.sibling=o.sibling,$.index=o.index,$.ref=o.ref,$}function Rg(o,_,$,j,_e,et){var tt=2;if(j=o,typeof o=="function")aj(o)&&(tt=1);else if(typeof o=="string")tt=5;else e:switch(o){case ya:return Tg($.children,_e,et,_);case za:tt=8,_e|=8;break;case Aa:return o=Bg(12,$,_,_e|2),o.elementType=Aa,o.lanes=et,o;case Ea:return o=Bg(13,$,_,_e),o.elementType=Ea,o.lanes=et,o;case Fa:return o=Bg(19,$,_,_e),o.elementType=Fa,o.lanes=et,o;case Ia:return pj($,_e,et,_);default:if(typeof o=="object"&&o!==null)switch(o.$$typeof){case Ba:tt=10;break e;case Ca:tt=9;break e;case Da:tt=11;break e;case Ga:tt=14;break e;case Ha:tt=16,j=null;break e}throw Error(p$1(130,o==null?o:typeof o,""))}return _=Bg(tt,$,_,_e),_.elementType=o,_.type=j,_.lanes=et,_}function Tg(o,_,$,j){return o=Bg(7,o,j,_),o.lanes=$,o}function pj(o,_,$,j){return o=Bg(22,o,j,_),o.elementType=Ia,o.lanes=$,o.stateNode={isHidden:!1},o}function Qg(o,_,$){return o=Bg(6,o,null,_),o.lanes=$,o}function Sg(o,_,$){return _=Bg(4,o.children!==null?o.children:[],o.key,_),_.lanes=$,_.stateNode={containerInfo:o.containerInfo,pendingChildren:null,implementation:o.implementation},_}function al(o,_,$,j,_e){this.tag=_,this.containerInfo=o,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=zc(0),this.expirationTimes=zc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zc(0),this.identifierPrefix=j,this.onRecoverableError=_e,this.mutableSourceEagerHydrationData=null}function bl(o,_,$,j,_e,et,tt,rt,nt){return o=new al(o,_,$,rt,nt),_===1?(_=1,et===!0&&(_|=8)):_=0,et=Bg(3,null,null,_),o.current=et,et.stateNode=o,et.memoizedState={element:j,isDehydrated:$,cache:null,transitions:null,pendingSuspenseBoundaries:null},kh(et),o}function cl(o,_,$){var j=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE)}catch(o){console.error(o)}}checkDCE(),reactDom.exports=reactDom_production_min;var reactDomExports=reactDom.exports;const ReactDOM=getDefaultExportFromCjs$1(reactDomExports);var createRoot,m$1=reactDomExports;createRoot=m$1.createRoot,m$1.hydrateRoot;const common$6={black:"#000",white:"#fff"},red={300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828"},purple={50:"#f3e5f5",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",700:"#7b1fa2"},blue={50:"#e3f2fd",200:"#90caf9",400:"#42a5f5",600:"#1e88e5",700:"#1976d2",800:"#1565c0"},lightBlue={300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",700:"#0288d1",900:"#01579b"},green={100:"#c8e6c9",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20"},orange={300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",900:"#e65100"},grey={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"};function formatMuiErrorMessage(o,..._){const $=new URL(`https://mui.com/production-error/?code=${o}`);return _.forEach(j=>$.searchParams.append("args[]",j)),`Minified MUI error #${o}; visit ${$} for the full message.`}const THEME_ID="$$material";function _extends$k(){return _extends$k=Object.assign?Object.assign.bind():function(o){for(var _=1;_0?charat(characters,--position):0,column--,character===10&&(column=1,line--),character}function next(){return character=position2||token(character)>3?"":" "}function escaping(o,_){for(;--_&&next()&&!(character<48||character>102||character>57&&character<65||character>70&&character<97););return slice$1(o,caret()+(_<6&&peek$2()==32&&next()==32))}function delimiter(o){for(;next();)switch(character){case o:return position;case 34:case 39:o!==34&&o!==39&&delimiter(character);break;case 40:o===41&&delimiter(o);break;case 92:next();break}return position}function commenter(o,_){for(;next()&&o+character!==57;)if(o+character===84&&peek$2()===47)break;return"/*"+slice$1(_,position-1)+"*"+from$2(o===47?o:next())}function identifier(o){for(;!token(peek$2());)next();return slice$1(o,position)}function compile(o){return dealloc(parse$2("",null,null,null,[""],o=alloc(o),0,[0],o))}function parse$2(o,_,$,j,_e,et,tt,rt,nt){for(var ot=0,it=0,st=tt,at=0,lt=0,ct=0,ft=1,dt=1,pt=1,yt=0,vt="",wt=_e,Ct=et,Pt=j,Bt=vt;dt;)switch(ct=yt,yt=next()){case 40:if(ct!=108&&charat(Bt,st-1)==58){indexof(Bt+=replace(delimit(yt),"&","&\f"),"&\f")!=-1&&(pt=-1);break}case 34:case 39:case 91:Bt+=delimit(yt);break;case 9:case 10:case 13:case 32:Bt+=whitespace(ct);break;case 92:Bt+=escaping(caret()-1,7);continue;case 47:switch(peek$2()){case 42:case 47:append$1(comment(commenter(next(),caret()),_,$),nt);break;default:Bt+="/"}break;case 123*ft:rt[ot++]=strlen(Bt)*pt;case 125*ft:case 59:case 0:switch(yt){case 0:case 125:dt=0;case 59+it:pt==-1&&(Bt=replace(Bt,/\f/g,"")),lt>0&&strlen(Bt)-st&&append$1(lt>32?declaration(Bt+";",j,$,st-1):declaration(replace(Bt," ","")+";",j,$,st-2),nt);break;case 59:Bt+=";";default:if(append$1(Pt=ruleset(Bt,_,$,ot,it,_e,rt,vt,wt=[],Ct=[],st),et),yt===123)if(it===0)parse$2(Bt,_,Pt,Pt,wt,et,st,rt,Ct);else switch(at===99&&charat(Bt,3)===110?100:at){case 100:case 108:case 109:case 115:parse$2(o,Pt,Pt,j&&append$1(ruleset(o,Pt,Pt,0,0,_e,rt,vt,_e,wt=[],st),Ct),_e,Ct,st,rt,j?wt:Ct);break;default:parse$2(Bt,Pt,Pt,Pt,[""],Ct,0,rt,Ct)}}ot=it=lt=0,ft=pt=1,vt=Bt="",st=tt;break;case 58:st=1+strlen(Bt),lt=ct;default:if(ft<1){if(yt==123)--ft;else if(yt==125&&ft++==0&&prev()==125)continue}switch(Bt+=from$2(yt),yt*ft){case 38:pt=it>0?1:(Bt+="\f",-1);break;case 44:rt[ot++]=(strlen(Bt)-1)*pt,pt=1;break;case 64:peek$2()===45&&(Bt+=delimit(next())),at=peek$2(),it=st=strlen(vt=Bt+=identifier(caret())),yt++;break;case 45:ct===45&&strlen(Bt)==2&&(ft=0)}}return et}function ruleset(o,_,$,j,_e,et,tt,rt,nt,ot,it){for(var st=_e-1,at=_e===0?et:[""],lt=sizeof(at),ct=0,ft=0,dt=0;ct0?at[pt]+" "+yt:replace(yt,/&\f/g,at[pt])))&&(nt[dt++]=vt);return node$1(o,_,$,_e===0?RULESET:rt,nt,ot,it)}function comment(o,_,$){return node$1(o,_,$,COMMENT,from$2(char()),substr(o,2,-2),0)}function declaration(o,_,$,j){return node$1(o,_,$,DECLARATION,substr(o,0,j),substr(o,j+1,-1),j)}function serialize(o,_){for(var $="",j=sizeof(o),_e=0;_e6)switch(charat(o,_+1)){case 109:if(charat(o,_+4)!==45)break;case 102:return replace(o,/(.+:)(.+)-([^]+)/,"$1"+WEBKIT+"$2-$3$1"+MOZ+(charat(o,_+3)==108?"$3":"$2-$3"))+o;case 115:return~indexof(o,"stretch")?prefix(replace(o,"stretch","fill-available"),_)+o:o}break;case 4949:if(charat(o,_+1)!==115)break;case 6444:switch(charat(o,strlen(o)-3-(~indexof(o,"!important")&&10))){case 107:return replace(o,":",":"+WEBKIT)+o;case 101:return replace(o,/(.+:)([^;!]+)(;|!.+)?/,"$1"+WEBKIT+(charat(o,14)===45?"inline-":"")+"box$3$1"+WEBKIT+"$2$3$1"+MS+"$2box$3")+o}break;case 5936:switch(charat(o,_+11)){case 114:return WEBKIT+o+MS+replace(o,/[svh]\w+-[tblr]{2}/,"tb")+o;case 108:return WEBKIT+o+MS+replace(o,/[svh]\w+-[tblr]{2}/,"tb-rl")+o;case 45:return WEBKIT+o+MS+replace(o,/[svh]\w+-[tblr]{2}/,"lr")+o}return WEBKIT+o+MS+o+o}return o}var prefixer=function(_,$,j,_e){if(_.length>-1&&!_.return)switch(_.type){case DECLARATION:_.return=prefix(_.value,_.length);break;case KEYFRAMES:return serialize([copy$2(_,{value:replace(_.value,"@","@"+WEBKIT)})],_e);case RULESET:if(_.length)return combine(_.props,function(et){switch(match(et,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return serialize([copy$2(_,{props:[replace(et,/:(read-\w+)/,":"+MOZ+"$1")]})],_e);case"::placeholder":return serialize([copy$2(_,{props:[replace(et,/:(plac\w+)/,":"+WEBKIT+"input-$1")]}),copy$2(_,{props:[replace(et,/:(plac\w+)/,":"+MOZ+"$1")]}),copy$2(_,{props:[replace(et,/:(plac\w+)/,MS+"input-$1")]})],_e)}return""})}},defaultStylisPlugins=[prefixer],createCache=function(_){var $=_.key;if($==="css"){var j=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(j,function(ft){var dt=ft.getAttribute("data-emotion");dt.indexOf(" ")!==-1&&(document.head.appendChild(ft),ft.setAttribute("data-s",""))})}var _e=_.stylisPlugins||defaultStylisPlugins,et={},tt,rt=[];tt=_.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+$+' "]'),function(ft){for(var dt=ft.getAttribute("data-emotion").split(" "),pt=1;pt=4;++j,_e-=4)$=o.charCodeAt(j)&255|(o.charCodeAt(++j)&255)<<8|(o.charCodeAt(++j)&255)<<16|(o.charCodeAt(++j)&255)<<24,$=($&65535)*1540483477+(($>>>16)*59797<<16),$^=$>>>24,_=($&65535)*1540483477+(($>>>16)*59797<<16)^(_&65535)*1540483477+((_>>>16)*59797<<16);switch(_e){case 3:_^=(o.charCodeAt(j+2)&255)<<16;case 2:_^=(o.charCodeAt(j+1)&255)<<8;case 1:_^=o.charCodeAt(j)&255,_=(_&65535)*1540483477+((_>>>16)*59797<<16)}return _^=_>>>13,_=(_&65535)*1540483477+((_>>>16)*59797<<16),((_^_>>>15)>>>0).toString(36)}var unitlessKeys={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},hyphenateRegex=/[A-Z]|^ms/g,animationRegex=/_EMO_([^_]+?)_([^]*?)_EMO_/g,isCustomProperty=function(_){return _.charCodeAt(1)===45},isProcessableValue=function(_){return _!=null&&typeof _!="boolean"},processStyleName=memoize$1(function(o){return isCustomProperty(o)?o:o.replace(hyphenateRegex,"-$&").toLowerCase()}),processStyleValue=function(_,$){switch(_){case"animation":case"animationName":if(typeof $=="string")return $.replace(animationRegex,function(j,_e,et){return cursor={name:_e,styles:et,next:cursor},_e})}return unitlessKeys[_]!==1&&!isCustomProperty(_)&&typeof $=="number"&&$!==0?$+"px":$};function handleInterpolation(o,_,$){if($==null)return"";var j=$;if(j.__emotion_styles!==void 0)return j;switch(typeof $){case"boolean":return"";case"object":{var _e=$;if(_e.anim===1)return cursor={name:_e.name,styles:_e.styles,next:cursor},_e.name;var et=$;if(et.styles!==void 0){var tt=et.next;if(tt!==void 0)for(;tt!==void 0;)cursor={name:tt.name,styles:tt.styles,next:cursor},tt=tt.next;var rt=et.styles+";";return rt}return createStringFromObject(o,_,$)}case"function":{if(o!==void 0){var nt=cursor,ot=$(o);return cursor=nt,handleInterpolation(o,_,ot)}break}}var it=$;if(_==null)return it;var st=_[it];return st!==void 0?st:it}function createStringFromObject(o,_,$){var j="";if(Array.isArray($))for(var _e=0;_e<$.length;_e++)j+=handleInterpolation(o,_,$[_e])+";";else for(var et in $){var tt=$[et];if(typeof tt!="object"){var rt=tt;_!=null&&_[rt]!==void 0?j+=et+"{"+_[rt]+"}":isProcessableValue(rt)&&(j+=processStyleName(et)+":"+processStyleValue(et,rt)+";")}else if(Array.isArray(tt)&&typeof tt[0]=="string"&&(_==null||_[tt[0]]===void 0))for(var nt=0;nt96?testOmitPropsOnStringTag:testOmitPropsOnComponent},composeShouldForwardProps=function(_,$,j){var _e;if($){var et=$.shouldForwardProp;_e=_.__emotion_forwardProp&&et?function(tt){return _.__emotion_forwardProp(tt)&&et(tt)}:et}return typeof _e!="function"&&j&&(_e=_.__emotion_forwardProp),_e},Insertion=function(_){var $=_.cache,j=_.serialized,_e=_.isStringTag;return registerStyles($,j,_e),useInsertionEffectAlwaysWithSyncFallback(function(){return insertStyles($,j,_e)}),null},createStyled$1=function o(_,$){var j=_.__emotion_real===_,_e=j&&_.__emotion_base||_,et,tt;$!==void 0&&(et=$.label,tt=$.target);var rt=composeShouldForwardProps(_,$,j),nt=rt||getDefaultShouldForwardProp(_e),ot=!nt("as");return function(){var it=arguments,st=j&&_.__emotion_styles!==void 0?_.__emotion_styles.slice(0):[];if(et!==void 0&&st.push("label:"+et+";"),it[0]==null||it[0].raw===void 0)st.push.apply(st,it);else{var at=it[0];st.push(at[0]);for(var lt=it.length,ct=1;ct_(isEmpty$2(_e)?$:_e):_;return jsxRuntimeExports.jsx(Global$1,{styles:j})}function styled$2(o,_){return styled$3(o,_)}function internal_mutateStyles(o,_){Array.isArray(o.__emotion_styles)&&(o.__emotion_styles=_(o.__emotion_styles))}const wrapper=[];function internal_serializeStyles(o){return wrapper[0]=o,serializeStyles(wrapper)}var reactIs={exports:{}},reactIs_production={};/** - * @license React - * react-is.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var REACT_ELEMENT_TYPE$1=Symbol.for("react.transitional.element"),REACT_PORTAL_TYPE=Symbol.for("react.portal"),REACT_FRAGMENT_TYPE=Symbol.for("react.fragment"),REACT_STRICT_MODE_TYPE=Symbol.for("react.strict_mode"),REACT_PROFILER_TYPE=Symbol.for("react.profiler"),REACT_CONSUMER_TYPE=Symbol.for("react.consumer"),REACT_CONTEXT_TYPE=Symbol.for("react.context"),REACT_FORWARD_REF_TYPE=Symbol.for("react.forward_ref"),REACT_SUSPENSE_TYPE=Symbol.for("react.suspense"),REACT_SUSPENSE_LIST_TYPE=Symbol.for("react.suspense_list"),REACT_MEMO_TYPE=Symbol.for("react.memo"),REACT_LAZY_TYPE$1=Symbol.for("react.lazy"),REACT_VIEW_TRANSITION_TYPE=Symbol.for("react.view_transition"),REACT_CLIENT_REFERENCE=Symbol.for("react.client.reference");function typeOf(o){if(typeof o=="object"&&o!==null){var _=o.$$typeof;switch(_){case REACT_ELEMENT_TYPE$1:switch(o=o.type,o){case REACT_FRAGMENT_TYPE:case REACT_PROFILER_TYPE:case REACT_STRICT_MODE_TYPE:case REACT_SUSPENSE_TYPE:case REACT_SUSPENSE_LIST_TYPE:case REACT_VIEW_TRANSITION_TYPE:return o;default:switch(o=o&&o.$$typeof,o){case REACT_CONTEXT_TYPE:case REACT_FORWARD_REF_TYPE:case REACT_LAZY_TYPE$1:case REACT_MEMO_TYPE:return o;case REACT_CONSUMER_TYPE:return o;default:return _}}case REACT_PORTAL_TYPE:return _}}}reactIs_production.ContextConsumer=REACT_CONSUMER_TYPE;reactIs_production.ContextProvider=REACT_CONTEXT_TYPE;reactIs_production.Element=REACT_ELEMENT_TYPE$1;reactIs_production.ForwardRef=REACT_FORWARD_REF_TYPE;reactIs_production.Fragment=REACT_FRAGMENT_TYPE;reactIs_production.Lazy=REACT_LAZY_TYPE$1;reactIs_production.Memo=REACT_MEMO_TYPE;reactIs_production.Portal=REACT_PORTAL_TYPE;reactIs_production.Profiler=REACT_PROFILER_TYPE;reactIs_production.StrictMode=REACT_STRICT_MODE_TYPE;reactIs_production.Suspense=REACT_SUSPENSE_TYPE;reactIs_production.SuspenseList=REACT_SUSPENSE_LIST_TYPE;reactIs_production.isContextConsumer=function(o){return typeOf(o)===REACT_CONSUMER_TYPE};reactIs_production.isContextProvider=function(o){return typeOf(o)===REACT_CONTEXT_TYPE};reactIs_production.isElement=function(o){return typeof o=="object"&&o!==null&&o.$$typeof===REACT_ELEMENT_TYPE$1};reactIs_production.isForwardRef=function(o){return typeOf(o)===REACT_FORWARD_REF_TYPE};reactIs_production.isFragment=function(o){return typeOf(o)===REACT_FRAGMENT_TYPE};reactIs_production.isLazy=function(o){return typeOf(o)===REACT_LAZY_TYPE$1};reactIs_production.isMemo=function(o){return typeOf(o)===REACT_MEMO_TYPE};reactIs_production.isPortal=function(o){return typeOf(o)===REACT_PORTAL_TYPE};reactIs_production.isProfiler=function(o){return typeOf(o)===REACT_PROFILER_TYPE};reactIs_production.isStrictMode=function(o){return typeOf(o)===REACT_STRICT_MODE_TYPE};reactIs_production.isSuspense=function(o){return typeOf(o)===REACT_SUSPENSE_TYPE};reactIs_production.isSuspenseList=function(o){return typeOf(o)===REACT_SUSPENSE_LIST_TYPE};reactIs_production.isValidElementType=function(o){return typeof o=="string"||typeof o=="function"||o===REACT_FRAGMENT_TYPE||o===REACT_PROFILER_TYPE||o===REACT_STRICT_MODE_TYPE||o===REACT_SUSPENSE_TYPE||o===REACT_SUSPENSE_LIST_TYPE||typeof o=="object"&&o!==null&&(o.$$typeof===REACT_LAZY_TYPE$1||o.$$typeof===REACT_MEMO_TYPE||o.$$typeof===REACT_CONTEXT_TYPE||o.$$typeof===REACT_CONSUMER_TYPE||o.$$typeof===REACT_FORWARD_REF_TYPE||o.$$typeof===REACT_CLIENT_REFERENCE||o.getModuleId!==void 0)};reactIs_production.typeOf=typeOf;reactIs.exports=reactIs_production;var reactIsExports=reactIs.exports;function isPlainObject$7(o){if(typeof o!="object"||o===null)return!1;const _=Object.getPrototypeOf(o);return(_===null||_===Object.prototype||Object.getPrototypeOf(_)===null)&&!(Symbol.toStringTag in o)&&!(Symbol.iterator in o)}function deepClone(o){if(reactExports.isValidElement(o)||reactIsExports.isValidElementType(o)||!isPlainObject$7(o))return o;const _={};return Object.keys(o).forEach($=>{_[$]=deepClone(o[$])}),_}function deepmerge$2(o,_,$={clone:!0}){const j=$.clone?{...o}:o;return isPlainObject$7(o)&&isPlainObject$7(_)&&Object.keys(_).forEach(_e=>{reactExports.isValidElement(_[_e])||reactIsExports.isValidElementType(_[_e])?j[_e]=_[_e]:isPlainObject$7(_[_e])&&Object.prototype.hasOwnProperty.call(o,_e)&&isPlainObject$7(o[_e])?j[_e]=deepmerge$2(o[_e],_[_e],$):$.clone?j[_e]=isPlainObject$7(_[_e])?deepClone(_[_e]):_[_e]:j[_e]=_[_e]}),j}const sortBreakpointsValues=o=>{const _=Object.keys(o).map($=>({key:$,val:o[$]}))||[];return _.sort(($,j)=>$.val-j.val),_.reduce(($,j)=>({...$,[j.key]:j.val}),{})};function createBreakpoints(o){const{values:_={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:$="px",step:j=5,..._e}=o,et=sortBreakpointsValues(_),tt=Object.keys(et);function rt(at){return`@media (min-width:${typeof _[at]=="number"?_[at]:at}${$})`}function nt(at){return`@media (max-width:${(typeof _[at]=="number"?_[at]:at)-j/100}${$})`}function ot(at,lt){const ct=tt.indexOf(lt);return`@media (min-width:${typeof _[at]=="number"?_[at]:at}${$}) and (max-width:${(ct!==-1&&typeof _[tt[ct]]=="number"?_[tt[ct]]:lt)-j/100}${$})`}function it(at){return tt.indexOf(at)+1j.startsWith("@container")).sort((j,_e)=>{var tt,rt;const et=/min-width:\s*([0-9.]+)/;return+(((tt=j.match(et))==null?void 0:tt[1])||0)-+(((rt=_e.match(et))==null?void 0:rt[1])||0)});return $.length?$.reduce((j,_e)=>{const et=_[_e];return delete j[_e],j[_e]=et,j},{..._}):_}function isCqShorthand(o,_){return _==="@"||_.startsWith("@")&&(o.some($=>_.startsWith(`@${$}`))||!!_.match(/^@\d/))}function getContainerQuery(o,_){const $=_.match(/^@([^/]+)?\/?(.+)?$/);if(!$)return null;const[,j,_e]=$,et=Number.isNaN(+j)?j||0:+j;return o.containerQueries(_e).up(et)}function cssContainerQueries(o){const _=(et,tt)=>et.replace("@media",tt?`@container ${tt}`:"@container");function $(et,tt){et.up=(...rt)=>_(o.breakpoints.up(...rt),tt),et.down=(...rt)=>_(o.breakpoints.down(...rt),tt),et.between=(...rt)=>_(o.breakpoints.between(...rt),tt),et.only=(...rt)=>_(o.breakpoints.only(...rt),tt),et.not=(...rt)=>{const nt=_(o.breakpoints.not(...rt),tt);return nt.includes("not all and")?nt.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):nt}}const j={},_e=et=>($(j,et),j);return $(_e),{...o,containerQueries:_e}}const shape={borderRadius:4};function merge(o,_){return _?deepmerge$2(o,_,{clone:!1}):o}const values$1={xs:0,sm:600,md:900,lg:1200,xl:1536},defaultBreakpoints={keys:["xs","sm","md","lg","xl"],up:o=>`@media (min-width:${values$1[o]}px)`},defaultContainerQueries={containerQueries:o=>({up:_=>{let $=typeof _=="number"?_:values$1[_]||_;return typeof $=="number"&&($=`${$}px`),o?`@container ${o} (min-width:${$})`:`@container (min-width:${$})`}})};function handleBreakpoints(o,_,$){const j=o.theme||{};if(Array.isArray(_)){const et=j.breakpoints||defaultBreakpoints;return _.reduce((tt,rt,nt)=>(tt[et.up(et.keys[nt])]=$(_[nt]),tt),{})}if(typeof _=="object"){const et=j.breakpoints||defaultBreakpoints;return Object.keys(_).reduce((tt,rt)=>{if(isCqShorthand(et.keys,rt)){const nt=getContainerQuery(j.containerQueries?j:defaultContainerQueries,rt);nt&&(tt[nt]=$(_[rt],rt))}else if(Object.keys(et.values||values$1).includes(rt)){const nt=et.up(rt);tt[nt]=$(_[rt],rt)}else{const nt=rt;tt[nt]=_[nt]}return tt},{})}return $(_)}function createEmptyBreakpointObject(o={}){var $;return(($=o.keys)==null?void 0:$.reduce((j,_e)=>{const et=o.up(_e);return j[et]={},j},{}))||{}}function removeUnusedBreakpoints(o,_){return o.reduce(($,j)=>{const _e=$[j];return(!_e||Object.keys(_e).length===0)&&delete $[j],$},_)}function mergeBreakpointsInOrder(o,..._){const $=createEmptyBreakpointObject(o),j=[$,..._].reduce((_e,et)=>deepmerge$2(_e,et),{});return removeUnusedBreakpoints(Object.keys($),j)}function computeBreakpointsBase(o,_){if(typeof o!="object")return{};const $={},j=Object.keys(_);return Array.isArray(o)?j.forEach((_e,et)=>{et{o[_e]!=null&&($[_e]=!0)}),$}function resolveBreakpointValues({values:o,breakpoints:_,base:$}){const j=$||computeBreakpointsBase(o,_),_e=Object.keys(j);if(_e.length===0)return o;let et;return _e.reduce((tt,rt,nt)=>(Array.isArray(o)?(tt[rt]=o[nt]!=null?o[nt]:o[et],et=nt):typeof o=="object"?(tt[rt]=o[rt]!=null?o[rt]:o[et],et=rt):tt[rt]=o,tt),{})}function capitalize(o){if(typeof o!="string")throw new Error(formatMuiErrorMessage(7));return o.charAt(0).toUpperCase()+o.slice(1)}function getPath$2(o,_,$=!0){if(!_||typeof _!="string")return null;if(o&&o.vars&&$){const j=`vars.${_}`.split(".").reduce((_e,et)=>_e&&_e[et]?_e[et]:null,o);if(j!=null)return j}return _.split(".").reduce((j,_e)=>j&&j[_e]!=null?j[_e]:null,o)}function getStyleValue$1(o,_,$,j=$){let _e;return typeof o=="function"?_e=o($):Array.isArray(o)?_e=o[$]||j:_e=getPath$2(o,$)||j,_&&(_e=_(_e,j,o)),_e}function style$2(o){const{prop:_,cssProperty:$=o.prop,themeKey:j,transform:_e}=o,et=tt=>{if(tt[_]==null)return null;const rt=tt[_],nt=tt.theme,ot=getPath$2(nt,j)||{};return handleBreakpoints(tt,rt,st=>{let at=getStyleValue$1(ot,_e,st);return st===at&&typeof st=="string"&&(at=getStyleValue$1(ot,_e,`${_}${st==="default"?"":capitalize(st)}`,st)),$===!1?at:{[$]:at}})};return et.propTypes={},et.filterProps=[_],et}function memoize(o){const _={};return $=>(_[$]===void 0&&(_[$]=o($)),_[$])}const properties={m:"margin",p:"padding"},directions={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},aliases={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},getCssProperties=memoize(o=>{if(o.length>2)if(aliases[o])o=aliases[o];else return[o];const[_,$]=o.split(""),j=properties[_],_e=directions[$]||"";return Array.isArray(_e)?_e.map(et=>j+et):[j+_e]}),marginKeys=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],paddingKeys=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...marginKeys,...paddingKeys];function createUnaryUnit(o,_,$,j){const _e=getPath$2(o,_,!0)??$;return typeof _e=="number"||typeof _e=="string"?et=>typeof et=="string"?et:typeof _e=="string"?_e.startsWith("var(")&&et===0?0:_e.startsWith("var(")&&et===1?_e:`calc(${et} * ${_e})`:_e*et:Array.isArray(_e)?et=>{if(typeof et=="string")return et;const tt=Math.abs(et),rt=_e[tt];return et>=0?rt:typeof rt=="number"?-rt:typeof rt=="string"&&rt.startsWith("var(")?`calc(-1 * ${rt})`:`-${rt}`}:typeof _e=="function"?_e:()=>{}}function createUnarySpacing(o){return createUnaryUnit(o,"spacing",8)}function getValue(o,_){return typeof _=="string"||_==null?_:o(_)}function getStyleFromPropValue(o,_){return $=>o.reduce((j,_e)=>(j[_e]=getValue(_,$),j),{})}function resolveCssProperty(o,_,$,j){if(!_.includes($))return null;const _e=getCssProperties($),et=getStyleFromPropValue(_e,j),tt=o[$];return handleBreakpoints(o,tt,et)}function style$1(o,_){const $=createUnarySpacing(o.theme);return Object.keys(o).map(j=>resolveCssProperty(o,_,j,$)).reduce(merge,{})}function margin(o){return style$1(o,marginKeys)}margin.propTypes={};margin.filterProps=marginKeys;function padding(o){return style$1(o,paddingKeys)}padding.propTypes={};padding.filterProps=paddingKeys;function createSpacing(o=8,_=createUnarySpacing({spacing:o})){if(o.mui)return o;const $=(...j)=>(j.length===0?[1]:j).map(et=>{const tt=_(et);return typeof tt=="number"?`${tt}px`:tt}).join(" ");return $.mui=!0,$}function compose$3(...o){const _=o.reduce((j,_e)=>(_e.filterProps.forEach(et=>{j[et]=_e}),j),{}),$=j=>Object.keys(j).reduce((_e,et)=>_[et]?merge(_e,_[et](j)):_e,{});return $.propTypes={},$.filterProps=o.reduce((j,_e)=>j.concat(_e.filterProps),[]),$}function borderTransform(o){return typeof o!="number"?o:`${o}px solid`}function createBorderStyle(o,_){return style$2({prop:o,themeKey:"borders",transform:_})}const border=createBorderStyle("border",borderTransform),borderTop=createBorderStyle("borderTop",borderTransform),borderRight=createBorderStyle("borderRight",borderTransform),borderBottom=createBorderStyle("borderBottom",borderTransform),borderLeft=createBorderStyle("borderLeft",borderTransform),borderColor=createBorderStyle("borderColor"),borderTopColor=createBorderStyle("borderTopColor"),borderRightColor=createBorderStyle("borderRightColor"),borderBottomColor=createBorderStyle("borderBottomColor"),borderLeftColor=createBorderStyle("borderLeftColor"),outline=createBorderStyle("outline",borderTransform),outlineColor=createBorderStyle("outlineColor"),borderRadius=o=>{if(o.borderRadius!==void 0&&o.borderRadius!==null){const _=createUnaryUnit(o.theme,"shape.borderRadius",4),$=j=>({borderRadius:getValue(_,j)});return handleBreakpoints(o,o.borderRadius,$)}return null};borderRadius.propTypes={};borderRadius.filterProps=["borderRadius"];compose$3(border,borderTop,borderRight,borderBottom,borderLeft,borderColor,borderTopColor,borderRightColor,borderBottomColor,borderLeftColor,borderRadius,outline,outlineColor);const gap=o=>{if(o.gap!==void 0&&o.gap!==null){const _=createUnaryUnit(o.theme,"spacing",8),$=j=>({gap:getValue(_,j)});return handleBreakpoints(o,o.gap,$)}return null};gap.propTypes={};gap.filterProps=["gap"];const columnGap=o=>{if(o.columnGap!==void 0&&o.columnGap!==null){const _=createUnaryUnit(o.theme,"spacing",8),$=j=>({columnGap:getValue(_,j)});return handleBreakpoints(o,o.columnGap,$)}return null};columnGap.propTypes={};columnGap.filterProps=["columnGap"];const rowGap=o=>{if(o.rowGap!==void 0&&o.rowGap!==null){const _=createUnaryUnit(o.theme,"spacing",8),$=j=>({rowGap:getValue(_,j)});return handleBreakpoints(o,o.rowGap,$)}return null};rowGap.propTypes={};rowGap.filterProps=["rowGap"];const gridColumn=style$2({prop:"gridColumn"}),gridRow=style$2({prop:"gridRow"}),gridAutoFlow=style$2({prop:"gridAutoFlow"}),gridAutoColumns=style$2({prop:"gridAutoColumns"}),gridAutoRows=style$2({prop:"gridAutoRows"}),gridTemplateColumns=style$2({prop:"gridTemplateColumns"}),gridTemplateRows=style$2({prop:"gridTemplateRows"}),gridTemplateAreas=style$2({prop:"gridTemplateAreas"}),gridArea=style$2({prop:"gridArea"});compose$3(gap,columnGap,rowGap,gridColumn,gridRow,gridAutoFlow,gridAutoColumns,gridAutoRows,gridTemplateColumns,gridTemplateRows,gridTemplateAreas,gridArea);function paletteTransform(o,_){return _==="grey"?_:o}const color$1=style$2({prop:"color",themeKey:"palette",transform:paletteTransform}),bgcolor=style$2({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:paletteTransform}),backgroundColor=style$2({prop:"backgroundColor",themeKey:"palette",transform:paletteTransform});compose$3(color$1,bgcolor,backgroundColor);function sizingTransform(o){return o<=1&&o!==0?`${o*100}%`:o}const width=style$2({prop:"width",transform:sizingTransform}),maxWidth=o=>{if(o.maxWidth!==void 0&&o.maxWidth!==null){const _=$=>{var _e,et,tt,rt,nt;const j=((tt=(et=(_e=o.theme)==null?void 0:_e.breakpoints)==null?void 0:et.values)==null?void 0:tt[$])||values$1[$];return j?((nt=(rt=o.theme)==null?void 0:rt.breakpoints)==null?void 0:nt.unit)!=="px"?{maxWidth:`${j}${o.theme.breakpoints.unit}`}:{maxWidth:j}:{maxWidth:sizingTransform($)}};return handleBreakpoints(o,o.maxWidth,_)}return null};maxWidth.filterProps=["maxWidth"];const minWidth=style$2({prop:"minWidth",transform:sizingTransform}),height=style$2({prop:"height",transform:sizingTransform}),maxHeight=style$2({prop:"maxHeight",transform:sizingTransform}),minHeight=style$2({prop:"minHeight",transform:sizingTransform});style$2({prop:"size",cssProperty:"width",transform:sizingTransform});style$2({prop:"size",cssProperty:"height",transform:sizingTransform});const boxSizing=style$2({prop:"boxSizing"});compose$3(width,maxWidth,minWidth,height,maxHeight,minHeight,boxSizing);const defaultSxConfig={border:{themeKey:"borders",transform:borderTransform},borderTop:{themeKey:"borders",transform:borderTransform},borderRight:{themeKey:"borders",transform:borderTransform},borderBottom:{themeKey:"borders",transform:borderTransform},borderLeft:{themeKey:"borders",transform:borderTransform},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:borderTransform},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:borderRadius},color:{themeKey:"palette",transform:paletteTransform},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:paletteTransform},backgroundColor:{themeKey:"palette",transform:paletteTransform},p:{style:padding},pt:{style:padding},pr:{style:padding},pb:{style:padding},pl:{style:padding},px:{style:padding},py:{style:padding},padding:{style:padding},paddingTop:{style:padding},paddingRight:{style:padding},paddingBottom:{style:padding},paddingLeft:{style:padding},paddingX:{style:padding},paddingY:{style:padding},paddingInline:{style:padding},paddingInlineStart:{style:padding},paddingInlineEnd:{style:padding},paddingBlock:{style:padding},paddingBlockStart:{style:padding},paddingBlockEnd:{style:padding},m:{style:margin},mt:{style:margin},mr:{style:margin},mb:{style:margin},ml:{style:margin},mx:{style:margin},my:{style:margin},margin:{style:margin},marginTop:{style:margin},marginRight:{style:margin},marginBottom:{style:margin},marginLeft:{style:margin},marginX:{style:margin},marginY:{style:margin},marginInline:{style:margin},marginInlineStart:{style:margin},marginInlineEnd:{style:margin},marginBlock:{style:margin},marginBlockStart:{style:margin},marginBlockEnd:{style:margin},displayPrint:{cssProperty:!1,transform:o=>({"@media print":{display:o}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:gap},rowGap:{style:rowGap},columnGap:{style:columnGap},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:sizingTransform},maxWidth:{style:maxWidth},minWidth:{transform:sizingTransform},height:{transform:sizingTransform},maxHeight:{transform:sizingTransform},minHeight:{transform:sizingTransform},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function objectsHaveSameKeys(...o){const _=o.reduce((j,_e)=>j.concat(Object.keys(_e)),[]),$=new Set(_);return o.every(j=>$.size===Object.keys(j).length)}function callIfFn(o,_){return typeof o=="function"?o(_):o}function unstable_createStyleFunctionSx(){function o($,j,_e,et){const tt={[$]:j,theme:_e},rt=et[$];if(!rt)return{[$]:j};const{cssProperty:nt=$,themeKey:ot,transform:it,style:st}=rt;if(j==null)return null;if(ot==="typography"&&j==="inherit")return{[$]:j};const at=getPath$2(_e,ot)||{};return st?st(tt):handleBreakpoints(tt,j,ct=>{let ft=getStyleValue$1(at,it,ct);return ct===ft&&typeof ct=="string"&&(ft=getStyleValue$1(at,it,`${$}${ct==="default"?"":capitalize(ct)}`,ct)),nt===!1?ft:{[nt]:ft}})}function _($){const{sx:j,theme:_e={},nested:et}=$||{};if(!j)return null;const tt=_e.unstable_sxConfig??defaultSxConfig;function rt(nt){let ot=nt;if(typeof nt=="function")ot=nt(_e);else if(typeof nt!="object")return nt;if(!ot)return null;const it=createEmptyBreakpointObject(_e.breakpoints),st=Object.keys(it);let at=it;return Object.keys(ot).forEach(lt=>{const ct=callIfFn(ot[lt],_e);if(ct!=null)if(typeof ct=="object")if(tt[lt])at=merge(at,o(lt,ct,_e,tt));else{const ft=handleBreakpoints({theme:_e},ct,dt=>({[lt]:dt}));objectsHaveSameKeys(ft,ct)?at[lt]=_({sx:ct,theme:_e,nested:!0}):at=merge(at,ft)}else at=merge(at,o(lt,ct,_e,tt))}),!et&&_e.modularCssLayers?{"@layer sx":sortContainerQueries(_e,removeUnusedBreakpoints(st,at))}:sortContainerQueries(_e,removeUnusedBreakpoints(st,at))}return Array.isArray(j)?j.map(rt):rt(j)}return _}const styleFunctionSx=unstable_createStyleFunctionSx();styleFunctionSx.filterProps=["sx"];function applyStyles$2(o,_){var j;const $=this;if($.vars){if(!((j=$.colorSchemes)!=null&&j[o])||typeof $.getColorSchemeSelector!="function")return{};let _e=$.getColorSchemeSelector(o);return _e==="&"?_:((_e.includes("data-")||_e.includes("."))&&(_e=`*:where(${_e.replace(/\s*&$/,"")}) &`),{[_e]:_})}return $.palette.mode===o?_:{}}function createTheme$1(o={},..._){const{breakpoints:$={},palette:j={},spacing:_e,shape:et={},...tt}=o,rt=createBreakpoints($),nt=createSpacing(_e);let ot=deepmerge$2({breakpoints:rt,direction:"ltr",components:{},palette:{mode:"light",...j},spacing:nt,shape:{...shape,...et}},tt);return ot=cssContainerQueries(ot),ot.applyStyles=applyStyles$2,ot=_.reduce((it,st)=>deepmerge$2(it,st),ot),ot.unstable_sxConfig={...defaultSxConfig,...tt==null?void 0:tt.unstable_sxConfig},ot.unstable_sx=function(st){return styleFunctionSx({sx:st,theme:this})},ot}function isObjectEmpty$2(o){return Object.keys(o).length===0}function useTheme$3(o=null){const _=reactExports.useContext(ThemeContext$1);return!_||isObjectEmpty$2(_)?o:_}const systemDefaultTheme$1=createTheme$1();function useTheme$2(o=systemDefaultTheme$1){return useTheme$3(o)}function wrapGlobalLayer(o){const _=internal_serializeStyles(o);return o!==_&&_.styles?(_.styles.match(/^@layer\s+[^{]*$/)||(_.styles=`@layer global{${_.styles}}`),_):o}function GlobalStyles$2({styles:o,themeId:_,defaultTheme:$={}}){const j=useTheme$2($),_e=_&&j[_]||j;let et=typeof o=="function"?o(_e):o;return _e.modularCssLayers&&(Array.isArray(et)?et=et.map(tt=>wrapGlobalLayer(typeof tt=="function"?tt(_e):tt)):et=wrapGlobalLayer(et)),jsxRuntimeExports.jsx(GlobalStyles$3,{styles:et})}const splitProps=o=>{var j;const _={systemProps:{},otherProps:{}},$=((j=o==null?void 0:o.theme)==null?void 0:j.unstable_sxConfig)??defaultSxConfig;return Object.keys(o).forEach(_e=>{$[_e]?_.systemProps[_e]=o[_e]:_.otherProps[_e]=o[_e]}),_};function extendSxProp$1(o){const{sx:_,...$}=o,{systemProps:j,otherProps:_e}=splitProps($);let et;return Array.isArray(_)?et=[j,..._]:typeof _=="function"?et=(...tt)=>{const rt=_(...tt);return isPlainObject$7(rt)?{...j,...rt}:j}:et={...j,..._},{..._e,sx:et}}const defaultGenerator=o=>o,createClassNameGenerator=()=>{let o=defaultGenerator;return{configure(_){o=_},generate(_){return o(_)},reset(){o=defaultGenerator}}},ClassNameGenerator=createClassNameGenerator();function r$1(o){var _,$,j="";if(typeof o=="string"||typeof o=="number")j+=o;else if(typeof o=="object")if(Array.isArray(o)){var _e=o.length;for(_=0;_<_e;_++)o[_]&&($=r$1(o[_]))&&(j&&(j+=" "),j+=$)}else for($ in o)o[$]&&(j&&(j+=" "),j+=$);return j}function clsx(){for(var o,_,$=0,j="",_e=arguments.length;$<_e;$++)(o=arguments[$])&&(_=r$1(o))&&(j&&(j+=" "),j+=_);return j}function createBox(o={}){const{themeId:_,defaultTheme:$,defaultClassName:j="MuiBox-root",generateClassName:_e}=o,et=styled$2("div",{shouldForwardProp:rt=>rt!=="theme"&&rt!=="sx"&&rt!=="as"})(styleFunctionSx);return reactExports.forwardRef(function(nt,ot){const it=useTheme$2($),{className:st,component:at="div",...lt}=extendSxProp$1(nt);return jsxRuntimeExports.jsx(et,{as:at,ref:ot,className:clsx(st,_e?_e(j):j),theme:_&&it[_]||it,...lt})})}const globalStateClasses={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function generateUtilityClass(o,_,$="Mui"){const j=globalStateClasses[_];return j?`${$}-${j}`:`${ClassNameGenerator.generate(o)}-${_}`}function generateUtilityClasses(o,_,$="Mui"){const j={};return _.forEach(_e=>{j[_e]=generateUtilityClass(o,_e,$)}),j}function preprocessStyles(o){const{variants:_,...$}=o,j={variants:_,style:internal_serializeStyles($),isProcessed:!0};return j.style===$||_&&_.forEach(_e=>{typeof _e.style!="function"&&(_e.style=internal_serializeStyles(_e.style))}),j}const systemDefaultTheme=createTheme$1();function shouldForwardProp(o){return o!=="ownerState"&&o!=="theme"&&o!=="sx"&&o!=="as"}function shallowLayer(o,_){return _&&o&&typeof o=="object"&&o.styles&&!o.styles.startsWith("@layer")&&(o.styles=`@layer ${_}{${String(o.styles)}}`),o}function defaultOverridesResolver(o){return o?(_,$)=>$[o]:null}function attachTheme(o,_,$){o.theme=isObjectEmpty$1(o.theme)?$:o.theme[_]||o.theme}function processStyle(o,_,$){const j=typeof _=="function"?_(o):_;if(Array.isArray(j))return j.flatMap(_e=>processStyle(o,_e,$));if(Array.isArray(j==null?void 0:j.variants)){let _e;if(j.isProcessed)_e=$?shallowLayer(j.style,$):j.style;else{const{variants:et,...tt}=j;_e=$?shallowLayer(internal_serializeStyles(tt),$):tt}return processStyleVariants(o,j.variants,[_e],$)}return j!=null&&j.isProcessed?$?shallowLayer(internal_serializeStyles(j.style),$):j.style:$?shallowLayer(internal_serializeStyles(j),$):j}function processStyleVariants(o,_,$=[],j=void 0){var et;let _e;e:for(let tt=0;tt<_.length;tt+=1){const rt=_[tt];if(typeof rt.props=="function"){if(_e??(_e={...o,...o.ownerState,ownerState:o.ownerState}),!rt.props(_e))continue}else for(const nt in rt.props)if(o[nt]!==rt.props[nt]&&((et=o.ownerState)==null?void 0:et[nt])!==rt.props[nt])continue e;typeof rt.style=="function"?(_e??(_e={...o,...o.ownerState,ownerState:o.ownerState}),$.push(j?shallowLayer(internal_serializeStyles(rt.style(_e)),j):rt.style(_e))):$.push(j?shallowLayer(internal_serializeStyles(rt.style),j):rt.style)}return $}function createStyled(o={}){const{themeId:_,defaultTheme:$=systemDefaultTheme,rootShouldForwardProp:j=shouldForwardProp,slotShouldForwardProp:_e=shouldForwardProp}=o;function et(rt){attachTheme(rt,_,$)}return(rt,nt={})=>{internal_mutateStyles(rt,Pt=>Pt.filter(Bt=>Bt!==styleFunctionSx));const{name:ot,slot:it,skipVariantsResolver:st,skipSx:at,overridesResolver:lt=defaultOverridesResolver(lowercaseFirstLetter(it)),...ct}=nt,ft=ot&&ot.startsWith("Mui")||it?"components":"custom",dt=st!==void 0?st:it&&it!=="Root"&&it!=="root"||!1,pt=at||!1;let yt=shouldForwardProp;it==="Root"||it==="root"?yt=j:it?yt=_e:isStringTag(rt)&&(yt=void 0);const vt=styled$2(rt,{shouldForwardProp:yt,label:generateStyledLabel(),...ct}),wt=Pt=>{if(Pt.__emotion_real===Pt)return Pt;if(typeof Pt=="function")return function(At){return processStyle(At,Pt,At.theme.modularCssLayers?ft:void 0)};if(isPlainObject$7(Pt)){const Bt=preprocessStyles(Pt);return function(kt){return Bt.variants?processStyle(kt,Bt,kt.theme.modularCssLayers?ft:void 0):kt.theme.modularCssLayers?shallowLayer(Bt.style,ft):Bt.style}}return Pt},Ct=(...Pt)=>{const Bt=[],At=Pt.map(wt),kt=[];if(Bt.push(et),ot&<&&kt.push(function(bt){var Et,_t;const gt=(_t=(Et=bt.theme.components)==null?void 0:Et[ot])==null?void 0:_t.styleOverrides;if(!gt)return null;const xt={};for(const $t in gt)xt[$t]=processStyle(bt,gt[$t],bt.theme.modularCssLayers?"theme":void 0);return lt(bt,xt)}),ot&&!dt&&kt.push(function(bt){var xt,Et;const mt=bt.theme,gt=(Et=(xt=mt==null?void 0:mt.components)==null?void 0:xt[ot])==null?void 0:Et.variants;return gt?processStyleVariants(bt,gt,[],bt.theme.modularCssLayers?"theme":void 0):null}),pt||kt.push(styleFunctionSx),Array.isArray(At[0])){const ht=At.shift(),bt=new Array(Bt.length).fill(""),mt=new Array(kt.length).fill("");let gt;gt=[...bt,...ht,...mt],gt.raw=[...bt,...ht.raw,...mt],Bt.unshift(gt)}const Ot=[...Bt,...At,...kt],Tt=vt(...Ot);return rt.muiName&&(Tt.muiName=rt.muiName),Tt};return vt.withConfig&&(Ct.withConfig=vt.withConfig),Ct}}function generateStyledLabel(o,_){return void 0}function isObjectEmpty$1(o){for(const _ in o)return!1;return!0}function isStringTag(o){return typeof o=="string"&&o.charCodeAt(0)>96}function lowercaseFirstLetter(o){return o&&o.charAt(0).toLowerCase()+o.slice(1)}const styled$1=createStyled();function resolveProps(o,_,$=!1){const j={..._};for(const _e in o)if(Object.prototype.hasOwnProperty.call(o,_e)){const et=_e;if(et==="components"||et==="slots")j[et]={...o[et],...j[et]};else if(et==="componentsProps"||et==="slotProps"){const tt=o[et],rt=_[et];if(!rt)j[et]=tt||{};else if(!tt)j[et]=rt;else{j[et]={...rt};for(const nt in tt)if(Object.prototype.hasOwnProperty.call(tt,nt)){const ot=nt;j[et][ot]=resolveProps(tt[ot],rt[ot],$)}}}else et==="className"&&$&&_.className?j.className=clsx(o==null?void 0:o.className,_==null?void 0:_.className):et==="style"&&$&&_.style?j.style={...o==null?void 0:o.style,..._==null?void 0:_.style}:j[et]===void 0&&(j[et]=o[et])}return j}function getThemeProps$1(o){const{theme:_,name:$,props:j}=o;return!_||!_.components||!_.components[$]||!_.components[$].defaultProps?j:resolveProps(_.components[$].defaultProps,j)}function useThemeProps({props:o,name:_,defaultTheme:$,themeId:j}){let _e=useTheme$2($);return j&&(_e=_e[j]||_e),getThemeProps$1({theme:_e,name:_,props:o})}const useEnhancedEffect=typeof window<"u"?reactExports.useLayoutEffect:reactExports.useEffect;function clamp(o,_=Number.MIN_SAFE_INTEGER,$=Number.MAX_SAFE_INTEGER){return Math.max(_,Math.min(o,$))}function clampWrapper(o,_=0,$=1){return clamp(o,_,$)}function hexToRgb(o){o=o.slice(1);const _=new RegExp(`.{1,${o.length>=6?2:1}}`,"g");let $=o.match(_);return $&&$[0].length===1&&($=$.map(j=>j+j)),$?`rgb${$.length===4?"a":""}(${$.map((j,_e)=>_e<3?parseInt(j,16):Math.round(parseInt(j,16)/255*1e3)/1e3).join(", ")})`:""}function decomposeColor(o){if(o.type)return o;if(o.charAt(0)==="#")return decomposeColor(hexToRgb(o));const _=o.indexOf("("),$=o.substring(0,_);if(!["rgb","rgba","hsl","hsla","color"].includes($))throw new Error(formatMuiErrorMessage(9,o));let j=o.substring(_+1,o.length-1),_e;if($==="color"){if(j=j.split(" "),_e=j.shift(),j.length===4&&j[3].charAt(0)==="/"&&(j[3]=j[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(_e))throw new Error(formatMuiErrorMessage(10,_e))}else j=j.split(",");return j=j.map(et=>parseFloat(et)),{type:$,values:j,colorSpace:_e}}const colorChannel=o=>{const _=decomposeColor(o);return _.values.slice(0,3).map(($,j)=>_.type.includes("hsl")&&j!==0?`${$}%`:$).join(" ")},private_safeColorChannel=(o,_)=>{try{return colorChannel(o)}catch{return o}};function recomposeColor(o){const{type:_,colorSpace:$}=o;let{values:j}=o;return _.includes("rgb")?j=j.map((_e,et)=>et<3?parseInt(_e,10):_e):_.includes("hsl")&&(j[1]=`${j[1]}%`,j[2]=`${j[2]}%`),_.includes("color")?j=`${$} ${j.join(" ")}`:j=`${j.join(", ")}`,`${_}(${j})`}function hslToRgb(o){o=decomposeColor(o);const{values:_}=o,$=_[0],j=_[1]/100,_e=_[2]/100,et=j*Math.min(_e,1-_e),tt=(ot,it=(ot+$/30)%12)=>_e-et*Math.max(Math.min(it-3,9-it,1),-1);let rt="rgb";const nt=[Math.round(tt(0)*255),Math.round(tt(8)*255),Math.round(tt(4)*255)];return o.type==="hsla"&&(rt+="a",nt.push(_[3])),recomposeColor({type:rt,values:nt})}function getLuminance(o){o=decomposeColor(o);let _=o.type==="hsl"||o.type==="hsla"?decomposeColor(hslToRgb(o)).values:o.values;return _=_.map($=>(o.type!=="color"&&($/=255),$<=.03928?$/12.92:(($+.055)/1.055)**2.4)),Number((.2126*_[0]+.7152*_[1]+.0722*_[2]).toFixed(3))}function getContrastRatio(o,_){const $=getLuminance(o),j=getLuminance(_);return(Math.max($,j)+.05)/(Math.min($,j)+.05)}function alpha$1(o,_){return o=decomposeColor(o),_=clampWrapper(_),(o.type==="rgb"||o.type==="hsl")&&(o.type+="a"),o.type==="color"?o.values[3]=`/${_}`:o.values[3]=_,recomposeColor(o)}function private_safeAlpha(o,_,$){try{return alpha$1(o,_)}catch{return o}}function darken(o,_){if(o=decomposeColor(o),_=clampWrapper(_),o.type.includes("hsl"))o.values[2]*=1-_;else if(o.type.includes("rgb")||o.type.includes("color"))for(let $=0;$<3;$+=1)o.values[$]*=1-_;return recomposeColor(o)}function private_safeDarken(o,_,$){try{return darken(o,_)}catch{return o}}function lighten(o,_){if(o=decomposeColor(o),_=clampWrapper(_),o.type.includes("hsl"))o.values[2]+=(100-o.values[2])*_;else if(o.type.includes("rgb"))for(let $=0;$<3;$+=1)o.values[$]+=(255-o.values[$])*_;else if(o.type.includes("color"))for(let $=0;$<3;$+=1)o.values[$]+=(1-o.values[$])*_;return recomposeColor(o)}function private_safeLighten(o,_,$){try{return lighten(o,_)}catch{return o}}function emphasize(o,_=.15){return getLuminance(o)>.5?darken(o,_):lighten(o,_)}function private_safeEmphasize(o,_,$){try{return emphasize(o,_)}catch{return o}}const ThemeContext=reactExports.createContext(null);function useTheme$1(){return reactExports.useContext(ThemeContext)}const hasSymbol=typeof Symbol=="function"&&Symbol.for,nested=hasSymbol?Symbol.for("mui.nested"):"__THEME_NESTED__";function mergeOuterLocalTheme(o,_){return typeof _=="function"?_(o):{...o,..._}}function ThemeProvider$3(o){const{children:_,theme:$}=o,j=useTheme$1(),_e=reactExports.useMemo(()=>{const et=j===null?{...$}:mergeOuterLocalTheme(j,$);return et!=null&&(et[nested]=j!==null),et},[$,j]);return jsxRuntimeExports.jsx(ThemeContext.Provider,{value:_e,children:_})}const RtlContext=reactExports.createContext();function RtlProvider({value:o,..._}){return jsxRuntimeExports.jsx(RtlContext.Provider,{value:o??!0,..._})}const useRtl=()=>reactExports.useContext(RtlContext)??!1,PropsContext=reactExports.createContext(void 0);function DefaultPropsProvider({value:o,children:_}){return jsxRuntimeExports.jsx(PropsContext.Provider,{value:o,children:_})}function getThemeProps(o){const{theme:_,name:$,props:j}=o;if(!_||!_.components||!_.components[$])return j;const _e=_.components[$];return _e.defaultProps?resolveProps(_e.defaultProps,j,_.components.mergeClassNameAndStyle):!_e.styleOverrides&&!_e.variants?resolveProps(_e,j,_.components.mergeClassNameAndStyle):j}function useDefaultProps$1({props:o,name:_}){const $=reactExports.useContext(PropsContext);return getThemeProps({props:o,name:_,theme:{components:$}})}let globalId=0;function useGlobalId(o){const[_,$]=reactExports.useState(o),j=o||_;return reactExports.useEffect(()=>{_==null&&(globalId+=1,$(`mui-${globalId}`))},[_]),j}const safeReact={...React$4},maybeReactUseId=safeReact.useId;function useId$1(o){if(maybeReactUseId!==void 0){const _=maybeReactUseId();return o??_}return useGlobalId(o)}function useLayerOrder(o){const _=useTheme$3(),$=useId$1()||"",{modularCssLayers:j}=o;let _e="mui.global, mui.components, mui.theme, mui.custom, mui.sx";return!j||_!==null?_e="":typeof j=="string"?_e=j.replace(/mui(?!\.)/g,_e):_e=`@layer ${_e};`,useEnhancedEffect(()=>{var rt,nt;const et=document.querySelector("head");if(!et)return;const tt=et.firstChild;if(_e){if(tt&&((rt=tt.hasAttribute)!=null&&rt.call(tt,"data-mui-layer-order"))&&tt.getAttribute("data-mui-layer-order")===$)return;const ot=document.createElement("style");ot.setAttribute("data-mui-layer-order",$),ot.textContent=_e,et.prepend(ot)}else(nt=et.querySelector(`style[data-mui-layer-order="${$}"]`))==null||nt.remove()},[_e,$]),_e?jsxRuntimeExports.jsx(GlobalStyles$2,{styles:_e}):null}const EMPTY_THEME={};function useThemeScoping(o,_,$,j=!1){return reactExports.useMemo(()=>{const _e=o&&_[o]||_;if(typeof $=="function"){const et=$(_e),tt=o?{..._,[o]:et}:et;return j?()=>tt:tt}return o?{..._,[o]:$}:{..._,...$}},[o,_,$,j])}function ThemeProvider$2(o){const{children:_,theme:$,themeId:j}=o,_e=useTheme$3(EMPTY_THEME),et=useTheme$1()||EMPTY_THEME,tt=useThemeScoping(j,_e,$),rt=useThemeScoping(j,et,$,!0),nt=(j?tt[j]:tt).direction==="rtl",ot=useLayerOrder(tt);return jsxRuntimeExports.jsx(ThemeProvider$3,{theme:rt,children:jsxRuntimeExports.jsx(ThemeContext$1.Provider,{value:tt,children:jsxRuntimeExports.jsx(RtlProvider,{value:nt,children:jsxRuntimeExports.jsxs(DefaultPropsProvider,{value:j?tt[j].components:tt.components,children:[ot,_]})})})})}const arg={theme:void 0};function unstable_memoTheme(o){let _,$;return function(_e){let et=_;return(et===void 0||_e.theme!==$)&&(arg.theme=_e.theme,et=preprocessStyles(o(arg)),_=et,$=_e.theme),et}}const DEFAULT_MODE_STORAGE_KEY="mode",DEFAULT_COLOR_SCHEME_STORAGE_KEY="color-scheme",DEFAULT_ATTRIBUTE="data-color-scheme";function InitColorSchemeScript(o){const{defaultMode:_="system",defaultLightColorScheme:$="light",defaultDarkColorScheme:j="dark",modeStorageKey:_e=DEFAULT_MODE_STORAGE_KEY,colorSchemeStorageKey:et=DEFAULT_COLOR_SCHEME_STORAGE_KEY,attribute:tt=DEFAULT_ATTRIBUTE,colorSchemeNode:rt="document.documentElement",nonce:nt}=o||{};let ot="",it=tt;if(tt==="class"&&(it=".%s"),tt==="data"&&(it="[data-%s]"),it.startsWith(".")){const at=it.substring(1);ot+=`${rt}.classList.remove('${at}'.replace('%s', light), '${at}'.replace('%s', dark)); - ${rt}.classList.add('${at}'.replace('%s', colorScheme));`}const st=it.match(/\[([^[\]]+)\]/);if(st){const[at,lt]=st[1].split("=");lt||(ot+=`${rt}.removeAttribute('${at}'.replace('%s', light)); - ${rt}.removeAttribute('${at}'.replace('%s', dark));`),ot+=` - ${rt}.setAttribute('${at}'.replace('%s', colorScheme), ${lt?`${lt}.replace('%s', colorScheme)`:'""'});`}else it!==".%s"&&(ot+=`${rt}.setAttribute('${it}', colorScheme);`);return jsxRuntimeExports.jsx("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?nt:"",dangerouslySetInnerHTML:{__html:`(function() { -try { - let colorScheme = ''; - const mode = localStorage.getItem('${_e}') || '${_}'; - const dark = localStorage.getItem('${et}-dark') || '${j}'; - const light = localStorage.getItem('${et}-light') || '${$}'; - if (mode === 'system') { - // handle system mode - const mql = window.matchMedia('(prefers-color-scheme: dark)'); - if (mql.matches) { - colorScheme = dark - } else { - colorScheme = light - } - } - if (mode === 'light') { - colorScheme = light; - } - if (mode === 'dark') { - colorScheme = dark; - } - if (colorScheme) { - ${ot} - } -} catch(e){}})();`}},"mui-color-scheme-init")}function noop$8(){}const localStorageManager=({key:o,storageWindow:_})=>(!_&&typeof window<"u"&&(_=window),{get($){if(typeof window>"u")return;if(!_)return $;let j;try{j=_.localStorage.getItem(o)}catch{}return j||$},set:$=>{if(_)try{_.localStorage.setItem(o,$)}catch{}},subscribe:$=>{if(!_)return noop$8;const j=_e=>{const et=_e.newValue;_e.key===o&&$(et)};return _.addEventListener("storage",j),()=>{_.removeEventListener("storage",j)}}});function noop$7(){}function getSystemMode(o){if(typeof window<"u"&&typeof window.matchMedia=="function"&&o==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function processState(o,_){if(o.mode==="light"||o.mode==="system"&&o.systemMode==="light")return _("light");if(o.mode==="dark"||o.mode==="system"&&o.systemMode==="dark")return _("dark")}function getColorScheme(o){return processState(o,_=>{if(_==="light")return o.lightColorScheme;if(_==="dark")return o.darkColorScheme})}function useCurrentColorScheme(o){const{defaultMode:_="light",defaultLightColorScheme:$,defaultDarkColorScheme:j,supportedColorSchemes:_e=[],modeStorageKey:et=DEFAULT_MODE_STORAGE_KEY,colorSchemeStorageKey:tt=DEFAULT_COLOR_SCHEME_STORAGE_KEY,storageWindow:rt=typeof window>"u"?void 0:window,storageManager:nt=localStorageManager,noSsr:ot=!1}=o,it=_e.join(","),st=_e.length>1,at=reactExports.useMemo(()=>nt==null?void 0:nt({key:et,storageWindow:rt}),[nt,et,rt]),lt=reactExports.useMemo(()=>nt==null?void 0:nt({key:`${tt}-light`,storageWindow:rt}),[nt,tt,rt]),ct=reactExports.useMemo(()=>nt==null?void 0:nt({key:`${tt}-dark`,storageWindow:rt}),[nt,tt,rt]),[ft,dt]=reactExports.useState(()=>{const At=(at==null?void 0:at.get(_))||_,kt=(lt==null?void 0:lt.get($))||$,Ot=(ct==null?void 0:ct.get(j))||j;return{mode:At,systemMode:getSystemMode(At),lightColorScheme:kt,darkColorScheme:Ot}}),[pt,yt]=reactExports.useState(ot||!st);reactExports.useEffect(()=>{yt(!0)},[]);const vt=getColorScheme(ft),wt=reactExports.useCallback(At=>{dt(kt=>{if(At===kt.mode)return kt;const Ot=At??_;return at==null||at.set(Ot),{...kt,mode:Ot,systemMode:getSystemMode(Ot)}})},[at,_]),Ct=reactExports.useCallback(At=>{At?typeof At=="string"?At&&!it.includes(At)?console.error(`\`${At}\` does not exist in \`theme.colorSchemes\`.`):dt(kt=>{const Ot={...kt};return processState(kt,Tt=>{Tt==="light"&&(lt==null||lt.set(At),Ot.lightColorScheme=At),Tt==="dark"&&(ct==null||ct.set(At),Ot.darkColorScheme=At)}),Ot}):dt(kt=>{const Ot={...kt},Tt=At.light===null?$:At.light,ht=At.dark===null?j:At.dark;return Tt&&(it.includes(Tt)?(Ot.lightColorScheme=Tt,lt==null||lt.set(Tt)):console.error(`\`${Tt}\` does not exist in \`theme.colorSchemes\`.`)),ht&&(it.includes(ht)?(Ot.darkColorScheme=ht,ct==null||ct.set(ht)):console.error(`\`${ht}\` does not exist in \`theme.colorSchemes\`.`)),Ot}):dt(kt=>(lt==null||lt.set($),ct==null||ct.set(j),{...kt,lightColorScheme:$,darkColorScheme:j}))},[it,lt,ct,$,j]),Pt=reactExports.useCallback(At=>{ft.mode==="system"&&dt(kt=>{const Ot=At!=null&&At.matches?"dark":"light";return kt.systemMode===Ot?kt:{...kt,systemMode:Ot}})},[ft.mode]),Bt=reactExports.useRef(Pt);return Bt.current=Pt,reactExports.useEffect(()=>{if(typeof window.matchMedia!="function"||!st)return;const At=(...Ot)=>Bt.current(...Ot),kt=window.matchMedia("(prefers-color-scheme: dark)");return kt.addListener(At),At(kt),()=>{kt.removeListener(At)}},[st]),reactExports.useEffect(()=>{if(st){const At=(at==null?void 0:at.subscribe(Tt=>{(!Tt||["light","dark","system"].includes(Tt))&&wt(Tt||_)}))||noop$7,kt=(lt==null?void 0:lt.subscribe(Tt=>{(!Tt||it.match(Tt))&&Ct({light:Tt})}))||noop$7,Ot=(ct==null?void 0:ct.subscribe(Tt=>{(!Tt||it.match(Tt))&&Ct({dark:Tt})}))||noop$7;return()=>{At(),kt(),Ot()}}},[Ct,wt,it,_,rt,st,at,lt,ct]),{...ft,mode:pt?ft.mode:void 0,systemMode:pt?ft.systemMode:void 0,colorScheme:pt?vt:void 0,setMode:wt,setColorScheme:Ct}}const DISABLE_CSS_TRANSITION="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function createCssVarsProvider(o){const{themeId:_,theme:$={},modeStorageKey:j=DEFAULT_MODE_STORAGE_KEY,colorSchemeStorageKey:_e=DEFAULT_COLOR_SCHEME_STORAGE_KEY,disableTransitionOnChange:et=!1,defaultColorScheme:tt,resolveTheme:rt}=o,nt={allColorSchemes:[],colorScheme:void 0,darkColorScheme:void 0,lightColorScheme:void 0,mode:void 0,setColorScheme:()=>{},setMode:()=>{},systemMode:void 0},ot=reactExports.createContext(void 0),it=()=>reactExports.useContext(ot)||nt,st={},at={};function lt(pt){var Pr,br,_r,Rr;const{children:yt,theme:vt,modeStorageKey:wt=j,colorSchemeStorageKey:Ct=_e,disableTransitionOnChange:Pt=et,storageManager:Bt,storageWindow:At=typeof window>"u"?void 0:window,documentNode:kt=typeof document>"u"?void 0:document,colorSchemeNode:Ot=typeof document>"u"?void 0:document.documentElement,disableNestedContext:Tt=!1,disableStyleSheetGeneration:ht=!1,defaultMode:bt="system",forceThemeRerender:mt=!1,noSsr:gt}=pt,xt=reactExports.useRef(!1),Et=useTheme$1(),_t=reactExports.useContext(ot),$t=!!_t&&!Tt,St=reactExports.useMemo(()=>vt||(typeof $=="function"?$():$),[vt]),Rt=St[_],It=Rt||St,{colorSchemes:Mt=st,components:Vt=at,cssVarPrefix:Gt}=It,zt=Object.keys(Mt).filter(Wt=>!!Mt[Wt]).join(","),jt=reactExports.useMemo(()=>zt.split(","),[zt]),Ft=typeof tt=="string"?tt:tt.light,qt=typeof tt=="string"?tt:tt.dark,Xt=Mt[Ft]&&Mt[qt]?bt:((br=(Pr=Mt[It.defaultColorScheme])==null?void 0:Pr.palette)==null?void 0:br.mode)||((_r=It.palette)==null?void 0:_r.mode),{mode:Ut,setMode:Lt,systemMode:Ht,lightColorScheme:Kt,darkColorScheme:Jt,colorScheme:tr,setColorScheme:nr}=useCurrentColorScheme({supportedColorSchemes:jt,defaultLightColorScheme:Ft,defaultDarkColorScheme:qt,modeStorageKey:wt,colorSchemeStorageKey:Ct,defaultMode:Xt,storageManager:Bt,storageWindow:At,noSsr:gt});let ur=Ut,rr=tr;$t&&(ur=_t.mode,rr=_t.colorScheme);let pr=rr||It.defaultColorScheme;It.vars&&!mt&&(pr=It.defaultColorScheme);const fr=reactExports.useMemo(()=>{var Dt;const Wt=((Dt=It.generateThemeVars)==null?void 0:Dt.call(It))||It.vars,Nt={...It,components:Vt,colorSchemes:Mt,cssVarPrefix:Gt,vars:Wt};if(typeof Nt.generateSpacing=="function"&&(Nt.spacing=Nt.generateSpacing()),pr){const Yt=Mt[pr];Yt&&typeof Yt=="object"&&Object.keys(Yt).forEach(er=>{Yt[er]&&typeof Yt[er]=="object"?Nt[er]={...Nt[er],...Yt[er]}:Nt[er]=Yt[er]})}return rt?rt(Nt):Nt},[It,pr,Vt,Mt,Gt]),lr=It.colorSchemeSelector;useEnhancedEffect(()=>{if(rr&&Ot&&lr&&lr!=="media"){const Wt=lr;let Nt=lr;if(Wt==="class"&&(Nt=".%s"),Wt==="data"&&(Nt="[data-%s]"),Wt!=null&&Wt.startsWith("data-")&&!Wt.includes("%s")&&(Nt=`[${Wt}="%s"]`),Nt.startsWith("."))Ot.classList.remove(...jt.map(Dt=>Nt.substring(1).replace("%s",Dt))),Ot.classList.add(Nt.substring(1).replace("%s",rr));else{const Dt=Nt.replace("%s",rr).match(/\[([^\]]+)\]/);if(Dt){const[Yt,er]=Dt[1].split("=");er||jt.forEach(ir=>{Ot.removeAttribute(Yt.replace(rr,ir))}),Ot.setAttribute(Yt,er?er.replace(/"|'/g,""):"")}else Ot.setAttribute(Nt,rr)}}},[rr,lr,Ot,jt]),reactExports.useEffect(()=>{let Wt;if(Pt&&xt.current&&kt){const Nt=kt.createElement("style");Nt.appendChild(kt.createTextNode(DISABLE_CSS_TRANSITION)),kt.head.appendChild(Nt),window.getComputedStyle(kt.body),Wt=setTimeout(()=>{kt.head.removeChild(Nt)},1)}return()=>{clearTimeout(Wt)}},[rr,Pt,kt]),reactExports.useEffect(()=>(xt.current=!0,()=>{xt.current=!1}),[]);const wr=reactExports.useMemo(()=>({allColorSchemes:jt,colorScheme:rr,darkColorScheme:Jt,lightColorScheme:Kt,mode:ur,setColorScheme:nr,setMode:Lt,systemMode:Ht}),[jt,rr,Jt,Kt,ur,nr,Lt,Ht,fr.colorSchemeSelector]);let hr=!0;(ht||It.cssVariables===!1||$t&&(Et==null?void 0:Et.cssVarPrefix)===Gt)&&(hr=!1);const Er=jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(ThemeProvider$2,{themeId:Rt?_:void 0,theme:fr,children:yt}),hr&&jsxRuntimeExports.jsx(GlobalStyles$3,{styles:((Rr=fr.generateStyleSheets)==null?void 0:Rr.call(fr))||[]})]});return $t?Er:jsxRuntimeExports.jsx(ot.Provider,{value:wr,children:Er})}const ct=typeof tt=="string"?tt:tt.light,ft=typeof tt=="string"?tt:tt.dark;return{CssVarsProvider:lt,useColorScheme:it,getInitColorSchemeScript:pt=>InitColorSchemeScript({colorSchemeStorageKey:_e,defaultLightColorScheme:ct,defaultDarkColorScheme:ft,modeStorageKey:j,...pt})}}function createGetCssVar$1(o=""){function _(...j){if(!j.length)return"";const _e=j[0];return typeof _e=="string"&&!_e.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${o?`${o}-`:""}${_e}${_(...j.slice(1))})`:`, ${_e}`}return(j,..._e)=>`var(--${o?`${o}-`:""}${j}${_(..._e)})`}const assignNestedKeys=(o,_,$,j=[])=>{let _e=o;_.forEach((et,tt)=>{tt===_.length-1?Array.isArray(_e)?_e[Number(et)]=$:_e&&typeof _e=="object"&&(_e[et]=$):_e&&typeof _e=="object"&&(_e[et]||(_e[et]=j.includes(et)?[]:{}),_e=_e[et])})},walkObjectDeep=(o,_,$)=>{function j(_e,et=[],tt=[]){Object.entries(_e).forEach(([rt,nt])=>{(!$||$&&!$([...et,rt]))&&nt!=null&&(typeof nt=="object"&&Object.keys(nt).length>0?j(nt,[...et,rt],Array.isArray(nt)?[...tt,rt]:tt):_([...et,rt],nt,tt))})}j(o)},getCssValue=(o,_)=>typeof _=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(j=>o.includes(j))||o[o.length-1].toLowerCase().includes("opacity")?_:`${_}px`:_;function cssVarsParser(o,_){const{prefix:$,shouldSkipGeneratingVar:j}=_||{},_e={},et={},tt={};return walkObjectDeep(o,(rt,nt,ot)=>{if((typeof nt=="string"||typeof nt=="number")&&(!j||!j(rt,nt))){const it=`--${$?`${$}-`:""}${rt.join("-")}`,st=getCssValue(rt,nt);Object.assign(_e,{[it]:st}),assignNestedKeys(et,rt,`var(${it})`,ot),assignNestedKeys(tt,rt,`var(${it}, ${st})`,ot)}},rt=>rt[0]==="vars"),{css:_e,vars:et,varsWithDefaults:tt}}function prepareCssVars(o,_={}){const{getSelector:$=pt,disableCssColorScheme:j,colorSchemeSelector:_e,enableContrastVars:et}=_,{colorSchemes:tt={},components:rt,defaultColorScheme:nt="light",...ot}=o,{vars:it,css:st,varsWithDefaults:at}=cssVarsParser(ot,_);let lt=at;const ct={},{[nt]:ft,...dt}=tt;if(Object.entries(dt||{}).forEach(([wt,Ct])=>{const{vars:Pt,css:Bt,varsWithDefaults:At}=cssVarsParser(Ct,_);lt=deepmerge$2(lt,At),ct[wt]={css:Bt,vars:Pt}}),ft){const{css:wt,vars:Ct,varsWithDefaults:Pt}=cssVarsParser(ft,_);lt=deepmerge$2(lt,Pt),ct[nt]={css:wt,vars:Ct}}function pt(wt,Ct){var Bt,At;let Pt=_e;if(_e==="class"&&(Pt=".%s"),_e==="data"&&(Pt="[data-%s]"),_e!=null&&_e.startsWith("data-")&&!_e.includes("%s")&&(Pt=`[${_e}="%s"]`),wt){if(Pt==="media")return o.defaultColorScheme===wt?":root":{[`@media (prefers-color-scheme: ${((At=(Bt=tt[wt])==null?void 0:Bt.palette)==null?void 0:At.mode)||wt})`]:{":root":Ct}};if(Pt)return o.defaultColorScheme===wt?`:root, ${Pt.replace("%s",String(wt))}`:Pt.replace("%s",String(wt))}return":root"}return{vars:lt,generateThemeVars:()=>{let wt={...it};return Object.entries(ct).forEach(([,{vars:Ct}])=>{wt=deepmerge$2(wt,Ct)}),wt},generateStyleSheets:()=>{var kt,Ot;const wt=[],Ct=o.defaultColorScheme||"light";function Pt(Tt,ht){Object.keys(ht).length&&wt.push(typeof Tt=="string"?{[Tt]:{...ht}}:Tt)}Pt($(void 0,{...st}),st);const{[Ct]:Bt,...At}=ct;if(Bt){const{css:Tt}=Bt,ht=(Ot=(kt=tt[Ct])==null?void 0:kt.palette)==null?void 0:Ot.mode,bt=!j&&ht?{colorScheme:ht,...Tt}:{...Tt};Pt($(Ct,{...bt}),bt)}return Object.entries(At).forEach(([Tt,{css:ht}])=>{var gt,xt;const bt=(xt=(gt=tt[Tt])==null?void 0:gt.palette)==null?void 0:xt.mode,mt=!j&&bt?{colorScheme:bt,...ht}:{...ht};Pt($(Tt,{...mt}),mt)}),et&&wt.push({":root":{"--__l-threshold":"0.7","--__l":"clamp(0, (l / var(--__l-threshold) - 1) * -infinity, 1)","--__a":"clamp(0.87, (l / var(--__l-threshold) - 1) * -infinity, 1)"}}),wt}}}function createGetColorSchemeSelector(o){return function($){return o==="media"?`@media (prefers-color-scheme: ${$})`:o?o.startsWith("data-")&&!o.includes("%s")?`[${o}="${$}"] &`:o==="class"?`.${$} &`:o==="data"?`[data-${$}] &`:`${o.replace("%s",$)} &`:"&"}}function composeClasses(o,_,$=void 0){const j={};for(const _e in o){const et=o[_e];let tt="",rt=!0;for(let nt=0;nt{const{ownerState:$}=o;return[_.root,_[`maxWidth${capitalize(String($.maxWidth))}`],$.fixed&&_.fixed,$.disableGutters&&_.disableGutters]}}),useThemePropsDefault$2=o=>useThemeProps({props:o,name:"MuiContainer",defaultTheme:defaultTheme$4}),useUtilityClasses$X=(o,_)=>{const $=nt=>generateUtilityClass(_,nt),{classes:j,fixed:_e,disableGutters:et,maxWidth:tt}=o,rt={root:["root",tt&&`maxWidth${capitalize(String(tt))}`,_e&&"fixed",et&&"disableGutters"]};return composeClasses(rt,$,j)};function createContainer(o={}){const{createStyledComponent:_=defaultCreateStyledComponent$2,useThemeProps:$=useThemePropsDefault$2,componentName:j="MuiContainer"}=o,_e=_(({theme:tt,ownerState:rt})=>({width:"100%",marginLeft:"auto",boxSizing:"border-box",marginRight:"auto",...!rt.disableGutters&&{paddingLeft:tt.spacing(2),paddingRight:tt.spacing(2),[tt.breakpoints.up("sm")]:{paddingLeft:tt.spacing(3),paddingRight:tt.spacing(3)}}}),({theme:tt,ownerState:rt})=>rt.fixed&&Object.keys(tt.breakpoints.values).reduce((nt,ot)=>{const it=ot,st=tt.breakpoints.values[it];return st!==0&&(nt[tt.breakpoints.up(it)]={maxWidth:`${st}${tt.breakpoints.unit}`}),nt},{}),({theme:tt,ownerState:rt})=>({...rt.maxWidth==="xs"&&{[tt.breakpoints.up("xs")]:{maxWidth:Math.max(tt.breakpoints.values.xs,444)}},...rt.maxWidth&&rt.maxWidth!=="xs"&&{[tt.breakpoints.up(rt.maxWidth)]:{maxWidth:`${tt.breakpoints.values[rt.maxWidth]}${tt.breakpoints.unit}`}}}));return reactExports.forwardRef(function(rt,nt){const ot=$(rt),{className:it,component:st="div",disableGutters:at=!1,fixed:lt=!1,maxWidth:ct="lg",classes:ft,...dt}=ot,pt={...ot,component:st,disableGutters:at,fixed:lt,maxWidth:ct},yt=useUtilityClasses$X(pt,j);return jsxRuntimeExports.jsx(_e,{as:st,ownerState:pt,className:clsx(yt.root,it),ref:nt,...dt})})}function isMuiElement(o,_){var $,j,_e;return reactExports.isValidElement(o)&&_.indexOf(o.type.muiName??((_e=(j=($=o.type)==null?void 0:$._payload)==null?void 0:j.value)==null?void 0:_e.muiName))!==-1}const filterBreakpointKeys=(o,_)=>o.filter($=>_.includes($)),traverseBreakpoints=(o,_,$)=>{const j=o.keys[0];Array.isArray(_)?_.forEach((_e,et)=>{$((tt,rt)=>{et<=o.keys.length-1&&(et===0?Object.assign(tt,rt):tt[o.up(o.keys[et])]=rt)},_e)}):_&&typeof _=="object"?(Object.keys(_).length>o.keys.length?o.keys:filterBreakpointKeys(o.keys,Object.keys(_))).forEach(et=>{if(o.keys.includes(et)){const tt=_[et];tt!==void 0&&$((rt,nt)=>{j===et?Object.assign(rt,nt):rt[o.up(et)]=nt},tt)}}):(typeof _=="number"||typeof _=="string")&&$((_e,et)=>{Object.assign(_e,et)},_)};function getSelfSpacingVar(o){return`--Grid-${o}Spacing`}function getParentSpacingVar(o){return`--Grid-parent-${o}Spacing`}const selfColumnsVar="--Grid-columns",parentColumnsVar="--Grid-parent-columns",generateGridSizeStyles=({theme:o,ownerState:_})=>{const $={};return traverseBreakpoints(o.breakpoints,_.size,(j,_e)=>{let et={};_e==="grow"&&(et={flexBasis:0,flexGrow:1,maxWidth:"100%"}),_e==="auto"&&(et={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof _e=="number"&&(et={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${_e} / var(${parentColumnsVar}) - (var(${parentColumnsVar}) - ${_e}) * (var(${getParentSpacingVar("column")}) / var(${parentColumnsVar})))`}),j($,et)}),$},generateGridOffsetStyles=({theme:o,ownerState:_})=>{const $={};return traverseBreakpoints(o.breakpoints,_.offset,(j,_e)=>{let et={};_e==="auto"&&(et={marginLeft:"auto"}),typeof _e=="number"&&(et={marginLeft:_e===0?"0px":`calc(100% * ${_e} / var(${parentColumnsVar}) + var(${getParentSpacingVar("column")}) * ${_e} / var(${parentColumnsVar}))`}),j($,et)}),$},generateGridColumnsStyles=({theme:o,ownerState:_})=>{if(!_.container)return{};const $={[selfColumnsVar]:12};return traverseBreakpoints(o.breakpoints,_.columns,(j,_e)=>{const et=_e??12;j($,{[selfColumnsVar]:et,"> *":{[parentColumnsVar]:et}})}),$},generateGridRowSpacingStyles=({theme:o,ownerState:_})=>{if(!_.container)return{};const $={};return traverseBreakpoints(o.breakpoints,_.rowSpacing,(j,_e)=>{var tt;const et=typeof _e=="string"?_e:(tt=o.spacing)==null?void 0:tt.call(o,_e);j($,{[getSelfSpacingVar("row")]:et,"> *":{[getParentSpacingVar("row")]:et}})}),$},generateGridColumnSpacingStyles=({theme:o,ownerState:_})=>{if(!_.container)return{};const $={};return traverseBreakpoints(o.breakpoints,_.columnSpacing,(j,_e)=>{var tt;const et=typeof _e=="string"?_e:(tt=o.spacing)==null?void 0:tt.call(o,_e);j($,{[getSelfSpacingVar("column")]:et,"> *":{[getParentSpacingVar("column")]:et}})}),$},generateGridDirectionStyles=({theme:o,ownerState:_})=>{if(!_.container)return{};const $={};return traverseBreakpoints(o.breakpoints,_.direction,(j,_e)=>{j($,{flexDirection:_e})}),$},generateGridStyles=({ownerState:o})=>({minWidth:0,boxSizing:"border-box",...o.container&&{display:"flex",flexWrap:"wrap",...o.wrap&&o.wrap!=="wrap"&&{flexWrap:o.wrap},gap:`var(${getSelfSpacingVar("row")}) var(${getSelfSpacingVar("column")})`}}),generateSizeClassNames=o=>{const _=[];return Object.entries(o).forEach(([$,j])=>{j!==!1&&j!==void 0&&_.push(`grid-${$}-${String(j)}`)}),_},generateSpacingClassNames=(o,_="xs")=>{function $(j){return j===void 0?!1:typeof j=="string"&&!Number.isNaN(Number(j))||typeof j=="number"&&j>0}if($(o))return[`spacing-${_}-${String(o)}`];if(typeof o=="object"&&!Array.isArray(o)){const j=[];return Object.entries(o).forEach(([_e,et])=>{$(et)&&j.push(`spacing-${_e}-${String(et)}`)}),j}return[]},generateDirectionClasses=o=>o===void 0?[]:typeof o=="object"?Object.entries(o).map(([_,$])=>`direction-${_}-${$}`):[`direction-xs-${String(o)}`];function deleteLegacyGridProps(o,_){o.item!==void 0&&delete o.item,o.zeroMinWidth!==void 0&&delete o.zeroMinWidth,_.keys.forEach($=>{o[$]!==void 0&&delete o[$]})}const defaultTheme$3=createTheme$1(),defaultCreateStyledComponent$1=styled$1("div",{name:"MuiGrid",slot:"Root"});function useThemePropsDefault$1(o){return useThemeProps({props:o,name:"MuiGrid",defaultTheme:defaultTheme$3})}function createGrid(o={}){const{createStyledComponent:_=defaultCreateStyledComponent$1,useThemeProps:$=useThemePropsDefault$1,useTheme:j=useTheme$2,componentName:_e="MuiGrid"}=o,et=(ot,it)=>{const{container:st,direction:at,spacing:lt,wrap:ct,size:ft}=ot,dt={root:["root",st&&"container",ct!=="wrap"&&`wrap-xs-${String(ct)}`,...generateDirectionClasses(at),...generateSizeClassNames(ft),...st?generateSpacingClassNames(lt,it.breakpoints.keys[0]):[]]};return composeClasses(dt,pt=>generateUtilityClass(_e,pt),{})};function tt(ot,it,st=()=>!0){const at={};return ot===null||(Array.isArray(ot)?ot.forEach((lt,ct)=>{lt!==null&&st(lt)&&it.keys[ct]&&(at[it.keys[ct]]=lt)}):typeof ot=="object"?Object.keys(ot).forEach(lt=>{const ct=ot[lt];ct!=null&&st(ct)&&(at[lt]=ct)}):at[it.keys[0]]=ot),at}const rt=_(generateGridColumnsStyles,generateGridColumnSpacingStyles,generateGridRowSpacingStyles,generateGridSizeStyles,generateGridDirectionStyles,generateGridStyles,generateGridOffsetStyles),nt=reactExports.forwardRef(function(it,st){const at=j(),lt=$(it),ct=extendSxProp$1(lt);deleteLegacyGridProps(ct,at.breakpoints);const{className:ft,children:dt,columns:pt=12,container:yt=!1,component:vt="div",direction:wt="row",wrap:Ct="wrap",size:Pt={},offset:Bt={},spacing:At=0,rowSpacing:kt=At,columnSpacing:Ot=At,unstable_level:Tt=0,...ht}=ct,bt=tt(Pt,at.breakpoints,Rt=>Rt!==!1),mt=tt(Bt,at.breakpoints),gt=it.columns??(Tt?void 0:pt),xt=it.spacing??(Tt?void 0:At),Et=it.rowSpacing??it.spacing??(Tt?void 0:kt),_t=it.columnSpacing??it.spacing??(Tt?void 0:Ot),$t={...ct,level:Tt,columns:gt,container:yt,direction:wt,wrap:Ct,spacing:xt,rowSpacing:Et,columnSpacing:_t,size:bt,offset:mt},St=et($t,at);return jsxRuntimeExports.jsx(rt,{ref:st,as:vt,ownerState:$t,className:clsx(St.root,ft),...ht,children:reactExports.Children.map(dt,Rt=>{var It;return reactExports.isValidElement(Rt)&&isMuiElement(Rt,["Grid"])&&yt&&Rt.props.container?reactExports.cloneElement(Rt,{unstable_level:((It=Rt.props)==null?void 0:It.unstable_level)??Tt+1}):Rt})})});return nt.muiName="Grid",nt}const defaultTheme$2=createTheme$1(),defaultCreateStyledComponent=styled$1("div",{name:"MuiStack",slot:"Root"});function useThemePropsDefault(o){return useThemeProps({props:o,name:"MuiStack",defaultTheme:defaultTheme$2})}function joinChildren(o,_){const $=reactExports.Children.toArray(o).filter(Boolean);return $.reduce((j,_e,et)=>(j.push(_e),et<$.length-1&&j.push(reactExports.cloneElement(_,{key:`separator-${et}`})),j),[])}const getSideFromDirection=o=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[o],style=({ownerState:o,theme:_})=>{let $={display:"flex",flexDirection:"column",...handleBreakpoints({theme:_},resolveBreakpointValues({values:o.direction,breakpoints:_.breakpoints.values}),j=>({flexDirection:j}))};if(o.spacing){const j=createUnarySpacing(_),_e=Object.keys(_.breakpoints.values).reduce((nt,ot)=>((typeof o.spacing=="object"&&o.spacing[ot]!=null||typeof o.direction=="object"&&o.direction[ot]!=null)&&(nt[ot]=!0),nt),{}),et=resolveBreakpointValues({values:o.direction,base:_e}),tt=resolveBreakpointValues({values:o.spacing,base:_e});typeof et=="object"&&Object.keys(et).forEach((nt,ot,it)=>{if(!et[nt]){const at=ot>0?et[it[ot-1]]:"column";et[nt]=at}}),$=deepmerge$2($,handleBreakpoints({theme:_},tt,(nt,ot)=>o.useFlexGap?{gap:getValue(j,nt)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${getSideFromDirection(ot?et[ot]:o.direction)}`]:getValue(j,nt)}}))}return $=mergeBreakpointsInOrder(_.breakpoints,$),$};function createStack(o={}){const{createStyledComponent:_=defaultCreateStyledComponent,useThemeProps:$=useThemePropsDefault,componentName:j="MuiStack"}=o,_e=()=>composeClasses({root:["root"]},nt=>generateUtilityClass(j,nt),{}),et=_(style);return reactExports.forwardRef(function(nt,ot){const it=$(nt),st=extendSxProp$1(it),{component:at="div",direction:lt="column",spacing:ct=0,divider:ft,children:dt,className:pt,useFlexGap:yt=!1,...vt}=st,wt={direction:lt,spacing:ct,useFlexGap:yt},Ct=_e();return jsxRuntimeExports.jsx(et,{as:at,ownerState:wt,ref:ot,className:clsx(Ct.root,pt),...vt,children:ft?joinChildren(dt,ft):dt})})}function getLight(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:common$6.white,default:common$6.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const light=getLight();function getDark(){return{text:{primary:common$6.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:common$6.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const dark=getDark();function addLightOrDark(o,_,$,j){const _e=j.light||j,et=j.dark||j*1.5;o[_]||(o.hasOwnProperty($)?o[_]=o[$]:_==="light"?o.light=lighten(o.main,_e):_==="dark"&&(o.dark=darken(o.main,et)))}function mixLightOrDark(o,_,$,j,_e){const et=_e.light||_e,tt=_e.dark||_e*1.5;_[$]||(_.hasOwnProperty(j)?_[$]=_[j]:$==="light"?_.light=`color-mix(in ${o}, ${_.main}, #fff ${(et*100).toFixed(0)}%)`:$==="dark"&&(_.dark=`color-mix(in ${o}, ${_.main}, #000 ${(tt*100).toFixed(0)}%)`))}function getDefaultPrimary(o="light"){return o==="dark"?{main:blue[200],light:blue[50],dark:blue[400]}:{main:blue[700],light:blue[400],dark:blue[800]}}function getDefaultSecondary(o="light"){return o==="dark"?{main:purple[200],light:purple[50],dark:purple[400]}:{main:purple[500],light:purple[300],dark:purple[700]}}function getDefaultError(o="light"){return o==="dark"?{main:red[500],light:red[300],dark:red[700]}:{main:red[700],light:red[400],dark:red[800]}}function getDefaultInfo(o="light"){return o==="dark"?{main:lightBlue[400],light:lightBlue[300],dark:lightBlue[700]}:{main:lightBlue[700],light:lightBlue[500],dark:lightBlue[900]}}function getDefaultSuccess(o="light"){return o==="dark"?{main:green[400],light:green[300],dark:green[700]}:{main:green[800],light:green[500],dark:green[900]}}function getDefaultWarning(o="light"){return o==="dark"?{main:orange[400],light:orange[300],dark:orange[700]}:{main:"#ed6c02",light:orange[500],dark:orange[900]}}function contrastColor(o){return`oklch(from ${o} var(--__l) 0 h / var(--__a))`}function createPalette(o){const{mode:_="light",contrastThreshold:$=3,tonalOffset:j=.2,colorSpace:_e,...et}=o,tt=o.primary||getDefaultPrimary(_),rt=o.secondary||getDefaultSecondary(_),nt=o.error||getDefaultError(_),ot=o.info||getDefaultInfo(_),it=o.success||getDefaultSuccess(_),st=o.warning||getDefaultWarning(_);function at(dt){return _e?contrastColor(dt):getContrastRatio(dt,dark.text.primary)>=$?dark.text.primary:light.text.primary}const lt=({color:dt,name:pt,mainShade:yt=500,lightShade:vt=300,darkShade:wt=700})=>{if(dt={...dt},!dt.main&&dt[yt]&&(dt.main=dt[yt]),!dt.hasOwnProperty("main"))throw new Error(formatMuiErrorMessage(11,pt?` (${pt})`:"",yt));if(typeof dt.main!="string")throw new Error(formatMuiErrorMessage(12,pt?` (${pt})`:"",JSON.stringify(dt.main)));return _e?(mixLightOrDark(_e,dt,"light",vt,j),mixLightOrDark(_e,dt,"dark",wt,j)):(addLightOrDark(dt,"light",vt,j),addLightOrDark(dt,"dark",wt,j)),dt.contrastText||(dt.contrastText=at(dt.main)),dt};let ct;return _==="light"?ct=getLight():_==="dark"&&(ct=getDark()),deepmerge$2({common:{...common$6},mode:_,primary:lt({color:tt,name:"primary"}),secondary:lt({color:rt,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:lt({color:nt,name:"error"}),warning:lt({color:st,name:"warning"}),info:lt({color:ot,name:"info"}),success:lt({color:it,name:"success"}),grey,contrastThreshold:$,getContrastText:at,augmentColor:lt,tonalOffset:j,...ct},et)}function prepareTypographyVars(o){const _={};return Object.entries(o).forEach(j=>{const[_e,et]=j;typeof et=="object"&&(_[_e]=`${et.fontStyle?`${et.fontStyle} `:""}${et.fontVariant?`${et.fontVariant} `:""}${et.fontWeight?`${et.fontWeight} `:""}${et.fontStretch?`${et.fontStretch} `:""}${et.fontSize||""}${et.lineHeight?`/${et.lineHeight} `:""}${et.fontFamily||""}`)}),_}function createMixins(o,_){return{toolbar:{minHeight:56,[o.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[o.up("sm")]:{minHeight:64}},..._}}function round$6(o){return Math.round(o*1e5)/1e5}const caseAllCaps={textTransform:"uppercase"},defaultFontFamily='"Roboto", "Helvetica", "Arial", sans-serif';function createTypography(o,_){const{fontFamily:$=defaultFontFamily,fontSize:j=14,fontWeightLight:_e=300,fontWeightRegular:et=400,fontWeightMedium:tt=500,fontWeightBold:rt=700,htmlFontSize:nt=16,allVariants:ot,pxToRem:it,...st}=typeof _=="function"?_(o):_,at=j/14,lt=it||(dt=>`${dt/nt*at}rem`),ct=(dt,pt,yt,vt,wt)=>({fontFamily:$,fontWeight:dt,fontSize:lt(pt),lineHeight:yt,...$===defaultFontFamily?{letterSpacing:`${round$6(vt/pt)}em`}:{},...wt,...ot}),ft={h1:ct(_e,96,1.167,-1.5),h2:ct(_e,60,1.2,-.5),h3:ct(et,48,1.167,0),h4:ct(et,34,1.235,.25),h5:ct(et,24,1.334,0),h6:ct(tt,20,1.6,.15),subtitle1:ct(et,16,1.75,.15),subtitle2:ct(tt,14,1.57,.1),body1:ct(et,16,1.5,.15),body2:ct(et,14,1.43,.15),button:ct(tt,14,1.75,.4,caseAllCaps),caption:ct(et,12,1.66,.4),overline:ct(et,12,2.66,1,caseAllCaps),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return deepmerge$2({htmlFontSize:nt,pxToRem:lt,fontFamily:$,fontSize:j,fontWeightLight:_e,fontWeightRegular:et,fontWeightMedium:tt,fontWeightBold:rt,...ft},st,{clone:!1})}const shadowKeyUmbraOpacity=.2,shadowKeyPenumbraOpacity=.14,shadowAmbientShadowOpacity=.12;function createShadow(...o){return[`${o[0]}px ${o[1]}px ${o[2]}px ${o[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`,`${o[4]}px ${o[5]}px ${o[6]}px ${o[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`,`${o[8]}px ${o[9]}px ${o[10]}px ${o[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(",")}const shadows=["none",createShadow(0,2,1,-1,0,1,1,0,0,1,3,0),createShadow(0,3,1,-2,0,2,2,0,0,1,5,0),createShadow(0,3,3,-2,0,3,4,0,0,1,8,0),createShadow(0,2,4,-1,0,4,5,0,0,1,10,0),createShadow(0,3,5,-1,0,5,8,0,0,1,14,0),createShadow(0,3,5,-1,0,6,10,0,0,1,18,0),createShadow(0,4,5,-2,0,7,10,1,0,2,16,1),createShadow(0,5,5,-3,0,8,10,1,0,3,14,2),createShadow(0,5,6,-3,0,9,12,1,0,3,16,2),createShadow(0,6,6,-3,0,10,14,1,0,4,18,3),createShadow(0,6,7,-4,0,11,15,1,0,4,20,3),createShadow(0,7,8,-4,0,12,17,2,0,5,22,4),createShadow(0,7,8,-4,0,13,19,2,0,5,24,4),createShadow(0,7,9,-4,0,14,21,2,0,5,26,4),createShadow(0,8,9,-5,0,15,22,2,0,6,28,5),createShadow(0,8,10,-5,0,16,24,2,0,6,30,5),createShadow(0,8,11,-5,0,17,26,2,0,6,32,5),createShadow(0,9,11,-5,0,18,28,2,0,7,34,6),createShadow(0,9,12,-6,0,19,29,2,0,7,36,6),createShadow(0,10,13,-6,0,20,31,3,0,8,38,7),createShadow(0,10,13,-6,0,21,33,3,0,8,40,7),createShadow(0,10,14,-6,0,22,35,3,0,8,42,7),createShadow(0,11,14,-7,0,23,36,3,0,9,44,8),createShadow(0,11,15,-7,0,24,38,3,0,9,46,8)],easing={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},duration={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function formatMs(o){return`${Math.round(o)}ms`}function getAutoHeightDuration(o){if(!o)return 0;const _=o/36;return Math.min(Math.round((4+15*_**.25+_/5)*10),3e3)}function createTransitions(o){const _={...easing,...o.easing},$={...duration,...o.duration};return{getAutoHeightDuration,create:(_e=["all"],et={})=>{const{duration:tt=$.standard,easing:rt=_.easeInOut,delay:nt=0,...ot}=et;return(Array.isArray(_e)?_e:[_e]).map(it=>`${it} ${typeof tt=="string"?tt:formatMs(tt)} ${rt} ${typeof nt=="string"?nt:formatMs(nt)}`).join(",")},...o,easing:_,duration:$}}const zIndex={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function isSerializable(o){return isPlainObject$7(o)||typeof o>"u"||typeof o=="string"||typeof o=="boolean"||typeof o=="number"||Array.isArray(o)}function stringifyTheme(o={}){const _={...o};function $(j){const _e=Object.entries(j);for(let et=0;et<_e.length;et++){const[tt,rt]=_e[et];!isSerializable(rt)||tt.startsWith("unstable_")?delete j[tt]:isPlainObject$7(rt)&&(j[tt]={...rt},$(j[tt]))}}return $(_),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles'; - -const theme = ${JSON.stringify(_,null,2)}; - -theme.breakpoints = createBreakpoints(theme.breakpoints || {}); -theme.transitions = createTransitions(theme.transitions || {}); - -export default theme;`}function coefficientToPercentage(o){return typeof o=="number"?`${(o*100).toFixed(0)}%`:`calc((${o}) * 100%)`}const parseAddition=o=>{if(!Number.isNaN(+o))return+o;const _=o.match(/\d*\.?\d+/g);if(!_)return 0;let $=0;for(let j=0;j<_.length;j+=1)$+=+_[j];return $};function attachColorManipulators(o){Object.assign(o,{alpha(_,$){const j=this||o;return j.colorSpace?`oklch(from ${_} l c h / ${typeof $=="string"?`calc(${$})`:$})`:j.vars?`rgba(${_.replace(/var\(--([^,\s)]+)(?:,[^)]+)?\)+/g,"var(--$1Channel)")} / ${typeof $=="string"?`calc(${$})`:$})`:alpha$1(_,parseAddition($))},lighten(_,$){const j=this||o;return j.colorSpace?`color-mix(in ${j.colorSpace}, ${_}, #fff ${coefficientToPercentage($)})`:lighten(_,$)},darken(_,$){const j=this||o;return j.colorSpace?`color-mix(in ${j.colorSpace}, ${_}, #000 ${coefficientToPercentage($)})`:darken(_,$)}})}function createThemeNoVars(o={},..._){const{breakpoints:$,mixins:j={},spacing:_e,palette:et={},transitions:tt={},typography:rt={},shape:nt,colorSpace:ot,...it}=o;if(o.vars&&o.generateThemeVars===void 0)throw new Error(formatMuiErrorMessage(20));const st=createPalette({...et,colorSpace:ot}),at=createTheme$1(o);let lt=deepmerge$2(at,{mixins:createMixins(at.breakpoints,j),palette:st,shadows:shadows.slice(),typography:createTypography(st,rt),transitions:createTransitions(tt),zIndex:{...zIndex}});return lt=deepmerge$2(lt,it),lt=_.reduce((ct,ft)=>deepmerge$2(ct,ft),lt),lt.unstable_sxConfig={...defaultSxConfig,...it==null?void 0:it.unstable_sxConfig},lt.unstable_sx=function(ft){return styleFunctionSx({sx:ft,theme:this})},lt.toRuntimeSource=stringifyTheme,attachColorManipulators(lt),lt}function getOverlayAlpha(o){let _;return o<1?_=5.11916*o**2:_=4.5*Math.log(o+1)+2,Math.round(_*10)/1e3}const defaultDarkOverlays=[...Array(25)].map((o,_)=>{if(_===0)return"none";const $=getOverlayAlpha(_);return`linear-gradient(rgba(255 255 255 / ${$}), rgba(255 255 255 / ${$}))`});function getOpacity(o){return{inputPlaceholder:o==="dark"?.5:.42,inputUnderline:o==="dark"?.7:.42,switchTrackDisabled:o==="dark"?.2:.12,switchTrack:o==="dark"?.3:.38}}function getOverlays(o){return o==="dark"?defaultDarkOverlays:[]}function createColorScheme(o){const{palette:_={mode:"light"},opacity:$,overlays:j,colorSpace:_e,...et}=o,tt=createPalette({..._,colorSpace:_e});return{palette:tt,opacity:{...getOpacity(tt.mode),...$},overlays:j||getOverlays(tt.mode),...et}}function shouldSkipGeneratingVar(o){var _;return!!o[0].match(/(cssVarPrefix|colorSchemeSelector|modularCssLayers|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!o[0].match(/sxConfig$/)||o[0]==="palette"&&!!((_=o[1])!=null&&_.match(/(mode|contrastThreshold|tonalOffset)/))}const excludeVariablesFromRoot=o=>[...[...Array(25)].map((_,$)=>`--${o?`${o}-`:""}overlays-${$}`),`--${o?`${o}-`:""}palette-AppBar-darkBg`,`--${o?`${o}-`:""}palette-AppBar-darkColor`],defaultGetSelector=o=>(_,$)=>{const j=o.rootSelector||":root",_e=o.colorSchemeSelector;let et=_e;if(_e==="class"&&(et=".%s"),_e==="data"&&(et="[data-%s]"),_e!=null&&_e.startsWith("data-")&&!_e.includes("%s")&&(et=`[${_e}="%s"]`),o.defaultColorScheme===_){if(_==="dark"){const tt={};return excludeVariablesFromRoot(o.cssVarPrefix).forEach(rt=>{tt[rt]=$[rt],delete $[rt]}),et==="media"?{[j]:$,"@media (prefers-color-scheme: dark)":{[j]:tt}}:et?{[et.replace("%s",_)]:tt,[`${j}, ${et.replace("%s",_)}`]:$}:{[j]:{...$,...tt}}}if(et&&et!=="media")return`${j}, ${et.replace("%s",String(_))}`}else if(_){if(et==="media")return{[`@media (prefers-color-scheme: ${String(_)})`]:{[j]:$}};if(et)return et.replace("%s",String(_))}return j};function assignNode(o,_){_.forEach($=>{o[$]||(o[$]={})})}function setColor(o,_,$){!o[_]&&$&&(o[_]=$)}function toRgb(o){return typeof o!="string"||!o.startsWith("hsl")?o:hslToRgb(o)}function setColorChannel(o,_){`${_}Channel`in o||(o[`${_}Channel`]=private_safeColorChannel(toRgb(o[_])))}function getSpacingVal(o){return typeof o=="number"?`${o}px`:typeof o=="string"||typeof o=="function"||Array.isArray(o)?o:"8px"}const silent=o=>{try{return o()}catch{}},createGetCssVar=(o="mui")=>createGetCssVar$1(o);function attachColorScheme$1(o,_,$,j,_e){if(!$)return;$=$===!0?{}:$;const et=_e==="dark"?"dark":"light";if(!j){_[_e]=createColorScheme({...$,palette:{mode:et,...$==null?void 0:$.palette},colorSpace:o});return}const{palette:tt,...rt}=createThemeNoVars({...j,palette:{mode:et,...$==null?void 0:$.palette},colorSpace:o});return _[_e]={...$,palette:tt,opacity:{...getOpacity(et),...$==null?void 0:$.opacity},overlays:($==null?void 0:$.overlays)||getOverlays(et)},rt}function createThemeWithVars(o={},..._){const{colorSchemes:$={light:!0},defaultColorScheme:j,disableCssColorScheme:_e=!1,cssVarPrefix:et="mui",nativeColor:tt=!1,shouldSkipGeneratingVar:rt=shouldSkipGeneratingVar,colorSchemeSelector:nt=$.light&&$.dark?"media":void 0,rootSelector:ot=":root",...it}=o,st=Object.keys($)[0],at=j||($.light&&st!=="light"?"light":st),lt=createGetCssVar(et),{[at]:ct,light:ft,dark:dt,...pt}=$,yt={...pt};let vt=ct;if((at==="dark"&&!("dark"in $)||at==="light"&&!("light"in $))&&(vt=!0),!vt)throw new Error(formatMuiErrorMessage(21,at));let wt;tt&&(wt="oklch");const Ct=attachColorScheme$1(wt,yt,vt,it,at);ft&&!yt.light&&attachColorScheme$1(wt,yt,ft,void 0,"light"),dt&&!yt.dark&&attachColorScheme$1(wt,yt,dt,void 0,"dark");let Pt={defaultColorScheme:at,...Ct,cssVarPrefix:et,colorSchemeSelector:nt,rootSelector:ot,getCssVar:lt,colorSchemes:yt,font:{...prepareTypographyVars(Ct.typography),...Ct.font},spacing:getSpacingVal(it.spacing)};Object.keys(Pt.colorSchemes).forEach(Tt=>{const ht=Pt.colorSchemes[Tt].palette,bt=gt=>{const xt=gt.split("-"),Et=xt[1],_t=xt[2];return lt(gt,ht[Et][_t])};ht.mode==="light"&&(setColor(ht.common,"background","#fff"),setColor(ht.common,"onBackground","#000")),ht.mode==="dark"&&(setColor(ht.common,"background","#000"),setColor(ht.common,"onBackground","#fff"));function mt(gt,xt,Et){if(wt){let _t;return gt===private_safeAlpha&&(_t=`transparent ${((1-Et)*100).toFixed(0)}%`),gt===private_safeDarken&&(_t=`#000 ${(Et*100).toFixed(0)}%`),gt===private_safeLighten&&(_t=`#fff ${(Et*100).toFixed(0)}%`),`color-mix(in ${wt}, ${xt}, ${_t})`}return gt(xt,Et)}if(assignNode(ht,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),ht.mode==="light"){setColor(ht.Alert,"errorColor",mt(private_safeDarken,ht.error.light,.6)),setColor(ht.Alert,"infoColor",mt(private_safeDarken,ht.info.light,.6)),setColor(ht.Alert,"successColor",mt(private_safeDarken,ht.success.light,.6)),setColor(ht.Alert,"warningColor",mt(private_safeDarken,ht.warning.light,.6)),setColor(ht.Alert,"errorFilledBg",bt("palette-error-main")),setColor(ht.Alert,"infoFilledBg",bt("palette-info-main")),setColor(ht.Alert,"successFilledBg",bt("palette-success-main")),setColor(ht.Alert,"warningFilledBg",bt("palette-warning-main")),setColor(ht.Alert,"errorFilledColor",silent(()=>ht.getContrastText(ht.error.main))),setColor(ht.Alert,"infoFilledColor",silent(()=>ht.getContrastText(ht.info.main))),setColor(ht.Alert,"successFilledColor",silent(()=>ht.getContrastText(ht.success.main))),setColor(ht.Alert,"warningFilledColor",silent(()=>ht.getContrastText(ht.warning.main))),setColor(ht.Alert,"errorStandardBg",mt(private_safeLighten,ht.error.light,.9)),setColor(ht.Alert,"infoStandardBg",mt(private_safeLighten,ht.info.light,.9)),setColor(ht.Alert,"successStandardBg",mt(private_safeLighten,ht.success.light,.9)),setColor(ht.Alert,"warningStandardBg",mt(private_safeLighten,ht.warning.light,.9)),setColor(ht.Alert,"errorIconColor",bt("palette-error-main")),setColor(ht.Alert,"infoIconColor",bt("palette-info-main")),setColor(ht.Alert,"successIconColor",bt("palette-success-main")),setColor(ht.Alert,"warningIconColor",bt("palette-warning-main")),setColor(ht.AppBar,"defaultBg",bt("palette-grey-100")),setColor(ht.Avatar,"defaultBg",bt("palette-grey-400")),setColor(ht.Button,"inheritContainedBg",bt("palette-grey-300")),setColor(ht.Button,"inheritContainedHoverBg",bt("palette-grey-A100")),setColor(ht.Chip,"defaultBorder",bt("palette-grey-400")),setColor(ht.Chip,"defaultAvatarColor",bt("palette-grey-700")),setColor(ht.Chip,"defaultIconColor",bt("palette-grey-700")),setColor(ht.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),setColor(ht.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),setColor(ht.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),setColor(ht.LinearProgress,"primaryBg",mt(private_safeLighten,ht.primary.main,.62)),setColor(ht.LinearProgress,"secondaryBg",mt(private_safeLighten,ht.secondary.main,.62)),setColor(ht.LinearProgress,"errorBg",mt(private_safeLighten,ht.error.main,.62)),setColor(ht.LinearProgress,"infoBg",mt(private_safeLighten,ht.info.main,.62)),setColor(ht.LinearProgress,"successBg",mt(private_safeLighten,ht.success.main,.62)),setColor(ht.LinearProgress,"warningBg",mt(private_safeLighten,ht.warning.main,.62)),setColor(ht.Skeleton,"bg",wt?mt(private_safeAlpha,ht.text.primary,.11):`rgba(${bt("palette-text-primaryChannel")} / 0.11)`),setColor(ht.Slider,"primaryTrack",mt(private_safeLighten,ht.primary.main,.62)),setColor(ht.Slider,"secondaryTrack",mt(private_safeLighten,ht.secondary.main,.62)),setColor(ht.Slider,"errorTrack",mt(private_safeLighten,ht.error.main,.62)),setColor(ht.Slider,"infoTrack",mt(private_safeLighten,ht.info.main,.62)),setColor(ht.Slider,"successTrack",mt(private_safeLighten,ht.success.main,.62)),setColor(ht.Slider,"warningTrack",mt(private_safeLighten,ht.warning.main,.62));const gt=wt?mt(private_safeDarken,ht.background.default,.6825):private_safeEmphasize(ht.background.default,.8);setColor(ht.SnackbarContent,"bg",gt),setColor(ht.SnackbarContent,"color",silent(()=>wt?dark.text.primary:ht.getContrastText(gt))),setColor(ht.SpeedDialAction,"fabHoverBg",private_safeEmphasize(ht.background.paper,.15)),setColor(ht.StepConnector,"border",bt("palette-grey-400")),setColor(ht.StepContent,"border",bt("palette-grey-400")),setColor(ht.Switch,"defaultColor",bt("palette-common-white")),setColor(ht.Switch,"defaultDisabledColor",bt("palette-grey-100")),setColor(ht.Switch,"primaryDisabledColor",mt(private_safeLighten,ht.primary.main,.62)),setColor(ht.Switch,"secondaryDisabledColor",mt(private_safeLighten,ht.secondary.main,.62)),setColor(ht.Switch,"errorDisabledColor",mt(private_safeLighten,ht.error.main,.62)),setColor(ht.Switch,"infoDisabledColor",mt(private_safeLighten,ht.info.main,.62)),setColor(ht.Switch,"successDisabledColor",mt(private_safeLighten,ht.success.main,.62)),setColor(ht.Switch,"warningDisabledColor",mt(private_safeLighten,ht.warning.main,.62)),setColor(ht.TableCell,"border",mt(private_safeLighten,mt(private_safeAlpha,ht.divider,1),.88)),setColor(ht.Tooltip,"bg",mt(private_safeAlpha,ht.grey[700],.92))}if(ht.mode==="dark"){setColor(ht.Alert,"errorColor",mt(private_safeLighten,ht.error.light,.6)),setColor(ht.Alert,"infoColor",mt(private_safeLighten,ht.info.light,.6)),setColor(ht.Alert,"successColor",mt(private_safeLighten,ht.success.light,.6)),setColor(ht.Alert,"warningColor",mt(private_safeLighten,ht.warning.light,.6)),setColor(ht.Alert,"errorFilledBg",bt("palette-error-dark")),setColor(ht.Alert,"infoFilledBg",bt("palette-info-dark")),setColor(ht.Alert,"successFilledBg",bt("palette-success-dark")),setColor(ht.Alert,"warningFilledBg",bt("palette-warning-dark")),setColor(ht.Alert,"errorFilledColor",silent(()=>ht.getContrastText(ht.error.dark))),setColor(ht.Alert,"infoFilledColor",silent(()=>ht.getContrastText(ht.info.dark))),setColor(ht.Alert,"successFilledColor",silent(()=>ht.getContrastText(ht.success.dark))),setColor(ht.Alert,"warningFilledColor",silent(()=>ht.getContrastText(ht.warning.dark))),setColor(ht.Alert,"errorStandardBg",mt(private_safeDarken,ht.error.light,.9)),setColor(ht.Alert,"infoStandardBg",mt(private_safeDarken,ht.info.light,.9)),setColor(ht.Alert,"successStandardBg",mt(private_safeDarken,ht.success.light,.9)),setColor(ht.Alert,"warningStandardBg",mt(private_safeDarken,ht.warning.light,.9)),setColor(ht.Alert,"errorIconColor",bt("palette-error-main")),setColor(ht.Alert,"infoIconColor",bt("palette-info-main")),setColor(ht.Alert,"successIconColor",bt("palette-success-main")),setColor(ht.Alert,"warningIconColor",bt("palette-warning-main")),setColor(ht.AppBar,"defaultBg",bt("palette-grey-900")),setColor(ht.AppBar,"darkBg",bt("palette-background-paper")),setColor(ht.AppBar,"darkColor",bt("palette-text-primary")),setColor(ht.Avatar,"defaultBg",bt("palette-grey-600")),setColor(ht.Button,"inheritContainedBg",bt("palette-grey-800")),setColor(ht.Button,"inheritContainedHoverBg",bt("palette-grey-700")),setColor(ht.Chip,"defaultBorder",bt("palette-grey-700")),setColor(ht.Chip,"defaultAvatarColor",bt("palette-grey-300")),setColor(ht.Chip,"defaultIconColor",bt("palette-grey-300")),setColor(ht.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),setColor(ht.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),setColor(ht.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),setColor(ht.LinearProgress,"primaryBg",mt(private_safeDarken,ht.primary.main,.5)),setColor(ht.LinearProgress,"secondaryBg",mt(private_safeDarken,ht.secondary.main,.5)),setColor(ht.LinearProgress,"errorBg",mt(private_safeDarken,ht.error.main,.5)),setColor(ht.LinearProgress,"infoBg",mt(private_safeDarken,ht.info.main,.5)),setColor(ht.LinearProgress,"successBg",mt(private_safeDarken,ht.success.main,.5)),setColor(ht.LinearProgress,"warningBg",mt(private_safeDarken,ht.warning.main,.5)),setColor(ht.Skeleton,"bg",wt?mt(private_safeAlpha,ht.text.primary,.13):`rgba(${bt("palette-text-primaryChannel")} / 0.13)`),setColor(ht.Slider,"primaryTrack",mt(private_safeDarken,ht.primary.main,.5)),setColor(ht.Slider,"secondaryTrack",mt(private_safeDarken,ht.secondary.main,.5)),setColor(ht.Slider,"errorTrack",mt(private_safeDarken,ht.error.main,.5)),setColor(ht.Slider,"infoTrack",mt(private_safeDarken,ht.info.main,.5)),setColor(ht.Slider,"successTrack",mt(private_safeDarken,ht.success.main,.5)),setColor(ht.Slider,"warningTrack",mt(private_safeDarken,ht.warning.main,.5));const gt=wt?mt(private_safeLighten,ht.background.default,.985):private_safeEmphasize(ht.background.default,.98);setColor(ht.SnackbarContent,"bg",gt),setColor(ht.SnackbarContent,"color",silent(()=>wt?light.text.primary:ht.getContrastText(gt))),setColor(ht.SpeedDialAction,"fabHoverBg",private_safeEmphasize(ht.background.paper,.15)),setColor(ht.StepConnector,"border",bt("palette-grey-600")),setColor(ht.StepContent,"border",bt("palette-grey-600")),setColor(ht.Switch,"defaultColor",bt("palette-grey-300")),setColor(ht.Switch,"defaultDisabledColor",bt("palette-grey-600")),setColor(ht.Switch,"primaryDisabledColor",mt(private_safeDarken,ht.primary.main,.55)),setColor(ht.Switch,"secondaryDisabledColor",mt(private_safeDarken,ht.secondary.main,.55)),setColor(ht.Switch,"errorDisabledColor",mt(private_safeDarken,ht.error.main,.55)),setColor(ht.Switch,"infoDisabledColor",mt(private_safeDarken,ht.info.main,.55)),setColor(ht.Switch,"successDisabledColor",mt(private_safeDarken,ht.success.main,.55)),setColor(ht.Switch,"warningDisabledColor",mt(private_safeDarken,ht.warning.main,.55)),setColor(ht.TableCell,"border",mt(private_safeDarken,mt(private_safeAlpha,ht.divider,1),.68)),setColor(ht.Tooltip,"bg",mt(private_safeAlpha,ht.grey[700],.92))}setColorChannel(ht.background,"default"),setColorChannel(ht.background,"paper"),setColorChannel(ht.common,"background"),setColorChannel(ht.common,"onBackground"),setColorChannel(ht,"divider"),Object.keys(ht).forEach(gt=>{const xt=ht[gt];gt!=="tonalOffset"&&xt&&typeof xt=="object"&&(xt.main&&setColor(ht[gt],"mainChannel",private_safeColorChannel(toRgb(xt.main))),xt.light&&setColor(ht[gt],"lightChannel",private_safeColorChannel(toRgb(xt.light))),xt.dark&&setColor(ht[gt],"darkChannel",private_safeColorChannel(toRgb(xt.dark))),xt.contrastText&&setColor(ht[gt],"contrastTextChannel",private_safeColorChannel(toRgb(xt.contrastText))),gt==="text"&&(setColorChannel(ht[gt],"primary"),setColorChannel(ht[gt],"secondary")),gt==="action"&&(xt.active&&setColorChannel(ht[gt],"active"),xt.selected&&setColorChannel(ht[gt],"selected")))})}),Pt=_.reduce((Tt,ht)=>deepmerge$2(Tt,ht),Pt);const Bt={prefix:et,disableCssColorScheme:_e,shouldSkipGeneratingVar:rt,getSelector:defaultGetSelector(Pt),enableContrastVars:tt},{vars:At,generateThemeVars:kt,generateStyleSheets:Ot}=prepareCssVars(Pt,Bt);return Pt.vars=At,Object.entries(Pt.colorSchemes[Pt.defaultColorScheme]).forEach(([Tt,ht])=>{Pt[Tt]=ht}),Pt.generateThemeVars=kt,Pt.generateStyleSheets=Ot,Pt.generateSpacing=function(){return createSpacing(it.spacing,createUnarySpacing(this))},Pt.getColorSchemeSelector=createGetColorSchemeSelector(nt),Pt.spacing=Pt.generateSpacing(),Pt.shouldSkipGeneratingVar=rt,Pt.unstable_sxConfig={...defaultSxConfig,...it==null?void 0:it.unstable_sxConfig},Pt.unstable_sx=function(ht){return styleFunctionSx({sx:ht,theme:this})},Pt.toRuntimeSource=stringifyTheme,Pt}function attachColorScheme(o,_,$){o.colorSchemes&&$&&(o.colorSchemes[_]={...$!==!0&&$,palette:createPalette({...$===!0?{}:$.palette,mode:_})})}function createTheme(o={},..._){const{palette:$,cssVariables:j=!1,colorSchemes:_e=$?void 0:{light:!0},defaultColorScheme:et=$==null?void 0:$.mode,...tt}=o,rt=et||"light",nt=_e==null?void 0:_e[rt],ot={..._e,...$?{[rt]:{...typeof nt!="boolean"&&nt,palette:$}}:void 0};if(j===!1){if(!("colorSchemes"in o))return createThemeNoVars(o,..._);let it=$;"palette"in o||ot[rt]&&(ot[rt]!==!0?it=ot[rt].palette:rt==="dark"&&(it={mode:"dark"}));const st=createThemeNoVars({...o,palette:it},..._);return st.defaultColorScheme=rt,st.colorSchemes=ot,st.palette.mode==="light"&&(st.colorSchemes.light={...ot.light!==!0&&ot.light,palette:st.palette},attachColorScheme(st,"dark",ot.dark)),st.palette.mode==="dark"&&(st.colorSchemes.dark={...ot.dark!==!0&&ot.dark,palette:st.palette},attachColorScheme(st,"light",ot.light)),st}return!$&&!("light"in ot)&&rt==="light"&&(ot.light=!0),createThemeWithVars({...tt,colorSchemes:ot,defaultColorScheme:rt,...typeof j!="boolean"&&j},..._)}function getUnit(o){return String(o).match(/[\d.\-+]*\s*(.*)/)[1]||""}function toUnitless(o){return parseFloat(o)}const defaultTheme$1=createTheme();function useTheme(){const o=useTheme$2(defaultTheme$1);return o[THEME_ID]||o}function slotShouldForwardProp(o){return o!=="ownerState"&&o!=="theme"&&o!=="sx"&&o!=="as"}const rootShouldForwardProp=o=>slotShouldForwardProp(o)&&o!=="classes",styled=createStyled({themeId:THEME_ID,defaultTheme:defaultTheme$1,rootShouldForwardProp});function ThemeProviderNoVars({theme:o,..._}){const $=THEME_ID in o?o[THEME_ID]:void 0;return jsxRuntimeExports.jsx(ThemeProvider$2,{..._,themeId:$?THEME_ID:void 0,theme:$||o})}const defaultConfig$1={colorSchemeStorageKey:"mui-color-scheme",defaultLightColorScheme:"light",defaultDarkColorScheme:"dark",modeStorageKey:"mui-mode"},{CssVarsProvider:InternalCssVarsProvider}=createCssVarsProvider({themeId:THEME_ID,theme:()=>createTheme({cssVariables:!0}),colorSchemeStorageKey:defaultConfig$1.colorSchemeStorageKey,modeStorageKey:defaultConfig$1.modeStorageKey,defaultColorScheme:{light:defaultConfig$1.defaultLightColorScheme,dark:defaultConfig$1.defaultDarkColorScheme},resolveTheme:o=>{const _={...o,typography:createTypography(o.palette,o.typography)};return _.unstable_sx=function(j){return styleFunctionSx({sx:j,theme:this})},_}}),CssVarsProvider=InternalCssVarsProvider;function ThemeProvider$1({theme:o,..._}){const $=reactExports.useMemo(()=>{if(typeof o=="function")return o;const j=THEME_ID in o?o[THEME_ID]:o;return"colorSchemes"in j?null:"vars"in j?o:{...o,vars:null}},[o]);return $?jsxRuntimeExports.jsx(ThemeProviderNoVars,{theme:$,..._}):jsxRuntimeExports.jsx(CssVarsProvider,{theme:o,..._})}function createChainedFunction(...o){return o.reduce((_,$)=>$==null?_:function(..._e){_.apply(this,_e),$.apply(this,_e)},()=>{})}function GlobalStyles$1(o){return jsxRuntimeExports.jsx(GlobalStyles$2,{...o,defaultTheme:defaultTheme$1,themeId:THEME_ID})}function globalCss(o){return function($){return jsxRuntimeExports.jsx(GlobalStyles$1,{styles:typeof o=="function"?j=>o({theme:j,...$}):o})}}function internal_createExtendSxProp(){return extendSxProp$1}const memoTheme=unstable_memoTheme;function useDefaultProps(o){return useDefaultProps$1(o)}function getSvgIconUtilityClass(o){return generateUtilityClass("MuiSvgIcon",o)}generateUtilityClasses("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const useUtilityClasses$W=o=>{const{color:_,fontSize:$,classes:j}=o,_e={root:["root",_!=="inherit"&&`color${capitalize(_)}`,`fontSize${capitalize($)}`]};return composeClasses(_e,getSvgIconUtilityClass,j)},SvgIconRoot=styled("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.color!=="inherit"&&_[`color${capitalize($.color)}`],_[`fontSize${capitalize($.fontSize)}`]]}})(memoTheme(({theme:o})=>{var _,$,j,_e,et,tt,rt,nt,ot,it,st,at,lt,ct;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(_e=(_=o.transitions)==null?void 0:_.create)==null?void 0:_e.call(_,"fill",{duration:(j=($=(o.vars??o).transitions)==null?void 0:$.duration)==null?void 0:j.shorter}),variants:[{props:ft=>!ft.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((tt=(et=o.typography)==null?void 0:et.pxToRem)==null?void 0:tt.call(et,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((nt=(rt=o.typography)==null?void 0:rt.pxToRem)==null?void 0:nt.call(rt,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((it=(ot=o.typography)==null?void 0:ot.pxToRem)==null?void 0:it.call(ot,35))||"2.1875rem"}},...Object.entries((o.vars??o).palette).filter(([,ft])=>ft&&ft.main).map(([ft])=>{var dt,pt;return{props:{color:ft},style:{color:(pt=(dt=(o.vars??o).palette)==null?void 0:dt[ft])==null?void 0:pt.main}}}),{props:{color:"action"},style:{color:(at=(st=(o.vars??o).palette)==null?void 0:st.action)==null?void 0:at.active}},{props:{color:"disabled"},style:{color:(ct=(lt=(o.vars??o).palette)==null?void 0:lt.action)==null?void 0:ct.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),SvgIcon=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiSvgIcon"}),{children:_e,className:et,color:tt="inherit",component:rt="svg",fontSize:nt="medium",htmlColor:ot,inheritViewBox:it=!1,titleAccess:st,viewBox:at="0 0 24 24",...lt}=j,ct=reactExports.isValidElement(_e)&&_e.type==="svg",ft={...j,color:tt,component:rt,fontSize:nt,instanceFontSize:_.fontSize,inheritViewBox:it,viewBox:at,hasSvgAsChild:ct},dt={};it||(dt.viewBox=at);const pt=useUtilityClasses$W(ft);return jsxRuntimeExports.jsxs(SvgIconRoot,{as:rt,className:clsx(pt.root,et),focusable:"false",color:ot,"aria-hidden":st?void 0:!0,role:st?"img":void 0,ref:$,...dt,...lt,...ct&&_e.props,ownerState:ft,children:[ct?_e.props.children:_e,st?jsxRuntimeExports.jsx("title",{children:st}):null]})});SvgIcon.muiName="SvgIcon";function createSvgIcon(o,_){function $(j,_e){return jsxRuntimeExports.jsx(SvgIcon,{"data-testid":void 0,ref:_e,...j,children:o})}return $.muiName=SvgIcon.muiName,reactExports.memo(reactExports.forwardRef($))}function debounce$3(o,_=166){let $;function j(..._e){const et=()=>{o.apply(this,_e)};clearTimeout($),$=setTimeout(et,_)}return j.clear=()=>{clearTimeout($)},j}function ownerDocument(o){return o&&o.ownerDocument||document}function ownerWindow(o){return ownerDocument(o).defaultView||window}function setRef$1(o,_){typeof o=="function"?o(_):o&&(o.current=_)}function useControlled(o){const{controlled:_,default:$,name:j,state:_e="value"}=o,{current:et}=reactExports.useRef(_!==void 0),[tt,rt]=reactExports.useState($),nt=et?_:tt,ot=reactExports.useCallback(it=>{et||rt(it)},[]);return[nt,ot]}function useEventCallback(o){const _=reactExports.useRef(o);return useEnhancedEffect(()=>{_.current=o}),reactExports.useRef((...$)=>(0,_.current)(...$)).current}function useForkRef(...o){const _=reactExports.useRef(void 0),$=reactExports.useCallback(j=>{const _e=o.map(et=>{if(et==null)return null;if(typeof et=="function"){const tt=et,rt=tt(j);return typeof rt=="function"?rt:()=>{tt(null)}}return et.current=j,()=>{et.current=null}});return()=>{_e.forEach(et=>et==null?void 0:et())}},o);return reactExports.useMemo(()=>o.every(j=>j==null)?null:j=>{_.current&&(_.current(),_.current=void 0),j!=null&&(_.current=$(j))},o)}function isEventHandler(o,_){const $=o.charCodeAt(2);return o[0]==="o"&&o[1]==="n"&&$>=65&&$<=90&&typeof _=="function"}function mergeSlotProps$1(o,_){if(!o)return _;function $(tt,rt){const nt={};return Object.keys(rt).forEach(ot=>{isEventHandler(ot,rt[ot])&&typeof tt[ot]=="function"&&(nt[ot]=(...it)=>{tt[ot](...it),rt[ot](...it)})}),nt}if(typeof o=="function"||typeof _=="function")return tt=>{const rt=typeof _=="function"?_(tt):_,nt=typeof o=="function"?o({...tt,...rt}):o,ot=clsx(tt==null?void 0:tt.className,rt==null?void 0:rt.className,nt==null?void 0:nt.className),it=$(nt,rt);return{...rt,...nt,...it,...!!ot&&{className:ot},...(rt==null?void 0:rt.style)&&(nt==null?void 0:nt.style)&&{style:{...rt.style,...nt.style}},...(rt==null?void 0:rt.sx)&&(nt==null?void 0:nt.sx)&&{sx:[...Array.isArray(rt.sx)?rt.sx:[rt.sx],...Array.isArray(nt.sx)?nt.sx:[nt.sx]]}}};const j=_,_e=$(o,j),et=clsx(j==null?void 0:j.className,o==null?void 0:o.className);return{..._,...o,..._e,...!!et&&{className:et},...(j==null?void 0:j.style)&&(o==null?void 0:o.style)&&{style:{...j.style,...o.style}},...(j==null?void 0:j.sx)&&(o==null?void 0:o.sx)&&{sx:[...Array.isArray(j.sx)?j.sx:[j.sx],...Array.isArray(o.sx)?o.sx:[o.sx]]}}}function _objectWithoutPropertiesLoose$f(o,_){if(o==null)return{};var $={};for(var j in o)if({}.hasOwnProperty.call(o,j)){if(_.indexOf(j)!==-1)continue;$[j]=o[j]}return $}function _setPrototypeOf(o,_){return _setPrototypeOf=Object.setPrototypeOf?Object.setPrototypeOf.bind():function($,j){return $.__proto__=j,$},_setPrototypeOf(o,_)}function _inheritsLoose(o,_){o.prototype=Object.create(_.prototype),o.prototype.constructor=o,_setPrototypeOf(o,_)}const config$1={disabled:!1},TransitionGroupContext=React$3.createContext(null);var forceReflow=function(_){return _.scrollTop},UNMOUNTED="unmounted",EXITED="exited",ENTERING="entering",ENTERED="entered",EXITING="exiting",Transition=function(o){_inheritsLoose(_,o);function _(j,_e){var et;et=o.call(this,j,_e)||this;var tt=_e,rt=tt&&!tt.isMounting?j.enter:j.appear,nt;return et.appearStatus=null,j.in?rt?(nt=EXITED,et.appearStatus=ENTERING):nt=ENTERED:j.unmountOnExit||j.mountOnEnter?nt=UNMOUNTED:nt=EXITED,et.state={status:nt},et.nextCallback=null,et}_.getDerivedStateFromProps=function(_e,et){var tt=_e.in;return tt&&et.status===UNMOUNTED?{status:EXITED}:null};var $=_.prototype;return $.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},$.componentDidUpdate=function(_e){var et=null;if(_e!==this.props){var tt=this.state.status;this.props.in?tt!==ENTERING&&tt!==ENTERED&&(et=ENTERING):(tt===ENTERING||tt===ENTERED)&&(et=EXITING)}this.updateStatus(!1,et)},$.componentWillUnmount=function(){this.cancelNextCallback()},$.getTimeouts=function(){var _e=this.props.timeout,et,tt,rt;return et=tt=rt=_e,_e!=null&&typeof _e!="number"&&(et=_e.exit,tt=_e.enter,rt=_e.appear!==void 0?_e.appear:tt),{exit:et,enter:tt,appear:rt}},$.updateStatus=function(_e,et){if(_e===void 0&&(_e=!1),et!==null)if(this.cancelNextCallback(),et===ENTERING){if(this.props.unmountOnExit||this.props.mountOnEnter){var tt=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this);tt&&forceReflow(tt)}this.performEnter(_e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===EXITED&&this.setState({status:UNMOUNTED})},$.performEnter=function(_e){var et=this,tt=this.props.enter,rt=this.context?this.context.isMounting:_e,nt=this.props.nodeRef?[rt]:[ReactDOM.findDOMNode(this),rt],ot=nt[0],it=nt[1],st=this.getTimeouts(),at=rt?st.appear:st.enter;if(!_e&&!tt||config$1.disabled){this.safeSetState({status:ENTERED},function(){et.props.onEntered(ot)});return}this.props.onEnter(ot,it),this.safeSetState({status:ENTERING},function(){et.props.onEntering(ot,it),et.onTransitionEnd(at,function(){et.safeSetState({status:ENTERED},function(){et.props.onEntered(ot,it)})})})},$.performExit=function(){var _e=this,et=this.props.exit,tt=this.getTimeouts(),rt=this.props.nodeRef?void 0:ReactDOM.findDOMNode(this);if(!et||config$1.disabled){this.safeSetState({status:EXITED},function(){_e.props.onExited(rt)});return}this.props.onExit(rt),this.safeSetState({status:EXITING},function(){_e.props.onExiting(rt),_e.onTransitionEnd(tt.exit,function(){_e.safeSetState({status:EXITED},function(){_e.props.onExited(rt)})})})},$.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},$.safeSetState=function(_e,et){et=this.setNextCallback(et),this.setState(_e,et)},$.setNextCallback=function(_e){var et=this,tt=!0;return this.nextCallback=function(rt){tt&&(tt=!1,et.nextCallback=null,_e(rt))},this.nextCallback.cancel=function(){tt=!1},this.nextCallback},$.onTransitionEnd=function(_e,et){this.setNextCallback(et);var tt=this.props.nodeRef?this.props.nodeRef.current:ReactDOM.findDOMNode(this),rt=_e==null&&!this.props.addEndListener;if(!tt||rt){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var nt=this.props.nodeRef?[this.nextCallback]:[tt,this.nextCallback],ot=nt[0],it=nt[1];this.props.addEndListener(ot,it)}_e!=null&&setTimeout(this.nextCallback,_e)},$.render=function(){var _e=this.state.status;if(_e===UNMOUNTED)return null;var et=this.props,tt=et.children;et.in,et.mountOnEnter,et.unmountOnExit,et.appear,et.enter,et.exit,et.timeout,et.addEndListener,et.onEnter,et.onEntering,et.onEntered,et.onExit,et.onExiting,et.onExited,et.nodeRef;var rt=_objectWithoutPropertiesLoose$f(et,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return React$3.createElement(TransitionGroupContext.Provider,{value:null},typeof tt=="function"?tt(_e,rt):React$3.cloneElement(React$3.Children.only(tt),rt))},_}(React$3.Component);Transition.contextType=TransitionGroupContext;Transition.propTypes={};function noop$6(){}Transition.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:noop$6,onEntering:noop$6,onEntered:noop$6,onExit:noop$6,onExiting:noop$6,onExited:noop$6};Transition.UNMOUNTED=UNMOUNTED;Transition.EXITED=EXITED;Transition.ENTERING=ENTERING;Transition.ENTERED=ENTERED;Transition.EXITING=EXITING;function _assertThisInitialized(o){if(o===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return o}function getChildMapping(o,_){var $=function(et){return _&&reactExports.isValidElement(et)?_(et):et},j=Object.create(null);return o&&reactExports.Children.map(o,function(_e){return _e}).forEach(function(_e){j[_e.key]=$(_e)}),j}function mergeChildMappings(o,_){o=o||{},_=_||{};function $(it){return it in _?_[it]:o[it]}var j=Object.create(null),_e=[];for(var et in o)et in _?_e.length&&(j[et]=_e,_e=[]):_e.push(et);var tt,rt={};for(var nt in _){if(j[nt])for(tt=0;tt{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)});vn(this,"disposeEffect",()=>this.clear)}static create(){return new Timeout}start(_,$){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,$()},_)}}function useTimeout(){const o=useLazyRef(Timeout.create).current;return useOnMount(o.disposeEffect),o}const reflow=o=>o.scrollTop;function getTransitionProps(o,_){const{timeout:$,easing:j,style:_e={}}=o;return{duration:_e.transitionDuration??(typeof $=="number"?$:$[_.mode]||0),easing:_e.transitionTimingFunction??(typeof j=="object"?j[_.mode]:j),delay:_e.transitionDelay}}function isHostComponent(o){return typeof o=="string"}function appendOwnerState(o,_,$){return o===void 0||isHostComponent(o)?_:{..._,ownerState:{..._.ownerState,...$}}}function resolveComponentProps(o,_,$){return typeof o=="function"?o(_,$):o}function extractEventHandlers(o,_=[]){if(o===void 0)return{};const $={};return Object.keys(o).filter(j=>j.match(/^on[A-Z]/)&&typeof o[j]=="function"&&!_.includes(j)).forEach(j=>{$[j]=o[j]}),$}function omitEventHandlers(o){if(o===void 0)return{};const _={};return Object.keys(o).filter($=>!($.match(/^on[A-Z]/)&&typeof o[$]=="function")).forEach($=>{_[$]=o[$]}),_}function mergeSlotProps(o){const{getSlotProps:_,additionalProps:$,externalSlotProps:j,externalForwardedProps:_e,className:et}=o;if(!_){const lt=clsx($==null?void 0:$.className,et,_e==null?void 0:_e.className,j==null?void 0:j.className),ct={...$==null?void 0:$.style,..._e==null?void 0:_e.style,...j==null?void 0:j.style},ft={...$,..._e,...j};return lt.length>0&&(ft.className=lt),Object.keys(ct).length>0&&(ft.style=ct),{props:ft,internalRef:void 0}}const tt=extractEventHandlers({..._e,...j}),rt=omitEventHandlers(j),nt=omitEventHandlers(_e),ot=_(tt),it=clsx(ot==null?void 0:ot.className,$==null?void 0:$.className,et,_e==null?void 0:_e.className,j==null?void 0:j.className),st={...ot==null?void 0:ot.style,...$==null?void 0:$.style,..._e==null?void 0:_e.style,...j==null?void 0:j.style},at={...ot,...$,...nt,...rt};return it.length>0&&(at.className=it),Object.keys(st).length>0&&(at.style=st),{props:at,internalRef:ot.ref}}function useSlot(o,_){const{className:$,elementType:j,ownerState:_e,externalForwardedProps:et,internalForwardedProps:tt,shouldForwardComponentProp:rt=!1,...nt}=_,{component:ot,slots:it={[o]:void 0},slotProps:st={[o]:void 0},...at}=et,lt=it[o]||j,ct=resolveComponentProps(st[o],_e),{props:{component:ft,...dt},internalRef:pt}=mergeSlotProps({className:$,...nt,externalForwardedProps:o==="root"?at:void 0,externalSlotProps:ct}),yt=useForkRef(pt,ct==null?void 0:ct.ref,_.ref),vt=o==="root"?ft||ot:ft,wt=appendOwnerState(lt,{...o==="root"&&!ot&&!it[o]&&tt,...o!=="root"&&!it[o]&&tt,...dt,...vt&&!rt&&{as:vt},...vt&&rt&&{component:vt},ref:yt},_e);return[lt,wt]}function getCollapseUtilityClass(o){return generateUtilityClass("MuiCollapse",o)}generateUtilityClasses("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const useUtilityClasses$V=o=>{const{orientation:_,classes:$}=o,j={root:["root",`${_}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${_}`],wrapperInner:["wrapperInner",`${_}`]};return composeClasses(j,getCollapseUtilityClass,$)},CollapseRoot=styled("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.orientation],$.state==="entered"&&_.entered,$.state==="exited"&&!$.in&&$.collapsedSize==="0px"&&_.hidden]}})(memoTheme(({theme:o})=>({height:0,overflow:"hidden",transition:o.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:o.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:_})=>_.state==="exited"&&!_.in&&_.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),CollapseWrapper=styled("div",{name:"MuiCollapse",slot:"Wrapper"})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),CollapseWrapperInner=styled("div",{name:"MuiCollapse",slot:"WrapperInner"})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),Collapse=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiCollapse"}),{addEndListener:_e,children:et,className:tt,collapsedSize:rt="0px",component:nt,easing:ot,in:it,onEnter:st,onEntered:at,onEntering:lt,onExit:ct,onExited:ft,onExiting:dt,orientation:pt="vertical",slots:yt={},slotProps:vt={},style:wt,timeout:Ct=duration.standard,TransitionComponent:Pt=Transition,...Bt}=j,At={...j,orientation:pt,collapsedSize:rt},kt=useUtilityClasses$V(At),Ot=useTheme(),Tt=useTimeout(),ht=reactExports.useRef(null),bt=reactExports.useRef(),mt=typeof rt=="number"?`${rt}px`:rt,gt=pt==="horizontal",xt=gt?"width":"height",Et=reactExports.useRef(null),_t=useForkRef($,Et),$t=Jt=>tr=>{if(Jt){const nr=Et.current;tr===void 0?Jt(nr):Jt(nr,tr)}},St=()=>ht.current?ht.current[gt?"clientWidth":"clientHeight"]:0,Rt=$t((Jt,tr)=>{ht.current&>&&(ht.current.style.position="absolute"),Jt.style[xt]=mt,st&&st(Jt,tr)}),It=$t((Jt,tr)=>{const nr=St();ht.current&>&&(ht.current.style.position="");const{duration:ur,easing:rr}=getTransitionProps({style:wt,timeout:Ct,easing:ot},{mode:"enter"});if(Ct==="auto"){const pr=Ot.transitions.getAutoHeightDuration(nr);Jt.style.transitionDuration=`${pr}ms`,bt.current=pr}else Jt.style.transitionDuration=typeof ur=="string"?ur:`${ur}ms`;Jt.style[xt]=`${nr}px`,Jt.style.transitionTimingFunction=rr,lt&<(Jt,tr)}),Mt=$t((Jt,tr)=>{Jt.style[xt]="auto",at&&at(Jt,tr)}),Vt=$t(Jt=>{Jt.style[xt]=`${St()}px`,ct&&ct(Jt)}),Gt=$t(ft),zt=$t(Jt=>{const tr=St(),{duration:nr,easing:ur}=getTransitionProps({style:wt,timeout:Ct,easing:ot},{mode:"exit"});if(Ct==="auto"){const rr=Ot.transitions.getAutoHeightDuration(tr);Jt.style.transitionDuration=`${rr}ms`,bt.current=rr}else Jt.style.transitionDuration=typeof nr=="string"?nr:`${nr}ms`;Jt.style[xt]=mt,Jt.style.transitionTimingFunction=ur,dt&&dt(Jt)}),jt=Jt=>{Ct==="auto"&&Tt.start(bt.current||0,Jt),_e&&_e(Et.current,Jt)},Ft={slots:yt,slotProps:vt,component:nt},[qt,Xt]=useSlot("root",{ref:_t,className:clsx(kt.root,tt),elementType:CollapseRoot,externalForwardedProps:Ft,ownerState:At,additionalProps:{style:{[gt?"minWidth":"minHeight"]:mt,...wt}}}),[Ut,Lt]=useSlot("wrapper",{ref:ht,className:kt.wrapper,elementType:CollapseWrapper,externalForwardedProps:Ft,ownerState:At}),[Ht,Kt]=useSlot("wrapperInner",{className:kt.wrapperInner,elementType:CollapseWrapperInner,externalForwardedProps:Ft,ownerState:At});return jsxRuntimeExports.jsx(Pt,{in:it,onEnter:Rt,onEntered:Mt,onEntering:It,onExit:Vt,onExited:Gt,onExiting:zt,addEndListener:jt,nodeRef:Et,timeout:Ct==="auto"?null:Ct,...Bt,children:(Jt,{ownerState:tr,...nr})=>{const ur={...At,state:Jt};return jsxRuntimeExports.jsx(qt,{...Xt,className:clsx(Xt.className,{entered:kt.entered,exited:!it&&mt==="0px"&&kt.hidden}[Jt]),ownerState:ur,...nr,children:jsxRuntimeExports.jsx(Ut,{...Lt,ownerState:ur,children:jsxRuntimeExports.jsx(Ht,{...Kt,ownerState:ur,children:et})})})}})});Collapse&&(Collapse.muiSupportAuto=!0);function getPaperUtilityClass(o){return generateUtilityClass("MuiPaper",o)}generateUtilityClasses("MuiPaper",["root","rounded","outlined","elevation","elevation0","elevation1","elevation2","elevation3","elevation4","elevation5","elevation6","elevation7","elevation8","elevation9","elevation10","elevation11","elevation12","elevation13","elevation14","elevation15","elevation16","elevation17","elevation18","elevation19","elevation20","elevation21","elevation22","elevation23","elevation24"]);const useUtilityClasses$U=o=>{const{square:_,elevation:$,variant:j,classes:_e}=o,et={root:["root",j,!_&&"rounded",j==="elevation"&&`elevation${$}`]};return composeClasses(et,getPaperUtilityClass,_e)},PaperRoot=styled("div",{name:"MuiPaper",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.variant],!$.square&&_.rounded,$.variant==="elevation"&&_[`elevation${$.elevation}`]]}})(memoTheme(({theme:o})=>({backgroundColor:(o.vars||o).palette.background.paper,color:(o.vars||o).palette.text.primary,transition:o.transitions.create("box-shadow"),variants:[{props:({ownerState:_})=>!_.square,style:{borderRadius:o.shape.borderRadius}},{props:{variant:"outlined"},style:{border:`1px solid ${(o.vars||o).palette.divider}`}},{props:{variant:"elevation"},style:{boxShadow:"var(--Paper-shadow)",backgroundImage:"var(--Paper-overlay)"}}]}))),Paper=reactExports.forwardRef(function(_,$){var lt;const j=useDefaultProps({props:_,name:"MuiPaper"}),_e=useTheme(),{className:et,component:tt="div",elevation:rt=1,square:nt=!1,variant:ot="elevation",...it}=j,st={...j,component:tt,elevation:rt,square:nt,variant:ot},at=useUtilityClasses$U(st);return jsxRuntimeExports.jsx(PaperRoot,{as:tt,ownerState:st,className:clsx(at.root,et),ref:$,...it,style:{...ot==="elevation"&&{"--Paper-shadow":(_e.vars||_e).shadows[rt],..._e.vars&&{"--Paper-overlay":(lt=_e.vars.overlays)==null?void 0:lt[rt]},...!_e.vars&&_e.palette.mode==="dark"&&{"--Paper-overlay":`linear-gradient(${alpha$1("#fff",getOverlayAlpha(rt))}, ${alpha$1("#fff",getOverlayAlpha(rt))})`}},...it.style}})}),AccordionContext=reactExports.createContext({});function getAccordionUtilityClass(o){return generateUtilityClass("MuiAccordion",o)}const accordionClasses=generateUtilityClasses("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),useUtilityClasses$T=o=>{const{classes:_,square:$,expanded:j,disabled:_e,disableGutters:et}=o;return composeClasses({root:["root",!$&&"rounded",j&&"expanded",_e&&"disabled",!et&&"gutters"],heading:["heading"],region:["region"]},getAccordionUtilityClass,_)},AccordionRoot=styled(Paper,{name:"MuiAccordion",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[{[`& .${accordionClasses.region}`]:_.region},_.root,!$.square&&_.rounded,!$.disableGutters&&_.gutters]}})(memoTheme(({theme:o})=>{const _={duration:o.transitions.duration.shortest};return{position:"relative",transition:o.transitions.create(["margin"],_),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(o.vars||o).palette.divider,transition:o.transitions.create(["opacity","background-color"],_)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${accordionClasses.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${accordionClasses.disabled}`]:{backgroundColor:(o.vars||o).palette.action.disabledBackground}}}),memoTheme(({theme:o})=>({variants:[{props:_=>!_.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(o.vars||o).shape.borderRadius,borderTopRightRadius:(o.vars||o).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(o.vars||o).shape.borderRadius,borderBottomRightRadius:(o.vars||o).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:_=>!_.disableGutters,style:{[`&.${accordionClasses.expanded}`]:{margin:"16px 0"}}}]}))),AccordionHeading=styled("h3",{name:"MuiAccordion",slot:"Heading"})({all:"unset"}),AccordionRegion=styled("div",{name:"MuiAccordion",slot:"Region"})({}),Accordion=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiAccordion"}),{children:_e,className:et,defaultExpanded:tt=!1,disabled:rt=!1,disableGutters:nt=!1,expanded:ot,onChange:it,slots:st={},slotProps:at={},TransitionComponent:lt,TransitionProps:ct,...ft}=j,[dt,pt]=useControlled({controlled:ot,default:tt,name:"Accordion",state:"expanded"}),yt=reactExports.useCallback($t=>{pt(!dt),it&&it($t,!dt)},[dt,it,pt]),[vt,...wt]=reactExports.Children.toArray(_e),Ct=reactExports.useMemo(()=>({expanded:dt,disabled:rt,disableGutters:nt,toggle:yt}),[dt,rt,nt,yt]),Pt={...j,disabled:rt,disableGutters:nt,expanded:dt},Bt=useUtilityClasses$T(Pt),At={transition:lt,...st},kt={transition:ct,...at},Ot={slots:At,slotProps:kt},[Tt,ht]=useSlot("root",{elementType:AccordionRoot,externalForwardedProps:{...Ot,...ft},className:clsx(Bt.root,et),shouldForwardComponentProp:!0,ownerState:Pt,ref:$}),[bt,mt]=useSlot("heading",{elementType:AccordionHeading,externalForwardedProps:Ot,className:Bt.heading,ownerState:Pt}),[gt,xt]=useSlot("transition",{elementType:Collapse,externalForwardedProps:Ot,ownerState:Pt}),[Et,_t]=useSlot("region",{elementType:AccordionRegion,externalForwardedProps:Ot,ownerState:Pt,className:Bt.region,additionalProps:{"aria-labelledby":vt.props.id,id:vt.props["aria-controls"],role:"region"}});return jsxRuntimeExports.jsxs(Tt,{...ht,children:[jsxRuntimeExports.jsx(bt,{...mt,children:jsxRuntimeExports.jsx(AccordionContext.Provider,{value:Ct,children:vt})}),jsxRuntimeExports.jsx(gt,{in:dt,timeout:"auto",...xt,children:jsxRuntimeExports.jsx(Et,{..._t,children:wt})})]})});function getAccordionDetailsUtilityClass(o){return generateUtilityClass("MuiAccordionDetails",o)}generateUtilityClasses("MuiAccordionDetails",["root"]);const useUtilityClasses$S=o=>{const{classes:_}=o;return composeClasses({root:["root"]},getAccordionDetailsUtilityClass,_)},AccordionDetailsRoot=styled("div",{name:"MuiAccordionDetails",slot:"Root"})(memoTheme(({theme:o})=>({padding:o.spacing(1,2,2)}))),AccordionDetails=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiAccordionDetails"}),{className:_e,...et}=j,tt=j,rt=useUtilityClasses$S(tt);return jsxRuntimeExports.jsx(AccordionDetailsRoot,{className:clsx(rt.root,_e),ref:$,ownerState:tt,...et})});function isFocusVisible(o){try{return o.matches(":focus-visible")}catch{}return!1}class LazyRipple{constructor(){vn(this,"mountEffect",()=>{this.shouldMount&&!this.didMount&&this.ref.current!==null&&(this.didMount=!0,this.mounted.resolve())});this.ref={current:null},this.mounted=null,this.didMount=!1,this.shouldMount=!1,this.setShouldMount=null}static create(){return new LazyRipple}static use(){const _=useLazyRef(LazyRipple.create).current,[$,j]=reactExports.useState(!1);return _.shouldMount=$,_.setShouldMount=j,reactExports.useEffect(_.mountEffect,[$]),_}mount(){return this.mounted||(this.mounted=createControlledPromise(),this.shouldMount=!0,this.setShouldMount(this.shouldMount)),this.mounted}start(..._){this.mount().then(()=>{var $;return($=this.ref.current)==null?void 0:$.start(..._)})}stop(..._){this.mount().then(()=>{var $;return($=this.ref.current)==null?void 0:$.stop(..._)})}pulsate(..._){this.mount().then(()=>{var $;return($=this.ref.current)==null?void 0:$.pulsate(..._)})}}function useLazyRipple(){return LazyRipple.use()}function createControlledPromise(){let o,_;const $=new Promise((j,_e)=>{o=j,_=_e});return $.resolve=o,$.reject=_,$}function Ripple(o){const{className:_,classes:$,pulsate:j=!1,rippleX:_e,rippleY:et,rippleSize:tt,in:rt,onExited:nt,timeout:ot}=o,[it,st]=reactExports.useState(!1),at=clsx(_,$.ripple,$.rippleVisible,j&&$.ripplePulsate),lt={width:tt,height:tt,top:-(tt/2)+et,left:-(tt/2)+_e},ct=clsx($.child,it&&$.childLeaving,j&&$.childPulsate);return!rt&&!it&&st(!0),reactExports.useEffect(()=>{if(!rt&&nt!=null){const ft=setTimeout(nt,ot);return()=>{clearTimeout(ft)}}},[nt,rt,ot]),jsxRuntimeExports.jsx("span",{className:at,style:lt,children:jsxRuntimeExports.jsx("span",{className:ct})})}const touchRippleClasses=generateUtilityClasses("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),DURATION=550,DELAY_RIPPLE=80,enterKeyframe=keyframes` - 0% { - transform: scale(0); - opacity: 0.1; - } - - 100% { - transform: scale(1); - opacity: 0.3; - } -`,exitKeyframe=keyframes` - 0% { - opacity: 1; - } - - 100% { - opacity: 0; - } -`,pulsateKeyframe=keyframes` - 0% { - transform: scale(1); - } - - 50% { - transform: scale(0.92); - } - - 100% { - transform: scale(1); - } -`,TouchRippleRoot=styled("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),TouchRippleRipple=styled(Ripple,{name:"MuiTouchRipple",slot:"Ripple"})` - opacity: 0; - position: absolute; - - &.${touchRippleClasses.rippleVisible} { - opacity: 0.3; - transform: scale(1); - animation-name: ${enterKeyframe}; - animation-duration: ${DURATION}ms; - animation-timing-function: ${({theme:o})=>o.transitions.easing.easeInOut}; - } - - &.${touchRippleClasses.ripplePulsate} { - animation-duration: ${({theme:o})=>o.transitions.duration.shorter}ms; - } - - & .${touchRippleClasses.child} { - opacity: 1; - display: block; - width: 100%; - height: 100%; - border-radius: 50%; - background-color: currentColor; - } - - & .${touchRippleClasses.childLeaving} { - opacity: 0; - animation-name: ${exitKeyframe}; - animation-duration: ${DURATION}ms; - animation-timing-function: ${({theme:o})=>o.transitions.easing.easeInOut}; - } - - & .${touchRippleClasses.childPulsate} { - position: absolute; - /* @noflip */ - left: 0px; - top: 0; - animation-name: ${pulsateKeyframe}; - animation-duration: 2500ms; - animation-timing-function: ${({theme:o})=>o.transitions.easing.easeInOut}; - animation-iteration-count: infinite; - animation-delay: 200ms; - } -`,TouchRipple=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTouchRipple"}),{center:_e=!1,classes:et={},className:tt,...rt}=j,[nt,ot]=reactExports.useState([]),it=reactExports.useRef(0),st=reactExports.useRef(null);reactExports.useEffect(()=>{st.current&&(st.current(),st.current=null)},[nt]);const at=reactExports.useRef(!1),lt=useTimeout(),ct=reactExports.useRef(null),ft=reactExports.useRef(null),dt=reactExports.useCallback(wt=>{const{pulsate:Ct,rippleX:Pt,rippleY:Bt,rippleSize:At,cb:kt}=wt;ot(Ot=>[...Ot,jsxRuntimeExports.jsx(TouchRippleRipple,{classes:{ripple:clsx(et.ripple,touchRippleClasses.ripple),rippleVisible:clsx(et.rippleVisible,touchRippleClasses.rippleVisible),ripplePulsate:clsx(et.ripplePulsate,touchRippleClasses.ripplePulsate),child:clsx(et.child,touchRippleClasses.child),childLeaving:clsx(et.childLeaving,touchRippleClasses.childLeaving),childPulsate:clsx(et.childPulsate,touchRippleClasses.childPulsate)},timeout:DURATION,pulsate:Ct,rippleX:Pt,rippleY:Bt,rippleSize:At},it.current)]),it.current+=1,st.current=kt},[et]),pt=reactExports.useCallback((wt={},Ct={},Pt=()=>{})=>{const{pulsate:Bt=!1,center:At=_e||Ct.pulsate,fakeElement:kt=!1}=Ct;if((wt==null?void 0:wt.type)==="mousedown"&&at.current){at.current=!1;return}(wt==null?void 0:wt.type)==="touchstart"&&(at.current=!0);const Ot=kt?null:ft.current,Tt=Ot?Ot.getBoundingClientRect():{width:0,height:0,left:0,top:0};let ht,bt,mt;if(At||wt===void 0||wt.clientX===0&&wt.clientY===0||!wt.clientX&&!wt.touches)ht=Math.round(Tt.width/2),bt=Math.round(Tt.height/2);else{const{clientX:gt,clientY:xt}=wt.touches&&wt.touches.length>0?wt.touches[0]:wt;ht=Math.round(gt-Tt.left),bt=Math.round(xt-Tt.top)}if(At)mt=Math.sqrt((2*Tt.width**2+Tt.height**2)/3),mt%2===0&&(mt+=1);else{const gt=Math.max(Math.abs((Ot?Ot.clientWidth:0)-ht),ht)*2+2,xt=Math.max(Math.abs((Ot?Ot.clientHeight:0)-bt),bt)*2+2;mt=Math.sqrt(gt**2+xt**2)}wt!=null&&wt.touches?ct.current===null&&(ct.current=()=>{dt({pulsate:Bt,rippleX:ht,rippleY:bt,rippleSize:mt,cb:Pt})},lt.start(DELAY_RIPPLE,()=>{ct.current&&(ct.current(),ct.current=null)})):dt({pulsate:Bt,rippleX:ht,rippleY:bt,rippleSize:mt,cb:Pt})},[_e,dt,lt]),yt=reactExports.useCallback(()=>{pt({},{pulsate:!0})},[pt]),vt=reactExports.useCallback((wt,Ct)=>{if(lt.clear(),(wt==null?void 0:wt.type)==="touchend"&&ct.current){ct.current(),ct.current=null,lt.start(0,()=>{vt(wt,Ct)});return}ct.current=null,ot(Pt=>Pt.length>0?Pt.slice(1):Pt),st.current=Ct},[lt]);return reactExports.useImperativeHandle($,()=>({pulsate:yt,start:pt,stop:vt}),[yt,pt,vt]),jsxRuntimeExports.jsx(TouchRippleRoot,{className:clsx(touchRippleClasses.root,et.root,tt),ref:ft,...rt,children:jsxRuntimeExports.jsx(TransitionGroup,{component:null,exit:!0,children:nt})})});function getButtonBaseUtilityClass(o){return generateUtilityClass("MuiButtonBase",o)}const buttonBaseClasses=generateUtilityClasses("MuiButtonBase",["root","disabled","focusVisible"]),useUtilityClasses$R=o=>{const{disabled:_,focusVisible:$,focusVisibleClassName:j,classes:_e}=o,tt=composeClasses({root:["root",_&&"disabled",$&&"focusVisible"]},getButtonBaseUtilityClass,_e);return $&&j&&(tt.root+=` ${j}`),tt},ButtonBaseRoot=styled("button",{name:"MuiButtonBase",slot:"Root"})({display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"},[`&.${buttonBaseClasses.disabled}`]:{pointerEvents:"none",cursor:"default"},"@media print":{colorAdjust:"exact"}}),ButtonBase=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiButtonBase"}),{action:_e,centerRipple:et=!1,children:tt,className:rt,component:nt="button",disabled:ot=!1,disableRipple:it=!1,disableTouchRipple:st=!1,focusRipple:at=!1,focusVisibleClassName:lt,LinkComponent:ct="a",onBlur:ft,onClick:dt,onContextMenu:pt,onDragLeave:yt,onFocus:vt,onFocusVisible:wt,onKeyDown:Ct,onKeyUp:Pt,onMouseDown:Bt,onMouseLeave:At,onMouseUp:kt,onTouchEnd:Ot,onTouchMove:Tt,onTouchStart:ht,tabIndex:bt=0,TouchRippleProps:mt,touchRippleRef:gt,type:xt,...Et}=j,_t=reactExports.useRef(null),$t=useLazyRipple(),St=useForkRef($t.ref,gt),[Rt,It]=reactExports.useState(!1);ot&&Rt&&It(!1),reactExports.useImperativeHandle(_e,()=>({focusVisible:()=>{It(!0),_t.current.focus()}}),[]);const Mt=$t.shouldMount&&!it&&!ot;reactExports.useEffect(()=>{Rt&&at&&!it&&$t.pulsate()},[it,at,Rt,$t]);const Vt=useRippleHandler($t,"start",Bt,st),Gt=useRippleHandler($t,"stop",pt,st),zt=useRippleHandler($t,"stop",yt,st),jt=useRippleHandler($t,"stop",kt,st),Ft=useRippleHandler($t,"stop",lr=>{Rt&&lr.preventDefault(),At&&At(lr)},st),qt=useRippleHandler($t,"start",ht,st),Xt=useRippleHandler($t,"stop",Ot,st),Ut=useRippleHandler($t,"stop",Tt,st),Lt=useRippleHandler($t,"stop",lr=>{isFocusVisible(lr.target)||It(!1),ft&&ft(lr)},!1),Ht=useEventCallback(lr=>{_t.current||(_t.current=lr.currentTarget),isFocusVisible(lr.target)&&(It(!0),wt&&wt(lr)),vt&&vt(lr)}),Kt=()=>{const lr=_t.current;return nt&&nt!=="button"&&!(lr.tagName==="A"&&lr.href)},Jt=useEventCallback(lr=>{at&&!lr.repeat&&Rt&&lr.key===" "&&$t.stop(lr,()=>{$t.start(lr)}),lr.target===lr.currentTarget&&Kt()&&lr.key===" "&&lr.preventDefault(),Ct&&Ct(lr),lr.target===lr.currentTarget&&Kt()&&lr.key==="Enter"&&!ot&&(lr.preventDefault(),dt&&dt(lr))}),tr=useEventCallback(lr=>{at&&lr.key===" "&&Rt&&!lr.defaultPrevented&&$t.stop(lr,()=>{$t.pulsate(lr)}),Pt&&Pt(lr),dt&&lr.target===lr.currentTarget&&Kt()&&lr.key===" "&&!lr.defaultPrevented&&dt(lr)});let nr=nt;nr==="button"&&(Et.href||Et.to)&&(nr=ct);const ur={};if(nr==="button"){const lr=!!Et.formAction;ur.type=xt===void 0&&!lr?"button":xt,ur.disabled=ot}else!Et.href&&!Et.to&&(ur.role="button"),ot&&(ur["aria-disabled"]=ot);const rr=useForkRef($,_t),pr={...j,centerRipple:et,component:nt,disabled:ot,disableRipple:it,disableTouchRipple:st,focusRipple:at,tabIndex:bt,focusVisible:Rt},fr=useUtilityClasses$R(pr);return jsxRuntimeExports.jsxs(ButtonBaseRoot,{as:nr,className:clsx(fr.root,rt),ownerState:pr,onBlur:Lt,onClick:dt,onContextMenu:Gt,onFocus:Ht,onKeyDown:Jt,onKeyUp:tr,onMouseDown:Vt,onMouseLeave:Ft,onMouseUp:jt,onDragLeave:zt,onTouchEnd:Xt,onTouchMove:Ut,onTouchStart:qt,ref:rr,tabIndex:ot?-1:bt,type:xt,...ur,...Et,children:[tt,Mt?jsxRuntimeExports.jsx(TouchRipple,{ref:St,center:et,...mt}):null]})});function useRippleHandler(o,_,$,j=!1){return useEventCallback(_e=>($&&$(_e),j||o[_](_e),!0))}function getAccordionSummaryUtilityClass(o){return generateUtilityClass("MuiAccordionSummary",o)}const accordionSummaryClasses=generateUtilityClasses("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),useUtilityClasses$Q=o=>{const{classes:_,expanded:$,disabled:j,disableGutters:_e}=o;return composeClasses({root:["root",$&&"expanded",j&&"disabled",!_e&&"gutters"],focusVisible:["focusVisible"],content:["content",$&&"expanded",!_e&&"contentGutters"],expandIconWrapper:["expandIconWrapper",$&&"expanded"]},getAccordionSummaryUtilityClass,_)},AccordionSummaryRoot=styled(ButtonBase,{name:"MuiAccordionSummary",slot:"Root"})(memoTheme(({theme:o})=>{const _={duration:o.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:o.spacing(0,2),transition:o.transitions.create(["min-height","background-color"],_),[`&.${accordionSummaryClasses.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`&.${accordionSummaryClasses.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity},[`&:hover:not(.${accordionSummaryClasses.disabled})`]:{cursor:"pointer"},variants:[{props:$=>!$.disableGutters,style:{[`&.${accordionSummaryClasses.expanded}`]:{minHeight:64}}}]}})),AccordionSummaryContent=styled("span",{name:"MuiAccordionSummary",slot:"Content"})(memoTheme(({theme:o})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:_=>!_.disableGutters,style:{transition:o.transitions.create(["margin"],{duration:o.transitions.duration.shortest}),[`&.${accordionSummaryClasses.expanded}`]:{margin:"20px 0"}}}]}))),AccordionSummaryExpandIconWrapper=styled("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper"})(memoTheme(({theme:o})=>({display:"flex",color:(o.vars||o).palette.action.active,transform:"rotate(0deg)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shortest}),[`&.${accordionSummaryClasses.expanded}`]:{transform:"rotate(180deg)"}}))),AccordionSummary=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiAccordionSummary"}),{children:_e,className:et,expandIcon:tt,focusVisibleClassName:rt,onClick:nt,slots:ot,slotProps:it,...st}=j,{disabled:at=!1,disableGutters:lt,expanded:ct,toggle:ft}=reactExports.useContext(AccordionContext),dt=Ot=>{ft&&ft(Ot),nt&&nt(Ot)},pt={...j,expanded:ct,disabled:at,disableGutters:lt},yt=useUtilityClasses$Q(pt),vt={slots:ot,slotProps:it},[wt,Ct]=useSlot("root",{ref:$,shouldForwardComponentProp:!0,className:clsx(yt.root,et),elementType:AccordionSummaryRoot,externalForwardedProps:{...vt,...st},ownerState:pt,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:at,"aria-expanded":ct,focusVisibleClassName:clsx(yt.focusVisible,rt)},getSlotProps:Ot=>({...Ot,onClick:Tt=>{var ht;(ht=Ot.onClick)==null||ht.call(Ot,Tt),dt(Tt)}})}),[Pt,Bt]=useSlot("content",{className:yt.content,elementType:AccordionSummaryContent,externalForwardedProps:vt,ownerState:pt}),[At,kt]=useSlot("expandIconWrapper",{className:yt.expandIconWrapper,elementType:AccordionSummaryExpandIconWrapper,externalForwardedProps:vt,ownerState:pt});return jsxRuntimeExports.jsxs(wt,{...Ct,children:[jsxRuntimeExports.jsx(Pt,{...Bt,children:_e}),tt&&jsxRuntimeExports.jsx(At,{...kt,children:tt})]})});function hasCorrectMainProperty(o){return typeof o.main=="string"}function checkSimplePaletteColorValues(o,_=[]){if(!hasCorrectMainProperty(o))return!1;for(const $ of _)if(!o.hasOwnProperty($)||typeof o[$]!="string")return!1;return!0}function createSimplePaletteValueFilter(o=[]){return([,_])=>_&&checkSimplePaletteColorValues(_,o)}function getAlertUtilityClass(o){return generateUtilityClass("MuiAlert",o)}const alertClasses=generateUtilityClasses("MuiAlert",["root","action","icon","message","filled","colorSuccess","colorInfo","colorWarning","colorError","filledSuccess","filledInfo","filledWarning","filledError","outlined","outlinedSuccess","outlinedInfo","outlinedWarning","outlinedError","standard","standardSuccess","standardInfo","standardWarning","standardError"]);function getCircularProgressUtilityClass(o){return generateUtilityClass("MuiCircularProgress",o)}generateUtilityClasses("MuiCircularProgress",["root","determinate","indeterminate","colorPrimary","colorSecondary","svg","track","circle","circleDeterminate","circleIndeterminate","circleDisableShrink"]);const SIZE=44,circularRotateKeyframe=keyframes` - 0% { - transform: rotate(0deg); - } - - 100% { - transform: rotate(360deg); - } -`,circularDashKeyframe=keyframes` - 0% { - stroke-dasharray: 1px, 200px; - stroke-dashoffset: 0; - } - - 50% { - stroke-dasharray: 100px, 200px; - stroke-dashoffset: -15px; - } - - 100% { - stroke-dasharray: 1px, 200px; - stroke-dashoffset: -126px; - } -`,rotateAnimation=typeof circularRotateKeyframe!="string"?css` - animation: ${circularRotateKeyframe} 1.4s linear infinite; - `:null,dashAnimation=typeof circularDashKeyframe!="string"?css` - animation: ${circularDashKeyframe} 1.4s ease-in-out infinite; - `:null,useUtilityClasses$P=o=>{const{classes:_,variant:$,color:j,disableShrink:_e}=o,et={root:["root",$,`color${capitalize(j)}`],svg:["svg"],track:["track"],circle:["circle",`circle${capitalize($)}`,_e&&"circleDisableShrink"]};return composeClasses(et,getCircularProgressUtilityClass,_)},CircularProgressRoot=styled("span",{name:"MuiCircularProgress",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.variant],_[`color${capitalize($.color)}`]]}})(memoTheme(({theme:o})=>({display:"inline-block",variants:[{props:{variant:"determinate"},style:{transition:o.transitions.create("transform")}},{props:{variant:"indeterminate"},style:rotateAnimation||{animation:`${circularRotateKeyframe} 1.4s linear infinite`}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_},style:{color:(o.vars||o).palette[_].main}}))]}))),CircularProgressSVG=styled("svg",{name:"MuiCircularProgress",slot:"Svg"})({display:"block"}),CircularProgressCircle=styled("circle",{name:"MuiCircularProgress",slot:"Circle",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.circle,_[`circle${capitalize($.variant)}`],$.disableShrink&&_.circleDisableShrink]}})(memoTheme(({theme:o})=>({stroke:"currentColor",variants:[{props:{variant:"determinate"},style:{transition:o.transitions.create("stroke-dashoffset")}},{props:{variant:"indeterminate"},style:{strokeDasharray:"80px, 200px",strokeDashoffset:0}},{props:({ownerState:_})=>_.variant==="indeterminate"&&!_.disableShrink,style:dashAnimation||{animation:`${circularDashKeyframe} 1.4s ease-in-out infinite`}}]}))),CircularProgressTrack=styled("circle",{name:"MuiCircularProgress",slot:"Track"})(memoTheme(({theme:o})=>({stroke:"currentColor",opacity:(o.vars||o).palette.action.activatedOpacity}))),CircularProgress=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiCircularProgress"}),{className:_e,color:et="primary",disableShrink:tt=!1,enableTrackSlot:rt=!1,size:nt=40,style:ot,thickness:it=3.6,value:st=0,variant:at="indeterminate",...lt}=j,ct={...j,color:et,disableShrink:tt,size:nt,thickness:it,value:st,variant:at,enableTrackSlot:rt},ft=useUtilityClasses$P(ct),dt={},pt={},yt={};if(at==="determinate"){const vt=2*Math.PI*((SIZE-it)/2);dt.strokeDasharray=vt.toFixed(3),yt["aria-valuenow"]=Math.round(st),dt.strokeDashoffset=`${((100-st)/100*vt).toFixed(3)}px`,pt.transform="rotate(-90deg)"}return jsxRuntimeExports.jsx(CircularProgressRoot,{className:clsx(ft.root,_e),style:{width:nt,height:nt,...pt,...ot},ownerState:ct,ref:$,role:"progressbar",...yt,...lt,children:jsxRuntimeExports.jsxs(CircularProgressSVG,{className:ft.svg,ownerState:ct,viewBox:`${SIZE/2} ${SIZE/2} ${SIZE} ${SIZE}`,children:[rt?jsxRuntimeExports.jsx(CircularProgressTrack,{className:ft.track,ownerState:ct,cx:SIZE,cy:SIZE,r:(SIZE-it)/2,fill:"none",strokeWidth:it,"aria-hidden":"true"}):null,jsxRuntimeExports.jsx(CircularProgressCircle,{className:ft.circle,style:dt,ownerState:ct,cx:SIZE,cy:SIZE,r:(SIZE-it)/2,fill:"none",strokeWidth:it})]})})});function getIconButtonUtilityClass(o){return generateUtilityClass("MuiIconButton",o)}const iconButtonClasses=generateUtilityClasses("MuiIconButton",["root","disabled","colorInherit","colorPrimary","colorSecondary","colorError","colorInfo","colorSuccess","colorWarning","edgeStart","edgeEnd","sizeSmall","sizeMedium","sizeLarge","loading","loadingIndicator","loadingWrapper"]),useUtilityClasses$O=o=>{const{classes:_,disabled:$,color:j,edge:_e,size:et,loading:tt}=o,rt={root:["root",tt&&"loading",$&&"disabled",j!=="default"&&`color${capitalize(j)}`,_e&&`edge${capitalize(_e)}`,`size${capitalize(et)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]};return composeClasses(rt,getIconButtonUtilityClass,_)},IconButtonRoot=styled(ButtonBase,{name:"MuiIconButton",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.loading&&_.loading,$.color!=="default"&&_[`color${capitalize($.color)}`],$.edge&&_[`edge${capitalize($.edge)}`],_[`size${capitalize($.size)}`]]}})(memoTheme(({theme:o})=>({textAlign:"center",flex:"0 0 auto",fontSize:o.typography.pxToRem(24),padding:8,borderRadius:"50%",color:(o.vars||o).palette.action.active,transition:o.transitions.create("background-color",{duration:o.transitions.duration.shortest}),variants:[{props:_=>!_.disableRipple,style:{"--IconButton-hoverBg":o.alpha((o.vars||o).palette.action.active,(o.vars||o).palette.action.hoverOpacity),"&:hover":{backgroundColor:"var(--IconButton-hoverBg)","@media (hover: none)":{backgroundColor:"transparent"}}}},{props:{edge:"start"},style:{marginLeft:-12}},{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:{edge:"end"},style:{marginRight:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}}]})),memoTheme(({theme:o})=>({variants:[{props:{color:"inherit"},style:{color:"inherit"}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_},style:{color:(o.vars||o).palette[_].main}})),...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_},style:{"--IconButton-hoverBg":o.alpha((o.vars||o).palette[_].main,(o.vars||o).palette.action.hoverOpacity)}})),{props:{size:"small"},style:{padding:5,fontSize:o.typography.pxToRem(18)}},{props:{size:"large"},style:{padding:12,fontSize:o.typography.pxToRem(28)}}],[`&.${iconButtonClasses.disabled}`]:{backgroundColor:"transparent",color:(o.vars||o).palette.action.disabled},[`&.${iconButtonClasses.loading}`]:{color:"transparent"}}))),IconButtonLoadingIndicator=styled("span",{name:"MuiIconButton",slot:"LoadingIndicator"})(({theme:o})=>({display:"none",position:"absolute",visibility:"visible",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:(o.vars||o).palette.action.disabled,variants:[{props:{loading:!0},style:{display:"flex"}}]})),IconButton=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiIconButton"}),{edge:_e=!1,children:et,className:tt,color:rt="default",disabled:nt=!1,disableFocusRipple:ot=!1,size:it="medium",id:st,loading:at=null,loadingIndicator:lt,...ct}=j,ft=useId$1(st),dt=lt??jsxRuntimeExports.jsx(CircularProgress,{"aria-labelledby":ft,color:"inherit",size:16}),pt={...j,edge:_e,color:rt,disabled:nt,disableFocusRipple:ot,loading:at,loadingIndicator:dt,size:it},yt=useUtilityClasses$O(pt);return jsxRuntimeExports.jsxs(IconButtonRoot,{id:at?ft:st,className:clsx(yt.root,tt),centerRipple:!0,focusRipple:!ot,disabled:nt||at,ref:$,...ct,ownerState:pt,children:[typeof at=="boolean"&&jsxRuntimeExports.jsx("span",{className:yt.loadingWrapper,style:{display:"contents"},children:jsxRuntimeExports.jsx(IconButtonLoadingIndicator,{className:yt.loadingIndicator,ownerState:pt,children:at&&dt})}),et]})}),SuccessOutlinedIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20,12A8,8 0 0,1 12,20A8,8 0 0,1 4,12A8,8 0 0,1 12,4C12.76,4 13.5,4.11 14.2, 4.31L15.77,2.74C14.61,2.26 13.34,2 12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0, 0 22,12M7.91,10.08L6.5,11.5L11,16L21,6L19.59,4.58L11,13.17L7.91,10.08Z"})),ReportProblemOutlinedIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 5.99L19.53 19H4.47L12 5.99M12 2L1 21h22L12 2zm1 14h-2v2h2v-2zm0-6h-2v4h2v-4z"})),ErrorOutlineIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11 15h2v2h-2zm0-8h2v6h-2zm.99-5C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"})),InfoOutlinedIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11,9H13V7H11M12,20C7.59,20 4,16.41 4,12C4,7.59 7.59,4 12,4C16.41,4 20,7.59 20, 12C20,16.41 16.41,20 12,20M12,2A10,10 0 0,0 2,12A10,10 0 0,0 12,22A10,10 0 0,0 22,12A10, 10 0 0,0 12,2M11,17H13V11H11V17Z"})),ClearIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"})),useUtilityClasses$N=o=>{const{variant:_,color:$,severity:j,classes:_e}=o,et={root:["root",`color${capitalize($||j)}`,`${_}${capitalize($||j)}`,`${_}`],icon:["icon"],message:["message"],action:["action"]};return composeClasses(et,getAlertUtilityClass,_e)},AlertRoot=styled(Paper,{name:"MuiAlert",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.variant],_[`${$.variant}${capitalize($.color||$.severity)}`]]}})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light"?o.darken:o.lighten,$=o.palette.mode==="light"?o.lighten:o.darken;return{...o.typography.body2,backgroundColor:"transparent",display:"flex",padding:"6px 16px",variants:[...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["light"])).map(([j])=>({props:{colorSeverity:j,variant:"standard"},style:{color:o.vars?o.vars.palette.Alert[`${j}Color`]:_(o.palette[j].light,.6),backgroundColor:o.vars?o.vars.palette.Alert[`${j}StandardBg`]:$(o.palette[j].light,.9),[`& .${alertClasses.icon}`]:o.vars?{color:o.vars.palette.Alert[`${j}IconColor`]}:{color:o.palette[j].main}}})),...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["light"])).map(([j])=>({props:{colorSeverity:j,variant:"outlined"},style:{color:o.vars?o.vars.palette.Alert[`${j}Color`]:_(o.palette[j].light,.6),border:`1px solid ${(o.vars||o).palette[j].light}`,[`& .${alertClasses.icon}`]:o.vars?{color:o.vars.palette.Alert[`${j}IconColor`]}:{color:o.palette[j].main}}})),...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([j])=>({props:{colorSeverity:j,variant:"filled"},style:{fontWeight:o.typography.fontWeightMedium,...o.vars?{color:o.vars.palette.Alert[`${j}FilledColor`],backgroundColor:o.vars.palette.Alert[`${j}FilledBg`]}:{backgroundColor:o.palette.mode==="dark"?o.palette[j].dark:o.palette[j].main,color:o.palette.getContrastText(o.palette[j].main)}}}))]}})),AlertIcon=styled("div",{name:"MuiAlert",slot:"Icon"})({marginRight:12,padding:"7px 0",display:"flex",fontSize:22,opacity:.9}),AlertMessage=styled("div",{name:"MuiAlert",slot:"Message"})({padding:"8px 0",minWidth:0,overflow:"auto"}),AlertAction=styled("div",{name:"MuiAlert",slot:"Action"})({display:"flex",alignItems:"flex-start",padding:"4px 0 0 16px",marginLeft:"auto",marginRight:-8}),defaultIconMapping={success:jsxRuntimeExports.jsx(SuccessOutlinedIcon,{fontSize:"inherit"}),warning:jsxRuntimeExports.jsx(ReportProblemOutlinedIcon,{fontSize:"inherit"}),error:jsxRuntimeExports.jsx(ErrorOutlineIcon,{fontSize:"inherit"}),info:jsxRuntimeExports.jsx(InfoOutlinedIcon,{fontSize:"inherit"})},Alert$1=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiAlert"}),{action:_e,children:et,className:tt,closeText:rt="Close",color:nt,components:ot={},componentsProps:it={},icon:st,iconMapping:at=defaultIconMapping,onClose:lt,role:ct="alert",severity:ft="success",slotProps:dt={},slots:pt={},variant:yt="standard",...vt}=j,wt={...j,color:nt,severity:ft,variant:yt,colorSeverity:nt||ft},Ct=useUtilityClasses$N(wt),Pt={slots:{closeButton:ot.CloseButton,closeIcon:ot.CloseIcon,...pt},slotProps:{...it,...dt}},[Bt,At]=useSlot("root",{ref:$,shouldForwardComponentProp:!0,className:clsx(Ct.root,tt),elementType:AlertRoot,externalForwardedProps:{...Pt,...vt},ownerState:wt,additionalProps:{role:ct,elevation:0}}),[kt,Ot]=useSlot("icon",{className:Ct.icon,elementType:AlertIcon,externalForwardedProps:Pt,ownerState:wt}),[Tt,ht]=useSlot("message",{className:Ct.message,elementType:AlertMessage,externalForwardedProps:Pt,ownerState:wt}),[bt,mt]=useSlot("action",{className:Ct.action,elementType:AlertAction,externalForwardedProps:Pt,ownerState:wt}),[gt,xt]=useSlot("closeButton",{elementType:IconButton,externalForwardedProps:Pt,ownerState:wt}),[Et,_t]=useSlot("closeIcon",{elementType:ClearIcon,externalForwardedProps:Pt,ownerState:wt});return jsxRuntimeExports.jsxs(Bt,{...At,children:[st!==!1?jsxRuntimeExports.jsx(kt,{...Ot,children:st||at[ft]}):null,jsxRuntimeExports.jsx(Tt,{...ht,children:et}),_e!=null?jsxRuntimeExports.jsx(bt,{...mt,children:_e}):null,_e==null&<?jsxRuntimeExports.jsx(bt,{...mt,children:jsxRuntimeExports.jsx(gt,{size:"small","aria-label":rt,title:rt,color:"inherit",onClick:lt,...xt,children:jsxRuntimeExports.jsx(Et,{fontSize:"small",..._t})})}):null]})});function getTypographyUtilityClass(o){return generateUtilityClass("MuiTypography",o)}generateUtilityClasses("MuiTypography",["root","h1","h2","h3","h4","h5","h6","subtitle1","subtitle2","body1","body2","inherit","button","caption","overline","alignLeft","alignRight","alignCenter","alignJustify","noWrap","gutterBottom","paragraph"]);const v6Colors$1={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},extendSxProp=internal_createExtendSxProp(),useUtilityClasses$M=o=>{const{align:_,gutterBottom:$,noWrap:j,paragraph:_e,variant:et,classes:tt}=o,rt={root:["root",et,o.align!=="inherit"&&`align${capitalize(_)}`,$&&"gutterBottom",j&&"noWrap",_e&&"paragraph"]};return composeClasses(rt,getTypographyUtilityClass,tt)},TypographyRoot=styled("span",{name:"MuiTypography",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.variant&&_[$.variant],$.align!=="inherit"&&_[`align${capitalize($.align)}`],$.noWrap&&_.noWrap,$.gutterBottom&&_.gutterBottom,$.paragraph&&_.paragraph]}})(memoTheme(({theme:o})=>{var _;return{margin:0,variants:[{props:{variant:"inherit"},style:{font:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}},...Object.entries(o.typography).filter(([$,j])=>$!=="inherit"&&j&&typeof j=="object").map(([$,j])=>({props:{variant:$},style:j})),...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([$])=>({props:{color:$},style:{color:(o.vars||o).palette[$].main}})),...Object.entries(((_=o.palette)==null?void 0:_.text)||{}).filter(([,$])=>typeof $=="string").map(([$])=>({props:{color:`text${capitalize($)}`},style:{color:(o.vars||o).palette.text[$]}})),{props:({ownerState:$})=>$.align!=="inherit",style:{textAlign:"var(--Typography-textAlign)"}},{props:({ownerState:$})=>$.noWrap,style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"}},{props:({ownerState:$})=>$.gutterBottom,style:{marginBottom:"0.35em"}},{props:({ownerState:$})=>$.paragraph,style:{marginBottom:16}}]}})),defaultVariantMapping={h1:"h1",h2:"h2",h3:"h3",h4:"h4",h5:"h5",h6:"h6",subtitle1:"h6",subtitle2:"h6",body1:"p",body2:"p",inherit:"p"},Typography=reactExports.forwardRef(function(_,$){const{color:j,..._e}=useDefaultProps({props:_,name:"MuiTypography"}),et=!v6Colors$1[j],tt=extendSxProp({..._e,...et&&{color:j}}),{align:rt="inherit",className:nt,component:ot,gutterBottom:it=!1,noWrap:st=!1,paragraph:at=!1,variant:lt="body1",variantMapping:ct=defaultVariantMapping,...ft}=tt,dt={...tt,align:rt,color:j,className:nt,component:ot,gutterBottom:it,noWrap:st,paragraph:at,variant:lt,variantMapping:ct},pt=ot||(at?"p":ct[lt]||defaultVariantMapping[lt])||"span",yt=useUtilityClasses$M(dt);return jsxRuntimeExports.jsx(TypographyRoot,{as:pt,ref:$,className:clsx(yt.root,nt),...ft,ownerState:dt,style:{...rt!=="inherit"&&{"--Typography-textAlign":rt},...ft.style}})});function getAppBarUtilityClass(o){return generateUtilityClass("MuiAppBar",o)}generateUtilityClasses("MuiAppBar",["root","positionFixed","positionAbsolute","positionSticky","positionStatic","positionRelative","colorDefault","colorPrimary","colorSecondary","colorInherit","colorTransparent","colorError","colorInfo","colorSuccess","colorWarning"]);const useUtilityClasses$L=o=>{const{color:_,position:$,classes:j}=o,_e={root:["root",`color${capitalize(_)}`,`position${capitalize($)}`]};return composeClasses(_e,getAppBarUtilityClass,j)},joinVars=(o,_)=>o?`${o==null?void 0:o.replace(")","")}, ${_})`:_,AppBarRoot=styled(Paper,{name:"MuiAppBar",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[`position${capitalize($.position)}`],_[`color${capitalize($.color)}`]]}})(memoTheme(({theme:o})=>({display:"flex",flexDirection:"column",width:"100%",boxSizing:"border-box",flexShrink:0,variants:[{props:{position:"fixed"},style:{position:"fixed",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0,"@media print":{position:"absolute"}}},{props:{position:"absolute"},style:{position:"absolute",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"sticky"},style:{position:"sticky",zIndex:(o.vars||o).zIndex.appBar,top:0,left:"auto",right:0}},{props:{position:"static"},style:{position:"static"}},{props:{position:"relative"},style:{position:"relative"}},{props:{color:"inherit"},style:{"--AppBar-color":"inherit",color:"var(--AppBar-color)"}},{props:{color:"default"},style:{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[100],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[100]),...o.applyStyles("dark",{"--AppBar-background":o.vars?o.vars.palette.AppBar.defaultBg:o.palette.grey[900],"--AppBar-color":o.vars?o.vars.palette.text.primary:o.palette.getContrastText(o.palette.grey[900])})}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["contrastText"])).map(([_])=>({props:{color:_},style:{"--AppBar-background":(o.vars??o).palette[_].main,"--AppBar-color":(o.vars??o).palette[_].contrastText}})),{props:_=>_.enableColorOnDark===!0&&!["inherit","transparent"].includes(_.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)"}},{props:_=>_.enableColorOnDark===!1&&!["inherit","transparent"].includes(_.color),style:{backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundColor:o.vars?joinVars(o.vars.palette.AppBar.darkBg,"var(--AppBar-background)"):null,color:o.vars?joinVars(o.vars.palette.AppBar.darkColor,"var(--AppBar-color)"):null})}},{props:{color:"transparent"},style:{"--AppBar-background":"transparent","--AppBar-color":"inherit",backgroundColor:"var(--AppBar-background)",color:"var(--AppBar-color)",...o.applyStyles("dark",{backgroundImage:"none"})}}]}))),AppBar=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiAppBar"}),{className:_e,color:et="primary",enableColorOnDark:tt=!1,position:rt="fixed",...nt}=j,ot={...j,color:et,position:rt,enableColorOnDark:tt},it=useUtilityClasses$L(ot);return jsxRuntimeExports.jsx(AppBarRoot,{square:!0,component:"header",ownerState:ot,elevation:4,className:clsx(it.root,_e,rt==="fixed"&&"mui-fixed"),ref:$,...nt})});function usePreviousProps(o){const _=reactExports.useRef({});return reactExports.useEffect(()=>{_.current=o}),_.current}var top="top",bottom="bottom",right="right",left="left",auto="auto",basePlacements=[top,bottom,right,left],start="start",end="end",clippingParents="clippingParents",viewport="viewport",popper="popper",reference="reference",variationPlacements=basePlacements.reduce(function(o,_){return o.concat([_+"-"+start,_+"-"+end])},[]),placements=[].concat(basePlacements,[auto]).reduce(function(o,_){return o.concat([_,_+"-"+start,_+"-"+end])},[]),beforeRead="beforeRead",read="read",afterRead="afterRead",beforeMain="beforeMain",main="main",afterMain="afterMain",beforeWrite="beforeWrite",write="write",afterWrite="afterWrite",modifierPhases=[beforeRead,read,afterRead,beforeMain,main,afterMain,beforeWrite,write,afterWrite];function getNodeName(o){return o?(o.nodeName||"").toLowerCase():null}function getWindow(o){if(o==null)return window;if(o.toString()!=="[object Window]"){var _=o.ownerDocument;return _&&_.defaultView||window}return o}function isElement(o){var _=getWindow(o).Element;return o instanceof _||o instanceof Element}function isHTMLElement$1(o){var _=getWindow(o).HTMLElement;return o instanceof _||o instanceof HTMLElement}function isShadowRoot(o){if(typeof ShadowRoot>"u")return!1;var _=getWindow(o).ShadowRoot;return o instanceof _||o instanceof ShadowRoot}function applyStyles(o){var _=o.state;Object.keys(_.elements).forEach(function($){var j=_.styles[$]||{},_e=_.attributes[$]||{},et=_.elements[$];!isHTMLElement$1(et)||!getNodeName(et)||(Object.assign(et.style,j),Object.keys(_e).forEach(function(tt){var rt=_e[tt];rt===!1?et.removeAttribute(tt):et.setAttribute(tt,rt===!0?"":rt)}))})}function effect$2(o){var _=o.state,$={popper:{position:_.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(_.elements.popper.style,$.popper),_.styles=$,_.elements.arrow&&Object.assign(_.elements.arrow.style,$.arrow),function(){Object.keys(_.elements).forEach(function(j){var _e=_.elements[j],et=_.attributes[j]||{},tt=Object.keys(_.styles.hasOwnProperty(j)?_.styles[j]:$[j]),rt=tt.reduce(function(nt,ot){return nt[ot]="",nt},{});!isHTMLElement$1(_e)||!getNodeName(_e)||(Object.assign(_e.style,rt),Object.keys(et).forEach(function(nt){_e.removeAttribute(nt)}))})}}const applyStyles$1={name:"applyStyles",enabled:!0,phase:"write",fn:applyStyles,effect:effect$2,requires:["computeStyles"]};function getBasePlacement(o){return o.split("-")[0]}var max$4=Math.max,min$3=Math.min,round$5=Math.round;function getUAString(){var o=navigator.userAgentData;return o!=null&&o.brands&&Array.isArray(o.brands)?o.brands.map(function(_){return _.brand+"/"+_.version}).join(" "):navigator.userAgent}function isLayoutViewport(){return!/^((?!chrome|android).)*safari/i.test(getUAString())}function getBoundingClientRect(o,_,$){_===void 0&&(_=!1),$===void 0&&($=!1);var j=o.getBoundingClientRect(),_e=1,et=1;_&&isHTMLElement$1(o)&&(_e=o.offsetWidth>0&&round$5(j.width)/o.offsetWidth||1,et=o.offsetHeight>0&&round$5(j.height)/o.offsetHeight||1);var tt=isElement(o)?getWindow(o):window,rt=tt.visualViewport,nt=!isLayoutViewport()&&$,ot=(j.left+(nt&&rt?rt.offsetLeft:0))/_e,it=(j.top+(nt&&rt?rt.offsetTop:0))/et,st=j.width/_e,at=j.height/et;return{width:st,height:at,top:it,right:ot+st,bottom:it+at,left:ot,x:ot,y:it}}function getLayoutRect(o){var _=getBoundingClientRect(o),$=o.offsetWidth,j=o.offsetHeight;return Math.abs(_.width-$)<=1&&($=_.width),Math.abs(_.height-j)<=1&&(j=_.height),{x:o.offsetLeft,y:o.offsetTop,width:$,height:j}}function contains(o,_){var $=_.getRootNode&&_.getRootNode();if(o.contains(_))return!0;if($&&isShadowRoot($)){var j=_;do{if(j&&o.isSameNode(j))return!0;j=j.parentNode||j.host}while(j)}return!1}function getComputedStyle(o){return getWindow(o).getComputedStyle(o)}function isTableElement(o){return["table","td","th"].indexOf(getNodeName(o))>=0}function getDocumentElement(o){return((isElement(o)?o.ownerDocument:o.document)||window.document).documentElement}function getParentNode(o){return getNodeName(o)==="html"?o:o.assignedSlot||o.parentNode||(isShadowRoot(o)?o.host:null)||getDocumentElement(o)}function getTrueOffsetParent(o){return!isHTMLElement$1(o)||getComputedStyle(o).position==="fixed"?null:o.offsetParent}function getContainingBlock(o){var _=/firefox/i.test(getUAString()),$=/Trident/i.test(getUAString());if($&&isHTMLElement$1(o)){var j=getComputedStyle(o);if(j.position==="fixed")return null}var _e=getParentNode(o);for(isShadowRoot(_e)&&(_e=_e.host);isHTMLElement$1(_e)&&["html","body"].indexOf(getNodeName(_e))<0;){var et=getComputedStyle(_e);if(et.transform!=="none"||et.perspective!=="none"||et.contain==="paint"||["transform","perspective"].indexOf(et.willChange)!==-1||_&&et.willChange==="filter"||_&&et.filter&&et.filter!=="none")return _e;_e=_e.parentNode}return null}function getOffsetParent(o){for(var _=getWindow(o),$=getTrueOffsetParent(o);$&&isTableElement($)&&getComputedStyle($).position==="static";)$=getTrueOffsetParent($);return $&&(getNodeName($)==="html"||getNodeName($)==="body"&&getComputedStyle($).position==="static")?_:$||getContainingBlock(o)||_}function getMainAxisFromPlacement(o){return["top","bottom"].indexOf(o)>=0?"x":"y"}function within(o,_,$){return max$4(o,min$3(_,$))}function withinMaxClamp(o,_,$){var j=within(o,_,$);return j>$?$:j}function getFreshSideObject(){return{top:0,right:0,bottom:0,left:0}}function mergePaddingObject(o){return Object.assign({},getFreshSideObject(),o)}function expandToHashMap(o,_){return _.reduce(function($,j){return $[j]=o,$},{})}var toPaddingObject=function(_,$){return _=typeof _=="function"?_(Object.assign({},$.rects,{placement:$.placement})):_,mergePaddingObject(typeof _!="number"?_:expandToHashMap(_,basePlacements))};function arrow(o){var _,$=o.state,j=o.name,_e=o.options,et=$.elements.arrow,tt=$.modifiersData.popperOffsets,rt=getBasePlacement($.placement),nt=getMainAxisFromPlacement(rt),ot=[left,right].indexOf(rt)>=0,it=ot?"height":"width";if(!(!et||!tt)){var st=toPaddingObject(_e.padding,$),at=getLayoutRect(et),lt=nt==="y"?top:left,ct=nt==="y"?bottom:right,ft=$.rects.reference[it]+$.rects.reference[nt]-tt[nt]-$.rects.popper[it],dt=tt[nt]-$.rects.reference[nt],pt=getOffsetParent(et),yt=pt?nt==="y"?pt.clientHeight||0:pt.clientWidth||0:0,vt=ft/2-dt/2,wt=st[lt],Ct=yt-at[it]-st[ct],Pt=yt/2-at[it]/2+vt,Bt=within(wt,Pt,Ct),At=nt;$.modifiersData[j]=(_={},_[At]=Bt,_.centerOffset=Bt-Pt,_)}}function effect$1(o){var _=o.state,$=o.options,j=$.element,_e=j===void 0?"[data-popper-arrow]":j;_e!=null&&(typeof _e=="string"&&(_e=_.elements.popper.querySelector(_e),!_e)||contains(_.elements.popper,_e)&&(_.elements.arrow=_e))}const arrow$1={name:"arrow",enabled:!0,phase:"main",fn:arrow,effect:effect$1,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function getVariation(o){return o.split("-")[1]}var unsetSides={top:"auto",right:"auto",bottom:"auto",left:"auto"};function roundOffsetsByDPR(o,_){var $=o.x,j=o.y,_e=_.devicePixelRatio||1;return{x:round$5($*_e)/_e||0,y:round$5(j*_e)/_e||0}}function mapToStyles(o){var _,$=o.popper,j=o.popperRect,_e=o.placement,et=o.variation,tt=o.offsets,rt=o.position,nt=o.gpuAcceleration,ot=o.adaptive,it=o.roundOffsets,st=o.isFixed,at=tt.x,lt=at===void 0?0:at,ct=tt.y,ft=ct===void 0?0:ct,dt=typeof it=="function"?it({x:lt,y:ft}):{x:lt,y:ft};lt=dt.x,ft=dt.y;var pt=tt.hasOwnProperty("x"),yt=tt.hasOwnProperty("y"),vt=left,wt=top,Ct=window;if(ot){var Pt=getOffsetParent($),Bt="clientHeight",At="clientWidth";if(Pt===getWindow($)&&(Pt=getDocumentElement($),getComputedStyle(Pt).position!=="static"&&rt==="absolute"&&(Bt="scrollHeight",At="scrollWidth")),Pt=Pt,_e===top||(_e===left||_e===right)&&et===end){wt=bottom;var kt=st&&Pt===Ct&&Ct.visualViewport?Ct.visualViewport.height:Pt[Bt];ft-=kt-j.height,ft*=nt?1:-1}if(_e===left||(_e===top||_e===bottom)&&et===end){vt=right;var Ot=st&&Pt===Ct&&Ct.visualViewport?Ct.visualViewport.width:Pt[At];lt-=Ot-j.width,lt*=nt?1:-1}}var Tt=Object.assign({position:rt},ot&&unsetSides),ht=it===!0?roundOffsetsByDPR({x:lt,y:ft},getWindow($)):{x:lt,y:ft};if(lt=ht.x,ft=ht.y,nt){var bt;return Object.assign({},Tt,(bt={},bt[wt]=yt?"0":"",bt[vt]=pt?"0":"",bt.transform=(Ct.devicePixelRatio||1)<=1?"translate("+lt+"px, "+ft+"px)":"translate3d("+lt+"px, "+ft+"px, 0)",bt))}return Object.assign({},Tt,(_={},_[wt]=yt?ft+"px":"",_[vt]=pt?lt+"px":"",_.transform="",_))}function computeStyles(o){var _=o.state,$=o.options,j=$.gpuAcceleration,_e=j===void 0?!0:j,et=$.adaptive,tt=et===void 0?!0:et,rt=$.roundOffsets,nt=rt===void 0?!0:rt,ot={placement:getBasePlacement(_.placement),variation:getVariation(_.placement),popper:_.elements.popper,popperRect:_.rects.popper,gpuAcceleration:_e,isFixed:_.options.strategy==="fixed"};_.modifiersData.popperOffsets!=null&&(_.styles.popper=Object.assign({},_.styles.popper,mapToStyles(Object.assign({},ot,{offsets:_.modifiersData.popperOffsets,position:_.options.strategy,adaptive:tt,roundOffsets:nt})))),_.modifiersData.arrow!=null&&(_.styles.arrow=Object.assign({},_.styles.arrow,mapToStyles(Object.assign({},ot,{offsets:_.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:nt})))),_.attributes.popper=Object.assign({},_.attributes.popper,{"data-popper-placement":_.placement})}const computeStyles$1={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:computeStyles,data:{}};var passive={passive:!0};function effect(o){var _=o.state,$=o.instance,j=o.options,_e=j.scroll,et=_e===void 0?!0:_e,tt=j.resize,rt=tt===void 0?!0:tt,nt=getWindow(_.elements.popper),ot=[].concat(_.scrollParents.reference,_.scrollParents.popper);return et&&ot.forEach(function(it){it.addEventListener("scroll",$.update,passive)}),rt&&nt.addEventListener("resize",$.update,passive),function(){et&&ot.forEach(function(it){it.removeEventListener("scroll",$.update,passive)}),rt&&nt.removeEventListener("resize",$.update,passive)}}const eventListeners={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect,data:{}};var hash$7={left:"right",right:"left",bottom:"top",top:"bottom"};function getOppositePlacement(o){return o.replace(/left|right|bottom|top/g,function(_){return hash$7[_]})}var hash$6={start:"end",end:"start"};function getOppositeVariationPlacement(o){return o.replace(/start|end/g,function(_){return hash$6[_]})}function getWindowScroll(o){var _=getWindow(o),$=_.pageXOffset,j=_.pageYOffset;return{scrollLeft:$,scrollTop:j}}function getWindowScrollBarX(o){return getBoundingClientRect(getDocumentElement(o)).left+getWindowScroll(o).scrollLeft}function getViewportRect(o,_){var $=getWindow(o),j=getDocumentElement(o),_e=$.visualViewport,et=j.clientWidth,tt=j.clientHeight,rt=0,nt=0;if(_e){et=_e.width,tt=_e.height;var ot=isLayoutViewport();(ot||!ot&&_==="fixed")&&(rt=_e.offsetLeft,nt=_e.offsetTop)}return{width:et,height:tt,x:rt+getWindowScrollBarX(o),y:nt}}function getDocumentRect(o){var _,$=getDocumentElement(o),j=getWindowScroll(o),_e=(_=o.ownerDocument)==null?void 0:_.body,et=max$4($.scrollWidth,$.clientWidth,_e?_e.scrollWidth:0,_e?_e.clientWidth:0),tt=max$4($.scrollHeight,$.clientHeight,_e?_e.scrollHeight:0,_e?_e.clientHeight:0),rt=-j.scrollLeft+getWindowScrollBarX(o),nt=-j.scrollTop;return getComputedStyle(_e||$).direction==="rtl"&&(rt+=max$4($.clientWidth,_e?_e.clientWidth:0)-et),{width:et,height:tt,x:rt,y:nt}}function isScrollParent(o){var _=getComputedStyle(o),$=_.overflow,j=_.overflowX,_e=_.overflowY;return/auto|scroll|overlay|hidden/.test($+_e+j)}function getScrollParent(o){return["html","body","#document"].indexOf(getNodeName(o))>=0?o.ownerDocument.body:isHTMLElement$1(o)&&isScrollParent(o)?o:getScrollParent(getParentNode(o))}function listScrollParents(o,_){var $;_===void 0&&(_=[]);var j=getScrollParent(o),_e=j===(($=o.ownerDocument)==null?void 0:$.body),et=getWindow(j),tt=_e?[et].concat(et.visualViewport||[],isScrollParent(j)?j:[]):j,rt=_.concat(tt);return _e?rt:rt.concat(listScrollParents(getParentNode(tt)))}function rectToClientRect(o){return Object.assign({},o,{left:o.x,top:o.y,right:o.x+o.width,bottom:o.y+o.height})}function getInnerBoundingClientRect(o,_){var $=getBoundingClientRect(o,!1,_==="fixed");return $.top=$.top+o.clientTop,$.left=$.left+o.clientLeft,$.bottom=$.top+o.clientHeight,$.right=$.left+o.clientWidth,$.width=o.clientWidth,$.height=o.clientHeight,$.x=$.left,$.y=$.top,$}function getClientRectFromMixedType(o,_,$){return _===viewport?rectToClientRect(getViewportRect(o,$)):isElement(_)?getInnerBoundingClientRect(_,$):rectToClientRect(getDocumentRect(getDocumentElement(o)))}function getClippingParents(o){var _=listScrollParents(getParentNode(o)),$=["absolute","fixed"].indexOf(getComputedStyle(o).position)>=0,j=$&&isHTMLElement$1(o)?getOffsetParent(o):o;return isElement(j)?_.filter(function(_e){return isElement(_e)&&contains(_e,j)&&getNodeName(_e)!=="body"}):[]}function getClippingRect(o,_,$,j){var _e=_==="clippingParents"?getClippingParents(o):[].concat(_),et=[].concat(_e,[$]),tt=et[0],rt=et.reduce(function(nt,ot){var it=getClientRectFromMixedType(o,ot,j);return nt.top=max$4(it.top,nt.top),nt.right=min$3(it.right,nt.right),nt.bottom=min$3(it.bottom,nt.bottom),nt.left=max$4(it.left,nt.left),nt},getClientRectFromMixedType(o,tt,j));return rt.width=rt.right-rt.left,rt.height=rt.bottom-rt.top,rt.x=rt.left,rt.y=rt.top,rt}function computeOffsets(o){var _=o.reference,$=o.element,j=o.placement,_e=j?getBasePlacement(j):null,et=j?getVariation(j):null,tt=_.x+_.width/2-$.width/2,rt=_.y+_.height/2-$.height/2,nt;switch(_e){case top:nt={x:tt,y:_.y-$.height};break;case bottom:nt={x:tt,y:_.y+_.height};break;case right:nt={x:_.x+_.width,y:rt};break;case left:nt={x:_.x-$.width,y:rt};break;default:nt={x:_.x,y:_.y}}var ot=_e?getMainAxisFromPlacement(_e):null;if(ot!=null){var it=ot==="y"?"height":"width";switch(et){case start:nt[ot]=nt[ot]-(_[it]/2-$[it]/2);break;case end:nt[ot]=nt[ot]+(_[it]/2-$[it]/2);break}}return nt}function detectOverflow(o,_){_===void 0&&(_={});var $=_,j=$.placement,_e=j===void 0?o.placement:j,et=$.strategy,tt=et===void 0?o.strategy:et,rt=$.boundary,nt=rt===void 0?clippingParents:rt,ot=$.rootBoundary,it=ot===void 0?viewport:ot,st=$.elementContext,at=st===void 0?popper:st,lt=$.altBoundary,ct=lt===void 0?!1:lt,ft=$.padding,dt=ft===void 0?0:ft,pt=mergePaddingObject(typeof dt!="number"?dt:expandToHashMap(dt,basePlacements)),yt=at===popper?reference:popper,vt=o.rects.popper,wt=o.elements[ct?yt:at],Ct=getClippingRect(isElement(wt)?wt:wt.contextElement||getDocumentElement(o.elements.popper),nt,it,tt),Pt=getBoundingClientRect(o.elements.reference),Bt=computeOffsets({reference:Pt,element:vt,placement:_e}),At=rectToClientRect(Object.assign({},vt,Bt)),kt=at===popper?At:Pt,Ot={top:Ct.top-kt.top+pt.top,bottom:kt.bottom-Ct.bottom+pt.bottom,left:Ct.left-kt.left+pt.left,right:kt.right-Ct.right+pt.right},Tt=o.modifiersData.offset;if(at===popper&&Tt){var ht=Tt[_e];Object.keys(Ot).forEach(function(bt){var mt=[right,bottom].indexOf(bt)>=0?1:-1,gt=[top,bottom].indexOf(bt)>=0?"y":"x";Ot[bt]+=ht[gt]*mt})}return Ot}function computeAutoPlacement(o,_){_===void 0&&(_={});var $=_,j=$.placement,_e=$.boundary,et=$.rootBoundary,tt=$.padding,rt=$.flipVariations,nt=$.allowedAutoPlacements,ot=nt===void 0?placements:nt,it=getVariation(j),st=it?rt?variationPlacements:variationPlacements.filter(function(ct){return getVariation(ct)===it}):basePlacements,at=st.filter(function(ct){return ot.indexOf(ct)>=0});at.length===0&&(at=st);var lt=at.reduce(function(ct,ft){return ct[ft]=detectOverflow(o,{placement:ft,boundary:_e,rootBoundary:et,padding:tt})[getBasePlacement(ft)],ct},{});return Object.keys(lt).sort(function(ct,ft){return lt[ct]-lt[ft]})}function getExpandedFallbackPlacements(o){if(getBasePlacement(o)===auto)return[];var _=getOppositePlacement(o);return[getOppositeVariationPlacement(o),_,getOppositeVariationPlacement(_)]}function flip(o){var _=o.state,$=o.options,j=o.name;if(!_.modifiersData[j]._skip){for(var _e=$.mainAxis,et=_e===void 0?!0:_e,tt=$.altAxis,rt=tt===void 0?!0:tt,nt=$.fallbackPlacements,ot=$.padding,it=$.boundary,st=$.rootBoundary,at=$.altBoundary,lt=$.flipVariations,ct=lt===void 0?!0:lt,ft=$.allowedAutoPlacements,dt=_.options.placement,pt=getBasePlacement(dt),yt=pt===dt,vt=nt||(yt||!ct?[getOppositePlacement(dt)]:getExpandedFallbackPlacements(dt)),wt=[dt].concat(vt).reduce(function(Vt,Gt){return Vt.concat(getBasePlacement(Gt)===auto?computeAutoPlacement(_,{placement:Gt,boundary:it,rootBoundary:st,padding:ot,flipVariations:ct,allowedAutoPlacements:ft}):Gt)},[]),Ct=_.rects.reference,Pt=_.rects.popper,Bt=new Map,At=!0,kt=wt[0],Ot=0;Ot=0,gt=mt?"width":"height",xt=detectOverflow(_,{placement:Tt,boundary:it,rootBoundary:st,altBoundary:at,padding:ot}),Et=mt?bt?right:left:bt?bottom:top;Ct[gt]>Pt[gt]&&(Et=getOppositePlacement(Et));var _t=getOppositePlacement(Et),$t=[];if(et&&$t.push(xt[ht]<=0),rt&&$t.push(xt[Et]<=0,xt[_t]<=0),$t.every(function(Vt){return Vt})){kt=Tt,At=!1;break}Bt.set(Tt,$t)}if(At)for(var St=ct?3:1,Rt=function(Gt){var zt=wt.find(function(jt){var Ft=Bt.get(jt);if(Ft)return Ft.slice(0,Gt).every(function(qt){return qt})});if(zt)return kt=zt,"break"},It=St;It>0;It--){var Mt=Rt(It);if(Mt==="break")break}_.placement!==kt&&(_.modifiersData[j]._skip=!0,_.placement=kt,_.reset=!0)}}const flip$1={name:"flip",enabled:!0,phase:"main",fn:flip,requiresIfExists:["offset"],data:{_skip:!1}};function getSideOffsets(o,_,$){return $===void 0&&($={x:0,y:0}),{top:o.top-_.height-$.y,right:o.right-_.width+$.x,bottom:o.bottom-_.height+$.y,left:o.left-_.width-$.x}}function isAnySideFullyClipped(o){return[top,right,bottom,left].some(function(_){return o[_]>=0})}function hide(o){var _=o.state,$=o.name,j=_.rects.reference,_e=_.rects.popper,et=_.modifiersData.preventOverflow,tt=detectOverflow(_,{elementContext:"reference"}),rt=detectOverflow(_,{altBoundary:!0}),nt=getSideOffsets(tt,j),ot=getSideOffsets(rt,_e,et),it=isAnySideFullyClipped(nt),st=isAnySideFullyClipped(ot);_.modifiersData[$]={referenceClippingOffsets:nt,popperEscapeOffsets:ot,isReferenceHidden:it,hasPopperEscaped:st},_.attributes.popper=Object.assign({},_.attributes.popper,{"data-popper-reference-hidden":it,"data-popper-escaped":st})}const hide$1={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:hide};function distanceAndSkiddingToXY(o,_,$){var j=getBasePlacement(o),_e=[left,top].indexOf(j)>=0?-1:1,et=typeof $=="function"?$(Object.assign({},_,{placement:o})):$,tt=et[0],rt=et[1];return tt=tt||0,rt=(rt||0)*_e,[left,right].indexOf(j)>=0?{x:rt,y:tt}:{x:tt,y:rt}}function offset(o){var _=o.state,$=o.options,j=o.name,_e=$.offset,et=_e===void 0?[0,0]:_e,tt=placements.reduce(function(it,st){return it[st]=distanceAndSkiddingToXY(st,_.rects,et),it},{}),rt=tt[_.placement],nt=rt.x,ot=rt.y;_.modifiersData.popperOffsets!=null&&(_.modifiersData.popperOffsets.x+=nt,_.modifiersData.popperOffsets.y+=ot),_.modifiersData[j]=tt}const offset$1={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:offset};function popperOffsets(o){var _=o.state,$=o.name;_.modifiersData[$]=computeOffsets({reference:_.rects.reference,element:_.rects.popper,placement:_.placement})}const popperOffsets$1={name:"popperOffsets",enabled:!0,phase:"read",fn:popperOffsets,data:{}};function getAltAxis(o){return o==="x"?"y":"x"}function preventOverflow(o){var _=o.state,$=o.options,j=o.name,_e=$.mainAxis,et=_e===void 0?!0:_e,tt=$.altAxis,rt=tt===void 0?!1:tt,nt=$.boundary,ot=$.rootBoundary,it=$.altBoundary,st=$.padding,at=$.tether,lt=at===void 0?!0:at,ct=$.tetherOffset,ft=ct===void 0?0:ct,dt=detectOverflow(_,{boundary:nt,rootBoundary:ot,padding:st,altBoundary:it}),pt=getBasePlacement(_.placement),yt=getVariation(_.placement),vt=!yt,wt=getMainAxisFromPlacement(pt),Ct=getAltAxis(wt),Pt=_.modifiersData.popperOffsets,Bt=_.rects.reference,At=_.rects.popper,kt=typeof ft=="function"?ft(Object.assign({},_.rects,{placement:_.placement})):ft,Ot=typeof kt=="number"?{mainAxis:kt,altAxis:kt}:Object.assign({mainAxis:0,altAxis:0},kt),Tt=_.modifiersData.offset?_.modifiersData.offset[_.placement]:null,ht={x:0,y:0};if(Pt){if(et){var bt,mt=wt==="y"?top:left,gt=wt==="y"?bottom:right,xt=wt==="y"?"height":"width",Et=Pt[wt],_t=Et+dt[mt],$t=Et-dt[gt],St=lt?-At[xt]/2:0,Rt=yt===start?Bt[xt]:At[xt],It=yt===start?-At[xt]:-Bt[xt],Mt=_.elements.arrow,Vt=lt&&Mt?getLayoutRect(Mt):{width:0,height:0},Gt=_.modifiersData["arrow#persistent"]?_.modifiersData["arrow#persistent"].padding:getFreshSideObject(),zt=Gt[mt],jt=Gt[gt],Ft=within(0,Bt[xt],Vt[xt]),qt=vt?Bt[xt]/2-St-Ft-zt-Ot.mainAxis:Rt-Ft-zt-Ot.mainAxis,Xt=vt?-Bt[xt]/2+St+Ft+jt+Ot.mainAxis:It+Ft+jt+Ot.mainAxis,Ut=_.elements.arrow&&getOffsetParent(_.elements.arrow),Lt=Ut?wt==="y"?Ut.clientTop||0:Ut.clientLeft||0:0,Ht=(bt=Tt==null?void 0:Tt[wt])!=null?bt:0,Kt=Et+qt-Ht-Lt,Jt=Et+Xt-Ht,tr=within(lt?min$3(_t,Kt):_t,Et,lt?max$4($t,Jt):$t);Pt[wt]=tr,ht[wt]=tr-Et}if(rt){var nr,ur=wt==="x"?top:left,rr=wt==="x"?bottom:right,pr=Pt[Ct],fr=Ct==="y"?"height":"width",lr=pr+dt[ur],wr=pr-dt[rr],hr=[top,left].indexOf(pt)!==-1,Er=(nr=Tt==null?void 0:Tt[Ct])!=null?nr:0,Pr=hr?lr:pr-Bt[fr]-At[fr]-Er+Ot.altAxis,br=hr?pr+Bt[fr]+At[fr]-Er-Ot.altAxis:wr,_r=lt&&hr?withinMaxClamp(Pr,pr,br):within(lt?Pr:lr,pr,lt?br:wr);Pt[Ct]=_r,ht[Ct]=_r-pr}_.modifiersData[j]=ht}}const preventOverflow$1={name:"preventOverflow",enabled:!0,phase:"main",fn:preventOverflow,requiresIfExists:["offset"]};function getHTMLElementScroll(o){return{scrollLeft:o.scrollLeft,scrollTop:o.scrollTop}}function getNodeScroll(o){return o===getWindow(o)||!isHTMLElement$1(o)?getWindowScroll(o):getHTMLElementScroll(o)}function isElementScaled(o){var _=o.getBoundingClientRect(),$=round$5(_.width)/o.offsetWidth||1,j=round$5(_.height)/o.offsetHeight||1;return $!==1||j!==1}function getCompositeRect(o,_,$){$===void 0&&($=!1);var j=isHTMLElement$1(_),_e=isHTMLElement$1(_)&&isElementScaled(_),et=getDocumentElement(_),tt=getBoundingClientRect(o,_e,$),rt={scrollLeft:0,scrollTop:0},nt={x:0,y:0};return(j||!j&&!$)&&((getNodeName(_)!=="body"||isScrollParent(et))&&(rt=getNodeScroll(_)),isHTMLElement$1(_)?(nt=getBoundingClientRect(_,!0),nt.x+=_.clientLeft,nt.y+=_.clientTop):et&&(nt.x=getWindowScrollBarX(et))),{x:tt.left+rt.scrollLeft-nt.x,y:tt.top+rt.scrollTop-nt.y,width:tt.width,height:tt.height}}function order(o){var _=new Map,$=new Set,j=[];o.forEach(function(et){_.set(et.name,et)});function _e(et){$.add(et.name);var tt=[].concat(et.requires||[],et.requiresIfExists||[]);tt.forEach(function(rt){if(!$.has(rt)){var nt=_.get(rt);nt&&_e(nt)}}),j.push(et)}return o.forEach(function(et){$.has(et.name)||_e(et)}),j}function orderModifiers(o){var _=order(o);return modifierPhases.reduce(function($,j){return $.concat(_.filter(function(_e){return _e.phase===j}))},[])}function debounce$2(o){var _;return function(){return _||(_=new Promise(function($){Promise.resolve().then(function(){_=void 0,$(o())})})),_}}function mergeByName(o){var _=o.reduce(function($,j){var _e=$[j.name];return $[j.name]=_e?Object.assign({},_e,j,{options:Object.assign({},_e.options,j.options),data:Object.assign({},_e.data,j.data)}):j,$},{});return Object.keys(_).map(function($){return _[$]})}var DEFAULT_OPTIONS={placement:"bottom",modifiers:[],strategy:"absolute"};function areValidElements(){for(var o=arguments.length,_=new Array(o),$=0;$=19?((_=o==null?void 0:o.props)==null?void 0:_.ref)||null:(o==null?void 0:o.ref)||null}function getContainer$1(o){return typeof o=="function"?o():o}const Portal=reactExports.forwardRef(function(_,$){const{children:j,container:_e,disablePortal:et=!1}=_,[tt,rt]=reactExports.useState(null),nt=useForkRef(reactExports.isValidElement(j)?getReactElementRef(j):null,$);if(useEnhancedEffect(()=>{et||rt(getContainer$1(_e)||document.body)},[_e,et]),useEnhancedEffect(()=>{if(tt&&!et)return setRef$1($,tt),()=>{setRef$1($,null)}},[$,tt,et]),et){if(reactExports.isValidElement(j)){const ot={ref:nt};return reactExports.cloneElement(j,ot)}return j}return tt&&reactDomExports.createPortal(j,tt)});function getPopperUtilityClass(o){return generateUtilityClass("MuiPopper",o)}generateUtilityClasses("MuiPopper",["root"]);function flipPlacement(o,_){if(_==="ltr")return o;switch(o){case"bottom-end":return"bottom-start";case"bottom-start":return"bottom-end";case"top-end":return"top-start";case"top-start":return"top-end";default:return o}}function resolveAnchorEl$1(o){return typeof o=="function"?o():o}function isHTMLElement(o){return o.nodeType!==void 0}const useUtilityClasses$K=o=>{const{classes:_}=o;return composeClasses({root:["root"]},getPopperUtilityClass,_)},defaultPopperOptions={},PopperTooltip=reactExports.forwardRef(function(_,$){const{anchorEl:j,children:_e,direction:et,disablePortal:tt,modifiers:rt,open:nt,placement:ot,popperOptions:it,popperRef:st,slotProps:at={},slots:lt={},TransitionProps:ct,ownerState:ft,...dt}=_,pt=reactExports.useRef(null),yt=useForkRef(pt,$),vt=reactExports.useRef(null),wt=useForkRef(vt,st),Ct=reactExports.useRef(wt);useEnhancedEffect(()=>{Ct.current=wt},[wt]),reactExports.useImperativeHandle(st,()=>vt.current,[]);const Pt=flipPlacement(ot,et),[Bt,At]=reactExports.useState(Pt),[kt,Ot]=reactExports.useState(resolveAnchorEl$1(j));reactExports.useEffect(()=>{vt.current&&vt.current.forceUpdate()}),reactExports.useEffect(()=>{j&&Ot(resolveAnchorEl$1(j))},[j]),useEnhancedEffect(()=>{if(!kt||!nt)return;const gt=_t=>{At(_t.placement)};let xt=[{name:"preventOverflow",options:{altBoundary:tt}},{name:"flip",options:{altBoundary:tt}},{name:"onUpdate",enabled:!0,phase:"afterWrite",fn:({state:_t})=>{gt(_t)}}];rt!=null&&(xt=xt.concat(rt)),it&&it.modifiers!=null&&(xt=xt.concat(it.modifiers));const Et=createPopper(kt,pt.current,{placement:Pt,...it,modifiers:xt});return Ct.current(Et),()=>{Et.destroy(),Ct.current(null)}},[kt,tt,rt,nt,it,Pt]);const Tt={placement:Bt};ct!==null&&(Tt.TransitionProps=ct);const ht=useUtilityClasses$K(_),bt=lt.root??"div",mt=useSlotProps({elementType:bt,externalSlotProps:at.root,externalForwardedProps:dt,additionalProps:{role:"tooltip",ref:yt},ownerState:_,className:ht.root});return jsxRuntimeExports.jsx(bt,{...mt,children:typeof _e=="function"?_e(Tt):_e})}),Popper$1=reactExports.forwardRef(function(_,$){const{anchorEl:j,children:_e,container:et,direction:tt="ltr",disablePortal:rt=!1,keepMounted:nt=!1,modifiers:ot,open:it,placement:st="bottom",popperOptions:at=defaultPopperOptions,popperRef:lt,style:ct,transition:ft=!1,slotProps:dt={},slots:pt={},...yt}=_,[vt,wt]=reactExports.useState(!0),Ct=()=>{wt(!1)},Pt=()=>{wt(!0)};if(!nt&&!it&&(!ft||vt))return null;let Bt;if(et)Bt=et;else if(j){const Ot=resolveAnchorEl$1(j);Bt=Ot&&isHTMLElement(Ot)?ownerDocument(Ot).body:ownerDocument(null).body}const At=!it&&nt&&(!ft||vt)?"none":void 0,kt=ft?{in:it,onEnter:Ct,onExited:Pt}:void 0;return jsxRuntimeExports.jsx(Portal,{disablePortal:rt,container:Bt,children:jsxRuntimeExports.jsx(PopperTooltip,{anchorEl:j,direction:tt,disablePortal:rt,modifiers:ot,ref:$,open:ft?!vt:it,placement:st,popperOptions:at,popperRef:lt,slotProps:dt,slots:pt,...yt,style:{position:"fixed",top:0,left:0,display:At,...ct},TransitionProps:kt,children:_e})})}),PopperRoot=styled(Popper$1,{name:"MuiPopper",slot:"Root"})({}),Popper=reactExports.forwardRef(function(_,$){const j=useRtl(),_e=useDefaultProps({props:_,name:"MuiPopper"}),{anchorEl:et,component:tt,components:rt,componentsProps:nt,container:ot,disablePortal:it,keepMounted:st,modifiers:at,open:lt,placement:ct,popperOptions:ft,popperRef:dt,transition:pt,slots:yt,slotProps:vt,...wt}=_e,Ct=(yt==null?void 0:yt.root)??(rt==null?void 0:rt.Root),Pt={anchorEl:et,container:ot,disablePortal:it,keepMounted:st,modifiers:at,open:lt,placement:ct,popperOptions:ft,popperRef:dt,transition:pt,...wt};return jsxRuntimeExports.jsx(PopperRoot,{as:tt,direction:j?"rtl":"ltr",slots:{root:Ct},slotProps:vt??nt,...Pt,ref:$})}),CancelIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12 17 15.59z"}));function getChipUtilityClass(o){return generateUtilityClass("MuiChip",o)}const chipClasses=generateUtilityClasses("MuiChip",["root","sizeSmall","sizeMedium","colorDefault","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","disabled","clickable","clickableColorPrimary","clickableColorSecondary","deletable","deletableColorPrimary","deletableColorSecondary","outlined","filled","outlinedPrimary","outlinedSecondary","filledPrimary","filledSecondary","avatar","avatarSmall","avatarMedium","avatarColorPrimary","avatarColorSecondary","icon","iconSmall","iconMedium","iconColorPrimary","iconColorSecondary","label","labelSmall","labelMedium","deleteIcon","deleteIconSmall","deleteIconMedium","deleteIconColorPrimary","deleteIconColorSecondary","deleteIconOutlinedColorPrimary","deleteIconOutlinedColorSecondary","deleteIconFilledColorPrimary","deleteIconFilledColorSecondary","focusVisible"]),useUtilityClasses$J=o=>{const{classes:_,disabled:$,size:j,color:_e,iconColor:et,onDelete:tt,clickable:rt,variant:nt}=o,ot={root:["root",nt,$&&"disabled",`size${capitalize(j)}`,`color${capitalize(_e)}`,rt&&"clickable",rt&&`clickableColor${capitalize(_e)}`,tt&&"deletable",tt&&`deletableColor${capitalize(_e)}`,`${nt}${capitalize(_e)}`],label:["label",`label${capitalize(j)}`],avatar:["avatar",`avatar${capitalize(j)}`,`avatarColor${capitalize(_e)}`],icon:["icon",`icon${capitalize(j)}`,`iconColor${capitalize(et)}`],deleteIcon:["deleteIcon",`deleteIcon${capitalize(j)}`,`deleteIconColor${capitalize(_e)}`,`deleteIcon${capitalize(nt)}Color${capitalize(_e)}`]};return composeClasses(ot,getChipUtilityClass,_)},ChipRoot=styled("div",{name:"MuiChip",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o,{color:j,iconColor:_e,clickable:et,onDelete:tt,size:rt,variant:nt}=$;return[{[`& .${chipClasses.avatar}`]:_.avatar},{[`& .${chipClasses.avatar}`]:_[`avatar${capitalize(rt)}`]},{[`& .${chipClasses.avatar}`]:_[`avatarColor${capitalize(j)}`]},{[`& .${chipClasses.icon}`]:_.icon},{[`& .${chipClasses.icon}`]:_[`icon${capitalize(rt)}`]},{[`& .${chipClasses.icon}`]:_[`iconColor${capitalize(_e)}`]},{[`& .${chipClasses.deleteIcon}`]:_.deleteIcon},{[`& .${chipClasses.deleteIcon}`]:_[`deleteIcon${capitalize(rt)}`]},{[`& .${chipClasses.deleteIcon}`]:_[`deleteIconColor${capitalize(j)}`]},{[`& .${chipClasses.deleteIcon}`]:_[`deleteIcon${capitalize(nt)}Color${capitalize(j)}`]},_.root,_[`size${capitalize(rt)}`],_[`color${capitalize(j)}`],et&&_.clickable,et&&j!=="default"&&_[`clickableColor${capitalize(j)}`],tt&&_.deletable,tt&&j!=="default"&&_[`deletableColor${capitalize(j)}`],_[nt],_[`${nt}${capitalize(j)}`]]}})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light"?o.palette.grey[700]:o.palette.grey[300];return{maxWidth:"100%",fontFamily:o.typography.fontFamily,fontSize:o.typography.pxToRem(13),display:"inline-flex",alignItems:"center",justifyContent:"center",height:32,lineHeight:1.5,color:(o.vars||o).palette.text.primary,backgroundColor:(o.vars||o).palette.action.selected,borderRadius:32/2,whiteSpace:"nowrap",transition:o.transitions.create(["background-color","box-shadow"]),cursor:"unset",outline:0,textDecoration:"none",border:0,padding:0,verticalAlign:"middle",boxSizing:"border-box",[`&.${chipClasses.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity,pointerEvents:"none"},[`& .${chipClasses.avatar}`]:{marginLeft:5,marginRight:-6,width:24,height:24,color:o.vars?o.vars.palette.Chip.defaultAvatarColor:_,fontSize:o.typography.pxToRem(12)},[`& .${chipClasses.avatarColorPrimary}`]:{color:(o.vars||o).palette.primary.contrastText,backgroundColor:(o.vars||o).palette.primary.dark},[`& .${chipClasses.avatarColorSecondary}`]:{color:(o.vars||o).palette.secondary.contrastText,backgroundColor:(o.vars||o).palette.secondary.dark},[`& .${chipClasses.avatarSmall}`]:{marginLeft:4,marginRight:-4,width:18,height:18,fontSize:o.typography.pxToRem(10)},[`& .${chipClasses.icon}`]:{marginLeft:5,marginRight:-6},[`& .${chipClasses.deleteIcon}`]:{WebkitTapHighlightColor:"transparent",color:o.alpha((o.vars||o).palette.text.primary,.26),fontSize:22,cursor:"pointer",margin:"0 5px 0 -6px","&:hover":{color:o.alpha((o.vars||o).palette.text.primary,.4)}},variants:[{props:{size:"small"},style:{height:24,[`& .${chipClasses.icon}`]:{fontSize:18,marginLeft:4,marginRight:-4},[`& .${chipClasses.deleteIcon}`]:{fontSize:16,marginRight:4,marginLeft:-4}}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["contrastText"])).map(([$])=>({props:{color:$},style:{backgroundColor:(o.vars||o).palette[$].main,color:(o.vars||o).palette[$].contrastText,[`& .${chipClasses.deleteIcon}`]:{color:o.alpha((o.vars||o).palette[$].contrastText,.7),"&:hover, &:active":{color:(o.vars||o).palette[$].contrastText}}}})),{props:$=>$.iconColor===$.color,style:{[`& .${chipClasses.icon}`]:{color:o.vars?o.vars.palette.Chip.defaultIconColor:_}}},{props:$=>$.iconColor===$.color&&$.color!=="default",style:{[`& .${chipClasses.icon}`]:{color:"inherit"}}},{props:{onDelete:!0},style:{[`&.${chipClasses.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette.action.selected,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.focusOpacity}`)}}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([$])=>({props:{color:$,onDelete:!0},style:{[`&.${chipClasses.focusVisible}`]:{background:(o.vars||o).palette[$].dark}}})),{props:{clickable:!0},style:{userSelect:"none",WebkitTapHighlightColor:"transparent",cursor:"pointer","&:hover":{backgroundColor:o.alpha((o.vars||o).palette.action.selected,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.hoverOpacity}`)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette.action.selected,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.focusOpacity}`)},"&:active":{boxShadow:(o.vars||o).shadows[1]}}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["dark"])).map(([$])=>({props:{color:$,clickable:!0},style:{[`&:hover, &.${chipClasses.focusVisible}`]:{backgroundColor:(o.vars||o).palette[$].dark}}})),{props:{variant:"outlined"},style:{backgroundColor:"transparent",border:o.vars?`1px solid ${o.vars.palette.Chip.defaultBorder}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[700]}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${chipClasses.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`& .${chipClasses.avatar}`]:{marginLeft:4},[`& .${chipClasses.avatarSmall}`]:{marginLeft:2},[`& .${chipClasses.icon}`]:{marginLeft:4},[`& .${chipClasses.iconSmall}`]:{marginLeft:2},[`& .${chipClasses.deleteIcon}`]:{marginRight:5},[`& .${chipClasses.deleteIconSmall}`]:{marginRight:3}}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([$])=>({props:{variant:"outlined",color:$},style:{color:(o.vars||o).palette[$].main,border:`1px solid ${o.alpha((o.vars||o).palette[$].main,.7)}`,[`&.${chipClasses.clickable}:hover`]:{backgroundColor:o.alpha((o.vars||o).palette[$].main,(o.vars||o).palette.action.hoverOpacity)},[`&.${chipClasses.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette[$].main,(o.vars||o).palette.action.focusOpacity)},[`& .${chipClasses.deleteIcon}`]:{color:o.alpha((o.vars||o).palette[$].main,.7),"&:hover, &:active":{color:(o.vars||o).palette[$].main}}}}))]}})),ChipLabel=styled("span",{name:"MuiChip",slot:"Label",overridesResolver:(o,_)=>{const{ownerState:$}=o,{size:j}=$;return[_.label,_[`label${capitalize(j)}`]]}})({overflow:"hidden",textOverflow:"ellipsis",paddingLeft:12,paddingRight:12,whiteSpace:"nowrap",variants:[{props:{variant:"outlined"},style:{paddingLeft:11,paddingRight:11}},{props:{size:"small"},style:{paddingLeft:8,paddingRight:8}},{props:{size:"small",variant:"outlined"},style:{paddingLeft:7,paddingRight:7}}]});function isDeleteKeyboardEvent(o){return o.key==="Backspace"||o.key==="Delete"}const Chip=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiChip"}),{avatar:_e,className:et,clickable:tt,color:rt="default",component:nt,deleteIcon:ot,disabled:it=!1,icon:st,label:at,onClick:lt,onDelete:ct,onKeyDown:ft,onKeyUp:dt,size:pt="medium",variant:yt="filled",tabIndex:vt,skipFocusWhenDisabled:wt=!1,slots:Ct={},slotProps:Pt={},...Bt}=j,At=reactExports.useRef(null),kt=useForkRef(At,$),Ot=zt=>{zt.stopPropagation(),ct&&ct(zt)},Tt=zt=>{zt.currentTarget===zt.target&&isDeleteKeyboardEvent(zt)&&zt.preventDefault(),ft&&ft(zt)},ht=zt=>{zt.currentTarget===zt.target&&ct&&isDeleteKeyboardEvent(zt)&&ct(zt),dt&&dt(zt)},bt=tt!==!1&<?!0:tt,mt=bt||ct?ButtonBase:nt||"div",gt={...j,component:mt,disabled:it,size:pt,color:rt,iconColor:reactExports.isValidElement(st)&&st.props.color||rt,onDelete:!!ct,clickable:bt,variant:yt},xt=useUtilityClasses$J(gt),Et=mt===ButtonBase?{component:nt||"div",focusVisibleClassName:xt.focusVisible,...ct&&{disableRipple:!0}}:{};let _t=null;ct&&(_t=ot&&reactExports.isValidElement(ot)?reactExports.cloneElement(ot,{className:clsx(ot.props.className,xt.deleteIcon),onClick:Ot}):jsxRuntimeExports.jsx(CancelIcon,{className:xt.deleteIcon,onClick:Ot}));let $t=null;_e&&reactExports.isValidElement(_e)&&($t=reactExports.cloneElement(_e,{className:clsx(xt.avatar,_e.props.className)}));let St=null;st&&reactExports.isValidElement(st)&&(St=reactExports.cloneElement(st,{className:clsx(xt.icon,st.props.className)}));const Rt={slots:Ct,slotProps:Pt},[It,Mt]=useSlot("root",{elementType:ChipRoot,externalForwardedProps:{...Rt,...Bt},ownerState:gt,shouldForwardComponentProp:!0,ref:kt,className:clsx(xt.root,et),additionalProps:{disabled:bt&&it?!0:void 0,tabIndex:wt&&it?-1:vt,...Et},getSlotProps:zt=>({...zt,onClick:jt=>{var Ft;(Ft=zt.onClick)==null||Ft.call(zt,jt),lt==null||lt(jt)},onKeyDown:jt=>{var Ft;(Ft=zt.onKeyDown)==null||Ft.call(zt,jt),Tt(jt)},onKeyUp:jt=>{var Ft;(Ft=zt.onKeyUp)==null||Ft.call(zt,jt),ht(jt)}})}),[Vt,Gt]=useSlot("label",{elementType:ChipLabel,externalForwardedProps:Rt,ownerState:gt,className:xt.label});return jsxRuntimeExports.jsxs(It,{as:mt,...Mt,children:[$t||St,jsxRuntimeExports.jsx(Vt,{...Gt,children:at}),_t]})});function getStyleValue(o){return parseInt(o,10)||0}const styles$4={shadow:{visibility:"hidden",position:"absolute",overflow:"hidden",height:0,top:0,left:0,transform:"translateZ(0)"}};function isObjectEmpty(o){for(const _ in o)return!1;return!0}function isEmpty$1(o){return isObjectEmpty(o)||o.outerHeightStyle===0&&!o.overflowing}const TextareaAutosize=reactExports.forwardRef(function(_,$){const{onChange:j,maxRows:_e,minRows:et=1,style:tt,value:rt,...nt}=_,{current:ot}=reactExports.useRef(rt!=null),it=reactExports.useRef(null),st=useForkRef($,it),at=reactExports.useRef(null),lt=reactExports.useRef(null),ct=reactExports.useCallback(()=>{const vt=it.current,wt=lt.current;if(!vt||!wt)return;const Pt=ownerWindow(vt).getComputedStyle(vt);if(Pt.width==="0px")return{outerHeightStyle:0,overflowing:!1};wt.style.width=Pt.width,wt.value=vt.value||_.placeholder||"x",wt.value.slice(-1)===` -`&&(wt.value+=" ");const Bt=Pt.boxSizing,At=getStyleValue(Pt.paddingBottom)+getStyleValue(Pt.paddingTop),kt=getStyleValue(Pt.borderBottomWidth)+getStyleValue(Pt.borderTopWidth),Ot=wt.scrollHeight;wt.value="x";const Tt=wt.scrollHeight;let ht=Ot;et&&(ht=Math.max(Number(et)*Tt,ht)),_e&&(ht=Math.min(Number(_e)*Tt,ht)),ht=Math.max(ht,Tt);const bt=ht+(Bt==="border-box"?At+kt:0),mt=Math.abs(ht-Ot)<=1;return{outerHeightStyle:bt,overflowing:mt}},[_e,et,_.placeholder]),ft=useEventCallback(()=>{const vt=it.current,wt=ct();if(!vt||!wt||isEmpty$1(wt))return!1;const Ct=wt.outerHeightStyle;return at.current!=null&&at.current!==Ct}),dt=reactExports.useCallback(()=>{const vt=it.current,wt=ct();if(!vt||!wt||isEmpty$1(wt))return;const Ct=wt.outerHeightStyle;at.current!==Ct&&(at.current=Ct,vt.style.height=`${Ct}px`),vt.style.overflow=wt.overflowing?"hidden":""},[ct]),pt=reactExports.useRef(-1);useEnhancedEffect(()=>{const vt=debounce$3(dt),wt=it==null?void 0:it.current;if(!wt)return;const Ct=ownerWindow(wt);Ct.addEventListener("resize",vt);let Pt;return typeof ResizeObserver<"u"&&(Pt=new ResizeObserver(()=>{ft()&&(Pt.unobserve(wt),cancelAnimationFrame(pt.current),dt(),pt.current=requestAnimationFrame(()=>{Pt.observe(wt)}))}),Pt.observe(wt)),()=>{vt.clear(),cancelAnimationFrame(pt.current),Ct.removeEventListener("resize",vt),Pt&&Pt.disconnect()}},[ct,dt,ft]),useEnhancedEffect(()=>{dt()});const yt=vt=>{ot||dt();const wt=vt.target,Ct=wt.value.length,Pt=wt.value.endsWith(` -`),Bt=wt.selectionStart===Ct;Pt&&Bt&&wt.setSelectionRange(Ct,Ct),j&&j(vt)};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("textarea",{value:rt,onChange:yt,ref:st,rows:et,style:tt,...nt}),jsxRuntimeExports.jsx("textarea",{"aria-hidden":!0,className:_.className,readOnly:!0,ref:lt,tabIndex:-1,style:{...styles$4.shadow,...tt,paddingTop:0,paddingBottom:0}})]})});function formControlState({props:o,states:_,muiFormControl:$}){return _.reduce((j,_e)=>(j[_e]=o[_e],$&&typeof o[_e]>"u"&&(j[_e]=$[_e]),j),{})}const FormControlContext=reactExports.createContext(void 0);function useFormControl(){return reactExports.useContext(FormControlContext)}function hasValue(o){return o!=null&&!(Array.isArray(o)&&o.length===0)}function isFilled(o,_=!1){return o&&(hasValue(o.value)&&o.value!==""||_&&hasValue(o.defaultValue)&&o.defaultValue!=="")}function isAdornedStart(o){return o.startAdornment}function getInputBaseUtilityClass(o){return generateUtilityClass("MuiInputBase",o)}const inputBaseClasses=generateUtilityClasses("MuiInputBase",["root","formControl","focused","disabled","adornedStart","adornedEnd","error","sizeSmall","multiline","colorSecondary","fullWidth","hiddenLabel","readOnly","input","inputSizeSmall","inputMultiline","inputTypeSearch","inputAdornedStart","inputAdornedEnd","inputHiddenLabel"]);var _InputGlobalStyles;const rootOverridesResolver=(o,_)=>{const{ownerState:$}=o;return[_.root,$.formControl&&_.formControl,$.startAdornment&&_.adornedStart,$.endAdornment&&_.adornedEnd,$.error&&_.error,$.size==="small"&&_.sizeSmall,$.multiline&&_.multiline,$.color&&_[`color${capitalize($.color)}`],$.fullWidth&&_.fullWidth,$.hiddenLabel&&_.hiddenLabel]},inputOverridesResolver=(o,_)=>{const{ownerState:$}=o;return[_.input,$.size==="small"&&_.inputSizeSmall,$.multiline&&_.inputMultiline,$.type==="search"&&_.inputTypeSearch,$.startAdornment&&_.inputAdornedStart,$.endAdornment&&_.inputAdornedEnd,$.hiddenLabel&&_.inputHiddenLabel]},useUtilityClasses$I=o=>{const{classes:_,color:$,disabled:j,error:_e,endAdornment:et,focused:tt,formControl:rt,fullWidth:nt,hiddenLabel:ot,multiline:it,readOnly:st,size:at,startAdornment:lt,type:ct}=o,ft={root:["root",`color${capitalize($)}`,j&&"disabled",_e&&"error",nt&&"fullWidth",tt&&"focused",rt&&"formControl",at&&at!=="medium"&&`size${capitalize(at)}`,it&&"multiline",lt&&"adornedStart",et&&"adornedEnd",ot&&"hiddenLabel",st&&"readOnly"],input:["input",j&&"disabled",ct==="search"&&"inputTypeSearch",it&&"inputMultiline",at==="small"&&"inputSizeSmall",ot&&"inputHiddenLabel",lt&&"inputAdornedStart",et&&"inputAdornedEnd",st&&"readOnly"]};return composeClasses(ft,getInputBaseUtilityClass,_)},InputBaseRoot=styled("div",{name:"MuiInputBase",slot:"Root",overridesResolver:rootOverridesResolver})(memoTheme(({theme:o})=>({...o.typography.body1,color:(o.vars||o).palette.text.primary,lineHeight:"1.4375em",boxSizing:"border-box",position:"relative",cursor:"text",display:"inline-flex",alignItems:"center",[`&.${inputBaseClasses.disabled}`]:{color:(o.vars||o).palette.text.disabled,cursor:"default"},variants:[{props:({ownerState:_})=>_.multiline,style:{padding:"4px 0 5px"}},{props:({ownerState:_,size:$})=>_.multiline&&$==="small",style:{paddingTop:1}},{props:({ownerState:_})=>_.fullWidth,style:{width:"100%"}}]}))),InputBaseInput=styled("input",{name:"MuiInputBase",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light",$={color:"currentColor",...o.vars?{opacity:o.vars.opacity.inputPlaceholder}:{opacity:_?.42:.5},transition:o.transitions.create("opacity",{duration:o.transitions.duration.shorter})},j={opacity:"0 !important"},_e=o.vars?{opacity:o.vars.opacity.inputPlaceholder}:{opacity:_?.42:.5};return{font:"inherit",letterSpacing:"inherit",color:"currentColor",padding:"4px 0 5px",border:0,boxSizing:"content-box",background:"none",height:"1.4375em",margin:0,WebkitTapHighlightColor:"transparent",display:"block",minWidth:0,width:"100%","&::-webkit-input-placeholder":$,"&::-moz-placeholder":$,"&::-ms-input-placeholder":$,"&:focus":{outline:0},"&:invalid":{boxShadow:"none"},"&::-webkit-search-decoration":{WebkitAppearance:"none"},[`label[data-shrink=false] + .${inputBaseClasses.formControl} &`]:{"&::-webkit-input-placeholder":j,"&::-moz-placeholder":j,"&::-ms-input-placeholder":j,"&:focus::-webkit-input-placeholder":_e,"&:focus::-moz-placeholder":_e,"&:focus::-ms-input-placeholder":_e},[`&.${inputBaseClasses.disabled}`]:{opacity:1,WebkitTextFillColor:(o.vars||o).palette.text.disabled},variants:[{props:({ownerState:et})=>!et.disableInjectingGlobalStyles,style:{animationName:"mui-auto-fill-cancel",animationDuration:"10ms","&:-webkit-autofill":{animationDuration:"5000s",animationName:"mui-auto-fill"}}},{props:{size:"small"},style:{paddingTop:1}},{props:({ownerState:et})=>et.multiline,style:{height:"auto",resize:"none",padding:0,paddingTop:0}},{props:{type:"search"},style:{MozAppearance:"textfield"}}]}})),InputGlobalStyles=globalCss({"@keyframes mui-auto-fill":{from:{display:"block"}},"@keyframes mui-auto-fill-cancel":{from:{display:"block"}}}),InputBase=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiInputBase"}),{"aria-describedby":_e,autoComplete:et,autoFocus:tt,className:rt,color:nt,components:ot={},componentsProps:it={},defaultValue:st,disabled:at,disableInjectingGlobalStyles:lt,endAdornment:ct,error:ft,fullWidth:dt=!1,id:pt,inputComponent:yt="input",inputProps:vt={},inputRef:wt,margin:Ct,maxRows:Pt,minRows:Bt,multiline:At=!1,name:kt,onBlur:Ot,onChange:Tt,onClick:ht,onFocus:bt,onKeyDown:mt,onKeyUp:gt,placeholder:xt,readOnly:Et,renderSuffix:_t,rows:$t,size:St,slotProps:Rt={},slots:It={},startAdornment:Mt,type:Vt="text",value:Gt,...zt}=j,jt=vt.value!=null?vt.value:Gt,{current:Ft}=reactExports.useRef(jt!=null),qt=reactExports.useRef(),Xt=reactExports.useCallback(Nt=>{},[]),Ut=useForkRef(qt,wt,vt.ref,Xt),[Lt,Ht]=reactExports.useState(!1),Kt=useFormControl(),Jt=formControlState({props:j,muiFormControl:Kt,states:["color","disabled","error","hiddenLabel","size","required","filled"]});Jt.focused=Kt?Kt.focused:Lt,reactExports.useEffect(()=>{!Kt&&at&&Lt&&(Ht(!1),Ot&&Ot())},[Kt,at,Lt,Ot]);const tr=Kt&&Kt.onFilled,nr=Kt&&Kt.onEmpty,ur=reactExports.useCallback(Nt=>{isFilled(Nt)?tr&&tr():nr&&nr()},[tr,nr]);useEnhancedEffect(()=>{Ft&&ur({value:jt})},[jt,ur,Ft]);const rr=Nt=>{bt&&bt(Nt),vt.onFocus&&vt.onFocus(Nt),Kt&&Kt.onFocus?Kt.onFocus(Nt):Ht(!0)},pr=Nt=>{Ot&&Ot(Nt),vt.onBlur&&vt.onBlur(Nt),Kt&&Kt.onBlur?Kt.onBlur(Nt):Ht(!1)},fr=(Nt,...Dt)=>{if(!Ft){const Yt=Nt.target||qt.current;if(Yt==null)throw new Error(formatMuiErrorMessage(1));ur({value:Yt.value})}vt.onChange&&vt.onChange(Nt,...Dt),Tt&&Tt(Nt,...Dt)};reactExports.useEffect(()=>{ur(qt.current)},[]);const lr=Nt=>{qt.current&&Nt.currentTarget===Nt.target&&qt.current.focus(),ht&&ht(Nt)};let wr=yt,hr=vt;At&&wr==="input"&&($t?hr={type:void 0,minRows:$t,maxRows:$t,...hr}:hr={type:void 0,maxRows:Pt,minRows:Bt,...hr},wr=TextareaAutosize);const Er=Nt=>{ur(Nt.animationName==="mui-auto-fill-cancel"?qt.current:{value:"x"})};reactExports.useEffect(()=>{Kt&&Kt.setAdornedStart(!!Mt)},[Kt,Mt]);const Pr={...j,color:Jt.color||"primary",disabled:Jt.disabled,endAdornment:ct,error:Jt.error,focused:Jt.focused,formControl:Kt,fullWidth:dt,hiddenLabel:Jt.hiddenLabel,multiline:At,size:Jt.size,startAdornment:Mt,type:Vt},br=useUtilityClasses$I(Pr),_r=It.root||ot.Root||InputBaseRoot,Rr=Rt.root||it.root||{},Wt=It.input||ot.Input||InputBaseInput;return hr={...hr,...Rt.input??it.input},jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[!lt&&typeof InputGlobalStyles=="function"&&(_InputGlobalStyles||(_InputGlobalStyles=jsxRuntimeExports.jsx(InputGlobalStyles,{}))),jsxRuntimeExports.jsxs(_r,{...Rr,ref:$,onClick:lr,...zt,...!isHostComponent(_r)&&{ownerState:{...Pr,...Rr.ownerState}},className:clsx(br.root,Rr.className,rt,Et&&"MuiInputBase-readOnly"),children:[Mt,jsxRuntimeExports.jsx(FormControlContext.Provider,{value:null,children:jsxRuntimeExports.jsx(Wt,{"aria-invalid":Jt.error,"aria-describedby":_e,autoComplete:et,autoFocus:tt,defaultValue:st,disabled:Jt.disabled,id:pt,onAnimationStart:Er,name:kt,placeholder:xt,readOnly:Et,required:Jt.required,rows:$t,value:jt,onKeyDown:mt,onKeyUp:gt,type:Vt,...hr,...!isHostComponent(Wt)&&{as:wr,ownerState:{...Pr,...hr.ownerState}},ref:Ut,className:clsx(br.input,hr.className,Et&&"MuiInputBase-readOnly"),onBlur:pr,onChange:fr,onFocus:rr})}),ct,_t?_t({...Jt,startAdornment:Mt}):null]})]})});function getInputUtilityClass(o){return generateUtilityClass("MuiInput",o)}const inputClasses={...inputBaseClasses,...generateUtilityClasses("MuiInput",["root","underline","input"])};function getOutlinedInputUtilityClass(o){return generateUtilityClass("MuiOutlinedInput",o)}const outlinedInputClasses={...inputBaseClasses,...generateUtilityClasses("MuiOutlinedInput",["root","notchedOutline","input"])};function getFilledInputUtilityClass(o){return generateUtilityClass("MuiFilledInput",o)}const filledInputClasses={...inputBaseClasses,...generateUtilityClasses("MuiFilledInput",["root","underline","input","adornedStart","adornedEnd","sizeSmall","multiline","hiddenLabel"])},ArrowDropDownIcon=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M7 10l5 5 5-5z"})),styles$3={entering:{opacity:1},entered:{opacity:1}},Fade=reactExports.forwardRef(function(_,$){const j=useTheme(),_e={enter:j.transitions.duration.enteringScreen,exit:j.transitions.duration.leavingScreen},{addEndListener:et,appear:tt=!0,children:rt,easing:nt,in:ot,onEnter:it,onEntered:st,onEntering:at,onExit:lt,onExited:ct,onExiting:ft,style:dt,timeout:pt=_e,TransitionComponent:yt=Transition,...vt}=_,wt=reactExports.useRef(null),Ct=useForkRef(wt,getReactElementRef(rt),$),Pt=mt=>gt=>{if(mt){const xt=wt.current;gt===void 0?mt(xt):mt(xt,gt)}},Bt=Pt(at),At=Pt((mt,gt)=>{reflow(mt);const xt=getTransitionProps({style:dt,timeout:pt,easing:nt},{mode:"enter"});mt.style.webkitTransition=j.transitions.create("opacity",xt),mt.style.transition=j.transitions.create("opacity",xt),it&&it(mt,gt)}),kt=Pt(st),Ot=Pt(ft),Tt=Pt(mt=>{const gt=getTransitionProps({style:dt,timeout:pt,easing:nt},{mode:"exit"});mt.style.webkitTransition=j.transitions.create("opacity",gt),mt.style.transition=j.transitions.create("opacity",gt),lt&<(mt)}),ht=Pt(ct),bt=mt=>{et&&et(wt.current,mt)};return jsxRuntimeExports.jsx(yt,{appear:tt,in:ot,nodeRef:wt,onEnter:At,onEntered:kt,onEntering:Bt,onExit:Tt,onExited:ht,onExiting:Ot,addEndListener:bt,timeout:pt,...vt,children:(mt,{ownerState:gt,...xt})=>reactExports.cloneElement(rt,{style:{opacity:0,visibility:mt==="exited"&&!ot?"hidden":void 0,...styles$3[mt],...dt,...rt.props.style},ref:Ct,...xt})})});function getBackdropUtilityClass(o){return generateUtilityClass("MuiBackdrop",o)}generateUtilityClasses("MuiBackdrop",["root","invisible"]);const useUtilityClasses$H=o=>{const{classes:_,invisible:$}=o;return composeClasses({root:["root",$&&"invisible"]},getBackdropUtilityClass,_)},BackdropRoot=styled("div",{name:"MuiBackdrop",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.invisible&&_.invisible]}})({position:"fixed",display:"flex",alignItems:"center",justifyContent:"center",right:0,bottom:0,top:0,left:0,backgroundColor:"rgba(0, 0, 0, 0.5)",WebkitTapHighlightColor:"transparent",variants:[{props:{invisible:!0},style:{backgroundColor:"transparent"}}]}),Backdrop=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiBackdrop"}),{children:_e,className:et,component:tt="div",invisible:rt=!1,open:nt,components:ot={},componentsProps:it={},slotProps:st={},slots:at={},TransitionComponent:lt,transitionDuration:ct,...ft}=j,dt={...j,component:tt,invisible:rt},pt=useUtilityClasses$H(dt),yt={transition:lt,root:ot.Root,...at},vt={...it,...st},wt={component:tt,slots:yt,slotProps:vt},[Ct,Pt]=useSlot("root",{elementType:BackdropRoot,externalForwardedProps:wt,className:clsx(pt.root,et),ownerState:dt}),[Bt,At]=useSlot("transition",{elementType:Fade,externalForwardedProps:wt,ownerState:dt});return jsxRuntimeExports.jsx(Bt,{in:nt,timeout:ct,...ft,...At,children:jsxRuntimeExports.jsx(Ct,{"aria-hidden":!0,...Pt,ref:$,children:_e})})});function useBadge(o){const{badgeContent:_,invisible:$=!1,max:j=99,showZero:_e=!1}=o,et=usePreviousProps({badgeContent:_,max:j});let tt=$;$===!1&&_===0&&!_e&&(tt=!0);const{badgeContent:rt,max:nt=j}=tt?et:o,ot=rt&&Number(rt)>nt?`${nt}+`:rt;return{badgeContent:rt,invisible:tt,max:nt,displayValue:ot}}function getBadgeUtilityClass(o){return generateUtilityClass("MuiBadge",o)}const badgeClasses=generateUtilityClasses("MuiBadge",["root","badge","dot","standard","anchorOriginTopRight","anchorOriginBottomRight","anchorOriginTopLeft","anchorOriginBottomLeft","invisible","colorError","colorInfo","colorPrimary","colorSecondary","colorSuccess","colorWarning","overlapRectangular","overlapCircular","anchorOriginTopLeftCircular","anchorOriginTopLeftRectangular","anchorOriginTopRightCircular","anchorOriginTopRightRectangular","anchorOriginBottomLeftCircular","anchorOriginBottomLeftRectangular","anchorOriginBottomRightCircular","anchorOriginBottomRightRectangular"]),RADIUS_STANDARD=10,RADIUS_DOT=4,useUtilityClasses$G=o=>{const{color:_,anchorOrigin:$,invisible:j,overlap:_e,variant:et,classes:tt={}}=o,rt={root:["root"],badge:["badge",et,j&&"invisible",`anchorOrigin${capitalize($.vertical)}${capitalize($.horizontal)}`,`anchorOrigin${capitalize($.vertical)}${capitalize($.horizontal)}${capitalize(_e)}`,`overlap${capitalize(_e)}`,_!=="default"&&`color${capitalize(_)}`]};return composeClasses(rt,getBadgeUtilityClass,tt)},BadgeRoot=styled("span",{name:"MuiBadge",slot:"Root"})({position:"relative",display:"inline-flex",verticalAlign:"middle",flexShrink:0}),BadgeBadge=styled("span",{name:"MuiBadge",slot:"Badge",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.badge,_[$.variant],_[`anchorOrigin${capitalize($.anchorOrigin.vertical)}${capitalize($.anchorOrigin.horizontal)}${capitalize($.overlap)}`],$.color!=="default"&&_[`color${capitalize($.color)}`],$.invisible&&_.invisible]}})(memoTheme(({theme:o})=>({display:"flex",flexDirection:"row",flexWrap:"wrap",justifyContent:"center",alignContent:"center",alignItems:"center",position:"absolute",boxSizing:"border-box",fontFamily:o.typography.fontFamily,fontWeight:o.typography.fontWeightMedium,fontSize:o.typography.pxToRem(12),minWidth:RADIUS_STANDARD*2,lineHeight:1,padding:"0 6px",height:RADIUS_STANDARD*2,borderRadius:RADIUS_STANDARD,zIndex:1,transition:o.transitions.create("transform",{easing:o.transitions.easing.easeInOut,duration:o.transitions.duration.enteringScreen}),variants:[...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["contrastText"])).map(([_])=>({props:{color:_},style:{backgroundColor:(o.vars||o).palette[_].main,color:(o.vars||o).palette[_].contrastText}})),{props:{variant:"dot"},style:{borderRadius:RADIUS_DOT,height:RADIUS_DOT*2,minWidth:RADIUS_DOT*2,padding:0}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="top"&&_.anchorOrigin.horizontal==="right"&&_.overlap==="rectangular",style:{top:0,right:0,transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="bottom"&&_.anchorOrigin.horizontal==="right"&&_.overlap==="rectangular",style:{bottom:0,right:0,transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="top"&&_.anchorOrigin.horizontal==="left"&&_.overlap==="rectangular",style:{top:0,left:0,transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="bottom"&&_.anchorOrigin.horizontal==="left"&&_.overlap==="rectangular",style:{bottom:0,left:0,transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="top"&&_.anchorOrigin.horizontal==="right"&&_.overlap==="circular",style:{top:"14%",right:"14%",transform:"scale(1) translate(50%, -50%)",transformOrigin:"100% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, -50%)"}}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="bottom"&&_.anchorOrigin.horizontal==="right"&&_.overlap==="circular",style:{bottom:"14%",right:"14%",transform:"scale(1) translate(50%, 50%)",transformOrigin:"100% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(50%, 50%)"}}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="top"&&_.anchorOrigin.horizontal==="left"&&_.overlap==="circular",style:{top:"14%",left:"14%",transform:"scale(1) translate(-50%, -50%)",transformOrigin:"0% 0%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, -50%)"}}},{props:({ownerState:_})=>_.anchorOrigin.vertical==="bottom"&&_.anchorOrigin.horizontal==="left"&&_.overlap==="circular",style:{bottom:"14%",left:"14%",transform:"scale(1) translate(-50%, 50%)",transformOrigin:"0% 100%",[`&.${badgeClasses.invisible}`]:{transform:"scale(0) translate(-50%, 50%)"}}},{props:{invisible:!0},style:{transition:o.transitions.create("transform",{easing:o.transitions.easing.easeInOut,duration:o.transitions.duration.leavingScreen})}}]})));function getAnchorOrigin(o){return{vertical:(o==null?void 0:o.vertical)??"top",horizontal:(o==null?void 0:o.horizontal)??"right"}}const Badge=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiBadge"}),{anchorOrigin:_e,className:et,classes:tt,component:rt,components:nt={},componentsProps:ot={},children:it,overlap:st="rectangular",color:at="default",invisible:lt=!1,max:ct=99,badgeContent:ft,slots:dt,slotProps:pt,showZero:yt=!1,variant:vt="standard",...wt}=j,{badgeContent:Ct,invisible:Pt,max:Bt,displayValue:At}=useBadge({max:ct,invisible:lt,badgeContent:ft,showZero:yt}),kt=usePreviousProps({anchorOrigin:getAnchorOrigin(_e),color:at,overlap:st,variant:vt,badgeContent:ft}),Ot=Pt||Ct==null&&vt!=="dot",{color:Tt=at,overlap:ht=st,anchorOrigin:bt,variant:mt=vt}=Ot?kt:j,gt=getAnchorOrigin(bt),xt=mt!=="dot"?At:void 0,Et={...j,badgeContent:Ct,invisible:Ot,max:Bt,displayValue:xt,showZero:yt,anchorOrigin:gt,color:Tt,overlap:ht,variant:mt},_t=useUtilityClasses$G(Et),$t={slots:{root:(dt==null?void 0:dt.root)??nt.Root,badge:(dt==null?void 0:dt.badge)??nt.Badge},slotProps:{root:(pt==null?void 0:pt.root)??ot.root,badge:(pt==null?void 0:pt.badge)??ot.badge}},[St,Rt]=useSlot("root",{elementType:BadgeRoot,externalForwardedProps:{...$t,...wt},ownerState:Et,className:clsx(_t.root,et),ref:$,additionalProps:{as:rt}}),[It,Mt]=useSlot("badge",{elementType:BadgeBadge,externalForwardedProps:$t,ownerState:Et,className:_t.badge});return jsxRuntimeExports.jsxs(St,{...Rt,children:[it,jsxRuntimeExports.jsx(It,{...Mt,children:xt})]})}),boxClasses=generateUtilityClasses("MuiBox",["root"]),defaultTheme=createTheme(),Box=createBox({themeId:THEME_ID,defaultTheme,defaultClassName:boxClasses.root,generateClassName:ClassNameGenerator.generate});function getButtonUtilityClass(o){return generateUtilityClass("MuiButton",o)}const buttonClasses=generateUtilityClasses("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","colorPrimary","colorSecondary","colorSuccess","colorError","colorInfo","colorWarning","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","icon","iconSizeSmall","iconSizeMedium","iconSizeLarge","loading","loadingWrapper","loadingIconPlaceholder","loadingIndicator","loadingPositionCenter","loadingPositionStart","loadingPositionEnd"]),ButtonGroupContext=reactExports.createContext({}),ButtonGroupButtonContext=reactExports.createContext(void 0),useUtilityClasses$F=o=>{const{color:_,disableElevation:$,fullWidth:j,size:_e,variant:et,loading:tt,loadingPosition:rt,classes:nt}=o,ot={root:["root",tt&&"loading",et,`${et}${capitalize(_)}`,`size${capitalize(_e)}`,`${et}Size${capitalize(_e)}`,`color${capitalize(_)}`,$&&"disableElevation",j&&"fullWidth",tt&&`loadingPosition${capitalize(rt)}`],startIcon:["icon","startIcon",`iconSize${capitalize(_e)}`],endIcon:["icon","endIcon",`iconSize${capitalize(_e)}`],loadingIndicator:["loadingIndicator"],loadingWrapper:["loadingWrapper"]},it=composeClasses(ot,getButtonUtilityClass,nt);return{...nt,...it}},commonIconStyles=[{props:{size:"small"},style:{"& > *:nth-of-type(1)":{fontSize:18}}},{props:{size:"medium"},style:{"& > *:nth-of-type(1)":{fontSize:20}}},{props:{size:"large"},style:{"& > *:nth-of-type(1)":{fontSize:22}}}],ButtonRoot=styled(ButtonBase,{shouldForwardProp:o=>rootShouldForwardProp(o)||o==="classes",name:"MuiButton",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.variant],_[`${$.variant}${capitalize($.color)}`],_[`size${capitalize($.size)}`],_[`${$.variant}Size${capitalize($.size)}`],$.color==="inherit"&&_.colorInherit,$.disableElevation&&_.disableElevation,$.fullWidth&&_.fullWidth,$.loading&&_.loading]}})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light"?o.palette.grey[300]:o.palette.grey[800],$=o.palette.mode==="light"?o.palette.grey.A100:o.palette.grey[700];return{...o.typography.button,minWidth:64,padding:"6px 16px",border:0,borderRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create(["background-color","box-shadow","border-color","color"],{duration:o.transitions.duration.short}),"&:hover":{textDecoration:"none"},[`&.${buttonClasses.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:{variant:"contained"},style:{color:"var(--variant-containedColor)",backgroundColor:"var(--variant-containedBg)",boxShadow:(o.vars||o).shadows[2],"&:hover":{boxShadow:(o.vars||o).shadows[4],"@media (hover: none)":{boxShadow:(o.vars||o).shadows[2]}},"&:active":{boxShadow:(o.vars||o).shadows[8]},[`&.${buttonClasses.focusVisible}`]:{boxShadow:(o.vars||o).shadows[6]},[`&.${buttonClasses.disabled}`]:{color:(o.vars||o).palette.action.disabled,boxShadow:(o.vars||o).shadows[0],backgroundColor:(o.vars||o).palette.action.disabledBackground}}},{props:{variant:"outlined"},style:{padding:"5px 15px",border:"1px solid currentColor",borderColor:"var(--variant-outlinedBorder, currentColor)",backgroundColor:"var(--variant-outlinedBg)",color:"var(--variant-outlinedColor)",[`&.${buttonClasses.disabled}`]:{border:`1px solid ${(o.vars||o).palette.action.disabledBackground}`}}},{props:{variant:"text"},style:{padding:"6px 8px",color:"var(--variant-textColor)",backgroundColor:"var(--variant-textBg)"}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([j])=>({props:{color:j},style:{"--variant-textColor":(o.vars||o).palette[j].main,"--variant-outlinedColor":(o.vars||o).palette[j].main,"--variant-outlinedBorder":o.alpha((o.vars||o).palette[j].main,.5),"--variant-containedColor":(o.vars||o).palette[j].contrastText,"--variant-containedBg":(o.vars||o).palette[j].main,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":(o.vars||o).palette[j].dark,"--variant-textBg":o.alpha((o.vars||o).palette[j].main,(o.vars||o).palette.action.hoverOpacity),"--variant-outlinedBorder":(o.vars||o).palette[j].main,"--variant-outlinedBg":o.alpha((o.vars||o).palette[j].main,(o.vars||o).palette.action.hoverOpacity)}}}})),{props:{color:"inherit"},style:{color:"inherit",borderColor:"currentColor","--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedBg:_,"@media (hover: hover)":{"&:hover":{"--variant-containedBg":o.vars?o.vars.palette.Button.inheritContainedHoverBg:$,"--variant-textBg":o.alpha((o.vars||o).palette.text.primary,(o.vars||o).palette.action.hoverOpacity),"--variant-outlinedBg":o.alpha((o.vars||o).palette.text.primary,(o.vars||o).palette.action.hoverOpacity)}}}},{props:{size:"small",variant:"text"},style:{padding:"4px 5px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"text"},style:{padding:"8px 11px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"outlined"},style:{padding:"3px 9px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"outlined"},style:{padding:"7px 21px",fontSize:o.typography.pxToRem(15)}},{props:{size:"small",variant:"contained"},style:{padding:"4px 10px",fontSize:o.typography.pxToRem(13)}},{props:{size:"large",variant:"contained"},style:{padding:"8px 22px",fontSize:o.typography.pxToRem(15)}},{props:{disableElevation:!0},style:{boxShadow:"none","&:hover":{boxShadow:"none"},[`&.${buttonClasses.focusVisible}`]:{boxShadow:"none"},"&:active":{boxShadow:"none"},[`&.${buttonClasses.disabled}`]:{boxShadow:"none"}}},{props:{fullWidth:!0},style:{width:"100%"}},{props:{loadingPosition:"center"},style:{transition:o.transitions.create(["background-color","box-shadow","border-color"],{duration:o.transitions.duration.short}),[`&.${buttonClasses.loading}`]:{color:"transparent"}}}]}})),ButtonStartIcon=styled("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.startIcon,$.loading&&_.startIconLoadingStart,_[`iconSize${capitalize($.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:8,marginLeft:-4,variants:[{props:{size:"small"},style:{marginLeft:-2}},{props:{loadingPosition:"start",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"start",loading:!0,fullWidth:!0},style:{marginRight:-8}},...commonIconStyles]})),ButtonEndIcon=styled("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.endIcon,$.loading&&_.endIconLoadingEnd,_[`iconSize${capitalize($.size)}`]]}})(({theme:o})=>({display:"inherit",marginRight:-4,marginLeft:8,variants:[{props:{size:"small"},style:{marginRight:-2}},{props:{loadingPosition:"end",loading:!0},style:{transition:o.transitions.create(["opacity"],{duration:o.transitions.duration.short}),opacity:0}},{props:{loadingPosition:"end",loading:!0,fullWidth:!0},style:{marginLeft:-8}},...commonIconStyles]})),ButtonLoadingIndicator=styled("span",{name:"MuiButton",slot:"LoadingIndicator"})(({theme:o})=>({display:"none",position:"absolute",visibility:"visible",variants:[{props:{loading:!0},style:{display:"flex"}},{props:{loadingPosition:"start"},style:{left:14}},{props:{loadingPosition:"start",size:"small"},style:{left:10}},{props:{variant:"text",loadingPosition:"start"},style:{left:6}},{props:{loadingPosition:"center"},style:{left:"50%",transform:"translate(-50%)",color:(o.vars||o).palette.action.disabled}},{props:{loadingPosition:"end"},style:{right:14}},{props:{loadingPosition:"end",size:"small"},style:{right:10}},{props:{variant:"text",loadingPosition:"end"},style:{right:6}},{props:{loadingPosition:"start",fullWidth:!0},style:{position:"relative",left:-10}},{props:{loadingPosition:"end",fullWidth:!0},style:{position:"relative",right:-10}}]})),ButtonLoadingIconPlaceholder=styled("span",{name:"MuiButton",slot:"LoadingIconPlaceholder"})({display:"inline-block",width:"1em",height:"1em"}),Button$1=reactExports.forwardRef(function(_,$){const j=reactExports.useContext(ButtonGroupContext),_e=reactExports.useContext(ButtonGroupButtonContext),et=resolveProps(j,_),tt=useDefaultProps({props:et,name:"MuiButton"}),{children:rt,color:nt="primary",component:ot="button",className:it,disabled:st=!1,disableElevation:at=!1,disableFocusRipple:lt=!1,endIcon:ct,focusVisibleClassName:ft,fullWidth:dt=!1,id:pt,loading:yt=null,loadingIndicator:vt,loadingPosition:wt="center",size:Ct="medium",startIcon:Pt,type:Bt,variant:At="text",...kt}=tt,Ot=useId$1(pt),Tt=vt??jsxRuntimeExports.jsx(CircularProgress,{"aria-labelledby":Ot,color:"inherit",size:16}),ht={...tt,color:nt,component:ot,disabled:st,disableElevation:at,disableFocusRipple:lt,fullWidth:dt,loading:yt,loadingIndicator:Tt,loadingPosition:wt,size:Ct,type:Bt,variant:At},bt=useUtilityClasses$F(ht),mt=(Pt||yt&&wt==="start")&&jsxRuntimeExports.jsx(ButtonStartIcon,{className:bt.startIcon,ownerState:ht,children:Pt||jsxRuntimeExports.jsx(ButtonLoadingIconPlaceholder,{className:bt.loadingIconPlaceholder,ownerState:ht})}),gt=(ct||yt&&wt==="end")&&jsxRuntimeExports.jsx(ButtonEndIcon,{className:bt.endIcon,ownerState:ht,children:ct||jsxRuntimeExports.jsx(ButtonLoadingIconPlaceholder,{className:bt.loadingIconPlaceholder,ownerState:ht})}),xt=_e||"",Et=typeof yt=="boolean"?jsxRuntimeExports.jsx("span",{className:bt.loadingWrapper,style:{display:"contents"},children:yt&&jsxRuntimeExports.jsx(ButtonLoadingIndicator,{className:bt.loadingIndicator,ownerState:ht,children:Tt})}):null;return jsxRuntimeExports.jsxs(ButtonRoot,{ownerState:ht,className:clsx(j.className,bt.root,it,xt),component:ot,disabled:st||yt,focusRipple:!lt,focusVisibleClassName:clsx(bt.focusVisible,ft),ref:$,type:Bt,id:yt?Ot:pt,...kt,classes:bt,children:[mt,wt!=="end"&&Et,rt,wt==="end"&&Et,gt]})});function getSwitchBaseUtilityClass(o){return generateUtilityClass("PrivateSwitchBase",o)}generateUtilityClasses("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const useUtilityClasses$E=o=>{const{classes:_,checked:$,disabled:j,edge:_e}=o,et={root:["root",$&&"checked",j&&"disabled",_e&&`edge${capitalize(_e)}`],input:["input"]};return composeClasses(et,getSwitchBaseUtilityClass,_)},SwitchBaseRoot=styled(ButtonBase,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:o,ownerState:_})=>o==="start"&&_.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:o,ownerState:_})=>o==="end"&&_.size!=="small",style:{marginRight:-12}}]}),SwitchBaseInput=styled("input",{name:"MuiSwitchBase",shouldForwardProp:rootShouldForwardProp})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),SwitchBase=reactExports.forwardRef(function(_,$){const{autoFocus:j,checked:_e,checkedIcon:et,defaultChecked:tt,disabled:rt,disableFocusRipple:nt=!1,edge:ot=!1,icon:it,id:st,inputProps:at,inputRef:lt,name:ct,onBlur:ft,onChange:dt,onFocus:pt,readOnly:yt,required:vt=!1,tabIndex:wt,type:Ct,value:Pt,slots:Bt={},slotProps:At={},...kt}=_,[Ot,Tt]=useControlled({controlled:_e,default:!!tt,name:"SwitchBase",state:"checked"}),ht=useFormControl(),bt=Gt=>{pt&&pt(Gt),ht&&ht.onFocus&&ht.onFocus(Gt)},mt=Gt=>{ft&&ft(Gt),ht&&ht.onBlur&&ht.onBlur(Gt)},gt=Gt=>{if(Gt.nativeEvent.defaultPrevented||yt)return;const zt=Gt.target.checked;Tt(zt),dt&&dt(Gt,zt)};let xt=rt;ht&&typeof xt>"u"&&(xt=ht.disabled);const Et=Ct==="checkbox"||Ct==="radio",_t={..._,checked:Ot,disabled:xt,disableFocusRipple:nt,edge:ot},$t=useUtilityClasses$E(_t),St={slots:Bt,slotProps:{input:at,...At}},[Rt,It]=useSlot("root",{ref:$,elementType:SwitchBaseRoot,className:$t.root,shouldForwardComponentProp:!0,externalForwardedProps:{...St,component:"span",...kt},getSlotProps:Gt=>({...Gt,onFocus:zt=>{var jt;(jt=Gt.onFocus)==null||jt.call(Gt,zt),bt(zt)},onBlur:zt=>{var jt;(jt=Gt.onBlur)==null||jt.call(Gt,zt),mt(zt)}}),ownerState:_t,additionalProps:{centerRipple:!0,focusRipple:!nt,disabled:xt,role:void 0,tabIndex:null}}),[Mt,Vt]=useSlot("input",{ref:lt,elementType:SwitchBaseInput,className:$t.input,externalForwardedProps:St,getSlotProps:Gt=>({...Gt,onChange:zt=>{var jt;(jt=Gt.onChange)==null||jt.call(Gt,zt),gt(zt)}}),ownerState:_t,additionalProps:{autoFocus:j,checked:_e,defaultChecked:tt,disabled:xt,id:Et?st:void 0,name:ct,readOnly:yt,required:vt,tabIndex:wt,type:Ct,...Ct==="checkbox"&&Pt===void 0?{}:{value:Pt}}});return jsxRuntimeExports.jsxs(Rt,{...It,children:[jsxRuntimeExports.jsx(Mt,{...Vt}),Ot?et:it]})}),Container=createContainer({createStyledComponent:styled("div",{name:"MuiContainer",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[`maxWidth${capitalize(String($.maxWidth))}`],$.fixed&&_.fixed,$.disableGutters&&_.disableGutters]}}),useThemeProps:o=>useDefaultProps({props:o,name:"MuiContainer"})}),isDynamicSupport=typeof globalCss({})=="function",html=(o,_)=>({WebkitFontSmoothing:"antialiased",MozOsxFontSmoothing:"grayscale",boxSizing:"border-box",WebkitTextSizeAdjust:"100%",..._&&!o.vars&&{colorScheme:o.palette.mode}}),body=o=>({color:(o.vars||o).palette.text.primary,...o.typography.body1,backgroundColor:(o.vars||o).palette.background.default,"@media print":{backgroundColor:(o.vars||o).palette.common.white}}),styles$2=(o,_=!1)=>{var et,tt;const $={};_&&o.colorSchemes&&typeof o.getColorSchemeSelector=="function"&&Object.entries(o.colorSchemes).forEach(([rt,nt])=>{var it,st;const ot=o.getColorSchemeSelector(rt);ot.startsWith("@")?$[ot]={":root":{colorScheme:(it=nt.palette)==null?void 0:it.mode}}:$[ot.replace(/\s*&/,"")]={colorScheme:(st=nt.palette)==null?void 0:st.mode}});let j={html:html(o,_),"*, *::before, *::after":{boxSizing:"inherit"},"strong, b":{fontWeight:o.typography.fontWeightBold},body:{margin:0,...body(o),"&::backdrop":{backgroundColor:(o.vars||o).palette.background.default}},...$};const _e=(tt=(et=o.components)==null?void 0:et.MuiCssBaseline)==null?void 0:tt.styleOverrides;return _e&&(j=[j,_e]),j},SELECTOR="mui-ecs",staticStyles=o=>{const _=styles$2(o,!1),$=Array.isArray(_)?_[0]:_;return!o.vars&&$&&($.html[`:root:has(${SELECTOR})`]={colorScheme:o.palette.mode}),o.colorSchemes&&Object.entries(o.colorSchemes).forEach(([j,_e])=>{var tt,rt;const et=o.getColorSchemeSelector(j);et.startsWith("@")?$[et]={[`:root:not(:has(.${SELECTOR}))`]:{colorScheme:(tt=_e.palette)==null?void 0:tt.mode}}:$[et.replace(/\s*&/,"")]={[`&:not(:has(.${SELECTOR}))`]:{colorScheme:(rt=_e.palette)==null?void 0:rt.mode}}}),_},GlobalStyles=globalCss(isDynamicSupport?({theme:o,enableColorScheme:_})=>styles$2(o,_):({theme:o})=>staticStyles(o));function CssBaseline(o){const _=useDefaultProps({props:o,name:"MuiCssBaseline"}),{children:$,enableColorScheme:j=!1}=_;return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[isDynamicSupport&&jsxRuntimeExports.jsx(GlobalStyles,{enableColorScheme:j}),!isDynamicSupport&&!j&&jsxRuntimeExports.jsx("span",{className:SELECTOR,style:{display:"none"}}),$]})}function getScrollbarSize(o=window){const _=o.document.documentElement.clientWidth;return o.innerWidth-_}function isOverflowing(o){const _=ownerDocument(o);return _.body===o?ownerWindow(o).innerWidth>_.documentElement.clientWidth:o.scrollHeight>o.clientHeight}function ariaHidden(o,_){_?o.setAttribute("aria-hidden","true"):o.removeAttribute("aria-hidden")}function getPaddingRight(o){return parseFloat(ownerWindow(o).getComputedStyle(o).paddingRight)||0}function isAriaHiddenForbiddenOnElement(o){const $=["TEMPLATE","SCRIPT","STYLE","LINK","MAP","META","NOSCRIPT","PICTURE","COL","COLGROUP","PARAM","SLOT","SOURCE","TRACK"].includes(o.tagName),j=o.tagName==="INPUT"&&o.getAttribute("type")==="hidden";return $||j}function ariaHiddenSiblings(o,_,$,j,_e){const et=[_,$,...j];[].forEach.call(o.children,tt=>{const rt=!et.includes(tt),nt=!isAriaHiddenForbiddenOnElement(tt);rt&&nt&&ariaHidden(tt,_e)})}function findIndexOf(o,_){let $=-1;return o.some((j,_e)=>_(j)?($=_e,!0):!1),$}function handleContainer(o,_){const $=[],j=o.container;if(!_.disableScrollLock){if(isOverflowing(j)){const tt=getScrollbarSize(ownerWindow(j));$.push({value:j.style.paddingRight,property:"padding-right",el:j}),j.style.paddingRight=`${getPaddingRight(j)+tt}px`;const rt=ownerDocument(j).querySelectorAll(".mui-fixed");[].forEach.call(rt,nt=>{$.push({value:nt.style.paddingRight,property:"padding-right",el:nt}),nt.style.paddingRight=`${getPaddingRight(nt)+tt}px`})}let et;if(j.parentNode instanceof DocumentFragment)et=ownerDocument(j).body;else{const tt=j.parentElement,rt=ownerWindow(j);et=(tt==null?void 0:tt.nodeName)==="HTML"&&rt.getComputedStyle(tt).overflowY==="scroll"?tt:j}$.push({value:et.style.overflow,property:"overflow",el:et},{value:et.style.overflowX,property:"overflow-x",el:et},{value:et.style.overflowY,property:"overflow-y",el:et}),et.style.overflow="hidden"}return()=>{$.forEach(({value:et,el:tt,property:rt})=>{et?tt.style.setProperty(rt,et):tt.style.removeProperty(rt)})}}function getHiddenSiblings(o){const _=[];return[].forEach.call(o.children,$=>{$.getAttribute("aria-hidden")==="true"&&_.push($)}),_}class ModalManager{constructor(){this.modals=[],this.containers=[]}add(_,$){let j=this.modals.indexOf(_);if(j!==-1)return j;j=this.modals.length,this.modals.push(_),_.modalRef&&ariaHidden(_.modalRef,!1);const _e=getHiddenSiblings($);ariaHiddenSiblings($,_.mount,_.modalRef,_e,!0);const et=findIndexOf(this.containers,tt=>tt.container===$);return et!==-1?(this.containers[et].modals.push(_),j):(this.containers.push({modals:[_],container:$,restore:null,hiddenSiblings:_e}),j)}mount(_,$){const j=findIndexOf(this.containers,et=>et.modals.includes(_)),_e=this.containers[j];_e.restore||(_e.restore=handleContainer(_e,$))}remove(_,$=!0){const j=this.modals.indexOf(_);if(j===-1)return j;const _e=findIndexOf(this.containers,tt=>tt.modals.includes(_)),et=this.containers[_e];if(et.modals.splice(et.modals.indexOf(_),1),this.modals.splice(j,1),et.modals.length===0)et.restore&&et.restore(),_.modalRef&&ariaHidden(_.modalRef,$),ariaHiddenSiblings(et.container,_.mount,_.modalRef,et.hiddenSiblings,!1),this.containers.splice(_e,1);else{const tt=et.modals[et.modals.length-1];tt.modalRef&&ariaHidden(tt.modalRef,!1)}return j}isTopModal(_){return this.modals.length>0&&this.modals[this.modals.length-1]===_}}function activeElement(o){var $;let _=o.activeElement;for(;(($=_==null?void 0:_.shadowRoot)==null?void 0:$.activeElement)!=null;)_=_.shadowRoot.activeElement;return _}const candidatesSelector=["input","select","textarea","a[href]","button","[tabindex]","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])'].join(",");function getTabIndex(o){const _=parseInt(o.getAttribute("tabindex")||"",10);return Number.isNaN(_)?o.contentEditable==="true"||(o.nodeName==="AUDIO"||o.nodeName==="VIDEO"||o.nodeName==="DETAILS")&&o.getAttribute("tabindex")===null?0:o.tabIndex:_}function isNonTabbableRadio(o){if(o.tagName!=="INPUT"||o.type!=="radio"||!o.name)return!1;const _=j=>o.ownerDocument.querySelector(`input[type="radio"]${j}`);let $=_(`[name="${o.name}"]:checked`);return $||($=_(`[name="${o.name}"]`)),$!==o}function isNodeMatchingSelectorFocusable(o){return!(o.disabled||o.tagName==="INPUT"&&o.type==="hidden"||isNonTabbableRadio(o))}function defaultGetTabbable(o){const _=[],$=[];return Array.from(o.querySelectorAll(candidatesSelector)).forEach((j,_e)=>{const et=getTabIndex(j);et===-1||!isNodeMatchingSelectorFocusable(j)||(et===0?_.push(j):$.push({documentOrder:_e,tabIndex:et,node:j}))}),$.sort((j,_e)=>j.tabIndex===_e.tabIndex?j.documentOrder-_e.documentOrder:j.tabIndex-_e.tabIndex).map(j=>j.node).concat(_)}function defaultIsEnabled(){return!0}function FocusTrap(o){const{children:_,disableAutoFocus:$=!1,disableEnforceFocus:j=!1,disableRestoreFocus:_e=!1,getTabbable:et=defaultGetTabbable,isEnabled:tt=defaultIsEnabled,open:rt}=o,nt=reactExports.useRef(!1),ot=reactExports.useRef(null),it=reactExports.useRef(null),st=reactExports.useRef(null),at=reactExports.useRef(null),lt=reactExports.useRef(!1),ct=reactExports.useRef(null),ft=useForkRef(getReactElementRef(_),ct),dt=reactExports.useRef(null);reactExports.useEffect(()=>{!rt||!ct.current||(lt.current=!$)},[$,rt]),reactExports.useEffect(()=>{if(!rt||!ct.current)return;const vt=ownerDocument(ct.current),wt=activeElement(vt);return ct.current.contains(wt)||(ct.current.hasAttribute("tabIndex")||ct.current.setAttribute("tabIndex","-1"),lt.current&&ct.current.focus()),()=>{_e||(st.current&&st.current.focus&&(nt.current=!0,st.current.focus()),st.current=null)}},[rt]),reactExports.useEffect(()=>{if(!rt||!ct.current)return;const vt=ownerDocument(ct.current),wt=Bt=>{if(dt.current=Bt,j||!tt()||Bt.key!=="Tab")return;activeElement(vt)===ct.current&&Bt.shiftKey&&(nt.current=!0,it.current&&it.current.focus())},Ct=()=>{var Ot,Tt;const Bt=ct.current;if(Bt===null)return;const At=activeElement(vt);if(!vt.hasFocus()||!tt()||nt.current){nt.current=!1;return}if(Bt.contains(At)||j&&At!==ot.current&&At!==it.current)return;if(At!==at.current)at.current=null;else if(at.current!==null)return;if(!lt.current)return;let kt=[];if((At===ot.current||At===it.current)&&(kt=et(ct.current)),kt.length>0){const ht=!!((Ot=dt.current)!=null&&Ot.shiftKey&&((Tt=dt.current)==null?void 0:Tt.key)==="Tab"),bt=kt[0],mt=kt[kt.length-1];typeof bt!="string"&&typeof mt!="string"&&(ht?mt.focus():bt.focus())}else Bt.focus()};vt.addEventListener("focusin",Ct),vt.addEventListener("keydown",wt,!0);const Pt=setInterval(()=>{const Bt=activeElement(vt);Bt&&Bt.tagName==="BODY"&&Ct()},50);return()=>{clearInterval(Pt),vt.removeEventListener("focusin",Ct),vt.removeEventListener("keydown",wt,!0)}},[$,j,_e,tt,rt,et]);const pt=vt=>{st.current===null&&(st.current=vt.relatedTarget),lt.current=!0,at.current=vt.target;const wt=_.props.onFocus;wt&&wt(vt)},yt=vt=>{st.current===null&&(st.current=vt.relatedTarget),lt.current=!0};return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx("div",{tabIndex:rt?0:-1,onFocus:yt,ref:ot,"data-testid":"sentinelStart"}),reactExports.cloneElement(_,{ref:ft,onFocus:pt}),jsxRuntimeExports.jsx("div",{tabIndex:rt?0:-1,onFocus:yt,ref:it,"data-testid":"sentinelEnd"})]})}function getContainer(o){return typeof o=="function"?o():o}function getHasTransition(o){return o?o.props.hasOwnProperty("in"):!1}const noop$5=()=>{},manager=new ModalManager;function useModal(o){const{container:_,disableEscapeKeyDown:$=!1,disableScrollLock:j=!1,closeAfterTransition:_e=!1,onTransitionEnter:et,onTransitionExited:tt,children:rt,onClose:nt,open:ot,rootRef:it}=o,st=reactExports.useRef({}),at=reactExports.useRef(null),lt=reactExports.useRef(null),ct=useForkRef(lt,it),[ft,dt]=reactExports.useState(!ot),pt=getHasTransition(rt);let yt=!0;(o["aria-hidden"]==="false"||o["aria-hidden"]===!1)&&(yt=!1);const vt=()=>ownerDocument(at.current),wt=()=>(st.current.modalRef=lt.current,st.current.mount=at.current,st.current),Ct=()=>{manager.mount(wt(),{disableScrollLock:j}),lt.current&&(lt.current.scrollTop=0)},Pt=useEventCallback(()=>{const gt=getContainer(_)||vt().body;manager.add(wt(),gt),lt.current&&Ct()}),Bt=()=>manager.isTopModal(wt()),At=useEventCallback(gt=>{at.current=gt,gt&&(ot&&Bt()?Ct():lt.current&&ariaHidden(lt.current,yt))}),kt=reactExports.useCallback(()=>{manager.remove(wt(),yt)},[yt]);reactExports.useEffect(()=>()=>{kt()},[kt]),reactExports.useEffect(()=>{ot?Pt():(!pt||!_e)&&kt()},[ot,kt,pt,_e,Pt]);const Ot=gt=>xt=>{var Et;(Et=gt.onKeyDown)==null||Et.call(gt,xt),!(xt.key!=="Escape"||xt.which===229||!Bt())&&($||(xt.stopPropagation(),nt&&nt(xt,"escapeKeyDown")))},Tt=gt=>xt=>{var Et;(Et=gt.onClick)==null||Et.call(gt,xt),xt.target===xt.currentTarget&&nt&&nt(xt,"backdropClick")};return{getRootProps:(gt={})=>{const xt=extractEventHandlers(o);delete xt.onTransitionEnter,delete xt.onTransitionExited;const Et={...xt,...gt};return{role:"presentation",...Et,onKeyDown:Ot(Et),ref:ct}},getBackdropProps:(gt={})=>{const xt=gt;return{"aria-hidden":!0,...xt,onClick:Tt(xt),open:ot}},getTransitionProps:()=>{const gt=()=>{dt(!1),et&&et()},xt=()=>{dt(!0),tt&&tt(),_e&&kt()};return{onEnter:createChainedFunction(gt,(rt==null?void 0:rt.props.onEnter)??noop$5),onExited:createChainedFunction(xt,(rt==null?void 0:rt.props.onExited)??noop$5)}},rootRef:ct,portalRef:At,isTopModal:Bt,exited:ft,hasTransition:pt}}function getModalUtilityClass(o){return generateUtilityClass("MuiModal",o)}generateUtilityClasses("MuiModal",["root","hidden","backdrop"]);const useUtilityClasses$D=o=>{const{open:_,exited:$,classes:j}=o;return composeClasses({root:["root",!_&&$&&"hidden"],backdrop:["backdrop"]},getModalUtilityClass,j)},ModalRoot=styled("div",{name:"MuiModal",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,!$.open&&$.exited&&_.hidden]}})(memoTheme(({theme:o})=>({position:"fixed",zIndex:(o.vars||o).zIndex.modal,right:0,bottom:0,top:0,left:0,variants:[{props:({ownerState:_})=>!_.open&&_.exited,style:{visibility:"hidden"}}]}))),ModalBackdrop=styled(Backdrop,{name:"MuiModal",slot:"Backdrop"})({zIndex:-1}),Modal=reactExports.forwardRef(function(_,$){const j=useDefaultProps({name:"MuiModal",props:_}),{BackdropComponent:_e=ModalBackdrop,BackdropProps:et,classes:tt,className:rt,closeAfterTransition:nt=!1,children:ot,container:it,component:st,components:at={},componentsProps:lt={},disableAutoFocus:ct=!1,disableEnforceFocus:ft=!1,disableEscapeKeyDown:dt=!1,disablePortal:pt=!1,disableRestoreFocus:yt=!1,disableScrollLock:vt=!1,hideBackdrop:wt=!1,keepMounted:Ct=!1,onClose:Pt,onTransitionEnter:Bt,onTransitionExited:At,open:kt,slotProps:Ot={},slots:Tt={},theme:ht,...bt}=j,mt={...j,closeAfterTransition:nt,disableAutoFocus:ct,disableEnforceFocus:ft,disableEscapeKeyDown:dt,disablePortal:pt,disableRestoreFocus:yt,disableScrollLock:vt,hideBackdrop:wt,keepMounted:Ct},{getRootProps:gt,getBackdropProps:xt,getTransitionProps:Et,portalRef:_t,isTopModal:$t,exited:St,hasTransition:Rt}=useModal({...mt,rootRef:$}),It={...mt,exited:St},Mt=useUtilityClasses$D(It),Vt={};if(ot.props.tabIndex===void 0&&(Vt.tabIndex="-1"),Rt){const{onEnter:Xt,onExited:Ut}=Et();Vt.onEnter=Xt,Vt.onExited=Ut}const Gt={slots:{root:at.Root,backdrop:at.Backdrop,...Tt},slotProps:{...lt,...Ot}},[zt,jt]=useSlot("root",{ref:$,elementType:ModalRoot,externalForwardedProps:{...Gt,...bt,component:st},getSlotProps:gt,ownerState:It,className:clsx(rt,Mt==null?void 0:Mt.root,!It.open&&It.exited&&(Mt==null?void 0:Mt.hidden))}),[Ft,qt]=useSlot("backdrop",{ref:et==null?void 0:et.ref,elementType:_e,externalForwardedProps:Gt,shouldForwardComponentProp:!0,additionalProps:et,getSlotProps:Xt=>xt({...Xt,onClick:Ut=>{Xt!=null&&Xt.onClick&&Xt.onClick(Ut)}}),className:clsx(et==null?void 0:et.className,Mt==null?void 0:Mt.backdrop),ownerState:It});return!Ct&&!kt&&(!Rt||St)?null:jsxRuntimeExports.jsx(Portal,{ref:_t,container:it,disablePortal:pt,children:jsxRuntimeExports.jsxs(zt,{...jt,children:[!wt&&_e?jsxRuntimeExports.jsx(Ft,{...qt}):null,jsxRuntimeExports.jsx(FocusTrap,{disableEnforceFocus:ft,disableAutoFocus:ct,disableRestoreFocus:yt,isEnabled:$t,open:kt,children:reactExports.cloneElement(ot,Vt)})]})})}),dividerClasses=generateUtilityClasses("MuiDivider",["root","absolute","fullWidth","inset","middle","flexItem","light","vertical","withChildren","withChildrenVertical","textAlignRight","textAlignLeft","wrapper","wrapperVertical"]),useUtilityClasses$C=o=>{const{classes:_,disableUnderline:$,startAdornment:j,endAdornment:_e,size:et,hiddenLabel:tt,multiline:rt}=o,nt={root:["root",!$&&"underline",j&&"adornedStart",_e&&"adornedEnd",et==="small"&&`size${capitalize(et)}`,tt&&"hiddenLabel",rt&&"multiline"],input:["input"]},ot=composeClasses(nt,getFilledInputUtilityClass,_);return{..._,...ot}},FilledInputRoot=styled(InputBaseRoot,{shouldForwardProp:o=>rootShouldForwardProp(o)||o==="classes",name:"MuiFilledInput",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[...rootOverridesResolver(o,_),!$.disableUnderline&&_.underline]}})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light",$=_?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)",j=_?"rgba(0, 0, 0, 0.06)":"rgba(255, 255, 255, 0.09)",_e=_?"rgba(0, 0, 0, 0.09)":"rgba(255, 255, 255, 0.13)",et=_?"rgba(0, 0, 0, 0.12)":"rgba(255, 255, 255, 0.12)";return{position:"relative",backgroundColor:o.vars?o.vars.palette.FilledInput.bg:j,borderTopLeftRadius:(o.vars||o).shape.borderRadius,borderTopRightRadius:(o.vars||o).shape.borderRadius,transition:o.transitions.create("background-color",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),"&:hover":{backgroundColor:o.vars?o.vars.palette.FilledInput.hoverBg:_e,"@media (hover: none)":{backgroundColor:o.vars?o.vars.palette.FilledInput.bg:j}},[`&.${filledInputClasses.focused}`]:{backgroundColor:o.vars?o.vars.palette.FilledInput.bg:j},[`&.${filledInputClasses.disabled}`]:{backgroundColor:o.vars?o.vars.palette.FilledInput.disabledBg:et},variants:[{props:({ownerState:tt})=>!tt.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${filledInputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${filledInputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(o.vars||o).palette.error.main}},"&::before":{borderBottom:`1px solid ${o.vars?o.alpha(o.vars.palette.common.onBackground,o.vars.opacity.inputUnderline):$}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:o.transitions.create("border-bottom-color",{duration:o.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${filledInputClasses.disabled}, .${filledInputClasses.error}):before`]:{borderBottom:`1px solid ${(o.vars||o).palette.text.primary}`},[`&.${filledInputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([tt])=>{var rt;return{props:{disableUnderline:!1,color:tt},style:{"&::after":{borderBottom:`2px solid ${(rt=(o.vars||o).palette[tt])==null?void 0:rt.main}`}}}}),{props:({ownerState:tt})=>tt.startAdornment,style:{paddingLeft:12}},{props:({ownerState:tt})=>tt.endAdornment,style:{paddingRight:12}},{props:({ownerState:tt})=>tt.multiline,style:{padding:"25px 12px 8px"}},{props:({ownerState:tt,size:rt})=>tt.multiline&&rt==="small",style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:tt})=>tt.multiline&&tt.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:tt})=>tt.multiline&&tt.hiddenLabel&&tt.size==="small",style:{paddingTop:8,paddingBottom:9}}]}})),FilledInputInput=styled(InputBaseInput,{name:"MuiFilledInput",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:o})=>({paddingTop:25,paddingRight:12,paddingBottom:8,paddingLeft:12,...!o.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:o.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:o.palette.mode==="light"?null:"#fff",caretColor:o.palette.mode==="light"?null:"#fff",borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"}},...o.vars&&{"&:-webkit-autofill":{borderTopLeftRadius:"inherit",borderTopRightRadius:"inherit"},[o.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{paddingTop:21,paddingBottom:4}},{props:({ownerState:_})=>_.hiddenLabel,style:{paddingTop:16,paddingBottom:17}},{props:({ownerState:_})=>_.startAdornment,style:{paddingLeft:0}},{props:({ownerState:_})=>_.endAdornment,style:{paddingRight:0}},{props:({ownerState:_})=>_.hiddenLabel&&_.size==="small",style:{paddingTop:8,paddingBottom:9}},{props:({ownerState:_})=>_.multiline,style:{paddingTop:0,paddingBottom:0,paddingLeft:0,paddingRight:0}}]}))),FilledInput=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiFilledInput"}),{disableUnderline:_e=!1,components:et={},componentsProps:tt,fullWidth:rt=!1,hiddenLabel:nt,inputComponent:ot="input",multiline:it=!1,slotProps:st,slots:at={},type:lt="text",...ct}=j,ft={...j,disableUnderline:_e,fullWidth:rt,inputComponent:ot,multiline:it,type:lt},dt=useUtilityClasses$C(j),pt={root:{ownerState:ft},input:{ownerState:ft}},yt=st??tt?deepmerge$2(pt,st??tt):pt,vt=at.root??et.Root??FilledInputRoot,wt=at.input??et.Input??FilledInputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:vt,input:wt},slotProps:yt,fullWidth:rt,inputComponent:ot,multiline:it,ref:$,type:lt,...ct,classes:dt})});FilledInput.muiName="Input";function getFormControlUtilityClasses(o){return generateUtilityClass("MuiFormControl",o)}generateUtilityClasses("MuiFormControl",["root","marginNone","marginNormal","marginDense","fullWidth","disabled"]);const useUtilityClasses$B=o=>{const{classes:_,margin:$,fullWidth:j}=o,_e={root:["root",$!=="none"&&`margin${capitalize($)}`,j&&"fullWidth"]};return composeClasses(_e,getFormControlUtilityClasses,_)},FormControlRoot=styled("div",{name:"MuiFormControl",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[`margin${capitalize($.margin)}`],$.fullWidth&&_.fullWidth]}})({display:"inline-flex",flexDirection:"column",position:"relative",minWidth:0,padding:0,margin:0,border:0,verticalAlign:"top",variants:[{props:{margin:"normal"},style:{marginTop:16,marginBottom:8}},{props:{margin:"dense"},style:{marginTop:8,marginBottom:4}},{props:{fullWidth:!0},style:{width:"100%"}}]}),FormControl=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiFormControl"}),{children:_e,className:et,color:tt="primary",component:rt="div",disabled:nt=!1,error:ot=!1,focused:it,fullWidth:st=!1,hiddenLabel:at=!1,margin:lt="none",required:ct=!1,size:ft="medium",variant:dt="outlined",...pt}=j,yt={...j,color:tt,component:rt,disabled:nt,error:ot,fullWidth:st,hiddenLabel:at,margin:lt,required:ct,size:ft,variant:dt},vt=useUtilityClasses$B(yt),[wt,Ct]=reactExports.useState(()=>{let gt=!1;return _e&&reactExports.Children.forEach(_e,xt=>{if(!isMuiElement(xt,["Input","Select"]))return;const Et=isMuiElement(xt,["Select"])?xt.props.input:xt;Et&&isAdornedStart(Et.props)&&(gt=!0)}),gt}),[Pt,Bt]=reactExports.useState(()=>{let gt=!1;return _e&&reactExports.Children.forEach(_e,xt=>{isMuiElement(xt,["Input","Select"])&&(isFilled(xt.props,!0)||isFilled(xt.props.inputProps,!0))&&(gt=!0)}),gt}),[At,kt]=reactExports.useState(!1);nt&&At&&kt(!1);const Ot=it!==void 0&&!nt?it:At;let Tt;reactExports.useRef(!1);const ht=reactExports.useCallback(()=>{Bt(!0)},[]),bt=reactExports.useCallback(()=>{Bt(!1)},[]),mt=reactExports.useMemo(()=>({adornedStart:wt,setAdornedStart:Ct,color:tt,disabled:nt,error:ot,filled:Pt,focused:Ot,fullWidth:st,hiddenLabel:at,size:ft,onBlur:()=>{kt(!1)},onFocus:()=>{kt(!0)},onEmpty:bt,onFilled:ht,registerEffect:Tt,required:ct,variant:dt}),[wt,tt,nt,ot,Pt,Ot,st,at,Tt,bt,ht,ct,ft,dt]);return jsxRuntimeExports.jsx(FormControlContext.Provider,{value:mt,children:jsxRuntimeExports.jsx(FormControlRoot,{as:rt,ownerState:yt,className:clsx(vt.root,et),ref:$,...pt,children:_e})})});function getFormControlLabelUtilityClasses(o){return generateUtilityClass("MuiFormControlLabel",o)}const formControlLabelClasses=generateUtilityClasses("MuiFormControlLabel",["root","labelPlacementStart","labelPlacementTop","labelPlacementBottom","disabled","label","error","required","asterisk"]),useUtilityClasses$A=o=>{const{classes:_,disabled:$,labelPlacement:j,error:_e,required:et}=o,tt={root:["root",$&&"disabled",`labelPlacement${capitalize(j)}`,_e&&"error",et&&"required"],label:["label",$&&"disabled"],asterisk:["asterisk",_e&&"error"]};return composeClasses(tt,getFormControlLabelUtilityClasses,_)},FormControlLabelRoot=styled("label",{name:"MuiFormControlLabel",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[{[`& .${formControlLabelClasses.label}`]:_.label},_.root,_[`labelPlacement${capitalize($.labelPlacement)}`]]}})(memoTheme(({theme:o})=>({display:"inline-flex",alignItems:"center",cursor:"pointer",verticalAlign:"middle",WebkitTapHighlightColor:"transparent",marginLeft:-11,marginRight:16,[`&.${formControlLabelClasses.disabled}`]:{cursor:"default"},[`& .${formControlLabelClasses.label}`]:{[`&.${formControlLabelClasses.disabled}`]:{color:(o.vars||o).palette.text.disabled}},variants:[{props:{labelPlacement:"start"},style:{flexDirection:"row-reverse",marginRight:-11}},{props:{labelPlacement:"top"},style:{flexDirection:"column-reverse"}},{props:{labelPlacement:"bottom"},style:{flexDirection:"column"}},{props:({labelPlacement:_})=>_==="start"||_==="top"||_==="bottom",style:{marginLeft:16}}]}))),AsteriskComponent$1=styled("span",{name:"MuiFormControlLabel",slot:"Asterisk"})(memoTheme(({theme:o})=>({[`&.${formControlLabelClasses.error}`]:{color:(o.vars||o).palette.error.main}}))),FormControlLabel=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiFormControlLabel"}),{checked:_e,className:et,componentsProps:tt={},control:rt,disabled:nt,disableTypography:ot,inputRef:it,label:st,labelPlacement:at="end",name:lt,onChange:ct,required:ft,slots:dt={},slotProps:pt={},value:yt,...vt}=j,wt=useFormControl(),Ct=nt??rt.props.disabled??(wt==null?void 0:wt.disabled),Pt=ft??rt.props.required,Bt={disabled:Ct,required:Pt};["checked","name","onChange","value","inputRef"].forEach(gt=>{typeof rt.props[gt]>"u"&&typeof j[gt]<"u"&&(Bt[gt]=j[gt])});const At=formControlState({props:j,muiFormControl:wt,states:["error"]}),kt={...j,disabled:Ct,labelPlacement:at,required:Pt,error:At.error},Ot=useUtilityClasses$A(kt),Tt={slots:dt,slotProps:{...tt,...pt}},[ht,bt]=useSlot("typography",{elementType:Typography,externalForwardedProps:Tt,ownerState:kt});let mt=st;return mt!=null&&mt.type!==Typography&&!ot&&(mt=jsxRuntimeExports.jsx(ht,{component:"span",...bt,className:clsx(Ot.label,bt==null?void 0:bt.className),children:mt})),jsxRuntimeExports.jsxs(FormControlLabelRoot,{className:clsx(Ot.root,et),ownerState:kt,ref:$,...vt,children:[reactExports.cloneElement(rt,Bt),Pt?jsxRuntimeExports.jsxs("div",{children:[mt,jsxRuntimeExports.jsxs(AsteriskComponent$1,{ownerState:kt,"aria-hidden":!0,className:Ot.asterisk,children:[" ","*"]})]}):mt]})});function getFormHelperTextUtilityClasses(o){return generateUtilityClass("MuiFormHelperText",o)}const formHelperTextClasses=generateUtilityClasses("MuiFormHelperText",["root","error","disabled","sizeSmall","sizeMedium","contained","focused","filled","required"]);var _span$2;const useUtilityClasses$z=o=>{const{classes:_,contained:$,size:j,disabled:_e,error:et,filled:tt,focused:rt,required:nt}=o,ot={root:["root",_e&&"disabled",et&&"error",j&&`size${capitalize(j)}`,$&&"contained",rt&&"focused",tt&&"filled",nt&&"required"]};return composeClasses(ot,getFormHelperTextUtilityClasses,_)},FormHelperTextRoot=styled("p",{name:"MuiFormHelperText",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.size&&_[`size${capitalize($.size)}`],$.contained&&_.contained,$.filled&&_.filled]}})(memoTheme(({theme:o})=>({color:(o.vars||o).palette.text.secondary,...o.typography.caption,textAlign:"left",marginTop:3,marginRight:0,marginBottom:0,marginLeft:0,[`&.${formHelperTextClasses.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${formHelperTextClasses.error}`]:{color:(o.vars||o).palette.error.main},variants:[{props:{size:"small"},style:{marginTop:4}},{props:({ownerState:_})=>_.contained,style:{marginLeft:14,marginRight:14}}]}))),FormHelperText=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiFormHelperText"}),{children:_e,className:et,component:tt="p",disabled:rt,error:nt,filled:ot,focused:it,margin:st,required:at,variant:lt,...ct}=j,ft=useFormControl(),dt=formControlState({props:j,muiFormControl:ft,states:["variant","size","disabled","error","filled","focused","required"]}),pt={...j,component:tt,contained:dt.variant==="filled"||dt.variant==="outlined",variant:dt.variant,size:dt.size,disabled:dt.disabled,error:dt.error,filled:dt.filled,focused:dt.focused,required:dt.required};delete pt.ownerState;const yt=useUtilityClasses$z(pt);return jsxRuntimeExports.jsx(FormHelperTextRoot,{as:tt,className:clsx(yt.root,et),ref:$,...ct,ownerState:pt,children:_e===" "?_span$2||(_span$2=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"})):_e})});function getFormLabelUtilityClasses(o){return generateUtilityClass("MuiFormLabel",o)}const formLabelClasses=generateUtilityClasses("MuiFormLabel",["root","colorSecondary","focused","disabled","error","filled","required","asterisk"]),useUtilityClasses$y=o=>{const{classes:_,color:$,focused:j,disabled:_e,error:et,filled:tt,required:rt}=o,nt={root:["root",`color${capitalize($)}`,_e&&"disabled",et&&"error",tt&&"filled",j&&"focused",rt&&"required"],asterisk:["asterisk",et&&"error"]};return composeClasses(nt,getFormLabelUtilityClasses,_)},FormLabelRoot=styled("label",{name:"MuiFormLabel",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.color==="secondary"&&_.colorSecondary,$.filled&&_.filled]}})(memoTheme(({theme:o})=>({color:(o.vars||o).palette.text.secondary,...o.typography.body1,lineHeight:"1.4375em",padding:0,position:"relative",variants:[...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_},style:{[`&.${formLabelClasses.focused}`]:{color:(o.vars||o).palette[_].main}}})),{props:{},style:{[`&.${formLabelClasses.disabled}`]:{color:(o.vars||o).palette.text.disabled},[`&.${formLabelClasses.error}`]:{color:(o.vars||o).palette.error.main}}}]}))),AsteriskComponent=styled("span",{name:"MuiFormLabel",slot:"Asterisk"})(memoTheme(({theme:o})=>({[`&.${formLabelClasses.error}`]:{color:(o.vars||o).palette.error.main}}))),FormLabel=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiFormLabel"}),{children:_e,className:et,color:tt,component:rt="label",disabled:nt,error:ot,filled:it,focused:st,required:at,...lt}=j,ct=useFormControl(),ft=formControlState({props:j,muiFormControl:ct,states:["color","required","focused","disabled","error","filled"]}),dt={...j,color:ft.color||"primary",component:rt,disabled:ft.disabled,error:ft.error,filled:ft.filled,focused:ft.focused,required:ft.required},pt=useUtilityClasses$y(dt);return jsxRuntimeExports.jsxs(FormLabelRoot,{as:rt,ownerState:dt,className:clsx(pt.root,et),ref:$,...lt,children:[_e,ft.required&&jsxRuntimeExports.jsxs(AsteriskComponent,{ownerState:dt,"aria-hidden":!0,className:pt.asterisk,children:[" ","*"]})]})}),Grid=createGrid({createStyledComponent:styled("div",{name:"MuiGrid",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.container&&_.container]}}),componentName:"MuiGrid",useThemeProps:o=>useDefaultProps({props:o,name:"MuiGrid"}),useTheme});function getScale(o){return`scale(${o}, ${o**2})`}const styles$1={entering:{opacity:1,transform:getScale(1)},entered:{opacity:1,transform:"none"}},isWebKit154=typeof navigator<"u"&&/^((?!chrome|android).)*(safari|mobile)/i.test(navigator.userAgent)&&/(os |version\/)15(.|_)4/i.test(navigator.userAgent),Grow=reactExports.forwardRef(function(_,$){const{addEndListener:j,appear:_e=!0,children:et,easing:tt,in:rt,onEnter:nt,onEntered:ot,onEntering:it,onExit:st,onExited:at,onExiting:lt,style:ct,timeout:ft="auto",TransitionComponent:dt=Transition,...pt}=_,yt=useTimeout(),vt=reactExports.useRef(),wt=useTheme(),Ct=reactExports.useRef(null),Pt=useForkRef(Ct,getReactElementRef(et),$),Bt=gt=>xt=>{if(gt){const Et=Ct.current;xt===void 0?gt(Et):gt(Et,xt)}},At=Bt(it),kt=Bt((gt,xt)=>{reflow(gt);const{duration:Et,delay:_t,easing:$t}=getTransitionProps({style:ct,timeout:ft,easing:tt},{mode:"enter"});let St;ft==="auto"?(St=wt.transitions.getAutoHeightDuration(gt.clientHeight),vt.current=St):St=Et,gt.style.transition=[wt.transitions.create("opacity",{duration:St,delay:_t}),wt.transitions.create("transform",{duration:isWebKit154?St:St*.666,delay:_t,easing:$t})].join(","),nt&&nt(gt,xt)}),Ot=Bt(ot),Tt=Bt(lt),ht=Bt(gt=>{const{duration:xt,delay:Et,easing:_t}=getTransitionProps({style:ct,timeout:ft,easing:tt},{mode:"exit"});let $t;ft==="auto"?($t=wt.transitions.getAutoHeightDuration(gt.clientHeight),vt.current=$t):$t=xt,gt.style.transition=[wt.transitions.create("opacity",{duration:$t,delay:Et}),wt.transitions.create("transform",{duration:isWebKit154?$t:$t*.666,delay:isWebKit154?Et:Et||$t*.333,easing:_t})].join(","),gt.style.opacity=0,gt.style.transform=getScale(.75),st&&st(gt)}),bt=Bt(at),mt=gt=>{ft==="auto"&&yt.start(vt.current||0,gt),j&&j(Ct.current,gt)};return jsxRuntimeExports.jsx(dt,{appear:_e,in:rt,nodeRef:Ct,onEnter:kt,onEntered:Ot,onEntering:At,onExit:ht,onExited:bt,onExiting:Tt,addEndListener:mt,timeout:ft==="auto"?null:ft,...pt,children:(gt,{ownerState:xt,...Et})=>reactExports.cloneElement(et,{style:{opacity:0,transform:getScale(.75),visibility:gt==="exited"&&!rt?"hidden":void 0,...styles$1[gt],...ct,...et.props.style},ref:Pt,...Et})})});Grow&&(Grow.muiSupportAuto=!0);const useUtilityClasses$x=o=>{const{classes:_,disableUnderline:$}=o,_e=composeClasses({root:["root",!$&&"underline"],input:["input"]},getInputUtilityClass,_);return{..._,..._e}},InputRoot=styled(InputBaseRoot,{shouldForwardProp:o=>rootShouldForwardProp(o)||o==="classes",name:"MuiInput",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[...rootOverridesResolver(o,_),!$.disableUnderline&&_.underline]}})(memoTheme(({theme:o})=>{let $=o.palette.mode==="light"?"rgba(0, 0, 0, 0.42)":"rgba(255, 255, 255, 0.7)";return o.vars&&($=o.alpha(o.vars.palette.common.onBackground,o.vars.opacity.inputUnderline)),{position:"relative",variants:[{props:({ownerState:j})=>j.formControl,style:{"label + &":{marginTop:16}}},{props:({ownerState:j})=>!j.disableUnderline,style:{"&::after":{left:0,bottom:0,content:'""',position:"absolute",right:0,transform:"scaleX(0)",transition:o.transitions.create("transform",{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut}),pointerEvents:"none"},[`&.${inputClasses.focused}:after`]:{transform:"scaleX(1) translateX(0)"},[`&.${inputClasses.error}`]:{"&::before, &::after":{borderBottomColor:(o.vars||o).palette.error.main}},"&::before":{borderBottom:`1px solid ${$}`,left:0,bottom:0,content:'"\\00a0"',position:"absolute",right:0,transition:o.transitions.create("border-bottom-color",{duration:o.transitions.duration.shorter}),pointerEvents:"none"},[`&:hover:not(.${inputClasses.disabled}, .${inputClasses.error}):before`]:{borderBottom:`2px solid ${(o.vars||o).palette.text.primary}`,"@media (hover: none)":{borderBottom:`1px solid ${$}`}},[`&.${inputClasses.disabled}:before`]:{borderBottomStyle:"dotted"}}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([j])=>({props:{color:j,disableUnderline:!1},style:{"&::after":{borderBottom:`2px solid ${(o.vars||o).palette[j].main}`}}}))]}})),InputInput=styled(InputBaseInput,{name:"MuiInput",slot:"Input",overridesResolver:inputOverridesResolver})({}),Input$1=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiInput"}),{disableUnderline:_e=!1,components:et={},componentsProps:tt,fullWidth:rt=!1,inputComponent:nt="input",multiline:ot=!1,slotProps:it,slots:st={},type:at="text",...lt}=j,ct=useUtilityClasses$x(j),dt={root:{ownerState:{disableUnderline:_e}}},pt=it??tt?deepmerge$2(it??tt,dt):dt,yt=st.root??et.Root??InputRoot,vt=st.input??et.Input??InputInput;return jsxRuntimeExports.jsx(InputBase,{slots:{root:yt,input:vt},slotProps:pt,fullWidth:rt,inputComponent:nt,multiline:ot,ref:$,type:at,...lt,classes:ct})});Input$1.muiName="Input";function getInputLabelUtilityClasses(o){return generateUtilityClass("MuiInputLabel",o)}generateUtilityClasses("MuiInputLabel",["root","focused","disabled","error","required","asterisk","formControl","sizeSmall","shrink","animated","standard","filled","outlined"]);const useUtilityClasses$w=o=>{const{classes:_,formControl:$,size:j,shrink:_e,disableAnimation:et,variant:tt,required:rt}=o,nt={root:["root",$&&"formControl",!et&&"animated",_e&&"shrink",j&&j!=="medium"&&`size${capitalize(j)}`,tt],asterisk:[rt&&"asterisk"]},ot=composeClasses(nt,getInputLabelUtilityClasses,_);return{..._,...ot}},InputLabelRoot=styled(FormLabel,{shouldForwardProp:o=>rootShouldForwardProp(o)||o==="classes",name:"MuiInputLabel",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[{[`& .${formLabelClasses.asterisk}`]:_.asterisk},_.root,$.formControl&&_.formControl,$.size==="small"&&_.sizeSmall,$.shrink&&_.shrink,!$.disableAnimation&&_.animated,$.focused&&_.focused,_[$.variant]]}})(memoTheme(({theme:o})=>({display:"block",transformOrigin:"top left",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis",maxWidth:"100%",variants:[{props:({ownerState:_})=>_.formControl,style:{position:"absolute",left:0,top:0,transform:"translate(0, 20px) scale(1)"}},{props:{size:"small"},style:{transform:"translate(0, 17px) scale(1)"}},{props:({ownerState:_})=>_.shrink,style:{transform:"translate(0, -1.5px) scale(0.75)",transformOrigin:"top left",maxWidth:"133%"}},{props:({ownerState:_})=>!_.disableAnimation,style:{transition:o.transitions.create(["color","transform","max-width"],{duration:o.transitions.duration.shorter,easing:o.transitions.easing.easeOut})}},{props:{variant:"filled"},style:{zIndex:1,pointerEvents:"none",transform:"translate(12px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"filled",size:"small"},style:{transform:"translate(12px, 13px) scale(1)"}},{props:({variant:_,ownerState:$})=>_==="filled"&&$.shrink,style:{userSelect:"none",pointerEvents:"auto",transform:"translate(12px, 7px) scale(0.75)",maxWidth:"calc(133% - 24px)"}},{props:({variant:_,ownerState:$,size:j})=>_==="filled"&&$.shrink&&j==="small",style:{transform:"translate(12px, 4px) scale(0.75)"}},{props:{variant:"outlined"},style:{zIndex:1,pointerEvents:"none",transform:"translate(14px, 16px) scale(1)",maxWidth:"calc(100% - 24px)"}},{props:{variant:"outlined",size:"small"},style:{transform:"translate(14px, 9px) scale(1)"}},{props:({variant:_,ownerState:$})=>_==="outlined"&&$.shrink,style:{userSelect:"none",pointerEvents:"auto",maxWidth:"calc(133% - 32px)",transform:"translate(14px, -9px) scale(0.75)"}}]}))),InputLabel=reactExports.forwardRef(function(_,$){const j=useDefaultProps({name:"MuiInputLabel",props:_}),{disableAnimation:_e=!1,margin:et,shrink:tt,variant:rt,className:nt,...ot}=j,it=useFormControl();let st=tt;typeof st>"u"&&it&&(st=it.filled||it.focused||it.adornedStart);const at=formControlState({props:j,muiFormControl:it,states:["size","variant","required","focused"]}),lt={...j,disableAnimation:_e,formControl:it,shrink:st,size:at.size,variant:at.variant,required:at.required,focused:at.focused},ct=useUtilityClasses$w(lt);return jsxRuntimeExports.jsx(InputLabelRoot,{"data-shrink":st,ref:$,className:clsx(ct.root,nt),...ot,ownerState:lt,classes:ct})});function getLinearProgressUtilityClass(o){return generateUtilityClass("MuiLinearProgress",o)}generateUtilityClasses("MuiLinearProgress",["root","colorPrimary","colorSecondary","determinate","indeterminate","buffer","query","dashed","dashedColorPrimary","dashedColorSecondary","bar","bar1","bar2","barColorPrimary","barColorSecondary","bar1Indeterminate","bar1Determinate","bar1Buffer","bar2Indeterminate","bar2Buffer"]);const TRANSITION_DURATION=4,indeterminate1Keyframe=keyframes` - 0% { - left: -35%; - right: 100%; - } - - 60% { - left: 100%; - right: -90%; - } - - 100% { - left: 100%; - right: -90%; - } -`,indeterminate1Animation=typeof indeterminate1Keyframe!="string"?css` - animation: ${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite; - `:null,indeterminate2Keyframe=keyframes` - 0% { - left: -200%; - right: 100%; - } - - 60% { - left: 107%; - right: -8%; - } - - 100% { - left: 107%; - right: -8%; - } -`,indeterminate2Animation=typeof indeterminate2Keyframe!="string"?css` - animation: ${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite; - `:null,bufferKeyframe=keyframes` - 0% { - opacity: 1; - background-position: 0 -23px; - } - - 60% { - opacity: 0; - background-position: 0 -23px; - } - - 100% { - opacity: 1; - background-position: -200px -23px; - } -`,bufferAnimation=typeof bufferKeyframe!="string"?css` - animation: ${bufferKeyframe} 3s infinite linear; - `:null,useUtilityClasses$v=o=>{const{classes:_,variant:$,color:j}=o,_e={root:["root",`color${capitalize(j)}`,$],dashed:["dashed",`dashedColor${capitalize(j)}`],bar1:["bar","bar1",`barColor${capitalize(j)}`,($==="indeterminate"||$==="query")&&"bar1Indeterminate",$==="determinate"&&"bar1Determinate",$==="buffer"&&"bar1Buffer"],bar2:["bar","bar2",$!=="buffer"&&`barColor${capitalize(j)}`,$==="buffer"&&`color${capitalize(j)}`,($==="indeterminate"||$==="query")&&"bar2Indeterminate",$==="buffer"&&"bar2Buffer"]};return composeClasses(_e,getLinearProgressUtilityClass,_)},getColorShade=(o,_)=>o.vars?o.vars.palette.LinearProgress[`${_}Bg`]:o.palette.mode==="light"?o.lighten(o.palette[_].main,.62):o.darken(o.palette[_].main,.5),LinearProgressRoot=styled("span",{name:"MuiLinearProgress",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[`color${capitalize($.color)}`],_[$.variant]]}})(memoTheme(({theme:o})=>({position:"relative",overflow:"hidden",display:"block",height:4,zIndex:0,"@media print":{colorAdjust:"exact"},variants:[...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_},style:{backgroundColor:getColorShade(o,_)}})),{props:({ownerState:_})=>_.color==="inherit"&&_.variant!=="buffer",style:{"&::before":{content:'""',position:"absolute",left:0,top:0,right:0,bottom:0,backgroundColor:"currentColor",opacity:.3}}},{props:{variant:"buffer"},style:{backgroundColor:"transparent"}},{props:{variant:"query"},style:{transform:"rotate(180deg)"}}]}))),LinearProgressDashed=styled("span",{name:"MuiLinearProgress",slot:"Dashed",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.dashed,_[`dashedColor${capitalize($.color)}`]]}})(memoTheme(({theme:o})=>({position:"absolute",marginTop:0,height:"100%",width:"100%",backgroundSize:"10px 10px",backgroundPosition:"0 -23px",variants:[{props:{color:"inherit"},style:{opacity:.3,backgroundImage:"radial-gradient(currentColor 0%, currentColor 16%, transparent 42%)"}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>{const $=getColorShade(o,_);return{props:{color:_},style:{backgroundImage:`radial-gradient(${$} 0%, ${$} 16%, transparent 42%)`}}})]})),bufferAnimation||{animation:`${bufferKeyframe} 3s infinite linear`}),LinearProgressBar1=styled("span",{name:"MuiLinearProgress",slot:"Bar1",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.bar,_.bar1,_[`barColor${capitalize($.color)}`],($.variant==="indeterminate"||$.variant==="query")&&_.bar1Indeterminate,$.variant==="determinate"&&_.bar1Determinate,$.variant==="buffer"&&_.bar1Buffer]}})(memoTheme(({theme:o})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[{props:{color:"inherit"},style:{backgroundColor:"currentColor"}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_},style:{backgroundColor:(o.vars||o).palette[_].main}})),{props:{variant:"determinate"},style:{transition:`transform .${TRANSITION_DURATION}s linear`}},{props:{variant:"buffer"},style:{zIndex:1,transition:`transform .${TRANSITION_DURATION}s linear`}},{props:({ownerState:_})=>_.variant==="indeterminate"||_.variant==="query",style:{width:"auto"}},{props:({ownerState:_})=>_.variant==="indeterminate"||_.variant==="query",style:indeterminate1Animation||{animation:`${indeterminate1Keyframe} 2.1s cubic-bezier(0.65, 0.815, 0.735, 0.395) infinite`}}]}))),LinearProgressBar2=styled("span",{name:"MuiLinearProgress",slot:"Bar2",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.bar,_.bar2,_[`barColor${capitalize($.color)}`],($.variant==="indeterminate"||$.variant==="query")&&_.bar2Indeterminate,$.variant==="buffer"&&_.bar2Buffer]}})(memoTheme(({theme:o})=>({width:"100%",position:"absolute",left:0,bottom:0,top:0,transition:"transform 0.2s linear",transformOrigin:"left",variants:[...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_},style:{"--LinearProgressBar2-barColor":(o.vars||o).palette[_].main}})),{props:({ownerState:_})=>_.variant!=="buffer"&&_.color!=="inherit",style:{backgroundColor:"var(--LinearProgressBar2-barColor, currentColor)"}},{props:({ownerState:_})=>_.variant!=="buffer"&&_.color==="inherit",style:{backgroundColor:"currentColor"}},{props:{color:"inherit"},style:{opacity:.3}},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{color:_,variant:"buffer"},style:{backgroundColor:getColorShade(o,_),transition:`transform .${TRANSITION_DURATION}s linear`}})),{props:({ownerState:_})=>_.variant==="indeterminate"||_.variant==="query",style:{width:"auto"}},{props:({ownerState:_})=>_.variant==="indeterminate"||_.variant==="query",style:indeterminate2Animation||{animation:`${indeterminate2Keyframe} 2.1s cubic-bezier(0.165, 0.84, 0.44, 1) 1.15s infinite`}}]}))),LinearProgress=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiLinearProgress"}),{className:_e,color:et="primary",value:tt,valueBuffer:rt,variant:nt="indeterminate",...ot}=j,it={...j,color:et,variant:nt},st=useUtilityClasses$v(it),at=useRtl(),lt={},ct={bar1:{},bar2:{}};if((nt==="determinate"||nt==="buffer")&&tt!==void 0){lt["aria-valuenow"]=Math.round(tt),lt["aria-valuemin"]=0,lt["aria-valuemax"]=100;let ft=tt-100;at&&(ft=-ft),ct.bar1.transform=`translateX(${ft}%)`}if(nt==="buffer"&&rt!==void 0){let ft=(rt||0)-100;at&&(ft=-ft),ct.bar2.transform=`translateX(${ft}%)`}return jsxRuntimeExports.jsxs(LinearProgressRoot,{className:clsx(st.root,_e),ownerState:it,role:"progressbar",...lt,ref:$,...ot,children:[nt==="buffer"?jsxRuntimeExports.jsx(LinearProgressDashed,{className:st.dashed,ownerState:it}):null,jsxRuntimeExports.jsx(LinearProgressBar1,{className:st.bar1,ownerState:it,style:ct.bar1}),nt==="determinate"?null:jsxRuntimeExports.jsx(LinearProgressBar2,{className:st.bar2,ownerState:it,style:ct.bar2})]})});function getLinkUtilityClass(o){return generateUtilityClass("MuiLink",o)}const linkClasses=generateUtilityClasses("MuiLink",["root","underlineNone","underlineHover","underlineAlways","button","focusVisible"]),getTextDecoration=({theme:o,ownerState:_})=>{const $=_.color;if("colorSpace"in o&&o.colorSpace){const et=getPath$2(o,`palette.${$}.main`)||getPath$2(o,`palette.${$}`)||_.color;return o.alpha(et,.4)}const j=getPath$2(o,`palette.${$}.main`,!1)||getPath$2(o,`palette.${$}`,!1)||_.color,_e=getPath$2(o,`palette.${$}.mainChannel`)||getPath$2(o,`palette.${$}Channel`);return"vars"in o&&_e?`rgba(${_e} / 0.4)`:alpha$1(j,.4)},v6Colors={primary:!0,secondary:!0,error:!0,info:!0,success:!0,warning:!0,textPrimary:!0,textSecondary:!0,textDisabled:!0},useUtilityClasses$u=o=>{const{classes:_,component:$,focusVisible:j,underline:_e}=o,et={root:["root",`underline${capitalize(_e)}`,$==="button"&&"button",j&&"focusVisible"]};return composeClasses(et,getLinkUtilityClass,_)},LinkRoot=styled(Typography,{name:"MuiLink",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[`underline${capitalize($.underline)}`],$.component==="button"&&_.button]}})(memoTheme(({theme:o})=>({variants:[{props:{underline:"none"},style:{textDecoration:"none"}},{props:{underline:"hover"},style:{textDecoration:"none","&:hover":{textDecoration:"underline"}}},{props:{underline:"always"},style:{textDecoration:"underline","&:hover":{textDecorationColor:"inherit"}}},{props:({underline:_,ownerState:$})=>_==="always"&&$.color!=="inherit",style:{textDecorationColor:"var(--Link-underlineColor)"}},{props:({underline:_,ownerState:$})=>_==="always"&&$.color==="inherit",style:o.colorSpace?{textDecorationColor:o.alpha("currentColor",.4)}:null},...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([_])=>({props:{underline:"always",color:_},style:{"--Link-underlineColor":o.alpha((o.vars||o).palette[_].main,.4)}})),{props:{underline:"always",color:"textPrimary"},style:{"--Link-underlineColor":o.alpha((o.vars||o).palette.text.primary,.4)}},{props:{underline:"always",color:"textSecondary"},style:{"--Link-underlineColor":o.alpha((o.vars||o).palette.text.secondary,.4)}},{props:{underline:"always",color:"textDisabled"},style:{"--Link-underlineColor":(o.vars||o).palette.text.disabled}},{props:{component:"button"},style:{position:"relative",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none","&::-moz-focus-inner":{borderStyle:"none"},[`&.${linkClasses.focusVisible}`]:{outline:"auto"}}}]}))),Link=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiLink"}),_e=useTheme(),{className:et,color:tt="primary",component:rt="a",onBlur:nt,onFocus:ot,TypographyClasses:it,underline:st="always",variant:at="inherit",sx:lt,...ct}=j,[ft,dt]=reactExports.useState(!1),pt=Ct=>{isFocusVisible(Ct.target)||dt(!1),nt&&nt(Ct)},yt=Ct=>{isFocusVisible(Ct.target)&&dt(!0),ot&&ot(Ct)},vt={...j,color:tt,component:rt,focusVisible:ft,underline:st,variant:at},wt=useUtilityClasses$u(vt);return jsxRuntimeExports.jsx(LinkRoot,{color:tt,className:clsx(wt.root,et),classes:it,component:rt,onBlur:pt,onFocus:yt,ref:$,ownerState:vt,variant:at,...ct,sx:[...v6Colors[tt]===void 0?[{color:tt}]:[],...Array.isArray(lt)?lt:[lt]],style:{...ct.style,...st==="always"&&tt!=="inherit"&&!v6Colors[tt]&&{"--Link-underlineColor":getTextDecoration({theme:_e,ownerState:vt})}}})}),ListContext=reactExports.createContext({});function getListUtilityClass(o){return generateUtilityClass("MuiList",o)}generateUtilityClasses("MuiList",["root","padding","dense","subheader"]);const useUtilityClasses$t=o=>{const{classes:_,disablePadding:$,dense:j,subheader:_e}=o;return composeClasses({root:["root",!$&&"padding",j&&"dense",_e&&"subheader"]},getListUtilityClass,_)},ListRoot=styled("ul",{name:"MuiList",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,!$.disablePadding&&_.padding,$.dense&&_.dense,$.subheader&&_.subheader]}})({listStyle:"none",margin:0,padding:0,position:"relative",variants:[{props:({ownerState:o})=>!o.disablePadding,style:{paddingTop:8,paddingBottom:8}},{props:({ownerState:o})=>o.subheader,style:{paddingTop:0}}]}),List$2=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiList"}),{children:_e,className:et,component:tt="ul",dense:rt=!1,disablePadding:nt=!1,subheader:ot,...it}=j,st=reactExports.useMemo(()=>({dense:rt}),[rt]),at={...j,component:tt,dense:rt,disablePadding:nt},lt=useUtilityClasses$t(at);return jsxRuntimeExports.jsx(ListContext.Provider,{value:st,children:jsxRuntimeExports.jsxs(ListRoot,{as:tt,className:clsx(lt.root,et),ref:$,ownerState:at,...it,children:[ot,_e]})})}),listItemIconClasses=generateUtilityClasses("MuiListItemIcon",["root","alignItemsFlexStart"]),listItemTextClasses=generateUtilityClasses("MuiListItemText",["root","multiline","dense","inset","primary","secondary"]);function nextItem$1(o,_,$){return o===_?o.firstChild:_&&_.nextElementSibling?_.nextElementSibling:$?null:o.firstChild}function previousItem$1(o,_,$){return o===_?$?o.firstChild:o.lastChild:_&&_.previousElementSibling?_.previousElementSibling:$?null:o.lastChild}function textCriteriaMatches(o,_){if(_===void 0)return!0;let $=o.innerText;return $===void 0&&($=o.textContent),$=$.trim().toLowerCase(),$.length===0?!1:_.repeating?$[0]===_.keys[0]:$.startsWith(_.keys.join(""))}function moveFocus$1(o,_,$,j,_e,et){let tt=!1,rt=_e(o,_,_?$:!1);for(;rt;){if(rt===o.firstChild){if(tt)return!1;tt=!0}const nt=j?!1:rt.disabled||rt.getAttribute("aria-disabled")==="true";if(!rt.hasAttribute("tabindex")||!textCriteriaMatches(rt,et)||nt)rt=_e(o,rt,$);else return rt.focus(),!0}return!1}const MenuList=reactExports.forwardRef(function(_,$){const{actions:j,autoFocus:_e=!1,autoFocusItem:et=!1,children:tt,className:rt,disabledItemsFocusable:nt=!1,disableListWrap:ot=!1,onKeyDown:it,variant:st="selectedMenu",...at}=_,lt=reactExports.useRef(null),ct=reactExports.useRef({keys:[],repeating:!0,previousKeyMatched:!0,lastTime:null});useEnhancedEffect(()=>{_e&<.current.focus()},[_e]),reactExports.useImperativeHandle(j,()=>({adjustStyleForScrollbar:(vt,{direction:wt})=>{const Ct=!lt.current.style.width;if(vt.clientHeight{const wt=lt.current,Ct=vt.key;if(vt.ctrlKey||vt.metaKey||vt.altKey){it&&it(vt);return}const Bt=activeElement(ownerDocument(wt));if(Ct==="ArrowDown")vt.preventDefault(),moveFocus$1(wt,Bt,ot,nt,nextItem$1);else if(Ct==="ArrowUp")vt.preventDefault(),moveFocus$1(wt,Bt,ot,nt,previousItem$1);else if(Ct==="Home")vt.preventDefault(),moveFocus$1(wt,null,ot,nt,nextItem$1);else if(Ct==="End")vt.preventDefault(),moveFocus$1(wt,null,ot,nt,previousItem$1);else if(Ct.length===1){const At=ct.current,kt=Ct.toLowerCase(),Ot=performance.now();At.keys.length>0&&(Ot-At.lastTime>500?(At.keys=[],At.repeating=!0,At.previousKeyMatched=!0):At.repeating&&kt!==At.keys[0]&&(At.repeating=!1)),At.lastTime=Ot,At.keys.push(kt);const Tt=Bt&&!At.repeating&&textCriteriaMatches(Bt,At);At.previousKeyMatched&&(Tt||moveFocus$1(wt,Bt,!1,nt,nextItem$1,At))?vt.preventDefault():At.previousKeyMatched=!1}it&&it(vt)},dt=useForkRef(lt,$);let pt=-1;reactExports.Children.forEach(tt,(vt,wt)=>{if(!reactExports.isValidElement(vt)){pt===wt&&(pt+=1,pt>=tt.length&&(pt=-1));return}vt.props.disabled||(st==="selectedMenu"&&vt.props.selected||pt===-1)&&(pt=wt),pt===wt&&(vt.props.disabled||vt.props.muiSkipListHighlight||vt.type.muiSkipListHighlight)&&(pt+=1,pt>=tt.length&&(pt=-1))});const yt=reactExports.Children.map(tt,(vt,wt)=>{if(wt===pt){const Ct={};return et&&(Ct.autoFocus=!0),vt.props.tabIndex===void 0&&st==="selectedMenu"&&(Ct.tabIndex=0),reactExports.cloneElement(vt,Ct)}return vt});return jsxRuntimeExports.jsx(List$2,{role:"menu",ref:dt,className:rt,onKeyDown:ft,tabIndex:_e?0:-1,...at,children:yt})});function getPopoverUtilityClass(o){return generateUtilityClass("MuiPopover",o)}generateUtilityClasses("MuiPopover",["root","paper"]);function getOffsetTop(o,_){let $=0;return typeof _=="number"?$=_:_==="center"?$=o.height/2:_==="bottom"&&($=o.height),$}function getOffsetLeft(o,_){let $=0;return typeof _=="number"?$=_:_==="center"?$=o.width/2:_==="right"&&($=o.width),$}function getTransformOriginValue(o){return[o.horizontal,o.vertical].map(_=>typeof _=="number"?`${_}px`:_).join(" ")}function resolveAnchorEl(o){return typeof o=="function"?o():o}const useUtilityClasses$s=o=>{const{classes:_}=o;return composeClasses({root:["root"],paper:["paper"]},getPopoverUtilityClass,_)},PopoverRoot=styled(Modal,{name:"MuiPopover",slot:"Root"})({}),PopoverPaper=styled(Paper,{name:"MuiPopover",slot:"Paper"})({position:"absolute",overflowY:"auto",overflowX:"hidden",minWidth:16,minHeight:16,maxWidth:"calc(100% - 32px)",maxHeight:"calc(100% - 32px)",outline:0}),Popover=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiPopover"}),{action:_e,anchorEl:et,anchorOrigin:tt={vertical:"top",horizontal:"left"},anchorPosition:rt,anchorReference:nt="anchorEl",children:ot,className:it,container:st,elevation:at=8,marginThreshold:lt=16,open:ct,PaperProps:ft={},slots:dt={},slotProps:pt={},transformOrigin:yt={vertical:"top",horizontal:"left"},TransitionComponent:vt,transitionDuration:wt="auto",TransitionProps:Ct={},disableScrollLock:Pt=!1,...Bt}=j,At=reactExports.useRef(),kt={...j,anchorOrigin:tt,anchorReference:nt,elevation:at,marginThreshold:lt,transformOrigin:yt,TransitionComponent:vt,transitionDuration:wt,TransitionProps:Ct},Ot=useUtilityClasses$s(kt),Tt=reactExports.useCallback(()=>{if(nt==="anchorPosition")return rt;const Xt=resolveAnchorEl(et),Lt=(Xt&&Xt.nodeType===1?Xt:ownerDocument(At.current).body).getBoundingClientRect();return{top:Lt.top+getOffsetTop(Lt,tt.vertical),left:Lt.left+getOffsetLeft(Lt,tt.horizontal)}},[et,tt.horizontal,tt.vertical,rt,nt]),ht=reactExports.useCallback(Xt=>({vertical:getOffsetTop(Xt,yt.vertical),horizontal:getOffsetLeft(Xt,yt.horizontal)}),[yt.horizontal,yt.vertical]),bt=reactExports.useCallback(Xt=>{const Ut={width:Xt.offsetWidth,height:Xt.offsetHeight},Lt=ht(Ut);if(nt==="none")return{top:null,left:null,transformOrigin:getTransformOriginValue(Lt)};const Ht=Tt();let Kt=Ht.top-Lt.vertical,Jt=Ht.left-Lt.horizontal;const tr=Kt+Ut.height,nr=Jt+Ut.width,ur=ownerWindow(resolveAnchorEl(et)),rr=ur.innerHeight-lt,pr=ur.innerWidth-lt;if(lt!==null&&Ktrr){const fr=tr-rr;Kt-=fr,Lt.vertical+=fr}if(lt!==null&&Jtpr){const fr=nr-pr;Jt-=fr,Lt.horizontal+=fr}return{top:`${Math.round(Kt)}px`,left:`${Math.round(Jt)}px`,transformOrigin:getTransformOriginValue(Lt)}},[et,nt,Tt,ht,lt]),[mt,gt]=reactExports.useState(ct),xt=reactExports.useCallback(()=>{const Xt=At.current;if(!Xt)return;const Ut=bt(Xt);Ut.top!==null&&Xt.style.setProperty("top",Ut.top),Ut.left!==null&&(Xt.style.left=Ut.left),Xt.style.transformOrigin=Ut.transformOrigin,gt(!0)},[bt]);reactExports.useEffect(()=>(Pt&&window.addEventListener("scroll",xt),()=>window.removeEventListener("scroll",xt)),[et,Pt,xt]);const Et=()=>{xt()},_t=()=>{gt(!1)};reactExports.useEffect(()=>{ct&&xt()}),reactExports.useImperativeHandle(_e,()=>ct?{updatePosition:()=>{xt()}}:null,[ct,xt]),reactExports.useEffect(()=>{if(!ct)return;const Xt=debounce$3(()=>{xt()}),Ut=ownerWindow(resolveAnchorEl(et));return Ut.addEventListener("resize",Xt),()=>{Xt.clear(),Ut.removeEventListener("resize",Xt)}},[et,ct,xt]);let $t=wt;const St={slots:{transition:vt,...dt},slotProps:{transition:Ct,paper:ft,...pt}},[Rt,It]=useSlot("transition",{elementType:Grow,externalForwardedProps:St,ownerState:kt,getSlotProps:Xt=>({...Xt,onEntering:(Ut,Lt)=>{var Ht;(Ht=Xt.onEntering)==null||Ht.call(Xt,Ut,Lt),Et()},onExited:Ut=>{var Lt;(Lt=Xt.onExited)==null||Lt.call(Xt,Ut),_t()}}),additionalProps:{appear:!0,in:ct}});wt==="auto"&&!Rt.muiSupportAuto&&($t=void 0);const Mt=st||(et?ownerDocument(resolveAnchorEl(et)).body:void 0),[Vt,{slots:Gt,slotProps:zt,...jt}]=useSlot("root",{ref:$,elementType:PopoverRoot,externalForwardedProps:{...St,...Bt},shouldForwardComponentProp:!0,additionalProps:{slots:{backdrop:dt.backdrop},slotProps:{backdrop:mergeSlotProps$1(typeof pt.backdrop=="function"?pt.backdrop(kt):pt.backdrop,{invisible:!0})},container:Mt,open:ct},ownerState:kt,className:clsx(Ot.root,it)}),[Ft,qt]=useSlot("paper",{ref:At,className:Ot.paper,elementType:PopoverPaper,externalForwardedProps:St,shouldForwardComponentProp:!0,additionalProps:{elevation:at,style:mt?void 0:{opacity:0}},ownerState:kt});return jsxRuntimeExports.jsx(Vt,{...jt,...!isHostComponent(Vt)&&{slots:Gt,slotProps:zt,disableScrollLock:Pt},children:jsxRuntimeExports.jsx(Rt,{...It,timeout:$t,children:jsxRuntimeExports.jsx(Ft,{...qt,children:ot})})})});function getMenuUtilityClass(o){return generateUtilityClass("MuiMenu",o)}generateUtilityClasses("MuiMenu",["root","paper","list"]);const RTL_ORIGIN={vertical:"top",horizontal:"right"},LTR_ORIGIN={vertical:"top",horizontal:"left"},useUtilityClasses$r=o=>{const{classes:_}=o;return composeClasses({root:["root"],paper:["paper"],list:["list"]},getMenuUtilityClass,_)},MenuRoot=styled(Popover,{shouldForwardProp:o=>rootShouldForwardProp(o)||o==="classes",name:"MuiMenu",slot:"Root"})({}),MenuPaper=styled(PopoverPaper,{name:"MuiMenu",slot:"Paper"})({maxHeight:"calc(100% - 96px)",WebkitOverflowScrolling:"touch"}),MenuMenuList=styled(MenuList,{name:"MuiMenu",slot:"List"})({outline:0}),Menu=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiMenu"}),{autoFocus:_e=!0,children:et,className:tt,disableAutoFocusItem:rt=!1,MenuListProps:nt={},onClose:ot,open:it,PaperProps:st={},PopoverClasses:at,transitionDuration:lt="auto",TransitionProps:{onEntering:ct,...ft}={},variant:dt="selectedMenu",slots:pt={},slotProps:yt={},...vt}=j,wt=useRtl(),Ct={...j,autoFocus:_e,disableAutoFocusItem:rt,MenuListProps:nt,onEntering:ct,PaperProps:st,transitionDuration:lt,TransitionProps:ft,variant:dt},Pt=useUtilityClasses$r(Ct),Bt=_e&&!rt&&it,At=reactExports.useRef(null),kt=($t,St)=>{At.current&&At.current.adjustStyleForScrollbar($t,{direction:wt?"rtl":"ltr"}),ct&&ct($t,St)},Ot=$t=>{$t.key==="Tab"&&($t.preventDefault(),ot&&ot($t,"tabKeyDown"))};let Tt=-1;reactExports.Children.map(et,($t,St)=>{reactExports.isValidElement($t)&&($t.props.disabled||(dt==="selectedMenu"&&$t.props.selected||Tt===-1)&&(Tt=St))});const ht={slots:pt,slotProps:{list:nt,transition:ft,paper:st,...yt}},bt=useSlotProps({elementType:pt.root,externalSlotProps:yt.root,ownerState:Ct,className:[Pt.root,tt]}),[mt,gt]=useSlot("paper",{className:Pt.paper,elementType:MenuPaper,externalForwardedProps:ht,shouldForwardComponentProp:!0,ownerState:Ct}),[xt,Et]=useSlot("list",{className:clsx(Pt.list,nt.className),elementType:MenuMenuList,shouldForwardComponentProp:!0,externalForwardedProps:ht,getSlotProps:$t=>({...$t,onKeyDown:St=>{var Rt;Ot(St),(Rt=$t.onKeyDown)==null||Rt.call($t,St)}}),ownerState:Ct}),_t=typeof ht.slotProps.transition=="function"?ht.slotProps.transition(Ct):ht.slotProps.transition;return jsxRuntimeExports.jsx(MenuRoot,{onClose:ot,anchorOrigin:{vertical:"bottom",horizontal:wt?"right":"left"},transformOrigin:wt?RTL_ORIGIN:LTR_ORIGIN,slots:{root:pt.root,paper:mt,backdrop:pt.backdrop,...pt.transition&&{transition:pt.transition}},slotProps:{root:bt,paper:gt,backdrop:typeof yt.backdrop=="function"?yt.backdrop(Ct):yt.backdrop,transition:{..._t,onEntering:(...$t)=>{var St;kt(...$t),(St=_t==null?void 0:_t.onEntering)==null||St.call(_t,...$t)}}},open:it,ref:$,transitionDuration:lt,ownerState:Ct,...vt,classes:at,children:jsxRuntimeExports.jsx(xt,{actions:At,autoFocus:_e&&(Tt===-1||rt),autoFocusItem:Bt,variant:dt,...Et,children:et})})});function getMenuItemUtilityClass(o){return generateUtilityClass("MuiMenuItem",o)}const menuItemClasses=generateUtilityClasses("MuiMenuItem",["root","focusVisible","dense","disabled","divider","gutters","selected"]),overridesResolver=(o,_)=>{const{ownerState:$}=o;return[_.root,$.dense&&_.dense,$.divider&&_.divider,!$.disableGutters&&_.gutters]},useUtilityClasses$q=o=>{const{disabled:_,dense:$,divider:j,disableGutters:_e,selected:et,classes:tt}=o,nt=composeClasses({root:["root",$&&"dense",_&&"disabled",!_e&&"gutters",j&&"divider",et&&"selected"]},getMenuItemUtilityClass,tt);return{...tt,...nt}},MenuItemRoot=styled(ButtonBase,{shouldForwardProp:o=>rootShouldForwardProp(o)||o==="classes",name:"MuiMenuItem",slot:"Root",overridesResolver})(memoTheme(({theme:o})=>({...o.typography.body1,display:"flex",justifyContent:"flex-start",alignItems:"center",position:"relative",textDecoration:"none",minHeight:48,paddingTop:6,paddingBottom:6,boxSizing:"border-box",whiteSpace:"nowrap","&:hover":{textDecoration:"none",backgroundColor:(o.vars||o).palette.action.hover,"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${menuItemClasses.selected}`]:{backgroundColor:o.alpha((o.vars||o).palette.primary.main,(o.vars||o).palette.action.selectedOpacity),[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:o.alpha((o.vars||o).palette.primary.main,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.focusOpacity}`)}},[`&.${menuItemClasses.selected}:hover`]:{backgroundColor:o.alpha((o.vars||o).palette.primary.main,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.hoverOpacity}`),"@media (hover: none)":{backgroundColor:o.alpha((o.vars||o).palette.primary.main,(o.vars||o).palette.action.selectedOpacity)}},[`&.${menuItemClasses.focusVisible}`]:{backgroundColor:(o.vars||o).palette.action.focus},[`&.${menuItemClasses.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity},[`& + .${dividerClasses.root}`]:{marginTop:o.spacing(1),marginBottom:o.spacing(1)},[`& + .${dividerClasses.inset}`]:{marginLeft:52},[`& .${listItemTextClasses.root}`]:{marginTop:0,marginBottom:0},[`& .${listItemTextClasses.inset}`]:{paddingLeft:36},[`& .${listItemIconClasses.root}`]:{minWidth:36},variants:[{props:({ownerState:_})=>!_.disableGutters,style:{paddingLeft:16,paddingRight:16}},{props:({ownerState:_})=>_.divider,style:{borderBottom:`1px solid ${(o.vars||o).palette.divider}`,backgroundClip:"padding-box"}},{props:({ownerState:_})=>!_.dense,style:{[o.breakpoints.up("sm")]:{minHeight:"auto"}}},{props:({ownerState:_})=>_.dense,style:{minHeight:32,paddingTop:4,paddingBottom:4,...o.typography.body2,[`& .${listItemIconClasses.root} svg`]:{fontSize:"1.25rem"}}}]}))),MenuItem=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiMenuItem"}),{autoFocus:_e=!1,component:et="li",dense:tt=!1,divider:rt=!1,disableGutters:nt=!1,focusVisibleClassName:ot,role:it="menuitem",tabIndex:st,className:at,...lt}=j,ct=reactExports.useContext(ListContext),ft=reactExports.useMemo(()=>({dense:tt||ct.dense||!1,disableGutters:nt}),[ct.dense,tt,nt]),dt=reactExports.useRef(null);useEnhancedEffect(()=>{_e&&dt.current&&dt.current.focus()},[_e]);const pt={...j,dense:ft.dense,divider:rt,disableGutters:nt},yt=useUtilityClasses$q(j),vt=useForkRef(dt,$);let wt;return j.disabled||(wt=st!==void 0?st:-1),jsxRuntimeExports.jsx(ListContext.Provider,{value:ft,children:jsxRuntimeExports.jsx(MenuItemRoot,{ref:vt,role:it,tabIndex:wt,component:et,focusVisibleClassName:clsx(yt.focusVisible,ot),className:clsx(yt.root,at),...lt,ownerState:pt,classes:yt})})});function getNativeSelectUtilityClasses(o){return generateUtilityClass("MuiNativeSelect",o)}const nativeSelectClasses=generateUtilityClasses("MuiNativeSelect",["root","select","multiple","filled","outlined","standard","disabled","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]),useUtilityClasses$p=o=>{const{classes:_,variant:$,disabled:j,multiple:_e,open:et,error:tt}=o,rt={select:["select",$,j&&"disabled",_e&&"multiple",tt&&"error"],icon:["icon",`icon${capitalize($)}`,et&&"iconOpen",j&&"disabled"]};return composeClasses(rt,getNativeSelectUtilityClasses,_)},StyledSelectSelect=styled("select",{name:"MuiNativeSelect"})(({theme:o})=>({MozAppearance:"none",WebkitAppearance:"none",userSelect:"none",borderRadius:0,cursor:"pointer","&:focus":{borderRadius:0},[`&.${nativeSelectClasses.disabled}`]:{cursor:"default"},"&[multiple]":{height:"auto"},"&:not([multiple]) option, &:not([multiple]) optgroup":{backgroundColor:(o.vars||o).palette.background.paper},variants:[{props:({ownerState:_})=>_.variant!=="filled"&&_.variant!=="outlined",style:{"&&&":{paddingRight:24,minWidth:16}}},{props:{variant:"filled"},style:{"&&&":{paddingRight:32}}},{props:{variant:"outlined"},style:{borderRadius:(o.vars||o).shape.borderRadius,"&:focus":{borderRadius:(o.vars||o).shape.borderRadius},"&&&":{paddingRight:32}}}]})),NativeSelectSelect=styled(StyledSelectSelect,{name:"MuiNativeSelect",slot:"Select",shouldForwardProp:rootShouldForwardProp,overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.select,_[$.variant],$.error&&_.error,{[`&.${nativeSelectClasses.multiple}`]:_.multiple}]}})({}),StyledSelectIcon=styled("svg",{name:"MuiNativeSelect"})(({theme:o})=>({position:"absolute",right:0,top:"calc(50% - .5em)",pointerEvents:"none",color:(o.vars||o).palette.action.active,[`&.${nativeSelectClasses.disabled}`]:{color:(o.vars||o).palette.action.disabled},variants:[{props:({ownerState:_})=>_.open,style:{transform:"rotate(180deg)"}},{props:{variant:"filled"},style:{right:7}},{props:{variant:"outlined"},style:{right:7}}]})),NativeSelectIcon=styled(StyledSelectIcon,{name:"MuiNativeSelect",slot:"Icon",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.icon,$.variant&&_[`icon${capitalize($.variant)}`],$.open&&_.iconOpen]}})({}),NativeSelectInput=reactExports.forwardRef(function(_,$){const{className:j,disabled:_e,error:et,IconComponent:tt,inputRef:rt,variant:nt="standard",...ot}=_,it={..._,disabled:_e,variant:nt,error:et},st=useUtilityClasses$p(it);return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[jsxRuntimeExports.jsx(NativeSelectSelect,{ownerState:it,className:clsx(st.select,j),disabled:_e,ref:rt||$,...ot}),_.multiple?null:jsxRuntimeExports.jsx(NativeSelectIcon,{as:tt,ownerState:it,className:st.icon})]})});var _span$1;const NotchedOutlineRoot$1=styled("fieldset",{name:"MuiNotchedOutlined",shouldForwardProp:rootShouldForwardProp})({textAlign:"left",position:"absolute",bottom:0,right:0,top:-5,left:0,margin:0,padding:"0 8px",pointerEvents:"none",borderRadius:"inherit",borderStyle:"solid",borderWidth:1,overflow:"hidden",minWidth:"0%"}),NotchedOutlineLegend=styled("legend",{name:"MuiNotchedOutlined",shouldForwardProp:rootShouldForwardProp})(memoTheme(({theme:o})=>({float:"unset",width:"auto",overflow:"hidden",variants:[{props:({ownerState:_})=>!_.withLabel,style:{padding:0,lineHeight:"11px",transition:o.transitions.create("width",{duration:150,easing:o.transitions.easing.easeOut})}},{props:({ownerState:_})=>_.withLabel,style:{display:"block",padding:0,height:11,fontSize:"0.75em",visibility:"hidden",maxWidth:.01,transition:o.transitions.create("max-width",{duration:50,easing:o.transitions.easing.easeOut}),whiteSpace:"nowrap","& > span":{paddingLeft:5,paddingRight:5,display:"inline-block",opacity:0,visibility:"visible"}}},{props:({ownerState:_})=>_.withLabel&&_.notched,style:{maxWidth:"100%",transition:o.transitions.create("max-width",{duration:100,easing:o.transitions.easing.easeOut,delay:50})}}]})));function NotchedOutline(o){const{children:_,classes:$,className:j,label:_e,notched:et,...tt}=o,rt=_e!=null&&_e!=="",nt={...o,notched:et,withLabel:rt};return jsxRuntimeExports.jsx(NotchedOutlineRoot$1,{"aria-hidden":!0,className:j,ownerState:nt,...tt,children:jsxRuntimeExports.jsx(NotchedOutlineLegend,{ownerState:nt,children:rt?jsxRuntimeExports.jsx("span",{children:_e}):_span$1||(_span$1=jsxRuntimeExports.jsx("span",{className:"notranslate","aria-hidden":!0,children:"​"}))})})}const useUtilityClasses$o=o=>{const{classes:_}=o,j=composeClasses({root:["root"],notchedOutline:["notchedOutline"],input:["input"]},getOutlinedInputUtilityClass,_);return{..._,...j}},OutlinedInputRoot=styled(InputBaseRoot,{shouldForwardProp:o=>rootShouldForwardProp(o)||o==="classes",name:"MuiOutlinedInput",slot:"Root",overridesResolver:rootOverridesResolver})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{position:"relative",borderRadius:(o.vars||o).shape.borderRadius,[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:(o.vars||o).palette.text.primary},"@media (hover: none)":{[`&:hover .${outlinedInputClasses.notchedOutline}`]:{borderColor:o.vars?o.alpha(o.vars.palette.common.onBackground,.23):_}},[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderWidth:2},variants:[...Object.entries(o.palette).filter(createSimplePaletteValueFilter()).map(([$])=>({props:{color:$},style:{[`&.${outlinedInputClasses.focused} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(o.vars||o).palette[$].main}}})),{props:{},style:{[`&.${outlinedInputClasses.error} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(o.vars||o).palette.error.main},[`&.${outlinedInputClasses.disabled} .${outlinedInputClasses.notchedOutline}`]:{borderColor:(o.vars||o).palette.action.disabled}}},{props:({ownerState:$})=>$.startAdornment,style:{paddingLeft:14}},{props:({ownerState:$})=>$.endAdornment,style:{paddingRight:14}},{props:({ownerState:$})=>$.multiline,style:{padding:"16.5px 14px"}},{props:({ownerState:$,size:j})=>$.multiline&&j==="small",style:{padding:"8.5px 14px"}}]}})),NotchedOutlineRoot=styled(NotchedOutline,{name:"MuiOutlinedInput",slot:"NotchedOutline"})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light"?"rgba(0, 0, 0, 0.23)":"rgba(255, 255, 255, 0.23)";return{borderColor:o.vars?o.alpha(o.vars.palette.common.onBackground,.23):_}})),OutlinedInputInput=styled(InputBaseInput,{name:"MuiOutlinedInput",slot:"Input",overridesResolver:inputOverridesResolver})(memoTheme(({theme:o})=>({padding:"16.5px 14px",...!o.vars&&{"&:-webkit-autofill":{WebkitBoxShadow:o.palette.mode==="light"?null:"0 0 0 100px #266798 inset",WebkitTextFillColor:o.palette.mode==="light"?null:"#fff",caretColor:o.palette.mode==="light"?null:"#fff",borderRadius:"inherit"}},...o.vars&&{"&:-webkit-autofill":{borderRadius:"inherit"},[o.getColorSchemeSelector("dark")]:{"&:-webkit-autofill":{WebkitBoxShadow:"0 0 0 100px #266798 inset",WebkitTextFillColor:"#fff",caretColor:"#fff"}}},variants:[{props:{size:"small"},style:{padding:"8.5px 14px"}},{props:({ownerState:_})=>_.multiline,style:{padding:0}},{props:({ownerState:_})=>_.startAdornment,style:{paddingLeft:0}},{props:({ownerState:_})=>_.endAdornment,style:{paddingRight:0}}]}))),OutlinedInput=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiOutlinedInput"}),{components:_e={},fullWidth:et=!1,inputComponent:tt="input",label:rt,multiline:nt=!1,notched:ot,slots:it={},slotProps:st={},type:at="text",...lt}=j,ct=useUtilityClasses$o(j),ft=useFormControl(),dt=formControlState({props:j,muiFormControl:ft,states:["color","disabled","error","focused","hiddenLabel","size","required"]}),pt={...j,color:dt.color||"primary",disabled:dt.disabled,error:dt.error,focused:dt.focused,formControl:ft,fullWidth:et,hiddenLabel:dt.hiddenLabel,multiline:nt,size:dt.size,type:at},yt=it.root??_e.Root??OutlinedInputRoot,vt=it.input??_e.Input??OutlinedInputInput,[wt,Ct]=useSlot("notchedOutline",{elementType:NotchedOutlineRoot,className:ct.notchedOutline,shouldForwardComponentProp:!0,ownerState:pt,externalForwardedProps:{slots:it,slotProps:st},additionalProps:{label:rt!=null&&rt!==""&&dt.required?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[rt," ","*"]}):rt}});return jsxRuntimeExports.jsx(InputBase,{slots:{root:yt,input:vt},slotProps:st,renderSuffix:Pt=>jsxRuntimeExports.jsx(wt,{...Ct,notched:typeof ot<"u"?ot:!!(Pt.startAdornment||Pt.filled||Pt.focused)}),fullWidth:et,inputComponent:tt,multiline:nt,ref:$,type:at,...lt,classes:{...ct,notchedOutline:null}})});OutlinedInput.muiName="Input";const FirstPageIconDefault=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z"})),LastPageIconDefault=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z"}));function getSelectUtilityClasses(o){return generateUtilityClass("MuiSelect",o)}const selectClasses=generateUtilityClasses("MuiSelect",["root","select","multiple","filled","outlined","standard","disabled","focused","icon","iconOpen","iconFilled","iconOutlined","iconStandard","nativeInput","error"]);var _span;const SelectSelect=styled(StyledSelectSelect,{name:"MuiSelect",slot:"Select",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[{[`&.${selectClasses.select}`]:_.select},{[`&.${selectClasses.select}`]:_[$.variant]},{[`&.${selectClasses.error}`]:_.error},{[`&.${selectClasses.multiple}`]:_.multiple}]}})({[`&.${selectClasses.select}`]:{height:"auto",minHeight:"1.4375em",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden"}}),SelectIcon=styled(StyledSelectIcon,{name:"MuiSelect",slot:"Icon",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.icon,$.variant&&_[`icon${capitalize($.variant)}`],$.open&&_.iconOpen]}})({}),SelectNativeInput=styled("input",{shouldForwardProp:o=>slotShouldForwardProp(o)&&o!=="classes",name:"MuiSelect",slot:"NativeInput"})({bottom:0,left:0,position:"absolute",opacity:0,pointerEvents:"none",width:"100%",boxSizing:"border-box"});function areEqualValues(o,_){return typeof _=="object"&&_!==null?o===_:String(o)===String(_)}function isEmpty(o){return o==null||typeof o=="string"&&!o.trim()}const useUtilityClasses$n=o=>{const{classes:_,variant:$,disabled:j,multiple:_e,open:et,error:tt}=o,rt={select:["select",$,j&&"disabled",_e&&"multiple",tt&&"error"],icon:["icon",`icon${capitalize($)}`,et&&"iconOpen",j&&"disabled"],nativeInput:["nativeInput"]};return composeClasses(rt,getSelectUtilityClasses,_)},SelectInput=reactExports.forwardRef(function(_,$){var xr,Sr,gr,Ar;const{"aria-describedby":j,"aria-label":_e,autoFocus:et,autoWidth:tt,children:rt,className:nt,defaultOpen:ot,defaultValue:it,disabled:st,displayEmpty:at,error:lt=!1,IconComponent:ct,inputRef:ft,labelId:dt,MenuProps:pt={},multiple:yt,name:vt,onBlur:wt,onChange:Ct,onClose:Pt,onFocus:Bt,onKeyDown:At,onMouseDown:kt,onOpen:Ot,open:Tt,readOnly:ht,renderValue:bt,required:mt,SelectDisplayProps:gt={},tabIndex:xt,type:Et,value:_t,variant:$t="standard",...St}=_,[Rt,It]=useControlled({controlled:_t,default:it,name:"Select"}),[Mt,Vt]=useControlled({controlled:Tt,default:ot,name:"Select"}),Gt=reactExports.useRef(null),zt=reactExports.useRef(null),[jt,Ft]=reactExports.useState(null),{current:qt}=reactExports.useRef(Tt!=null),[Xt,Ut]=reactExports.useState(),Lt=useForkRef($,ft),Ht=reactExports.useCallback(dr=>{zt.current=dr,dr&&Ft(dr)},[]),Kt=jt==null?void 0:jt.parentNode;reactExports.useImperativeHandle(Lt,()=>({focus:()=>{zt.current.focus()},node:Gt.current,value:Rt}),[Rt]);const Jt=jt!==null&&Mt;reactExports.useEffect(()=>{if(!Jt||!Kt||tt||typeof ResizeObserver>"u")return;const dr=new ResizeObserver(()=>{Ut(Kt.clientWidth)});return dr.observe(Kt),()=>{dr.disconnect()}},[Jt,Kt,tt]),reactExports.useEffect(()=>{ot&&Mt&&jt&&!qt&&(Ut(tt?null:Kt.clientWidth),zt.current.focus())},[jt,tt]),reactExports.useEffect(()=>{et&&zt.current.focus()},[et]),reactExports.useEffect(()=>{if(!dt)return;const dr=ownerDocument(zt.current).getElementById(dt);if(dr){const yr=()=>{getSelection().isCollapsed&&zt.current.focus()};return dr.addEventListener("click",yr),()=>{dr.removeEventListener("click",yr)}}},[dt]);const tr=(dr,yr)=>{dr?Ot&&Ot(yr):Pt&&Pt(yr),qt||(Ut(tt?null:Kt.clientWidth),Vt(dr))},nr=dr=>{kt==null||kt(dr),dr.button===0&&(dr.preventDefault(),zt.current.focus(),tr(!0,dr))},ur=dr=>{tr(!1,dr)},rr=reactExports.Children.toArray(rt),pr=dr=>{const yr=rr.find(Ir=>Ir.props.value===dr.target.value);yr!==void 0&&(It(yr.props.value),Ct&&Ct(dr,yr))},fr=dr=>yr=>{let Ir;if(yr.currentTarget.hasAttribute("tabindex")){if(yt){Ir=Array.isArray(Rt)?Rt.slice():[];const Nr=Rt.indexOf(dr.props.value);Nr===-1?Ir.push(dr.props.value):Ir.splice(Nr,1)}else Ir=dr.props.value;if(dr.props.onClick&&dr.props.onClick(yr),Rt!==Ir&&(It(Ir),Ct)){const Nr=yr.nativeEvent||yr,Tr=new Nr.constructor(Nr.type,Nr);Object.defineProperty(Tr,"target",{writable:!0,value:{value:Ir,name:vt}}),Ct(Tr,dr)}yt||tr(!1,yr)}},lr=dr=>{ht||([" ","ArrowUp","ArrowDown","Enter"].includes(dr.key)&&(dr.preventDefault(),tr(!0,dr)),At==null||At(dr))},wr=dr=>{!Jt&&wt&&(Object.defineProperty(dr,"target",{writable:!0,value:{value:Rt,name:vt}}),wt(dr))};delete St["aria-invalid"];let hr,Er;const Pr=[];let br=!1;(isFilled({value:Rt})||at)&&(bt?hr=bt(Rt):br=!0);const _r=rr.map(dr=>{if(!reactExports.isValidElement(dr))return null;let yr;if(yt){if(!Array.isArray(Rt))throw new Error(formatMuiErrorMessage(2));yr=Rt.some(Ir=>areEqualValues(Ir,dr.props.value)),yr&&br&&Pr.push(dr.props.children)}else yr=areEqualValues(Rt,dr.props.value),yr&&br&&(Er=dr.props.children);return reactExports.cloneElement(dr,{"aria-selected":yr?"true":"false",onClick:fr(dr),onKeyUp:Ir=>{Ir.key===" "&&Ir.preventDefault(),dr.props.onKeyUp&&dr.props.onKeyUp(Ir)},role:"option",selected:yr,value:void 0,"data-value":dr.props.value})});br&&(yt?Pr.length===0?hr=null:hr=Pr.reduce((dr,yr,Ir)=>(dr.push(yr),Ir{const{classes:_}=o,j=composeClasses({root:["root"]},getSelectUtilityClasses,_);return{..._,...j}},styledRootConfig={name:"MuiSelect",slot:"Root",shouldForwardProp:o=>rootShouldForwardProp(o)&&o!=="variant"},StyledInput=styled(Input$1,styledRootConfig)(""),StyledOutlinedInput=styled(OutlinedInput,styledRootConfig)(""),StyledFilledInput=styled(FilledInput,styledRootConfig)(""),Select=reactExports.forwardRef(function(_,$){const j=useDefaultProps({name:"MuiSelect",props:_}),{autoWidth:_e=!1,children:et,classes:tt={},className:rt,defaultOpen:nt=!1,displayEmpty:ot=!1,IconComponent:it=ArrowDropDownIcon,id:st,input:at,inputProps:lt,label:ct,labelId:ft,MenuProps:dt,multiple:pt=!1,native:yt=!1,onClose:vt,onOpen:wt,open:Ct,renderValue:Pt,SelectDisplayProps:Bt,variant:At="outlined",...kt}=j,Ot=yt?NativeSelectInput:SelectInput,Tt=useFormControl(),ht=formControlState({props:j,muiFormControl:Tt,states:["variant","error"]}),bt=ht.variant||At,mt={...j,variant:bt,classes:tt},gt=useUtilityClasses$m(mt),{root:xt,...Et}=gt,_t=at||{standard:jsxRuntimeExports.jsx(StyledInput,{ownerState:mt}),outlined:jsxRuntimeExports.jsx(StyledOutlinedInput,{label:ct,ownerState:mt}),filled:jsxRuntimeExports.jsx(StyledFilledInput,{ownerState:mt})}[bt],$t=useForkRef($,getReactElementRef(_t));return jsxRuntimeExports.jsx(reactExports.Fragment,{children:reactExports.cloneElement(_t,{inputComponent:Ot,inputProps:{children:et,error:ht.error,IconComponent:it,variant:bt,type:void 0,multiple:pt,...yt?{id:st}:{autoWidth:_e,defaultOpen:nt,displayEmpty:ot,labelId:ft,MenuProps:dt,onClose:vt,onOpen:wt,open:Ct,renderValue:Pt,SelectDisplayProps:{id:st,...Bt}},...lt,classes:lt?deepmerge$2(Et,lt.classes):Et,...at?at.props.inputProps:{}},...(pt&&yt||ot)&&bt==="outlined"?{notched:!0}:{},ref:$t,className:clsx(_t.props.className,rt,gt.root),...!at&&{variant:bt},...kt})})});Select.muiName="Select";function getSkeletonUtilityClass(o){return generateUtilityClass("MuiSkeleton",o)}generateUtilityClasses("MuiSkeleton",["root","text","rectangular","rounded","circular","pulse","wave","withChildren","fitContent","heightAuto"]);const useUtilityClasses$l=o=>{const{classes:_,variant:$,animation:j,hasChildren:_e,width:et,height:tt}=o;return composeClasses({root:["root",$,j,_e&&"withChildren",_e&&!et&&"fitContent",_e&&!tt&&"heightAuto"]},getSkeletonUtilityClass,_)},pulseKeyframe=keyframes` - 0% { - opacity: 1; - } - - 50% { - opacity: 0.4; - } - - 100% { - opacity: 1; - } -`,waveKeyframe=keyframes` - 0% { - transform: translateX(-100%); - } - - 50% { - /* +0.5s of delay between each loop */ - transform: translateX(100%); - } - - 100% { - transform: translateX(100%); - } -`,pulseAnimation=typeof pulseKeyframe!="string"?css` - animation: ${pulseKeyframe} 2s ease-in-out 0.5s infinite; - `:null,waveAnimation=typeof waveKeyframe!="string"?css` - &::after { - animation: ${waveKeyframe} 2s linear 0.5s infinite; - } - `:null,SkeletonRoot=styled("span",{name:"MuiSkeleton",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.variant],$.animation!==!1&&_[$.animation],$.hasChildren&&_.withChildren,$.hasChildren&&!$.width&&_.fitContent,$.hasChildren&&!$.height&&_.heightAuto]}})(memoTheme(({theme:o})=>{const _=getUnit(o.shape.borderRadius)||"px",$=toUnitless(o.shape.borderRadius);return{display:"block",backgroundColor:o.vars?o.vars.palette.Skeleton.bg:o.alpha(o.palette.text.primary,o.palette.mode==="light"?.11:.13),height:"1.2em",variants:[{props:{variant:"text"},style:{marginTop:0,marginBottom:0,height:"auto",transformOrigin:"0 55%",transform:"scale(1, 0.60)",borderRadius:`${$}${_}/${Math.round($/.6*10)/10}${_}`,"&:empty:before":{content:'"\\00a0"'}}},{props:{variant:"circular"},style:{borderRadius:"50%"}},{props:{variant:"rounded"},style:{borderRadius:(o.vars||o).shape.borderRadius}},{props:({ownerState:j})=>j.hasChildren,style:{"& > *":{visibility:"hidden"}}},{props:({ownerState:j})=>j.hasChildren&&!j.width,style:{maxWidth:"fit-content"}},{props:({ownerState:j})=>j.hasChildren&&!j.height,style:{height:"auto"}},{props:{animation:"pulse"},style:pulseAnimation||{animation:`${pulseKeyframe} 2s ease-in-out 0.5s infinite`}},{props:{animation:"wave"},style:{position:"relative",overflow:"hidden",WebkitMaskImage:"-webkit-radial-gradient(white, black)","&::after":{background:`linear-gradient( - 90deg, - transparent, - ${(o.vars||o).palette.action.hover}, - transparent - )`,content:'""',position:"absolute",transform:"translateX(-100%)",bottom:0,left:0,right:0,top:0}}},{props:{animation:"wave"},style:waveAnimation||{"&::after":{animation:`${waveKeyframe} 2s linear 0.5s infinite`}}}]}})),Skeleton=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiSkeleton"}),{animation:_e="pulse",className:et,component:tt="span",height:rt,style:nt,variant:ot="text",width:it,...st}=j,at={...j,animation:_e,component:tt,variant:ot,hasChildren:!!st.children},lt=useUtilityClasses$l(at);return jsxRuntimeExports.jsx(SkeletonRoot,{as:tt,ref:$,className:clsx(lt.root,et),ownerState:at,...st,style:{width:it,height:rt,...nt}})});function getTooltipUtilityClass(o){return generateUtilityClass("MuiTooltip",o)}const tooltipClasses=generateUtilityClasses("MuiTooltip",["popper","popperInteractive","popperArrow","popperClose","tooltip","tooltipArrow","touch","tooltipPlacementLeft","tooltipPlacementRight","tooltipPlacementTop","tooltipPlacementBottom","arrow"]);function round$4(o){return Math.round(o*1e5)/1e5}const useUtilityClasses$k=o=>{const{classes:_,disableInteractive:$,arrow:j,touch:_e,placement:et}=o,tt={popper:["popper",!$&&"popperInteractive",j&&"popperArrow"],tooltip:["tooltip",j&&"tooltipArrow",_e&&"touch",`tooltipPlacement${capitalize(et.split("-")[0])}`],arrow:["arrow"]};return composeClasses(tt,getTooltipUtilityClass,_)},TooltipPopper=styled(Popper,{name:"MuiTooltip",slot:"Popper",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.popper,!$.disableInteractive&&_.popperInteractive,$.arrow&&_.popperArrow,!$.open&&_.popperClose]}})(memoTheme(({theme:o})=>({zIndex:(o.vars||o).zIndex.tooltip,pointerEvents:"none",variants:[{props:({ownerState:_})=>!_.disableInteractive,style:{pointerEvents:"auto"}},{props:({open:_})=>!_,style:{pointerEvents:"none"}},{props:({ownerState:_})=>_.arrow,style:{[`&[data-popper-placement*="bottom"] .${tooltipClasses.arrow}`]:{top:0,marginTop:"-0.71em","&::before":{transformOrigin:"0 100%"}},[`&[data-popper-placement*="top"] .${tooltipClasses.arrow}`]:{bottom:0,marginBottom:"-0.71em","&::before":{transformOrigin:"100% 0"}},[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"100% 100%"}},[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:{height:"1em",width:"0.71em","&::before":{transformOrigin:"0 0"}}}},{props:({ownerState:_})=>_.arrow&&!_.isRtl,style:{[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:{left:0,marginLeft:"-0.71em"}}},{props:({ownerState:_})=>_.arrow&&!!_.isRtl,style:{[`&[data-popper-placement*="right"] .${tooltipClasses.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:_})=>_.arrow&&!_.isRtl,style:{[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:{right:0,marginRight:"-0.71em"}}},{props:({ownerState:_})=>_.arrow&&!!_.isRtl,style:{[`&[data-popper-placement*="left"] .${tooltipClasses.arrow}`]:{left:0,marginLeft:"-0.71em"}}}]}))),TooltipTooltip=styled("div",{name:"MuiTooltip",slot:"Tooltip",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.tooltip,$.touch&&_.touch,$.arrow&&_.tooltipArrow,_[`tooltipPlacement${capitalize($.placement.split("-")[0])}`]]}})(memoTheme(({theme:o})=>({backgroundColor:o.vars?o.vars.palette.Tooltip.bg:o.alpha(o.palette.grey[700],.92),borderRadius:(o.vars||o).shape.borderRadius,color:(o.vars||o).palette.common.white,fontFamily:o.typography.fontFamily,padding:"4px 8px",fontSize:o.typography.pxToRem(11),maxWidth:300,margin:2,wordWrap:"break-word",fontWeight:o.typography.fontWeightMedium,[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{transformOrigin:"right center"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{transformOrigin:"left center"},[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:{transformOrigin:"center bottom",marginBottom:"14px"},[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:{transformOrigin:"center top",marginTop:"14px"},variants:[{props:({ownerState:_})=>_.arrow,style:{position:"relative",margin:0}},{props:({ownerState:_})=>_.touch,style:{padding:"8px 16px",fontSize:o.typography.pxToRem(14),lineHeight:`${round$4(16/14)}em`,fontWeight:o.typography.fontWeightRegular}},{props:({ownerState:_})=>!_.isRtl,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginRight:"14px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginLeft:"14px"}}},{props:({ownerState:_})=>!_.isRtl&&_.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginRight:"24px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginLeft:"24px"}}},{props:({ownerState:_})=>!!_.isRtl,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginLeft:"14px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginRight:"14px"}}},{props:({ownerState:_})=>!!_.isRtl&&_.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="left"] &`]:{marginLeft:"24px"},[`.${tooltipClasses.popper}[data-popper-placement*="right"] &`]:{marginRight:"24px"}}},{props:({ownerState:_})=>_.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="top"] &`]:{marginBottom:"24px"}}},{props:({ownerState:_})=>_.touch,style:{[`.${tooltipClasses.popper}[data-popper-placement*="bottom"] &`]:{marginTop:"24px"}}}]}))),TooltipArrow=styled("span",{name:"MuiTooltip",slot:"Arrow"})(memoTheme(({theme:o})=>({overflow:"hidden",position:"absolute",width:"1em",height:"0.71em",boxSizing:"border-box",color:o.vars?o.vars.palette.Tooltip.bg:o.alpha(o.palette.grey[700],.9),"&::before":{content:'""',margin:"auto",display:"block",width:"100%",height:"100%",backgroundColor:"currentColor",transform:"rotate(45deg)"}})));let hystersisOpen=!1;const hystersisTimer=new Timeout;let cursorPosition={x:0,y:0};function composeEventHandler(o,_){return($,...j)=>{_&&_($,...j),o($,...j)}}const Tooltip$1=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTooltip"}),{arrow:_e=!1,children:et,classes:tt,components:rt={},componentsProps:nt={},describeChild:ot=!1,disableFocusListener:it=!1,disableHoverListener:st=!1,disableInteractive:at=!1,disableTouchListener:lt=!1,enterDelay:ct=100,enterNextDelay:ft=0,enterTouchDelay:dt=700,followCursor:pt=!1,id:yt,leaveDelay:vt=0,leaveTouchDelay:wt=1500,onClose:Ct,onOpen:Pt,open:Bt,placement:At="bottom",PopperComponent:kt,PopperProps:Ot={},slotProps:Tt={},slots:ht={},title:bt,TransitionComponent:mt,TransitionProps:gt,...xt}=j,Et=reactExports.isValidElement(et)?et:jsxRuntimeExports.jsx("span",{children:et}),_t=useTheme(),$t=useRtl(),[St,Rt]=reactExports.useState(),[It,Mt]=reactExports.useState(null),Vt=reactExports.useRef(!1),Gt=at||pt,zt=useTimeout(),jt=useTimeout(),Ft=useTimeout(),qt=useTimeout(),[Xt,Ut]=useControlled({controlled:Bt,default:!1,name:"Tooltip",state:"open"});let Lt=Xt;const Ht=useId$1(yt),Kt=reactExports.useRef(),Jt=useEventCallback(()=>{Kt.current!==void 0&&(document.body.style.WebkitUserSelect=Kt.current,Kt.current=void 0),qt.clear()});reactExports.useEffect(()=>Jt,[Jt]);const tr=Zt=>{hystersisTimer.clear(),hystersisOpen=!0,Ut(!0),Pt&&!Lt&&Pt(Zt)},nr=useEventCallback(Zt=>{hystersisTimer.start(800+vt,()=>{hystersisOpen=!1}),Ut(!1),Ct&&Lt&&Ct(Zt),zt.start(_t.transitions.duration.shortest,()=>{Vt.current=!1})}),ur=Zt=>{Vt.current&&Zt.type!=="touchstart"||(St&&St.removeAttribute("title"),jt.clear(),Ft.clear(),ct||hystersisOpen&&ft?jt.start(hystersisOpen?ft:ct,()=>{tr(Zt)}):tr(Zt))},rr=Zt=>{jt.clear(),Ft.start(vt,()=>{nr(Zt)})},[,pr]=reactExports.useState(!1),fr=Zt=>{isFocusVisible(Zt.target)||(pr(!1),rr(Zt))},lr=Zt=>{St||Rt(Zt.currentTarget),isFocusVisible(Zt.target)&&(pr(!0),ur(Zt))},wr=Zt=>{Vt.current=!0;const Qt=Et.props;Qt.onTouchStart&&Qt.onTouchStart(Zt)},hr=Zt=>{wr(Zt),Ft.clear(),zt.clear(),Jt(),Kt.current=document.body.style.WebkitUserSelect,document.body.style.WebkitUserSelect="none",qt.start(dt,()=>{document.body.style.WebkitUserSelect=Kt.current,ur(Zt)})},Er=Zt=>{Et.props.onTouchEnd&&Et.props.onTouchEnd(Zt),Jt(),Ft.start(wt,()=>{nr(Zt)})};reactExports.useEffect(()=>{if(!Lt)return;function Zt(Qt){Qt.key==="Escape"&&nr(Qt)}return document.addEventListener("keydown",Zt),()=>{document.removeEventListener("keydown",Zt)}},[nr,Lt]);const Pr=useForkRef(getReactElementRef(Et),Rt,$);!bt&&bt!==0&&(Lt=!1);const br=reactExports.useRef(),_r=Zt=>{const Qt=Et.props;Qt.onMouseMove&&Qt.onMouseMove(Zt),cursorPosition={x:Zt.clientX,y:Zt.clientY},br.current&&br.current.update()},Rr={},Wt=typeof bt=="string";ot?(Rr.title=!Lt&&Wt&&!st?bt:null,Rr["aria-describedby"]=Lt?Ht:null):(Rr["aria-label"]=Wt?bt:null,Rr["aria-labelledby"]=Lt&&!Wt?Ht:null);const Nt={...Rr,...xt,...Et.props,className:clsx(xt.className,Et.props.className),onTouchStart:wr,ref:Pr,...pt?{onMouseMove:_r}:{}},Dt={};lt||(Nt.onTouchStart=hr,Nt.onTouchEnd=Er),st||(Nt.onMouseOver=composeEventHandler(ur,Nt.onMouseOver),Nt.onMouseLeave=composeEventHandler(rr,Nt.onMouseLeave),Gt||(Dt.onMouseOver=ur,Dt.onMouseLeave=rr)),it||(Nt.onFocus=composeEventHandler(lr,Nt.onFocus),Nt.onBlur=composeEventHandler(fr,Nt.onBlur),Gt||(Dt.onFocus=lr,Dt.onBlur=fr));const Yt={...j,isRtl:$t,arrow:_e,disableInteractive:Gt,placement:At,PopperComponentProp:kt,touch:Vt.current},er=typeof Tt.popper=="function"?Tt.popper(Yt):Tt.popper,ir=reactExports.useMemo(()=>{var Qt,or;let Zt=[{name:"arrow",enabled:!!It,options:{element:It,padding:4}}];return(Qt=Ot.popperOptions)!=null&&Qt.modifiers&&(Zt=Zt.concat(Ot.popperOptions.modifiers)),(or=er==null?void 0:er.popperOptions)!=null&&or.modifiers&&(Zt=Zt.concat(er.popperOptions.modifiers)),{...Ot.popperOptions,...er==null?void 0:er.popperOptions,modifiers:Zt}},[It,Ot.popperOptions,er==null?void 0:er.popperOptions]),sr=useUtilityClasses$k(Yt),xr=typeof Tt.transition=="function"?Tt.transition(Yt):Tt.transition,Sr={slots:{popper:rt.Popper,transition:rt.Transition??mt,tooltip:rt.Tooltip,arrow:rt.Arrow,...ht},slotProps:{arrow:Tt.arrow??nt.arrow,popper:{...Ot,...er??nt.popper},tooltip:Tt.tooltip??nt.tooltip,transition:{...gt,...xr??nt.transition}}},[gr,Ar]=useSlot("popper",{elementType:TooltipPopper,externalForwardedProps:Sr,ownerState:Yt,className:clsx(sr.popper,Ot==null?void 0:Ot.className)}),[dr,yr]=useSlot("transition",{elementType:Grow,externalForwardedProps:Sr,ownerState:Yt}),[Ir,Nr]=useSlot("tooltip",{elementType:TooltipTooltip,className:sr.tooltip,externalForwardedProps:Sr,ownerState:Yt}),[Tr,Dr]=useSlot("arrow",{elementType:TooltipArrow,className:sr.arrow,externalForwardedProps:Sr,ownerState:Yt,ref:Mt});return jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[reactExports.cloneElement(Et,Nt),jsxRuntimeExports.jsx(gr,{as:kt??Popper,placement:At,anchorEl:pt?{getBoundingClientRect:()=>({top:cursorPosition.y,left:cursorPosition.x,right:cursorPosition.x,bottom:cursorPosition.y,width:0,height:0})}:St,popperRef:br,open:St?Lt:!1,id:Ht,transition:!0,...Dt,...Ar,popperOptions:ir,children:({TransitionProps:Zt})=>jsxRuntimeExports.jsx(dr,{timeout:_t.transitions.duration.shorter,...Zt,...yr,children:jsxRuntimeExports.jsxs(Ir,{...Nr,children:[bt,_e?jsxRuntimeExports.jsx(Tr,{...Dr}):null]})})})]})}),Stack=createStack({createStyledComponent:styled("div",{name:"MuiStack",slot:"Root"}),useThemeProps:o=>useDefaultProps({props:o,name:"MuiStack"})}),StepperContext=reactExports.createContext({}),StepContext=reactExports.createContext({});function getStepUtilityClass(o){return generateUtilityClass("MuiStep",o)}generateUtilityClasses("MuiStep",["root","horizontal","vertical","alternativeLabel","completed"]);const useUtilityClasses$j=o=>{const{classes:_,orientation:$,alternativeLabel:j,completed:_e}=o;return composeClasses({root:["root",$,j&&"alternativeLabel",_e&&"completed"]},getStepUtilityClass,_)},StepRoot=styled("div",{name:"MuiStep",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.orientation],$.alternativeLabel&&_.alternativeLabel,$.completed&&_.completed]}})({variants:[{props:{orientation:"horizontal"},style:{paddingLeft:8,paddingRight:8}},{props:{alternativeLabel:!0},style:{flex:1,position:"relative"}}]}),Step$1=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiStep"}),{active:_e,children:et,className:tt,component:rt="div",completed:nt,disabled:ot,expanded:it=!1,index:st,last:at,...lt}=j,{activeStep:ct,connector:ft,alternativeLabel:dt,orientation:pt,nonLinear:yt}=reactExports.useContext(StepperContext);let[vt=!1,wt=!1,Ct=!1]=[_e,nt,ot];ct===st?vt=_e!==void 0?_e:!0:!yt&&ct>st?wt=nt!==void 0?nt:!0:!yt&&ct({index:st,last:at,expanded:it,icon:st+1,active:vt,completed:wt,disabled:Ct}),[st,at,it,vt,wt,Ct]),Bt={...j,active:vt,orientation:pt,alternativeLabel:dt,completed:wt,disabled:Ct,expanded:it,component:rt},At=useUtilityClasses$j(Bt),kt=jsxRuntimeExports.jsxs(StepRoot,{as:rt,className:clsx(At.root,tt),ref:$,ownerState:Bt,...lt,children:[ft&&dt&&st!==0?ft:null,et]});return jsxRuntimeExports.jsx(StepContext.Provider,{value:Pt,children:ft&&!dt&&st!==0?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[ft,kt]}):kt})}),CheckCircle$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 0a12 12 0 1 0 0 24 12 12 0 0 0 0-24zm-2 17l-5-5 1.4-1.4 3.6 3.6 7.6-7.6L19 8l-9 9z"})),Warning$1=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"}));function getStepIconUtilityClass(o){return generateUtilityClass("MuiStepIcon",o)}const stepIconClasses=generateUtilityClasses("MuiStepIcon",["root","active","completed","error","text"]);var _circle;const useUtilityClasses$i=o=>{const{classes:_,active:$,completed:j,error:_e}=o;return composeClasses({root:["root",$&&"active",j&&"completed",_e&&"error"],text:["text"]},getStepIconUtilityClass,_)},StepIconRoot=styled(SvgIcon,{name:"MuiStepIcon",slot:"Root"})(memoTheme(({theme:o})=>({display:"block",transition:o.transitions.create("color",{duration:o.transitions.duration.shortest}),color:(o.vars||o).palette.text.disabled,[`&.${stepIconClasses.completed}`]:{color:(o.vars||o).palette.primary.main},[`&.${stepIconClasses.active}`]:{color:(o.vars||o).palette.primary.main},[`&.${stepIconClasses.error}`]:{color:(o.vars||o).palette.error.main}}))),StepIconText=styled("text",{name:"MuiStepIcon",slot:"Text"})(memoTheme(({theme:o})=>({fill:(o.vars||o).palette.primary.contrastText,fontSize:o.typography.caption.fontSize,fontFamily:o.typography.fontFamily}))),StepIcon=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiStepIcon"}),{active:_e=!1,className:et,completed:tt=!1,error:rt=!1,icon:nt,...ot}=j,it={...j,active:_e,completed:tt,error:rt},st=useUtilityClasses$i(it);if(typeof nt=="number"||typeof nt=="string"){const at=clsx(et,st.root);return rt?jsxRuntimeExports.jsx(StepIconRoot,{as:Warning$1,className:at,ref:$,ownerState:it,...ot}):tt?jsxRuntimeExports.jsx(StepIconRoot,{as:CheckCircle$1,className:at,ref:$,ownerState:it,...ot}):jsxRuntimeExports.jsxs(StepIconRoot,{className:at,ref:$,ownerState:it,...ot,children:[_circle||(_circle=jsxRuntimeExports.jsx("circle",{cx:"12",cy:"12",r:"12"})),jsxRuntimeExports.jsx(StepIconText,{className:st.text,x:"12",y:"12",textAnchor:"middle",dominantBaseline:"central",ownerState:it,children:nt})]})}return nt});function getStepLabelUtilityClass(o){return generateUtilityClass("MuiStepLabel",o)}const stepLabelClasses=generateUtilityClasses("MuiStepLabel",["root","horizontal","vertical","label","active","completed","error","disabled","iconContainer","alternativeLabel","labelContainer"]),useUtilityClasses$h=o=>{const{classes:_,orientation:$,active:j,completed:_e,error:et,disabled:tt,alternativeLabel:rt}=o;return composeClasses({root:["root",$,et&&"error",tt&&"disabled",rt&&"alternativeLabel"],label:["label",j&&"active",_e&&"completed",et&&"error",tt&&"disabled",rt&&"alternativeLabel"],iconContainer:["iconContainer",j&&"active",_e&&"completed",et&&"error",tt&&"disabled",rt&&"alternativeLabel"],labelContainer:["labelContainer",rt&&"alternativeLabel"]},getStepLabelUtilityClass,_)},StepLabelRoot=styled("span",{name:"MuiStepLabel",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.orientation]]}})({display:"flex",alignItems:"center",[`&.${stepLabelClasses.alternativeLabel}`]:{flexDirection:"column"},[`&.${stepLabelClasses.disabled}`]:{cursor:"default"},variants:[{props:{orientation:"vertical"},style:{textAlign:"left",padding:"8px 0"}}]}),StepLabelLabel=styled("span",{name:"MuiStepLabel",slot:"Label"})(memoTheme(({theme:o})=>({...o.typography.body2,display:"block",transition:o.transitions.create("color",{duration:o.transitions.duration.shortest}),[`&.${stepLabelClasses.active}`]:{color:(o.vars||o).palette.text.primary,fontWeight:500},[`&.${stepLabelClasses.completed}`]:{color:(o.vars||o).palette.text.primary,fontWeight:500},[`&.${stepLabelClasses.alternativeLabel}`]:{marginTop:16},[`&.${stepLabelClasses.error}`]:{color:(o.vars||o).palette.error.main}}))),StepLabelIconContainer=styled("span",{name:"MuiStepLabel",slot:"IconContainer"})({flexShrink:0,display:"flex",paddingRight:8,[`&.${stepLabelClasses.alternativeLabel}`]:{paddingRight:0}}),StepLabelLabelContainer=styled("span",{name:"MuiStepLabel",slot:"LabelContainer"})(memoTheme(({theme:o})=>({width:"100%",color:(o.vars||o).palette.text.secondary,[`&.${stepLabelClasses.alternativeLabel}`]:{textAlign:"center"}}))),StepLabel=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiStepLabel"}),{children:_e,className:et,componentsProps:tt={},error:rt=!1,icon:nt,optional:ot,slots:it={},slotProps:st={},StepIconComponent:at,StepIconProps:lt,...ct}=j,{alternativeLabel:ft,orientation:dt}=reactExports.useContext(StepperContext),{active:pt,disabled:yt,completed:vt,icon:wt}=reactExports.useContext(StepContext),Ct=nt||wt;let Pt=at;Ct&&!Pt&&(Pt=StepIcon);const Bt={...j,active:pt,alternativeLabel:ft,completed:vt,disabled:yt,error:rt,orientation:dt},At=useUtilityClasses$h(Bt),kt={slots:it,slotProps:{stepIcon:lt,...tt,...st}},[Ot,Tt]=useSlot("root",{elementType:StepLabelRoot,externalForwardedProps:{...kt,...ct},ownerState:Bt,ref:$,className:clsx(At.root,et)}),[ht,bt]=useSlot("label",{elementType:StepLabelLabel,externalForwardedProps:kt,ownerState:Bt}),[mt,gt]=useSlot("stepIcon",{elementType:Pt,externalForwardedProps:kt,ownerState:Bt});return jsxRuntimeExports.jsxs(Ot,{...Tt,children:[Ct||mt?jsxRuntimeExports.jsx(StepLabelIconContainer,{className:At.iconContainer,ownerState:Bt,children:jsxRuntimeExports.jsx(mt,{completed:vt,active:pt,error:rt,icon:Ct,...gt})}):null,jsxRuntimeExports.jsxs(StepLabelLabelContainer,{className:At.labelContainer,ownerState:Bt,children:[_e?jsxRuntimeExports.jsx(ht,{...bt,className:clsx(At.label,bt==null?void 0:bt.className),children:_e}):null,ot]})]})});StepLabel.muiName="StepLabel";function getStepConnectorUtilityClass(o){return generateUtilityClass("MuiStepConnector",o)}generateUtilityClasses("MuiStepConnector",["root","horizontal","vertical","alternativeLabel","active","completed","disabled","line","lineHorizontal","lineVertical"]);const useUtilityClasses$g=o=>{const{classes:_,orientation:$,alternativeLabel:j,active:_e,completed:et,disabled:tt}=o,rt={root:["root",$,j&&"alternativeLabel",_e&&"active",et&&"completed",tt&&"disabled"],line:["line",`line${capitalize($)}`]};return composeClasses(rt,getStepConnectorUtilityClass,_)},StepConnectorRoot=styled("div",{name:"MuiStepConnector",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.orientation],$.alternativeLabel&&_.alternativeLabel,$.completed&&_.completed]}})({flex:"1 1 auto",variants:[{props:{orientation:"vertical"},style:{marginLeft:12}},{props:{alternativeLabel:!0},style:{position:"absolute",top:12,left:"calc(-50% + 20px)",right:"calc(50% + 20px)"}}]}),StepConnectorLine=styled("span",{name:"MuiStepConnector",slot:"Line",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.line,_[`line${capitalize($.orientation)}`]]}})(memoTheme(({theme:o})=>{const _=o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[600];return{display:"block",borderColor:o.vars?o.vars.palette.StepConnector.border:_,variants:[{props:{orientation:"horizontal"},style:{borderTopStyle:"solid",borderTopWidth:1}},{props:{orientation:"vertical"},style:{borderLeftStyle:"solid",borderLeftWidth:1,minHeight:24}}]}})),StepConnector=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiStepConnector"}),{className:_e,...et}=j,{alternativeLabel:tt,orientation:rt="horizontal"}=reactExports.useContext(StepperContext),{active:nt,disabled:ot,completed:it}=reactExports.useContext(StepContext),st={...j,alternativeLabel:tt,orientation:rt,active:nt,completed:it,disabled:ot},at=useUtilityClasses$g(st);return jsxRuntimeExports.jsx(StepConnectorRoot,{className:clsx(at.root,_e),ref:$,ownerState:st,...et,children:jsxRuntimeExports.jsx(StepConnectorLine,{className:at.line,ownerState:st})})});function getStepContentUtilityClass(o){return generateUtilityClass("MuiStepContent",o)}generateUtilityClasses("MuiStepContent",["root","last","transition"]);const useUtilityClasses$f=o=>{const{classes:_,last:$}=o;return composeClasses({root:["root",$&&"last"],transition:["transition"]},getStepContentUtilityClass,_)},StepContentRoot=styled("div",{name:"MuiStepContent",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.last&&_.last]}})(memoTheme(({theme:o})=>({marginLeft:12,paddingLeft:20,paddingRight:8,borderLeft:o.vars?`1px solid ${o.vars.palette.StepContent.border}`:`1px solid ${o.palette.mode==="light"?o.palette.grey[400]:o.palette.grey[600]}`,variants:[{props:{last:!0},style:{borderLeft:"none"}}]}))),StepContentTransition=styled(Collapse,{name:"MuiStepContent",slot:"Transition"})({}),StepContent=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiStepContent"}),{children:_e,className:et,TransitionComponent:tt=Collapse,transitionDuration:rt="auto",TransitionProps:nt,slots:ot={},slotProps:it={},...st}=j,{orientation:at}=reactExports.useContext(StepperContext),{active:lt,last:ct,expanded:ft}=reactExports.useContext(StepContext),dt={...j,last:ct},pt=useUtilityClasses$f(dt);let yt=rt;rt==="auto"&&!tt.muiSupportAuto&&(yt=void 0);const vt={slots:ot,slotProps:{transition:nt,...it}},[wt,Ct]=useSlot("transition",{elementType:StepContentTransition,externalForwardedProps:vt,ownerState:dt,className:pt.transition,additionalProps:{in:lt||ft,timeout:yt,unmountOnExit:!0}});return jsxRuntimeExports.jsx(StepContentRoot,{className:clsx(pt.root,et),ref:$,ownerState:dt,...st,children:jsxRuntimeExports.jsx(wt,{as:tt,...Ct,children:_e})})});function getStepperUtilityClass(o){return generateUtilityClass("MuiStepper",o)}generateUtilityClasses("MuiStepper",["root","horizontal","vertical","nonLinear","alternativeLabel"]);const useUtilityClasses$e=o=>{const{orientation:_,nonLinear:$,alternativeLabel:j,classes:_e}=o;return composeClasses({root:["root",_,$&&"nonLinear",j&&"alternativeLabel"]},getStepperUtilityClass,_e)},StepperRoot=styled("div",{name:"MuiStepper",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.orientation],$.alternativeLabel&&_.alternativeLabel,$.nonLinear&&_.nonLinear]}})({display:"flex",variants:[{props:{orientation:"horizontal"},style:{flexDirection:"row",alignItems:"center"}},{props:{orientation:"vertical"},style:{flexDirection:"column"}},{props:{alternativeLabel:!0},style:{alignItems:"flex-start"}}]}),defaultConnector=jsxRuntimeExports.jsx(StepConnector,{}),Stepper=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiStepper"}),{activeStep:_e=0,alternativeLabel:et=!1,children:tt,className:rt,component:nt="div",connector:ot=defaultConnector,nonLinear:it=!1,orientation:st="horizontal",...at}=j,lt={...j,nonLinear:it,alternativeLabel:et,orientation:st,component:nt},ct=useUtilityClasses$e(lt),ft=reactExports.Children.toArray(tt).filter(Boolean),dt=ft.map((yt,vt)=>reactExports.cloneElement(yt,{index:vt,last:vt+1===ft.length,...yt.props})),pt=reactExports.useMemo(()=>({activeStep:_e,alternativeLabel:et,connector:ot,nonLinear:it,orientation:st}),[_e,et,ot,it,st]);return jsxRuntimeExports.jsx(StepperContext.Provider,{value:pt,children:jsxRuntimeExports.jsx(StepperRoot,{as:nt,ownerState:lt,className:clsx(ct.root,rt),ref:$,...at,children:dt})})});function getSwitchUtilityClass(o){return generateUtilityClass("MuiSwitch",o)}const switchClasses=generateUtilityClasses("MuiSwitch",["root","edgeStart","edgeEnd","switchBase","colorPrimary","colorSecondary","sizeSmall","sizeMedium","checked","disabled","input","thumb","track"]),useUtilityClasses$d=o=>{const{classes:_,edge:$,size:j,color:_e,checked:et,disabled:tt}=o,rt={root:["root",$&&`edge${capitalize($)}`,`size${capitalize(j)}`],switchBase:["switchBase",`color${capitalize(_e)}`,et&&"checked",tt&&"disabled"],thumb:["thumb"],track:["track"],input:["input"]},nt=composeClasses(rt,getSwitchUtilityClass,_);return{..._,...nt}},SwitchRoot=styled("span",{name:"MuiSwitch",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.edge&&_[`edge${capitalize($.edge)}`],_[`size${capitalize($.size)}`]]}})({display:"inline-flex",width:34+12*2,height:14+12*2,overflow:"hidden",padding:12,boxSizing:"border-box",position:"relative",flexShrink:0,zIndex:0,verticalAlign:"middle","@media print":{colorAdjust:"exact"},variants:[{props:{edge:"start"},style:{marginLeft:-8}},{props:{edge:"end"},style:{marginRight:-8}},{props:{size:"small"},style:{width:40,height:24,padding:7,[`& .${switchClasses.thumb}`]:{width:16,height:16},[`& .${switchClasses.switchBase}`]:{padding:4,[`&.${switchClasses.checked}`]:{transform:"translateX(16px)"}}}}]}),SwitchSwitchBase=styled(SwitchBase,{name:"MuiSwitch",slot:"SwitchBase",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.switchBase,{[`& .${switchClasses.input}`]:_.input},$.color!=="default"&&_[`color${capitalize($.color)}`]]}})(memoTheme(({theme:o})=>({position:"absolute",top:0,left:0,zIndex:1,color:o.vars?o.vars.palette.Switch.defaultColor:`${o.palette.mode==="light"?o.palette.common.white:o.palette.grey[300]}`,transition:o.transitions.create(["left","transform"],{duration:o.transitions.duration.shortest}),[`&.${switchClasses.checked}`]:{transform:"translateX(20px)"},[`&.${switchClasses.disabled}`]:{color:o.vars?o.vars.palette.Switch.defaultDisabledColor:`${o.palette.mode==="light"?o.palette.grey[100]:o.palette.grey[600]}`},[`&.${switchClasses.checked} + .${switchClasses.track}`]:{opacity:.5},[`&.${switchClasses.disabled} + .${switchClasses.track}`]:{opacity:o.vars?o.vars.opacity.switchTrackDisabled:`${o.palette.mode==="light"?.12:.2}`},[`& .${switchClasses.input}`]:{left:"-100%",width:"300%"}})),memoTheme(({theme:o})=>({"&:hover":{backgroundColor:o.alpha((o.vars||o).palette.action.active,(o.vars||o).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},variants:[...Object.entries(o.palette).filter(createSimplePaletteValueFilter(["light"])).map(([_])=>({props:{color:_},style:{[`&.${switchClasses.checked}`]:{color:(o.vars||o).palette[_].main,"&:hover":{backgroundColor:o.alpha((o.vars||o).palette[_].main,(o.vars||o).palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},[`&.${switchClasses.disabled}`]:{color:o.vars?o.vars.palette.Switch[`${_}DisabledColor`]:`${o.palette.mode==="light"?o.lighten(o.palette[_].main,.62):o.darken(o.palette[_].main,.55)}`}},[`&.${switchClasses.checked} + .${switchClasses.track}`]:{backgroundColor:(o.vars||o).palette[_].main}}}))]}))),SwitchTrack=styled("span",{name:"MuiSwitch",slot:"Track"})(memoTheme(({theme:o})=>({height:"100%",width:"100%",borderRadius:14/2,zIndex:-1,transition:o.transitions.create(["opacity","background-color"],{duration:o.transitions.duration.shortest}),backgroundColor:o.vars?o.vars.palette.common.onBackground:`${o.palette.mode==="light"?o.palette.common.black:o.palette.common.white}`,opacity:o.vars?o.vars.opacity.switchTrack:`${o.palette.mode==="light"?.38:.3}`}))),SwitchThumb=styled("span",{name:"MuiSwitch",slot:"Thumb"})(memoTheme(({theme:o})=>({boxShadow:(o.vars||o).shadows[1],backgroundColor:"currentColor",width:20,height:20,borderRadius:"50%"}))),Switch=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiSwitch"}),{className:_e,color:et="primary",edge:tt=!1,size:rt="medium",sx:nt,slots:ot={},slotProps:it={},...st}=j,at={...j,color:et,edge:tt,size:rt},lt=useUtilityClasses$d(at),ct={slots:ot,slotProps:it},[ft,dt]=useSlot("root",{className:clsx(lt.root,_e),elementType:SwitchRoot,externalForwardedProps:ct,ownerState:at,additionalProps:{sx:nt}}),[pt,yt]=useSlot("thumb",{className:lt.thumb,elementType:SwitchThumb,externalForwardedProps:ct,ownerState:at}),vt=jsxRuntimeExports.jsx(pt,{...yt}),[wt,Ct]=useSlot("track",{className:lt.track,elementType:SwitchTrack,externalForwardedProps:ct,ownerState:at});return jsxRuntimeExports.jsxs(ft,{...dt,children:[jsxRuntimeExports.jsx(SwitchSwitchBase,{type:"checkbox",icon:vt,checkedIcon:vt,ref:$,ownerState:at,...st,classes:{...lt,root:lt.switchBase},slots:{...ot.switchBase&&{root:ot.switchBase},...ot.input&&{input:ot.input}},slotProps:{...it.switchBase&&{root:typeof it.switchBase=="function"?it.switchBase(at):it.switchBase},input:{role:"switch"},...it.input&&{input:typeof it.input=="function"?it.input(at):it.input}}}),jsxRuntimeExports.jsx(wt,{...Ct})]})});function getTabUtilityClass(o){return generateUtilityClass("MuiTab",o)}const tabClasses=generateUtilityClasses("MuiTab",["root","labelIcon","textColorInherit","textColorPrimary","textColorSecondary","selected","disabled","fullWidth","wrapped","iconWrapper","icon"]),useUtilityClasses$c=o=>{const{classes:_,textColor:$,fullWidth:j,wrapped:_e,icon:et,label:tt,selected:rt,disabled:nt}=o,ot={root:["root",et&&tt&&"labelIcon",`textColor${capitalize($)}`,j&&"fullWidth",_e&&"wrapped",rt&&"selected",nt&&"disabled"],icon:["iconWrapper","icon"]};return composeClasses(ot,getTabUtilityClass,_)},TabRoot=styled(ButtonBase,{name:"MuiTab",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.label&&$.icon&&_.labelIcon,_[`textColor${capitalize($.textColor)}`],$.fullWidth&&_.fullWidth,$.wrapped&&_.wrapped,{[`& .${tabClasses.iconWrapper}`]:_.iconWrapper},{[`& .${tabClasses.icon}`]:_.icon}]}})(memoTheme(({theme:o})=>({...o.typography.button,maxWidth:360,minWidth:90,position:"relative",minHeight:48,flexShrink:0,padding:"12px 16px",overflow:"hidden",whiteSpace:"normal",textAlign:"center",lineHeight:1.25,variants:[{props:({ownerState:_})=>_.label&&(_.iconPosition==="top"||_.iconPosition==="bottom"),style:{flexDirection:"column"}},{props:({ownerState:_})=>_.label&&_.iconPosition!=="top"&&_.iconPosition!=="bottom",style:{flexDirection:"row"}},{props:({ownerState:_})=>_.icon&&_.label,style:{minHeight:72,paddingTop:9,paddingBottom:9}},{props:({ownerState:_,iconPosition:$})=>_.icon&&_.label&&$==="top",style:{[`& > .${tabClasses.icon}`]:{marginBottom:6}}},{props:({ownerState:_,iconPosition:$})=>_.icon&&_.label&&$==="bottom",style:{[`& > .${tabClasses.icon}`]:{marginTop:6}}},{props:({ownerState:_,iconPosition:$})=>_.icon&&_.label&&$==="start",style:{[`& > .${tabClasses.icon}`]:{marginRight:o.spacing(1)}}},{props:({ownerState:_,iconPosition:$})=>_.icon&&_.label&&$==="end",style:{[`& > .${tabClasses.icon}`]:{marginLeft:o.spacing(1)}}},{props:{textColor:"inherit"},style:{color:"inherit",opacity:.6,[`&.${tabClasses.selected}`]:{opacity:1},[`&.${tabClasses.disabled}`]:{opacity:(o.vars||o).palette.action.disabledOpacity}}},{props:{textColor:"primary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${tabClasses.selected}`]:{color:(o.vars||o).palette.primary.main},[`&.${tabClasses.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:{textColor:"secondary"},style:{color:(o.vars||o).palette.text.secondary,[`&.${tabClasses.selected}`]:{color:(o.vars||o).palette.secondary.main},[`&.${tabClasses.disabled}`]:{color:(o.vars||o).palette.text.disabled}}},{props:({ownerState:_})=>_.fullWidth,style:{flexShrink:1,flexGrow:1,flexBasis:0,maxWidth:"none"}},{props:({ownerState:_})=>_.wrapped,style:{fontSize:o.typography.pxToRem(12)}}]}))),Tab=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTab"}),{className:_e,disabled:et=!1,disableFocusRipple:tt=!1,fullWidth:rt,icon:nt,iconPosition:ot="top",indicator:it,label:st,onChange:at,onClick:lt,onFocus:ct,selected:ft,selectionFollowsFocus:dt,textColor:pt="inherit",value:yt,wrapped:vt=!1,...wt}=j,Ct={...j,disabled:et,disableFocusRipple:tt,selected:ft,icon:!!nt,iconPosition:ot,label:!!st,fullWidth:rt,textColor:pt,wrapped:vt},Pt=useUtilityClasses$c(Ct),Bt=nt&&st&&reactExports.isValidElement(nt)?reactExports.cloneElement(nt,{className:clsx(Pt.icon,nt.props.className)}):nt,At=Ot=>{!ft&&at&&at(Ot,yt),lt&<(Ot)},kt=Ot=>{dt&&!ft&&at&&at(Ot,yt),ct&&ct(Ot)};return jsxRuntimeExports.jsxs(TabRoot,{focusRipple:!tt,className:clsx(Pt.root,_e),ref:$,role:"tab","aria-selected":ft,disabled:et,onClick:At,onFocus:kt,ownerState:Ct,tabIndex:ft?0:-1,...wt,children:[ot==="top"||ot==="start"?jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[Bt,st]}):jsxRuntimeExports.jsxs(reactExports.Fragment,{children:[st,Bt]}),it]})}),TableContext=reactExports.createContext();function getTableUtilityClass(o){return generateUtilityClass("MuiTable",o)}generateUtilityClasses("MuiTable",["root","stickyHeader"]);const useUtilityClasses$b=o=>{const{classes:_,stickyHeader:$}=o;return composeClasses({root:["root",$&&"stickyHeader"]},getTableUtilityClass,_)},TableRoot=styled("table",{name:"MuiTable",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.stickyHeader&&_.stickyHeader]}})(memoTheme(({theme:o})=>({display:"table",width:"100%",borderCollapse:"collapse",borderSpacing:0,"& caption":{...o.typography.body2,padding:o.spacing(2),color:(o.vars||o).palette.text.secondary,textAlign:"left",captionSide:"bottom"},variants:[{props:({ownerState:_})=>_.stickyHeader,style:{borderCollapse:"separate"}}]}))),defaultComponent$3="table",Table=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTable"}),{className:_e,component:et=defaultComponent$3,padding:tt="normal",size:rt="medium",stickyHeader:nt=!1,...ot}=j,it={...j,component:et,padding:tt,size:rt,stickyHeader:nt},st=useUtilityClasses$b(it),at=reactExports.useMemo(()=>({padding:tt,size:rt,stickyHeader:nt}),[tt,rt,nt]);return jsxRuntimeExports.jsx(TableContext.Provider,{value:at,children:jsxRuntimeExports.jsx(TableRoot,{as:et,role:et===defaultComponent$3?null:"table",ref:$,className:clsx(st.root,_e),ownerState:it,...ot})})}),Tablelvl2Context=reactExports.createContext();function getTableBodyUtilityClass(o){return generateUtilityClass("MuiTableBody",o)}generateUtilityClasses("MuiTableBody",["root"]);const useUtilityClasses$a=o=>{const{classes:_}=o;return composeClasses({root:["root"]},getTableBodyUtilityClass,_)},TableBodyRoot=styled("tbody",{name:"MuiTableBody",slot:"Root"})({display:"table-row-group"}),tablelvl2$1={variant:"body"},defaultComponent$2="tbody",TableBody=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTableBody"}),{className:_e,component:et=defaultComponent$2,...tt}=j,rt={...j,component:et},nt=useUtilityClasses$a(rt);return jsxRuntimeExports.jsx(Tablelvl2Context.Provider,{value:tablelvl2$1,children:jsxRuntimeExports.jsx(TableBodyRoot,{className:clsx(nt.root,_e),as:et,ref:$,role:et===defaultComponent$2?null:"rowgroup",ownerState:rt,...tt})})});function getTableCellUtilityClass(o){return generateUtilityClass("MuiTableCell",o)}const tableCellClasses=generateUtilityClasses("MuiTableCell",["root","head","body","footer","sizeSmall","sizeMedium","paddingCheckbox","paddingNone","alignLeft","alignCenter","alignRight","alignJustify","stickyHeader"]),useUtilityClasses$9=o=>{const{classes:_,variant:$,align:j,padding:_e,size:et,stickyHeader:tt}=o,rt={root:["root",$,tt&&"stickyHeader",j!=="inherit"&&`align${capitalize(j)}`,_e!=="normal"&&`padding${capitalize(_e)}`,`size${capitalize(et)}`]};return composeClasses(rt,getTableCellUtilityClass,_)},TableCellRoot=styled("td",{name:"MuiTableCell",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,_[$.variant],_[`size${capitalize($.size)}`],$.padding!=="normal"&&_[`padding${capitalize($.padding)}`],$.align!=="inherit"&&_[`align${capitalize($.align)}`],$.stickyHeader&&_.stickyHeader]}})(memoTheme(({theme:o})=>({...o.typography.body2,display:"table-cell",verticalAlign:"inherit",borderBottom:o.vars?`1px solid ${o.vars.palette.TableCell.border}`:`1px solid - ${o.palette.mode==="light"?o.lighten(o.alpha(o.palette.divider,1),.88):o.darken(o.alpha(o.palette.divider,1),.68)}`,textAlign:"left",padding:16,variants:[{props:{variant:"head"},style:{color:(o.vars||o).palette.text.primary,lineHeight:o.typography.pxToRem(24),fontWeight:o.typography.fontWeightMedium}},{props:{variant:"body"},style:{color:(o.vars||o).palette.text.primary}},{props:{variant:"footer"},style:{color:(o.vars||o).palette.text.secondary,lineHeight:o.typography.pxToRem(21),fontSize:o.typography.pxToRem(12)}},{props:{size:"small"},style:{padding:"6px 16px",[`&.${tableCellClasses.paddingCheckbox}`]:{width:24,padding:"0 12px 0 16px","& > *":{padding:0}}}},{props:{padding:"checkbox"},style:{width:48,padding:"0 0 0 4px"}},{props:{padding:"none"},style:{padding:0}},{props:{align:"left"},style:{textAlign:"left"}},{props:{align:"center"},style:{textAlign:"center"}},{props:{align:"right"},style:{textAlign:"right",flexDirection:"row-reverse"}},{props:{align:"justify"},style:{textAlign:"justify"}},{props:({ownerState:_})=>_.stickyHeader,style:{position:"sticky",top:0,zIndex:2,backgroundColor:(o.vars||o).palette.background.default}}]}))),TableCell=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTableCell"}),{align:_e="inherit",className:et,component:tt,padding:rt,scope:nt,size:ot,sortDirection:it,variant:st,...at}=j,lt=reactExports.useContext(TableContext),ct=reactExports.useContext(Tablelvl2Context),ft=ct&&ct.variant==="head";let dt;tt?dt=tt:dt=ft?"th":"td";let pt=nt;dt==="td"?pt=void 0:!pt&&ft&&(pt="col");const yt=st||ct&&ct.variant,vt={...j,align:_e,component:dt,padding:rt||(lt&<.padding?lt.padding:"normal"),size:ot||(lt&<.size?lt.size:"medium"),sortDirection:it,stickyHeader:yt==="head"&<&<.stickyHeader,variant:yt},wt=useUtilityClasses$9(vt);let Ct=null;return it&&(Ct=it==="asc"?"ascending":"descending"),jsxRuntimeExports.jsx(TableCellRoot,{as:dt,ref:$,className:clsx(wt.root,et),"aria-sort":Ct,scope:pt,ownerState:vt,...at})});function getTableContainerUtilityClass(o){return generateUtilityClass("MuiTableContainer",o)}generateUtilityClasses("MuiTableContainer",["root"]);const useUtilityClasses$8=o=>{const{classes:_}=o;return composeClasses({root:["root"]},getTableContainerUtilityClass,_)},TableContainerRoot=styled("div",{name:"MuiTableContainer",slot:"Root"})({width:"100%",overflowX:"auto"}),TableContainer=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTableContainer"}),{className:_e,component:et="div",...tt}=j,rt={...j,component:et},nt=useUtilityClasses$8(rt);return jsxRuntimeExports.jsx(TableContainerRoot,{ref:$,as:et,className:clsx(nt.root,_e),ownerState:rt,...tt})});function getTableHeadUtilityClass(o){return generateUtilityClass("MuiTableHead",o)}generateUtilityClasses("MuiTableHead",["root"]);const useUtilityClasses$7=o=>{const{classes:_}=o;return composeClasses({root:["root"]},getTableHeadUtilityClass,_)},TableHeadRoot=styled("thead",{name:"MuiTableHead",slot:"Root"})({display:"table-header-group"}),tablelvl2={variant:"head"},defaultComponent$1="thead",TableHead=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTableHead"}),{className:_e,component:et=defaultComponent$1,...tt}=j,rt={...j,component:et},nt=useUtilityClasses$7(rt);return jsxRuntimeExports.jsx(Tablelvl2Context.Provider,{value:tablelvl2,children:jsxRuntimeExports.jsx(TableHeadRoot,{as:et,className:clsx(nt.root,_e),ref:$,role:et===defaultComponent$1?null:"rowgroup",ownerState:rt,...tt})})});function getToolbarUtilityClass(o){return generateUtilityClass("MuiToolbar",o)}generateUtilityClasses("MuiToolbar",["root","gutters","regular","dense"]);const useUtilityClasses$6=o=>{const{classes:_,disableGutters:$,variant:j}=o;return composeClasses({root:["root",!$&&"gutters",j]},getToolbarUtilityClass,_)},ToolbarRoot=styled("div",{name:"MuiToolbar",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,!$.disableGutters&&_.gutters,_[$.variant]]}})(memoTheme(({theme:o})=>({position:"relative",display:"flex",alignItems:"center",variants:[{props:({ownerState:_})=>!_.disableGutters,style:{paddingLeft:o.spacing(2),paddingRight:o.spacing(2),[o.breakpoints.up("sm")]:{paddingLeft:o.spacing(3),paddingRight:o.spacing(3)}}},{props:{variant:"dense"},style:{minHeight:48}},{props:{variant:"regular"},style:o.mixins.toolbar}]}))),Toolbar=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiToolbar"}),{className:_e,component:et="div",disableGutters:tt=!1,variant:rt="regular",...nt}=j,ot={...j,component:et,disableGutters:tt,variant:rt},it=useUtilityClasses$6(ot);return jsxRuntimeExports.jsx(ToolbarRoot,{as:et,className:clsx(it.root,_e),ref:$,ownerState:ot,...nt})}),KeyboardArrowLeft=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z"})),KeyboardArrowRight=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z"}));function getTablePaginationActionsUtilityClass(o){return generateUtilityClass("MuiTablePaginationActions",o)}generateUtilityClasses("MuiTablePaginationActions",["root"]);const useUtilityClasses$5=o=>{const{classes:_}=o;return composeClasses({root:["root"]},getTablePaginationActionsUtilityClass,_)},TablePaginationActionsRoot=styled("div",{name:"MuiTablePaginationActions",slot:"Root"})({}),TablePaginationActions=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTablePaginationActions"}),{backIconButtonProps:_e,className:et,count:tt,disabled:rt=!1,getItemAriaLabel:nt,nextIconButtonProps:ot,onPageChange:it,page:st,rowsPerPage:at,showFirstButton:lt,showLastButton:ct,slots:ft={},slotProps:dt={},...pt}=j,yt=useRtl(),wt=useUtilityClasses$5(j),Ct=Gt=>{it(Gt,0)},Pt=Gt=>{it(Gt,st-1)},Bt=Gt=>{it(Gt,st+1)},At=Gt=>{it(Gt,Math.max(0,Math.ceil(tt/at)-1))},kt=ft.firstButton??IconButton,Ot=ft.lastButton??IconButton,Tt=ft.nextButton??IconButton,ht=ft.previousButton??IconButton,bt=ft.firstButtonIcon??FirstPageIconDefault,mt=ft.lastButtonIcon??LastPageIconDefault,gt=ft.nextButtonIcon??KeyboardArrowRight,xt=ft.previousButtonIcon??KeyboardArrowLeft,Et=yt?Ot:kt,_t=yt?Tt:ht,$t=yt?ht:Tt,St=yt?kt:Ot,Rt=yt?dt.lastButton:dt.firstButton,It=yt?dt.nextButton:dt.previousButton,Mt=yt?dt.previousButton:dt.nextButton,Vt=yt?dt.firstButton:dt.lastButton;return jsxRuntimeExports.jsxs(TablePaginationActionsRoot,{ref:$,className:clsx(wt.root,et),...pt,children:[lt&&jsxRuntimeExports.jsx(Et,{onClick:Ct,disabled:rt||st===0,"aria-label":nt("first",st),title:nt("first",st),...Rt,children:yt?jsxRuntimeExports.jsx(mt,{...dt.lastButtonIcon}):jsxRuntimeExports.jsx(bt,{...dt.firstButtonIcon})}),jsxRuntimeExports.jsx(_t,{onClick:Pt,disabled:rt||st===0,color:"inherit","aria-label":nt("previous",st),title:nt("previous",st),...It??_e,children:yt?jsxRuntimeExports.jsx(gt,{...dt.nextButtonIcon}):jsxRuntimeExports.jsx(xt,{...dt.previousButtonIcon})}),jsxRuntimeExports.jsx($t,{onClick:Bt,disabled:rt||(tt!==-1?st>=Math.ceil(tt/at)-1:!1),color:"inherit","aria-label":nt("next",st),title:nt("next",st),...Mt??ot,children:yt?jsxRuntimeExports.jsx(xt,{...dt.previousButtonIcon}):jsxRuntimeExports.jsx(gt,{...dt.nextButtonIcon})}),ct&&jsxRuntimeExports.jsx(St,{onClick:At,disabled:rt||st>=Math.ceil(tt/at)-1,"aria-label":nt("last",st),title:nt("last",st),...Vt,children:yt?jsxRuntimeExports.jsx(bt,{...dt.firstButtonIcon}):jsxRuntimeExports.jsx(mt,{...dt.lastButtonIcon})})]})});function getTablePaginationUtilityClass(o){return generateUtilityClass("MuiTablePagination",o)}const tablePaginationClasses=generateUtilityClasses("MuiTablePagination",["root","toolbar","spacer","selectLabel","selectRoot","select","selectIcon","input","menuItem","displayedRows","actions"]);var _InputBase;const TablePaginationRoot=styled(TableCell,{name:"MuiTablePagination",slot:"Root"})(memoTheme(({theme:o})=>({overflow:"auto",color:(o.vars||o).palette.text.primary,fontSize:o.typography.pxToRem(14),"&:last-child":{padding:0}}))),TablePaginationToolbar=styled(Toolbar,{name:"MuiTablePagination",slot:"Toolbar",overridesResolver:(o,_)=>({[`& .${tablePaginationClasses.actions}`]:_.actions,..._.toolbar})})(memoTheme(({theme:o})=>({minHeight:52,paddingRight:2,[`${o.breakpoints.up("xs")} and (orientation: landscape)`]:{minHeight:52},[o.breakpoints.up("sm")]:{minHeight:52,paddingRight:2},[`& .${tablePaginationClasses.actions}`]:{flexShrink:0,marginLeft:20}}))),TablePaginationSpacer=styled("div",{name:"MuiTablePagination",slot:"Spacer"})({flex:"1 1 100%"}),TablePaginationSelectLabel=styled("p",{name:"MuiTablePagination",slot:"SelectLabel"})(memoTheme(({theme:o})=>({...o.typography.body2,flexShrink:0}))),TablePaginationSelect=styled(Select,{name:"MuiTablePagination",slot:"Select",overridesResolver:(o,_)=>({[`& .${tablePaginationClasses.selectIcon}`]:_.selectIcon,[`& .${tablePaginationClasses.select}`]:_.select,..._.input,..._.selectRoot})})({color:"inherit",fontSize:"inherit",flexShrink:0,marginRight:32,marginLeft:8,[`& .${tablePaginationClasses.select}`]:{paddingLeft:8,paddingRight:24,textAlign:"right",textAlignLast:"right"}}),TablePaginationMenuItem=styled(MenuItem,{name:"MuiTablePagination",slot:"MenuItem"})({}),TablePaginationDisplayedRows=styled("p",{name:"MuiTablePagination",slot:"DisplayedRows"})(memoTheme(({theme:o})=>({...o.typography.body2,flexShrink:0})));function defaultLabelDisplayedRows({from:o,to:_,count:$}){return`${o}–${_} of ${$!==-1?$:`more than ${_}`}`}function defaultGetAriaLabel(o){return`Go to ${o} page`}const useUtilityClasses$4=o=>{const{classes:_}=o;return composeClasses({root:["root"],toolbar:["toolbar"],spacer:["spacer"],selectLabel:["selectLabel"],select:["select"],input:["input"],selectIcon:["selectIcon"],menuItem:["menuItem"],displayedRows:["displayedRows"],actions:["actions"]},getTablePaginationUtilityClass,_)},TablePagination=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTablePagination"}),{ActionsComponent:_e=TablePaginationActions,backIconButtonProps:et,colSpan:tt,component:rt=TableCell,count:nt,disabled:ot=!1,getItemAriaLabel:it=defaultGetAriaLabel,labelDisplayedRows:st=defaultLabelDisplayedRows,labelRowsPerPage:at="Rows per page:",nextIconButtonProps:lt,onPageChange:ct,onRowsPerPageChange:ft,page:dt,rowsPerPage:pt,rowsPerPageOptions:yt=[10,25,50,100],SelectProps:vt={},showFirstButton:wt=!1,showLastButton:Ct=!1,slotProps:Pt={},slots:Bt={},...At}=j,kt=j,Ot=useUtilityClasses$4(kt),Tt=(Pt==null?void 0:Pt.select)??vt,ht=Tt.native?"option":TablePaginationMenuItem;let bt;(rt===TableCell||rt==="td")&&(bt=tt||1e3);const mt=useId$1(Tt.id),gt=useId$1(Tt.labelId),xt=()=>nt===-1?(dt+1)*pt:pt===-1?nt:Math.min(nt,(dt+1)*pt),Et={slots:Bt,slotProps:Pt},[_t,$t]=useSlot("root",{ref:$,className:Ot.root,elementType:TablePaginationRoot,externalForwardedProps:{...Et,component:rt,...At},ownerState:kt,additionalProps:{colSpan:bt}}),[St,Rt]=useSlot("toolbar",{className:Ot.toolbar,elementType:TablePaginationToolbar,externalForwardedProps:Et,ownerState:kt}),[It,Mt]=useSlot("spacer",{className:Ot.spacer,elementType:TablePaginationSpacer,externalForwardedProps:Et,ownerState:kt}),[Vt,Gt]=useSlot("selectLabel",{className:Ot.selectLabel,elementType:TablePaginationSelectLabel,externalForwardedProps:Et,ownerState:kt,additionalProps:{id:gt}}),[zt,jt]=useSlot("select",{className:Ot.select,elementType:TablePaginationSelect,externalForwardedProps:Et,ownerState:kt}),[Ft,qt]=useSlot("menuItem",{className:Ot.menuItem,elementType:ht,externalForwardedProps:Et,ownerState:kt}),[Xt,Ut]=useSlot("displayedRows",{className:Ot.displayedRows,elementType:TablePaginationDisplayedRows,externalForwardedProps:Et,ownerState:kt});return jsxRuntimeExports.jsx(_t,{...$t,children:jsxRuntimeExports.jsxs(St,{...Rt,children:[jsxRuntimeExports.jsx(It,{...Mt}),yt.length>1&&jsxRuntimeExports.jsx(Vt,{...Gt,children:at}),yt.length>1&&jsxRuntimeExports.jsx(zt,{variant:"standard",...!Tt.variant&&{input:_InputBase||(_InputBase=jsxRuntimeExports.jsx(InputBase,{}))},value:pt,onChange:ft,id:mt,labelId:gt,...Tt,classes:{...Tt.classes,root:clsx(Ot.input,Ot.selectRoot,(Tt.classes||{}).root),select:clsx(Ot.select,(Tt.classes||{}).select),icon:clsx(Ot.selectIcon,(Tt.classes||{}).icon)},disabled:ot,...jt,children:yt.map(Lt=>reactExports.createElement(Ft,{...qt,key:Lt.label?Lt.label:Lt,value:Lt.value?Lt.value:Lt},Lt.label?Lt.label:Lt))}),jsxRuntimeExports.jsx(Xt,{...Ut,children:st({from:nt===0?0:dt*pt+1,to:xt(),count:nt===-1?-1:nt,page:dt})}),jsxRuntimeExports.jsx(_e,{className:Ot.actions,backIconButtonProps:et,count:nt,nextIconButtonProps:lt,onPageChange:ct,page:dt,rowsPerPage:pt,showFirstButton:wt,showLastButton:Ct,slotProps:Pt.actions,slots:Bt.actions,getItemAriaLabel:it,disabled:ot})]})})});function getTableRowUtilityClass(o){return generateUtilityClass("MuiTableRow",o)}const tableRowClasses=generateUtilityClasses("MuiTableRow",["root","selected","hover","head","footer"]),useUtilityClasses$3=o=>{const{classes:_,selected:$,hover:j,head:_e,footer:et}=o;return composeClasses({root:["root",$&&"selected",j&&"hover",_e&&"head",et&&"footer"]},getTableRowUtilityClass,_)},TableRowRoot=styled("tr",{name:"MuiTableRow",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.head&&_.head,$.footer&&_.footer]}})(memoTheme(({theme:o})=>({color:"inherit",display:"table-row",verticalAlign:"middle",outline:0,[`&.${tableRowClasses.hover}:hover`]:{backgroundColor:(o.vars||o).palette.action.hover},[`&.${tableRowClasses.selected}`]:{backgroundColor:o.alpha((o.vars||o).palette.primary.main,(o.vars||o).palette.action.selectedOpacity),"&:hover":{backgroundColor:o.alpha((o.vars||o).palette.primary.main,`${(o.vars||o).palette.action.selectedOpacity} + ${(o.vars||o).palette.action.hoverOpacity}`)}}}))),defaultComponent="tr",TableRow=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTableRow"}),{className:_e,component:et=defaultComponent,hover:tt=!1,selected:rt=!1,...nt}=j,ot=reactExports.useContext(Tablelvl2Context),it={...j,component:et,hover:tt,selected:rt,head:ot&&ot.variant==="head",footer:ot&&ot.variant==="footer"},st=useUtilityClasses$3(it);return jsxRuntimeExports.jsx(TableRowRoot,{as:et,ref:$,className:clsx(st.root,_e),role:et===defaultComponent?null:"row",ownerState:it,...nt})});function easeInOutSin(o){return(1+Math.sin(Math.PI*o-Math.PI/2))/2}function animate(o,_,$,j={},_e=()=>{}){const{ease:et=easeInOutSin,duration:tt=300}=j;let rt=null;const nt=_[o];let ot=!1;const it=()=>{ot=!0},st=at=>{if(ot){_e(new Error("Animation cancelled"));return}rt===null&&(rt=at);const lt=Math.min(1,(at-rt)/tt);if(_[o]=et(lt)*($-nt)+nt,lt>=1){requestAnimationFrame(()=>{_e(null)});return}requestAnimationFrame(st)};return nt===$?(_e(new Error("Element already at target position")),it):(requestAnimationFrame(st),it)}const styles={width:99,height:99,position:"absolute",top:-9999,overflow:"scroll"};function ScrollbarSize(o){const{onChange:_,...$}=o,j=reactExports.useRef(),_e=reactExports.useRef(null),et=()=>{j.current=_e.current.offsetHeight-_e.current.clientHeight};return useEnhancedEffect(()=>{const tt=debounce$3(()=>{const nt=j.current;et(),nt!==j.current&&_(j.current)}),rt=ownerWindow(_e.current);return rt.addEventListener("resize",tt),()=>{tt.clear(),rt.removeEventListener("resize",tt)}},[_]),reactExports.useEffect(()=>{et(),_(j.current)},[_]),jsxRuntimeExports.jsx("div",{style:styles,...$,ref:_e})}function getTabScrollButtonUtilityClass(o){return generateUtilityClass("MuiTabScrollButton",o)}const tabScrollButtonClasses=generateUtilityClasses("MuiTabScrollButton",["root","vertical","horizontal","disabled"]),useUtilityClasses$2=o=>{const{classes:_,orientation:$,disabled:j}=o;return composeClasses({root:["root",$,j&&"disabled"]},getTabScrollButtonUtilityClass,_)},TabScrollButtonRoot=styled(ButtonBase,{name:"MuiTabScrollButton",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.root,$.orientation&&_[$.orientation]]}})({width:40,flexShrink:0,opacity:.8,[`&.${tabScrollButtonClasses.disabled}`]:{opacity:0},variants:[{props:{orientation:"vertical"},style:{width:"100%",height:40,"& svg":{transform:"var(--TabScrollButton-svgRotate)"}}}]}),TabScrollButton=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTabScrollButton"}),{className:_e,slots:et={},slotProps:tt={},direction:rt,orientation:nt,disabled:ot,...it}=j,st=useRtl(),at={isRtl:st,...j},lt=useUtilityClasses$2(at),ct=et.StartScrollButtonIcon??KeyboardArrowLeft,ft=et.EndScrollButtonIcon??KeyboardArrowRight,dt=useSlotProps({elementType:ct,externalSlotProps:tt.startScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:at}),pt=useSlotProps({elementType:ft,externalSlotProps:tt.endScrollButtonIcon,additionalProps:{fontSize:"small"},ownerState:at});return jsxRuntimeExports.jsx(TabScrollButtonRoot,{component:"div",className:clsx(lt.root,_e),ref:$,role:null,ownerState:at,tabIndex:null,...it,style:{...it.style,...nt==="vertical"&&{"--TabScrollButton-svgRotate":`rotate(${st?-90:90}deg)`}},children:rt==="left"?jsxRuntimeExports.jsx(ct,{...dt}):jsxRuntimeExports.jsx(ft,{...pt})})});function getTabsUtilityClass(o){return generateUtilityClass("MuiTabs",o)}const tabsClasses=generateUtilityClasses("MuiTabs",["root","vertical","list","flexContainer","flexContainerVertical","centered","scroller","fixed","scrollableX","scrollableY","hideScrollbar","scrollButtons","scrollButtonsHideMobile","indicator"]),nextItem=(o,_)=>o===_?o.firstChild:_&&_.nextElementSibling?_.nextElementSibling:o.firstChild,previousItem=(o,_)=>o===_?o.lastChild:_&&_.previousElementSibling?_.previousElementSibling:o.lastChild,moveFocus=(o,_,$)=>{let j=!1,_e=$(o,_);for(;_e;){if(_e===o.firstChild){if(j)return;j=!0}const et=_e.disabled||_e.getAttribute("aria-disabled")==="true";if(!_e.hasAttribute("tabindex")||et)_e=$(o,_e);else{_e.focus();return}}},useUtilityClasses$1=o=>{const{vertical:_,fixed:$,hideScrollbar:j,scrollableX:_e,scrollableY:et,centered:tt,scrollButtonsHideMobile:rt,classes:nt}=o;return composeClasses({root:["root",_&&"vertical"],scroller:["scroller",$&&"fixed",j&&"hideScrollbar",_e&&"scrollableX",et&&"scrollableY"],list:["list","flexContainer",_&&"flexContainerVertical",_&&"vertical",tt&&"centered"],indicator:["indicator"],scrollButtons:["scrollButtons",rt&&"scrollButtonsHideMobile"],scrollableX:[_e&&"scrollableX"],hideScrollbar:[j&&"hideScrollbar"]},getTabsUtilityClass,nt)},TabsRoot=styled("div",{name:"MuiTabs",slot:"Root",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[{[`& .${tabsClasses.scrollButtons}`]:_.scrollButtons},{[`& .${tabsClasses.scrollButtons}`]:$.scrollButtonsHideMobile&&_.scrollButtonsHideMobile},_.root,$.vertical&&_.vertical]}})(memoTheme(({theme:o})=>({overflow:"hidden",minHeight:48,WebkitOverflowScrolling:"touch",display:"flex",variants:[{props:({ownerState:_})=>_.vertical,style:{flexDirection:"column"}},{props:({ownerState:_})=>_.scrollButtonsHideMobile,style:{[`& .${tabsClasses.scrollButtons}`]:{[o.breakpoints.down("sm")]:{display:"none"}}}}]}))),TabsScroller=styled("div",{name:"MuiTabs",slot:"Scroller",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.scroller,$.fixed&&_.fixed,$.hideScrollbar&&_.hideScrollbar,$.scrollableX&&_.scrollableX,$.scrollableY&&_.scrollableY]}})({position:"relative",display:"inline-block",flex:"1 1 auto",whiteSpace:"nowrap",variants:[{props:({ownerState:o})=>o.fixed,style:{overflowX:"hidden",width:"100%"}},{props:({ownerState:o})=>o.hideScrollbar,style:{scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}},{props:({ownerState:o})=>o.scrollableX,style:{overflowX:"auto",overflowY:"hidden"}},{props:({ownerState:o})=>o.scrollableY,style:{overflowY:"auto",overflowX:"hidden"}}]}),List$1=styled("div",{name:"MuiTabs",slot:"List",overridesResolver:(o,_)=>{const{ownerState:$}=o;return[_.list,_.flexContainer,$.vertical&&_.flexContainerVertical,$.centered&&_.centered]}})({display:"flex",variants:[{props:({ownerState:o})=>o.vertical,style:{flexDirection:"column"}},{props:({ownerState:o})=>o.centered,style:{justifyContent:"center"}}]}),TabsIndicator=styled("span",{name:"MuiTabs",slot:"Indicator"})(memoTheme(({theme:o})=>({position:"absolute",height:2,bottom:0,width:"100%",transition:o.transitions.create(),variants:[{props:{indicatorColor:"primary"},style:{backgroundColor:(o.vars||o).palette.primary.main}},{props:{indicatorColor:"secondary"},style:{backgroundColor:(o.vars||o).palette.secondary.main}},{props:({ownerState:_})=>_.vertical,style:{height:"100%",width:2,right:0}}]}))),TabsScrollbarSize=styled(ScrollbarSize)({overflowX:"auto",overflowY:"hidden",scrollbarWidth:"none","&::-webkit-scrollbar":{display:"none"}}),defaultIndicatorStyle={},Tabs=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTabs"}),_e=useTheme(),et=useRtl(),{"aria-label":tt,"aria-labelledby":rt,action:nt,centered:ot=!1,children:it,className:st,component:at="div",allowScrollButtonsMobile:lt=!1,indicatorColor:ct="primary",onChange:ft,orientation:dt="horizontal",ScrollButtonComponent:pt,scrollButtons:yt="auto",selectionFollowsFocus:vt,slots:wt={},slotProps:Ct={},TabIndicatorProps:Pt={},TabScrollButtonProps:Bt={},textColor:At="primary",value:kt,variant:Ot="standard",visibleScrollbar:Tt=!1,...ht}=j,bt=Ot==="scrollable",mt=dt==="vertical",gt=mt?"scrollTop":"scrollLeft",xt=mt?"top":"left",Et=mt?"bottom":"right",_t=mt?"clientHeight":"clientWidth",$t=mt?"height":"width",St={...j,component:at,allowScrollButtonsMobile:lt,indicatorColor:ct,orientation:dt,vertical:mt,scrollButtons:yt,textColor:At,variant:Ot,visibleScrollbar:Tt,fixed:!bt,hideScrollbar:bt&&!Tt,scrollableX:bt&&!mt,scrollableY:bt&&mt,centered:ot&&!bt,scrollButtonsHideMobile:!lt},Rt=useUtilityClasses$1(St),It=useSlotProps({elementType:wt.StartScrollButtonIcon,externalSlotProps:Ct.startScrollButtonIcon,ownerState:St}),Mt=useSlotProps({elementType:wt.EndScrollButtonIcon,externalSlotProps:Ct.endScrollButtonIcon,ownerState:St}),[Vt,Gt]=reactExports.useState(!1),[zt,jt]=reactExports.useState(defaultIndicatorStyle),[Ft,qt]=reactExports.useState(!1),[Xt,Ut]=reactExports.useState(!1),[Lt,Ht]=reactExports.useState(!1),[Kt,Jt]=reactExports.useState({overflow:"hidden",scrollbarWidth:0}),tr=new Map,nr=reactExports.useRef(null),ur=reactExports.useRef(null),rr={slots:wt,slotProps:{indicator:Pt,scrollButtons:Bt,...Ct}},pr=()=>{const or=nr.current;let ar;if(or){const vr=or.getBoundingClientRect();ar={clientWidth:or.clientWidth,scrollLeft:or.scrollLeft,scrollTop:or.scrollTop,scrollWidth:or.scrollWidth,top:vr.top,bottom:vr.bottom,left:vr.left,right:vr.right}}let cr;if(or&&kt!==!1){const vr=ur.current.children;if(vr.length>0){const $r=vr[tr.get(kt)];cr=$r?$r.getBoundingClientRect():null}}return{tabsMeta:ar,tabMeta:cr}},fr=useEventCallback(()=>{const{tabsMeta:or,tabMeta:ar}=pr();let cr=0,vr;mt?(vr="top",ar&&or&&(cr=ar.top-or.top+or.scrollTop)):(vr=et?"right":"left",ar&&or&&(cr=(et?-1:1)*(ar[vr]-or[vr]+or.scrollLeft)));const $r={[vr]:cr,[$t]:ar?ar[$t]:0};if(typeof zt[vr]!="number"||typeof zt[$t]!="number")jt($r);else{const Cr=Math.abs(zt[vr]-$r[vr]),Mr=Math.abs(zt[$t]-$r[$t]);(Cr>=1||Mr>=1)&&jt($r)}}),lr=(or,{animation:ar=!0}={})=>{ar?animate(gt,nr.current,or,{duration:_e.transitions.duration.standard}):nr.current[gt]=or},wr=or=>{let ar=nr.current[gt];mt?ar+=or:ar+=or*(et?-1:1),lr(ar)},hr=()=>{const or=nr.current[_t];let ar=0;const cr=Array.from(ur.current.children);for(let vr=0;vror){vr===0&&(ar=or);break}ar+=$r[_t]}return ar},Er=()=>{wr(-1*hr())},Pr=()=>{wr(hr())},[br,{onChange:_r,...Rr}]=useSlot("scrollbar",{className:clsx(Rt.scrollableX,Rt.hideScrollbar),elementType:TabsScrollbarSize,shouldForwardComponentProp:!0,externalForwardedProps:rr,ownerState:St}),Wt=reactExports.useCallback(or=>{_r==null||_r(or),Jt({overflow:null,scrollbarWidth:or})},[_r]),[Nt,Dt]=useSlot("scrollButtons",{className:clsx(Rt.scrollButtons,Bt.className),elementType:TabScrollButton,externalForwardedProps:rr,ownerState:St,additionalProps:{orientation:dt,slots:{StartScrollButtonIcon:wt.startScrollButtonIcon||wt.StartScrollButtonIcon,EndScrollButtonIcon:wt.endScrollButtonIcon||wt.EndScrollButtonIcon},slotProps:{startScrollButtonIcon:It,endScrollButtonIcon:Mt}}}),Yt=()=>{const or={};or.scrollbarSizeListener=bt?jsxRuntimeExports.jsx(br,{...Rr,onChange:Wt}):null;const cr=bt&&(yt==="auto"&&(Ft||Xt)||yt===!0);return or.scrollButtonStart=cr?jsxRuntimeExports.jsx(Nt,{direction:et?"right":"left",onClick:Er,disabled:!Ft,...Dt}):null,or.scrollButtonEnd=cr?jsxRuntimeExports.jsx(Nt,{direction:et?"left":"right",onClick:Pr,disabled:!Xt,...Dt}):null,or},er=useEventCallback(or=>{const{tabsMeta:ar,tabMeta:cr}=pr();if(!(!cr||!ar)){if(cr[xt]ar[Et]){const vr=ar[gt]+(cr[Et]-ar[Et]);lr(vr,{animation:or})}}}),ir=useEventCallback(()=>{bt&&yt!==!1&&Ht(!Lt)});reactExports.useEffect(()=>{const or=debounce$3(()=>{nr.current&&fr()});let ar;const cr=Cr=>{Cr.forEach(Mr=>{Mr.removedNodes.forEach(jr=>{ar==null||ar.unobserve(jr)}),Mr.addedNodes.forEach(jr=>{ar==null||ar.observe(jr)})}),or(),ir()},vr=ownerWindow(nr.current);vr.addEventListener("resize",or);let $r;return typeof ResizeObserver<"u"&&(ar=new ResizeObserver(or),Array.from(ur.current.children).forEach(Cr=>{ar.observe(Cr)})),typeof MutationObserver<"u"&&($r=new MutationObserver(cr),$r.observe(ur.current,{childList:!0})),()=>{or.clear(),vr.removeEventListener("resize",or),$r==null||$r.disconnect(),ar==null||ar.disconnect()}},[fr,ir]),reactExports.useEffect(()=>{const or=Array.from(ur.current.children),ar=or.length;if(typeof IntersectionObserver<"u"&&ar>0&&bt&&yt!==!1){const cr=or[0],vr=or[ar-1],$r={root:nr.current,threshold:.99},Cr=Lr=>{qt(!Lr[0].isIntersecting)},Mr=new IntersectionObserver(Cr,$r);Mr.observe(cr);const jr=Lr=>{Ut(!Lr[0].isIntersecting)},Br=new IntersectionObserver(jr,$r);return Br.observe(vr),()=>{Mr.disconnect(),Br.disconnect()}}},[bt,yt,Lt,it==null?void 0:it.length]),reactExports.useEffect(()=>{Gt(!0)},[]),reactExports.useEffect(()=>{fr()}),reactExports.useEffect(()=>{er(defaultIndicatorStyle!==zt)},[er,zt]),reactExports.useImperativeHandle(nt,()=>({updateIndicator:fr,updateScrollButtons:ir}),[fr,ir]);const[sr,xr]=useSlot("indicator",{className:clsx(Rt.indicator,Pt.className),elementType:TabsIndicator,externalForwardedProps:rr,ownerState:St,additionalProps:{style:zt}}),Sr=jsxRuntimeExports.jsx(sr,{...xr});let gr=0;const Ar=reactExports.Children.map(it,or=>{if(!reactExports.isValidElement(or))return null;const ar=or.props.value===void 0?gr:or.props.value;tr.set(ar,gr);const cr=ar===kt;return gr+=1,reactExports.cloneElement(or,{fullWidth:Ot==="fullWidth",indicator:cr&&!Vt&&Sr,selected:cr,selectionFollowsFocus:vt,onChange:ft,textColor:At,value:ar,...gr===1&&kt===!1&&!or.props.tabIndex?{tabIndex:0}:{}})}),dr=or=>{if(or.altKey||or.shiftKey||or.ctrlKey||or.metaKey)return;const ar=ur.current,cr=activeElement(ownerDocument(ar));if((cr==null?void 0:cr.getAttribute("role"))!=="tab")return;let $r=dt==="horizontal"?"ArrowLeft":"ArrowUp",Cr=dt==="horizontal"?"ArrowRight":"ArrowDown";switch(dt==="horizontal"&&et&&($r="ArrowRight",Cr="ArrowLeft"),or.key){case $r:or.preventDefault(),moveFocus(ar,cr,previousItem);break;case Cr:or.preventDefault(),moveFocus(ar,cr,nextItem);break;case"Home":or.preventDefault(),moveFocus(ar,null,nextItem);break;case"End":or.preventDefault(),moveFocus(ar,null,previousItem);break}},yr=Yt(),[Ir,Nr]=useSlot("root",{ref:$,className:clsx(Rt.root,st),elementType:TabsRoot,externalForwardedProps:{...rr,...ht,component:at},ownerState:St}),[Tr,Dr]=useSlot("scroller",{ref:nr,className:Rt.scroller,elementType:TabsScroller,externalForwardedProps:rr,ownerState:St,additionalProps:{style:{overflow:Kt.overflow,[mt?`margin${et?"Left":"Right"}`:"marginBottom"]:Tt?void 0:-Kt.scrollbarWidth}}}),[Zt,Qt]=useSlot("list",{ref:ur,className:clsx(Rt.list,Rt.flexContainer),elementType:List$1,externalForwardedProps:rr,ownerState:St,getSlotProps:or=>({...or,onKeyDown:ar=>{var cr;dr(ar),(cr=or.onKeyDown)==null||cr.call(or,ar)}})});return jsxRuntimeExports.jsxs(Ir,{...Nr,children:[yr.scrollButtonStart,yr.scrollbarSizeListener,jsxRuntimeExports.jsxs(Tr,{...Dr,children:[jsxRuntimeExports.jsx(Zt,{"aria-label":tt,"aria-labelledby":rt,"aria-orientation":dt==="vertical"?"vertical":null,role:"tablist",...Qt,children:Ar}),Vt&&Sr]}),yr.scrollButtonEnd]})});function getTextFieldUtilityClass(o){return generateUtilityClass("MuiTextField",o)}generateUtilityClasses("MuiTextField",["root"]);const variantComponent={standard:Input$1,filled:FilledInput,outlined:OutlinedInput},useUtilityClasses=o=>{const{classes:_}=o;return composeClasses({root:["root"]},getTextFieldUtilityClass,_)},TextFieldRoot=styled(FormControl,{name:"MuiTextField",slot:"Root"})({}),TextField=reactExports.forwardRef(function(_,$){const j=useDefaultProps({props:_,name:"MuiTextField"}),{autoComplete:_e,autoFocus:et=!1,children:tt,className:rt,color:nt="primary",defaultValue:ot,disabled:it=!1,error:st=!1,FormHelperTextProps:at,fullWidth:lt=!1,helperText:ct,id:ft,InputLabelProps:dt,inputProps:pt,InputProps:yt,inputRef:vt,label:wt,maxRows:Ct,minRows:Pt,multiline:Bt=!1,name:At,onBlur:kt,onChange:Ot,onFocus:Tt,placeholder:ht,required:bt=!1,rows:mt,select:gt=!1,SelectProps:xt,slots:Et={},slotProps:_t={},type:$t,value:St,variant:Rt="outlined",...It}=j,Mt={...j,autoFocus:et,color:nt,disabled:it,error:st,fullWidth:lt,multiline:Bt,required:bt,select:gt,variant:Rt},Vt=useUtilityClasses(Mt),Gt=useId$1(ft),zt=ct&&Gt?`${Gt}-helper-text`:void 0,jt=wt&&Gt?`${Gt}-label`:void 0,Ft=variantComponent[Rt],qt={slots:Et,slotProps:{input:yt,inputLabel:dt,htmlInput:pt,formHelperText:at,select:xt,..._t}},Xt={},Ut=qt.slotProps.inputLabel;Rt==="outlined"&&(Ut&&typeof Ut.shrink<"u"&&(Xt.notched=Ut.shrink),Xt.label=wt),gt&&((!xt||!xt.native)&&(Xt.id=void 0),Xt["aria-describedby"]=void 0);const[Lt,Ht]=useSlot("root",{elementType:TextFieldRoot,shouldForwardComponentProp:!0,externalForwardedProps:{...qt,...It},ownerState:Mt,className:clsx(Vt.root,rt),ref:$,additionalProps:{disabled:it,error:st,fullWidth:lt,required:bt,color:nt,variant:Rt}}),[Kt,Jt]=useSlot("input",{elementType:Ft,externalForwardedProps:qt,additionalProps:Xt,ownerState:Mt}),[tr,nr]=useSlot("inputLabel",{elementType:InputLabel,externalForwardedProps:qt,ownerState:Mt}),[ur,rr]=useSlot("htmlInput",{elementType:"input",externalForwardedProps:qt,ownerState:Mt}),[pr,fr]=useSlot("formHelperText",{elementType:FormHelperText,externalForwardedProps:qt,ownerState:Mt}),[lr,wr]=useSlot("select",{elementType:Select,externalForwardedProps:qt,ownerState:Mt}),hr=jsxRuntimeExports.jsx(Kt,{"aria-describedby":zt,autoComplete:_e,autoFocus:et,defaultValue:ot,fullWidth:lt,multiline:Bt,name:At,rows:mt,maxRows:Ct,minRows:Pt,type:$t,value:St,id:Gt,inputRef:vt,onBlur:kt,onChange:Ot,onFocus:Tt,placeholder:ht,inputProps:rr,slots:{input:Et.htmlInput?ur:void 0},...Jt});return jsxRuntimeExports.jsxs(Lt,{...Ht,children:[wt!=null&&wt!==""&&jsxRuntimeExports.jsx(tr,{htmlFor:Gt,id:jt,...nr,children:wt}),gt?jsxRuntimeExports.jsx(lr,{"aria-describedby":zt,id:Gt,labelId:jt,value:St,input:hr,...wr,children:tt}):hr,ct&&jsxRuntimeExports.jsx(pr,{id:zt,...fr,children:ct})]})}),AccountBalanceWallet=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M21 18v1c0 1.1-.9 2-2 2H5c-1.11 0-2-.9-2-2V5c0-1.1.89-2 2-2h14c1.1 0 2 .9 2 2v1h-9c-1.11 0-2 .9-2 2v8c0 1.1.89 2 2 2zm-9-2h10V8H12zm4-2.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5"})),Add=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"})),CheckCircle=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z"})),Code=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M9.4 16.6 4.8 12l4.6-4.6L8 6l-6 6 6 6zm5.2 0 4.6-4.6-4.6-4.6L16 6l6 6-6 6z"})),ContentCopy=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2m0 16H8V7h11z"})),EmojiEvents=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 5h-2V3H7v2H5c-1.1 0-2 .9-2 2v1c0 2.55 1.92 4.63 4.39 4.94.63 1.5 1.98 2.63 3.61 2.96V19H7v2h10v-2h-4v-3.1c1.63-.33 2.98-1.46 3.61-2.96C19.08 12.63 21 10.55 21 8V7c0-1.1-.9-2-2-2M5 8V7h2v3.82C5.84 10.4 5 9.3 5 8m14 0c0 1.3-.84 2.4-2 2.82V7h2z"})),ExitToApp=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M10.09 15.59 11.5 17l5-5-5-5-1.41 1.41L12.67 11H3v2h9.67zM19 3H5c-1.11 0-2 .9-2 2v4h2V5h14v14H5v-4H3v4c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2"})),ExpandMore=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z"})),FolderSpecial=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2m-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24z"})),GitHub=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 1.27a11 11 0 00-3.48 21.46c.55.09.73-.28.73-.55v-1.84c-3.03.64-3.67-1.46-3.67-1.46-.55-1.29-1.28-1.65-1.28-1.65-.92-.65.1-.65.1-.65 1.1 0 1.73 1.1 1.73 1.1.92 1.65 2.57 1.2 3.21.92a2 2 0 01.64-1.47c-2.47-.27-5.04-1.19-5.04-5.5 0-1.1.46-2.1 1.2-2.84a3.76 3.76 0 010-2.93s.91-.28 3.11 1.1c1.8-.49 3.7-.49 5.5 0 2.1-1.38 3.02-1.1 3.02-1.1a3.76 3.76 0 010 2.93c.83.74 1.2 1.74 1.2 2.94 0 4.21-2.57 5.13-5.04 5.4.45.37.82.92.82 2.02v3.03c0 .27.1.64.73.55A11 11 0 0012 1.27"})),HelpOutline=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M11 18h2v-2h-2zm1-16C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8m0-14c-2.21 0-4 1.79-4 4h2c0-1.1.9-2 2-2s2 .9 2 2c0 2-3 1.75-3 5h2c0-2.25 3-2.5 3-5 0-2.21-1.79-4-4-4"})),List=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M3 13h2v-2H3zm0 4h2v-2H3zm0-8h2V7H3zm4 4h14v-2H7zm0 4h14v-2H7zM7 7v2h14V7z"})),OpenInNew=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"})),Person=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4m0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4"})),Refresh=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M17.65 6.35C16.2 4.9 14.21 4 12 4c-4.42 0-7.99 3.58-7.99 8s3.57 8 7.99 8c3.73 0 6.84-2.55 7.73-6h-2.08c-.82 2.33-3.04 4-5.65 4-3.31 0-6-2.69-6-6s2.69-6 6-6c1.66 0 3.14.69 4.22 1.78L13 11h7V4z"})),Security=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11z"})),Settings=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M19.14 12.94c.04-.3.06-.61.06-.94 0-.32-.02-.64-.07-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.05.3-.09.63-.09.94s.02.64.07.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6"})),Speed=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m20.38 8.57-1.23 1.85a8 8 0 0 1-.22 7.58H5.07A8 8 0 0 1 15.58 6.85l1.85-1.23A10 10 0 0 0 3.35 19a2 2 0 0 0 1.72 1h13.85a2 2 0 0 0 1.74-1 10 10 0 0 0-.27-10.44zm-9.79 6.84a2 2 0 0 0 2.83 0l5.66-8.49-8.49 5.66a2 2 0 0 0 0 2.83"})),Terminal=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M20 4H4c-1.11 0-2 .9-2 2v12c0 1.1.89 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.89-2-2-2m0 14H4V8h16zm-2-1h-6v-2h6zM7.5 17l-1.41-1.41L8.67 13l-2.59-2.59L7.5 9l4 4z"})),TrendingUp=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"m16 6 2.29 2.29-4.88 4.88-4-4L2 16.59 3.41 18l6-6 4 4 6.3-6.29L22 12V6z"})),VerifiedUser=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M12 1 3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5zm-2 16-4-4 1.41-1.41L10 14.17l6.59-6.59L18 9z"})),Warning=createSvgIcon(jsxRuntimeExports.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"})),baseMainnet=defineChain({id:8453,name:"Base",network:"base-mainnet",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://mainnet.base.org"]},public:{http:["https://mainnet.base.org"]}},blockExplorers:{default:{name:"BaseScan",url:"https://basescan.org"}}}),baseSepolia=defineChain({id:84532,name:"Base Sepolia",network:"base-sepolia",nativeCurrency:{decimals:18,name:"ETH",symbol:"ETH"},rpcUrls:{default:{http:["https://sepolia.base.org"]},public:{http:["https://sepolia.base.org"]}},blockExplorers:{default:{name:"BaseScan",url:"https://sepolia.basescan.org"}}});function getChainConfig$1(o){switch(o){case 8453:return baseMainnet;case 84532:return baseSepolia;default:throw new Error(`Unsupported chain ID: ${o}. Supported chains: 8453 (Base), 84532 (Base Sepolia)`)}}const EAS_ABI=parseAbi(["function attest((bytes32 schema,(address recipient,uint64 expirationTime,bool revocable,bytes32 refUID,bytes data,uint256 value) data)) returns (bytes32)"]),EAS_EVENTS_ABI=parseAbi(["event Attested(address indexed recipient, address indexed attester, bytes32 indexed uid, bytes32 schema)"]);function extractAttestationUidFromLog(o,_,$){const j=(o.address??"").toLowerCase()===_.toLowerCase();try{if(j){const _e=decodeEventLog({abi:EAS_EVENTS_ABI,data:o.data,topics:o.topics});if(_e.eventName==="Attested"){const et=_e.args.uid;if(et&&et!=="0x"&&et.toLowerCase()!==$.toLowerCase())return et}}}catch{}if(j&&Array.isArray(o.topics)&&o.topics.length>=4){const _e=o.topics[3];if(_e&&_e!=="0x"&&_e.toLowerCase()!==$.toLowerCase())return _e}if(j&&typeof o.data=="string"&&o.data.startsWith("0x")&&o.data.length>=66){const _e="0x"+o.data.slice(2,66);if(_e&&_e!=="0x"&&_e.toLowerCase()!==$.toLowerCase())return _e}}function encodeBindingData(o){return encodeAbiParameters([{type:"string",name:"domain"},{type:"string",name:"username"},{type:"address",name:"wallet"},{type:"string",name:"message"},{type:"bytes",name:"signature"},{type:"string",name:"proof_url"}],[o.domain,o.username,getAddress(o.wallet),o.message,o.signature,o.proof_url])}const EASAddresses={baseSepolia:o=>{if(!o.EAS_ADDRESS)throw new Error("VITE_EAS_BASE_SEPOLIA_ADDRESS (or VITE_EAS_ADDRESS) is required for Base Sepolia");return{chain:baseSepolia,contract:o.EAS_ADDRESS}},forChain:(o,_)=>{if(!_.EAS_ADDRESS)throw new Error("VITE_EAS_ADDRESS is required");return{chain:getChainConfig$1(o),contract:_.EAS_ADDRESS}}};async function attestIdentityBinding(o,_,$){var it;const j=st=>typeof st=="string"&&/^0x[0-9a-fA-F]{40}$/.test(st);if(!j(_.contract))throw new Error(`EAS contract address invalid: ${String(_.contract)}`);if(!j(o.recipient))throw new Error(`Recipient address invalid: ${String(o.recipient)}`);const _e=($==null?void 0:$.publicClient)??createPublicClient({chain:_.chain,transport:http(_.chain.rpcUrls.default.http[0])});try{const st=await _e.getCode({address:_.contract});if(!st||st==="0x")throw new Error(`No contract code found at EAS address ${_.contract}. Check VITE_EAS_BASE_SEPOLIA_ADDRESS.`)}catch(st){throw st instanceof Error?st:new Error("Failed to resolve EAS contract code")}if($!=null&&$.aaClient){const st=encodeFunctionData({abi:EAS_ABI,functionName:"attest",args:[{schema:o.schemaUid,data:{recipient:o.recipient,expirationTime:BigInt(0),revocable:!0,refUID:toHex$1(0,{size:32}),data:o.data,value:BigInt(0)}}]}),at=await $.aaClient.sendUserOp({to:_.contract,data:st,value:0n}),lt=await $.aaClient.waitForUserOp(at),ct=((it=lt==null?void 0:lt.receipt)==null?void 0:it.transactionHash)??(lt==null?void 0:lt.transactionHash)??(lt==null?void 0:lt.hash)??at;let ft;try{const dt=await _e.waitForTransactionReceipt({hash:ct});for(const pt of dt.logs){const yt=extractAttestationUidFromLog({address:pt.address,data:pt.data,topics:pt.topics},_.contract,o.schemaUid);if(yt){ft=yt;break}}}catch{}return{txHash:ct,attestationUid:ft}}const et=($==null?void 0:$.walletClient)??(window.ethereum?createWalletClient({chain:_.chain,transport:custom(window.ethereum)}):null);if(!et)throw new Error("No wallet client available");const[tt]=await et.getAddresses(),rt=await et.writeContract({address:_.contract,abi:EAS_ABI,functionName:"attest",account:tt,args:[{schema:o.schemaUid,data:{recipient:o.recipient,expirationTime:BigInt(0),revocable:!0,refUID:toHex$1(0,{size:32}),data:o.data,value:BigInt(0)}}]}),nt=await _e.waitForTransactionReceipt({hash:rt});let ot;for(const st of nt.logs){const at=extractAttestationUidFromLog({address:st.address,data:st.data,topics:st.topics},_.contract,o.schemaUid);if(at){ot=at;break}}return{txHash:rt,attestationUid:ot}}function _typeof(o){"@babel/helpers - typeof";return _typeof=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(_){return typeof _}:function(_){return _&&typeof Symbol=="function"&&_.constructor===Symbol&&_!==Symbol.prototype?"symbol":typeof _},_typeof(o)}function toPrimitive(o,_){if(_typeof(o)!="object"||!o)return o;var $=o[Symbol.toPrimitive];if($!==void 0){var j=$.call(o,_);if(_typeof(j)!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(o)}function toPropertyKey(o){var _=toPrimitive(o,"string");return _typeof(_)=="symbol"?_:_+""}function _defineProperty$z(o,_,$){return(_=toPropertyKey(_))in o?Object.defineProperty(o,_,{value:$,enumerable:!0,configurable:!0,writable:!0}):o[_]=$,o}function ownKeys$x(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread2(o){for(var _=1;_0)throw new Error("Invalid string. Length must be a multiple of 4");var $=o.indexOf("=");$===-1&&($=_);var j=$===_?0:4-$%4;return[$,j]}function byteLength$1(o){var _=getLens(o),$=_[0],j=_[1];return($+j)*3/4-j}function _byteLength(o,_,$){return(_+$)*3/4-$}function toByteArray(o){var _,$=getLens(o),j=$[0],_e=$[1],et=new Arr(_byteLength(o,j,_e)),tt=0,rt=_e>0?j-4:j,nt;for(nt=0;nt>16&255,et[tt++]=_>>8&255,et[tt++]=_&255;return _e===2&&(_=revLookup[o.charCodeAt(nt)]<<2|revLookup[o.charCodeAt(nt+1)]>>4,et[tt++]=_&255),_e===1&&(_=revLookup[o.charCodeAt(nt)]<<10|revLookup[o.charCodeAt(nt+1)]<<4|revLookup[o.charCodeAt(nt+2)]>>2,et[tt++]=_>>8&255,et[tt++]=_&255),et}function tripletToBase64(o){return lookup$2[o>>18&63]+lookup$2[o>>12&63]+lookup$2[o>>6&63]+lookup$2[o&63]}function encodeChunk(o,_,$){for(var j,_e=[],et=_;et<$;et+=3)j=(o[et]<<16&16711680)+(o[et+1]<<8&65280)+(o[et+2]&255),_e.push(tripletToBase64(j));return _e.join("")}function fromByteArray(o){for(var _,$=o.length,j=$%3,_e=[],et=16383,tt=0,rt=$-j;ttrt?rt:tt+et));return j===1?(_=o[$-1],_e.push(lookup$2[_>>2]+lookup$2[_<<4&63]+"==")):j===2&&(_=(o[$-2]<<8)+o[$-1],_e.push(lookup$2[_>>10]+lookup$2[_>>4&63]+lookup$2[_<<2&63]+"=")),_e.join("")}var ieee754={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ieee754.read=function(o,_,$,j,_e){var et,tt,rt=_e*8-j-1,nt=(1<>1,it=-7,st=$?_e-1:0,at=$?-1:1,lt=o[_+st];for(st+=at,et=lt&(1<<-it)-1,lt>>=-it,it+=rt;it>0;et=et*256+o[_+st],st+=at,it-=8);for(tt=et&(1<<-it)-1,et>>=-it,it+=j;it>0;tt=tt*256+o[_+st],st+=at,it-=8);if(et===0)et=1-ot;else{if(et===nt)return tt?NaN:(lt?-1:1)*(1/0);tt=tt+Math.pow(2,j),et=et-ot}return(lt?-1:1)*tt*Math.pow(2,et-j)};ieee754.write=function(o,_,$,j,_e,et){var tt,rt,nt,ot=et*8-_e-1,it=(1<>1,at=_e===23?Math.pow(2,-24)-Math.pow(2,-77):0,lt=j?0:et-1,ct=j?1:-1,ft=_<0||_===0&&1/_<0?1:0;for(_=Math.abs(_),isNaN(_)||_===1/0?(rt=isNaN(_)?1:0,tt=it):(tt=Math.floor(Math.log(_)/Math.LN2),_*(nt=Math.pow(2,-tt))<1&&(tt--,nt*=2),tt+st>=1?_+=at/nt:_+=at*Math.pow(2,1-st),_*nt>=2&&(tt++,nt/=2),tt+st>=it?(rt=0,tt=it):tt+st>=1?(rt=(_*nt-1)*Math.pow(2,_e),tt=tt+st):(rt=_*Math.pow(2,st-1)*Math.pow(2,_e),tt=0));_e>=8;o[$+lt]=rt&255,lt+=ct,rt/=256,_e-=8);for(tt=tt<<_e|rt,ot+=_e;ot>0;o[$+lt]=tt&255,lt+=ct,tt/=256,ot-=8);o[$+lt-ct]|=ft*128};/*! - * The buffer module from node.js, for the browser. - * - * @author Feross Aboukhadijeh - * @license MIT - */(function(o){const _=base64Js,$=ieee754,j=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;o.Buffer=it,o.SlowBuffer=Ct,o.INSPECT_MAX_BYTES=50;const _e=2147483647;o.kMaxLength=_e;const{Uint8Array:et,ArrayBuffer:tt,SharedArrayBuffer:rt}=globalThis;it.TYPED_ARRAY_SUPPORT=nt(),!it.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function nt(){try{const Wt=new et(1),Nt={foo:function(){return 42}};return Object.setPrototypeOf(Nt,et.prototype),Object.setPrototypeOf(Wt,Nt),Wt.foo()===42}catch{return!1}}Object.defineProperty(it.prototype,"parent",{enumerable:!0,get:function(){if(it.isBuffer(this))return this.buffer}}),Object.defineProperty(it.prototype,"offset",{enumerable:!0,get:function(){if(it.isBuffer(this))return this.byteOffset}});function ot(Wt){if(Wt>_e)throw new RangeError('The value "'+Wt+'" is invalid for option "size"');const Nt=new et(Wt);return Object.setPrototypeOf(Nt,it.prototype),Nt}function it(Wt,Nt,Dt){if(typeof Wt=="number"){if(typeof Nt=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return ct(Wt)}return st(Wt,Nt,Dt)}it.poolSize=8192;function st(Wt,Nt,Dt){if(typeof Wt=="string")return ft(Wt,Nt);if(tt.isView(Wt))return pt(Wt);if(Wt==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Wt);if(Er(Wt,tt)||Wt&&Er(Wt.buffer,tt)||typeof rt<"u"&&(Er(Wt,rt)||Wt&&Er(Wt.buffer,rt)))return yt(Wt,Nt,Dt);if(typeof Wt=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const Yt=Wt.valueOf&&Wt.valueOf();if(Yt!=null&&Yt!==Wt)return it.from(Yt,Nt,Dt);const er=vt(Wt);if(er)return er;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Wt[Symbol.toPrimitive]=="function")return it.from(Wt[Symbol.toPrimitive]("string"),Nt,Dt);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Wt)}it.from=function(Wt,Nt,Dt){return st(Wt,Nt,Dt)},Object.setPrototypeOf(it.prototype,et.prototype),Object.setPrototypeOf(it,et);function at(Wt){if(typeof Wt!="number")throw new TypeError('"size" argument must be of type number');if(Wt<0)throw new RangeError('The value "'+Wt+'" is invalid for option "size"')}function lt(Wt,Nt,Dt){return at(Wt),Wt<=0?ot(Wt):Nt!==void 0?typeof Dt=="string"?ot(Wt).fill(Nt,Dt):ot(Wt).fill(Nt):ot(Wt)}it.alloc=function(Wt,Nt,Dt){return lt(Wt,Nt,Dt)};function ct(Wt){return at(Wt),ot(Wt<0?0:wt(Wt)|0)}it.allocUnsafe=function(Wt){return ct(Wt)},it.allocUnsafeSlow=function(Wt){return ct(Wt)};function ft(Wt,Nt){if((typeof Nt!="string"||Nt==="")&&(Nt="utf8"),!it.isEncoding(Nt))throw new TypeError("Unknown encoding: "+Nt);const Dt=Pt(Wt,Nt)|0;let Yt=ot(Dt);const er=Yt.write(Wt,Nt);return er!==Dt&&(Yt=Yt.slice(0,er)),Yt}function dt(Wt){const Nt=Wt.length<0?0:wt(Wt.length)|0,Dt=ot(Nt);for(let Yt=0;Yt=_e)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_e.toString(16)+" bytes");return Wt|0}function Ct(Wt){return+Wt!=Wt&&(Wt=0),it.alloc(+Wt)}it.isBuffer=function(Nt){return Nt!=null&&Nt._isBuffer===!0&&Nt!==it.prototype},it.compare=function(Nt,Dt){if(Er(Nt,et)&&(Nt=it.from(Nt,Nt.offset,Nt.byteLength)),Er(Dt,et)&&(Dt=it.from(Dt,Dt.offset,Dt.byteLength)),!it.isBuffer(Nt)||!it.isBuffer(Dt))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Nt===Dt)return 0;let Yt=Nt.length,er=Dt.length;for(let ir=0,sr=Math.min(Yt,er);irer.length?(it.isBuffer(sr)||(sr=it.from(sr)),sr.copy(er,ir)):et.prototype.set.call(er,sr,ir);else if(it.isBuffer(sr))sr.copy(er,ir);else throw new TypeError('"list" argument must be an Array of Buffers');ir+=sr.length}return er};function Pt(Wt,Nt){if(it.isBuffer(Wt))return Wt.length;if(tt.isView(Wt)||Er(Wt,tt))return Wt.byteLength;if(typeof Wt!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Wt);const Dt=Wt.length,Yt=arguments.length>2&&arguments[2]===!0;if(!Yt&&Dt===0)return 0;let er=!1;for(;;)switch(Nt){case"ascii":case"latin1":case"binary":return Dt;case"utf8":case"utf-8":return pr(Wt).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Dt*2;case"hex":return Dt>>>1;case"base64":return wr(Wt).length;default:if(er)return Yt?-1:pr(Wt).length;Nt=(""+Nt).toLowerCase(),er=!0}}it.byteLength=Pt;function Bt(Wt,Nt,Dt){let Yt=!1;if((Nt===void 0||Nt<0)&&(Nt=0),Nt>this.length||((Dt===void 0||Dt>this.length)&&(Dt=this.length),Dt<=0)||(Dt>>>=0,Nt>>>=0,Dt<=Nt))return"";for(Wt||(Wt="utf8");;)switch(Wt){case"hex":return It(this,Nt,Dt);case"utf8":case"utf-8":return Et(this,Nt,Dt);case"ascii":return St(this,Nt,Dt);case"latin1":case"binary":return Rt(this,Nt,Dt);case"base64":return xt(this,Nt,Dt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mt(this,Nt,Dt);default:if(Yt)throw new TypeError("Unknown encoding: "+Wt);Wt=(Wt+"").toLowerCase(),Yt=!0}}it.prototype._isBuffer=!0;function At(Wt,Nt,Dt){const Yt=Wt[Nt];Wt[Nt]=Wt[Dt],Wt[Dt]=Yt}it.prototype.swap16=function(){const Nt=this.length;if(Nt%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let Dt=0;DtDt&&(Nt+=" ... "),""},j&&(it.prototype[j]=it.prototype.inspect),it.prototype.compare=function(Nt,Dt,Yt,er,ir){if(Er(Nt,et)&&(Nt=it.from(Nt,Nt.offset,Nt.byteLength)),!it.isBuffer(Nt))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Nt);if(Dt===void 0&&(Dt=0),Yt===void 0&&(Yt=Nt?Nt.length:0),er===void 0&&(er=0),ir===void 0&&(ir=this.length),Dt<0||Yt>Nt.length||er<0||ir>this.length)throw new RangeError("out of range index");if(er>=ir&&Dt>=Yt)return 0;if(er>=ir)return-1;if(Dt>=Yt)return 1;if(Dt>>>=0,Yt>>>=0,er>>>=0,ir>>>=0,this===Nt)return 0;let sr=ir-er,xr=Yt-Dt;const Sr=Math.min(sr,xr),gr=this.slice(er,ir),Ar=Nt.slice(Dt,Yt);for(let dr=0;dr2147483647?Dt=2147483647:Dt<-2147483648&&(Dt=-2147483648),Dt=+Dt,Pr(Dt)&&(Dt=er?0:Wt.length-1),Dt<0&&(Dt=Wt.length+Dt),Dt>=Wt.length){if(er)return-1;Dt=Wt.length-1}else if(Dt<0)if(er)Dt=0;else return-1;if(typeof Nt=="string"&&(Nt=it.from(Nt,Yt)),it.isBuffer(Nt))return Nt.length===0?-1:Ot(Wt,Nt,Dt,Yt,er);if(typeof Nt=="number")return Nt=Nt&255,typeof et.prototype.indexOf=="function"?er?et.prototype.indexOf.call(Wt,Nt,Dt):et.prototype.lastIndexOf.call(Wt,Nt,Dt):Ot(Wt,[Nt],Dt,Yt,er);throw new TypeError("val must be string, number or Buffer")}function Ot(Wt,Nt,Dt,Yt,er){let ir=1,sr=Wt.length,xr=Nt.length;if(Yt!==void 0&&(Yt=String(Yt).toLowerCase(),Yt==="ucs2"||Yt==="ucs-2"||Yt==="utf16le"||Yt==="utf-16le")){if(Wt.length<2||Nt.length<2)return-1;ir=2,sr/=2,xr/=2,Dt/=2}function Sr(Ar,dr){return ir===1?Ar[dr]:Ar.readUInt16BE(dr*ir)}let gr;if(er){let Ar=-1;for(gr=Dt;grsr&&(Dt=sr-xr),gr=Dt;gr>=0;gr--){let Ar=!0;for(let dr=0;drer&&(Yt=er)):Yt=er;const ir=Nt.length;Yt>ir/2&&(Yt=ir/2);let sr;for(sr=0;sr>>0,isFinite(Yt)?(Yt=Yt>>>0,er===void 0&&(er="utf8")):(er=Yt,Yt=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const ir=this.length-Dt;if((Yt===void 0||Yt>ir)&&(Yt=ir),Nt.length>0&&(Yt<0||Dt<0)||Dt>this.length)throw new RangeError("Attempt to write outside buffer bounds");er||(er="utf8");let sr=!1;for(;;)switch(er){case"hex":return Tt(this,Nt,Dt,Yt);case"utf8":case"utf-8":return ht(this,Nt,Dt,Yt);case"ascii":case"latin1":case"binary":return bt(this,Nt,Dt,Yt);case"base64":return mt(this,Nt,Dt,Yt);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return gt(this,Nt,Dt,Yt);default:if(sr)throw new TypeError("Unknown encoding: "+er);er=(""+er).toLowerCase(),sr=!0}},it.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function xt(Wt,Nt,Dt){return Nt===0&&Dt===Wt.length?_.fromByteArray(Wt):_.fromByteArray(Wt.slice(Nt,Dt))}function Et(Wt,Nt,Dt){Dt=Math.min(Wt.length,Dt);const Yt=[];let er=Nt;for(;er239?4:ir>223?3:ir>191?2:1;if(er+xr<=Dt){let Sr,gr,Ar,dr;switch(xr){case 1:ir<128&&(sr=ir);break;case 2:Sr=Wt[er+1],(Sr&192)===128&&(dr=(ir&31)<<6|Sr&63,dr>127&&(sr=dr));break;case 3:Sr=Wt[er+1],gr=Wt[er+2],(Sr&192)===128&&(gr&192)===128&&(dr=(ir&15)<<12|(Sr&63)<<6|gr&63,dr>2047&&(dr<55296||dr>57343)&&(sr=dr));break;case 4:Sr=Wt[er+1],gr=Wt[er+2],Ar=Wt[er+3],(Sr&192)===128&&(gr&192)===128&&(Ar&192)===128&&(dr=(ir&15)<<18|(Sr&63)<<12|(gr&63)<<6|Ar&63,dr>65535&&dr<1114112&&(sr=dr))}}sr===null?(sr=65533,xr=1):sr>65535&&(sr-=65536,Yt.push(sr>>>10&1023|55296),sr=56320|sr&1023),Yt.push(sr),er+=xr}return $t(Yt)}const _t=4096;function $t(Wt){const Nt=Wt.length;if(Nt<=_t)return String.fromCharCode.apply(String,Wt);let Dt="",Yt=0;for(;YtYt)&&(Dt=Yt);let er="";for(let ir=Nt;irYt&&(Nt=Yt),Dt<0?(Dt+=Yt,Dt<0&&(Dt=0)):Dt>Yt&&(Dt=Yt),DtDt)throw new RangeError("Trying to access beyond buffer length")}it.prototype.readUintLE=it.prototype.readUIntLE=function(Nt,Dt,Yt){Nt=Nt>>>0,Dt=Dt>>>0,Yt||Vt(Nt,Dt,this.length);let er=this[Nt],ir=1,sr=0;for(;++sr>>0,Dt=Dt>>>0,Yt||Vt(Nt,Dt,this.length);let er=this[Nt+--Dt],ir=1;for(;Dt>0&&(ir*=256);)er+=this[Nt+--Dt]*ir;return er},it.prototype.readUint8=it.prototype.readUInt8=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,1,this.length),this[Nt]},it.prototype.readUint16LE=it.prototype.readUInt16LE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,2,this.length),this[Nt]|this[Nt+1]<<8},it.prototype.readUint16BE=it.prototype.readUInt16BE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,2,this.length),this[Nt]<<8|this[Nt+1]},it.prototype.readUint32LE=it.prototype.readUInt32LE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,4,this.length),(this[Nt]|this[Nt+1]<<8|this[Nt+2]<<16)+this[Nt+3]*16777216},it.prototype.readUint32BE=it.prototype.readUInt32BE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,4,this.length),this[Nt]*16777216+(this[Nt+1]<<16|this[Nt+2]<<8|this[Nt+3])},it.prototype.readBigUInt64LE=_r(function(Nt){Nt=Nt>>>0,tr(Nt,"offset");const Dt=this[Nt],Yt=this[Nt+7];(Dt===void 0||Yt===void 0)&&nr(Nt,this.length-8);const er=Dt+this[++Nt]*2**8+this[++Nt]*2**16+this[++Nt]*2**24,ir=this[++Nt]+this[++Nt]*2**8+this[++Nt]*2**16+Yt*2**24;return BigInt(er)+(BigInt(ir)<>>0,tr(Nt,"offset");const Dt=this[Nt],Yt=this[Nt+7];(Dt===void 0||Yt===void 0)&&nr(Nt,this.length-8);const er=Dt*2**24+this[++Nt]*2**16+this[++Nt]*2**8+this[++Nt],ir=this[++Nt]*2**24+this[++Nt]*2**16+this[++Nt]*2**8+Yt;return(BigInt(er)<>>0,Dt=Dt>>>0,Yt||Vt(Nt,Dt,this.length);let er=this[Nt],ir=1,sr=0;for(;++sr=ir&&(er-=Math.pow(2,8*Dt)),er},it.prototype.readIntBE=function(Nt,Dt,Yt){Nt=Nt>>>0,Dt=Dt>>>0,Yt||Vt(Nt,Dt,this.length);let er=Dt,ir=1,sr=this[Nt+--er];for(;er>0&&(ir*=256);)sr+=this[Nt+--er]*ir;return ir*=128,sr>=ir&&(sr-=Math.pow(2,8*Dt)),sr},it.prototype.readInt8=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,1,this.length),this[Nt]&128?(255-this[Nt]+1)*-1:this[Nt]},it.prototype.readInt16LE=function(Nt,Dt){Nt=Nt>>>0,Dt||Vt(Nt,2,this.length);const Yt=this[Nt]|this[Nt+1]<<8;return Yt&32768?Yt|4294901760:Yt},it.prototype.readInt16BE=function(Nt,Dt){Nt=Nt>>>0,Dt||Vt(Nt,2,this.length);const Yt=this[Nt+1]|this[Nt]<<8;return Yt&32768?Yt|4294901760:Yt},it.prototype.readInt32LE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,4,this.length),this[Nt]|this[Nt+1]<<8|this[Nt+2]<<16|this[Nt+3]<<24},it.prototype.readInt32BE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,4,this.length),this[Nt]<<24|this[Nt+1]<<16|this[Nt+2]<<8|this[Nt+3]},it.prototype.readBigInt64LE=_r(function(Nt){Nt=Nt>>>0,tr(Nt,"offset");const Dt=this[Nt],Yt=this[Nt+7];(Dt===void 0||Yt===void 0)&&nr(Nt,this.length-8);const er=this[Nt+4]+this[Nt+5]*2**8+this[Nt+6]*2**16+(Yt<<24);return(BigInt(er)<>>0,tr(Nt,"offset");const Dt=this[Nt],Yt=this[Nt+7];(Dt===void 0||Yt===void 0)&&nr(Nt,this.length-8);const er=(Dt<<24)+this[++Nt]*2**16+this[++Nt]*2**8+this[++Nt];return(BigInt(er)<>>0,Dt||Vt(Nt,4,this.length),$.read(this,Nt,!0,23,4)},it.prototype.readFloatBE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,4,this.length),$.read(this,Nt,!1,23,4)},it.prototype.readDoubleLE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,8,this.length),$.read(this,Nt,!0,52,8)},it.prototype.readDoubleBE=function(Nt,Dt){return Nt=Nt>>>0,Dt||Vt(Nt,8,this.length),$.read(this,Nt,!1,52,8)};function Gt(Wt,Nt,Dt,Yt,er,ir){if(!it.isBuffer(Wt))throw new TypeError('"buffer" argument must be a Buffer instance');if(Nt>er||NtWt.length)throw new RangeError("Index out of range")}it.prototype.writeUintLE=it.prototype.writeUIntLE=function(Nt,Dt,Yt,er){if(Nt=+Nt,Dt=Dt>>>0,Yt=Yt>>>0,!er){const xr=Math.pow(2,8*Yt)-1;Gt(this,Nt,Dt,Yt,xr,0)}let ir=1,sr=0;for(this[Dt]=Nt&255;++sr>>0,Yt=Yt>>>0,!er){const xr=Math.pow(2,8*Yt)-1;Gt(this,Nt,Dt,Yt,xr,0)}let ir=Yt-1,sr=1;for(this[Dt+ir]=Nt&255;--ir>=0&&(sr*=256);)this[Dt+ir]=Nt/sr&255;return Dt+Yt},it.prototype.writeUint8=it.prototype.writeUInt8=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,1,255,0),this[Dt]=Nt&255,Dt+1},it.prototype.writeUint16LE=it.prototype.writeUInt16LE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,2,65535,0),this[Dt]=Nt&255,this[Dt+1]=Nt>>>8,Dt+2},it.prototype.writeUint16BE=it.prototype.writeUInt16BE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,2,65535,0),this[Dt]=Nt>>>8,this[Dt+1]=Nt&255,Dt+2},it.prototype.writeUint32LE=it.prototype.writeUInt32LE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,4,4294967295,0),this[Dt+3]=Nt>>>24,this[Dt+2]=Nt>>>16,this[Dt+1]=Nt>>>8,this[Dt]=Nt&255,Dt+4},it.prototype.writeUint32BE=it.prototype.writeUInt32BE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,4,4294967295,0),this[Dt]=Nt>>>24,this[Dt+1]=Nt>>>16,this[Dt+2]=Nt>>>8,this[Dt+3]=Nt&255,Dt+4};function zt(Wt,Nt,Dt,Yt,er){Jt(Nt,Yt,er,Wt,Dt,7);let ir=Number(Nt&BigInt(4294967295));Wt[Dt++]=ir,ir=ir>>8,Wt[Dt++]=ir,ir=ir>>8,Wt[Dt++]=ir,ir=ir>>8,Wt[Dt++]=ir;let sr=Number(Nt>>BigInt(32)&BigInt(4294967295));return Wt[Dt++]=sr,sr=sr>>8,Wt[Dt++]=sr,sr=sr>>8,Wt[Dt++]=sr,sr=sr>>8,Wt[Dt++]=sr,Dt}function jt(Wt,Nt,Dt,Yt,er){Jt(Nt,Yt,er,Wt,Dt,7);let ir=Number(Nt&BigInt(4294967295));Wt[Dt+7]=ir,ir=ir>>8,Wt[Dt+6]=ir,ir=ir>>8,Wt[Dt+5]=ir,ir=ir>>8,Wt[Dt+4]=ir;let sr=Number(Nt>>BigInt(32)&BigInt(4294967295));return Wt[Dt+3]=sr,sr=sr>>8,Wt[Dt+2]=sr,sr=sr>>8,Wt[Dt+1]=sr,sr=sr>>8,Wt[Dt]=sr,Dt+8}it.prototype.writeBigUInt64LE=_r(function(Nt,Dt=0){return zt(this,Nt,Dt,BigInt(0),BigInt("0xffffffffffffffff"))}),it.prototype.writeBigUInt64BE=_r(function(Nt,Dt=0){return jt(this,Nt,Dt,BigInt(0),BigInt("0xffffffffffffffff"))}),it.prototype.writeIntLE=function(Nt,Dt,Yt,er){if(Nt=+Nt,Dt=Dt>>>0,!er){const Sr=Math.pow(2,8*Yt-1);Gt(this,Nt,Dt,Yt,Sr-1,-Sr)}let ir=0,sr=1,xr=0;for(this[Dt]=Nt&255;++ir>0)-xr&255;return Dt+Yt},it.prototype.writeIntBE=function(Nt,Dt,Yt,er){if(Nt=+Nt,Dt=Dt>>>0,!er){const Sr=Math.pow(2,8*Yt-1);Gt(this,Nt,Dt,Yt,Sr-1,-Sr)}let ir=Yt-1,sr=1,xr=0;for(this[Dt+ir]=Nt&255;--ir>=0&&(sr*=256);)Nt<0&&xr===0&&this[Dt+ir+1]!==0&&(xr=1),this[Dt+ir]=(Nt/sr>>0)-xr&255;return Dt+Yt},it.prototype.writeInt8=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,1,127,-128),Nt<0&&(Nt=255+Nt+1),this[Dt]=Nt&255,Dt+1},it.prototype.writeInt16LE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,2,32767,-32768),this[Dt]=Nt&255,this[Dt+1]=Nt>>>8,Dt+2},it.prototype.writeInt16BE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,2,32767,-32768),this[Dt]=Nt>>>8,this[Dt+1]=Nt&255,Dt+2},it.prototype.writeInt32LE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,4,2147483647,-2147483648),this[Dt]=Nt&255,this[Dt+1]=Nt>>>8,this[Dt+2]=Nt>>>16,this[Dt+3]=Nt>>>24,Dt+4},it.prototype.writeInt32BE=function(Nt,Dt,Yt){return Nt=+Nt,Dt=Dt>>>0,Yt||Gt(this,Nt,Dt,4,2147483647,-2147483648),Nt<0&&(Nt=4294967295+Nt+1),this[Dt]=Nt>>>24,this[Dt+1]=Nt>>>16,this[Dt+2]=Nt>>>8,this[Dt+3]=Nt&255,Dt+4},it.prototype.writeBigInt64LE=_r(function(Nt,Dt=0){return zt(this,Nt,Dt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),it.prototype.writeBigInt64BE=_r(function(Nt,Dt=0){return jt(this,Nt,Dt,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ft(Wt,Nt,Dt,Yt,er,ir){if(Dt+Yt>Wt.length)throw new RangeError("Index out of range");if(Dt<0)throw new RangeError("Index out of range")}function qt(Wt,Nt,Dt,Yt,er){return Nt=+Nt,Dt=Dt>>>0,er||Ft(Wt,Nt,Dt,4),$.write(Wt,Nt,Dt,Yt,23,4),Dt+4}it.prototype.writeFloatLE=function(Nt,Dt,Yt){return qt(this,Nt,Dt,!0,Yt)},it.prototype.writeFloatBE=function(Nt,Dt,Yt){return qt(this,Nt,Dt,!1,Yt)};function Xt(Wt,Nt,Dt,Yt,er){return Nt=+Nt,Dt=Dt>>>0,er||Ft(Wt,Nt,Dt,8),$.write(Wt,Nt,Dt,Yt,52,8),Dt+8}it.prototype.writeDoubleLE=function(Nt,Dt,Yt){return Xt(this,Nt,Dt,!0,Yt)},it.prototype.writeDoubleBE=function(Nt,Dt,Yt){return Xt(this,Nt,Dt,!1,Yt)},it.prototype.copy=function(Nt,Dt,Yt,er){if(!it.isBuffer(Nt))throw new TypeError("argument should be a Buffer");if(Yt||(Yt=0),!er&&er!==0&&(er=this.length),Dt>=Nt.length&&(Dt=Nt.length),Dt||(Dt=0),er>0&&er=this.length)throw new RangeError("Index out of range");if(er<0)throw new RangeError("sourceEnd out of bounds");er>this.length&&(er=this.length),Nt.length-Dt>>0,Yt=Yt===void 0?this.length:Yt>>>0,Nt||(Nt=0);let ir;if(typeof Nt=="number")for(ir=Dt;ir2**32?er=Ht(String(Dt)):typeof Dt=="bigint"&&(er=String(Dt),(Dt>BigInt(2)**BigInt(32)||Dt<-(BigInt(2)**BigInt(32)))&&(er=Ht(er)),er+="n"),Yt+=` It must be ${Nt}. Received ${er}`,Yt},RangeError);function Ht(Wt){let Nt="",Dt=Wt.length;const Yt=Wt[0]==="-"?1:0;for(;Dt>=Yt+4;Dt-=3)Nt=`_${Wt.slice(Dt-3,Dt)}${Nt}`;return`${Wt.slice(0,Dt)}${Nt}`}function Kt(Wt,Nt,Dt){tr(Nt,"offset"),(Wt[Nt]===void 0||Wt[Nt+Dt]===void 0)&&nr(Nt,Wt.length-(Dt+1))}function Jt(Wt,Nt,Dt,Yt,er,ir){if(Wt>Dt||Wt= 0${sr} and < 2${sr} ** ${(ir+1)*8}${sr}`:xr=`>= -(2${sr} ** ${(ir+1)*8-1}${sr}) and < 2 ** ${(ir+1)*8-1}${sr}`,new Ut.ERR_OUT_OF_RANGE("value",xr,Wt)}Kt(Yt,er,ir)}function tr(Wt,Nt){if(typeof Wt!="number")throw new Ut.ERR_INVALID_ARG_TYPE(Nt,"number",Wt)}function nr(Wt,Nt,Dt){throw Math.floor(Wt)!==Wt?(tr(Wt,Dt),new Ut.ERR_OUT_OF_RANGE("offset","an integer",Wt)):Nt<0?new Ut.ERR_BUFFER_OUT_OF_BOUNDS:new Ut.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${Nt}`,Wt)}const ur=/[^+/0-9A-Za-z-_]/g;function rr(Wt){if(Wt=Wt.split("=")[0],Wt=Wt.trim().replace(ur,""),Wt.length<2)return"";for(;Wt.length%4!==0;)Wt=Wt+"=";return Wt}function pr(Wt,Nt){Nt=Nt||1/0;let Dt;const Yt=Wt.length;let er=null;const ir=[];for(let sr=0;sr55295&&Dt<57344){if(!er){if(Dt>56319){(Nt-=3)>-1&&ir.push(239,191,189);continue}else if(sr+1===Yt){(Nt-=3)>-1&&ir.push(239,191,189);continue}er=Dt;continue}if(Dt<56320){(Nt-=3)>-1&&ir.push(239,191,189),er=Dt;continue}Dt=(er-55296<<10|Dt-56320)+65536}else er&&(Nt-=3)>-1&&ir.push(239,191,189);if(er=null,Dt<128){if((Nt-=1)<0)break;ir.push(Dt)}else if(Dt<2048){if((Nt-=2)<0)break;ir.push(Dt>>6|192,Dt&63|128)}else if(Dt<65536){if((Nt-=3)<0)break;ir.push(Dt>>12|224,Dt>>6&63|128,Dt&63|128)}else if(Dt<1114112){if((Nt-=4)<0)break;ir.push(Dt>>18|240,Dt>>12&63|128,Dt>>6&63|128,Dt&63|128)}else throw new Error("Invalid code point")}return ir}function fr(Wt){const Nt=[];for(let Dt=0;Dt>8,er=Dt%256,ir.push(er),ir.push(Yt);return ir}function wr(Wt){return _.toByteArray(rr(Wt))}function hr(Wt,Nt,Dt,Yt){let er;for(er=0;er=Nt.length||er>=Wt.length);++er)Nt[er+Dt]=Wt[er];return er}function Er(Wt,Nt){return Wt instanceof Nt||Wt!=null&&Wt.constructor!=null&&Wt.constructor.name!=null&&Wt.constructor.name===Nt.name}function Pr(Wt){return Wt!==Wt}const br=function(){const Wt="0123456789abcdef",Nt=new Array(256);for(let Dt=0;Dt<16;++Dt){const Yt=Dt*16;for(let er=0;er<16;++er)Nt[Yt+er]=Wt[Dt]+Wt[er]}return Nt}();function _r(Wt){return typeof BigInt>"u"?Rr:Wt}function Rr(){throw new Error("BigInt not supported")}})(buffer$1);const Buffer$3=buffer$1.Buffer,Blob$1=buffer$1.Blob,BlobOptions=buffer$1.BlobOptions,Buffer$1$1=buffer$1.Buffer,File$1=buffer$1.File,FileOptions=buffer$1.FileOptions,INSPECT_MAX_BYTES=buffer$1.INSPECT_MAX_BYTES,SlowBuffer=buffer$1.SlowBuffer,TranscodeEncoding=buffer$1.TranscodeEncoding,atob$1=buffer$1.atob,btoa$1=buffer$1.btoa,constants$2=buffer$1.constants,isAscii=buffer$1.isAscii,isUtf8=buffer$1.isUtf8,kMaxLength=buffer$1.kMaxLength,kStringMaxLength=buffer$1.kStringMaxLength,resolveObjectURL=buffer$1.resolveObjectURL,transcode=buffer$1.transcode,dist$1=Object.freeze(Object.defineProperty({__proto__:null,Blob:Blob$1,BlobOptions,Buffer:Buffer$1$1,File:File$1,FileOptions,INSPECT_MAX_BYTES,SlowBuffer,TranscodeEncoding,atob:atob$1,btoa:btoa$1,constants:constants$2,default:Buffer$3,isAscii,isUtf8,kMaxLength,kStringMaxLength,resolveObjectURL,transcode},Symbol.toStringTag,{value:"Module"}));var bn$1={exports:{}};const require$$0$1=getAugmentedNamespace(dist$1);bn$1.exports;(function(o){(function(_,$){function j(bt,mt){if(!bt)throw new Error(mt||"Assertion failed")}function _e(bt,mt){bt.super_=mt;var gt=function(){};gt.prototype=mt.prototype,bt.prototype=new gt,bt.prototype.constructor=bt}function et(bt,mt,gt){if(et.isBN(bt))return bt;this.negative=0,this.words=null,this.length=0,this.red=null,bt!==null&&((mt==="le"||mt==="be")&&(gt=mt,mt=10),this._init(bt||0,mt||10,gt||"be"))}typeof _=="object"?_.exports=et:$.BN=et,et.BN=et,et.wordSize=26;var tt;try{typeof window<"u"&&typeof window.Buffer<"u"?tt=window.Buffer:tt=require$$0$1.Buffer}catch{}et.isBN=function(mt){return mt instanceof et?!0:mt!==null&&typeof mt=="object"&&mt.constructor.wordSize===et.wordSize&&Array.isArray(mt.words)},et.max=function(mt,gt){return mt.cmp(gt)>0?mt:gt},et.min=function(mt,gt){return mt.cmp(gt)<0?mt:gt},et.prototype._init=function(mt,gt,xt){if(typeof mt=="number")return this._initNumber(mt,gt,xt);if(typeof mt=="object")return this._initArray(mt,gt,xt);gt==="hex"&&(gt=16),j(gt===(gt|0)&>>=2&><=36),mt=mt.toString().replace(/\s+/g,"");var Et=0;mt[0]==="-"&&(Et++,this.negative=1),Et=0;Et-=3)$t=mt[Et]|mt[Et-1]<<8|mt[Et-2]<<16,this.words[_t]|=$t<>>26-St&67108863,St+=24,St>=26&&(St-=26,_t++);else if(xt==="le")for(Et=0,_t=0;Et>>26-St&67108863,St+=24,St>=26&&(St-=26,_t++);return this._strip()};function rt(bt,mt){var gt=bt.charCodeAt(mt);if(gt>=48&><=57)return gt-48;if(gt>=65&><=70)return gt-55;if(gt>=97&><=102)return gt-87;j(!1,"Invalid character in "+bt)}function nt(bt,mt,gt){var xt=rt(bt,gt);return gt-1>=mt&&(xt|=rt(bt,gt-1)<<4),xt}et.prototype._parseHex=function(mt,gt,xt){this.length=Math.ceil((mt.length-gt)/6),this.words=new Array(this.length);for(var Et=0;Et=gt;Et-=2)St=nt(mt,gt,Et)<<_t,this.words[$t]|=St&67108863,_t>=18?(_t-=18,$t+=1,this.words[$t]|=St>>>26):_t+=8;else{var Rt=mt.length-gt;for(Et=Rt%2===0?gt+1:gt;Et=18?(_t-=18,$t+=1,this.words[$t]|=St>>>26):_t+=8}this._strip()};function ot(bt,mt,gt,xt){for(var Et=0,_t=0,$t=Math.min(bt.length,gt),St=mt;St<$t;St++){var Rt=bt.charCodeAt(St)-48;Et*=xt,Rt>=49?_t=Rt-49+10:Rt>=17?_t=Rt-17+10:_t=Rt,j(Rt>=0&&_t1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},et.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},typeof Symbol<"u"&&typeof Symbol.for=="function")try{et.prototype[Symbol.for("nodejs.util.inspect.custom")]=st}catch{et.prototype.inspect=st}else et.prototype.inspect=st;function st(){return(this.red?""}var at=["","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"],lt=[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],ct=[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];et.prototype.toString=function(mt,gt){mt=mt||10,gt=gt|0||1;var xt;if(mt===16||mt==="hex"){xt="";for(var Et=0,_t=0,$t=0;$t>>24-Et&16777215,Et+=2,Et>=26&&(Et-=26,$t--),_t!==0||$t!==this.length-1?xt=at[6-Rt.length]+Rt+xt:xt=Rt+xt}for(_t!==0&&(xt=_t.toString(16)+xt);xt.length%gt!==0;)xt="0"+xt;return this.negative!==0&&(xt="-"+xt),xt}if(mt===(mt|0)&&mt>=2&&mt<=36){var It=lt[mt],Mt=ct[mt];xt="";var Vt=this.clone();for(Vt.negative=0;!Vt.isZero();){var Gt=Vt.modrn(Mt).toString(mt);Vt=Vt.idivn(Mt),Vt.isZero()?xt=Gt+xt:xt=at[It-Gt.length]+Gt+xt}for(this.isZero()&&(xt="0"+xt);xt.length%gt!==0;)xt="0"+xt;return this.negative!==0&&(xt="-"+xt),xt}j(!1,"Base should be between 2 and 36")},et.prototype.toNumber=function(){var mt=this.words[0];return this.length===2?mt+=this.words[1]*67108864:this.length===3&&this.words[2]===1?mt+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-mt:mt},et.prototype.toJSON=function(){return this.toString(16,2)},tt&&(et.prototype.toBuffer=function(mt,gt){return this.toArrayLike(tt,mt,gt)}),et.prototype.toArray=function(mt,gt){return this.toArrayLike(Array,mt,gt)};var ft=function(mt,gt){return mt.allocUnsafe?mt.allocUnsafe(gt):new mt(gt)};et.prototype.toArrayLike=function(mt,gt,xt){this._strip();var Et=this.byteLength(),_t=xt||Math.max(1,Et);j(Et<=_t,"byte array longer than desired length"),j(_t>0,"Requested array length <= 0");var $t=ft(mt,_t),St=gt==="le"?"LE":"BE";return this["_toArrayLike"+St]($t,Et),$t},et.prototype._toArrayLikeLE=function(mt,gt){for(var xt=0,Et=0,_t=0,$t=0;_t>8&255),xt>16&255),$t===6?(xt>24&255),Et=0,$t=0):(Et=St>>>24,$t+=2)}if(xt=0&&(mt[xt--]=St>>8&255),xt>=0&&(mt[xt--]=St>>16&255),$t===6?(xt>=0&&(mt[xt--]=St>>24&255),Et=0,$t=0):(Et=St>>>24,$t+=2)}if(xt>=0)for(mt[xt--]=Et;xt>=0;)mt[xt--]=0},Math.clz32?et.prototype._countBits=function(mt){return 32-Math.clz32(mt)}:et.prototype._countBits=function(mt){var gt=mt,xt=0;return gt>=4096&&(xt+=13,gt>>>=13),gt>=64&&(xt+=7,gt>>>=7),gt>=8&&(xt+=4,gt>>>=4),gt>=2&&(xt+=2,gt>>>=2),xt+gt},et.prototype._zeroBits=function(mt){if(mt===0)return 26;var gt=mt,xt=0;return gt&8191||(xt+=13,gt>>>=13),gt&127||(xt+=7,gt>>>=7),gt&15||(xt+=4,gt>>>=4),gt&3||(xt+=2,gt>>>=2),gt&1||xt++,xt},et.prototype.bitLength=function(){var mt=this.words[this.length-1],gt=this._countBits(mt);return(this.length-1)*26+gt};function dt(bt){for(var mt=new Array(bt.bitLength()),gt=0;gt>>Et&1}return mt}et.prototype.zeroBits=function(){if(this.isZero())return 0;for(var mt=0,gt=0;gtmt.length?this.clone().ior(mt):mt.clone().ior(this)},et.prototype.uor=function(mt){return this.length>mt.length?this.clone().iuor(mt):mt.clone().iuor(this)},et.prototype.iuand=function(mt){var gt;this.length>mt.length?gt=mt:gt=this;for(var xt=0;xtmt.length?this.clone().iand(mt):mt.clone().iand(this)},et.prototype.uand=function(mt){return this.length>mt.length?this.clone().iuand(mt):mt.clone().iuand(this)},et.prototype.iuxor=function(mt){var gt,xt;this.length>mt.length?(gt=this,xt=mt):(gt=mt,xt=this);for(var Et=0;Etmt.length?this.clone().ixor(mt):mt.clone().ixor(this)},et.prototype.uxor=function(mt){return this.length>mt.length?this.clone().iuxor(mt):mt.clone().iuxor(this)},et.prototype.inotn=function(mt){j(typeof mt=="number"&&mt>=0);var gt=Math.ceil(mt/26)|0,xt=mt%26;this._expand(gt),xt>0&>--;for(var Et=0;Et0&&(this.words[Et]=~this.words[Et]&67108863>>26-xt),this._strip()},et.prototype.notn=function(mt){return this.clone().inotn(mt)},et.prototype.setn=function(mt,gt){j(typeof mt=="number"&&mt>=0);var xt=mt/26|0,Et=mt%26;return this._expand(xt+1),gt?this.words[xt]=this.words[xt]|1<mt.length?(xt=this,Et=mt):(xt=mt,Et=this);for(var _t=0,$t=0;$t>>26;for(;_t!==0&&$t>>26;if(this.length=xt.length,_t!==0)this.words[this.length]=_t,this.length++;else if(xt!==this)for(;$tmt.length?this.clone().iadd(mt):mt.clone().iadd(this)},et.prototype.isub=function(mt){if(mt.negative!==0){mt.negative=0;var gt=this.iadd(mt);return mt.negative=1,gt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(mt),this.negative=1,this._normSign();var xt=this.cmp(mt);if(xt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Et,_t;xt>0?(Et=this,_t=mt):(Et=mt,_t=this);for(var $t=0,St=0;St<_t.length;St++)gt=(Et.words[St]|0)-(_t.words[St]|0)+$t,$t=gt>>26,this.words[St]=gt&67108863;for(;$t!==0&&St>26,this.words[St]=gt&67108863;if($t===0&&St>>26,Vt=Rt&67108863,Gt=Math.min(It,mt.length-1),zt=Math.max(0,It-bt.length+1);zt<=Gt;zt++){var jt=It-zt|0;Et=bt.words[jt]|0,_t=mt.words[zt]|0,$t=Et*_t+Vt,Mt+=$t/67108864|0,Vt=$t&67108863}gt.words[It]=Vt|0,Rt=Mt|0}return Rt!==0?gt.words[It]=Rt|0:gt.length--,gt._strip()}var yt=function(mt,gt,xt){var Et=mt.words,_t=gt.words,$t=xt.words,St=0,Rt,It,Mt,Vt=Et[0]|0,Gt=Vt&8191,zt=Vt>>>13,jt=Et[1]|0,Ft=jt&8191,qt=jt>>>13,Xt=Et[2]|0,Ut=Xt&8191,Lt=Xt>>>13,Ht=Et[3]|0,Kt=Ht&8191,Jt=Ht>>>13,tr=Et[4]|0,nr=tr&8191,ur=tr>>>13,rr=Et[5]|0,pr=rr&8191,fr=rr>>>13,lr=Et[6]|0,wr=lr&8191,hr=lr>>>13,Er=Et[7]|0,Pr=Er&8191,br=Er>>>13,_r=Et[8]|0,Rr=_r&8191,Wt=_r>>>13,Nt=Et[9]|0,Dt=Nt&8191,Yt=Nt>>>13,er=_t[0]|0,ir=er&8191,sr=er>>>13,xr=_t[1]|0,Sr=xr&8191,gr=xr>>>13,Ar=_t[2]|0,dr=Ar&8191,yr=Ar>>>13,Ir=_t[3]|0,Nr=Ir&8191,Tr=Ir>>>13,Dr=_t[4]|0,Zt=Dr&8191,Qt=Dr>>>13,or=_t[5]|0,ar=or&8191,cr=or>>>13,vr=_t[6]|0,$r=vr&8191,Cr=vr>>>13,Mr=_t[7]|0,jr=Mr&8191,Br=Mr>>>13,Lr=_t[8]|0,Hr=Lr&8191,Or=Lr>>>13,zr=_t[9]|0,Ur=zr&8191,Fr=zr>>>13;xt.negative=mt.negative^gt.negative,xt.length=19,Rt=Math.imul(Gt,ir),It=Math.imul(Gt,sr),It=It+Math.imul(zt,ir)|0,Mt=Math.imul(zt,sr);var Wr=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,Rt=Math.imul(Ft,ir),It=Math.imul(Ft,sr),It=It+Math.imul(qt,ir)|0,Mt=Math.imul(qt,sr),Rt=Rt+Math.imul(Gt,Sr)|0,It=It+Math.imul(Gt,gr)|0,It=It+Math.imul(zt,Sr)|0,Mt=Mt+Math.imul(zt,gr)|0;var qr=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(qr>>>26)|0,qr&=67108863,Rt=Math.imul(Ut,ir),It=Math.imul(Ut,sr),It=It+Math.imul(Lt,ir)|0,Mt=Math.imul(Lt,sr),Rt=Rt+Math.imul(Ft,Sr)|0,It=It+Math.imul(Ft,gr)|0,It=It+Math.imul(qt,Sr)|0,Mt=Mt+Math.imul(qt,gr)|0,Rt=Rt+Math.imul(Gt,dr)|0,It=It+Math.imul(Gt,yr)|0,It=It+Math.imul(zt,dr)|0,Mt=Mt+Math.imul(zt,yr)|0;var Jr=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,Rt=Math.imul(Kt,ir),It=Math.imul(Kt,sr),It=It+Math.imul(Jt,ir)|0,Mt=Math.imul(Jt,sr),Rt=Rt+Math.imul(Ut,Sr)|0,It=It+Math.imul(Ut,gr)|0,It=It+Math.imul(Lt,Sr)|0,Mt=Mt+Math.imul(Lt,gr)|0,Rt=Rt+Math.imul(Ft,dr)|0,It=It+Math.imul(Ft,yr)|0,It=It+Math.imul(qt,dr)|0,Mt=Mt+Math.imul(qt,yr)|0,Rt=Rt+Math.imul(Gt,Nr)|0,It=It+Math.imul(Gt,Tr)|0,It=It+Math.imul(zt,Nr)|0,Mt=Mt+Math.imul(zt,Tr)|0;var Qr=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,Rt=Math.imul(nr,ir),It=Math.imul(nr,sr),It=It+Math.imul(ur,ir)|0,Mt=Math.imul(ur,sr),Rt=Rt+Math.imul(Kt,Sr)|0,It=It+Math.imul(Kt,gr)|0,It=It+Math.imul(Jt,Sr)|0,Mt=Mt+Math.imul(Jt,gr)|0,Rt=Rt+Math.imul(Ut,dr)|0,It=It+Math.imul(Ut,yr)|0,It=It+Math.imul(Lt,dr)|0,Mt=Mt+Math.imul(Lt,yr)|0,Rt=Rt+Math.imul(Ft,Nr)|0,It=It+Math.imul(Ft,Tr)|0,It=It+Math.imul(qt,Nr)|0,Mt=Mt+Math.imul(qt,Tr)|0,Rt=Rt+Math.imul(Gt,Zt)|0,It=It+Math.imul(Gt,Qt)|0,It=It+Math.imul(zt,Zt)|0,Mt=Mt+Math.imul(zt,Qt)|0;var en=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(en>>>26)|0,en&=67108863,Rt=Math.imul(pr,ir),It=Math.imul(pr,sr),It=It+Math.imul(fr,ir)|0,Mt=Math.imul(fr,sr),Rt=Rt+Math.imul(nr,Sr)|0,It=It+Math.imul(nr,gr)|0,It=It+Math.imul(ur,Sr)|0,Mt=Mt+Math.imul(ur,gr)|0,Rt=Rt+Math.imul(Kt,dr)|0,It=It+Math.imul(Kt,yr)|0,It=It+Math.imul(Jt,dr)|0,Mt=Mt+Math.imul(Jt,yr)|0,Rt=Rt+Math.imul(Ut,Nr)|0,It=It+Math.imul(Ut,Tr)|0,It=It+Math.imul(Lt,Nr)|0,Mt=Mt+Math.imul(Lt,Tr)|0,Rt=Rt+Math.imul(Ft,Zt)|0,It=It+Math.imul(Ft,Qt)|0,It=It+Math.imul(qt,Zt)|0,Mt=Mt+Math.imul(qt,Qt)|0,Rt=Rt+Math.imul(Gt,ar)|0,It=It+Math.imul(Gt,cr)|0,It=It+Math.imul(zt,ar)|0,Mt=Mt+Math.imul(zt,cr)|0;var tn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(tn>>>26)|0,tn&=67108863,Rt=Math.imul(wr,ir),It=Math.imul(wr,sr),It=It+Math.imul(hr,ir)|0,Mt=Math.imul(hr,sr),Rt=Rt+Math.imul(pr,Sr)|0,It=It+Math.imul(pr,gr)|0,It=It+Math.imul(fr,Sr)|0,Mt=Mt+Math.imul(fr,gr)|0,Rt=Rt+Math.imul(nr,dr)|0,It=It+Math.imul(nr,yr)|0,It=It+Math.imul(ur,dr)|0,Mt=Mt+Math.imul(ur,yr)|0,Rt=Rt+Math.imul(Kt,Nr)|0,It=It+Math.imul(Kt,Tr)|0,It=It+Math.imul(Jt,Nr)|0,Mt=Mt+Math.imul(Jt,Tr)|0,Rt=Rt+Math.imul(Ut,Zt)|0,It=It+Math.imul(Ut,Qt)|0,It=It+Math.imul(Lt,Zt)|0,Mt=Mt+Math.imul(Lt,Qt)|0,Rt=Rt+Math.imul(Ft,ar)|0,It=It+Math.imul(Ft,cr)|0,It=It+Math.imul(qt,ar)|0,Mt=Mt+Math.imul(qt,cr)|0,Rt=Rt+Math.imul(Gt,$r)|0,It=It+Math.imul(Gt,Cr)|0,It=It+Math.imul(zt,$r)|0,Mt=Mt+Math.imul(zt,Cr)|0;var rn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(rn>>>26)|0,rn&=67108863,Rt=Math.imul(Pr,ir),It=Math.imul(Pr,sr),It=It+Math.imul(br,ir)|0,Mt=Math.imul(br,sr),Rt=Rt+Math.imul(wr,Sr)|0,It=It+Math.imul(wr,gr)|0,It=It+Math.imul(hr,Sr)|0,Mt=Mt+Math.imul(hr,gr)|0,Rt=Rt+Math.imul(pr,dr)|0,It=It+Math.imul(pr,yr)|0,It=It+Math.imul(fr,dr)|0,Mt=Mt+Math.imul(fr,yr)|0,Rt=Rt+Math.imul(nr,Nr)|0,It=It+Math.imul(nr,Tr)|0,It=It+Math.imul(ur,Nr)|0,Mt=Mt+Math.imul(ur,Tr)|0,Rt=Rt+Math.imul(Kt,Zt)|0,It=It+Math.imul(Kt,Qt)|0,It=It+Math.imul(Jt,Zt)|0,Mt=Mt+Math.imul(Jt,Qt)|0,Rt=Rt+Math.imul(Ut,ar)|0,It=It+Math.imul(Ut,cr)|0,It=It+Math.imul(Lt,ar)|0,Mt=Mt+Math.imul(Lt,cr)|0,Rt=Rt+Math.imul(Ft,$r)|0,It=It+Math.imul(Ft,Cr)|0,It=It+Math.imul(qt,$r)|0,Mt=Mt+Math.imul(qt,Cr)|0,Rt=Rt+Math.imul(Gt,jr)|0,It=It+Math.imul(Gt,Br)|0,It=It+Math.imul(zt,jr)|0,Mt=Mt+Math.imul(zt,Br)|0;var nn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(nn>>>26)|0,nn&=67108863,Rt=Math.imul(Rr,ir),It=Math.imul(Rr,sr),It=It+Math.imul(Wt,ir)|0,Mt=Math.imul(Wt,sr),Rt=Rt+Math.imul(Pr,Sr)|0,It=It+Math.imul(Pr,gr)|0,It=It+Math.imul(br,Sr)|0,Mt=Mt+Math.imul(br,gr)|0,Rt=Rt+Math.imul(wr,dr)|0,It=It+Math.imul(wr,yr)|0,It=It+Math.imul(hr,dr)|0,Mt=Mt+Math.imul(hr,yr)|0,Rt=Rt+Math.imul(pr,Nr)|0,It=It+Math.imul(pr,Tr)|0,It=It+Math.imul(fr,Nr)|0,Mt=Mt+Math.imul(fr,Tr)|0,Rt=Rt+Math.imul(nr,Zt)|0,It=It+Math.imul(nr,Qt)|0,It=It+Math.imul(ur,Zt)|0,Mt=Mt+Math.imul(ur,Qt)|0,Rt=Rt+Math.imul(Kt,ar)|0,It=It+Math.imul(Kt,cr)|0,It=It+Math.imul(Jt,ar)|0,Mt=Mt+Math.imul(Jt,cr)|0,Rt=Rt+Math.imul(Ut,$r)|0,It=It+Math.imul(Ut,Cr)|0,It=It+Math.imul(Lt,$r)|0,Mt=Mt+Math.imul(Lt,Cr)|0,Rt=Rt+Math.imul(Ft,jr)|0,It=It+Math.imul(Ft,Br)|0,It=It+Math.imul(qt,jr)|0,Mt=Mt+Math.imul(qt,Br)|0,Rt=Rt+Math.imul(Gt,Hr)|0,It=It+Math.imul(Gt,Or)|0,It=It+Math.imul(zt,Hr)|0,Mt=Mt+Math.imul(zt,Or)|0;var sn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(sn>>>26)|0,sn&=67108863,Rt=Math.imul(Dt,ir),It=Math.imul(Dt,sr),It=It+Math.imul(Yt,ir)|0,Mt=Math.imul(Yt,sr),Rt=Rt+Math.imul(Rr,Sr)|0,It=It+Math.imul(Rr,gr)|0,It=It+Math.imul(Wt,Sr)|0,Mt=Mt+Math.imul(Wt,gr)|0,Rt=Rt+Math.imul(Pr,dr)|0,It=It+Math.imul(Pr,yr)|0,It=It+Math.imul(br,dr)|0,Mt=Mt+Math.imul(br,yr)|0,Rt=Rt+Math.imul(wr,Nr)|0,It=It+Math.imul(wr,Tr)|0,It=It+Math.imul(hr,Nr)|0,Mt=Mt+Math.imul(hr,Tr)|0,Rt=Rt+Math.imul(pr,Zt)|0,It=It+Math.imul(pr,Qt)|0,It=It+Math.imul(fr,Zt)|0,Mt=Mt+Math.imul(fr,Qt)|0,Rt=Rt+Math.imul(nr,ar)|0,It=It+Math.imul(nr,cr)|0,It=It+Math.imul(ur,ar)|0,Mt=Mt+Math.imul(ur,cr)|0,Rt=Rt+Math.imul(Kt,$r)|0,It=It+Math.imul(Kt,Cr)|0,It=It+Math.imul(Jt,$r)|0,Mt=Mt+Math.imul(Jt,Cr)|0,Rt=Rt+Math.imul(Ut,jr)|0,It=It+Math.imul(Ut,Br)|0,It=It+Math.imul(Lt,jr)|0,Mt=Mt+Math.imul(Lt,Br)|0,Rt=Rt+Math.imul(Ft,Hr)|0,It=It+Math.imul(Ft,Or)|0,It=It+Math.imul(qt,Hr)|0,Mt=Mt+Math.imul(qt,Or)|0,Rt=Rt+Math.imul(Gt,Ur)|0,It=It+Math.imul(Gt,Fr)|0,It=It+Math.imul(zt,Ur)|0,Mt=Mt+Math.imul(zt,Fr)|0;var an=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(an>>>26)|0,an&=67108863,Rt=Math.imul(Dt,Sr),It=Math.imul(Dt,gr),It=It+Math.imul(Yt,Sr)|0,Mt=Math.imul(Yt,gr),Rt=Rt+Math.imul(Rr,dr)|0,It=It+Math.imul(Rr,yr)|0,It=It+Math.imul(Wt,dr)|0,Mt=Mt+Math.imul(Wt,yr)|0,Rt=Rt+Math.imul(Pr,Nr)|0,It=It+Math.imul(Pr,Tr)|0,It=It+Math.imul(br,Nr)|0,Mt=Mt+Math.imul(br,Tr)|0,Rt=Rt+Math.imul(wr,Zt)|0,It=It+Math.imul(wr,Qt)|0,It=It+Math.imul(hr,Zt)|0,Mt=Mt+Math.imul(hr,Qt)|0,Rt=Rt+Math.imul(pr,ar)|0,It=It+Math.imul(pr,cr)|0,It=It+Math.imul(fr,ar)|0,Mt=Mt+Math.imul(fr,cr)|0,Rt=Rt+Math.imul(nr,$r)|0,It=It+Math.imul(nr,Cr)|0,It=It+Math.imul(ur,$r)|0,Mt=Mt+Math.imul(ur,Cr)|0,Rt=Rt+Math.imul(Kt,jr)|0,It=It+Math.imul(Kt,Br)|0,It=It+Math.imul(Jt,jr)|0,Mt=Mt+Math.imul(Jt,Br)|0,Rt=Rt+Math.imul(Ut,Hr)|0,It=It+Math.imul(Ut,Or)|0,It=It+Math.imul(Lt,Hr)|0,Mt=Mt+Math.imul(Lt,Or)|0,Rt=Rt+Math.imul(Ft,Ur)|0,It=It+Math.imul(Ft,Fr)|0,It=It+Math.imul(qt,Ur)|0,Mt=Mt+Math.imul(qt,Fr)|0;var un=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(un>>>26)|0,un&=67108863,Rt=Math.imul(Dt,dr),It=Math.imul(Dt,yr),It=It+Math.imul(Yt,dr)|0,Mt=Math.imul(Yt,yr),Rt=Rt+Math.imul(Rr,Nr)|0,It=It+Math.imul(Rr,Tr)|0,It=It+Math.imul(Wt,Nr)|0,Mt=Mt+Math.imul(Wt,Tr)|0,Rt=Rt+Math.imul(Pr,Zt)|0,It=It+Math.imul(Pr,Qt)|0,It=It+Math.imul(br,Zt)|0,Mt=Mt+Math.imul(br,Qt)|0,Rt=Rt+Math.imul(wr,ar)|0,It=It+Math.imul(wr,cr)|0,It=It+Math.imul(hr,ar)|0,Mt=Mt+Math.imul(hr,cr)|0,Rt=Rt+Math.imul(pr,$r)|0,It=It+Math.imul(pr,Cr)|0,It=It+Math.imul(fr,$r)|0,Mt=Mt+Math.imul(fr,Cr)|0,Rt=Rt+Math.imul(nr,jr)|0,It=It+Math.imul(nr,Br)|0,It=It+Math.imul(ur,jr)|0,Mt=Mt+Math.imul(ur,Br)|0,Rt=Rt+Math.imul(Kt,Hr)|0,It=It+Math.imul(Kt,Or)|0,It=It+Math.imul(Jt,Hr)|0,Mt=Mt+Math.imul(Jt,Or)|0,Rt=Rt+Math.imul(Ut,Ur)|0,It=It+Math.imul(Ut,Fr)|0,It=It+Math.imul(Lt,Ur)|0,Mt=Mt+Math.imul(Lt,Fr)|0;var dn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(dn>>>26)|0,dn&=67108863,Rt=Math.imul(Dt,Nr),It=Math.imul(Dt,Tr),It=It+Math.imul(Yt,Nr)|0,Mt=Math.imul(Yt,Tr),Rt=Rt+Math.imul(Rr,Zt)|0,It=It+Math.imul(Rr,Qt)|0,It=It+Math.imul(Wt,Zt)|0,Mt=Mt+Math.imul(Wt,Qt)|0,Rt=Rt+Math.imul(Pr,ar)|0,It=It+Math.imul(Pr,cr)|0,It=It+Math.imul(br,ar)|0,Mt=Mt+Math.imul(br,cr)|0,Rt=Rt+Math.imul(wr,$r)|0,It=It+Math.imul(wr,Cr)|0,It=It+Math.imul(hr,$r)|0,Mt=Mt+Math.imul(hr,Cr)|0,Rt=Rt+Math.imul(pr,jr)|0,It=It+Math.imul(pr,Br)|0,It=It+Math.imul(fr,jr)|0,Mt=Mt+Math.imul(fr,Br)|0,Rt=Rt+Math.imul(nr,Hr)|0,It=It+Math.imul(nr,Or)|0,It=It+Math.imul(ur,Hr)|0,Mt=Mt+Math.imul(ur,Or)|0,Rt=Rt+Math.imul(Kt,Ur)|0,It=It+Math.imul(Kt,Fr)|0,It=It+Math.imul(Jt,Ur)|0,Mt=Mt+Math.imul(Jt,Fr)|0;var pn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(pn>>>26)|0,pn&=67108863,Rt=Math.imul(Dt,Zt),It=Math.imul(Dt,Qt),It=It+Math.imul(Yt,Zt)|0,Mt=Math.imul(Yt,Qt),Rt=Rt+Math.imul(Rr,ar)|0,It=It+Math.imul(Rr,cr)|0,It=It+Math.imul(Wt,ar)|0,Mt=Mt+Math.imul(Wt,cr)|0,Rt=Rt+Math.imul(Pr,$r)|0,It=It+Math.imul(Pr,Cr)|0,It=It+Math.imul(br,$r)|0,Mt=Mt+Math.imul(br,Cr)|0,Rt=Rt+Math.imul(wr,jr)|0,It=It+Math.imul(wr,Br)|0,It=It+Math.imul(hr,jr)|0,Mt=Mt+Math.imul(hr,Br)|0,Rt=Rt+Math.imul(pr,Hr)|0,It=It+Math.imul(pr,Or)|0,It=It+Math.imul(fr,Hr)|0,Mt=Mt+Math.imul(fr,Or)|0,Rt=Rt+Math.imul(nr,Ur)|0,It=It+Math.imul(nr,Fr)|0,It=It+Math.imul(ur,Ur)|0,Mt=Mt+Math.imul(ur,Fr)|0;var hn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(hn>>>26)|0,hn&=67108863,Rt=Math.imul(Dt,ar),It=Math.imul(Dt,cr),It=It+Math.imul(Yt,ar)|0,Mt=Math.imul(Yt,cr),Rt=Rt+Math.imul(Rr,$r)|0,It=It+Math.imul(Rr,Cr)|0,It=It+Math.imul(Wt,$r)|0,Mt=Mt+Math.imul(Wt,Cr)|0,Rt=Rt+Math.imul(Pr,jr)|0,It=It+Math.imul(Pr,Br)|0,It=It+Math.imul(br,jr)|0,Mt=Mt+Math.imul(br,Br)|0,Rt=Rt+Math.imul(wr,Hr)|0,It=It+Math.imul(wr,Or)|0,It=It+Math.imul(hr,Hr)|0,Mt=Mt+Math.imul(hr,Or)|0,Rt=Rt+Math.imul(pr,Ur)|0,It=It+Math.imul(pr,Fr)|0,It=It+Math.imul(fr,Ur)|0,Mt=Mt+Math.imul(fr,Fr)|0;var mn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(mn>>>26)|0,mn&=67108863,Rt=Math.imul(Dt,$r),It=Math.imul(Dt,Cr),It=It+Math.imul(Yt,$r)|0,Mt=Math.imul(Yt,Cr),Rt=Rt+Math.imul(Rr,jr)|0,It=It+Math.imul(Rr,Br)|0,It=It+Math.imul(Wt,jr)|0,Mt=Mt+Math.imul(Wt,Br)|0,Rt=Rt+Math.imul(Pr,Hr)|0,It=It+Math.imul(Pr,Or)|0,It=It+Math.imul(br,Hr)|0,Mt=Mt+Math.imul(br,Or)|0,Rt=Rt+Math.imul(wr,Ur)|0,It=It+Math.imul(wr,Fr)|0,It=It+Math.imul(hr,Ur)|0,Mt=Mt+Math.imul(hr,Fr)|0;var gn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(gn>>>26)|0,gn&=67108863,Rt=Math.imul(Dt,jr),It=Math.imul(Dt,Br),It=It+Math.imul(Yt,jr)|0,Mt=Math.imul(Yt,Br),Rt=Rt+Math.imul(Rr,Hr)|0,It=It+Math.imul(Rr,Or)|0,It=It+Math.imul(Wt,Hr)|0,Mt=Mt+Math.imul(Wt,Or)|0,Rt=Rt+Math.imul(Pr,Ur)|0,It=It+Math.imul(Pr,Fr)|0,It=It+Math.imul(br,Ur)|0,Mt=Mt+Math.imul(br,Fr)|0;var yn=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(yn>>>26)|0,yn&=67108863,Rt=Math.imul(Dt,Hr),It=Math.imul(Dt,Or),It=It+Math.imul(Yt,Hr)|0,Mt=Math.imul(Yt,Or),Rt=Rt+Math.imul(Rr,Ur)|0,It=It+Math.imul(Rr,Fr)|0,It=It+Math.imul(Wt,Ur)|0,Mt=Mt+Math.imul(Wt,Fr)|0;var An=(St+Rt|0)+((It&8191)<<13)|0;St=(Mt+(It>>>13)|0)+(An>>>26)|0,An&=67108863,Rt=Math.imul(Dt,Ur),It=Math.imul(Dt,Fr),It=It+Math.imul(Yt,Ur)|0,Mt=Math.imul(Yt,Fr);var Cn=(St+Rt|0)+((It&8191)<<13)|0;return St=(Mt+(It>>>13)|0)+(Cn>>>26)|0,Cn&=67108863,$t[0]=Wr,$t[1]=qr,$t[2]=Jr,$t[3]=Qr,$t[4]=en,$t[5]=tn,$t[6]=rn,$t[7]=nn,$t[8]=sn,$t[9]=an,$t[10]=un,$t[11]=dn,$t[12]=pn,$t[13]=hn,$t[14]=mn,$t[15]=gn,$t[16]=yn,$t[17]=An,$t[18]=Cn,St!==0&&($t[19]=St,xt.length++),xt};Math.imul||(yt=pt);function vt(bt,mt,gt){gt.negative=mt.negative^bt.negative,gt.length=bt.length+mt.length;for(var xt=0,Et=0,_t=0;_t>>26)|0,Et+=$t>>>26,$t&=67108863}gt.words[_t]=St,xt=$t,$t=Et}return xt!==0?gt.words[_t]=xt:gt.length--,gt._strip()}function wt(bt,mt,gt){return vt(bt,mt,gt)}et.prototype.mulTo=function(mt,gt){var xt,Et=this.length+mt.length;return this.length===10&&mt.length===10?xt=yt(this,mt,gt):Et<63?xt=pt(this,mt,gt):Et<1024?xt=vt(this,mt,gt):xt=wt(this,mt,gt),xt},et.prototype.mul=function(mt){var gt=new et(null);return gt.words=new Array(this.length+mt.length),this.mulTo(mt,gt)},et.prototype.mulf=function(mt){var gt=new et(null);return gt.words=new Array(this.length+mt.length),wt(this,mt,gt)},et.prototype.imul=function(mt){return this.clone().mulTo(mt,this)},et.prototype.imuln=function(mt){var gt=mt<0;gt&&(mt=-mt),j(typeof mt=="number"),j(mt<67108864);for(var xt=0,Et=0;Et>=26,xt+=_t/67108864|0,xt+=$t>>>26,this.words[Et]=$t&67108863}return xt!==0&&(this.words[Et]=xt,this.length++),this.length=mt===0?1:this.length,gt?this.ineg():this},et.prototype.muln=function(mt){return this.clone().imuln(mt)},et.prototype.sqr=function(){return this.mul(this)},et.prototype.isqr=function(){return this.imul(this.clone())},et.prototype.pow=function(mt){var gt=dt(mt);if(gt.length===0)return new et(1);for(var xt=this,Et=0;Et=0);var gt=mt%26,xt=(mt-gt)/26,Et=67108863>>>26-gt<<26-gt,_t;if(gt!==0){var $t=0;for(_t=0;_t>>26-gt}$t&&(this.words[_t]=$t,this.length++)}if(xt!==0){for(_t=this.length-1;_t>=0;_t--)this.words[_t+xt]=this.words[_t];for(_t=0;_t=0);var Et;gt?Et=(gt-gt%26)/26:Et=0;var _t=mt%26,$t=Math.min((mt-_t)/26,this.length),St=67108863^67108863>>>_t<<_t,Rt=xt;if(Et-=$t,Et=Math.max(0,Et),Rt){for(var It=0;It<$t;It++)Rt.words[It]=this.words[It];Rt.length=$t}if($t!==0)if(this.length>$t)for(this.length-=$t,It=0;It=0&&(Mt!==0||It>=Et);It--){var Vt=this.words[It]|0;this.words[It]=Mt<<26-_t|Vt>>>_t,Mt=Vt&St}return Rt&&Mt!==0&&(Rt.words[Rt.length++]=Mt),this.length===0&&(this.words[0]=0,this.length=1),this._strip()},et.prototype.ishrn=function(mt,gt,xt){return j(this.negative===0),this.iushrn(mt,gt,xt)},et.prototype.shln=function(mt){return this.clone().ishln(mt)},et.prototype.ushln=function(mt){return this.clone().iushln(mt)},et.prototype.shrn=function(mt){return this.clone().ishrn(mt)},et.prototype.ushrn=function(mt){return this.clone().iushrn(mt)},et.prototype.testn=function(mt){j(typeof mt=="number"&&mt>=0);var gt=mt%26,xt=(mt-gt)/26,Et=1<=0);var gt=mt%26,xt=(mt-gt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=xt)return this;if(gt!==0&&xt++,this.length=Math.min(xt,this.length),gt!==0){var Et=67108863^67108863>>>gt<=67108864;gt++)this.words[gt]-=67108864,gt===this.length-1?this.words[gt+1]=1:this.words[gt+1]++;return this.length=Math.max(this.length,gt+1),this},et.prototype.isubn=function(mt){if(j(typeof mt=="number"),j(mt<67108864),mt<0)return this.iaddn(-mt);if(this.negative!==0)return this.negative=0,this.iaddn(mt),this.negative=1,this;if(this.words[0]-=mt,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var gt=0;gt>26)-(Rt/67108864|0),this.words[_t+xt]=$t&67108863}for(;_t>26,this.words[_t+xt]=$t&67108863;if(St===0)return this._strip();for(j(St===-1),St=0,_t=0;_t>26,this.words[_t]=$t&67108863;return this.negative=1,this._strip()},et.prototype._wordDiv=function(mt,gt){var xt=this.length-mt.length,Et=this.clone(),_t=mt,$t=_t.words[_t.length-1]|0,St=this._countBits($t);xt=26-St,xt!==0&&(_t=_t.ushln(xt),Et.iushln(xt),$t=_t.words[_t.length-1]|0);var Rt=Et.length-_t.length,It;if(gt!=="mod"){It=new et(null),It.length=Rt+1,It.words=new Array(It.length);for(var Mt=0;Mt=0;Gt--){var zt=(Et.words[_t.length+Gt]|0)*67108864+(Et.words[_t.length+Gt-1]|0);for(zt=Math.min(zt/$t|0,67108863),Et._ishlnsubmul(_t,zt,Gt);Et.negative!==0;)zt--,Et.negative=0,Et._ishlnsubmul(_t,1,Gt),Et.isZero()||(Et.negative^=1);It&&(It.words[Gt]=zt)}return It&&It._strip(),Et._strip(),gt!=="div"&&xt!==0&&Et.iushrn(xt),{div:It||null,mod:Et}},et.prototype.divmod=function(mt,gt,xt){if(j(!mt.isZero()),this.isZero())return{div:new et(0),mod:new et(0)};var Et,_t,$t;return this.negative!==0&&mt.negative===0?($t=this.neg().divmod(mt,gt),gt!=="mod"&&(Et=$t.div.neg()),gt!=="div"&&(_t=$t.mod.neg(),xt&&_t.negative!==0&&_t.iadd(mt)),{div:Et,mod:_t}):this.negative===0&&mt.negative!==0?($t=this.divmod(mt.neg(),gt),gt!=="mod"&&(Et=$t.div.neg()),{div:Et,mod:$t.mod}):this.negative&mt.negative?($t=this.neg().divmod(mt.neg(),gt),gt!=="div"&&(_t=$t.mod.neg(),xt&&_t.negative!==0&&_t.isub(mt)),{div:$t.div,mod:_t}):mt.length>this.length||this.cmp(mt)<0?{div:new et(0),mod:this}:mt.length===1?gt==="div"?{div:this.divn(mt.words[0]),mod:null}:gt==="mod"?{div:null,mod:new et(this.modrn(mt.words[0]))}:{div:this.divn(mt.words[0]),mod:new et(this.modrn(mt.words[0]))}:this._wordDiv(mt,gt)},et.prototype.div=function(mt){return this.divmod(mt,"div",!1).div},et.prototype.mod=function(mt){return this.divmod(mt,"mod",!1).mod},et.prototype.umod=function(mt){return this.divmod(mt,"mod",!0).mod},et.prototype.divRound=function(mt){var gt=this.divmod(mt);if(gt.mod.isZero())return gt.div;var xt=gt.div.negative!==0?gt.mod.isub(mt):gt.mod,Et=mt.ushrn(1),_t=mt.andln(1),$t=xt.cmp(Et);return $t<0||_t===1&&$t===0?gt.div:gt.div.negative!==0?gt.div.isubn(1):gt.div.iaddn(1)},et.prototype.modrn=function(mt){var gt=mt<0;gt&&(mt=-mt),j(mt<=67108863);for(var xt=(1<<26)%mt,Et=0,_t=this.length-1;_t>=0;_t--)Et=(xt*Et+(this.words[_t]|0))%mt;return gt?-Et:Et},et.prototype.modn=function(mt){return this.modrn(mt)},et.prototype.idivn=function(mt){var gt=mt<0;gt&&(mt=-mt),j(mt<=67108863);for(var xt=0,Et=this.length-1;Et>=0;Et--){var _t=(this.words[Et]|0)+xt*67108864;this.words[Et]=_t/mt|0,xt=_t%mt}return this._strip(),gt?this.ineg():this},et.prototype.divn=function(mt){return this.clone().idivn(mt)},et.prototype.egcd=function(mt){j(mt.negative===0),j(!mt.isZero());var gt=this,xt=mt.clone();gt.negative!==0?gt=gt.umod(mt):gt=gt.clone();for(var Et=new et(1),_t=new et(0),$t=new et(0),St=new et(1),Rt=0;gt.isEven()&&xt.isEven();)gt.iushrn(1),xt.iushrn(1),++Rt;for(var It=xt.clone(),Mt=gt.clone();!gt.isZero();){for(var Vt=0,Gt=1;!(gt.words[0]&Gt)&&Vt<26;++Vt,Gt<<=1);if(Vt>0)for(gt.iushrn(Vt);Vt-- >0;)(Et.isOdd()||_t.isOdd())&&(Et.iadd(It),_t.isub(Mt)),Et.iushrn(1),_t.iushrn(1);for(var zt=0,jt=1;!(xt.words[0]&jt)&&zt<26;++zt,jt<<=1);if(zt>0)for(xt.iushrn(zt);zt-- >0;)($t.isOdd()||St.isOdd())&&($t.iadd(It),St.isub(Mt)),$t.iushrn(1),St.iushrn(1);gt.cmp(xt)>=0?(gt.isub(xt),Et.isub($t),_t.isub(St)):(xt.isub(gt),$t.isub(Et),St.isub(_t))}return{a:$t,b:St,gcd:xt.iushln(Rt)}},et.prototype._invmp=function(mt){j(mt.negative===0),j(!mt.isZero());var gt=this,xt=mt.clone();gt.negative!==0?gt=gt.umod(mt):gt=gt.clone();for(var Et=new et(1),_t=new et(0),$t=xt.clone();gt.cmpn(1)>0&&xt.cmpn(1)>0;){for(var St=0,Rt=1;!(gt.words[0]&Rt)&&St<26;++St,Rt<<=1);if(St>0)for(gt.iushrn(St);St-- >0;)Et.isOdd()&&Et.iadd($t),Et.iushrn(1);for(var It=0,Mt=1;!(xt.words[0]&Mt)&&It<26;++It,Mt<<=1);if(It>0)for(xt.iushrn(It);It-- >0;)_t.isOdd()&&_t.iadd($t),_t.iushrn(1);gt.cmp(xt)>=0?(gt.isub(xt),Et.isub(_t)):(xt.isub(gt),_t.isub(Et))}var Vt;return gt.cmpn(1)===0?Vt=Et:Vt=_t,Vt.cmpn(0)<0&&Vt.iadd(mt),Vt},et.prototype.gcd=function(mt){if(this.isZero())return mt.abs();if(mt.isZero())return this.abs();var gt=this.clone(),xt=mt.clone();gt.negative=0,xt.negative=0;for(var Et=0;gt.isEven()&&xt.isEven();Et++)gt.iushrn(1),xt.iushrn(1);do{for(;gt.isEven();)gt.iushrn(1);for(;xt.isEven();)xt.iushrn(1);var _t=gt.cmp(xt);if(_t<0){var $t=gt;gt=xt,xt=$t}else if(_t===0||xt.cmpn(1)===0)break;gt.isub(xt)}while(!0);return xt.iushln(Et)},et.prototype.invm=function(mt){return this.egcd(mt).a.umod(mt)},et.prototype.isEven=function(){return(this.words[0]&1)===0},et.prototype.isOdd=function(){return(this.words[0]&1)===1},et.prototype.andln=function(mt){return this.words[0]&mt},et.prototype.bincn=function(mt){j(typeof mt=="number");var gt=mt%26,xt=(mt-gt)/26,Et=1<>>26,St&=67108863,this.words[$t]=St}return _t!==0&&(this.words[$t]=_t,this.length++),this},et.prototype.isZero=function(){return this.length===1&&this.words[0]===0},et.prototype.cmpn=function(mt){var gt=mt<0;if(this.negative!==0&&!gt)return-1;if(this.negative===0&>)return 1;this._strip();var xt;if(this.length>1)xt=1;else{gt&&(mt=-mt),j(mt<=67108863,"Number is too big");var Et=this.words[0]|0;xt=Et===mt?0:Etmt.length)return 1;if(this.length=0;xt--){var Et=this.words[xt]|0,_t=mt.words[xt]|0;if(Et!==_t){Et<_t?gt=-1:Et>_t&&(gt=1);break}}return gt},et.prototype.gtn=function(mt){return this.cmpn(mt)===1},et.prototype.gt=function(mt){return this.cmp(mt)===1},et.prototype.gten=function(mt){return this.cmpn(mt)>=0},et.prototype.gte=function(mt){return this.cmp(mt)>=0},et.prototype.ltn=function(mt){return this.cmpn(mt)===-1},et.prototype.lt=function(mt){return this.cmp(mt)===-1},et.prototype.lten=function(mt){return this.cmpn(mt)<=0},et.prototype.lte=function(mt){return this.cmp(mt)<=0},et.prototype.eqn=function(mt){return this.cmpn(mt)===0},et.prototype.eq=function(mt){return this.cmp(mt)===0},et.red=function(mt){return new Tt(mt)},et.prototype.toRed=function(mt){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),mt.convertTo(this)._forceRed(mt)},et.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},et.prototype._forceRed=function(mt){return this.red=mt,this},et.prototype.forceRed=function(mt){return j(!this.red,"Already a number in reduction context"),this._forceRed(mt)},et.prototype.redAdd=function(mt){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,mt)},et.prototype.redIAdd=function(mt){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,mt)},et.prototype.redSub=function(mt){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,mt)},et.prototype.redISub=function(mt){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,mt)},et.prototype.redShl=function(mt){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,mt)},et.prototype.redMul=function(mt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,mt),this.red.mul(this,mt)},et.prototype.redIMul=function(mt){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,mt),this.red.imul(this,mt)},et.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},et.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},et.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},et.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},et.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},et.prototype.redPow=function(mt){return j(this.red&&!mt.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,mt)};var Ct={k256:null,p224:null,p192:null,p25519:null};function Pt(bt,mt){this.name=bt,this.p=new et(mt,16),this.n=this.p.bitLength(),this.k=new et(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}Pt.prototype._tmp=function(){var mt=new et(null);return mt.words=new Array(Math.ceil(this.n/13)),mt},Pt.prototype.ireduce=function(mt){var gt=mt,xt;do this.split(gt,this.tmp),gt=this.imulK(gt),gt=gt.iadd(this.tmp),xt=gt.bitLength();while(xt>this.n);var Et=xt0?gt.isub(this.p):gt.strip!==void 0?gt.strip():gt._strip(),gt},Pt.prototype.split=function(mt,gt){mt.iushrn(this.n,0,gt)},Pt.prototype.imulK=function(mt){return mt.imul(this.k)};function Bt(){Pt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}_e(Bt,Pt),Bt.prototype.split=function(mt,gt){for(var xt=4194303,Et=Math.min(mt.length,9),_t=0;_t>>22,$t=St}$t>>>=22,mt.words[_t-10]=$t,$t===0&&mt.length>10?mt.length-=10:mt.length-=9},Bt.prototype.imulK=function(mt){mt.words[mt.length]=0,mt.words[mt.length+1]=0,mt.length+=2;for(var gt=0,xt=0;xt>>=26,mt.words[xt]=_t,gt=Et}return gt!==0&&(mt.words[mt.length++]=gt),mt},et._prime=function(mt){if(Ct[mt])return Ct[mt];var gt;if(mt==="k256")gt=new Bt;else if(mt==="p224")gt=new At;else if(mt==="p192")gt=new kt;else if(mt==="p25519")gt=new Ot;else throw new Error("Unknown prime "+mt);return Ct[mt]=gt,gt};function Tt(bt){if(typeof bt=="string"){var mt=et._prime(bt);this.m=mt.p,this.prime=mt}else j(bt.gtn(1),"modulus must be greater than 1"),this.m=bt,this.prime=null}Tt.prototype._verify1=function(mt){j(mt.negative===0,"red works only with positives"),j(mt.red,"red works only with red numbers")},Tt.prototype._verify2=function(mt,gt){j((mt.negative|gt.negative)===0,"red works only with positives"),j(mt.red&&mt.red===gt.red,"red works only with red numbers")},Tt.prototype.imod=function(mt){return this.prime?this.prime.ireduce(mt)._forceRed(this):(it(mt,mt.umod(this.m)._forceRed(this)),mt)},Tt.prototype.neg=function(mt){return mt.isZero()?mt.clone():this.m.sub(mt)._forceRed(this)},Tt.prototype.add=function(mt,gt){this._verify2(mt,gt);var xt=mt.add(gt);return xt.cmp(this.m)>=0&&xt.isub(this.m),xt._forceRed(this)},Tt.prototype.iadd=function(mt,gt){this._verify2(mt,gt);var xt=mt.iadd(gt);return xt.cmp(this.m)>=0&&xt.isub(this.m),xt},Tt.prototype.sub=function(mt,gt){this._verify2(mt,gt);var xt=mt.sub(gt);return xt.cmpn(0)<0&&xt.iadd(this.m),xt._forceRed(this)},Tt.prototype.isub=function(mt,gt){this._verify2(mt,gt);var xt=mt.isub(gt);return xt.cmpn(0)<0&&xt.iadd(this.m),xt},Tt.prototype.shl=function(mt,gt){return this._verify1(mt),this.imod(mt.ushln(gt))},Tt.prototype.imul=function(mt,gt){return this._verify2(mt,gt),this.imod(mt.imul(gt))},Tt.prototype.mul=function(mt,gt){return this._verify2(mt,gt),this.imod(mt.mul(gt))},Tt.prototype.isqr=function(mt){return this.imul(mt,mt.clone())},Tt.prototype.sqr=function(mt){return this.mul(mt,mt)},Tt.prototype.sqrt=function(mt){if(mt.isZero())return mt.clone();var gt=this.m.andln(3);if(j(gt%2===1),gt===3){var xt=this.m.add(new et(1)).iushrn(2);return this.pow(mt,xt)}for(var Et=this.m.subn(1),_t=0;!Et.isZero()&&Et.andln(1)===0;)_t++,Et.iushrn(1);j(!Et.isZero());var $t=new et(1).toRed(this),St=$t.redNeg(),Rt=this.m.subn(1).iushrn(1),It=this.m.bitLength();for(It=new et(2*It*It).toRed(this);this.pow(It,Rt).cmp(St)!==0;)It.redIAdd(St);for(var Mt=this.pow(It,Et),Vt=this.pow(mt,Et.addn(1).iushrn(1)),Gt=this.pow(mt,Et),zt=_t;Gt.cmp($t)!==0;){for(var jt=Gt,Ft=0;jt.cmp($t)!==0;Ft++)jt=jt.redSqr();j(Ft=0;_t--){for(var Mt=gt.words[_t],Vt=It-1;Vt>=0;Vt--){var Gt=Mt>>Vt&1;if($t!==Et[0]&&($t=this.sqr($t)),Gt===0&&St===0){Rt=0;continue}St<<=1,St|=Gt,Rt++,!(Rt!==xt&&(_t!==0||Vt!==0))&&($t=this.mul($t,Et[St]),Rt=0,St=0)}It=26}return $t},Tt.prototype.convertTo=function(mt){var gt=mt.umod(this.m);return gt===mt?gt.clone():gt},Tt.prototype.convertFrom=function(mt){var gt=mt.clone();return gt.red=null,gt},et.mont=function(mt){return new ht(mt)};function ht(bt){Tt.call(this,bt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new et(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)}_e(ht,Tt),ht.prototype.convertTo=function(mt){return this.imod(mt.ushln(this.shift))},ht.prototype.convertFrom=function(mt){var gt=this.imod(mt.mul(this.rinv));return gt.red=null,gt},ht.prototype.imul=function(mt,gt){if(mt.isZero()||gt.isZero())return mt.words[0]=0,mt.length=1,mt;var xt=mt.imul(gt),Et=xt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_t=xt.isub(Et).iushrn(this.shift),$t=_t;return _t.cmp(this.m)>=0?$t=_t.isub(this.m):_t.cmpn(0)<0&&($t=_t.iadd(this.m)),$t._forceRed(this)},ht.prototype.mul=function(mt,gt){if(mt.isZero()||gt.isZero())return new et(0)._forceRed(this);var xt=mt.mul(gt),Et=xt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),_t=xt.isub(Et).iushrn(this.shift),$t=_t;return _t.cmp(this.m)>=0?$t=_t.isub(this.m):_t.cmpn(0)<0&&($t=_t.iadd(this.m)),$t._forceRed(this)},ht.prototype.invm=function(mt){var gt=this.imod(mt._invmp(this.m).mul(this.r2));return gt._forceRed(this)}})(o,commonjsGlobal)})(bn$1);var bnExports$1=bn$1.exports;const BN$7=getDefaultExportFromCjs$1(bnExports$1);function number$4(o){if(!Number.isSafeInteger(o)||o<0)throw new Error(`positive integer expected, not ${o}`)}function bool(o){if(typeof o!="boolean")throw new Error(`boolean expected, not ${o}`)}function isBytes$1(o){return o instanceof Uint8Array||o!=null&&typeof o=="object"&&o.constructor.name==="Uint8Array"}function bytes$1(o,..._){if(!isBytes$1(o))throw new Error("Uint8Array expected");if(_.length>0&&!_.includes(o.length))throw new Error(`Uint8Array expected of length ${_}, not of length=${o.length}`)}function hash$5(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$4(o.outputLen),number$4(o.blockLen)}function exists$1(o,_=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(_&&o.finished)throw new Error("Hash#digest() has already been called")}function output$1(o,_){bytes$1(o);const $=_.outputLen;if(o.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}const assert$i={number:number$4,bool,bytes:bytes$1,hash:hash$5,exists:exists$1,output:output$1},crypto$2=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u32$1=o=>new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)),createView$1=o=>new DataView(o.buffer,o.byteOffset,o.byteLength),rotr$1=(o,_)=>o<<32-_|o>>>_,isLE$1=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,byteSwap=o=>o<<24&4278190080|o<<8&16711680|o>>>8&65280|o>>>24&255;function byteSwap32(o){for(let _=0;_o().update(toBytes$2(j)).digest(),$=o();return _.outputLen=$.outputLen,_.blockLen=$.blockLen,_.create=()=>o(),_}function randomBytes$2(o=32){if(crypto$2&&typeof crypto$2.getRandomValues=="function")return crypto$2.getRandomValues(new Uint8Array(o));throw new Error("crypto.getRandomValues must be defined")}let HMAC$1=class extends Hash$1{constructor(_,$){super(),this.finished=!1,this.destroyed=!1,hash$5(_);const j=toBytes$2($);if(this.iHash=_.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const _e=this.blockLen,et=new Uint8Array(_e);et.set(j.length>_e?_.create().update(j).digest():j);for(let tt=0;ttnew HMAC$1(o,_).update($).digest();hmac$2.create=(o,_)=>new HMAC$1(o,_);function setBigUint64$1(o,_,$,j){if(typeof o.setBigUint64=="function")return o.setBigUint64(_,$,j);const _e=BigInt(32),et=BigInt(4294967295),tt=Number($>>_e&et),rt=Number($&et),nt=j?4:0,ot=j?0:4;o.setUint32(_+nt,tt,j),o.setUint32(_+ot,rt,j)}const Chi$1=(o,_,$)=>o&_^~o&$,Maj$1=(o,_,$)=>o&_^o&$^_&$;class HashMD extends Hash$1{constructor(_,$,j,_e){super(),this.blockLen=_,this.outputLen=$,this.padOffset=j,this.isLE=_e,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(_),this.view=createView$1(this.buffer)}update(_){exists$1(this);const{view:$,buffer:j,blockLen:_e}=this;_=toBytes$2(_);const et=_.length;for(let tt=0;tt_e-tt&&(this.process(j,0),tt=0);for(let st=tt;st<_e;st++)$[st]=0;setBigUint64$1(j,_e-8,BigInt(this.length*8),et),this.process(j,0);const rt=createView$1(_),nt=this.outputLen;if(nt%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const ot=nt/4,it=this.get();if(ot>it.length)throw new Error("_sha2: outputLen bigger than state");for(let st=0;st>>3,ft=rotr$1(lt,17)^rotr$1(lt,19)^lt>>>10;SHA256_W$1[st]=ft+SHA256_W$1[st-7]+ct+SHA256_W$1[st-16]|0}let{A:j,B:_e,C:et,D:tt,E:rt,F:nt,G:ot,H:it}=this;for(let st=0;st<64;st++){const at=rotr$1(rt,6)^rotr$1(rt,11)^rotr$1(rt,25),lt=it+at+Chi$1(rt,nt,ot)+SHA256_K$1[st]+SHA256_W$1[st]|0,ft=(rotr$1(j,2)^rotr$1(j,13)^rotr$1(j,22))+Maj$1(j,_e,et)|0;it=ot,ot=nt,nt=rt,rt=tt+lt|0,tt=et,et=_e,_e=j,j=lt+ft|0}j=j+this.A|0,_e=_e+this.B|0,et=et+this.C|0,tt=tt+this.D|0,rt=rt+this.E|0,nt=nt+this.F|0,ot=ot+this.G|0,it=it+this.H|0,this.set(j,_e,et,tt,rt,nt,ot,it)}roundClean(){SHA256_W$1.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}};const sha256$3=wrapConstructor$1(()=>new SHA256$3),U32_MASK64$1=BigInt(2**32-1),_32n$1=BigInt(32);function fromBig$1(o,_=!1){return _?{h:Number(o&U32_MASK64$1),l:Number(o>>_32n$1&U32_MASK64$1)}:{h:Number(o>>_32n$1&U32_MASK64$1)|0,l:Number(o&U32_MASK64$1)|0}}function split$1(o,_=!1){let $=new Uint32Array(o.length),j=new Uint32Array(o.length);for(let _e=0;_eo<<$|_>>>32-$,rotlSL$1=(o,_,$)=>_<<$|o>>>32-$,rotlBH$1=(o,_,$)=>_<<$-32|o>>>64-$,rotlBL$1=(o,_,$)=>o<<$-32|_>>>64-$;/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _1n$b=BigInt(1),_2n$7=BigInt(2);function isBytes(o){return o instanceof Uint8Array||o!=null&&typeof o=="object"&&o.constructor.name==="Uint8Array"}function abytes(o){if(!isBytes(o))throw new Error("Uint8Array expected")}const hexes$1=Array.from({length:256},(o,_)=>_.toString(16).padStart(2,"0"));function bytesToHex$2(o){abytes(o);let _="";for(let $=0;$=asciis._0&&o<=asciis._9)return o-asciis._0;if(o>=asciis._A&&o<=asciis._F)return o-(asciis._A-10);if(o>=asciis._a&&o<=asciis._f)return o-(asciis._a-10)}function hexToBytes$2(o){if(typeof o!="string")throw new Error("hex string expected, got "+typeof o);const _=o.length,$=_/2;if(_%2)throw new Error("padded hex string expected, got unpadded hex of length "+_);const j=new Uint8Array($);for(let _e=0,et=0;_e<$;_e++,et+=2){const tt=asciiToBase16(o.charCodeAt(et)),rt=asciiToBase16(o.charCodeAt(et+1));if(tt===void 0||rt===void 0){const nt=o[et]+o[et+1];throw new Error('hex string expected, got non-hex character "'+nt+'" at index '+et)}j[_e]=tt*16+rt}return j}function bytesToNumberBE$1(o){return hexToNumber$1(bytesToHex$2(o))}function bytesToNumberLE$1(o){return abytes(o),hexToNumber$1(bytesToHex$2(Uint8Array.from(o).reverse()))}function numberToBytesBE$1(o,_){return hexToBytes$2(o.toString(16).padStart(_*2,"0"))}function numberToBytesLE$1(o,_){return numberToBytesBE$1(o,_).reverse()}function ensureBytes$1(o,_,$){let j;if(typeof _=="string")try{j=hexToBytes$2(_)}catch(et){throw new Error(`${o} must be valid hex string, got "${_}". Cause: ${et}`)}else if(isBytes(_))j=Uint8Array.from(_);else throw new Error(`${o} must be hex string or Uint8Array`);const _e=j.length;if(typeof $=="number"&&_e!==$)throw new Error(`${o} expected ${$} bytes, got ${_e}`);return j}function concatBytes$2(...o){let _=0;for(let j=0;j(_2n$7<new Uint8Array(o),u8fr$1=o=>Uint8Array.from(o);function createHmacDrbg$1(o,_,$){if(typeof o!="number"||o<2)throw new Error("hashLen must be a number");if(typeof _!="number"||_<2)throw new Error("qByteLen must be a number");if(typeof $!="function")throw new Error("hmacFn must be a function");let j=u8n$1(o),_e=u8n$1(o),et=0;const tt=()=>{j.fill(1),_e.fill(0),et=0},rt=(...st)=>$(_e,j,...st),nt=(st=u8n$1())=>{_e=rt(u8fr$1([0]),st),j=rt(),st.length!==0&&(_e=rt(u8fr$1([1]),st),j=rt())},ot=()=>{if(et++>=1e3)throw new Error("drbg: tried 1000 values");let st=0;const at=[];for(;st<_;){j=rt();const lt=j.slice();at.push(lt),st+=j.length}return concatBytes$2(...at)};return(st,at)=>{tt(),nt(st);let lt;for(;!(lt=at(ot()));)nt();return tt(),lt}}const validatorFns$1={bigint:o=>typeof o=="bigint",function:o=>typeof o=="function",boolean:o=>typeof o=="boolean",string:o=>typeof o=="string",stringOrUint8Array:o=>typeof o=="string"||isBytes(o),isSafeInteger:o=>Number.isSafeInteger(o),array:o=>Array.isArray(o),field:(o,_)=>_.Fp.isValid(o),hash:o=>typeof o=="function"&&Number.isSafeInteger(o.outputLen)};function validateObject$4(o,_,$={}){const j=(_e,et,tt)=>{const rt=validatorFns$1[et];if(typeof rt!="function")throw new Error(`Invalid validator "${et}", expected function`);const nt=o[_e];if(!(tt&&nt===void 0)&&!rt(nt,o))throw new Error(`Invalid param ${String(_e)}=${nt} (${typeof nt}), expected ${et}`)};for(const[_e,et]of Object.entries(_))j(_e,et,!1);for(const[_e,et]of Object.entries($))j(_e,et,!0);return o}const ut$1=Object.freeze(Object.defineProperty({__proto__:null,abytes,bitMask:bitMask$1,bytesToHex:bytesToHex$2,bytesToNumberBE:bytesToNumberBE$1,bytesToNumberLE:bytesToNumberLE$1,concatBytes:concatBytes$2,createHmacDrbg:createHmacDrbg$1,ensureBytes:ensureBytes$1,hexToBytes:hexToBytes$2,hexToNumber:hexToNumber$1,isBytes,numberToBytesBE:numberToBytesBE$1,numberToBytesLE:numberToBytesLE$1,validateObject:validateObject$4},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$7=BigInt(0),_1n$a=BigInt(1),_2n$6=BigInt(2),_3n$3=BigInt(3),_4n$1=BigInt(4),_5n$1=BigInt(5),_8n$1=BigInt(8);BigInt(9);BigInt(16);function mod$1(o,_){const $=o%_;return $>=_0n$7?$:_+$}function pow$4(o,_,$){if($<=_0n$7||_<_0n$7)throw new Error("Expected power/modulo > 0");if($===_1n$a)return _0n$7;let j=_1n$a;for(;_>_0n$7;)_&_1n$a&&(j=j*o%$),o=o*o%$,_>>=_1n$a;return j}function pow2$1(o,_,$){let j=o;for(;_-- >_0n$7;)j*=j,j%=$;return j}function invert$1(o,_){if(o===_0n$7||_<=_0n$7)throw new Error(`invert: expected positive integers, got n=${o} mod=${_}`);let $=mod$1(o,_),j=_,_e=_0n$7,et=_1n$a;for(;$!==_0n$7;){const rt=j/$,nt=j%$,ot=_e-et*rt;j=$,$=nt,_e=et,et=ot}if(j!==_1n$a)throw new Error("invert: does not exist");return mod$1(_e,_)}function tonelliShanks$1(o){const _=(o-_1n$a)/_2n$6;let $,j,_e;for($=o-_1n$a,j=0;$%_2n$6===_0n$7;$/=_2n$6,j++);for(_e=_2n$6;_e(j[_e]="function",j),_);return validateObject$4(o,$)}function FpPow$1(o,_,$){if($<_0n$7)throw new Error("Expected power > 0");if($===_0n$7)return o.ONE;if($===_1n$a)return _;let j=o.ONE,_e=_;for(;$>_0n$7;)$&_1n$a&&(j=o.mul(j,_e)),_e=o.sqr(_e),$>>=_1n$a;return j}function FpInvertBatch$1(o,_){const $=new Array(_.length),j=_.reduce((et,tt,rt)=>o.is0(tt)?et:($[rt]=et,o.mul(et,tt)),o.ONE),_e=o.inv(j);return _.reduceRight((et,tt,rt)=>o.is0(tt)?et:($[rt]=o.mul(et,$[rt]),o.mul(et,tt)),_e),$}function nLength$1(o,_){const $=_!==void 0?_:o.toString(2).length,j=Math.ceil($/8);return{nBitLength:$,nByteLength:j}}function Field$1(o,_,$=!1,j={}){if(o<=_0n$7)throw new Error(`Expected Field ORDER > 0, got ${o}`);const{nBitLength:_e,nByteLength:et}=nLength$1(o,_);if(et>2048)throw new Error("Field lengths over 2048 bytes are not supported");const tt=FpSqrt$1(o),rt=Object.freeze({ORDER:o,BITS:_e,BYTES:et,MASK:bitMask$1(_e),ZERO:_0n$7,ONE:_1n$a,create:nt=>mod$1(nt,o),isValid:nt=>{if(typeof nt!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof nt}`);return _0n$7<=nt&&ntnt===_0n$7,isOdd:nt=>(nt&_1n$a)===_1n$a,neg:nt=>mod$1(-nt,o),eql:(nt,ot)=>nt===ot,sqr:nt=>mod$1(nt*nt,o),add:(nt,ot)=>mod$1(nt+ot,o),sub:(nt,ot)=>mod$1(nt-ot,o),mul:(nt,ot)=>mod$1(nt*ot,o),pow:(nt,ot)=>FpPow$1(rt,nt,ot),div:(nt,ot)=>mod$1(nt*invert$1(ot,o),o),sqrN:nt=>nt*nt,addN:(nt,ot)=>nt+ot,subN:(nt,ot)=>nt-ot,mulN:(nt,ot)=>nt*ot,inv:nt=>invert$1(nt,o),sqrt:j.sqrt||(nt=>tt(rt,nt)),invertBatch:nt=>FpInvertBatch$1(rt,nt),cmov:(nt,ot,it)=>it?ot:nt,toBytes:nt=>$?numberToBytesLE$1(nt,et):numberToBytesBE$1(nt,et),fromBytes:nt=>{if(nt.length!==et)throw new Error(`Fp.fromBytes: expected ${et}, got ${nt.length}`);return $?bytesToNumberLE$1(nt):bytesToNumberBE$1(nt)}});return Object.freeze(rt)}function getFieldBytesLength$1(o){if(typeof o!="bigint")throw new Error("field order must be bigint");const _=o.toString(2).length;return Math.ceil(_/8)}function getMinHashLength$1(o){const _=getFieldBytesLength$1(o);return _+Math.ceil(_/2)}function mapHashToField$1(o,_,$=!1){const j=o.length,_e=getFieldBytesLength$1(_),et=getMinHashLength$1(_);if(j<16||j1024)throw new Error(`expected ${et}-1024 bytes of input, got ${j}`);const tt=$?bytesToNumberBE$1(o):bytesToNumberLE$1(o),rt=mod$1(tt,_-_1n$a)+_1n$a;return $?numberToBytesLE$1(rt,_e):numberToBytesBE$1(rt,_e)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$6=BigInt(0),_1n$9=BigInt(1);function wNAF$1(o,_){const $=(_e,et)=>{const tt=et.negate();return _e?tt:et},j=_e=>{const et=Math.ceil(_/_e)+1,tt=2**(_e-1);return{windows:et,windowSize:tt}};return{constTimeNegate:$,unsafeLadder(_e,et){let tt=o.ZERO,rt=_e;for(;et>_0n$6;)et&_1n$9&&(tt=tt.add(rt)),rt=rt.double(),et>>=_1n$9;return tt},precomputeWindow(_e,et){const{windows:tt,windowSize:rt}=j(et),nt=[];let ot=_e,it=ot;for(let st=0;st>=lt,dt>nt&&(dt-=at,tt+=_1n$9);const pt=ft,yt=ft+Math.abs(dt)-1,vt=ct%2!==0,wt=dt<0;dt===0?it=it.add($(vt,et[pt])):ot=ot.add($(wt,et[yt]))}return{p:ot,f:it}},wNAFCached(_e,et,tt,rt){const nt=_e._WINDOW_SIZE||1;let ot=et.get(_e);return ot||(ot=this.precomputeWindow(_e,nt),nt!==1&&et.set(_e,rt(ot))),this.wNAF(nt,ot,tt)}}}function validateBasic$1(o){return validateField$1(o.Fp),validateObject$4(o,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength$1(o.n,o.nBitLength),...o,p:o.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts$1(o){const _=validateBasic$1(o);validateObject$4(_,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:$,Fp:j,a:_e}=_;if($){if(!j.eql(_e,j.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof $!="object"||typeof $.beta!="bigint"||typeof $.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({..._})}const{bytesToNumberBE:b2n$1,hexToBytes:h2b$1}=ut$1,DER$1={Err:class extends Error{constructor(_=""){super(_)}},_parseInt(o){const{Err:_}=DER$1;if(o.length<2||o[0]!==2)throw new _("Invalid signature integer tag");const $=o[1],j=o.subarray(2,$+2);if(!$||j.length!==$)throw new _("Invalid signature integer: wrong length");if(j[0]&128)throw new _("Invalid signature integer: negative");if(j[0]===0&&!(j[1]&128))throw new _("Invalid signature integer: unnecessary leading zero");return{d:b2n$1(j),l:o.subarray($+2)}},toSig(o){const{Err:_}=DER$1,$=typeof o=="string"?h2b$1(o):o;abytes($);let j=$.length;if(j<2||$[0]!=48)throw new _("Invalid signature tag");if($[1]!==j-2)throw new _("Invalid signature: incorrect length");const{d:_e,l:et}=DER$1._parseInt($.subarray(2)),{d:tt,l:rt}=DER$1._parseInt(et);if(rt.length)throw new _("Invalid signature: left bytes after parsing");return{r:_e,s:tt}},hexFromSig(o){const _=ot=>Number.parseInt(ot[0],16)&8?"00"+ot:ot,$=ot=>{const it=ot.toString(16);return it.length&1?`0${it}`:it},j=_($(o.s)),_e=_($(o.r)),et=j.length/2,tt=_e.length/2,rt=$(et),nt=$(tt);return`30${$(tt+et+4)}02${nt}${_e}02${rt}${j}`}},_0n$5=BigInt(0),_1n$8=BigInt(1);BigInt(2);const _3n$2=BigInt(3);BigInt(4);function weierstrassPoints$1(o){const _=validatePointOpts$1(o),{Fp:$}=_,j=_.toBytes||((ct,ft,dt)=>{const pt=ft.toAffine();return concatBytes$2(Uint8Array.from([4]),$.toBytes(pt.x),$.toBytes(pt.y))}),_e=_.fromBytes||(ct=>{const ft=ct.subarray(1),dt=$.fromBytes(ft.subarray(0,$.BYTES)),pt=$.fromBytes(ft.subarray($.BYTES,2*$.BYTES));return{x:dt,y:pt}});function et(ct){const{a:ft,b:dt}=_,pt=$.sqr(ct),yt=$.mul(pt,ct);return $.add($.add(yt,$.mul(ct,ft)),dt)}if(!$.eql($.sqr(_.Gy),et(_.Gx)))throw new Error("bad generator point: equation left != right");function tt(ct){return typeof ct=="bigint"&&_0n$5$.eql(vt,$.ZERO);return yt(dt)&&yt(pt)?st.ZERO:new st(dt,pt,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ft){const dt=$.invertBatch(ft.map(pt=>pt.pz));return ft.map((pt,yt)=>pt.toAffine(dt[yt])).map(st.fromAffine)}static fromHex(ft){const dt=st.fromAffine(_e(ensureBytes$1("pointHex",ft)));return dt.assertValidity(),dt}static fromPrivateKey(ft){return st.BASE.multiply(nt(ft))}_setWindowSize(ft){this._WINDOW_SIZE=ft,ot.delete(this)}assertValidity(){if(this.is0()){if(_.allowInfinityPoint&&!$.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:ft,y:dt}=this.toAffine();if(!$.isValid(ft)||!$.isValid(dt))throw new Error("bad point: x or y not FE");const pt=$.sqr(dt),yt=et(ft);if(!$.eql(pt,yt))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:ft}=this.toAffine();if($.isOdd)return!$.isOdd(ft);throw new Error("Field doesn't support isOdd")}equals(ft){it(ft);const{px:dt,py:pt,pz:yt}=this,{px:vt,py:wt,pz:Ct}=ft,Pt=$.eql($.mul(dt,Ct),$.mul(vt,yt)),Bt=$.eql($.mul(pt,Ct),$.mul(wt,yt));return Pt&&Bt}negate(){return new st(this.px,$.neg(this.py),this.pz)}double(){const{a:ft,b:dt}=_,pt=$.mul(dt,_3n$2),{px:yt,py:vt,pz:wt}=this;let Ct=$.ZERO,Pt=$.ZERO,Bt=$.ZERO,At=$.mul(yt,yt),kt=$.mul(vt,vt),Ot=$.mul(wt,wt),Tt=$.mul(yt,vt);return Tt=$.add(Tt,Tt),Bt=$.mul(yt,wt),Bt=$.add(Bt,Bt),Ct=$.mul(ft,Bt),Pt=$.mul(pt,Ot),Pt=$.add(Ct,Pt),Ct=$.sub(kt,Pt),Pt=$.add(kt,Pt),Pt=$.mul(Ct,Pt),Ct=$.mul(Tt,Ct),Bt=$.mul(pt,Bt),Ot=$.mul(ft,Ot),Tt=$.sub(At,Ot),Tt=$.mul(ft,Tt),Tt=$.add(Tt,Bt),Bt=$.add(At,At),At=$.add(Bt,At),At=$.add(At,Ot),At=$.mul(At,Tt),Pt=$.add(Pt,At),Ot=$.mul(vt,wt),Ot=$.add(Ot,Ot),At=$.mul(Ot,Tt),Ct=$.sub(Ct,At),Bt=$.mul(Ot,kt),Bt=$.add(Bt,Bt),Bt=$.add(Bt,Bt),new st(Ct,Pt,Bt)}add(ft){it(ft);const{px:dt,py:pt,pz:yt}=this,{px:vt,py:wt,pz:Ct}=ft;let Pt=$.ZERO,Bt=$.ZERO,At=$.ZERO;const kt=_.a,Ot=$.mul(_.b,_3n$2);let Tt=$.mul(dt,vt),ht=$.mul(pt,wt),bt=$.mul(yt,Ct),mt=$.add(dt,pt),gt=$.add(vt,wt);mt=$.mul(mt,gt),gt=$.add(Tt,ht),mt=$.sub(mt,gt),gt=$.add(dt,yt);let xt=$.add(vt,Ct);return gt=$.mul(gt,xt),xt=$.add(Tt,bt),gt=$.sub(gt,xt),xt=$.add(pt,yt),Pt=$.add(wt,Ct),xt=$.mul(xt,Pt),Pt=$.add(ht,bt),xt=$.sub(xt,Pt),At=$.mul(kt,gt),Pt=$.mul(Ot,bt),At=$.add(Pt,At),Pt=$.sub(ht,At),At=$.add(ht,At),Bt=$.mul(Pt,At),ht=$.add(Tt,Tt),ht=$.add(ht,Tt),bt=$.mul(kt,bt),gt=$.mul(Ot,gt),ht=$.add(ht,bt),bt=$.sub(Tt,bt),bt=$.mul(kt,bt),gt=$.add(gt,bt),Tt=$.mul(ht,gt),Bt=$.add(Bt,Tt),Tt=$.mul(xt,gt),Pt=$.mul(mt,Pt),Pt=$.sub(Pt,Tt),Tt=$.mul(mt,ht),At=$.mul(xt,At),At=$.add(At,Tt),new st(Pt,Bt,At)}subtract(ft){return this.add(ft.negate())}is0(){return this.equals(st.ZERO)}wNAF(ft){return lt.wNAFCached(this,ot,ft,dt=>{const pt=$.invertBatch(dt.map(yt=>yt.pz));return dt.map((yt,vt)=>yt.toAffine(pt[vt])).map(st.fromAffine)})}multiplyUnsafe(ft){const dt=st.ZERO;if(ft===_0n$5)return dt;if(rt(ft),ft===_1n$8)return this;const{endo:pt}=_;if(!pt)return lt.unsafeLadder(this,ft);let{k1neg:yt,k1:vt,k2neg:wt,k2:Ct}=pt.splitScalar(ft),Pt=dt,Bt=dt,At=this;for(;vt>_0n$5||Ct>_0n$5;)vt&_1n$8&&(Pt=Pt.add(At)),Ct&_1n$8&&(Bt=Bt.add(At)),At=At.double(),vt>>=_1n$8,Ct>>=_1n$8;return yt&&(Pt=Pt.negate()),wt&&(Bt=Bt.negate()),Bt=new st($.mul(Bt.px,pt.beta),Bt.py,Bt.pz),Pt.add(Bt)}multiply(ft){rt(ft);let dt=ft,pt,yt;const{endo:vt}=_;if(vt){const{k1neg:wt,k1:Ct,k2neg:Pt,k2:Bt}=vt.splitScalar(dt);let{p:At,f:kt}=this.wNAF(Ct),{p:Ot,f:Tt}=this.wNAF(Bt);At=lt.constTimeNegate(wt,At),Ot=lt.constTimeNegate(Pt,Ot),Ot=new st($.mul(Ot.px,vt.beta),Ot.py,Ot.pz),pt=At.add(Ot),yt=kt.add(Tt)}else{const{p:wt,f:Ct}=this.wNAF(dt);pt=wt,yt=Ct}return st.normalizeZ([pt,yt])[0]}multiplyAndAddUnsafe(ft,dt,pt){const yt=st.BASE,vt=(Ct,Pt)=>Pt===_0n$5||Pt===_1n$8||!Ct.equals(yt)?Ct.multiplyUnsafe(Pt):Ct.multiply(Pt),wt=vt(this,dt).add(vt(ft,pt));return wt.is0()?void 0:wt}toAffine(ft){const{px:dt,py:pt,pz:yt}=this,vt=this.is0();ft==null&&(ft=vt?$.ONE:$.inv(yt));const wt=$.mul(dt,ft),Ct=$.mul(pt,ft),Pt=$.mul(yt,ft);if(vt)return{x:$.ZERO,y:$.ZERO};if(!$.eql(Pt,$.ONE))throw new Error("invZ was invalid");return{x:wt,y:Ct}}isTorsionFree(){const{h:ft,isTorsionFree:dt}=_;if(ft===_1n$8)return!0;if(dt)return dt(st,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ft,clearCofactor:dt}=_;return ft===_1n$8?this:dt?dt(st,this):this.multiplyUnsafe(_.h)}toRawBytes(ft=!0){return this.assertValidity(),j(st,this,ft)}toHex(ft=!0){return bytesToHex$2(this.toRawBytes(ft))}}st.BASE=new st(_.Gx,_.Gy,$.ONE),st.ZERO=new st($.ZERO,$.ONE,$.ZERO);const at=_.nBitLength,lt=wNAF$1(st,_.endo?Math.ceil(at/2):at);return{CURVE:_,ProjectivePoint:st,normPrivateKeyToScalar:nt,weierstrassEquation:et,isWithinCurveOrder:tt}}function validateOpts$1(o){const _=validateBasic$1(o);return validateObject$4(_,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,..._})}function weierstrass$1(o){const _=validateOpts$1(o),{Fp:$,n:j}=_,_e=$.BYTES+1,et=2*$.BYTES+1;function tt(gt){return _0n$5bytesToHex$2(numberToBytesBE$1(gt,_.nByteLength));function ct(gt){const xt=j>>_1n$8;return gt>xt}function ft(gt){return ct(gt)?rt(-gt):gt}const dt=(gt,xt,Et)=>bytesToNumberBE$1(gt.slice(xt,Et));class pt{constructor(xt,Et,_t){this.r=xt,this.s=Et,this.recovery=_t,this.assertValidity()}static fromCompact(xt){const Et=_.nByteLength;return xt=ensureBytes$1("compactSignature",xt,Et*2),new pt(dt(xt,0,Et),dt(xt,Et,2*Et))}static fromDER(xt){const{r:Et,s:_t}=DER$1.toSig(ensureBytes$1("DER",xt));return new pt(Et,_t)}assertValidity(){if(!at(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!at(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(xt){return new pt(this.r,this.s,xt)}recoverPublicKey(xt){const{r:Et,s:_t,recovery:$t}=this,St=Bt(ensureBytes$1("msgHash",xt));if($t==null||![0,1,2,3].includes($t))throw new Error("recovery id invalid");const Rt=$t===2||$t===3?Et+_.n:Et;if(Rt>=$.ORDER)throw new Error("recovery id 2 or 3 invalid");const It=$t&1?"03":"02",Mt=ot.fromHex(It+lt(Rt)),Vt=nt(Rt),Gt=rt(-St*Vt),zt=rt(_t*Vt),jt=ot.BASE.multiplyAndAddUnsafe(Mt,Gt,zt);if(!jt)throw new Error("point at infinify");return jt.assertValidity(),jt}hasHighS(){return ct(this.s)}normalizeS(){return this.hasHighS()?new pt(this.r,rt(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes$2(this.toDERHex())}toDERHex(){return DER$1.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes$2(this.toCompactHex())}toCompactHex(){return lt(this.r)+lt(this.s)}}const yt={isValidPrivateKey(gt){try{return it(gt),!0}catch{return!1}},normPrivateKeyToScalar:it,randomPrivateKey:()=>{const gt=getMinHashLength$1(_.n);return mapHashToField$1(_.randomBytes(gt),_.n)},precompute(gt=8,xt=ot.BASE){return xt._setWindowSize(gt),xt.multiply(BigInt(3)),xt}};function vt(gt,xt=!0){return ot.fromPrivateKey(gt).toRawBytes(xt)}function wt(gt){const xt=isBytes(gt),Et=typeof gt=="string",_t=(xt||Et)&>.length;return xt?_t===_e||_t===et:Et?_t===2*_e||_t===2*et:gt instanceof ot}function Ct(gt,xt,Et=!0){if(wt(gt))throw new Error("first arg must be private key");if(!wt(xt))throw new Error("second arg must be public key");return ot.fromHex(xt).multiply(it(gt)).toRawBytes(Et)}const Pt=_.bits2int||function(gt){const xt=bytesToNumberBE$1(gt),Et=gt.length*8-_.nBitLength;return Et>0?xt>>BigInt(Et):xt},Bt=_.bits2int_modN||function(gt){return rt(Pt(gt))},At=bitMask$1(_.nBitLength);function kt(gt){if(typeof gt!="bigint")throw new Error("bigint expected");if(!(_0n$5<=gt&>qt in Et))throw new Error("sign() legacy options not supported");const{hash:_t,randomBytes:$t}=_;let{lowS:St,prehash:Rt,extraEntropy:It}=Et;St==null&&(St=!0),gt=ensureBytes$1("msgHash",gt),Rt&&(gt=ensureBytes$1("prehashed msgHash",_t(gt)));const Mt=Bt(gt),Vt=it(xt),Gt=[kt(Vt),kt(Mt)];if(It!=null&&It!==!1){const qt=It===!0?$t($.BYTES):It;Gt.push(ensureBytes$1("extraEntropy",qt))}const zt=concatBytes$2(...Gt),jt=Mt;function Ft(qt){const Xt=Pt(qt);if(!at(Xt))return;const Ut=nt(Xt),Lt=ot.BASE.multiply(Xt).toAffine(),Ht=rt(Lt.x);if(Ht===_0n$5)return;const Kt=rt(Ut*rt(jt+Ht*Vt));if(Kt===_0n$5)return;let Jt=(Lt.x===Ht?0:2)|Number(Lt.y&_1n$8),tr=Kt;return St&&ct(Kt)&&(tr=ft(Kt),Jt^=1),new pt(Ht,tr,Jt)}return{seed:zt,k2sig:Ft}}const Tt={lowS:_.lowS,prehash:!1},ht={lowS:_.lowS,prehash:!1};function bt(gt,xt,Et=Tt){const{seed:_t,k2sig:$t}=Ot(gt,xt,Et),St=_;return createHmacDrbg$1(St.hash.outputLen,St.nByteLength,St.hmac)(_t,$t)}ot.BASE._setWindowSize(8);function mt(gt,xt,Et,_t=ht){var Lt;const $t=gt;if(xt=ensureBytes$1("msgHash",xt),Et=ensureBytes$1("publicKey",Et),"strict"in _t)throw new Error("options.strict was renamed to lowS");const{lowS:St,prehash:Rt}=_t;let It,Mt;try{if(typeof $t=="string"||isBytes($t))try{It=pt.fromDER($t)}catch(Ht){if(!(Ht instanceof DER$1.Err))throw Ht;It=pt.fromCompact($t)}else if(typeof $t=="object"&&typeof $t.r=="bigint"&&typeof $t.s=="bigint"){const{r:Ht,s:Kt}=$t;It=new pt(Ht,Kt)}else throw new Error("PARSE");Mt=ot.fromHex(Et)}catch(Ht){if(Ht.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(St&&It.hasHighS())return!1;Rt&&(xt=_.hash(xt));const{r:Vt,s:Gt}=It,zt=Bt(xt),jt=nt(Gt),Ft=rt(zt*jt),qt=rt(Vt*jt),Xt=(Lt=ot.BASE.multiplyAndAddUnsafe(Mt,Ft,qt))==null?void 0:Lt.toAffine();return Xt?rt(Xt.x)===Vt:!1}return{CURVE:_,getPublicKey:vt,getSharedSecret:Ct,sign:bt,verify:mt,ProjectivePoint:ot,Signature:pt,utils:yt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash$1(o){return{hash:o,hmac:(_,...$)=>hmac$2(o,_,concatBytes$3(...$)),randomBytes:randomBytes$2}}function createCurve$1(o,_){const $=j=>weierstrass$1({...o,...getHash$1(j)});return Object.freeze({...$(_),create:$})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P$1=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N$1=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n$7=BigInt(1),_2n$5=BigInt(2),divNearest$1=(o,_)=>(o+_/_2n$5)/_;function sqrtMod$1(o){const _=secp256k1P$1,$=BigInt(3),j=BigInt(6),_e=BigInt(11),et=BigInt(22),tt=BigInt(23),rt=BigInt(44),nt=BigInt(88),ot=o*o*o%_,it=ot*ot*o%_,st=pow2$1(it,$,_)*it%_,at=pow2$1(st,$,_)*it%_,lt=pow2$1(at,_2n$5,_)*ot%_,ct=pow2$1(lt,_e,_)*lt%_,ft=pow2$1(ct,et,_)*ct%_,dt=pow2$1(ft,rt,_)*ft%_,pt=pow2$1(dt,nt,_)*dt%_,yt=pow2$1(pt,rt,_)*ft%_,vt=pow2$1(yt,$,_)*it%_,wt=pow2$1(vt,tt,_)*ct%_,Ct=pow2$1(wt,j,_)*ot%_,Pt=pow2$1(Ct,_2n$5,_);if(!Fp$1.eql(Fp$1.sqr(Pt),o))throw new Error("Cannot find square root");return Pt}const Fp$1=Field$1(secp256k1P$1,void 0,void 0,{sqrt:sqrtMod$1}),secp256k1$2=createCurve$1({a:BigInt(0),b:BigInt(7),Fp:Fp$1,n:secp256k1N$1,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:o=>{const _=secp256k1N$1,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),j=-_1n$7*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),_e=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),et=$,tt=BigInt("0x100000000000000000000000000000000"),rt=divNearest$1(et*o,_),nt=divNearest$1(-j*o,_);let ot=mod$1(o-rt*$-nt*_e,_),it=mod$1(-rt*j-nt*et,_);const st=ot>tt,at=it>tt;if(st&&(ot=_-ot),at&&(it=_-it),ot>tt||it>tt)throw new Error("splitScalar: Endomorphism failed, k="+o);return{k1neg:st,k1:ot,k2neg:at,k2:it}}}},sha256$3);BigInt(0);secp256k1$2.ProjectivePoint;var hash$4={},utils$n={},minimalisticAssert=assert$h;function assert$h(o,_){if(!o)throw new Error(_||"Assertion failed")}assert$h.equal=function(_,$,j){if(_!=$)throw new Error(j||"Assertion failed: "+_+" != "+$)};var inherits_browser={exports:{}};typeof Object.create=="function"?inherits_browser.exports=function(_,$){$&&(_.super_=$,_.prototype=Object.create($.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}))}:inherits_browser.exports=function(_,$){if($){_.super_=$;var j=function(){};j.prototype=$.prototype,_.prototype=new j,_.prototype.constructor=_}};var inherits_browserExports=inherits_browser.exports,assert$g=minimalisticAssert,inherits$3=inherits_browserExports;utils$n.inherits=inherits$3;function isSurrogatePair(o,_){return(o.charCodeAt(_)&64512)!==55296||_<0||_+1>=o.length?!1:(o.charCodeAt(_+1)&64512)===56320}function toArray$3(o,_){if(Array.isArray(o))return o.slice();if(!o)return[];var $=[];if(typeof o=="string")if(_){if(_==="hex")for(o=o.replace(/[^a-z0-9]+/ig,""),o.length%2!==0&&(o="0"+o),_e=0;_e>6|192,$[j++]=et&63|128):isSurrogatePair(o,_e)?(et=65536+((et&1023)<<10)+(o.charCodeAt(++_e)&1023),$[j++]=et>>18|240,$[j++]=et>>12&63|128,$[j++]=et>>6&63|128,$[j++]=et&63|128):($[j++]=et>>12|224,$[j++]=et>>6&63|128,$[j++]=et&63|128)}else for(_e=0;_e>>24|o>>>8&65280|o<<8&16711680|(o&255)<<24;return _>>>0}utils$n.htonl=htonl;function toHex32(o,_){for(var $="",j=0;j>>0}return et}utils$n.join32=join32;function split32(o,_){for(var $=new Array(o.length*4),j=0,_e=0;j>>24,$[_e+1]=et>>>16&255,$[_e+2]=et>>>8&255,$[_e+3]=et&255):($[_e+3]=et>>>24,$[_e+2]=et>>>16&255,$[_e+1]=et>>>8&255,$[_e]=et&255)}return $}utils$n.split32=split32;function rotr32$1(o,_){return o>>>_|o<<32-_}utils$n.rotr32=rotr32$1;function rotl32$2(o,_){return o<<_|o>>>32-_}utils$n.rotl32=rotl32$2;function sum32$3(o,_){return o+_>>>0}utils$n.sum32=sum32$3;function sum32_3$1(o,_,$){return o+_+$>>>0}utils$n.sum32_3=sum32_3$1;function sum32_4$2(o,_,$,j){return o+_+$+j>>>0}utils$n.sum32_4=sum32_4$2;function sum32_5$2(o,_,$,j,_e){return o+_+$+j+_e>>>0}utils$n.sum32_5=sum32_5$2;function sum64$1(o,_,$,j){var _e=o[_],et=o[_+1],tt=j+et>>>0,rt=(tt>>0,o[_+1]=tt}utils$n.sum64=sum64$1;function sum64_hi$1(o,_,$,j){var _e=_+j>>>0,et=(_e<_?1:0)+o+$;return et>>>0}utils$n.sum64_hi=sum64_hi$1;function sum64_lo$1(o,_,$,j){var _e=_+j;return _e>>>0}utils$n.sum64_lo=sum64_lo$1;function sum64_4_hi$1(o,_,$,j,_e,et,tt,rt){var nt=0,ot=_;ot=ot+j>>>0,nt+=ot<_?1:0,ot=ot+et>>>0,nt+=ot>>0,nt+=ot>>0}utils$n.sum64_4_hi=sum64_4_hi$1;function sum64_4_lo$1(o,_,$,j,_e,et,tt,rt){var nt=_+j+et+rt;return nt>>>0}utils$n.sum64_4_lo=sum64_4_lo$1;function sum64_5_hi$1(o,_,$,j,_e,et,tt,rt,nt,ot){var it=0,st=_;st=st+j>>>0,it+=st<_?1:0,st=st+et>>>0,it+=st>>0,it+=st>>0,it+=st>>0}utils$n.sum64_5_hi=sum64_5_hi$1;function sum64_5_lo$1(o,_,$,j,_e,et,tt,rt,nt,ot){var it=_+j+et+rt+ot;return it>>>0}utils$n.sum64_5_lo=sum64_5_lo$1;function rotr64_hi$1(o,_,$){var j=_<<32-$|o>>>$;return j>>>0}utils$n.rotr64_hi=rotr64_hi$1;function rotr64_lo$1(o,_,$){var j=o<<32-$|_>>>$;return j>>>0}utils$n.rotr64_lo=rotr64_lo$1;function shr64_hi$1(o,_,$){return o>>>$}utils$n.shr64_hi=shr64_hi$1;function shr64_lo$1(o,_,$){var j=o<<32-$|_>>>$;return j>>>0}utils$n.shr64_lo=shr64_lo$1;var common$5={},utils$m=utils$n,assert$f=minimalisticAssert;function BlockHash$4(){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}common$5.BlockHash=BlockHash$4;BlockHash$4.prototype.update=function(_,$){if(_=utils$m.toArray(_,$),this.pending?this.pending=this.pending.concat(_):this.pending=_,this.pendingTotal+=_.length,this.pending.length>=this._delta8){_=this.pending;var j=_.length%this._delta8;this.pending=_.slice(_.length-j,_.length),this.pending.length===0&&(this.pending=null),_=utils$m.join32(_,0,_.length-j,this.endian);for(var _e=0;_e<_.length;_e+=this._delta32)this._update(_,_e,_e+this._delta32)}return this};BlockHash$4.prototype.digest=function(_){return this.update(this._pad()),assert$f(this.pending===null),this._digest(_)};BlockHash$4.prototype._pad=function(){var _=this.pendingTotal,$=this._delta8,j=$-(_+this.padLength)%$,_e=new Array(j+this.padLength);_e[0]=128;for(var et=1;et>>24&255,_e[et++]=_>>>16&255,_e[et++]=_>>>8&255,_e[et++]=_&255}else for(_e[et++]=_&255,_e[et++]=_>>>8&255,_e[et++]=_>>>16&255,_e[et++]=_>>>24&255,_e[et++]=0,_e[et++]=0,_e[et++]=0,_e[et++]=0,tt=8;tt>>3}common$4.g0_256=g0_256$1;function g1_256$1(o){return rotr32(o,17)^rotr32(o,19)^o>>>10}common$4.g1_256=g1_256$1;var utils$k=utils$n,common$3=common$5,shaCommon$1=common$4,rotl32$1=utils$k.rotl32,sum32$2=utils$k.sum32,sum32_5$1=utils$k.sum32_5,ft_1=shaCommon$1.ft_1,BlockHash$3=common$3.BlockHash,sha1_K=[1518500249,1859775393,2400959708,3395469782];function SHA1(){if(!(this instanceof SHA1))return new SHA1;BlockHash$3.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}utils$k.inherits(SHA1,BlockHash$3);var _1=SHA1;SHA1.blockSize=512;SHA1.outSize=160;SHA1.hmacStrength=80;SHA1.padLength=64;SHA1.prototype._update=function(_,$){for(var j=this.W,_e=0;_e<16;_e++)j[_e]=_[$+_e];for(;_ethis.blockSize&&(_=new this.Hash().update(_).digest()),assert$c(_.length<=this.blockSize);for(var $=_.length;$1)for(var $=1;$"u"||!getProto$2?undefined$1:getProto$2(Uint8Array),INTRINSICS={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?undefined$1:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?undefined$1:ArrayBuffer,"%ArrayIteratorPrototype%":hasSymbols&&getProto$2?getProto$2([][Symbol.iterator]()):undefined$1,"%AsyncFromSyncIteratorPrototype%":undefined$1,"%AsyncFunction%":needsEval,"%AsyncGenerator%":needsEval,"%AsyncGeneratorFunction%":needsEval,"%AsyncIteratorPrototype%":needsEval,"%Atomics%":typeof Atomics>"u"?undefined$1:Atomics,"%BigInt%":typeof BigInt>"u"?undefined$1:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?undefined$1:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?undefined$1:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?undefined$1:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":$Error,"%eval%":eval,"%EvalError%":$EvalError,"%Float16Array%":typeof Float16Array>"u"?undefined$1:Float16Array,"%Float32Array%":typeof Float32Array>"u"?undefined$1:Float32Array,"%Float64Array%":typeof Float64Array>"u"?undefined$1:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?undefined$1:FinalizationRegistry,"%Function%":$Function,"%GeneratorFunction%":needsEval,"%Int8Array%":typeof Int8Array>"u"?undefined$1:Int8Array,"%Int16Array%":typeof Int16Array>"u"?undefined$1:Int16Array,"%Int32Array%":typeof Int32Array>"u"?undefined$1:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":hasSymbols&&getProto$2?getProto$2(getProto$2([][Symbol.iterator]())):undefined$1,"%JSON%":typeof JSON=="object"?JSON:undefined$1,"%Map%":typeof Map>"u"?undefined$1:Map,"%MapIteratorPrototype%":typeof Map>"u"||!hasSymbols||!getProto$2?undefined$1:getProto$2(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":$Object,"%Object.getOwnPropertyDescriptor%":$gOPD,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?undefined$1:Promise,"%Proxy%":typeof Proxy>"u"?undefined$1:Proxy,"%RangeError%":$RangeError,"%ReferenceError%":$ReferenceError,"%Reflect%":typeof Reflect>"u"?undefined$1:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?undefined$1:Set,"%SetIteratorPrototype%":typeof Set>"u"||!hasSymbols||!getProto$2?undefined$1:getProto$2(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?undefined$1:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":hasSymbols&&getProto$2?getProto$2(""[Symbol.iterator]()):undefined$1,"%Symbol%":hasSymbols?Symbol:undefined$1,"%SyntaxError%":$SyntaxError$1,"%ThrowTypeError%":ThrowTypeError,"%TypedArray%":TypedArray,"%TypeError%":$TypeError$3,"%Uint8Array%":typeof Uint8Array>"u"?undefined$1:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?undefined$1:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?undefined$1:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?undefined$1:Uint32Array,"%URIError%":$URIError,"%WeakMap%":typeof WeakMap>"u"?undefined$1:WeakMap,"%WeakRef%":typeof WeakRef>"u"?undefined$1:WeakRef,"%WeakSet%":typeof WeakSet>"u"?undefined$1:WeakSet,"%Function.prototype.call%":$call,"%Function.prototype.apply%":$apply$1,"%Object.defineProperty%":$defineProperty$2,"%Object.getPrototypeOf%":$ObjectGPO,"%Math.abs%":abs,"%Math.floor%":floor,"%Math.max%":max$1,"%Math.min%":min$1,"%Math.pow%":pow$2,"%Math.round%":round$2,"%Math.sign%":sign$3,"%Reflect.getPrototypeOf%":$ReflectGPO};if(getProto$2)try{null.error}catch(o){var errorProto=getProto$2(getProto$2(o));INTRINSICS["%Error.prototype%"]=errorProto}var doEval=function o(_){var $;if(_==="%AsyncFunction%")$=getEvalledConstructor("async function () {}");else if(_==="%GeneratorFunction%")$=getEvalledConstructor("function* () {}");else if(_==="%AsyncGeneratorFunction%")$=getEvalledConstructor("async function* () {}");else if(_==="%AsyncGenerator%"){var j=o("%AsyncGeneratorFunction%");j&&($=j.prototype)}else if(_==="%AsyncIteratorPrototype%"){var _e=o("%AsyncGenerator%");_e&&getProto$2&&($=getProto$2(_e.prototype))}return INTRINSICS[_]=$,$},LEGACY_ALIASES={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},bind$1=functionBind,hasOwn$1=requireHasown(),$concat=bind$1.call($call,Array.prototype.concat),$spliceApply=bind$1.call($apply$1,Array.prototype.splice),$replace=bind$1.call($call,String.prototype.replace),$strSlice=bind$1.call($call,String.prototype.slice),$exec$2=bind$1.call($call,RegExp.prototype.exec),rePropName=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=function(_){var $=$strSlice(_,0,1),j=$strSlice(_,-1);if($==="%"&&j!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected closing `%`");if(j==="%"&&$!=="%")throw new $SyntaxError$1("invalid intrinsic syntax, expected opening `%`");var _e=[];return $replace(_,rePropName,function(et,tt,rt,nt){_e[_e.length]=rt?$replace(nt,reEscapeChar,"$1"):tt||et}),_e},getBaseIntrinsic=function(_,$){var j=_,_e;if(hasOwn$1(LEGACY_ALIASES,j)&&(_e=LEGACY_ALIASES[j],j="%"+_e[0]+"%"),hasOwn$1(INTRINSICS,j)){var et=INTRINSICS[j];if(et===needsEval&&(et=doEval(j)),typeof et>"u"&&!$)throw new $TypeError$3("intrinsic "+_+" exists, but is not available. Please file an issue!");return{alias:_e,name:j,value:et}}throw new $SyntaxError$1("intrinsic "+_+" does not exist!")},getIntrinsic=function(_,$){if(typeof _!="string"||_.length===0)throw new $TypeError$3("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof $!="boolean")throw new $TypeError$3('"allowMissing" argument must be a boolean');if($exec$2(/^%?[^%]*%?$/,_)===null)throw new $SyntaxError$1("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var j=stringToPath(_),_e=j.length>0?j[0]:"",et=getBaseIntrinsic("%"+_e+"%",$),tt=et.name,rt=et.value,nt=!1,ot=et.alias;ot&&(_e=ot[0],$spliceApply(j,$concat([0,1],ot)));for(var it=1,st=!0;it=j.length){var ft=$gOPD(rt,at);st=!!ft,st&&"get"in ft&&!("originalValue"in ft.get)?rt=ft.get:rt=rt[at]}else st=hasOwn$1(rt,at),rt=rt[at];st&&!nt&&(INTRINSICS[tt]=rt)}}return rt},GetIntrinsic$1=getIntrinsic,callBindBasic=callBindApplyHelpers,$indexOf$2=callBindBasic([GetIntrinsic$1("%String.prototype.indexOf%")]),callBound$6=function(_,$){var j=GetIntrinsic$1(_,!!$);return typeof j=="function"&&$indexOf$2(_,".prototype.")>-1?callBindBasic([j]):j},hasToStringTag$4=shams(),callBound$5=callBound$6,$toString$2=callBound$5("Object.prototype.toString"),isStandardArguments=function(_){return hasToStringTag$4&&_&&typeof _=="object"&&Symbol.toStringTag in _?!1:$toString$2(_)==="[object Arguments]"},isLegacyArguments=function(_){return isStandardArguments(_)?!0:_!==null&&typeof _=="object"&&"length"in _&&typeof _.length=="number"&&_.length>=0&&$toString$2(_)!=="[object Array]"&&"callee"in _&&$toString$2(_.callee)==="[object Function]"},supportsStandardArguments=function(){return isStandardArguments(arguments)}();isStandardArguments.isLegacyArguments=isLegacyArguments;var isArguments$2=supportsStandardArguments?isStandardArguments:isLegacyArguments,callBound$4=callBound$6,hasToStringTag$3=shams(),hasOwn=requireHasown(),gOPD$2=gopd$1,fn;if(hasToStringTag$3){var $exec$1=callBound$4("RegExp.prototype.exec"),isRegexMarker={},throwRegexMarker=function(){throw isRegexMarker},badStringifier={toString:throwRegexMarker,valueOf:throwRegexMarker};typeof Symbol.toPrimitive=="symbol"&&(badStringifier[Symbol.toPrimitive]=throwRegexMarker),fn=function(_){if(!_||typeof _!="object")return!1;var $=gOPD$2(_,"lastIndex"),j=$&&hasOwn($,"value");if(!j)return!1;try{$exec$1(_,badStringifier)}catch(_e){return _e===isRegexMarker}}}else{var $toString$1=callBound$4("Object.prototype.toString"),regexClass="[object RegExp]";fn=function(_){return!_||typeof _!="object"&&typeof _!="function"?!1:$toString$1(_)===regexClass}}var isRegex$1=fn,callBound$3=callBound$6,isRegex=isRegex$1,$exec=callBound$3("RegExp.prototype.exec"),$TypeError$2=type,safeRegexTest$1=function(_){if(!isRegex(_))throw new $TypeError$2("`regex` must be a RegExp");return function(j){return $exec(_,j)!==null}},generatorFunction,hasRequiredGeneratorFunction;function requireGeneratorFunction(){if(hasRequiredGeneratorFunction)return generatorFunction;hasRequiredGeneratorFunction=1;const o=(function*(){}).constructor;return generatorFunction=()=>o,generatorFunction}var callBound$2=callBound$6,safeRegexTest=safeRegexTest$1,isFnRegex=safeRegexTest(/^\s*(?:function)?\*/),hasToStringTag$2=shams(),getProto$1=requireGetProto(),toStr$3=callBound$2("Object.prototype.toString"),fnToStr$1=callBound$2("Function.prototype.toString"),getGeneratorFunction=requireGeneratorFunction(),isGeneratorFunction=function(_){if(typeof _!="function")return!1;if(isFnRegex(fnToStr$1(_)))return!0;if(!hasToStringTag$2){var $=toStr$3(_);return $==="[object GeneratorFunction]"}if(!getProto$1)return!1;var j=getGeneratorFunction();return j&&getProto$1(_)===j.prototype},fnToStr=Function.prototype.toString,reflectApply=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,badArrayLike,isCallableMarker;if(typeof reflectApply=="function"&&typeof Object.defineProperty=="function")try{badArrayLike=Object.defineProperty({},"length",{get:function(){throw isCallableMarker}}),isCallableMarker={},reflectApply(function(){throw 42},null,badArrayLike)}catch(o){o!==isCallableMarker&&(reflectApply=null)}else reflectApply=null;var constructorRegex=/^\s*class\b/,isES6ClassFn=function(_){try{var $=fnToStr.call(_);return constructorRegex.test($)}catch{return!1}},tryFunctionObject=function(_){try{return isES6ClassFn(_)?!1:(fnToStr.call(_),!0)}catch{return!1}},toStr$2=Object.prototype.toString,objectClass="[object Object]",fnClass="[object Function]",genClass="[object GeneratorFunction]",ddaClass="[object HTMLAllCollection]",ddaClass2="[object HTML document.all class]",ddaClass3="[object HTMLCollection]",hasToStringTag$1=typeof Symbol=="function"&&!!Symbol.toStringTag,isIE68=!(0 in[,]),isDDA=function(){return!1};if(typeof document=="object"){var all=document.all;toStr$2.call(all)===toStr$2.call(document.all)&&(isDDA=function(_){if((isIE68||!_)&&(typeof _>"u"||typeof _=="object"))try{var $=toStr$2.call(_);return($===ddaClass||$===ddaClass2||$===ddaClass3||$===objectClass)&&_("")==null}catch{}return!1})}var isCallable$1=reflectApply?function(_){if(isDDA(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;try{reflectApply(_,null,badArrayLike)}catch($){if($!==isCallableMarker)return!1}return!isES6ClassFn(_)&&tryFunctionObject(_)}:function(_){if(isDDA(_))return!0;if(!_||typeof _!="function"&&typeof _!="object")return!1;if(hasToStringTag$1)return tryFunctionObject(_);if(isES6ClassFn(_))return!1;var $=toStr$2.call(_);return $!==fnClass&&$!==genClass&&!/^\[object HTML/.test($)?!1:tryFunctionObject(_)},isCallable=isCallable$1,toStr$1=Object.prototype.toString,hasOwnProperty=Object.prototype.hasOwnProperty,forEachArray=function(_,$,j){for(var _e=0,et=_.length;_e=3&&(_e=j),isArray$2(_)?forEachArray(_,$,_e):typeof _=="string"?forEachString(_,$,_e):forEachObject(_,$,_e)},possibleTypedArrayNames=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"],possibleNames=possibleTypedArrayNames,g$1=globalThis,availableTypedArrays$1=function(){for(var _=[],$=0;$3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new $TypeError$1("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new $TypeError$1("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new $TypeError$1("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new $TypeError$1("`loose`, if provided, must be a boolean");var _e=arguments.length>3?arguments[3]:null,et=arguments.length>4?arguments[4]:null,tt=arguments.length>5?arguments[5]:null,rt=arguments.length>6?arguments[6]:!1,nt=!!gopd&&gopd(_,$);if($defineProperty$1)$defineProperty$1(_,$,{configurable:tt===null&&nt?nt.configurable:!tt,enumerable:_e===null&&nt?nt.enumerable:!_e,value:j,writable:et===null&&nt?nt.writable:!et});else if(rt||!_e&&!et&&!tt)_[$]=j;else throw new $SyntaxError("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},$defineProperty=esDefineProperty,hasPropertyDescriptors=function(){return!!$defineProperty};hasPropertyDescriptors.hasArrayLengthDefineBug=function(){if(!$defineProperty)return null;try{return $defineProperty([],"length",{value:1}).length!==1}catch{return!0}};var hasPropertyDescriptors_1=hasPropertyDescriptors,GetIntrinsic=getIntrinsic,define$1=defineDataProperty,hasDescriptors=hasPropertyDescriptors_1(),gOPD$1=gopd$1,$TypeError=type,$floor=GetIntrinsic("%Math.floor%"),setFunctionLength=function(_,$){if(typeof _!="function")throw new $TypeError("`fn` is not a function");if(typeof $!="number"||$<0||$>4294967295||$floor($)!==$)throw new $TypeError("`length` must be a positive 32-bit integer");var j=arguments.length>2&&!!arguments[2],_e=!0,et=!0;if("length"in _&&gOPD$1){var tt=gOPD$1(_,"length");tt&&!tt.configurable&&(_e=!1),tt&&!tt.writable&&(et=!1)}return(_e||et||!j)&&(hasDescriptors?define$1(_,"length",$,!0,!0):define$1(_,"length",$)),_},bind=functionBind,$apply=functionApply,actualApply=actualApply$1,applyBind=function(){return actualApply(bind,$apply,arguments)};(function(o){var _=setFunctionLength,$=esDefineProperty,j=callBindApplyHelpers,_e=applyBind;o.exports=function(tt){var rt=j(arguments),nt=tt.length-(arguments.length-1);return _(rt,1+(nt>0?nt:0),!0)},$?$(o.exports,"apply",{value:_e}):o.exports.apply=_e})(callBind$2);var callBindExports=callBind$2.exports,forEach$1=forEach$2,availableTypedArrays=availableTypedArrays$1,callBind$1=callBindExports,callBound$1=callBound$6,gOPD=gopd$1,getProto=requireGetProto(),$toString=callBound$1("Object.prototype.toString"),hasToStringTag=shams(),g=globalThis,typedArrays=availableTypedArrays(),$slice=callBound$1("String.prototype.slice"),$indexOf$1=callBound$1("Array.prototype.indexOf",!0)||function(_,$){for(var j=0;j<_.length;j+=1)if(_[j]===$)return j;return-1},cache$1={__proto__:null};hasToStringTag&&gOPD&&getProto?forEach$1(typedArrays,function(o){var _=new g[o];if(Symbol.toStringTag in _&&getProto){var $=getProto(_),j=gOPD($,Symbol.toStringTag);if(!j&&$){var _e=getProto($);j=gOPD(_e,Symbol.toStringTag)}if(j&&j.get){var et=callBind$1(j.get);cache$1["$"+o]=et}}}):forEach$1(typedArrays,function(o){var _=new g[o],$=_.slice||_.set;if($){var j=callBind$1($);cache$1["$"+o]=j}});var tryTypedArrays=function(_){var $=!1;return forEach$1(cache$1,function(j,_e){if(!$)try{"$"+j(_)===_e&&($=$slice(_e,1))}catch{}}),$},trySlices=function(_){var $=!1;return forEach$1(cache$1,function(j,_e){if(!$)try{j(_),$=$slice(_e,1)}catch{}}),$},whichTypedArray$1=function(_){if(!_||typeof _!="object")return!1;if(!hasToStringTag){var $=$slice($toString(_),8,-1);return $indexOf$1(typedArrays,$)>-1?$:$!=="Object"?!1:trySlices(_)}return gOPD?tryTypedArrays(_):null},whichTypedArray=whichTypedArray$1,isTypedArray$1=function(_){return!!whichTypedArray(_)};(function(o){var _=isArguments$2,$=isGeneratorFunction,j=whichTypedArray$1,_e=isTypedArray$1;function et(rr){return rr.call.bind(rr)}var tt=typeof BigInt<"u",rt=typeof Symbol<"u",nt=et(Object.prototype.toString),ot=et(Number.prototype.valueOf),it=et(String.prototype.valueOf),st=et(Boolean.prototype.valueOf);if(tt)var at=et(BigInt.prototype.valueOf);if(rt)var lt=et(Symbol.prototype.valueOf);function ct(rr,pr){if(typeof rr!="object")return!1;try{return pr(rr),!0}catch{return!1}}o.isArgumentsObject=_,o.isGeneratorFunction=$,o.isTypedArray=_e;function ft(rr){return typeof Promise<"u"&&rr instanceof Promise||rr!==null&&typeof rr=="object"&&typeof rr.then=="function"&&typeof rr.catch=="function"}o.isPromise=ft;function dt(rr){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(rr):_e(rr)||Mt(rr)}o.isArrayBufferView=dt;function pt(rr){return j(rr)==="Uint8Array"}o.isUint8Array=pt;function yt(rr){return j(rr)==="Uint8ClampedArray"}o.isUint8ClampedArray=yt;function vt(rr){return j(rr)==="Uint16Array"}o.isUint16Array=vt;function wt(rr){return j(rr)==="Uint32Array"}o.isUint32Array=wt;function Ct(rr){return j(rr)==="Int8Array"}o.isInt8Array=Ct;function Pt(rr){return j(rr)==="Int16Array"}o.isInt16Array=Pt;function Bt(rr){return j(rr)==="Int32Array"}o.isInt32Array=Bt;function At(rr){return j(rr)==="Float32Array"}o.isFloat32Array=At;function kt(rr){return j(rr)==="Float64Array"}o.isFloat64Array=kt;function Ot(rr){return j(rr)==="BigInt64Array"}o.isBigInt64Array=Ot;function Tt(rr){return j(rr)==="BigUint64Array"}o.isBigUint64Array=Tt;function ht(rr){return nt(rr)==="[object Map]"}ht.working=typeof Map<"u"&&ht(new Map);function bt(rr){return typeof Map>"u"?!1:ht.working?ht(rr):rr instanceof Map}o.isMap=bt;function mt(rr){return nt(rr)==="[object Set]"}mt.working=typeof Set<"u"&&mt(new Set);function gt(rr){return typeof Set>"u"?!1:mt.working?mt(rr):rr instanceof Set}o.isSet=gt;function xt(rr){return nt(rr)==="[object WeakMap]"}xt.working=typeof WeakMap<"u"&&xt(new WeakMap);function Et(rr){return typeof WeakMap>"u"?!1:xt.working?xt(rr):rr instanceof WeakMap}o.isWeakMap=Et;function _t(rr){return nt(rr)==="[object WeakSet]"}_t.working=typeof WeakSet<"u"&&_t(new WeakSet);function $t(rr){return _t(rr)}o.isWeakSet=$t;function St(rr){return nt(rr)==="[object ArrayBuffer]"}St.working=typeof ArrayBuffer<"u"&&St(new ArrayBuffer);function Rt(rr){return typeof ArrayBuffer>"u"?!1:St.working?St(rr):rr instanceof ArrayBuffer}o.isArrayBuffer=Rt;function It(rr){return nt(rr)==="[object DataView]"}It.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&It(new DataView(new ArrayBuffer(1),0,1));function Mt(rr){return typeof DataView>"u"?!1:It.working?It(rr):rr instanceof DataView}o.isDataView=Mt;var Vt=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Gt(rr){return nt(rr)==="[object SharedArrayBuffer]"}function zt(rr){return typeof Vt>"u"?!1:(typeof Gt.working>"u"&&(Gt.working=Gt(new Vt)),Gt.working?Gt(rr):rr instanceof Vt)}o.isSharedArrayBuffer=zt;function jt(rr){return nt(rr)==="[object AsyncFunction]"}o.isAsyncFunction=jt;function Ft(rr){return nt(rr)==="[object Map Iterator]"}o.isMapIterator=Ft;function qt(rr){return nt(rr)==="[object Set Iterator]"}o.isSetIterator=qt;function Xt(rr){return nt(rr)==="[object Generator]"}o.isGeneratorObject=Xt;function Ut(rr){return nt(rr)==="[object WebAssembly.Module]"}o.isWebAssemblyCompiledModule=Ut;function Lt(rr){return ct(rr,ot)}o.isNumberObject=Lt;function Ht(rr){return ct(rr,it)}o.isStringObject=Ht;function Kt(rr){return ct(rr,st)}o.isBooleanObject=Kt;function Jt(rr){return tt&&ct(rr,at)}o.isBigIntObject=Jt;function tr(rr){return rt&&ct(rr,lt)}o.isSymbolObject=tr;function nr(rr){return Lt(rr)||Ht(rr)||Kt(rr)||Jt(rr)||tr(rr)}o.isBoxedPrimitive=nr;function ur(rr){return typeof Uint8Array<"u"&&(Rt(rr)||zt(rr))}o.isAnyArrayBuffer=ur,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(rr){Object.defineProperty(o,rr,{enumerable:!1,value:function(){throw new Error(rr+" is not supported in userland")}})})})(types);var isBufferBrowser=function(_){return _&&typeof _=="object"&&typeof _.copy=="function"&&typeof _.fill=="function"&&typeof _.readUInt8=="function"};(function(o){var _={},$=Object.getOwnPropertyDescriptors||function(Vt){for(var Gt=Object.keys(Vt),zt={},jt=0;jt=jt)return Xt;switch(Xt){case"%s":return String(zt[Gt++]);case"%d":return Number(zt[Gt++]);case"%j":try{return JSON.stringify(zt[Gt++])}catch{return"[Circular]"}default:return Xt}}),qt=zt[Gt];Gt"u")return function(){return o.deprecate(Mt,Vt).apply(this,arguments)};var Gt=!1;function zt(){if(!Gt){if(process$1$1.throwDeprecation)throw new Error(Vt);process$1$1.traceDeprecation?console.trace(Vt):console.error(Vt),Gt=!0}return Mt.apply(this,arguments)}return zt};var _e={},et=/^$/;if(_.NODE_DEBUG){var tt=_.NODE_DEBUG;tt=tt.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),et=new RegExp("^"+tt+"$","i")}o.debuglog=function(Mt){if(Mt=Mt.toUpperCase(),!_e[Mt])if(et.test(Mt)){var Vt=process$1$1.pid;_e[Mt]=function(){var Gt=o.format.apply(o,arguments);console.error("%s %d: %s",Mt,Vt,Gt)}}else _e[Mt]=function(){};return _e[Mt]};function rt(Mt,Vt){var Gt={seen:[],stylize:ot};return arguments.length>=3&&(Gt.depth=arguments[2]),arguments.length>=4&&(Gt.colors=arguments[3]),yt(Vt)?Gt.showHidden=Vt:Vt&&o._extend(Gt,Vt),At(Gt.showHidden)&&(Gt.showHidden=!1),At(Gt.depth)&&(Gt.depth=2),At(Gt.colors)&&(Gt.colors=!1),At(Gt.customInspect)&&(Gt.customInspect=!0),Gt.colors&&(Gt.stylize=nt),st(Gt,Mt,Gt.depth)}o.inspect=rt,rt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},rt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function nt(Mt,Vt){var Gt=rt.styles[Vt];return Gt?"\x1B["+rt.colors[Gt][0]+"m"+Mt+"\x1B["+rt.colors[Gt][1]+"m":Mt}function ot(Mt,Vt){return Mt}function it(Mt){var Vt={};return Mt.forEach(function(Gt,zt){Vt[Gt]=!0}),Vt}function st(Mt,Vt,Gt){if(Mt.customInspect&&Vt&&bt(Vt.inspect)&&Vt.inspect!==o.inspect&&!(Vt.constructor&&Vt.constructor.prototype===Vt)){var zt=Vt.inspect(Gt,Mt);return Pt(zt)||(zt=st(Mt,zt,Gt)),zt}var jt=at(Mt,Vt);if(jt)return jt;var Ft=Object.keys(Vt),qt=it(Ft);if(Mt.showHidden&&(Ft=Object.getOwnPropertyNames(Vt)),ht(Vt)&&(Ft.indexOf("message")>=0||Ft.indexOf("description")>=0))return lt(Vt);if(Ft.length===0){if(bt(Vt)){var Xt=Vt.name?": "+Vt.name:"";return Mt.stylize("[Function"+Xt+"]","special")}if(kt(Vt))return Mt.stylize(RegExp.prototype.toString.call(Vt),"regexp");if(Tt(Vt))return Mt.stylize(Date.prototype.toString.call(Vt),"date");if(ht(Vt))return lt(Vt)}var Ut="",Lt=!1,Ht=["{","}"];if(pt(Vt)&&(Lt=!0,Ht=["[","]"]),bt(Vt)){var Kt=Vt.name?": "+Vt.name:"";Ut=" [Function"+Kt+"]"}if(kt(Vt)&&(Ut=" "+RegExp.prototype.toString.call(Vt)),Tt(Vt)&&(Ut=" "+Date.prototype.toUTCString.call(Vt)),ht(Vt)&&(Ut=" "+lt(Vt)),Ft.length===0&&(!Lt||Vt.length==0))return Ht[0]+Ut+Ht[1];if(Gt<0)return kt(Vt)?Mt.stylize(RegExp.prototype.toString.call(Vt),"regexp"):Mt.stylize("[Object]","special");Mt.seen.push(Vt);var Jt;return Lt?Jt=ct(Mt,Vt,Gt,qt,Ft):Jt=Ft.map(function(tr){return ft(Mt,Vt,Gt,qt,tr,Lt)}),Mt.seen.pop(),dt(Jt,Ut,Ht)}function at(Mt,Vt){if(At(Vt))return Mt.stylize("undefined","undefined");if(Pt(Vt)){var Gt="'"+JSON.stringify(Vt).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return Mt.stylize(Gt,"string")}if(Ct(Vt))return Mt.stylize(""+Vt,"number");if(yt(Vt))return Mt.stylize(""+Vt,"boolean");if(vt(Vt))return Mt.stylize("null","null")}function lt(Mt){return"["+Error.prototype.toString.call(Mt)+"]"}function ct(Mt,Vt,Gt,zt,jt){for(var Ft=[],qt=0,Xt=Vt.length;qt-1&&(Ft?Xt=Xt.split(` -`).map(function(Lt){return" "+Lt}).join(` -`).slice(2):Xt=` -`+Xt.split(` -`).map(function(Lt){return" "+Lt}).join(` -`))):Xt=Mt.stylize("[Circular]","special")),At(qt)){if(Ft&&jt.match(/^\d+$/))return Xt;qt=JSON.stringify(""+jt),qt.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(qt=qt.slice(1,-1),qt=Mt.stylize(qt,"name")):(qt=qt.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),qt=Mt.stylize(qt,"string"))}return qt+": "+Xt}function dt(Mt,Vt,Gt){var zt=Mt.reduce(function(jt,Ft){return Ft.indexOf(` -`)>=0,jt+Ft.replace(/\u001b\[\d\d?m/g,"").length+1},0);return zt>60?Gt[0]+(Vt===""?"":Vt+` - `)+" "+Mt.join(`, - `)+" "+Gt[1]:Gt[0]+Vt+" "+Mt.join(", ")+" "+Gt[1]}o.types=types;function pt(Mt){return Array.isArray(Mt)}o.isArray=pt;function yt(Mt){return typeof Mt=="boolean"}o.isBoolean=yt;function vt(Mt){return Mt===null}o.isNull=vt;function wt(Mt){return Mt==null}o.isNullOrUndefined=wt;function Ct(Mt){return typeof Mt=="number"}o.isNumber=Ct;function Pt(Mt){return typeof Mt=="string"}o.isString=Pt;function Bt(Mt){return typeof Mt=="symbol"}o.isSymbol=Bt;function At(Mt){return Mt===void 0}o.isUndefined=At;function kt(Mt){return Ot(Mt)&>(Mt)==="[object RegExp]"}o.isRegExp=kt,o.types.isRegExp=kt;function Ot(Mt){return typeof Mt=="object"&&Mt!==null}o.isObject=Ot;function Tt(Mt){return Ot(Mt)&>(Mt)==="[object Date]"}o.isDate=Tt,o.types.isDate=Tt;function ht(Mt){return Ot(Mt)&&(gt(Mt)==="[object Error]"||Mt instanceof Error)}o.isError=ht,o.types.isNativeError=ht;function bt(Mt){return typeof Mt=="function"}o.isFunction=bt;function mt(Mt){return Mt===null||typeof Mt=="boolean"||typeof Mt=="number"||typeof Mt=="string"||typeof Mt=="symbol"||typeof Mt>"u"}o.isPrimitive=mt,o.isBuffer=isBufferBrowser;function gt(Mt){return Object.prototype.toString.call(Mt)}function xt(Mt){return Mt<10?"0"+Mt.toString(10):Mt.toString(10)}var Et=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function _t(){var Mt=new Date,Vt=[xt(Mt.getHours()),xt(Mt.getMinutes()),xt(Mt.getSeconds())].join(":");return[Mt.getDate(),Et[Mt.getMonth()],Vt].join(" ")}o.log=function(){console.log("%s - %s",_t(),o.format.apply(o,arguments))},o.inherits=inherits_browserExports,o._extend=function(Mt,Vt){if(!Vt||!Ot(Vt))return Mt;for(var Gt=Object.keys(Vt),zt=Gt.length;zt--;)Mt[Gt[zt]]=Vt[Gt[zt]];return Mt};function $t(Mt,Vt){return Object.prototype.hasOwnProperty.call(Mt,Vt)}var St=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;o.promisify=function(Vt){if(typeof Vt!="function")throw new TypeError('The "original" argument must be of type Function');if(St&&Vt[St]){var Gt=Vt[St];if(typeof Gt!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(Gt,St,{value:Gt,enumerable:!1,writable:!1,configurable:!0}),Gt}function Gt(){for(var zt,jt,Ft=new Promise(function(Ut,Lt){zt=Ut,jt=Lt}),qt=[],Xt=0;Xt=0&&toStr.call(_.callee)==="[object Function]"),j},implementation,hasRequiredImplementation;function requireImplementation(){if(hasRequiredImplementation)return implementation;hasRequiredImplementation=1;var o;if(!Object.keys){var _=Object.prototype.hasOwnProperty,$=Object.prototype.toString,j=isArguments$1,_e=Object.prototype.propertyIsEnumerable,et=!_e.call({toString:null},"toString"),tt=_e.call(function(){},"prototype"),rt=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],nt=function(at){var lt=at.constructor;return lt&<.prototype===at},ot={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},it=function(){if(typeof window>"u")return!1;for(var at in window)try{if(!ot["$"+at]&&_.call(window,at)&&window[at]!==null&&typeof window[at]=="object")try{nt(window[at])}catch{return!0}}catch{return!0}return!1}(),st=function(at){if(typeof window>"u"||!it)return nt(at);try{return nt(at)}catch{return!1}};o=function(lt){var ct=lt!==null&&typeof lt=="object",ft=$.call(lt)==="[object Function]",dt=j(lt),pt=ct&&$.call(lt)==="[object String]",yt=[];if(!ct&&!ft&&!dt)throw new TypeError("Object.keys called on a non-object");var vt=tt&&ft;if(pt&<.length>0&&!_.call(lt,0))for(var wt=0;wt0)for(var Ct=0;Ct0?ht:bt},et.min=function(ht,bt){return ht.cmp(bt)<0?ht:bt},et.prototype._init=function(ht,bt,mt){if(typeof ht=="number")return this._initNumber(ht,bt,mt);if(typeof ht=="object")return this._initArray(ht,bt,mt);bt==="hex"&&(bt=16),j(bt===(bt|0)&&bt>=2&&bt<=36),ht=ht.toString().replace(/\s+/g,"");var gt=0;ht[0]==="-"&&(gt++,this.negative=1),gt=0;gt-=3)Et=ht[gt]|ht[gt-1]<<8|ht[gt-2]<<16,this.words[xt]|=Et<<_t&67108863,this.words[xt+1]=Et>>>26-_t&67108863,_t+=24,_t>=26&&(_t-=26,xt++);else if(mt==="le")for(gt=0,xt=0;gt>>26-_t&67108863,_t+=24,_t>=26&&(_t-=26,xt++);return this.strip()};function rt(Tt,ht){var bt=Tt.charCodeAt(ht);return bt>=65&&bt<=70?bt-55:bt>=97&&bt<=102?bt-87:bt-48&15}function nt(Tt,ht,bt){var mt=rt(Tt,bt);return bt-1>=ht&&(mt|=rt(Tt,bt-1)<<4),mt}et.prototype._parseHex=function(ht,bt,mt){this.length=Math.ceil((ht.length-bt)/6),this.words=new Array(this.length);for(var gt=0;gt=bt;gt-=2)_t=nt(ht,bt,gt)<=18?(xt-=18,Et+=1,this.words[Et]|=_t>>>26):xt+=8;else{var $t=ht.length-bt;for(gt=$t%2===0?bt+1:bt;gt=18?(xt-=18,Et+=1,this.words[Et]|=_t>>>26):xt+=8}this.strip()};function ot(Tt,ht,bt,mt){for(var gt=0,xt=Math.min(Tt.length,bt),Et=ht;Et=49?gt+=_t-49+10:_t>=17?gt+=_t-17+10:gt+=_t}return gt}et.prototype._parseBase=function(ht,bt,mt){this.words=[0],this.length=1;for(var gt=0,xt=1;xt<=67108863;xt*=bt)gt++;gt--,xt=xt/bt|0;for(var Et=ht.length-mt,_t=Et%gt,$t=Math.min(Et,Et-_t)+mt,St=0,Rt=mt;Rt<$t;Rt+=gt)St=ot(ht,Rt,Rt+gt,bt),this.imuln(xt),this.words[0]+St<67108864?this.words[0]+=St:this._iaddn(St);if(_t!==0){var It=1;for(St=ot(ht,Rt,ht.length,bt),Rt=0;Rt<_t;Rt++)It*=bt;this.imuln(It),this.words[0]+St<67108864?this.words[0]+=St:this._iaddn(St)}this.strip()},et.prototype.copy=function(ht){ht.words=new Array(this.length);for(var bt=0;bt1&&this.words[this.length-1]===0;)this.length--;return this._normSign()},et.prototype._normSign=function(){return this.length===1&&this.words[0]===0&&(this.negative=0),this},et.prototype.inspect=function(){return(this.red?""};var it=["","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"],st=[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],at=[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];et.prototype.toString=function(ht,bt){ht=ht||10,bt=bt|0||1;var mt;if(ht===16||ht==="hex"){mt="";for(var gt=0,xt=0,Et=0;Et>>24-gt&16777215,gt+=2,gt>=26&&(gt-=26,Et--),xt!==0||Et!==this.length-1?mt=it[6-$t.length]+$t+mt:mt=$t+mt}for(xt!==0&&(mt=xt.toString(16)+mt);mt.length%bt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}if(ht===(ht|0)&&ht>=2&&ht<=36){var St=st[ht],Rt=at[ht];mt="";var It=this.clone();for(It.negative=0;!It.isZero();){var Mt=It.modn(Rt).toString(ht);It=It.idivn(Rt),It.isZero()?mt=Mt+mt:mt=it[St-Mt.length]+Mt+mt}for(this.isZero()&&(mt="0"+mt);mt.length%bt!==0;)mt="0"+mt;return this.negative!==0&&(mt="-"+mt),mt}j(!1,"Base should be between 2 and 36")},et.prototype.toNumber=function(){var ht=this.words[0];return this.length===2?ht+=this.words[1]*67108864:this.length===3&&this.words[2]===1?ht+=4503599627370496+this.words[1]*67108864:this.length>2&&j(!1,"Number can only safely store up to 53 bits"),this.negative!==0?-ht:ht},et.prototype.toJSON=function(){return this.toString(16)},et.prototype.toBuffer=function(ht,bt){return j(typeof tt<"u"),this.toArrayLike(tt,ht,bt)},et.prototype.toArray=function(ht,bt){return this.toArrayLike(Array,ht,bt)},et.prototype.toArrayLike=function(ht,bt,mt){var gt=this.byteLength(),xt=mt||Math.max(1,gt);j(gt<=xt,"byte array longer than desired length"),j(xt>0,"Requested array length <= 0"),this.strip();var Et=bt==="le",_t=new ht(xt),$t,St,Rt=this.clone();if(Et){for(St=0;!Rt.isZero();St++)$t=Rt.andln(255),Rt.iushrn(8),_t[St]=$t;for(;St=4096&&(mt+=13,bt>>>=13),bt>=64&&(mt+=7,bt>>>=7),bt>=8&&(mt+=4,bt>>>=4),bt>=2&&(mt+=2,bt>>>=2),mt+bt},et.prototype._zeroBits=function(ht){if(ht===0)return 26;var bt=ht,mt=0;return bt&8191||(mt+=13,bt>>>=13),bt&127||(mt+=7,bt>>>=7),bt&15||(mt+=4,bt>>>=4),bt&3||(mt+=2,bt>>>=2),bt&1||mt++,mt},et.prototype.bitLength=function(){var ht=this.words[this.length-1],bt=this._countBits(ht);return(this.length-1)*26+bt};function lt(Tt){for(var ht=new Array(Tt.bitLength()),bt=0;bt>>gt}return ht}et.prototype.zeroBits=function(){if(this.isZero())return 0;for(var ht=0,bt=0;btht.length?this.clone().ior(ht):ht.clone().ior(this)},et.prototype.uor=function(ht){return this.length>ht.length?this.clone().iuor(ht):ht.clone().iuor(this)},et.prototype.iuand=function(ht){var bt;this.length>ht.length?bt=ht:bt=this;for(var mt=0;mtht.length?this.clone().iand(ht):ht.clone().iand(this)},et.prototype.uand=function(ht){return this.length>ht.length?this.clone().iuand(ht):ht.clone().iuand(this)},et.prototype.iuxor=function(ht){var bt,mt;this.length>ht.length?(bt=this,mt=ht):(bt=ht,mt=this);for(var gt=0;gtht.length?this.clone().ixor(ht):ht.clone().ixor(this)},et.prototype.uxor=function(ht){return this.length>ht.length?this.clone().iuxor(ht):ht.clone().iuxor(this)},et.prototype.inotn=function(ht){j(typeof ht=="number"&&ht>=0);var bt=Math.ceil(ht/26)|0,mt=ht%26;this._expand(bt),mt>0&&bt--;for(var gt=0;gt0&&(this.words[gt]=~this.words[gt]&67108863>>26-mt),this.strip()},et.prototype.notn=function(ht){return this.clone().inotn(ht)},et.prototype.setn=function(ht,bt){j(typeof ht=="number"&&ht>=0);var mt=ht/26|0,gt=ht%26;return this._expand(mt+1),bt?this.words[mt]=this.words[mt]|1<ht.length?(mt=this,gt=ht):(mt=ht,gt=this);for(var xt=0,Et=0;Et>>26;for(;xt!==0&&Et>>26;if(this.length=mt.length,xt!==0)this.words[this.length]=xt,this.length++;else if(mt!==this)for(;Etht.length?this.clone().iadd(ht):ht.clone().iadd(this)},et.prototype.isub=function(ht){if(ht.negative!==0){ht.negative=0;var bt=this.iadd(ht);return ht.negative=1,bt._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(ht),this.negative=1,this._normSign();var mt=this.cmp(ht);if(mt===0)return this.negative=0,this.length=1,this.words[0]=0,this;var gt,xt;mt>0?(gt=this,xt=ht):(gt=ht,xt=this);for(var Et=0,_t=0;_t>26,this.words[_t]=bt&67108863;for(;Et!==0&&_t>26,this.words[_t]=bt&67108863;if(Et===0&&_t>>26,It=$t&67108863,Mt=Math.min(St,ht.length-1),Vt=Math.max(0,St-Tt.length+1);Vt<=Mt;Vt++){var Gt=St-Vt|0;gt=Tt.words[Gt]|0,xt=ht.words[Vt]|0,Et=gt*xt+It,Rt+=Et/67108864|0,It=Et&67108863}bt.words[St]=It|0,$t=Rt|0}return $t!==0?bt.words[St]=$t|0:bt.length--,bt.strip()}var ft=function(ht,bt,mt){var gt=ht.words,xt=bt.words,Et=mt.words,_t=0,$t,St,Rt,It=gt[0]|0,Mt=It&8191,Vt=It>>>13,Gt=gt[1]|0,zt=Gt&8191,jt=Gt>>>13,Ft=gt[2]|0,qt=Ft&8191,Xt=Ft>>>13,Ut=gt[3]|0,Lt=Ut&8191,Ht=Ut>>>13,Kt=gt[4]|0,Jt=Kt&8191,tr=Kt>>>13,nr=gt[5]|0,ur=nr&8191,rr=nr>>>13,pr=gt[6]|0,fr=pr&8191,lr=pr>>>13,wr=gt[7]|0,hr=wr&8191,Er=wr>>>13,Pr=gt[8]|0,br=Pr&8191,_r=Pr>>>13,Rr=gt[9]|0,Wt=Rr&8191,Nt=Rr>>>13,Dt=xt[0]|0,Yt=Dt&8191,er=Dt>>>13,ir=xt[1]|0,sr=ir&8191,xr=ir>>>13,Sr=xt[2]|0,gr=Sr&8191,Ar=Sr>>>13,dr=xt[3]|0,yr=dr&8191,Ir=dr>>>13,Nr=xt[4]|0,Tr=Nr&8191,Dr=Nr>>>13,Zt=xt[5]|0,Qt=Zt&8191,or=Zt>>>13,ar=xt[6]|0,cr=ar&8191,vr=ar>>>13,$r=xt[7]|0,Cr=$r&8191,Mr=$r>>>13,jr=xt[8]|0,Br=jr&8191,Lr=jr>>>13,Hr=xt[9]|0,Or=Hr&8191,zr=Hr>>>13;mt.negative=ht.negative^bt.negative,mt.length=19,$t=Math.imul(Mt,Yt),St=Math.imul(Mt,er),St=St+Math.imul(Vt,Yt)|0,Rt=Math.imul(Vt,er);var Ur=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(Ur>>>26)|0,Ur&=67108863,$t=Math.imul(zt,Yt),St=Math.imul(zt,er),St=St+Math.imul(jt,Yt)|0,Rt=Math.imul(jt,er),$t=$t+Math.imul(Mt,sr)|0,St=St+Math.imul(Mt,xr)|0,St=St+Math.imul(Vt,sr)|0,Rt=Rt+Math.imul(Vt,xr)|0;var Fr=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(Fr>>>26)|0,Fr&=67108863,$t=Math.imul(qt,Yt),St=Math.imul(qt,er),St=St+Math.imul(Xt,Yt)|0,Rt=Math.imul(Xt,er),$t=$t+Math.imul(zt,sr)|0,St=St+Math.imul(zt,xr)|0,St=St+Math.imul(jt,sr)|0,Rt=Rt+Math.imul(jt,xr)|0,$t=$t+Math.imul(Mt,gr)|0,St=St+Math.imul(Mt,Ar)|0,St=St+Math.imul(Vt,gr)|0,Rt=Rt+Math.imul(Vt,Ar)|0;var Wr=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(Wr>>>26)|0,Wr&=67108863,$t=Math.imul(Lt,Yt),St=Math.imul(Lt,er),St=St+Math.imul(Ht,Yt)|0,Rt=Math.imul(Ht,er),$t=$t+Math.imul(qt,sr)|0,St=St+Math.imul(qt,xr)|0,St=St+Math.imul(Xt,sr)|0,Rt=Rt+Math.imul(Xt,xr)|0,$t=$t+Math.imul(zt,gr)|0,St=St+Math.imul(zt,Ar)|0,St=St+Math.imul(jt,gr)|0,Rt=Rt+Math.imul(jt,Ar)|0,$t=$t+Math.imul(Mt,yr)|0,St=St+Math.imul(Mt,Ir)|0,St=St+Math.imul(Vt,yr)|0,Rt=Rt+Math.imul(Vt,Ir)|0;var qr=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(qr>>>26)|0,qr&=67108863,$t=Math.imul(Jt,Yt),St=Math.imul(Jt,er),St=St+Math.imul(tr,Yt)|0,Rt=Math.imul(tr,er),$t=$t+Math.imul(Lt,sr)|0,St=St+Math.imul(Lt,xr)|0,St=St+Math.imul(Ht,sr)|0,Rt=Rt+Math.imul(Ht,xr)|0,$t=$t+Math.imul(qt,gr)|0,St=St+Math.imul(qt,Ar)|0,St=St+Math.imul(Xt,gr)|0,Rt=Rt+Math.imul(Xt,Ar)|0,$t=$t+Math.imul(zt,yr)|0,St=St+Math.imul(zt,Ir)|0,St=St+Math.imul(jt,yr)|0,Rt=Rt+Math.imul(jt,Ir)|0,$t=$t+Math.imul(Mt,Tr)|0,St=St+Math.imul(Mt,Dr)|0,St=St+Math.imul(Vt,Tr)|0,Rt=Rt+Math.imul(Vt,Dr)|0;var Jr=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(Jr>>>26)|0,Jr&=67108863,$t=Math.imul(ur,Yt),St=Math.imul(ur,er),St=St+Math.imul(rr,Yt)|0,Rt=Math.imul(rr,er),$t=$t+Math.imul(Jt,sr)|0,St=St+Math.imul(Jt,xr)|0,St=St+Math.imul(tr,sr)|0,Rt=Rt+Math.imul(tr,xr)|0,$t=$t+Math.imul(Lt,gr)|0,St=St+Math.imul(Lt,Ar)|0,St=St+Math.imul(Ht,gr)|0,Rt=Rt+Math.imul(Ht,Ar)|0,$t=$t+Math.imul(qt,yr)|0,St=St+Math.imul(qt,Ir)|0,St=St+Math.imul(Xt,yr)|0,Rt=Rt+Math.imul(Xt,Ir)|0,$t=$t+Math.imul(zt,Tr)|0,St=St+Math.imul(zt,Dr)|0,St=St+Math.imul(jt,Tr)|0,Rt=Rt+Math.imul(jt,Dr)|0,$t=$t+Math.imul(Mt,Qt)|0,St=St+Math.imul(Mt,or)|0,St=St+Math.imul(Vt,Qt)|0,Rt=Rt+Math.imul(Vt,or)|0;var Qr=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(Qr>>>26)|0,Qr&=67108863,$t=Math.imul(fr,Yt),St=Math.imul(fr,er),St=St+Math.imul(lr,Yt)|0,Rt=Math.imul(lr,er),$t=$t+Math.imul(ur,sr)|0,St=St+Math.imul(ur,xr)|0,St=St+Math.imul(rr,sr)|0,Rt=Rt+Math.imul(rr,xr)|0,$t=$t+Math.imul(Jt,gr)|0,St=St+Math.imul(Jt,Ar)|0,St=St+Math.imul(tr,gr)|0,Rt=Rt+Math.imul(tr,Ar)|0,$t=$t+Math.imul(Lt,yr)|0,St=St+Math.imul(Lt,Ir)|0,St=St+Math.imul(Ht,yr)|0,Rt=Rt+Math.imul(Ht,Ir)|0,$t=$t+Math.imul(qt,Tr)|0,St=St+Math.imul(qt,Dr)|0,St=St+Math.imul(Xt,Tr)|0,Rt=Rt+Math.imul(Xt,Dr)|0,$t=$t+Math.imul(zt,Qt)|0,St=St+Math.imul(zt,or)|0,St=St+Math.imul(jt,Qt)|0,Rt=Rt+Math.imul(jt,or)|0,$t=$t+Math.imul(Mt,cr)|0,St=St+Math.imul(Mt,vr)|0,St=St+Math.imul(Vt,cr)|0,Rt=Rt+Math.imul(Vt,vr)|0;var en=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(en>>>26)|0,en&=67108863,$t=Math.imul(hr,Yt),St=Math.imul(hr,er),St=St+Math.imul(Er,Yt)|0,Rt=Math.imul(Er,er),$t=$t+Math.imul(fr,sr)|0,St=St+Math.imul(fr,xr)|0,St=St+Math.imul(lr,sr)|0,Rt=Rt+Math.imul(lr,xr)|0,$t=$t+Math.imul(ur,gr)|0,St=St+Math.imul(ur,Ar)|0,St=St+Math.imul(rr,gr)|0,Rt=Rt+Math.imul(rr,Ar)|0,$t=$t+Math.imul(Jt,yr)|0,St=St+Math.imul(Jt,Ir)|0,St=St+Math.imul(tr,yr)|0,Rt=Rt+Math.imul(tr,Ir)|0,$t=$t+Math.imul(Lt,Tr)|0,St=St+Math.imul(Lt,Dr)|0,St=St+Math.imul(Ht,Tr)|0,Rt=Rt+Math.imul(Ht,Dr)|0,$t=$t+Math.imul(qt,Qt)|0,St=St+Math.imul(qt,or)|0,St=St+Math.imul(Xt,Qt)|0,Rt=Rt+Math.imul(Xt,or)|0,$t=$t+Math.imul(zt,cr)|0,St=St+Math.imul(zt,vr)|0,St=St+Math.imul(jt,cr)|0,Rt=Rt+Math.imul(jt,vr)|0,$t=$t+Math.imul(Mt,Cr)|0,St=St+Math.imul(Mt,Mr)|0,St=St+Math.imul(Vt,Cr)|0,Rt=Rt+Math.imul(Vt,Mr)|0;var tn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(tn>>>26)|0,tn&=67108863,$t=Math.imul(br,Yt),St=Math.imul(br,er),St=St+Math.imul(_r,Yt)|0,Rt=Math.imul(_r,er),$t=$t+Math.imul(hr,sr)|0,St=St+Math.imul(hr,xr)|0,St=St+Math.imul(Er,sr)|0,Rt=Rt+Math.imul(Er,xr)|0,$t=$t+Math.imul(fr,gr)|0,St=St+Math.imul(fr,Ar)|0,St=St+Math.imul(lr,gr)|0,Rt=Rt+Math.imul(lr,Ar)|0,$t=$t+Math.imul(ur,yr)|0,St=St+Math.imul(ur,Ir)|0,St=St+Math.imul(rr,yr)|0,Rt=Rt+Math.imul(rr,Ir)|0,$t=$t+Math.imul(Jt,Tr)|0,St=St+Math.imul(Jt,Dr)|0,St=St+Math.imul(tr,Tr)|0,Rt=Rt+Math.imul(tr,Dr)|0,$t=$t+Math.imul(Lt,Qt)|0,St=St+Math.imul(Lt,or)|0,St=St+Math.imul(Ht,Qt)|0,Rt=Rt+Math.imul(Ht,or)|0,$t=$t+Math.imul(qt,cr)|0,St=St+Math.imul(qt,vr)|0,St=St+Math.imul(Xt,cr)|0,Rt=Rt+Math.imul(Xt,vr)|0,$t=$t+Math.imul(zt,Cr)|0,St=St+Math.imul(zt,Mr)|0,St=St+Math.imul(jt,Cr)|0,Rt=Rt+Math.imul(jt,Mr)|0,$t=$t+Math.imul(Mt,Br)|0,St=St+Math.imul(Mt,Lr)|0,St=St+Math.imul(Vt,Br)|0,Rt=Rt+Math.imul(Vt,Lr)|0;var rn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(rn>>>26)|0,rn&=67108863,$t=Math.imul(Wt,Yt),St=Math.imul(Wt,er),St=St+Math.imul(Nt,Yt)|0,Rt=Math.imul(Nt,er),$t=$t+Math.imul(br,sr)|0,St=St+Math.imul(br,xr)|0,St=St+Math.imul(_r,sr)|0,Rt=Rt+Math.imul(_r,xr)|0,$t=$t+Math.imul(hr,gr)|0,St=St+Math.imul(hr,Ar)|0,St=St+Math.imul(Er,gr)|0,Rt=Rt+Math.imul(Er,Ar)|0,$t=$t+Math.imul(fr,yr)|0,St=St+Math.imul(fr,Ir)|0,St=St+Math.imul(lr,yr)|0,Rt=Rt+Math.imul(lr,Ir)|0,$t=$t+Math.imul(ur,Tr)|0,St=St+Math.imul(ur,Dr)|0,St=St+Math.imul(rr,Tr)|0,Rt=Rt+Math.imul(rr,Dr)|0,$t=$t+Math.imul(Jt,Qt)|0,St=St+Math.imul(Jt,or)|0,St=St+Math.imul(tr,Qt)|0,Rt=Rt+Math.imul(tr,or)|0,$t=$t+Math.imul(Lt,cr)|0,St=St+Math.imul(Lt,vr)|0,St=St+Math.imul(Ht,cr)|0,Rt=Rt+Math.imul(Ht,vr)|0,$t=$t+Math.imul(qt,Cr)|0,St=St+Math.imul(qt,Mr)|0,St=St+Math.imul(Xt,Cr)|0,Rt=Rt+Math.imul(Xt,Mr)|0,$t=$t+Math.imul(zt,Br)|0,St=St+Math.imul(zt,Lr)|0,St=St+Math.imul(jt,Br)|0,Rt=Rt+Math.imul(jt,Lr)|0,$t=$t+Math.imul(Mt,Or)|0,St=St+Math.imul(Mt,zr)|0,St=St+Math.imul(Vt,Or)|0,Rt=Rt+Math.imul(Vt,zr)|0;var nn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(nn>>>26)|0,nn&=67108863,$t=Math.imul(Wt,sr),St=Math.imul(Wt,xr),St=St+Math.imul(Nt,sr)|0,Rt=Math.imul(Nt,xr),$t=$t+Math.imul(br,gr)|0,St=St+Math.imul(br,Ar)|0,St=St+Math.imul(_r,gr)|0,Rt=Rt+Math.imul(_r,Ar)|0,$t=$t+Math.imul(hr,yr)|0,St=St+Math.imul(hr,Ir)|0,St=St+Math.imul(Er,yr)|0,Rt=Rt+Math.imul(Er,Ir)|0,$t=$t+Math.imul(fr,Tr)|0,St=St+Math.imul(fr,Dr)|0,St=St+Math.imul(lr,Tr)|0,Rt=Rt+Math.imul(lr,Dr)|0,$t=$t+Math.imul(ur,Qt)|0,St=St+Math.imul(ur,or)|0,St=St+Math.imul(rr,Qt)|0,Rt=Rt+Math.imul(rr,or)|0,$t=$t+Math.imul(Jt,cr)|0,St=St+Math.imul(Jt,vr)|0,St=St+Math.imul(tr,cr)|0,Rt=Rt+Math.imul(tr,vr)|0,$t=$t+Math.imul(Lt,Cr)|0,St=St+Math.imul(Lt,Mr)|0,St=St+Math.imul(Ht,Cr)|0,Rt=Rt+Math.imul(Ht,Mr)|0,$t=$t+Math.imul(qt,Br)|0,St=St+Math.imul(qt,Lr)|0,St=St+Math.imul(Xt,Br)|0,Rt=Rt+Math.imul(Xt,Lr)|0,$t=$t+Math.imul(zt,Or)|0,St=St+Math.imul(zt,zr)|0,St=St+Math.imul(jt,Or)|0,Rt=Rt+Math.imul(jt,zr)|0;var sn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(sn>>>26)|0,sn&=67108863,$t=Math.imul(Wt,gr),St=Math.imul(Wt,Ar),St=St+Math.imul(Nt,gr)|0,Rt=Math.imul(Nt,Ar),$t=$t+Math.imul(br,yr)|0,St=St+Math.imul(br,Ir)|0,St=St+Math.imul(_r,yr)|0,Rt=Rt+Math.imul(_r,Ir)|0,$t=$t+Math.imul(hr,Tr)|0,St=St+Math.imul(hr,Dr)|0,St=St+Math.imul(Er,Tr)|0,Rt=Rt+Math.imul(Er,Dr)|0,$t=$t+Math.imul(fr,Qt)|0,St=St+Math.imul(fr,or)|0,St=St+Math.imul(lr,Qt)|0,Rt=Rt+Math.imul(lr,or)|0,$t=$t+Math.imul(ur,cr)|0,St=St+Math.imul(ur,vr)|0,St=St+Math.imul(rr,cr)|0,Rt=Rt+Math.imul(rr,vr)|0,$t=$t+Math.imul(Jt,Cr)|0,St=St+Math.imul(Jt,Mr)|0,St=St+Math.imul(tr,Cr)|0,Rt=Rt+Math.imul(tr,Mr)|0,$t=$t+Math.imul(Lt,Br)|0,St=St+Math.imul(Lt,Lr)|0,St=St+Math.imul(Ht,Br)|0,Rt=Rt+Math.imul(Ht,Lr)|0,$t=$t+Math.imul(qt,Or)|0,St=St+Math.imul(qt,zr)|0,St=St+Math.imul(Xt,Or)|0,Rt=Rt+Math.imul(Xt,zr)|0;var an=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(an>>>26)|0,an&=67108863,$t=Math.imul(Wt,yr),St=Math.imul(Wt,Ir),St=St+Math.imul(Nt,yr)|0,Rt=Math.imul(Nt,Ir),$t=$t+Math.imul(br,Tr)|0,St=St+Math.imul(br,Dr)|0,St=St+Math.imul(_r,Tr)|0,Rt=Rt+Math.imul(_r,Dr)|0,$t=$t+Math.imul(hr,Qt)|0,St=St+Math.imul(hr,or)|0,St=St+Math.imul(Er,Qt)|0,Rt=Rt+Math.imul(Er,or)|0,$t=$t+Math.imul(fr,cr)|0,St=St+Math.imul(fr,vr)|0,St=St+Math.imul(lr,cr)|0,Rt=Rt+Math.imul(lr,vr)|0,$t=$t+Math.imul(ur,Cr)|0,St=St+Math.imul(ur,Mr)|0,St=St+Math.imul(rr,Cr)|0,Rt=Rt+Math.imul(rr,Mr)|0,$t=$t+Math.imul(Jt,Br)|0,St=St+Math.imul(Jt,Lr)|0,St=St+Math.imul(tr,Br)|0,Rt=Rt+Math.imul(tr,Lr)|0,$t=$t+Math.imul(Lt,Or)|0,St=St+Math.imul(Lt,zr)|0,St=St+Math.imul(Ht,Or)|0,Rt=Rt+Math.imul(Ht,zr)|0;var un=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(un>>>26)|0,un&=67108863,$t=Math.imul(Wt,Tr),St=Math.imul(Wt,Dr),St=St+Math.imul(Nt,Tr)|0,Rt=Math.imul(Nt,Dr),$t=$t+Math.imul(br,Qt)|0,St=St+Math.imul(br,or)|0,St=St+Math.imul(_r,Qt)|0,Rt=Rt+Math.imul(_r,or)|0,$t=$t+Math.imul(hr,cr)|0,St=St+Math.imul(hr,vr)|0,St=St+Math.imul(Er,cr)|0,Rt=Rt+Math.imul(Er,vr)|0,$t=$t+Math.imul(fr,Cr)|0,St=St+Math.imul(fr,Mr)|0,St=St+Math.imul(lr,Cr)|0,Rt=Rt+Math.imul(lr,Mr)|0,$t=$t+Math.imul(ur,Br)|0,St=St+Math.imul(ur,Lr)|0,St=St+Math.imul(rr,Br)|0,Rt=Rt+Math.imul(rr,Lr)|0,$t=$t+Math.imul(Jt,Or)|0,St=St+Math.imul(Jt,zr)|0,St=St+Math.imul(tr,Or)|0,Rt=Rt+Math.imul(tr,zr)|0;var dn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(dn>>>26)|0,dn&=67108863,$t=Math.imul(Wt,Qt),St=Math.imul(Wt,or),St=St+Math.imul(Nt,Qt)|0,Rt=Math.imul(Nt,or),$t=$t+Math.imul(br,cr)|0,St=St+Math.imul(br,vr)|0,St=St+Math.imul(_r,cr)|0,Rt=Rt+Math.imul(_r,vr)|0,$t=$t+Math.imul(hr,Cr)|0,St=St+Math.imul(hr,Mr)|0,St=St+Math.imul(Er,Cr)|0,Rt=Rt+Math.imul(Er,Mr)|0,$t=$t+Math.imul(fr,Br)|0,St=St+Math.imul(fr,Lr)|0,St=St+Math.imul(lr,Br)|0,Rt=Rt+Math.imul(lr,Lr)|0,$t=$t+Math.imul(ur,Or)|0,St=St+Math.imul(ur,zr)|0,St=St+Math.imul(rr,Or)|0,Rt=Rt+Math.imul(rr,zr)|0;var pn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(pn>>>26)|0,pn&=67108863,$t=Math.imul(Wt,cr),St=Math.imul(Wt,vr),St=St+Math.imul(Nt,cr)|0,Rt=Math.imul(Nt,vr),$t=$t+Math.imul(br,Cr)|0,St=St+Math.imul(br,Mr)|0,St=St+Math.imul(_r,Cr)|0,Rt=Rt+Math.imul(_r,Mr)|0,$t=$t+Math.imul(hr,Br)|0,St=St+Math.imul(hr,Lr)|0,St=St+Math.imul(Er,Br)|0,Rt=Rt+Math.imul(Er,Lr)|0,$t=$t+Math.imul(fr,Or)|0,St=St+Math.imul(fr,zr)|0,St=St+Math.imul(lr,Or)|0,Rt=Rt+Math.imul(lr,zr)|0;var hn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(hn>>>26)|0,hn&=67108863,$t=Math.imul(Wt,Cr),St=Math.imul(Wt,Mr),St=St+Math.imul(Nt,Cr)|0,Rt=Math.imul(Nt,Mr),$t=$t+Math.imul(br,Br)|0,St=St+Math.imul(br,Lr)|0,St=St+Math.imul(_r,Br)|0,Rt=Rt+Math.imul(_r,Lr)|0,$t=$t+Math.imul(hr,Or)|0,St=St+Math.imul(hr,zr)|0,St=St+Math.imul(Er,Or)|0,Rt=Rt+Math.imul(Er,zr)|0;var mn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(mn>>>26)|0,mn&=67108863,$t=Math.imul(Wt,Br),St=Math.imul(Wt,Lr),St=St+Math.imul(Nt,Br)|0,Rt=Math.imul(Nt,Lr),$t=$t+Math.imul(br,Or)|0,St=St+Math.imul(br,zr)|0,St=St+Math.imul(_r,Or)|0,Rt=Rt+Math.imul(_r,zr)|0;var gn=(_t+$t|0)+((St&8191)<<13)|0;_t=(Rt+(St>>>13)|0)+(gn>>>26)|0,gn&=67108863,$t=Math.imul(Wt,Or),St=Math.imul(Wt,zr),St=St+Math.imul(Nt,Or)|0,Rt=Math.imul(Nt,zr);var yn=(_t+$t|0)+((St&8191)<<13)|0;return _t=(Rt+(St>>>13)|0)+(yn>>>26)|0,yn&=67108863,Et[0]=Ur,Et[1]=Fr,Et[2]=Wr,Et[3]=qr,Et[4]=Jr,Et[5]=Qr,Et[6]=en,Et[7]=tn,Et[8]=rn,Et[9]=nn,Et[10]=sn,Et[11]=an,Et[12]=un,Et[13]=dn,Et[14]=pn,Et[15]=hn,Et[16]=mn,Et[17]=gn,Et[18]=yn,_t!==0&&(Et[19]=_t,mt.length++),mt};Math.imul||(ft=ct);function dt(Tt,ht,bt){bt.negative=ht.negative^Tt.negative,bt.length=Tt.length+ht.length;for(var mt=0,gt=0,xt=0;xt>>26)|0,gt+=Et>>>26,Et&=67108863}bt.words[xt]=_t,mt=Et,Et=gt}return mt!==0?bt.words[xt]=mt:bt.length--,bt.strip()}function pt(Tt,ht,bt){var mt=new yt;return mt.mulp(Tt,ht,bt)}et.prototype.mulTo=function(ht,bt){var mt,gt=this.length+ht.length;return this.length===10&&ht.length===10?mt=ft(this,ht,bt):gt<63?mt=ct(this,ht,bt):gt<1024?mt=dt(this,ht,bt):mt=pt(this,ht,bt),mt};function yt(Tt,ht){this.x=Tt,this.y=ht}yt.prototype.makeRBT=function(ht){for(var bt=new Array(ht),mt=et.prototype._countBits(ht)-1,gt=0;gt>=1;return gt},yt.prototype.permute=function(ht,bt,mt,gt,xt,Et){for(var _t=0;_t>>1)xt++;return 1<>>13,mt[2*Et+1]=xt&8191,xt=xt>>>13;for(Et=2*bt;Et>=26,bt+=gt/67108864|0,bt+=xt>>>26,this.words[mt]=xt&67108863}return bt!==0&&(this.words[mt]=bt,this.length++),this.length=ht===0?1:this.length,this},et.prototype.muln=function(ht){return this.clone().imuln(ht)},et.prototype.sqr=function(){return this.mul(this)},et.prototype.isqr=function(){return this.imul(this.clone())},et.prototype.pow=function(ht){var bt=lt(ht);if(bt.length===0)return new et(1);for(var mt=this,gt=0;gt=0);var bt=ht%26,mt=(ht-bt)/26,gt=67108863>>>26-bt<<26-bt,xt;if(bt!==0){var Et=0;for(xt=0;xt>>26-bt}Et&&(this.words[xt]=Et,this.length++)}if(mt!==0){for(xt=this.length-1;xt>=0;xt--)this.words[xt+mt]=this.words[xt];for(xt=0;xt=0);var gt;bt?gt=(bt-bt%26)/26:gt=0;var xt=ht%26,Et=Math.min((ht-xt)/26,this.length),_t=67108863^67108863>>>xt<Et)for(this.length-=Et,St=0;St=0&&(Rt!==0||St>=gt);St--){var It=this.words[St]|0;this.words[St]=Rt<<26-xt|It>>>xt,Rt=It&_t}return $t&&Rt!==0&&($t.words[$t.length++]=Rt),this.length===0&&(this.words[0]=0,this.length=1),this.strip()},et.prototype.ishrn=function(ht,bt,mt){return j(this.negative===0),this.iushrn(ht,bt,mt)},et.prototype.shln=function(ht){return this.clone().ishln(ht)},et.prototype.ushln=function(ht){return this.clone().iushln(ht)},et.prototype.shrn=function(ht){return this.clone().ishrn(ht)},et.prototype.ushrn=function(ht){return this.clone().iushrn(ht)},et.prototype.testn=function(ht){j(typeof ht=="number"&&ht>=0);var bt=ht%26,mt=(ht-bt)/26,gt=1<=0);var bt=ht%26,mt=(ht-bt)/26;if(j(this.negative===0,"imaskn works only with positive numbers"),this.length<=mt)return this;if(bt!==0&&mt++,this.length=Math.min(mt,this.length),bt!==0){var gt=67108863^67108863>>>bt<=67108864;bt++)this.words[bt]-=67108864,bt===this.length-1?this.words[bt+1]=1:this.words[bt+1]++;return this.length=Math.max(this.length,bt+1),this},et.prototype.isubn=function(ht){if(j(typeof ht=="number"),j(ht<67108864),ht<0)return this.iaddn(-ht);if(this.negative!==0)return this.negative=0,this.iaddn(ht),this.negative=1,this;if(this.words[0]-=ht,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var bt=0;bt>26)-($t/67108864|0),this.words[xt+mt]=Et&67108863}for(;xt>26,this.words[xt+mt]=Et&67108863;if(_t===0)return this.strip();for(j(_t===-1),_t=0,xt=0;xt>26,this.words[xt]=Et&67108863;return this.negative=1,this.strip()},et.prototype._wordDiv=function(ht,bt){var mt=this.length-ht.length,gt=this.clone(),xt=ht,Et=xt.words[xt.length-1]|0,_t=this._countBits(Et);mt=26-_t,mt!==0&&(xt=xt.ushln(mt),gt.iushln(mt),Et=xt.words[xt.length-1]|0);var $t=gt.length-xt.length,St;if(bt!=="mod"){St=new et(null),St.length=$t+1,St.words=new Array(St.length);for(var Rt=0;Rt=0;Mt--){var Vt=(gt.words[xt.length+Mt]|0)*67108864+(gt.words[xt.length+Mt-1]|0);for(Vt=Math.min(Vt/Et|0,67108863),gt._ishlnsubmul(xt,Vt,Mt);gt.negative!==0;)Vt--,gt.negative=0,gt._ishlnsubmul(xt,1,Mt),gt.isZero()||(gt.negative^=1);St&&(St.words[Mt]=Vt)}return St&&St.strip(),gt.strip(),bt!=="div"&&mt!==0&>.iushrn(mt),{div:St||null,mod:gt}},et.prototype.divmod=function(ht,bt,mt){if(j(!ht.isZero()),this.isZero())return{div:new et(0),mod:new et(0)};var gt,xt,Et;return this.negative!==0&&ht.negative===0?(Et=this.neg().divmod(ht,bt),bt!=="mod"&&(gt=Et.div.neg()),bt!=="div"&&(xt=Et.mod.neg(),mt&&xt.negative!==0&&xt.iadd(ht)),{div:gt,mod:xt}):this.negative===0&&ht.negative!==0?(Et=this.divmod(ht.neg(),bt),bt!=="mod"&&(gt=Et.div.neg()),{div:gt,mod:Et.mod}):this.negative&ht.negative?(Et=this.neg().divmod(ht.neg(),bt),bt!=="div"&&(xt=Et.mod.neg(),mt&&xt.negative!==0&&xt.isub(ht)),{div:Et.div,mod:xt}):ht.length>this.length||this.cmp(ht)<0?{div:new et(0),mod:this}:ht.length===1?bt==="div"?{div:this.divn(ht.words[0]),mod:null}:bt==="mod"?{div:null,mod:new et(this.modn(ht.words[0]))}:{div:this.divn(ht.words[0]),mod:new et(this.modn(ht.words[0]))}:this._wordDiv(ht,bt)},et.prototype.div=function(ht){return this.divmod(ht,"div",!1).div},et.prototype.mod=function(ht){return this.divmod(ht,"mod",!1).mod},et.prototype.umod=function(ht){return this.divmod(ht,"mod",!0).mod},et.prototype.divRound=function(ht){var bt=this.divmod(ht);if(bt.mod.isZero())return bt.div;var mt=bt.div.negative!==0?bt.mod.isub(ht):bt.mod,gt=ht.ushrn(1),xt=ht.andln(1),Et=mt.cmp(gt);return Et<0||xt===1&&Et===0?bt.div:bt.div.negative!==0?bt.div.isubn(1):bt.div.iaddn(1)},et.prototype.modn=function(ht){j(ht<=67108863);for(var bt=(1<<26)%ht,mt=0,gt=this.length-1;gt>=0;gt--)mt=(bt*mt+(this.words[gt]|0))%ht;return mt},et.prototype.idivn=function(ht){j(ht<=67108863);for(var bt=0,mt=this.length-1;mt>=0;mt--){var gt=(this.words[mt]|0)+bt*67108864;this.words[mt]=gt/ht|0,bt=gt%ht}return this.strip()},et.prototype.divn=function(ht){return this.clone().idivn(ht)},et.prototype.egcd=function(ht){j(ht.negative===0),j(!ht.isZero());var bt=this,mt=ht.clone();bt.negative!==0?bt=bt.umod(ht):bt=bt.clone();for(var gt=new et(1),xt=new et(0),Et=new et(0),_t=new et(1),$t=0;bt.isEven()&&mt.isEven();)bt.iushrn(1),mt.iushrn(1),++$t;for(var St=mt.clone(),Rt=bt.clone();!bt.isZero();){for(var It=0,Mt=1;!(bt.words[0]&Mt)&&It<26;++It,Mt<<=1);if(It>0)for(bt.iushrn(It);It-- >0;)(gt.isOdd()||xt.isOdd())&&(gt.iadd(St),xt.isub(Rt)),gt.iushrn(1),xt.iushrn(1);for(var Vt=0,Gt=1;!(mt.words[0]&Gt)&&Vt<26;++Vt,Gt<<=1);if(Vt>0)for(mt.iushrn(Vt);Vt-- >0;)(Et.isOdd()||_t.isOdd())&&(Et.iadd(St),_t.isub(Rt)),Et.iushrn(1),_t.iushrn(1);bt.cmp(mt)>=0?(bt.isub(mt),gt.isub(Et),xt.isub(_t)):(mt.isub(bt),Et.isub(gt),_t.isub(xt))}return{a:Et,b:_t,gcd:mt.iushln($t)}},et.prototype._invmp=function(ht){j(ht.negative===0),j(!ht.isZero());var bt=this,mt=ht.clone();bt.negative!==0?bt=bt.umod(ht):bt=bt.clone();for(var gt=new et(1),xt=new et(0),Et=mt.clone();bt.cmpn(1)>0&&mt.cmpn(1)>0;){for(var _t=0,$t=1;!(bt.words[0]&$t)&&_t<26;++_t,$t<<=1);if(_t>0)for(bt.iushrn(_t);_t-- >0;)gt.isOdd()&>.iadd(Et),gt.iushrn(1);for(var St=0,Rt=1;!(mt.words[0]&Rt)&&St<26;++St,Rt<<=1);if(St>0)for(mt.iushrn(St);St-- >0;)xt.isOdd()&&xt.iadd(Et),xt.iushrn(1);bt.cmp(mt)>=0?(bt.isub(mt),gt.isub(xt)):(mt.isub(bt),xt.isub(gt))}var It;return bt.cmpn(1)===0?It=gt:It=xt,It.cmpn(0)<0&&It.iadd(ht),It},et.prototype.gcd=function(ht){if(this.isZero())return ht.abs();if(ht.isZero())return this.abs();var bt=this.clone(),mt=ht.clone();bt.negative=0,mt.negative=0;for(var gt=0;bt.isEven()&&mt.isEven();gt++)bt.iushrn(1),mt.iushrn(1);do{for(;bt.isEven();)bt.iushrn(1);for(;mt.isEven();)mt.iushrn(1);var xt=bt.cmp(mt);if(xt<0){var Et=bt;bt=mt,mt=Et}else if(xt===0||mt.cmpn(1)===0)break;bt.isub(mt)}while(!0);return mt.iushln(gt)},et.prototype.invm=function(ht){return this.egcd(ht).a.umod(ht)},et.prototype.isEven=function(){return(this.words[0]&1)===0},et.prototype.isOdd=function(){return(this.words[0]&1)===1},et.prototype.andln=function(ht){return this.words[0]&ht},et.prototype.bincn=function(ht){j(typeof ht=="number");var bt=ht%26,mt=(ht-bt)/26,gt=1<>>26,_t&=67108863,this.words[Et]=_t}return xt!==0&&(this.words[Et]=xt,this.length++),this},et.prototype.isZero=function(){return this.length===1&&this.words[0]===0},et.prototype.cmpn=function(ht){var bt=ht<0;if(this.negative!==0&&!bt)return-1;if(this.negative===0&&bt)return 1;this.strip();var mt;if(this.length>1)mt=1;else{bt&&(ht=-ht),j(ht<=67108863,"Number is too big");var gt=this.words[0]|0;mt=gt===ht?0:gtht.length)return 1;if(this.length=0;mt--){var gt=this.words[mt]|0,xt=ht.words[mt]|0;if(gt!==xt){gtxt&&(bt=1);break}}return bt},et.prototype.gtn=function(ht){return this.cmpn(ht)===1},et.prototype.gt=function(ht){return this.cmp(ht)===1},et.prototype.gten=function(ht){return this.cmpn(ht)>=0},et.prototype.gte=function(ht){return this.cmp(ht)>=0},et.prototype.ltn=function(ht){return this.cmpn(ht)===-1},et.prototype.lt=function(ht){return this.cmp(ht)===-1},et.prototype.lten=function(ht){return this.cmpn(ht)<=0},et.prototype.lte=function(ht){return this.cmp(ht)<=0},et.prototype.eqn=function(ht){return this.cmpn(ht)===0},et.prototype.eq=function(ht){return this.cmp(ht)===0},et.red=function(ht){return new kt(ht)},et.prototype.toRed=function(ht){return j(!this.red,"Already a number in reduction context"),j(this.negative===0,"red works only with positives"),ht.convertTo(this)._forceRed(ht)},et.prototype.fromRed=function(){return j(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},et.prototype._forceRed=function(ht){return this.red=ht,this},et.prototype.forceRed=function(ht){return j(!this.red,"Already a number in reduction context"),this._forceRed(ht)},et.prototype.redAdd=function(ht){return j(this.red,"redAdd works only with red numbers"),this.red.add(this,ht)},et.prototype.redIAdd=function(ht){return j(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,ht)},et.prototype.redSub=function(ht){return j(this.red,"redSub works only with red numbers"),this.red.sub(this,ht)},et.prototype.redISub=function(ht){return j(this.red,"redISub works only with red numbers"),this.red.isub(this,ht)},et.prototype.redShl=function(ht){return j(this.red,"redShl works only with red numbers"),this.red.shl(this,ht)},et.prototype.redMul=function(ht){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ht),this.red.mul(this,ht)},et.prototype.redIMul=function(ht){return j(this.red,"redMul works only with red numbers"),this.red._verify2(this,ht),this.red.imul(this,ht)},et.prototype.redSqr=function(){return j(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},et.prototype.redISqr=function(){return j(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},et.prototype.redSqrt=function(){return j(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},et.prototype.redInvm=function(){return j(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},et.prototype.redNeg=function(){return j(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},et.prototype.redPow=function(ht){return j(this.red&&!ht.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,ht)};var vt={k256:null,p224:null,p192:null,p25519:null};function wt(Tt,ht){this.name=Tt,this.p=new et(ht,16),this.n=this.p.bitLength(),this.k=new et(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}wt.prototype._tmp=function(){var ht=new et(null);return ht.words=new Array(Math.ceil(this.n/13)),ht},wt.prototype.ireduce=function(ht){var bt=ht,mt;do this.split(bt,this.tmp),bt=this.imulK(bt),bt=bt.iadd(this.tmp),mt=bt.bitLength();while(mt>this.n);var gt=mt0?bt.isub(this.p):bt.strip!==void 0?bt.strip():bt._strip(),bt},wt.prototype.split=function(ht,bt){ht.iushrn(this.n,0,bt)},wt.prototype.imulK=function(ht){return ht.imul(this.k)};function Ct(){wt.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}_e(Ct,wt),Ct.prototype.split=function(ht,bt){for(var mt=4194303,gt=Math.min(ht.length,9),xt=0;xt>>22,Et=_t}Et>>>=22,ht.words[xt-10]=Et,Et===0&&ht.length>10?ht.length-=10:ht.length-=9},Ct.prototype.imulK=function(ht){ht.words[ht.length]=0,ht.words[ht.length+1]=0,ht.length+=2;for(var bt=0,mt=0;mt>>=26,ht.words[mt]=xt,bt=gt}return bt!==0&&(ht.words[ht.length++]=bt),ht},et._prime=function(ht){if(vt[ht])return vt[ht];var bt;if(ht==="k256")bt=new Ct;else if(ht==="p224")bt=new Pt;else if(ht==="p192")bt=new Bt;else if(ht==="p25519")bt=new At;else throw new Error("Unknown prime "+ht);return vt[ht]=bt,bt};function kt(Tt){if(typeof Tt=="string"){var ht=et._prime(Tt);this.m=ht.p,this.prime=ht}else j(Tt.gtn(1),"modulus must be greater than 1"),this.m=Tt,this.prime=null}kt.prototype._verify1=function(ht){j(ht.negative===0,"red works only with positives"),j(ht.red,"red works only with red numbers")},kt.prototype._verify2=function(ht,bt){j((ht.negative|bt.negative)===0,"red works only with positives"),j(ht.red&&ht.red===bt.red,"red works only with red numbers")},kt.prototype.imod=function(ht){return this.prime?this.prime.ireduce(ht)._forceRed(this):ht.umod(this.m)._forceRed(this)},kt.prototype.neg=function(ht){return ht.isZero()?ht.clone():this.m.sub(ht)._forceRed(this)},kt.prototype.add=function(ht,bt){this._verify2(ht,bt);var mt=ht.add(bt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt._forceRed(this)},kt.prototype.iadd=function(ht,bt){this._verify2(ht,bt);var mt=ht.iadd(bt);return mt.cmp(this.m)>=0&&mt.isub(this.m),mt},kt.prototype.sub=function(ht,bt){this._verify2(ht,bt);var mt=ht.sub(bt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt._forceRed(this)},kt.prototype.isub=function(ht,bt){this._verify2(ht,bt);var mt=ht.isub(bt);return mt.cmpn(0)<0&&mt.iadd(this.m),mt},kt.prototype.shl=function(ht,bt){return this._verify1(ht),this.imod(ht.ushln(bt))},kt.prototype.imul=function(ht,bt){return this._verify2(ht,bt),this.imod(ht.imul(bt))},kt.prototype.mul=function(ht,bt){return this._verify2(ht,bt),this.imod(ht.mul(bt))},kt.prototype.isqr=function(ht){return this.imul(ht,ht.clone())},kt.prototype.sqr=function(ht){return this.mul(ht,ht)},kt.prototype.sqrt=function(ht){if(ht.isZero())return ht.clone();var bt=this.m.andln(3);if(j(bt%2===1),bt===3){var mt=this.m.add(new et(1)).iushrn(2);return this.pow(ht,mt)}for(var gt=this.m.subn(1),xt=0;!gt.isZero()&>.andln(1)===0;)xt++,gt.iushrn(1);j(!gt.isZero());var Et=new et(1).toRed(this),_t=Et.redNeg(),$t=this.m.subn(1).iushrn(1),St=this.m.bitLength();for(St=new et(2*St*St).toRed(this);this.pow(St,$t).cmp(_t)!==0;)St.redIAdd(_t);for(var Rt=this.pow(St,gt),It=this.pow(ht,gt.addn(1).iushrn(1)),Mt=this.pow(ht,gt),Vt=xt;Mt.cmp(Et)!==0;){for(var Gt=Mt,zt=0;Gt.cmp(Et)!==0;zt++)Gt=Gt.redSqr();j(zt=0;xt--){for(var Rt=bt.words[xt],It=St-1;It>=0;It--){var Mt=Rt>>It&1;if(Et!==gt[0]&&(Et=this.sqr(Et)),Mt===0&&_t===0){$t=0;continue}_t<<=1,_t|=Mt,$t++,!($t!==mt&&(xt!==0||It!==0))&&(Et=this.mul(Et,gt[_t]),$t=0,_t=0)}St=26}return Et},kt.prototype.convertTo=function(ht){var bt=ht.umod(this.m);return bt===ht?bt.clone():bt},kt.prototype.convertFrom=function(ht){var bt=ht.clone();return bt.red=null,bt},et.mont=function(ht){return new Ot(ht)};function Ot(Tt){kt.call(this,Tt),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new et(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)}_e(Ot,kt),Ot.prototype.convertTo=function(ht){return this.imod(ht.ushln(this.shift))},Ot.prototype.convertFrom=function(ht){var bt=this.imod(ht.mul(this.rinv));return bt.red=null,bt},Ot.prototype.imul=function(ht,bt){if(ht.isZero()||bt.isZero())return ht.words[0]=0,ht.length=1,ht;var mt=ht.imul(bt),gt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),xt=mt.isub(gt).iushrn(this.shift),Et=xt;return xt.cmp(this.m)>=0?Et=xt.isub(this.m):xt.cmpn(0)<0&&(Et=xt.iadd(this.m)),Et._forceRed(this)},Ot.prototype.mul=function(ht,bt){if(ht.isZero()||bt.isZero())return new et(0)._forceRed(this);var mt=ht.mul(bt),gt=mt.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),xt=mt.isub(gt).iushrn(this.shift),Et=xt;return xt.cmp(this.m)>=0?Et=xt.isub(this.m):xt.cmpn(0)<0&&(Et=xt.iadd(this.m)),Et._forceRed(this)},Ot.prototype.invm=function(ht){var bt=this.imod(ht._invmp(this.m).mul(this.r2));return bt._forceRed(this)}})(o,commonjsGlobal)})(bn);var bnExports=bn.exports,utils$c={};(function(o){var _=o;function $(et,tt){if(Array.isArray(et))return et.slice();if(!et)return[];var rt=[];if(typeof et!="string"){for(var nt=0;nt>8,st=ot&255;it?rt.push(it,st):rt.push(st)}return rt}_.toArray=$;function j(et){return et.length===1?"0"+et:et}_.zero2=j;function _e(et){for(var tt="",rt=0;rt(ft>>1)-1?pt=(ft>>1)-yt:pt=yt,dt.isubn(pt)):pt=0,lt[ct]=pt,dt.iushrn(1)}return lt}_.getNAF=et;function tt(it,st){var at=[[],[]];it=it.clone(),st=st.clone();for(var lt=0,ct=0,ft;it.cmpn(-lt)>0||st.cmpn(-ct)>0;){var dt=it.andln(3)+lt&3,pt=st.andln(3)+ct&3;dt===3&&(dt=-1),pt===3&&(pt=-1);var yt;dt&1?(ft=it.andln(7)+lt&7,(ft===3||ft===5)&&pt===2?yt=-dt:yt=dt):yt=0,at[0].push(yt);var vt;pt&1?(ft=st.andln(7)+ct&7,(ft===3||ft===5)&&dt===2?vt=-pt:vt=pt):vt=0,at[1].push(vt),2*lt===yt+1&&(lt=1-lt),2*ct===vt+1&&(ct=1-ct),it.iushrn(1),st.iushrn(1)}return at}_.getJSF=tt;function rt(it,st,at){var lt="_"+st;it.prototype[st]=function(){return this[lt]!==void 0?this[lt]:this[lt]=at.call(this)}}_.cachedProperty=rt;function nt(it){return typeof it=="string"?_.toArray(it,"hex"):it}_.parseBytes=nt;function ot(it){return new $(it,"hex","le")}_.intFromLE=ot})(utils$d);var brorand={exports:{}},cryptoBrowserify={},browser$d={exports:{}},safeBuffer$1={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh */(function(o,_){var $=require$$0$1,j=$.Buffer;function _e(tt,rt){for(var nt in tt)rt[nt]=tt[nt]}j.from&&j.alloc&&j.allocUnsafe&&j.allocUnsafeSlow?o.exports=$:(_e($,_),_.Buffer=et);function et(tt,rt,nt){return j(tt,rt,nt)}et.prototype=Object.create(j.prototype),_e(j,et),et.from=function(tt,rt,nt){if(typeof tt=="number")throw new TypeError("Argument must not be a number");return j(tt,rt,nt)},et.alloc=function(tt,rt,nt){if(typeof tt!="number")throw new TypeError("Argument must be a number");var ot=j(tt);return rt!==void 0?typeof nt=="string"?ot.fill(rt,nt):ot.fill(rt):ot.fill(0),ot},et.allocUnsafe=function(tt){if(typeof tt!="number")throw new TypeError("Argument must be a number");return j(tt)},et.allocUnsafeSlow=function(tt){if(typeof tt!="number")throw new TypeError("Argument must be a number");return $.SlowBuffer(tt)}})(safeBuffer$1,safeBuffer$1.exports);var safeBufferExports=safeBuffer$1.exports,hasRequiredBrowser$c;function requireBrowser$c(){if(hasRequiredBrowser$c)return browser$d.exports;hasRequiredBrowser$c=1;var o=65536,_=4294967295;function $(){throw new Error(`Secure random number generation is not supported by this browser. -Use Chrome, Firefox or Internet Explorer 11`)}var j=safeBufferExports.Buffer,_e=globalThis.crypto||globalThis.msCrypto;_e&&_e.getRandomValues?browser$d.exports=et:browser$d.exports=$;function et(tt,rt){if(tt>_)throw new RangeError("requested too many random bytes");var nt=j.allocUnsafe(tt);if(tt>0)if(tt>o)for(var ot=0;ot0&&(tt=$[0]),tt instanceof Error)throw tt;var rt=new Error("Unhandled error."+(tt?" ("+tt.message+")":""));throw rt.context=tt,rt}var nt=et[_];if(nt===void 0)return!1;if(typeof nt=="function")ReflectApply(nt,this,$);else for(var ot=nt.length,it=arrayClone$1(nt,ot),j=0;j0&&tt.length>_e&&!tt.warned){tt.warned=!0;var rt=new Error("Possible EventEmitter memory leak detected. "+tt.length+" "+String(_)+" listeners added. Use emitter.setMaxListeners() to increase limit");rt.name="MaxListenersExceededWarning",rt.emitter=o,rt.type=_,rt.count=tt.length,ProcessEmitWarning(rt)}return o}EventEmitter$1.prototype.addListener=function(_,$){return _addListener(this,_,$,!1)};EventEmitter$1.prototype.on=EventEmitter$1.prototype.addListener;EventEmitter$1.prototype.prependListener=function(_,$){return _addListener(this,_,$,!0)};function onceWrapper(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function _onceWrap(o,_,$){var j={fired:!1,wrapFn:void 0,target:o,type:_,listener:$},_e=onceWrapper.bind(j);return _e.listener=$,j.wrapFn=_e,_e}EventEmitter$1.prototype.once=function(_,$){return checkListener($),this.on(_,_onceWrap(this,_,$)),this};EventEmitter$1.prototype.prependOnceListener=function(_,$){return checkListener($),this.prependListener(_,_onceWrap(this,_,$)),this};EventEmitter$1.prototype.removeListener=function(_,$){var j,_e,et,tt,rt;if(checkListener($),_e=this._events,_e===void 0)return this;if(j=_e[_],j===void 0)return this;if(j===$||j.listener===$)--this._eventsCount===0?this._events=Object.create(null):(delete _e[_],_e.removeListener&&this.emit("removeListener",_,j.listener||$));else if(typeof j!="function"){for(et=-1,tt=j.length-1;tt>=0;tt--)if(j[tt]===$||j[tt].listener===$){rt=j[tt].listener,et=tt;break}if(et<0)return this;et===0?j.shift():spliceOne(j,et),j.length===1&&(_e[_]=j[0]),_e.removeListener!==void 0&&this.emit("removeListener",_,rt||$)}return this};EventEmitter$1.prototype.off=EventEmitter$1.prototype.removeListener;EventEmitter$1.prototype.removeAllListeners=function(_){var $,j,_e;if(j=this._events,j===void 0)return this;if(j.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):j[_]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete j[_]),this;if(arguments.length===0){var et=Object.keys(j),tt;for(_e=0;_e=0;_e--)this.removeListener(_,$[_e]);return this};function _listeners(o,_,$){var j=o._events;if(j===void 0)return[];var _e=j[_];return _e===void 0?[]:typeof _e=="function"?$?[_e.listener||_e]:[_e]:$?unwrapListeners(_e):arrayClone$1(_e,_e.length)}EventEmitter$1.prototype.listeners=function(_){return _listeners(this,_,!0)};EventEmitter$1.prototype.rawListeners=function(_){return _listeners(this,_,!1)};EventEmitter$1.listenerCount=function(o,_){return typeof o.listenerCount=="function"?o.listenerCount(_):listenerCount.call(o,_)};EventEmitter$1.prototype.listenerCount=listenerCount;function listenerCount(o){var _=this._events;if(_!==void 0){var $=_[o];if(typeof $=="function")return 1;if($!==void 0)return $.length}return 0}EventEmitter$1.prototype.eventNames=function(){return this._eventsCount>0?ReflectOwnKeys(this._events):[]};function arrayClone$1(o,_){for(var $=new Array(_),j=0;j<_;++j)$[j]=o[j];return $}function spliceOne(o,_){for(;_+10?this.tail.next=pt:this.head=pt,this.tail=pt,++this.length}},{key:"unshift",value:function(dt){var pt={data:dt,next:this.head};this.length===0&&(this.tail=pt),this.head=pt,++this.length}},{key:"shift",value:function(){if(this.length!==0){var dt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,dt}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(dt){if(this.length===0)return"";for(var pt=this.head,yt=""+pt.data;pt=pt.next;)yt+=dt+pt.data;return yt}},{key:"concat",value:function(dt){if(this.length===0)return ot.alloc(0);for(var pt=ot.allocUnsafe(dt>>>0),yt=this.head,vt=0;yt;)lt(yt.data,pt,vt),vt+=yt.data.length,yt=yt.next;return pt}},{key:"consume",value:function(dt,pt){var yt;return dtwt.length?wt.length:dt;if(Ct===wt.length?vt+=wt:vt+=wt.slice(0,dt),dt-=Ct,dt===0){Ct===wt.length?(++yt,pt.next?this.head=pt.next:this.head=this.tail=null):(this.head=pt,pt.data=wt.slice(Ct));break}++yt}return this.length-=yt,vt}},{key:"_getBuffer",value:function(dt){var pt=ot.allocUnsafe(dt),yt=this.head,vt=1;for(yt.data.copy(pt),dt-=yt.data.length;yt=yt.next;){var wt=yt.data,Ct=dt>wt.length?wt.length:dt;if(wt.copy(pt,pt.length-dt,0,Ct),dt-=Ct,dt===0){Ct===wt.length?(++vt,yt.next?this.head=yt.next:this.head=this.tail=null):(this.head=yt,yt.data=wt.slice(Ct));break}++vt}return this.length-=vt,pt}},{key:at,value:function(dt,pt){return st(this,_(_({},pt),{},{depth:0,customInspect:!1}))}}]),ct}(),buffer_list$1}var destroy_1$2,hasRequiredDestroy$1;function requireDestroy$1(){if(hasRequiredDestroy$1)return destroy_1$2;hasRequiredDestroy$1=1;function o(tt,rt){var nt=this,ot=this._readableState&&this._readableState.destroyed,it=this._writableState&&this._writableState.destroyed;return ot||it?(rt?rt(tt):tt&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process$1$1.nextTick(_e,this,tt)):process$1$1.nextTick(_e,this,tt)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(tt||null,function(st){!rt&&st?nt._writableState?nt._writableState.errorEmitted?process$1$1.nextTick($,nt):(nt._writableState.errorEmitted=!0,process$1$1.nextTick(_,nt,st)):process$1$1.nextTick(_,nt,st):rt?(process$1$1.nextTick($,nt),rt(st)):process$1$1.nextTick($,nt)}),this)}function _(tt,rt){_e(tt,rt),$(tt)}function $(tt){tt._writableState&&!tt._writableState.emitClose||tt._readableState&&!tt._readableState.emitClose||tt.emit("close")}function j(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function _e(tt,rt){tt.emit("error",rt)}function et(tt,rt){var nt=tt._readableState,ot=tt._writableState;nt&&nt.autoDestroy||ot&&ot.autoDestroy?tt.destroy(rt):tt.emit("error",rt)}return destroy_1$2={destroy:o,undestroy:j,errorOrDestroy:et},destroy_1$2}var errorsBrowser={},hasRequiredErrorsBrowser;function requireErrorsBrowser(){if(hasRequiredErrorsBrowser)return errorsBrowser;hasRequiredErrorsBrowser=1;function o(rt,nt){rt.prototype=Object.create(nt.prototype),rt.prototype.constructor=rt,rt.__proto__=nt}var _={};function $(rt,nt,ot){ot||(ot=Error);function it(at,lt,ct){return typeof nt=="string"?nt:nt(at,lt,ct)}var st=function(at){o(lt,at);function lt(ct,ft,dt){return at.call(this,it(ct,ft,dt))||this}return lt}(ot);st.prototype.name=ot.name,st.prototype.code=rt,_[rt]=st}function j(rt,nt){if(Array.isArray(rt)){var ot=rt.length;return rt=rt.map(function(it){return String(it)}),ot>2?"one of ".concat(nt," ").concat(rt.slice(0,ot-1).join(", "),", or ")+rt[ot-1]:ot===2?"one of ".concat(nt," ").concat(rt[0]," or ").concat(rt[1]):"of ".concat(nt," ").concat(rt[0])}else return"of ".concat(nt," ").concat(String(rt))}function _e(rt,nt,ot){return rt.substr(0,nt.length)===nt}function et(rt,nt,ot){return(ot===void 0||ot>rt.length)&&(ot=rt.length),rt.substring(ot-nt.length,ot)===nt}function tt(rt,nt,ot){return typeof ot!="number"&&(ot=0),ot+nt.length>rt.length?!1:rt.indexOf(nt,ot)!==-1}return $("ERR_INVALID_OPT_VALUE",function(rt,nt){return'The value "'+nt+'" is invalid for option "'+rt+'"'},TypeError),$("ERR_INVALID_ARG_TYPE",function(rt,nt,ot){var it;typeof nt=="string"&&_e(nt,"not ")?(it="must not be",nt=nt.replace(/^not /,"")):it="must be";var st;if(et(rt," argument"))st="The ".concat(rt," ").concat(it," ").concat(j(nt,"type"));else{var at=tt(rt,".")?"property":"argument";st='The "'.concat(rt,'" ').concat(at," ").concat(it," ").concat(j(nt,"type"))}return st+=". Received type ".concat(typeof ot),st},TypeError),$("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),$("ERR_METHOD_NOT_IMPLEMENTED",function(rt){return"The "+rt+" method is not implemented"}),$("ERR_STREAM_PREMATURE_CLOSE","Premature close"),$("ERR_STREAM_DESTROYED",function(rt){return"Cannot call "+rt+" after a stream was destroyed"}),$("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),$("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),$("ERR_STREAM_WRITE_AFTER_END","write after end"),$("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),$("ERR_UNKNOWN_ENCODING",function(rt){return"Unknown encoding: "+rt},TypeError),$("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),errorsBrowser.codes=_,errorsBrowser}var state$1,hasRequiredState;function requireState(){if(hasRequiredState)return state$1;hasRequiredState=1;var o=requireErrorsBrowser().codes.ERR_INVALID_OPT_VALUE;function _(j,_e,et){return j.highWaterMark!=null?j.highWaterMark:_e?j[et]:null}function $(j,_e,et,tt){var rt=_(_e,tt,et);if(rt!=null){if(!(isFinite(rt)&&Math.floor(rt)===rt)||rt<0){var nt=tt?et:"highWaterMark";throw new o(nt,rt)}return Math.floor(rt)}return j.objectMode?16:16*1024}return state$1={getHighWaterMark:$},state$1}var browser$c,hasRequiredBrowser$b;function requireBrowser$b(){if(hasRequiredBrowser$b)return browser$c;hasRequiredBrowser$b=1,browser$c=o;function o($,j){if(_("noDeprecation"))return $;var _e=!1;function et(){if(!_e){if(_("throwDeprecation"))throw new Error(j);_("traceDeprecation")?console.trace(j):console.warn(j),_e=!0}return $.apply(this,arguments)}return et}function _($){try{if(!globalThis.localStorage)return!1}catch{return!1}var j=globalThis.localStorage[$];return j==null?!1:String(j).toLowerCase()==="true"}return browser$c}var _stream_writable$1,hasRequired_stream_writable$1;function require_stream_writable$1(){if(hasRequired_stream_writable$1)return _stream_writable$1;hasRequired_stream_writable$1=1,_stream_writable$1=At;function o(zt){var jt=this;this.next=null,this.entry=null,this.finish=function(){Gt(jt,zt)}}var _;At.WritableState=Pt;var $={deprecate:requireBrowser$b()},j=requireStreamBrowser$1(),_e=require$$0$1.Buffer,et=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function tt(zt){return _e.from(zt)}function rt(zt){return _e.isBuffer(zt)||zt instanceof et}var nt=requireDestroy$1(),ot=requireState(),it=ot.getHighWaterMark,st=requireErrorsBrowser().codes,at=st.ERR_INVALID_ARG_TYPE,lt=st.ERR_METHOD_NOT_IMPLEMENTED,ct=st.ERR_MULTIPLE_CALLBACK,ft=st.ERR_STREAM_CANNOT_PIPE,dt=st.ERR_STREAM_DESTROYED,pt=st.ERR_STREAM_NULL_VALUES,yt=st.ERR_STREAM_WRITE_AFTER_END,vt=st.ERR_UNKNOWN_ENCODING,wt=nt.errorOrDestroy;inherits_browserExports(At,j);function Ct(){}function Pt(zt,jt,Ft){_=_||require_stream_duplex$1(),zt=zt||{},typeof Ft!="boolean"&&(Ft=jt instanceof _),this.objectMode=!!zt.objectMode,Ft&&(this.objectMode=this.objectMode||!!zt.writableObjectMode),this.highWaterMark=it(this,zt,"writableHighWaterMark",Ft),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var qt=zt.decodeStrings===!1;this.decodeStrings=!qt,this.defaultEncoding=zt.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Xt){xt(jt,Xt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=zt.emitClose!==!1,this.autoDestroy=!!zt.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}Pt.prototype.getBuffer=function(){for(var jt=this.bufferedRequest,Ft=[];jt;)Ft.push(jt),jt=jt.next;return Ft},function(){try{Object.defineProperty(Pt.prototype,"buffer",{get:$.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var Bt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Bt=Function.prototype[Symbol.hasInstance],Object.defineProperty(At,Symbol.hasInstance,{value:function(jt){return Bt.call(this,jt)?!0:this!==At?!1:jt&&jt._writableState instanceof Pt}})):Bt=function(jt){return jt instanceof this};function At(zt){_=_||require_stream_duplex$1();var jt=this instanceof _;if(!jt&&!Bt.call(At,this))return new At(zt);this._writableState=new Pt(zt,this,jt),this.writable=!0,zt&&(typeof zt.write=="function"&&(this._write=zt.write),typeof zt.writev=="function"&&(this._writev=zt.writev),typeof zt.destroy=="function"&&(this._destroy=zt.destroy),typeof zt.final=="function"&&(this._final=zt.final)),j.call(this)}At.prototype.pipe=function(){wt(this,new ft)};function kt(zt,jt){var Ft=new yt;wt(zt,Ft),process$1$1.nextTick(jt,Ft)}function Ot(zt,jt,Ft,qt){var Xt;return Ft===null?Xt=new pt:typeof Ft!="string"&&!jt.objectMode&&(Xt=new at("chunk",["string","Buffer"],Ft)),Xt?(wt(zt,Xt),process$1$1.nextTick(qt,Xt),!1):!0}At.prototype.write=function(zt,jt,Ft){var qt=this._writableState,Xt=!1,Ut=!qt.objectMode&&rt(zt);return Ut&&!_e.isBuffer(zt)&&(zt=tt(zt)),typeof jt=="function"&&(Ft=jt,jt=null),Ut?jt="buffer":jt||(jt=qt.defaultEncoding),typeof Ft!="function"&&(Ft=Ct),qt.ending?kt(this,Ft):(Ut||Ot(this,qt,zt,Ft))&&(qt.pendingcb++,Xt=ht(this,qt,Ut,zt,jt,Ft)),Xt},At.prototype.cork=function(){this._writableState.corked++},At.prototype.uncork=function(){var zt=this._writableState;zt.corked&&(zt.corked--,!zt.writing&&!zt.corked&&!zt.bufferProcessing&&zt.bufferedRequest&&$t(this,zt))},At.prototype.setDefaultEncoding=function(jt){if(typeof jt=="string"&&(jt=jt.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((jt+"").toLowerCase())>-1))throw new vt(jt);return this._writableState.defaultEncoding=jt,this},Object.defineProperty(At.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Tt(zt,jt,Ft){return!zt.objectMode&&zt.decodeStrings!==!1&&typeof jt=="string"&&(jt=_e.from(jt,Ft)),jt}Object.defineProperty(At.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function ht(zt,jt,Ft,qt,Xt,Ut){if(!Ft){var Lt=Tt(jt,qt,Xt);qt!==Lt&&(Ft=!0,Xt="buffer",qt=Lt)}var Ht=jt.objectMode?1:qt.length;jt.length+=Ht;var Kt=jt.length>5===6?2:o>>4===14?3:o>>3===30?4:o>>6===2?-1:-2}function utf8CheckIncomplete(o,_,$){var j=_.length-1;if(j<$)return 0;var _e=utf8CheckByte(_[j]);return _e>=0?(_e>0&&(o.lastNeed=_e-1),_e):--j<$||_e===-2?0:(_e=utf8CheckByte(_[j]),_e>=0?(_e>0&&(o.lastNeed=_e-2),_e):--j<$||_e===-2?0:(_e=utf8CheckByte(_[j]),_e>=0?(_e>0&&(_e===2?_e=0:o.lastNeed=_e-3),_e):0))}function utf8CheckExtraBytes(o,_,$){if((_[0]&192)!==128)return o.lastNeed=0,"ļæ½";if(o.lastNeed>1&&_.length>1){if((_[1]&192)!==128)return o.lastNeed=1,"ļæ½";if(o.lastNeed>2&&_.length>2&&(_[2]&192)!==128)return o.lastNeed=2,"ļæ½"}}function utf8FillLast(o){var _=this.lastTotal-this.lastNeed,$=utf8CheckExtraBytes(this,o);if($!==void 0)return $;if(this.lastNeed<=o.length)return o.copy(this.lastChar,_,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);o.copy(this.lastChar,_,0,o.length),this.lastNeed-=o.length}function utf8Text(o,_){var $=utf8CheckIncomplete(this,o,_);if(!this.lastNeed)return o.toString("utf8",_);this.lastTotal=$;var j=o.length-($-this.lastNeed);return o.copy(this.lastChar,0,j),o.toString("utf8",_,j)}function utf8End(o){var _=o&&o.length?this.write(o):"";return this.lastNeed?_+"ļæ½":_}function utf16Text(o,_){if((o.length-_)%2===0){var $=o.toString("utf16le",_);if($){var j=$.charCodeAt($.length-1);if(j>=55296&&j<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=o[o.length-2],this.lastChar[1]=o[o.length-1],$.slice(0,-1)}return $}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=o[o.length-1],o.toString("utf16le",_,o.length-1)}function utf16End(o){var _=o&&o.length?this.write(o):"";if(this.lastNeed){var $=this.lastTotal-this.lastNeed;return _+this.lastChar.toString("utf16le",0,$)}return _}function base64Text(o,_){var $=(o.length-_)%3;return $===0?o.toString("base64",_):(this.lastNeed=3-$,this.lastTotal=3,$===1?this.lastChar[0]=o[o.length-1]:(this.lastChar[0]=o[o.length-2],this.lastChar[1]=o[o.length-1]),o.toString("base64",_,o.length-$))}function base64End(o){var _=o&&o.length?this.write(o):"";return this.lastNeed?_+this.lastChar.toString("base64",0,3-this.lastNeed):_}function simpleWrite(o){return o.toString(this.encoding)}function simpleEnd(o){return o&&o.length?this.write(o):""}var endOfStream$1,hasRequiredEndOfStream;function requireEndOfStream(){if(hasRequiredEndOfStream)return endOfStream$1;hasRequiredEndOfStream=1;var o=requireErrorsBrowser().codes.ERR_STREAM_PREMATURE_CLOSE;function _(et){var tt=!1;return function(){if(!tt){tt=!0;for(var rt=arguments.length,nt=new Array(rt),ot=0;ot0)if(typeof Lt!="string"&&!tr.objectMode&&Object.getPrototypeOf(Lt)!==j.prototype&&(Lt=et(Lt)),Kt)tr.endEmitted?Ct(Ut,new pt):Tt(Ut,tr,Lt,!0);else if(tr.ended)Ct(Ut,new ft);else{if(tr.destroyed)return!1;tr.reading=!1,tr.decoder&&!Ht?(Lt=tr.decoder.write(Lt),tr.objectMode||Lt.length!==0?Tt(Ut,tr,Lt,!1):$t(Ut,tr)):Tt(Ut,tr,Lt,!1)}else Kt||(tr.reading=!1,$t(Ut,tr))}return!tr.ended&&(tr.length=bt?Ut=bt:(Ut--,Ut|=Ut>>>1,Ut|=Ut>>>2,Ut|=Ut>>>4,Ut|=Ut>>>8,Ut|=Ut>>>16,Ut++),Ut}function gt(Ut,Lt){return Ut<=0||Lt.length===0&&Lt.ended?0:Lt.objectMode?1:Ut!==Ut?Lt.flowing&&Lt.length?Lt.buffer.head.data.length:Lt.length:(Ut>Lt.highWaterMark&&(Lt.highWaterMark=mt(Ut)),Ut<=Lt.length?Ut:Lt.ended?Lt.length:(Lt.needReadable=!0,0))}kt.prototype.read=function(Ut){nt("read",Ut),Ut=parseInt(Ut,10);var Lt=this._readableState,Ht=Ut;if(Ut!==0&&(Lt.emittedReadable=!1),Ut===0&&Lt.needReadable&&((Lt.highWaterMark!==0?Lt.length>=Lt.highWaterMark:Lt.length>0)||Lt.ended))return nt("read: emitReadable",Lt.length,Lt.ended),Lt.length===0&&Lt.ended?Ft(this):Et(this),null;if(Ut=gt(Ut,Lt),Ut===0&&Lt.ended)return Lt.length===0&&Ft(this),null;var Kt=Lt.needReadable;nt("need readable",Kt),(Lt.length===0||Lt.length-Ut0?Jt=jt(Ut,Lt):Jt=null,Jt===null?(Lt.needReadable=Lt.length<=Lt.highWaterMark,Ut=0):(Lt.length-=Ut,Lt.awaitDrain=0),Lt.length===0&&(Lt.ended||(Lt.needReadable=!0),Ht!==Ut&&Lt.ended&&Ft(this)),Jt!==null&&this.emit("data",Jt),Jt};function xt(Ut,Lt){if(nt("onEofChunk"),!Lt.ended){if(Lt.decoder){var Ht=Lt.decoder.end();Ht&&Ht.length&&(Lt.buffer.push(Ht),Lt.length+=Lt.objectMode?1:Ht.length)}Lt.ended=!0,Lt.sync?Et(Ut):(Lt.needReadable=!1,Lt.emittedReadable||(Lt.emittedReadable=!0,_t(Ut)))}}function Et(Ut){var Lt=Ut._readableState;nt("emitReadable",Lt.needReadable,Lt.emittedReadable),Lt.needReadable=!1,Lt.emittedReadable||(nt("emitReadable",Lt.flowing),Lt.emittedReadable=!0,process$1$1.nextTick(_t,Ut))}function _t(Ut){var Lt=Ut._readableState;nt("emitReadable_",Lt.destroyed,Lt.length,Lt.ended),!Lt.destroyed&&(Lt.length||Lt.ended)&&(Ut.emit("readable"),Lt.emittedReadable=!1),Lt.needReadable=!Lt.flowing&&!Lt.ended&&Lt.length<=Lt.highWaterMark,zt(Ut)}function $t(Ut,Lt){Lt.readingMore||(Lt.readingMore=!0,process$1$1.nextTick(St,Ut,Lt))}function St(Ut,Lt){for(;!Lt.reading&&!Lt.ended&&(Lt.length1&&Xt(Kt.pipes,Ut)!==-1)&&!pr&&(nt("false write response, pause",Kt.awaitDrain),Kt.awaitDrain++),Ht.pause())}function wr(br){nt("onerror",br),Pr(),Ut.removeListener("error",wr),_(Ut,"error")===0&&Ct(Ut,br)}Bt(Ut,"error",wr);function hr(){Ut.removeListener("finish",Er),Pr()}Ut.once("close",hr);function Er(){nt("onfinish"),Ut.removeListener("close",hr),Pr()}Ut.once("finish",Er);function Pr(){nt("unpipe"),Ht.unpipe(Ut)}return Ut.emit("pipe",Ht),Kt.flowing||(nt("pipe resume"),Ht.resume()),Ut};function Rt(Ut){return function(){var Ht=Ut._readableState;nt("pipeOnDrain",Ht.awaitDrain),Ht.awaitDrain&&Ht.awaitDrain--,Ht.awaitDrain===0&&_(Ut,"data")&&(Ht.flowing=!0,zt(Ut))}}kt.prototype.unpipe=function(Ut){var Lt=this._readableState,Ht={hasUnpiped:!1};if(Lt.pipesCount===0)return this;if(Lt.pipesCount===1)return Ut&&Ut!==Lt.pipes?this:(Ut||(Ut=Lt.pipes),Lt.pipes=null,Lt.pipesCount=0,Lt.flowing=!1,Ut&&Ut.emit("unpipe",this,Ht),this);if(!Ut){var Kt=Lt.pipes,Jt=Lt.pipesCount;Lt.pipes=null,Lt.pipesCount=0,Lt.flowing=!1;for(var tr=0;tr0,Kt.flowing!==!1&&this.resume()):Ut==="readable"&&!Kt.endEmitted&&!Kt.readableListening&&(Kt.readableListening=Kt.needReadable=!0,Kt.flowing=!1,Kt.emittedReadable=!1,nt("on readable",Kt.length,Kt.reading),Kt.length?Et(this):Kt.reading||process$1$1.nextTick(Mt,this)),Ht},kt.prototype.addListener=kt.prototype.on,kt.prototype.removeListener=function(Ut,Lt){var Ht=$.prototype.removeListener.call(this,Ut,Lt);return Ut==="readable"&&process$1$1.nextTick(It,this),Ht},kt.prototype.removeAllListeners=function(Ut){var Lt=$.prototype.removeAllListeners.apply(this,arguments);return(Ut==="readable"||Ut===void 0)&&process$1$1.nextTick(It,this),Lt};function It(Ut){var Lt=Ut._readableState;Lt.readableListening=Ut.listenerCount("readable")>0,Lt.resumeScheduled&&!Lt.paused?Lt.flowing=!0:Ut.listenerCount("data")>0&&Ut.resume()}function Mt(Ut){nt("readable nexttick read 0"),Ut.read(0)}kt.prototype.resume=function(){var Ut=this._readableState;return Ut.flowing||(nt("resume"),Ut.flowing=!Ut.readableListening,Vt(this,Ut)),Ut.paused=!1,this};function Vt(Ut,Lt){Lt.resumeScheduled||(Lt.resumeScheduled=!0,process$1$1.nextTick(Gt,Ut,Lt))}function Gt(Ut,Lt){nt("resume",Lt.reading),Lt.reading||Ut.read(0),Lt.resumeScheduled=!1,Ut.emit("resume"),zt(Ut),Lt.flowing&&!Lt.reading&&Ut.read(0)}kt.prototype.pause=function(){return nt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(nt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function zt(Ut){var Lt=Ut._readableState;for(nt("flow",Lt.flowing);Lt.flowing&&Ut.read()!==null;);}kt.prototype.wrap=function(Ut){var Lt=this,Ht=this._readableState,Kt=!1;Ut.on("end",function(){if(nt("wrapped end"),Ht.decoder&&!Ht.ended){var nr=Ht.decoder.end();nr&&nr.length&&Lt.push(nr)}Lt.push(null)}),Ut.on("data",function(nr){if(nt("wrapped data"),Ht.decoder&&(nr=Ht.decoder.write(nr)),!(Ht.objectMode&&nr==null)&&!(!Ht.objectMode&&(!nr||!nr.length))){var ur=Lt.push(nr);ur||(Kt=!0,Ut.pause())}});for(var Jt in Ut)this[Jt]===void 0&&typeof Ut[Jt]=="function"&&(this[Jt]=function(ur){return function(){return Ut[ur].apply(Ut,arguments)}}(Jt));for(var tr=0;tr=Lt.length?(Lt.decoder?Ht=Lt.buffer.join(""):Lt.buffer.length===1?Ht=Lt.buffer.first():Ht=Lt.buffer.concat(Lt.length),Lt.buffer.clear()):Ht=Lt.buffer.consume(Ut,Lt.decoder),Ht}function Ft(Ut){var Lt=Ut._readableState;nt("endReadable",Lt.endEmitted),Lt.endEmitted||(Lt.ended=!0,process$1$1.nextTick(qt,Lt,Ut))}function qt(Ut,Lt){if(nt("endReadableNT",Ut.endEmitted,Ut.length),!Ut.endEmitted&&Ut.length===0&&(Ut.endEmitted=!0,Lt.readable=!1,Lt.emit("end"),Ut.autoDestroy)){var Ht=Lt._writableState;(!Ht||Ht.autoDestroy&&Ht.finished)&&Lt.destroy()}}typeof Symbol=="function"&&(kt.from=function(Ut,Lt){return wt===void 0&&(wt=requireFromBrowser()),wt(kt,Ut,Lt)});function Xt(Ut,Lt){for(var Ht=0,Kt=Ut.length;Ht0;return rt(yt,wt,Ct,function(Pt){dt||(dt=Pt),Pt&&pt.forEach(nt),!wt&&(pt.forEach(nt),ft(dt))})});return lt.reduce(ot)}return pipeline_1$1=st,pipeline_1$1}var streamBrowserify,hasRequiredStreamBrowserify;function requireStreamBrowserify(){if(hasRequiredStreamBrowserify)return streamBrowserify;hasRequiredStreamBrowserify=1,streamBrowserify=$;var o=eventsExports.EventEmitter,_=inherits_browserExports;_($,o),$.Readable=require_stream_readable$1(),$.Writable=require_stream_writable$1(),$.Duplex=require_stream_duplex$1(),$.Transform=require_stream_transform$1(),$.PassThrough=require_stream_passthrough$1(),$.finished=requireEndOfStream(),$.pipeline=requirePipeline(),$.Stream=$;function $(){o.call(this)}return $.prototype.pipe=function(j,_e){var et=this;function tt(lt){j.writable&&j.write(lt)===!1&&et.pause&&et.pause()}et.on("data",tt);function rt(){et.readable&&et.resume&&et.resume()}j.on("drain",rt),!j._isStdio&&(!_e||_e.end!==!1)&&(et.on("end",ot),et.on("close",it));var nt=!1;function ot(){nt||(nt=!0,j.end())}function it(){nt||(nt=!0,typeof j.destroy=="function"&&j.destroy())}function st(lt){if(at(),o.listenerCount(this,"error")===0)throw lt}et.on("error",st),j.on("error",st);function at(){et.removeListener("data",tt),j.removeListener("drain",rt),et.removeListener("end",ot),et.removeListener("close",it),et.removeListener("error",st),j.removeListener("error",st),et.removeListener("end",at),et.removeListener("close",at),j.removeListener("close",at)}return et.on("end",at),et.on("close",at),j.on("close",at),j.emit("pipe",et),j},streamBrowserify}var hashBase$1,hasRequiredHashBase$1;function requireHashBase$1(){if(hasRequiredHashBase$1)return hashBase$1;hasRequiredHashBase$1=1;var o=safeBufferExports.Buffer,_=requireStreamBrowserify().Transform,$=inherits_browserExports;function j(rt){_.call(this),this._block=o.allocUnsafe(rt),this._blockSize=rt,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}$(j,_),j.prototype._transform=function(rt,nt,ot){var it=null;try{this.update(rt,nt)}catch(st){it=st}ot(it)},j.prototype._flush=function(rt){var nt=null;try{this.push(this.digest())}catch(ot){nt=ot}rt(nt)};var _e=typeof Uint8Array<"u",et=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(o.prototype instanceof Uint8Array||o.TYPED_ARRAY_SUPPORT);function tt(rt,nt){if(rt instanceof o)return rt;if(typeof rt=="string")return o.from(rt,nt);if(et&&ArrayBuffer.isView(rt)){if(rt.byteLength===0)return o.alloc(0);var ot=o.from(rt.buffer,rt.byteOffset,rt.byteLength);if(ot.byteLength===rt.byteLength)return ot}if(_e&&rt instanceof Uint8Array||o.isBuffer(rt)&&rt.constructor&&typeof rt.constructor.isBuffer=="function"&&rt.constructor.isBuffer(rt))return o.from(rt);throw new TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}return j.prototype.update=function(rt,nt){if(this._finalized)throw new Error("Digest already called");rt=tt(rt,nt);for(var ot=this._block,it=0;this._blockOffset+rt.length-it>=this._blockSize;){for(var st=this._blockOffset;st0;++at)this._length[at]+=lt,lt=this._length[at]/4294967296|0,lt>0&&(this._length[at]-=4294967296*lt);return this},j.prototype._update=function(){throw new Error("_update is not implemented")},j.prototype.digest=function(rt){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var nt=this._digest();rt!==void 0&&(nt=nt.toString(rt)),this._block.fill(0),this._blockOffset=0;for(var ot=0;ot<4;++ot)this._length[ot]=0;return nt},j.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase$1=j,hashBase$1}var md5_js,hasRequiredMd5_js;function requireMd5_js(){if(hasRequiredMd5_js)return md5_js;hasRequiredMd5_js=1;var o=inherits_browserExports,_=requireHashBase$1(),$=safeBufferExports.Buffer,j=new Array(16);function _e(){_.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}o(_e,_),_e.prototype._update=function(){for(var it=j,st=0;st<16;++st)it[st]=this._block.readInt32LE(st*4);var at=this._a,lt=this._b,ct=this._c,ft=this._d;at=tt(at,lt,ct,ft,it[0],3614090360,7),ft=tt(ft,at,lt,ct,it[1],3905402710,12),ct=tt(ct,ft,at,lt,it[2],606105819,17),lt=tt(lt,ct,ft,at,it[3],3250441966,22),at=tt(at,lt,ct,ft,it[4],4118548399,7),ft=tt(ft,at,lt,ct,it[5],1200080426,12),ct=tt(ct,ft,at,lt,it[6],2821735955,17),lt=tt(lt,ct,ft,at,it[7],4249261313,22),at=tt(at,lt,ct,ft,it[8],1770035416,7),ft=tt(ft,at,lt,ct,it[9],2336552879,12),ct=tt(ct,ft,at,lt,it[10],4294925233,17),lt=tt(lt,ct,ft,at,it[11],2304563134,22),at=tt(at,lt,ct,ft,it[12],1804603682,7),ft=tt(ft,at,lt,ct,it[13],4254626195,12),ct=tt(ct,ft,at,lt,it[14],2792965006,17),lt=tt(lt,ct,ft,at,it[15],1236535329,22),at=rt(at,lt,ct,ft,it[1],4129170786,5),ft=rt(ft,at,lt,ct,it[6],3225465664,9),ct=rt(ct,ft,at,lt,it[11],643717713,14),lt=rt(lt,ct,ft,at,it[0],3921069994,20),at=rt(at,lt,ct,ft,it[5],3593408605,5),ft=rt(ft,at,lt,ct,it[10],38016083,9),ct=rt(ct,ft,at,lt,it[15],3634488961,14),lt=rt(lt,ct,ft,at,it[4],3889429448,20),at=rt(at,lt,ct,ft,it[9],568446438,5),ft=rt(ft,at,lt,ct,it[14],3275163606,9),ct=rt(ct,ft,at,lt,it[3],4107603335,14),lt=rt(lt,ct,ft,at,it[8],1163531501,20),at=rt(at,lt,ct,ft,it[13],2850285829,5),ft=rt(ft,at,lt,ct,it[2],4243563512,9),ct=rt(ct,ft,at,lt,it[7],1735328473,14),lt=rt(lt,ct,ft,at,it[12],2368359562,20),at=nt(at,lt,ct,ft,it[5],4294588738,4),ft=nt(ft,at,lt,ct,it[8],2272392833,11),ct=nt(ct,ft,at,lt,it[11],1839030562,16),lt=nt(lt,ct,ft,at,it[14],4259657740,23),at=nt(at,lt,ct,ft,it[1],2763975236,4),ft=nt(ft,at,lt,ct,it[4],1272893353,11),ct=nt(ct,ft,at,lt,it[7],4139469664,16),lt=nt(lt,ct,ft,at,it[10],3200236656,23),at=nt(at,lt,ct,ft,it[13],681279174,4),ft=nt(ft,at,lt,ct,it[0],3936430074,11),ct=nt(ct,ft,at,lt,it[3],3572445317,16),lt=nt(lt,ct,ft,at,it[6],76029189,23),at=nt(at,lt,ct,ft,it[9],3654602809,4),ft=nt(ft,at,lt,ct,it[12],3873151461,11),ct=nt(ct,ft,at,lt,it[15],530742520,16),lt=nt(lt,ct,ft,at,it[2],3299628645,23),at=ot(at,lt,ct,ft,it[0],4096336452,6),ft=ot(ft,at,lt,ct,it[7],1126891415,10),ct=ot(ct,ft,at,lt,it[14],2878612391,15),lt=ot(lt,ct,ft,at,it[5],4237533241,21),at=ot(at,lt,ct,ft,it[12],1700485571,6),ft=ot(ft,at,lt,ct,it[3],2399980690,10),ct=ot(ct,ft,at,lt,it[10],4293915773,15),lt=ot(lt,ct,ft,at,it[1],2240044497,21),at=ot(at,lt,ct,ft,it[8],1873313359,6),ft=ot(ft,at,lt,ct,it[15],4264355552,10),ct=ot(ct,ft,at,lt,it[6],2734768916,15),lt=ot(lt,ct,ft,at,it[13],1309151649,21),at=ot(at,lt,ct,ft,it[4],4149444226,6),ft=ot(ft,at,lt,ct,it[11],3174756917,10),ct=ot(ct,ft,at,lt,it[2],718787259,15),lt=ot(lt,ct,ft,at,it[9],3951481745,21),this._a=this._a+at|0,this._b=this._b+lt|0,this._c=this._c+ct|0,this._d=this._d+ft|0},_e.prototype._digest=function(){this._block[this._blockOffset++]=128,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var it=$.allocUnsafe(16);return it.writeInt32LE(this._a,0),it.writeInt32LE(this._b,4),it.writeInt32LE(this._c,8),it.writeInt32LE(this._d,12),it};function et(it,st){return it<>>32-st}function tt(it,st,at,lt,ct,ft,dt){return et(it+(st&at|~st<)+ct+ft|0,dt)+st|0}function rt(it,st,at,lt,ct,ft,dt){return et(it+(st<|at&~lt)+ct+ft|0,dt)+st|0}function nt(it,st,at,lt,ct,ft,dt){return et(it+(st^at^lt)+ct+ft|0,dt)+st|0}function ot(it,st,at,lt,ct,ft,dt){return et(it+(at^(st|~lt))+ct+ft|0,dt)+st|0}return md5_js=_e,md5_js}var toString$3={}.toString,isarray$1=Array.isArray||function(o){return toString$3.call(o)=="[object Array]"},typedArrayBuffer,hasRequiredTypedArrayBuffer;function requireTypedArrayBuffer(){if(hasRequiredTypedArrayBuffer)return typedArrayBuffer;hasRequiredTypedArrayBuffer=1;var o=type,_=callBound$6,$=_("TypedArray.prototype.buffer",!0),j=isTypedArray$1;return typedArrayBuffer=$||function(et){if(!j(et))throw new o("Not a Typed Array");return et.buffer},typedArrayBuffer}var toBuffer$1,hasRequiredToBuffer$2;function requireToBuffer$2(){if(hasRequiredToBuffer$2)return toBuffer$1;hasRequiredToBuffer$2=1;var o=safeBufferExports.Buffer,_=isarray$1,$=requireTypedArrayBuffer(),j=ArrayBuffer.isView||function(nt){try{return $(nt),!0}catch{return!1}},_e=typeof Uint8Array<"u",et=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",tt=et&&(o.prototype instanceof Uint8Array||o.TYPED_ARRAY_SUPPORT);return toBuffer$1=function(nt,ot){if(o.isBuffer(nt))return nt.constructor&&!("isBuffer"in nt)?o.from(nt):nt;if(typeof nt=="string")return o.from(nt,ot);if(et&&j(nt)){if(nt.byteLength===0)return o.alloc(0);if(tt){var it=o.from(nt.buffer,nt.byteOffset,nt.byteLength);if(it.byteLength===nt.byteLength)return it}var st=nt instanceof Uint8Array?nt:new Uint8Array(nt.buffer,nt.byteOffset,nt.byteLength),at=o.from(st);if(at.length===nt.byteLength)return at}if(_e&&nt instanceof Uint8Array)return o.from(nt);var lt=_(nt);if(lt)for(var ct=0;ct255||~~ft!==ft)throw new RangeError("Array items must be numbers in the range 0-255.")}if(lt||o.isBuffer(nt)&&nt.constructor&&typeof nt.constructor.isBuffer=="function"&&nt.constructor.isBuffer(nt))return o.from(nt);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},toBuffer$1}var toBuffer_1$1,hasRequiredToBuffer$1;function requireToBuffer$1(){if(hasRequiredToBuffer$1)return toBuffer_1$1;hasRequiredToBuffer$1=1;var o=safeBufferExports.Buffer,_=requireToBuffer$2(),$=typeof Uint8Array<"u",j=$&&typeof ArrayBuffer<"u",_e=j&&ArrayBuffer.isView;return toBuffer_1$1=function(et,tt){if(typeof et=="string"||o.isBuffer(et)||$&&et instanceof Uint8Array||_e&&_e(et))return _(et,tt);throw new TypeError('The "data" argument must be a string, a Buffer, a Uint8Array, or a DataView')},toBuffer_1$1}var readableBrowser={exports:{}},processNextickArgs={exports:{}},hasRequiredProcessNextickArgs;function requireProcessNextickArgs(){if(hasRequiredProcessNextickArgs)return processNextickArgs.exports;hasRequiredProcessNextickArgs=1,typeof process$1$1>"u"||!process$1$1.version||process$1$1.version.indexOf("v0.")===0||process$1$1.version.indexOf("v1.")===0&&process$1$1.version.indexOf("v1.8.")!==0?processNextickArgs.exports={nextTick:o}:processNextickArgs.exports=process$1$1;function o(_,$,j,_e){if(typeof _!="function")throw new TypeError('"callback" argument must be a function');var et=arguments.length,tt,rt;switch(et){case 0:case 1:return process$1$1.nextTick(_);case 2:return process$1$1.nextTick(function(){_.call(null,$)});case 3:return process$1$1.nextTick(function(){_.call(null,$,j)});case 4:return process$1$1.nextTick(function(){_.call(null,$,j,_e)});default:for(tt=new Array(et-1),rt=0;rt"u"}util$2.isPrimitive=lt,util$2.isBuffer=require$$0$1.Buffer.isBuffer;function ct(ft){return Object.prototype.toString.call(ft)}return util$2}var BufferList={exports:{}},hasRequiredBufferList;function requireBufferList(){return hasRequiredBufferList||(hasRequiredBufferList=1,function(o){function _(et,tt){if(!(et instanceof tt))throw new TypeError("Cannot call a class as a function")}var $=requireSafeBuffer().Buffer,j=util$3;function _e(et,tt,rt){et.copy(tt,rt)}o.exports=function(){function et(){_(this,et),this.head=null,this.tail=null,this.length=0}return et.prototype.push=function(rt){var nt={data:rt,next:null};this.length>0?this.tail.next=nt:this.head=nt,this.tail=nt,++this.length},et.prototype.unshift=function(rt){var nt={data:rt,next:this.head};this.length===0&&(this.tail=nt),this.head=nt,++this.length},et.prototype.shift=function(){if(this.length!==0){var rt=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,rt}},et.prototype.clear=function(){this.head=this.tail=null,this.length=0},et.prototype.join=function(rt){if(this.length===0)return"";for(var nt=this.head,ot=""+nt.data;nt=nt.next;)ot+=rt+nt.data;return ot},et.prototype.concat=function(rt){if(this.length===0)return $.alloc(0);for(var nt=$.allocUnsafe(rt>>>0),ot=this.head,it=0;ot;)_e(ot.data,nt,it),it+=ot.data.length,ot=ot.next;return nt},et}(),j&&j.inspect&&j.inspect.custom&&(o.exports.prototype[j.inspect.custom]=function(){var et=j.inspect({length:this.length});return this.constructor.name+" "+et})}(BufferList)),BufferList.exports}var destroy_1$1,hasRequiredDestroy;function requireDestroy(){if(hasRequiredDestroy)return destroy_1$1;hasRequiredDestroy=1;var o=requireProcessNextickArgs();function _(_e,et){var tt=this,rt=this._readableState&&this._readableState.destroyed,nt=this._writableState&&this._writableState.destroyed;return rt||nt?(et?et(_e):_e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,o.nextTick(j,this,_e)):o.nextTick(j,this,_e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(_e||null,function(ot){!et&&ot?tt._writableState?tt._writableState.errorEmitted||(tt._writableState.errorEmitted=!0,o.nextTick(j,tt,ot)):o.nextTick(j,tt,ot):et&&et(ot)}),this)}function $(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function j(_e,et){_e.emit("error",et)}return destroy_1$1={destroy:_,undestroy:$},destroy_1$1}var _stream_writable,hasRequired_stream_writable;function require_stream_writable(){if(hasRequired_stream_writable)return _stream_writable;hasRequired_stream_writable=1;var o=requireProcessNextickArgs();_stream_writable=ft;function _(Et){var _t=this;this.next=null,this.entry=null,this.finish=function(){xt(_t,Et)}}var $=!process$1$1.browser&&["v0.10","v0.9."].indexOf(process$1$1.version.slice(0,5))>-1?setImmediate:o.nextTick,j;ft.WritableState=lt;var _e=Object.create(requireUtil());_e.inherits=inherits_browserExports;var et={deprecate:requireBrowser$b()},tt=requireStreamBrowser(),rt=requireSafeBuffer().Buffer,nt=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function ot(Et){return rt.from(Et)}function it(Et){return rt.isBuffer(Et)||Et instanceof nt}var st=requireDestroy();_e.inherits(ft,tt);function at(){}function lt(Et,_t){j=j||require_stream_duplex(),Et=Et||{};var $t=_t instanceof j;this.objectMode=!!Et.objectMode,$t&&(this.objectMode=this.objectMode||!!Et.writableObjectMode);var St=Et.highWaterMark,Rt=Et.writableHighWaterMark,It=this.objectMode?16:16*1024;St||St===0?this.highWaterMark=St:$t&&(Rt||Rt===0)?this.highWaterMark=Rt:this.highWaterMark=It,this.highWaterMark=Math.floor(this.highWaterMark),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var Mt=Et.decodeStrings===!1;this.decodeStrings=!Mt,this.defaultEncoding=Et.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(Vt){Bt(_t,Vt)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.bufferedRequestCount=0,this.corkedRequestsFree=new _(this)}lt.prototype.getBuffer=function(){for(var _t=this.bufferedRequest,$t=[];_t;)$t.push(_t),_t=_t.next;return $t},function(){try{Object.defineProperty(lt.prototype,"buffer",{get:et.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var ct;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(ct=Function.prototype[Symbol.hasInstance],Object.defineProperty(ft,Symbol.hasInstance,{value:function(Et){return ct.call(this,Et)?!0:this!==ft?!1:Et&&Et._writableState instanceof lt}})):ct=function(Et){return Et instanceof this};function ft(Et){if(j=j||require_stream_duplex(),!ct.call(ft,this)&&!(this instanceof j))return new ft(Et);this._writableState=new lt(Et,this),this.writable=!0,Et&&(typeof Et.write=="function"&&(this._write=Et.write),typeof Et.writev=="function"&&(this._writev=Et.writev),typeof Et.destroy=="function"&&(this._destroy=Et.destroy),typeof Et.final=="function"&&(this._final=Et.final)),tt.call(this)}ft.prototype.pipe=function(){this.emit("error",new Error("Cannot pipe, not readable"))};function dt(Et,_t){var $t=new Error("write after end");Et.emit("error",$t),o.nextTick(_t,$t)}function pt(Et,_t,$t,St){var Rt=!0,It=!1;return $t===null?It=new TypeError("May not write null values to stream"):typeof $t!="string"&&$t!==void 0&&!_t.objectMode&&(It=new TypeError("Invalid non-string/buffer chunk")),It&&(Et.emit("error",It),o.nextTick(St,It),Rt=!1),Rt}ft.prototype.write=function(Et,_t,$t){var St=this._writableState,Rt=!1,It=!St.objectMode&&it(Et);return It&&!rt.isBuffer(Et)&&(Et=ot(Et)),typeof _t=="function"&&($t=_t,_t=null),It?_t="buffer":_t||(_t=St.defaultEncoding),typeof $t!="function"&&($t=at),St.ended?dt(this,$t):(It||pt(this,St,Et,$t))&&(St.pendingcb++,Rt=vt(this,St,It,Et,_t,$t)),Rt},ft.prototype.cork=function(){var Et=this._writableState;Et.corked++},ft.prototype.uncork=function(){var Et=this._writableState;Et.corked&&(Et.corked--,!Et.writing&&!Et.corked&&!Et.bufferProcessing&&Et.bufferedRequest&&Ot(this,Et))},ft.prototype.setDefaultEncoding=function(_t){if(typeof _t=="string"&&(_t=_t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((_t+"").toLowerCase())>-1))throw new TypeError("Unknown encoding: "+_t);return this._writableState.defaultEncoding=_t,this};function yt(Et,_t,$t){return!Et.objectMode&&Et.decodeStrings!==!1&&typeof _t=="string"&&(_t=rt.from(_t,$t)),_t}Object.defineProperty(ft.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function vt(Et,_t,$t,St,Rt,It){if(!$t){var Mt=yt(_t,St,Rt);St!==Mt&&($t=!0,Rt="buffer",St=Mt)}var Vt=_t.objectMode?1:St.length;_t.length+=Vt;var Gt=_t.length<_t.highWaterMark;if(Gt||(_t.needDrain=!0),_t.writing||_t.corked){var zt=_t.lastBufferedRequest;_t.lastBufferedRequest={chunk:St,encoding:Rt,isBuf:$t,callback:It,next:null},zt?zt.next=_t.lastBufferedRequest:_t.bufferedRequest=_t.lastBufferedRequest,_t.bufferedRequestCount+=1}else wt(Et,_t,!1,Vt,St,Rt,It);return Gt}function wt(Et,_t,$t,St,Rt,It,Mt){_t.writelen=St,_t.writecb=Mt,_t.writing=!0,_t.sync=!0,$t?Et._writev(Rt,_t.onwrite):Et._write(Rt,It,_t.onwrite),_t.sync=!1}function Ct(Et,_t,$t,St,Rt){--_t.pendingcb,$t?(o.nextTick(Rt,St),o.nextTick(mt,Et,_t),Et._writableState.errorEmitted=!0,Et.emit("error",St)):(Rt(St),Et._writableState.errorEmitted=!0,Et.emit("error",St),mt(Et,_t))}function Pt(Et){Et.writing=!1,Et.writecb=null,Et.length-=Et.writelen,Et.writelen=0}function Bt(Et,_t){var $t=Et._writableState,St=$t.sync,Rt=$t.writecb;if(Pt($t),_t)Ct(Et,$t,St,_t,Rt);else{var It=Tt($t);!It&&!$t.corked&&!$t.bufferProcessing&&$t.bufferedRequest&&Ot(Et,$t),St?$(At,Et,$t,It,Rt):At(Et,$t,It,Rt)}}function At(Et,_t,$t,St){$t||kt(Et,_t),_t.pendingcb--,St(),mt(Et,_t)}function kt(Et,_t){_t.length===0&&_t.needDrain&&(_t.needDrain=!1,Et.emit("drain"))}function Ot(Et,_t){_t.bufferProcessing=!0;var $t=_t.bufferedRequest;if(Et._writev&&$t&&$t.next){var St=_t.bufferedRequestCount,Rt=new Array(St),It=_t.corkedRequestsFree;It.entry=$t;for(var Mt=0,Vt=!0;$t;)Rt[Mt]=$t,$t.isBuf||(Vt=!1),$t=$t.next,Mt+=1;Rt.allBuffers=Vt,wt(Et,_t,!0,_t.length,Rt,"",It.finish),_t.pendingcb++,_t.lastBufferedRequest=null,It.next?(_t.corkedRequestsFree=It.next,It.next=null):_t.corkedRequestsFree=new _(_t),_t.bufferedRequestCount=0}else{for(;$t;){var Gt=$t.chunk,zt=$t.encoding,jt=$t.callback,Ft=_t.objectMode?1:Gt.length;if(wt(Et,_t,!1,Ft,Gt,zt,jt),$t=$t.next,_t.bufferedRequestCount--,_t.writing)break}$t===null&&(_t.lastBufferedRequest=null)}_t.bufferedRequest=$t,_t.bufferProcessing=!1}ft.prototype._write=function(Et,_t,$t){$t(new Error("_write() is not implemented"))},ft.prototype._writev=null,ft.prototype.end=function(Et,_t,$t){var St=this._writableState;typeof Et=="function"?($t=Et,Et=null,_t=null):typeof _t=="function"&&($t=_t,_t=null),Et!=null&&this.write(Et,_t),St.corked&&(St.corked=1,this.uncork()),St.ending||gt(this,St,$t)};function Tt(Et){return Et.ending&&Et.length===0&&Et.bufferedRequest===null&&!Et.finished&&!Et.writing}function ht(Et,_t){Et._final(function($t){_t.pendingcb--,$t&&Et.emit("error",$t),_t.prefinished=!0,Et.emit("prefinish"),mt(Et,_t)})}function bt(Et,_t){!_t.prefinished&&!_t.finalCalled&&(typeof Et._final=="function"?(_t.pendingcb++,_t.finalCalled=!0,o.nextTick(ht,Et,_t)):(_t.prefinished=!0,Et.emit("prefinish")))}function mt(Et,_t){var $t=Tt(_t);return $t&&(bt(Et,_t),_t.pendingcb===0&&(_t.finished=!0,Et.emit("finish"))),$t}function gt(Et,_t,$t){_t.ending=!0,mt(Et,_t),$t&&(_t.finished?o.nextTick($t):Et.once("finish",$t)),_t.ended=!0,Et.writable=!1}function xt(Et,_t,$t){var St=Et.entry;for(Et.entry=null;St;){var Rt=St.callback;_t.pendingcb--,Rt($t),St=St.next}_t.corkedRequestsFree.next=Et}return Object.defineProperty(ft.prototype,"destroyed",{get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(Et){this._writableState&&(this._writableState.destroyed=Et)}}),ft.prototype.destroy=st.destroy,ft.prototype._undestroy=st.undestroy,ft.prototype._destroy=function(Et,_t){this.end(),_t(Et)},_stream_writable}var _stream_duplex,hasRequired_stream_duplex;function require_stream_duplex(){if(hasRequired_stream_duplex)return _stream_duplex;hasRequired_stream_duplex=1;var o=requireProcessNextickArgs(),_=Object.keys||function(st){var at=[];for(var lt in st)at.push(lt);return at};_stream_duplex=nt;var $=Object.create(requireUtil());$.inherits=inherits_browserExports;var j=require_stream_readable(),_e=require_stream_writable();$.inherits(nt,j);for(var et=_(_e.prototype),tt=0;tt0?(typeof Ft!="string"&&!Lt.objectMode&&Object.getPrototypeOf(Ft)!==et.prototype&&(Ft=rt(Ft)),Xt?Lt.endEmitted?jt.emit("error",new Error("stream.unshift() after end event")):wt(jt,Lt,Ft,!0):Lt.ended?jt.emit("error",new Error("stream.push() after EOF")):(Lt.reading=!1,Lt.decoder&&!qt?(Ft=Lt.decoder.write(Ft),Lt.objectMode||Ft.length!==0?wt(jt,Lt,Ft,!1):bt(jt,Lt)):wt(jt,Lt,Ft,!1))):Xt||(Lt.reading=!1)}return Pt(Lt)}function wt(jt,Ft,qt,Xt){Ft.flowing&&Ft.length===0&&!Ft.sync?(jt.emit("data",qt),jt.read(0)):(Ft.length+=Ft.objectMode?1:qt.length,Xt?Ft.buffer.unshift(qt):Ft.buffer.push(qt),Ft.needReadable&&Tt(jt)),bt(jt,Ft)}function Ct(jt,Ft){var qt;return!nt(Ft)&&typeof Ft!="string"&&Ft!==void 0&&!jt.objectMode&&(qt=new TypeError("Invalid non-string/buffer chunk")),qt}function Pt(jt){return!jt.ended&&(jt.needReadable||jt.length=Bt?jt=Bt:(jt--,jt|=jt>>>1,jt|=jt>>>2,jt|=jt>>>4,jt|=jt>>>8,jt|=jt>>>16,jt++),jt}function kt(jt,Ft){return jt<=0||Ft.length===0&&Ft.ended?0:Ft.objectMode?1:jt!==jt?Ft.flowing&&Ft.length?Ft.buffer.head.data.length:Ft.length:(jt>Ft.highWaterMark&&(Ft.highWaterMark=At(jt)),jt<=Ft.length?jt:Ft.ended?Ft.length:(Ft.needReadable=!0,0))}yt.prototype.read=function(jt){st("read",jt),jt=parseInt(jt,10);var Ft=this._readableState,qt=jt;if(jt!==0&&(Ft.emittedReadable=!1),jt===0&&Ft.needReadable&&(Ft.length>=Ft.highWaterMark||Ft.ended))return st("read: emitReadable",Ft.length,Ft.ended),Ft.length===0&&Ft.ended?Vt(this):Tt(this),null;if(jt=kt(jt,Ft),jt===0&&Ft.ended)return Ft.length===0&&Vt(this),null;var Xt=Ft.needReadable;st("need readable",Xt),(Ft.length===0||Ft.length-jt0?Ut=St(jt,Ft):Ut=null,Ut===null?(Ft.needReadable=!0,jt=0):Ft.length-=jt,Ft.length===0&&(Ft.ended||(Ft.needReadable=!0),qt!==jt&&Ft.ended&&Vt(this)),Ut!==null&&this.emit("data",Ut),Ut};function Ot(jt,Ft){if(!Ft.ended){if(Ft.decoder){var qt=Ft.decoder.end();qt&&qt.length&&(Ft.buffer.push(qt),Ft.length+=Ft.objectMode?1:qt.length)}Ft.ended=!0,Tt(jt)}}function Tt(jt){var Ft=jt._readableState;Ft.needReadable=!1,Ft.emittedReadable||(st("emitReadable",Ft.flowing),Ft.emittedReadable=!0,Ft.sync?o.nextTick(ht,jt):ht(jt))}function ht(jt){st("emit readable"),jt.emit("readable"),$t(jt)}function bt(jt,Ft){Ft.readingMore||(Ft.readingMore=!0,o.nextTick(mt,jt,Ft))}function mt(jt,Ft){for(var qt=Ft.length;!Ft.reading&&!Ft.flowing&&!Ft.ended&&Ft.length1&&zt(Xt.pipes,jt)!==-1)&&!tr&&(st("false write response, pause",Xt.awaitDrain),Xt.awaitDrain++,ur=!0),qt.pause())}function pr(hr){st("onerror",hr),wr(),jt.removeListener("error",pr),j(jt,"error")===0&&jt.emit("error",hr)}dt(jt,"error",pr);function fr(){jt.removeListener("finish",lr),wr()}jt.once("close",fr);function lr(){st("onfinish"),jt.removeListener("close",fr),wr()}jt.once("finish",lr);function wr(){st("unpipe"),qt.unpipe(jt)}return jt.emit("pipe",qt),Xt.flowing||(st("pipe resume"),qt.resume()),jt};function gt(jt){return function(){var Ft=jt._readableState;st("pipeOnDrain",Ft.awaitDrain),Ft.awaitDrain&&Ft.awaitDrain--,Ft.awaitDrain===0&&j(jt,"data")&&(Ft.flowing=!0,$t(jt))}}yt.prototype.unpipe=function(jt){var Ft=this._readableState,qt={hasUnpiped:!1};if(Ft.pipesCount===0)return this;if(Ft.pipesCount===1)return jt&&jt!==Ft.pipes?this:(jt||(jt=Ft.pipes),Ft.pipes=null,Ft.pipesCount=0,Ft.flowing=!1,jt&&jt.emit("unpipe",this,qt),this);if(!jt){var Xt=Ft.pipes,Ut=Ft.pipesCount;Ft.pipes=null,Ft.pipesCount=0,Ft.flowing=!1;for(var Lt=0;Lt=Ft.length?(Ft.decoder?qt=Ft.buffer.join(""):Ft.buffer.length===1?qt=Ft.buffer.head.data:qt=Ft.buffer.concat(Ft.length),Ft.buffer.clear()):qt=Rt(jt,Ft.buffer,Ft.decoder),qt}function Rt(jt,Ft,qt){var Xt;return jtLt.length?Lt.length:jt;if(Ht===Lt.length?Ut+=Lt:Ut+=Lt.slice(0,jt),jt-=Ht,jt===0){Ht===Lt.length?(++Xt,qt.next?Ft.head=qt.next:Ft.head=Ft.tail=null):(Ft.head=qt,qt.data=Lt.slice(Ht));break}++Xt}return Ft.length-=Xt,Ut}function Mt(jt,Ft){var qt=et.allocUnsafe(jt),Xt=Ft.head,Ut=1;for(Xt.data.copy(qt),jt-=Xt.data.length;Xt=Xt.next;){var Lt=Xt.data,Ht=jt>Lt.length?Lt.length:jt;if(Lt.copy(qt,qt.length-jt,0,Ht),jt-=Ht,jt===0){Ht===Lt.length?(++Ut,Xt.next?Ft.head=Xt.next:Ft.head=Ft.tail=null):(Ft.head=Xt,Xt.data=Lt.slice(Ht));break}++Ut}return Ft.length-=Ut,qt}function Vt(jt){var Ft=jt._readableState;if(Ft.length>0)throw new Error('"endReadable()" called on non-empty stream');Ft.endEmitted||(Ft.ended=!0,o.nextTick(Gt,Ft,jt))}function Gt(jt,Ft){!jt.endEmitted&&jt.length===0&&(jt.endEmitted=!0,Ft.readable=!1,Ft.emit("end"))}function zt(jt,Ft){for(var qt=0,Xt=jt.length;qt=this._blockSize;){for(var it=this._blockOffset;it0;++st)this._length[st]+=at,at=this._length[st]/4294967296|0,at>0&&(this._length[st]-=4294967296*at);return this},_e.prototype._update=function(){throw new Error("_update is not implemented")},_e.prototype.digest=function(et){if(this._finalized)throw new Error("Digest already called");this._finalized=!0;var tt=this._digest();et!==void 0&&(tt=tt.toString(et)),this._block.fill(0),this._blockOffset=0;for(var rt=0;rt<4;++rt)this._length[rt]=0;return tt},_e.prototype._digest=function(){throw new Error("_digest is not implemented")},hashBase=_e,hashBase}var ripemd160,hasRequiredRipemd160;function requireRipemd160(){if(hasRequiredRipemd160)return ripemd160;hasRequiredRipemd160=1;var o=require$$0$1.Buffer,_=inherits_browserExports,$=requireHashBase(),j=new Array(16),_e=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],et=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],tt=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],rt=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],nt=[0,1518500249,1859775393,2400959708,2840853838],ot=[1352829926,1548603684,1836072691,2053994217,0];function it(pt,yt){return pt<>>32-yt}function st(pt,yt,vt,wt,Ct,Pt,Bt,At){return it(pt+(yt^vt^wt)+Pt+Bt|0,At)+Ct|0}function at(pt,yt,vt,wt,Ct,Pt,Bt,At){return it(pt+(yt&vt|~yt&wt)+Pt+Bt|0,At)+Ct|0}function lt(pt,yt,vt,wt,Ct,Pt,Bt,At){return it(pt+((yt|~vt)^wt)+Pt+Bt|0,At)+Ct|0}function ct(pt,yt,vt,wt,Ct,Pt,Bt,At){return it(pt+(yt&wt|vt&~wt)+Pt+Bt|0,At)+Ct|0}function ft(pt,yt,vt,wt,Ct,Pt,Bt,At){return it(pt+(yt^(vt|~wt))+Pt+Bt|0,At)+Ct|0}function dt(){$.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520}return _(dt,$),dt.prototype._update=function(){for(var pt=j,yt=0;yt<16;++yt)pt[yt]=this._block.readInt32LE(yt*4);for(var vt=this._a|0,wt=this._b|0,Ct=this._c|0,Pt=this._d|0,Bt=this._e|0,At=this._a|0,kt=this._b|0,Ot=this._c|0,Tt=this._d|0,ht=this._e|0,bt=0;bt<80;bt+=1){var mt,gt;bt<16?(mt=st(vt,wt,Ct,Pt,Bt,pt[_e[bt]],nt[0],tt[bt]),gt=ft(At,kt,Ot,Tt,ht,pt[et[bt]],ot[0],rt[bt])):bt<32?(mt=at(vt,wt,Ct,Pt,Bt,pt[_e[bt]],nt[1],tt[bt]),gt=ct(At,kt,Ot,Tt,ht,pt[et[bt]],ot[1],rt[bt])):bt<48?(mt=lt(vt,wt,Ct,Pt,Bt,pt[_e[bt]],nt[2],tt[bt]),gt=lt(At,kt,Ot,Tt,ht,pt[et[bt]],ot[2],rt[bt])):bt<64?(mt=ct(vt,wt,Ct,Pt,Bt,pt[_e[bt]],nt[3],tt[bt]),gt=at(At,kt,Ot,Tt,ht,pt[et[bt]],ot[3],rt[bt])):(mt=ft(vt,wt,Ct,Pt,Bt,pt[_e[bt]],nt[4],tt[bt]),gt=st(At,kt,Ot,Tt,ht,pt[et[bt]],ot[4],rt[bt])),vt=Bt,Bt=Pt,Pt=it(Ct,10),Ct=wt,wt=mt,At=ht,ht=Tt,Tt=it(Ot,10),Ot=kt,kt=gt}var xt=this._b+Ct+Tt|0;this._b=this._c+Pt+ht|0,this._c=this._d+Bt+At|0,this._d=this._e+vt+kt|0,this._e=this._a+wt+Ot|0,this._a=xt},dt.prototype._digest=function(){this._block[this._blockOffset]=128,this._blockOffset+=1,this._blockOffset>56&&(this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0),this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var pt=o.alloc?o.alloc(20):new o(20);return pt.writeInt32LE(this._a,0),pt.writeInt32LE(this._b,4),pt.writeInt32LE(this._c,8),pt.writeInt32LE(this._d,12),pt.writeInt32LE(this._e,16),pt},ripemd160=dt,ripemd160}var sha_js={exports:{}},hash$3,hasRequiredHash;function requireHash(){if(hasRequiredHash)return hash$3;hasRequiredHash=1;var o=safeBufferExports.Buffer,_=requireToBuffer$2();function $(j,_e){this._block=o.alloc(j),this._finalSize=_e,this._blockSize=j,this._len=0}return $.prototype.update=function(j,_e){j=_(j,_e||"utf8");for(var et=this._block,tt=this._blockSize,rt=j.length,nt=this._len,ot=0;ot=this._finalSize&&(this._update(this._block),this._block.fill(0));var et=this._len*8;if(et<=4294967295)this._block.writeUInt32BE(et,this._blockSize-4);else{var tt=(et&4294967295)>>>0,rt=(et-tt)/4294967296;this._block.writeUInt32BE(rt,this._blockSize-8),this._block.writeUInt32BE(tt,this._blockSize-4)}this._update(this._block);var nt=this._hash();return j?nt.toString(j):nt},$.prototype._update=function(){throw new Error("_update must be implemented by subclass")},hash$3=$,hash$3}var sha,hasRequiredSha;function requireSha(){if(hasRequiredSha)return sha;hasRequiredSha=1;var o=inherits_browserExports,_=requireHash(),$=safeBufferExports.Buffer,j=[1518500249,1859775393,-1894007588,-899497514],_e=new Array(80);function et(){this.init(),this._w=_e,_.call(this,64,56)}o(et,_),et.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function tt(ot){return ot<<5|ot>>>27}function rt(ot){return ot<<30|ot>>>2}function nt(ot,it,st,at){return ot===0?it&st|~it&at:ot===2?it&st|it&at|st&at:it^st^at}return et.prototype._update=function(ot){for(var it=this._w,st=this._a|0,at=this._b|0,lt=this._c|0,ct=this._d|0,ft=this._e|0,dt=0;dt<16;++dt)it[dt]=ot.readInt32BE(dt*4);for(;dt<80;++dt)it[dt]=it[dt-3]^it[dt-8]^it[dt-14]^it[dt-16];for(var pt=0;pt<80;++pt){var yt=~~(pt/20),vt=tt(st)+nt(yt,at,lt,ct)+ft+it[pt]+j[yt]|0;ft=ct,ct=lt,lt=rt(at),at=st,st=vt}this._a=st+this._a|0,this._b=at+this._b|0,this._c=lt+this._c|0,this._d=ct+this._d|0,this._e=ft+this._e|0},et.prototype._hash=function(){var ot=$.allocUnsafe(20);return ot.writeInt32BE(this._a|0,0),ot.writeInt32BE(this._b|0,4),ot.writeInt32BE(this._c|0,8),ot.writeInt32BE(this._d|0,12),ot.writeInt32BE(this._e|0,16),ot},sha=et,sha}var sha1,hasRequiredSha1;function requireSha1(){if(hasRequiredSha1)return sha1;hasRequiredSha1=1;var o=inherits_browserExports,_=requireHash(),$=safeBufferExports.Buffer,j=[1518500249,1859775393,-1894007588,-899497514],_e=new Array(80);function et(){this.init(),this._w=_e,_.call(this,64,56)}o(et,_),et.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function tt(it){return it<<1|it>>>31}function rt(it){return it<<5|it>>>27}function nt(it){return it<<30|it>>>2}function ot(it,st,at,lt){return it===0?st&at|~st<:it===2?st&at|st<|at<:st^at^lt}return et.prototype._update=function(it){for(var st=this._w,at=this._a|0,lt=this._b|0,ct=this._c|0,ft=this._d|0,dt=this._e|0,pt=0;pt<16;++pt)st[pt]=it.readInt32BE(pt*4);for(;pt<80;++pt)st[pt]=tt(st[pt-3]^st[pt-8]^st[pt-14]^st[pt-16]);for(var yt=0;yt<80;++yt){var vt=~~(yt/20),wt=rt(at)+ot(vt,lt,ct,ft)+dt+st[yt]+j[vt]|0;dt=ft,ft=ct,ct=nt(lt),lt=at,at=wt}this._a=at+this._a|0,this._b=lt+this._b|0,this._c=ct+this._c|0,this._d=ft+this._d|0,this._e=dt+this._e|0},et.prototype._hash=function(){var it=$.allocUnsafe(20);return it.writeInt32BE(this._a|0,0),it.writeInt32BE(this._b|0,4),it.writeInt32BE(this._c|0,8),it.writeInt32BE(this._d|0,12),it.writeInt32BE(this._e|0,16),it},sha1=et,sha1}var sha256$2,hasRequiredSha256;function requireSha256(){if(hasRequiredSha256)return sha256$2;hasRequiredSha256=1;var o=inherits_browserExports,_=requireHash(),$=safeBufferExports.Buffer,j=[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],_e=new Array(64);function et(){this.init(),this._w=_e,_.call(this,64,56)}o(et,_),et.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};function tt(at,lt,ct){return ct^at&(lt^ct)}function rt(at,lt,ct){return at<|ct&(at|lt)}function nt(at){return(at>>>2|at<<30)^(at>>>13|at<<19)^(at>>>22|at<<10)}function ot(at){return(at>>>6|at<<26)^(at>>>11|at<<21)^(at>>>25|at<<7)}function it(at){return(at>>>7|at<<25)^(at>>>18|at<<14)^at>>>3}function st(at){return(at>>>17|at<<15)^(at>>>19|at<<13)^at>>>10}return et.prototype._update=function(at){for(var lt=this._w,ct=this._a|0,ft=this._b|0,dt=this._c|0,pt=this._d|0,yt=this._e|0,vt=this._f|0,wt=this._g|0,Ct=this._h|0,Pt=0;Pt<16;++Pt)lt[Pt]=at.readInt32BE(Pt*4);for(;Pt<64;++Pt)lt[Pt]=st(lt[Pt-2])+lt[Pt-7]+it(lt[Pt-15])+lt[Pt-16]|0;for(var Bt=0;Bt<64;++Bt){var At=Ct+ot(yt)+tt(yt,vt,wt)+j[Bt]+lt[Bt]|0,kt=nt(ct)+rt(ct,ft,dt)|0;Ct=wt,wt=vt,vt=yt,yt=pt+At|0,pt=dt,dt=ft,ft=ct,ct=At+kt|0}this._a=ct+this._a|0,this._b=ft+this._b|0,this._c=dt+this._c|0,this._d=pt+this._d|0,this._e=yt+this._e|0,this._f=vt+this._f|0,this._g=wt+this._g|0,this._h=Ct+this._h|0},et.prototype._hash=function(){var at=$.allocUnsafe(32);return at.writeInt32BE(this._a,0),at.writeInt32BE(this._b,4),at.writeInt32BE(this._c,8),at.writeInt32BE(this._d,12),at.writeInt32BE(this._e,16),at.writeInt32BE(this._f,20),at.writeInt32BE(this._g,24),at.writeInt32BE(this._h,28),at},sha256$2=et,sha256$2}var sha224$1,hasRequiredSha224;function requireSha224(){if(hasRequiredSha224)return sha224$1;hasRequiredSha224=1;var o=inherits_browserExports,_=requireSha256(),$=requireHash(),j=safeBufferExports.Buffer,_e=new Array(64);function et(){this.init(),this._w=_e,$.call(this,64,56)}return o(et,_),et.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},et.prototype._hash=function(){var tt=j.allocUnsafe(28);return tt.writeInt32BE(this._a,0),tt.writeInt32BE(this._b,4),tt.writeInt32BE(this._c,8),tt.writeInt32BE(this._d,12),tt.writeInt32BE(this._e,16),tt.writeInt32BE(this._f,20),tt.writeInt32BE(this._g,24),tt},sha224$1=et,sha224$1}var sha512$2,hasRequiredSha512;function requireSha512(){if(hasRequiredSha512)return sha512$2;hasRequiredSha512=1;var o=inherits_browserExports,_=requireHash(),$=safeBufferExports.Buffer,j=[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],_e=new Array(160);function et(){this.init(),this._w=_e,_.call(this,128,112)}o(et,_),et.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};function tt(ft,dt,pt){return pt^ft&(dt^pt)}function rt(ft,dt,pt){return ft&dt|pt&(ft|dt)}function nt(ft,dt){return(ft>>>28|dt<<4)^(dt>>>2|ft<<30)^(dt>>>7|ft<<25)}function ot(ft,dt){return(ft>>>14|dt<<18)^(ft>>>18|dt<<14)^(dt>>>9|ft<<23)}function it(ft,dt){return(ft>>>1|dt<<31)^(ft>>>8|dt<<24)^ft>>>7}function st(ft,dt){return(ft>>>1|dt<<31)^(ft>>>8|dt<<24)^(ft>>>7|dt<<25)}function at(ft,dt){return(ft>>>19|dt<<13)^(dt>>>29|ft<<3)^ft>>>6}function lt(ft,dt){return(ft>>>19|dt<<13)^(dt>>>29|ft<<3)^(ft>>>6|dt<<26)}function ct(ft,dt){return ft>>>0
>>0?1:0}return et.prototype._update=function(ft){for(var dt=this._w,pt=this._ah|0,yt=this._bh|0,vt=this._ch|0,wt=this._dh|0,Ct=this._eh|0,Pt=this._fh|0,Bt=this._gh|0,At=this._hh|0,kt=this._al|0,Ot=this._bl|0,Tt=this._cl|0,ht=this._dl|0,bt=this._el|0,mt=this._fl|0,gt=this._gl|0,xt=this._hl|0,Et=0;Et<32;Et+=2)dt[Et]=ft.readInt32BE(Et*4),dt[Et+1]=ft.readInt32BE(Et*4+4);for(;Et<160;Et+=2){var _t=dt[Et-30],$t=dt[Et-15*2+1],St=it(_t,$t),Rt=st($t,_t);_t=dt[Et-2*2],$t=dt[Et-2*2+1];var It=at(_t,$t),Mt=lt($t,_t),Vt=dt[Et-7*2],Gt=dt[Et-7*2+1],zt=dt[Et-16*2],jt=dt[Et-16*2+1],Ft=Rt+Gt|0,qt=St+Vt+ct(Ft,Rt)|0;Ft=Ft+Mt|0,qt=qt+It+ct(Ft,Mt)|0,Ft=Ft+jt|0,qt=qt+zt+ct(Ft,jt)|0,dt[Et]=qt,dt[Et+1]=Ft}for(var Xt=0;Xt<160;Xt+=2){qt=dt[Xt],Ft=dt[Xt+1];var Ut=rt(pt,yt,vt),Lt=rt(kt,Ot,Tt),Ht=nt(pt,kt),Kt=nt(kt,pt),Jt=ot(Ct,bt),tr=ot(bt,Ct),nr=j[Xt],ur=j[Xt+1],rr=tt(Ct,Pt,Bt),pr=tt(bt,mt,gt),fr=xt+tr|0,lr=At+Jt+ct(fr,xt)|0;fr=fr+pr|0,lr=lr+rr+ct(fr,pr)|0,fr=fr+ur|0,lr=lr+nr+ct(fr,ur)|0,fr=fr+Ft|0,lr=lr+qt+ct(fr,Ft)|0;var wr=Kt+Lt|0,hr=Ht+Ut+ct(wr,Kt)|0;At=Bt,xt=gt,Bt=Pt,gt=mt,Pt=Ct,mt=bt,bt=ht+fr|0,Ct=wt+lr+ct(bt,ht)|0,wt=vt,ht=Tt,vt=yt,Tt=Ot,yt=pt,Ot=kt,kt=fr+wr|0,pt=lr+hr+ct(kt,fr)|0}this._al=this._al+kt|0,this._bl=this._bl+Ot|0,this._cl=this._cl+Tt|0,this._dl=this._dl+ht|0,this._el=this._el+bt|0,this._fl=this._fl+mt|0,this._gl=this._gl+gt|0,this._hl=this._hl+xt|0,this._ah=this._ah+pt+ct(this._al,kt)|0,this._bh=this._bh+yt+ct(this._bl,Ot)|0,this._ch=this._ch+vt+ct(this._cl,Tt)|0,this._dh=this._dh+wt+ct(this._dl,ht)|0,this._eh=this._eh+Ct+ct(this._el,bt)|0,this._fh=this._fh+Pt+ct(this._fl,mt)|0,this._gh=this._gh+Bt+ct(this._gl,gt)|0,this._hh=this._hh+At+ct(this._hl,xt)|0},et.prototype._hash=function(){var ft=$.allocUnsafe(64);function dt(pt,yt,vt){ft.writeInt32BE(pt,vt),ft.writeInt32BE(yt,vt+4)}return dt(this._ah,this._al,0),dt(this._bh,this._bl,8),dt(this._ch,this._cl,16),dt(this._dh,this._dl,24),dt(this._eh,this._el,32),dt(this._fh,this._fl,40),dt(this._gh,this._gl,48),dt(this._hh,this._hl,56),ft},sha512$2=et,sha512$2}var sha384$1,hasRequiredSha384;function requireSha384(){if(hasRequiredSha384)return sha384$1;hasRequiredSha384=1;var o=inherits_browserExports,_=requireSha512(),$=requireHash(),j=safeBufferExports.Buffer,_e=new Array(160);function et(){this.init(),this._w=_e,$.call(this,128,112)}return o(et,_),et.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},et.prototype._hash=function(){var tt=j.allocUnsafe(48);function rt(nt,ot,it){tt.writeInt32BE(nt,it),tt.writeInt32BE(ot,it+4)}return rt(this._ah,this._al,0),rt(this._bh,this._bl,8),rt(this._ch,this._cl,16),rt(this._dh,this._dl,24),rt(this._eh,this._el,32),rt(this._fh,this._fl,40),tt},sha384$1=et,sha384$1}var hasRequiredSha_js;function requireSha_js(){return hasRequiredSha_js||(hasRequiredSha_js=1,function(o){o.exports=function($){var j=$.toLowerCase(),_e=o.exports[j];if(!_e)throw new Error(j+" is not supported (we accept pull requests)");return new _e},o.exports.sha=requireSha(),o.exports.sha1=requireSha1(),o.exports.sha224=requireSha224(),o.exports.sha256=requireSha256(),o.exports.sha384=requireSha384(),o.exports.sha512=requireSha512()}(sha_js)),sha_js.exports}var cipherBase,hasRequiredCipherBase;function requireCipherBase(){if(hasRequiredCipherBase)return cipherBase;hasRequiredCipherBase=1;var o=safeBufferExports.Buffer,_=requireStreamBrowserify().Transform,$=string_decoder.StringDecoder,j=inherits_browserExports,_e=requireToBuffer$2();function et(tt){_.call(this),this.hashMode=typeof tt=="string",this.hashMode?this[tt]=this._finalOrDigest:this.final=this._finalOrDigest,this._final&&(this.__final=this._final,this._final=null),this._decoder=null,this._encoding=null}return j(et,_),et.prototype.update=function(tt,rt,nt){var ot=_e(tt,rt),it=this._update(ot);return this.hashMode?this:(nt&&(it=this._toString(it,nt)),it)},et.prototype.setAutoPadding=function(){},et.prototype.getAuthTag=function(){throw new Error("trying to get auth tag in unsupported state")},et.prototype.setAuthTag=function(){throw new Error("trying to set auth tag in unsupported state")},et.prototype.setAAD=function(){throw new Error("trying to set aad in unsupported state")},et.prototype._transform=function(tt,rt,nt){var ot;try{this.hashMode?this._update(tt):this.push(this._update(tt))}catch(it){ot=it}finally{nt(ot)}},et.prototype._flush=function(tt){var rt;try{this.push(this.__final())}catch(nt){rt=nt}tt(rt)},et.prototype._finalOrDigest=function(tt){var rt=this.__final()||o.alloc(0);return tt&&(rt=this._toString(rt,tt,!0)),rt},et.prototype._toString=function(tt,rt,nt){if(this._decoder||(this._decoder=new $(rt),this._encoding=rt),this._encoding!==rt)throw new Error("can’t switch encodings");var ot=this._decoder.write(tt);return nt&&(ot+=this._decoder.end()),ot},cipherBase=et,cipherBase}var browser$b,hasRequiredBrowser$a;function requireBrowser$a(){if(hasRequiredBrowser$a)return browser$b;hasRequiredBrowser$a=1;var o=inherits_browserExports,_=requireMd5_js(),$=requireRipemd160(),j=requireSha_js(),_e=requireCipherBase();function et(tt){_e.call(this,"digest"),this._hash=tt}return o(et,_e),et.prototype._update=function(tt){this._hash.update(tt)},et.prototype._final=function(){return this._hash.digest()},browser$b=function(rt){return rt=rt.toLowerCase(),rt==="md5"?new _:rt==="rmd160"||rt==="ripemd160"?new $:new et(j(rt))},browser$b}var legacy$1,hasRequiredLegacy;function requireLegacy(){if(hasRequiredLegacy)return legacy$1;hasRequiredLegacy=1;var o=inherits_browserExports,_=safeBufferExports.Buffer,$=requireCipherBase(),j=_.alloc(128),_e=64;function et(tt,rt){$.call(this,"digest"),typeof rt=="string"&&(rt=_.from(rt)),this._alg=tt,this._key=rt,rt.length>_e?rt=tt(rt):rt.length<_e&&(rt=_.concat([rt,j],_e));for(var nt=this._ipad=_.allocUnsafe(_e),ot=this._opad=_.allocUnsafe(_e),it=0;it<_e;it++)nt[it]=rt[it]^54,ot[it]=rt[it]^92;this._hash=[nt]}return o(et,$),et.prototype._update=function(tt){this._hash.push(tt)},et.prototype._final=function(){var tt=this._alg(_.concat(this._hash));return this._alg(_.concat([this._opad,tt]))},legacy$1=et,legacy$1}var md5,hasRequiredMd5;function requireMd5(){if(hasRequiredMd5)return md5;hasRequiredMd5=1;var o=requireMd5_js();return md5=function(_){return new o().update(_).digest()},md5}var browser$a,hasRequiredBrowser$9;function requireBrowser$9(){if(hasRequiredBrowser$9)return browser$a;hasRequiredBrowser$9=1;var o=inherits_browserExports,_=requireLegacy(),$=requireCipherBase(),j=safeBufferExports.Buffer,_e=requireMd5(),et=requireRipemd160(),tt=requireSha_js(),rt=j.alloc(128);function nt(ot,it){$.call(this,"digest"),typeof it=="string"&&(it=j.from(it));var st=ot==="sha512"||ot==="sha384"?128:64;if(this._alg=ot,this._key=it,it.length>st){var at=ot==="rmd160"?new et:tt(ot);it=at.update(it).digest()}else it.length_||j!==j)throw new TypeError("Bad key length")},precondition}var defaultEncoding_1,hasRequiredDefaultEncoding;function requireDefaultEncoding(){if(hasRequiredDefaultEncoding)return defaultEncoding_1;hasRequiredDefaultEncoding=1;var o;if(globalThis.process&&globalThis.process.browser)o="utf-8";else if(globalThis.process&&globalThis.process.version){var _=parseInt(process$1$1.version.split(".")[0].slice(1),10);o=_>=6?"utf-8":"binary"}else o="utf-8";return defaultEncoding_1=o,defaultEncoding_1}var toBuffer_1,hasRequiredToBuffer;function requireToBuffer(){if(hasRequiredToBuffer)return toBuffer_1;hasRequiredToBuffer=1;var o=safeBufferExports.Buffer,_=requireToBuffer$2(),$=typeof Uint8Array<"u",j=$&&typeof ArrayBuffer<"u",_e=j&&ArrayBuffer.isView;return toBuffer_1=function(et,tt,rt){if(typeof et=="string"||o.isBuffer(et)||$&&et instanceof Uint8Array||_e&&_e(et))return _(et,tt);throw new TypeError(rt+" must be a string, a Buffer, a Uint8Array, or a DataView")},toBuffer_1}var syncBrowser,hasRequiredSyncBrowser;function requireSyncBrowser(){if(hasRequiredSyncBrowser)return syncBrowser;hasRequiredSyncBrowser=1;var o=requireMd5(),_=requireRipemd160(),$=requireSha_js(),j=safeBufferExports.Buffer,_e=requirePrecondition(),et=requireDefaultEncoding(),tt=requireToBuffer(),rt=j.alloc(128),nt={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,ripemd160:20,rmd160:20},ot={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"};function it(ct){return new _().update(ct).digest()}function st(ct){function ft(dt){return $(ct).update(dt).digest()}return ct==="rmd160"||ct==="ripemd160"?it:ct==="md5"?o:ft}function at(ct,ft,dt){var pt=st(ct),yt=ct==="sha512"||ct==="sha384"?128:64;ft.length>yt?ft=pt(ft):ft.length>>0},utils$b.writeUInt32BE=function(_e,et,tt){_e[0+tt]=et>>>24,_e[1+tt]=et>>>16&255,_e[2+tt]=et>>>8&255,_e[3+tt]=et&255},utils$b.ip=function(_e,et,tt,rt){for(var nt=0,ot=0,it=6;it>=0;it-=2){for(var st=0;st<=24;st+=8)nt<<=1,nt|=et>>>st+it&1;for(var st=0;st<=24;st+=8)nt<<=1,nt|=_e>>>st+it&1}for(var it=6;it>=0;it-=2){for(var st=1;st<=25;st+=8)ot<<=1,ot|=et>>>st+it&1;for(var st=1;st<=25;st+=8)ot<<=1,ot|=_e>>>st+it&1}tt[rt+0]=nt>>>0,tt[rt+1]=ot>>>0},utils$b.rip=function(_e,et,tt,rt){for(var nt=0,ot=0,it=0;it<4;it++)for(var st=24;st>=0;st-=8)nt<<=1,nt|=et>>>st+it&1,nt<<=1,nt|=_e>>>st+it&1;for(var it=4;it<8;it++)for(var st=24;st>=0;st-=8)ot<<=1,ot|=et>>>st+it&1,ot<<=1,ot|=_e>>>st+it&1;tt[rt+0]=nt>>>0,tt[rt+1]=ot>>>0},utils$b.pc1=function(_e,et,tt,rt){for(var nt=0,ot=0,it=7;it>=5;it--){for(var st=0;st<=24;st+=8)nt<<=1,nt|=et>>st+it&1;for(var st=0;st<=24;st+=8)nt<<=1,nt|=_e>>st+it&1}for(var st=0;st<=24;st+=8)nt<<=1,nt|=et>>st+it&1;for(var it=1;it<=3;it++){for(var st=0;st<=24;st+=8)ot<<=1,ot|=et>>st+it&1;for(var st=0;st<=24;st+=8)ot<<=1,ot|=_e>>st+it&1}for(var st=0;st<=24;st+=8)ot<<=1,ot|=_e>>st+it&1;tt[rt+0]=nt>>>0,tt[rt+1]=ot>>>0},utils$b.r28shl=function(_e,et){return _e<>>28-et};var o=[14,11,17,4,27,23,25,0,13,22,7,18,5,9,16,24,2,20,12,21,1,8,15,26,15,4,25,19,9,1,26,16,5,11,23,8,12,7,17,0,22,3,10,14,6,20,27,24];utils$b.pc2=function(_e,et,tt,rt){for(var nt=0,ot=0,it=o.length>>>1,st=0;st>>o[st]&1;for(var st=it;st>>o[st]&1;tt[rt+0]=nt>>>0,tt[rt+1]=ot>>>0},utils$b.expand=function(_e,et,tt){var rt=0,nt=0;rt=(_e&1)<<5|_e>>>27;for(var ot=23;ot>=15;ot-=4)rt<<=6,rt|=_e>>>ot&63;for(var ot=11;ot>=3;ot-=4)nt|=_e>>>ot&63,nt<<=6;nt|=(_e&31)<<1|_e>>>31,et[tt+0]=rt>>>0,et[tt+1]=nt>>>0};var _=[14,0,4,15,13,7,1,4,2,14,15,2,11,13,8,1,3,10,10,6,6,12,12,11,5,9,9,5,0,3,7,8,4,15,1,12,14,8,8,2,13,4,6,9,2,1,11,7,15,5,12,11,9,3,7,14,3,10,10,0,5,6,0,13,15,3,1,13,8,4,14,7,6,15,11,2,3,8,4,14,9,12,7,0,2,1,13,10,12,6,0,9,5,11,10,5,0,13,14,8,7,10,11,1,10,3,4,15,13,4,1,2,5,11,8,6,12,7,6,12,9,0,3,5,2,14,15,9,10,13,0,7,9,0,14,9,6,3,3,4,15,6,5,10,1,2,13,8,12,5,7,14,11,12,4,11,2,15,8,1,13,1,6,10,4,13,9,0,8,6,15,9,3,8,0,7,11,4,1,15,2,14,12,3,5,11,10,5,14,2,7,12,7,13,13,8,14,11,3,5,0,6,6,15,9,0,10,3,1,4,2,7,8,2,5,12,11,1,12,10,4,14,15,9,10,3,6,15,9,0,0,6,12,10,11,1,7,13,13,8,15,9,1,4,3,5,14,11,5,12,2,7,8,2,4,14,2,14,12,11,4,2,1,12,7,4,10,7,11,13,6,1,8,5,5,0,3,15,15,10,13,3,0,9,14,8,9,6,4,11,2,8,1,12,11,7,10,1,13,14,7,2,8,13,15,6,9,15,12,0,5,9,6,10,3,4,0,5,14,3,12,10,1,15,10,4,15,2,9,7,2,12,6,9,8,5,0,6,13,1,3,13,4,14,14,0,7,11,5,3,11,8,9,4,14,3,15,2,5,12,2,9,8,5,12,15,3,10,7,11,0,14,4,1,10,7,1,6,13,0,11,8,6,13,4,13,11,0,2,11,14,7,15,4,0,9,8,1,13,10,3,14,12,3,9,5,7,12,5,2,10,15,6,8,1,6,1,6,4,11,11,13,13,8,12,1,3,4,7,10,14,7,10,9,15,5,6,0,8,15,0,14,5,2,9,3,2,12,13,1,2,15,8,13,4,8,6,10,15,3,11,7,1,4,10,12,9,5,3,6,14,11,5,0,0,14,12,9,7,2,7,2,11,1,4,14,1,7,9,4,12,10,14,8,2,13,0,15,6,12,10,9,13,0,15,3,3,5,5,6,8,11];utils$b.substitute=function(_e,et){for(var tt=0,rt=0;rt<4;rt++){var nt=_e>>>18-rt*6&63,ot=_[rt*64+nt];tt<<=4,tt|=ot}for(var rt=0;rt<4;rt++){var nt=et>>>18-rt*6&63,ot=_[4*64+rt*64+nt];tt<<=4,tt|=ot}return tt>>>0};var $=[16,25,12,11,3,20,4,15,31,17,9,6,27,14,1,22,30,24,8,18,0,5,29,23,13,19,2,26,10,21,28,7];return utils$b.permute=function(_e){for(var et=0,tt=0;tt<$.length;tt++)et<<=1,et|=_e>>>$[tt]&1;return et>>>0},utils$b.padSplit=function(_e,et,tt){for(var rt=_e.toString(2);rt.length0;tt--)_e+=this._buffer(j,_e),et+=this._flushBuffer(rt,et);return _e+=this._buffer(j,_e),rt},_.prototype.final=function(j){var _e;j&&(_e=this.update(j));var et;return this.type==="encrypt"?et=this._finalEncrypt():et=this._finalDecrypt(),_e?_e.concat(et):et},_.prototype._pad=function(j,_e){if(_e===0)return!1;for(;_e>>1];it=$.r28shl(it,lt),st=$.r28shl(st,lt),$.pc2(it,st,nt.keys,at)}},et.prototype._update=function(nt,ot,it,st){var at=this._desState,lt=$.readUInt32BE(nt,ot),ct=$.readUInt32BE(nt,ot+4);$.ip(lt,ct,at.tmp,0),lt=at.tmp[0],ct=at.tmp[1],this.type==="encrypt"?this._encrypt(at,lt,ct,at.tmp,0):this._decrypt(at,lt,ct,at.tmp,0),lt=at.tmp[0],ct=at.tmp[1],$.writeUInt32BE(it,lt,st),$.writeUInt32BE(it,ct,st+4)},et.prototype._pad=function(nt,ot){if(this.padding===!1)return!1;for(var it=nt.length-ot,st=ot;st>>0,lt=wt}$.rip(ct,lt,st,at)},et.prototype._decrypt=function(nt,ot,it,st,at){for(var lt=it,ct=ot,ft=nt.keys.length-2;ft>=0;ft-=2){var dt=nt.keys[ft],pt=nt.keys[ft+1];$.expand(lt,nt.tmp,0),dt^=nt.tmp[0],pt^=nt.tmp[1];var yt=$.substitute(dt,pt),vt=$.permute(yt),wt=lt;lt=(ct^vt)>>>0,ct=wt}$.rip(lt,ct,st,at)},des}var cbc$1={},hasRequiredCbc$1;function requireCbc$1(){if(hasRequiredCbc$1)return cbc$1;hasRequiredCbc$1=1;var o=minimalisticAssert,_=inherits_browserExports,$={};function j(et){o.equal(et.length,8,"Invalid IV length"),this.iv=new Array(8);for(var tt=0;tt>rt%8,j._prev=$(j._prev,et?it:st);return ot}function $(j,_e){var et=j.length,tt=-1,rt=o.allocUnsafe(j.length);for(j=o.concat([j,o.from([_e])]);++tt>7;return rt}return cfb1.encrypt=function(j,_e,et){for(var tt=_e.length,rt=o.allocUnsafe(tt),nt=-1;++nt>>24]^lt[pt>>>16&255]^ct[yt>>>8&255]^ft[vt&255]^nt[At++],Ct=at[pt>>>24]^lt[yt>>>16&255]^ct[vt>>>8&255]^ft[dt&255]^nt[At++],Pt=at[yt>>>24]^lt[vt>>>16&255]^ct[dt>>>8&255]^ft[pt&255]^nt[At++],Bt=at[vt>>>24]^lt[dt>>>16&255]^ct[pt>>>8&255]^ft[yt&255]^nt[At++],dt=wt,pt=Ct,yt=Pt,vt=Bt;return wt=(it[dt>>>24]<<24|it[pt>>>16&255]<<16|it[yt>>>8&255]<<8|it[vt&255])^nt[At++],Ct=(it[pt>>>24]<<24|it[yt>>>16&255]<<16|it[vt>>>8&255]<<8|it[dt&255])^nt[At++],Pt=(it[yt>>>24]<<24|it[vt>>>16&255]<<16|it[dt>>>8&255]<<8|it[pt&255])^nt[At++],Bt=(it[vt>>>24]<<24|it[dt>>>16&255]<<16|it[pt>>>8&255]<<8|it[yt&255])^nt[At++],wt=wt>>>0,Ct=Ct>>>0,Pt=Pt>>>0,Bt=Bt>>>0,[wt,Ct,Pt,Bt]}var _e=[0,1,2,4,8,16,32,64,128,27,54],et=function(){for(var rt=new Array(256),nt=0;nt<256;nt++)nt<128?rt[nt]=nt<<1:rt[nt]=nt<<1^283;for(var ot=[],it=[],st=[[],[],[],[]],at=[[],[],[],[]],lt=0,ct=0,ft=0;ft<256;++ft){var dt=ct^ct<<1^ct<<2^ct<<3^ct<<4;dt=dt>>>8^dt&255^99,ot[lt]=dt,it[dt]=lt;var pt=rt[lt],yt=rt[pt],vt=rt[yt],wt=rt[dt]*257^dt*16843008;st[0][lt]=wt<<24|wt>>>8,st[1][lt]=wt<<16|wt>>>16,st[2][lt]=wt<<8|wt>>>24,st[3][lt]=wt,wt=vt*16843009^yt*65537^pt*257^lt*16843008,at[0][dt]=wt<<24|wt>>>8,at[1][dt]=wt<<16|wt>>>16,at[2][dt]=wt<<8|wt>>>24,at[3][dt]=wt,lt===0?lt=ct=1:(lt=pt^rt[rt[rt[vt^pt]]],ct^=rt[rt[ct]])}return{SBOX:ot,INV_SBOX:it,SUB_MIX:st,INV_SUB_MIX:at}}();function tt(rt){this._key=_(rt),this._reset()}return tt.blockSize=4*4,tt.keySize=256/8,tt.prototype.blockSize=tt.blockSize,tt.prototype.keySize=tt.keySize,tt.prototype._reset=function(){for(var rt=this._key,nt=rt.length,ot=nt+6,it=(ot+1)*4,st=[],at=0;at>>24,lt=et.SBOX[lt>>>24]<<24|et.SBOX[lt>>>16&255]<<16|et.SBOX[lt>>>8&255]<<8|et.SBOX[lt&255],lt^=_e[at/nt|0]<<24):nt>6&&at%nt===4&&(lt=et.SBOX[lt>>>24]<<24|et.SBOX[lt>>>16&255]<<16|et.SBOX[lt>>>8&255]<<8|et.SBOX[lt&255]),st[at]=st[at-nt]^lt}for(var ct=[],ft=0;ft>>24]]^et.INV_SUB_MIX[1][et.SBOX[pt>>>16&255]]^et.INV_SUB_MIX[2][et.SBOX[pt>>>8&255]]^et.INV_SUB_MIX[3][et.SBOX[pt&255]]}this._nRounds=ot,this._keySchedule=st,this._invKeySchedule=ct},tt.prototype.encryptBlockRaw=function(rt){return rt=_(rt),j(rt,this._keySchedule,et.SUB_MIX,et.SBOX,this._nRounds)},tt.prototype.encryptBlock=function(rt){var nt=this.encryptBlockRaw(rt),ot=o.allocUnsafe(16);return ot.writeUInt32BE(nt[0],0),ot.writeUInt32BE(nt[1],4),ot.writeUInt32BE(nt[2],8),ot.writeUInt32BE(nt[3],12),ot},tt.prototype.decryptBlock=function(rt){rt=_(rt);var nt=rt[1];rt[1]=rt[3],rt[3]=nt;var ot=j(rt,this._invKeySchedule,et.INV_SUB_MIX,et.INV_SBOX,this._nRounds),it=o.allocUnsafe(16);return it.writeUInt32BE(ot[0],0),it.writeUInt32BE(ot[3],4),it.writeUInt32BE(ot[2],8),it.writeUInt32BE(ot[1],12),it},tt.prototype.scrub=function(){$(this._keySchedule),$(this._invKeySchedule),$(this._key)},aes.AES=tt,aes}var ghash,hasRequiredGhash;function requireGhash(){if(hasRequiredGhash)return ghash;hasRequiredGhash=1;var o=safeBufferExports.Buffer,_=o.alloc(16,0);function $(et){return[et.readUInt32BE(0),et.readUInt32BE(4),et.readUInt32BE(8),et.readUInt32BE(12)]}function j(et){var tt=o.allocUnsafe(16);return tt.writeUInt32BE(et[0]>>>0,0),tt.writeUInt32BE(et[1]>>>0,4),tt.writeUInt32BE(et[2]>>>0,8),tt.writeUInt32BE(et[3]>>>0,12),tt}function _e(et){this.h=et,this.state=o.alloc(16,0),this.cache=o.allocUnsafe(0)}return _e.prototype.ghash=function(et){for(var tt=-1;++tt0;rt--)et[rt]=et[rt]>>>1|(et[rt-1]&1)<<31;et[0]=et[0]>>>1,ot&&(et[0]=et[0]^225<<24)}this.state=j(tt)},_e.prototype.update=function(et){this.cache=o.concat([this.cache,et]);for(var tt;this.cache.length>=16;)tt=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(tt)},_e.prototype.final=function(et,tt){return this.cache.length&&this.ghash(o.concat([this.cache,_],16)),this.ghash(j([0,et,0,tt])),this.state},ghash=_e,ghash}var authCipher,hasRequiredAuthCipher;function requireAuthCipher(){if(hasRequiredAuthCipher)return authCipher;hasRequiredAuthCipher=1;var o=requireAes(),_=safeBufferExports.Buffer,$=requireCipherBase(),j=inherits_browserExports,_e=requireGhash(),et=requireBufferXor(),tt=requireIncr32();function rt(it,st){var at=0;it.length!==st.length&&at++;for(var lt=Math.min(it.length,st.length),ct=0;ct0||tt>0;){var st=new _;st.update(it),st.update(j),_e&&st.update(_e),it=st.digest();var at=0;if(rt>0){var lt=nt.length-rt;at=Math.min(rt,it.length),it.copy(nt,lt,0,at),rt-=at}if(at0){var ct=ot.length-tt,ft=Math.min(tt,it.length-at);it.copy(ot,ct,at,at+ft),tt-=ft}}return it.fill(0),{key:nt,iv:ot}}return evp_bytestokey=$,evp_bytestokey}var hasRequiredEncrypter;function requireEncrypter(){if(hasRequiredEncrypter)return encrypter;hasRequiredEncrypter=1;var o=requireModes$1(),_=requireAuthCipher(),$=safeBufferExports.Buffer,j=requireStreamCipher(),_e=requireCipherBase(),et=requireAes(),tt=requireEvp_bytestokey(),rt=inherits_browserExports;function nt(lt,ct,ft){_e.call(this),this._cache=new it,this._cipher=new et.AES(ct),this._prev=$.from(ft),this._mode=lt,this._autopadding=!0}rt(nt,_e),nt.prototype._update=function(lt){this._cache.add(lt);for(var ct,ft,dt=[];ct=this._cache.get();)ft=this._mode.encrypt(this,ct),dt.push(ft);return $.concat(dt)};var ot=$.alloc(16,16);nt.prototype._final=function(){var lt=this._cache.flush();if(this._autopadding)return lt=this._mode.encrypt(this,lt),this._cipher.scrub(),lt;if(!lt.equals(ot))throw this._cipher.scrub(),new Error("data not multiple of block length")},nt.prototype.setAutoPadding=function(lt){return this._autopadding=!!lt,this};function it(){this.cache=$.allocUnsafe(0)}it.prototype.add=function(lt){this.cache=$.concat([this.cache,lt])},it.prototype.get=function(){if(this.cache.length>15){var lt=this.cache.slice(0,16);return this.cache=this.cache.slice(16),lt}return null},it.prototype.flush=function(){for(var lt=16-this.cache.length,ct=$.allocUnsafe(lt),ft=-1;++ft16)return ct=this.cache.slice(0,16),this.cache=this.cache.slice(16),ct}else if(this.cache.length>=16)return ct=this.cache.slice(0,16),this.cache=this.cache.slice(16),ct;return null},ot.prototype.flush=function(){if(this.cache.length)return this.cache};function it(lt){var ct=lt[15];if(ct<1||ct>16)throw new Error("unable to decrypt data");for(var ft=-1;++ft=0);return rt},$.prototype._randrange=function(_e,et){var tt=et.sub(_e);return _e.add(this._randbelow(tt))},$.prototype.test=function(_e,et,tt){var rt=_e.bitLength(),nt=o.mont(_e),ot=new o(1).toRed(nt);et||(et=Math.max(1,rt/48|0));for(var it=_e.subn(1),st=0;!it.testn(st);st++);for(var at=_e.shrn(st),lt=it.toRed(nt),ct=!0;et>0;et--){var ft=this._randrange(new o(2),it);tt&&tt(ft);var dt=ft.toRed(nt).redPow(at);if(!(dt.cmp(ot)===0||dt.cmp(lt)===0)){for(var pt=1;pt0;et--){var lt=this._randrange(new o(2),ot),ct=_e.gcd(lt);if(ct.cmpn(1)!==0)return ct;var ft=lt.toRed(rt).redPow(st);if(!(ft.cmp(nt)===0||ft.cmp(at)===0)){for(var dt=1;dtpt;)vt.ishrn(1);if(vt.isEven()&&vt.iadd(et),vt.testn(1)||vt.iadd(tt),yt.cmp(tt)){if(!yt.cmp(rt))for(;vt.mod(nt).cmp(ot);)vt.iadd(st)}else for(;vt.mod($).cmp(it);)vt.iadd(st);if(wt=vt.shrn(1),ct(wt)&&ct(vt)&&ft(wt)&&ft(vt)&&_e.test(wt)&&_e.test(vt))return vt}}return generatePrime}const modp1={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},modp2={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},modp5={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},modp14={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},modp15={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},modp16={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},modp17={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},modp18={gen:"02",prime:"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"},require$$1$1={modp1,modp2,modp5,modp14,modp15,modp16,modp17,modp18};var dh,hasRequiredDh;function requireDh(){if(hasRequiredDh)return dh;hasRequiredDh=1;var o=bnExports,_=requireMr(),$=new _,j=new o(24),_e=new o(11),et=new o(10),tt=new o(3),rt=new o(7),nt=requireGeneratePrime(),ot=requireBrowser$c();dh=ct;function it(dt,pt){return pt=pt||"utf8",Buffer$3.isBuffer(dt)||(dt=new Buffer$3(dt,pt)),this._pub=new o(dt),this}function st(dt,pt){return pt=pt||"utf8",Buffer$3.isBuffer(dt)||(dt=new Buffer$3(dt,pt)),this._priv=new o(dt),this}var at={};function lt(dt,pt){var yt=pt.toString("hex"),vt=[yt,dt.toString(16)].join("_");if(vt in at)return at[vt];var wt=0;if(dt.isEven()||!nt.simpleSieve||!nt.fermatTest(dt)||!$.test(dt))return wt+=1,yt==="02"||yt==="05"?wt+=8:wt+=4,at[vt]=wt,wt;$.test(dt.shrn(1))||(wt+=2);var Ct;switch(yt){case"02":dt.mod(j).cmp(_e)&&(wt+=8);break;case"05":Ct=dt.mod(et),Ct.cmp(tt)&&Ct.cmp(rt)&&(wt+=8);break;default:wt+=4}return at[vt]=wt,wt}function ct(dt,pt,yt){this.setGenerator(pt),this.__prime=new o(dt),this._prime=o.mont(this.__prime),this._primeLen=dt.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,yt?(this.setPublicKey=it,this.setPrivateKey=st):this._primeCode=8}Object.defineProperty(ct.prototype,"verifyError",{enumerable:!0,get:function(){return typeof this._primeCode!="number"&&(this._primeCode=lt(this.__prime,this.__gen)),this._primeCode}}),ct.prototype.generateKeys=function(){return this._priv||(this._priv=new o(ot(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},ct.prototype.computeSecret=function(dt){dt=new o(dt),dt=dt.toRed(this._prime);var pt=dt.redPow(this._priv).fromRed(),yt=new Buffer$3(pt.toArray()),vt=this.getPrime();if(yt.length=0||!nt.umod(tt.prime1)||!nt.umod(tt.prime2));return nt}function _e(tt){var rt=j(tt),nt=rt.toRed(o.mont(tt.modulus)).redPow(new o(tt.publicExponent)).fromRed();return{blinder:nt,unblinder:rt.invm(tt.modulus)}}function et(tt,rt){var nt=_e(rt),ot=rt.modulus.byteLength(),it=new o(tt).mul(nt.blinder).umod(rt.modulus),st=it.toRed(o.mont(rt.prime1)),at=it.toRed(o.mont(rt.prime2)),lt=rt.coefficient,ct=rt.prime1,ft=rt.prime2,dt=st.redPow(rt.exponent1).fromRed(),pt=at.redPow(rt.exponent2).fromRed(),yt=dt.isub(pt).imul(lt).umod(ct).imul(ft);return pt.iadd(yt).imul(nt.unblinder).umod(rt.modulus).toArrayLike($,"be",ot)}return et.getr=j,browserifyRsa=et,browserifyRsa}var asn1$1={},asn1={},api={},vmBrowserify={},hasRequiredVmBrowserify;function requireVmBrowserify(){return hasRequiredVmBrowserify||(hasRequiredVmBrowserify=1,function(exports$1){var indexOf=function(o,_){if(o.indexOf)return o.indexOf(_);for(var $=0;$>6],lt=(st&32)===0;if((st&31)===31){var ct=st;for(st=0;(ct&128)===128;){if(ct=ot.readUInt8(it),ot.isError(ct))return ct;st<<=7,st|=ct&127}}else st&=31;var ft=_e.tag[st];return{cls:at,primitive:lt,tag:st,tagStr:ft}}function nt(ot,it,st){var at=ot.readUInt8(st);if(ot.isError(at))return at;if(!it&&at===128)return null;if(!(at&128))return at;var lt=at&127;if(lt>4)return ot.error("length octect is too long");at=0;for(var ct=0;ct=256;dt>>=8)ft++;var pt=new _(2+ft);pt[0]=ct,pt[1]=128|ft;for(var dt=1+ft,yt=lt.length;yt>0;dt--,yt>>=8)pt[dt]=yt&255;return this._createEncoderBuffer([pt,lt])},tt.prototype._encodeStr=function(it,st){if(st==="bitstr")return this._createEncoderBuffer([it.unused|0,it.data]);if(st==="bmpstr"){for(var at=new _(it.length*2),lt=0;lt=40)return this.reporter.error("Second objid identifier OOB");it.splice(0,2,it[0]*40+it[1])}for(var ct=0,lt=0;lt=128;ft>>=7)ct++}for(var dt=new _(ct),pt=dt.length-1,lt=it.length-1;lt>=0;lt--){var ft=it[lt];for(dt[pt--]=ft&127;(ft>>=7)>0;)dt[pt--]=128|ft&127}return this._createEncoderBuffer(dt)};function rt(ot){return ot<10?"0"+ot:ot}tt.prototype._encodeTime=function(it,st){var at,lt=new Date(it);return st==="gentime"?at=[rt(lt.getFullYear()),rt(lt.getUTCMonth()+1),rt(lt.getUTCDate()),rt(lt.getUTCHours()),rt(lt.getUTCMinutes()),rt(lt.getUTCSeconds()),"Z"].join(""):st==="utctime"?at=[rt(lt.getFullYear()%100),rt(lt.getUTCMonth()+1),rt(lt.getUTCDate()),rt(lt.getUTCHours()),rt(lt.getUTCMinutes()),rt(lt.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+st+" time is not supported yet"),this._encodeStr(at,"octstr")},tt.prototype._encodeNull=function(){return this._createEncoderBuffer("")},tt.prototype._encodeInt=function(it,st){if(typeof it=="string"){if(!st)return this.reporter.error("String int or enum given, but no values map");if(!st.hasOwnProperty(it))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(it));it=st[it]}if(typeof it!="number"&&!_.isBuffer(it)){var at=it.toArray();!it.sign&&at[0]&128&&at.unshift(0),it=new _(at)}if(_.isBuffer(it)){var lt=it.length;it.length===0&<++;var ft=new _(lt);return it.copy(ft),it.length===0&&(ft[0]=0),this._createEncoderBuffer(ft)}if(it<128)return this._createEncoderBuffer(it);if(it<256)return this._createEncoderBuffer([0,it]);for(var lt=1,ct=it;ct>=256;ct>>=8)lt++;for(var ft=new Array(lt),ct=ft.length-1;ct>=0;ct--)ft[ct]=it&255,it>>=8;return ft[0]&128&&ft.unshift(0),this._createEncoderBuffer(new _(ft))},tt.prototype._encodeBool=function(it){return this._createEncoderBuffer(it?255:0)},tt.prototype._use=function(it,st){return typeof it=="function"&&(it=it(st)),it._getEncoder("der").tree},tt.prototype._skipDefault=function(it,st,at){var lt=this._baseState,ct;if(lt.default===null)return!1;var ft=it.join();if(lt.defaultBuffer===void 0&&(lt.defaultBuffer=this._encodeValue(lt.default,st,at).join()),ft.length!==lt.defaultBuffer.length)return!1;for(ct=0;ct=31?at.error("Multi-octet tag encoding unsupported"):(it||(lt|=32),lt|=_e.tagClassByName[st||"universal"]<<6,lt)}return der_1}var pem,hasRequiredPem;function requirePem(){if(hasRequiredPem)return pem;hasRequiredPem=1;var o=inherits_browserExports,_=requireDer();function $(j){_.call(this,j),this.enc="pem"}return o($,_),pem=$,$.prototype.encode=function(_e,et){for(var tt=_.prototype.encode.call(this,_e),rt=tt.toString("base64"),nt=["-----BEGIN "+et.label+"-----"],ot=0;ot0&&vt.ishrn(wt),vt}function ct(pt,yt){pt=lt(pt,yt),pt=pt.mod(yt);var vt=o.from(pt.toArray());if(vt.length=0)throw new Error("invalid sig")}return verify_1=et,verify_1}var browser$5,hasRequiredBrowser$4;function requireBrowser$4(){if(hasRequiredBrowser$4)return browser$5;hasRequiredBrowser$4=1;var o=safeBufferExports.Buffer,_=requireBrowser$a(),$=requireReadableBrowser(),j=inherits_browserExports,_e=requireSign(),et=requireVerify(),tt=require$$6;Object.keys(tt).forEach(function(st){tt[st].id=o.from(tt[st].id,"hex"),tt[st.toLowerCase()]=tt[st]});function rt(st){$.Writable.call(this);var at=tt[st];if(!at)throw new Error("Unknown message digest");this._hashType=at.hash,this._hash=_(at.hash),this._tag=at.id,this._signType=at.sign}j(rt,$.Writable),rt.prototype._write=function(at,lt,ct){this._hash.update(at),ct()},rt.prototype.update=function(at,lt){return this._hash.update(typeof at=="string"?o.from(at,lt):at),this},rt.prototype.sign=function(at,lt){this.end();var ct=this._hash.digest(),ft=_e(ct,at,this._hashType,this._signType,this._tag);return lt?ft.toString(lt):ft};function nt(st){$.Writable.call(this);var at=tt[st];if(!at)throw new Error("Unknown message digest");this._hash=_(at.hash),this._tag=at.id,this._signType=at.sign}j(nt,$.Writable),nt.prototype._write=function(at,lt,ct){this._hash.update(at),ct()},nt.prototype.update=function(at,lt){return this._hash.update(typeof at=="string"?o.from(at,lt):at),this},nt.prototype.verify=function(at,lt,ct){var ft=typeof lt=="string"?o.from(lt,ct):lt;this.end();var dt=this._hash.digest();return et(ft,dt,at,this._signType,this._tag)};function ot(st){return new rt(st)}function it(st){return new nt(st)}return browser$5={Sign:ot,Verify:it,createSign:ot,createVerify:it},browser$5}var browser$4,hasRequiredBrowser$3;function requireBrowser$3(){if(hasRequiredBrowser$3)return browser$4;hasRequiredBrowser$3=1;var o=requireElliptic(),_=bnExports;browser$4=function(tt){return new j(tt)};var $={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};$.p224=$.secp224r1,$.p256=$.secp256r1=$.prime256v1,$.p192=$.secp192r1=$.prime192v1,$.p384=$.secp384r1,$.p521=$.secp521r1;function j(et){this.curveType=$[et],this.curveType||(this.curveType={name:et}),this.curve=new o.ec(this.curveType.name),this.keys=void 0}j.prototype.generateKeys=function(et,tt){return this.keys=this.curve.genKeyPair(),this.getPublicKey(et,tt)},j.prototype.computeSecret=function(et,tt,rt){tt=tt||"utf8",Buffer$3.isBuffer(et)||(et=new Buffer$3(et,tt));var nt=this.curve.keyFromPublic(et).getPublic(),ot=nt.mul(this.keys.getPrivate()).getX();return _e(ot,rt,this.curveType.byteLength)},j.prototype.getPublicKey=function(et,tt){var rt=this.keys.getPublic(tt==="compressed",!0);return tt==="hybrid"&&(rt[rt.length-1]%2?rt[0]=7:rt[0]=6),_e(rt,et)},j.prototype.getPrivateKey=function(et){return _e(this.keys.getPrivate(),et)},j.prototype.setPublicKey=function(et,tt){return tt=tt||"utf8",Buffer$3.isBuffer(et)||(et=new Buffer$3(et,tt)),this.keys._importPublic(et),this},j.prototype.setPrivateKey=function(et,tt){tt=tt||"utf8",Buffer$3.isBuffer(et)||(et=new Buffer$3(et,tt));var rt=new _(et);return rt=rt.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(rt),this};function _e(et,tt,rt){Array.isArray(et)||(et=et.toArray());var nt=new Buffer$3(et);if(rt&&nt.length=0)throw new Error("data too long for modulus")}else throw new Error("unknown padding");return ft?rt(yt,pt):tt(yt,pt)};function ot(at,lt){var ct=at.modulus.byteLength(),ft=lt.length,dt=$("sha1").update(nt.alloc(0)).digest(),pt=dt.length,yt=2*pt;if(ft>ct-yt-2)throw new Error("message too long");var vt=nt.alloc(ct-ft-yt-2),wt=ct-pt-1,Ct=_(pt),Pt=_e(nt.concat([dt,vt,nt.alloc(1,1),lt],wt),j(Ct,wt)),Bt=_e(Ct,j(Pt,pt));return new et(nt.concat([nt.alloc(1),Bt,Pt],ct))}function it(at,lt,ct){var ft=lt.length,dt=at.modulus.byteLength();if(ft>dt-11)throw new Error("message too long");var pt;return ct?pt=nt.alloc(dt-ft-3,255):pt=st(dt-ft-3),new et(nt.concat([nt.from([0,ct?1:2]),pt,nt.alloc(1),lt],dt))}function st(at){for(var lt=nt.allocUnsafe(at),ct=0,ft=_(at*2),dt=0,pt;ctpt||new j(lt).cmp(dt.modulus)>=0)throw new Error("decryption error");var yt;ct?yt=tt(new j(lt),dt):yt=_e(lt,dt);var vt=rt.alloc(pt-yt.length);if(yt=rt.concat([vt,yt],pt),ft===4)return nt(dt,yt);if(ft===1)return ot(dt,yt,ct);if(ft===3)return yt;throw new Error("unknown padding")};function nt(st,at){var lt=st.modulus.byteLength(),ct=et("sha1").update(rt.alloc(0)).digest(),ft=ct.length;if(at[0]!==0)throw new Error("decryption error");var dt=at.slice(1,ft+1),pt=at.slice(ft+1),yt=$(dt,_(pt,ft)),vt=$(pt,_(yt,lt-ft-1));if(it(ct,vt.slice(0,ft)))throw new Error("decryption error");for(var wt=ft;vt[wt]===0;)wt++;if(vt[wt++]!==1)throw new Error("decryption error");return vt.slice(wt)}function ot(st,at,lt){for(var ct=at.slice(0,2),ft=2,dt=0;at[ft++]!==0;)if(ft>=at.length){dt++;break}var pt=at.slice(2,ft-1);if((ct.toString("hex")!=="0002"&&!lt||ct.toString("hex")!=="0001"&<)&&dt++,pt.length<8&&dt++,dt)throw new Error("decryption error");return at.slice(ft)}function it(st,at){st=rt.from(st),at=rt.from(at);var lt=0,ct=st.length;st.length!==at.length&&(lt++,ct=Math.min(st.length,at.length));for(var ft=-1;++fttt||at<0)throw new TypeError("offset must be a uint32");if(at>_e||at>lt)throw new RangeError("offset out of range")}function nt(at,lt,ct){if(typeof at!="number"||at!==at)throw new TypeError("size must be a number");if(at>tt||at<0)throw new TypeError("size must be a uint32");if(at+lt>ct||at>_e)throw new RangeError("buffer too small")}et&&et.getRandomValues||!process$1$1.browser?(browser$2.randomFill=ot,browser$2.randomFillSync=st):(browser$2.randomFill=o,browser$2.randomFillSync=o);function ot(at,lt,ct,ft){if(!j.isBuffer(at)&&!(at instanceof globalThis.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof lt=="function")ft=lt,lt=0,ct=at.length;else if(typeof ct=="function")ft=ct,ct=at.length-lt;else if(typeof ft!="function")throw new TypeError('"cb" argument must be a function');return rt(lt,at.length),nt(ct,lt,at.length),it(at,lt,ct,ft)}function it(at,lt,ct,ft){if(process$1$1.browser){var dt=at.buffer,pt=new Uint8Array(dt,lt,ct);if(et.getRandomValues(pt),ft){process$1$1.nextTick(function(){ft(null,at)});return}return at}if(ft){$(ct,function(vt,wt){if(vt)return ft(vt);wt.copy(at,lt),ft(null,at)});return}var yt=$(ct);return yt.copy(at,lt),at}function st(at,lt,ct){if(typeof lt>"u"&&(lt=0),!j.isBuffer(at)&&!(at instanceof globalThis.Uint8Array))throw new TypeError('"buf" argument must be a Buffer or Uint8Array');return rt(lt,at.length),ct===void 0&&(ct=at.length-lt),nt(ct,lt,at.length),it(at,lt,ct)}return browser$2}var hasRequiredCryptoBrowserify;function requireCryptoBrowserify(){if(hasRequiredCryptoBrowserify)return cryptoBrowserify;hasRequiredCryptoBrowserify=1,cryptoBrowserify.randomBytes=cryptoBrowserify.rng=cryptoBrowserify.pseudoRandomBytes=cryptoBrowserify.prng=requireBrowser$c(),cryptoBrowserify.createHash=cryptoBrowserify.Hash=requireBrowser$a(),cryptoBrowserify.createHmac=cryptoBrowserify.Hmac=requireBrowser$9();var o=requireAlgos(),_=Object.keys(o),$=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(_);cryptoBrowserify.getHashes=function(){return $};var j=requireBrowser$8();cryptoBrowserify.pbkdf2=j.pbkdf2,cryptoBrowserify.pbkdf2Sync=j.pbkdf2Sync;var _e=requireBrowser$6();cryptoBrowserify.Cipher=_e.Cipher,cryptoBrowserify.createCipher=_e.createCipher,cryptoBrowserify.Cipheriv=_e.Cipheriv,cryptoBrowserify.createCipheriv=_e.createCipheriv,cryptoBrowserify.Decipher=_e.Decipher,cryptoBrowserify.createDecipher=_e.createDecipher,cryptoBrowserify.Decipheriv=_e.Decipheriv,cryptoBrowserify.createDecipheriv=_e.createDecipheriv,cryptoBrowserify.getCiphers=_e.getCiphers,cryptoBrowserify.listCiphers=_e.listCiphers;var et=requireBrowser$5();cryptoBrowserify.DiffieHellmanGroup=et.DiffieHellmanGroup,cryptoBrowserify.createDiffieHellmanGroup=et.createDiffieHellmanGroup,cryptoBrowserify.getDiffieHellman=et.getDiffieHellman,cryptoBrowserify.createDiffieHellman=et.createDiffieHellman,cryptoBrowserify.DiffieHellman=et.DiffieHellman;var tt=requireBrowser$4();cryptoBrowserify.createSign=tt.createSign,cryptoBrowserify.Sign=tt.Sign,cryptoBrowserify.createVerify=tt.createVerify,cryptoBrowserify.Verify=tt.Verify,cryptoBrowserify.createECDH=requireBrowser$3();var rt=requireBrowser$2();cryptoBrowserify.publicEncrypt=rt.publicEncrypt,cryptoBrowserify.privateEncrypt=rt.privateEncrypt,cryptoBrowserify.publicDecrypt=rt.publicDecrypt,cryptoBrowserify.privateDecrypt=rt.privateDecrypt;var nt=requireBrowser$1();return cryptoBrowserify.randomFill=nt.randomFill,cryptoBrowserify.randomFillSync=nt.randomFillSync,cryptoBrowserify.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet -we accept pull requests -https://github.com/browserify/crypto-browserify`)},cryptoBrowserify.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6},cryptoBrowserify}var hasRequiredBrorand;function requireBrorand(){if(hasRequiredBrorand)return brorand.exports;hasRequiredBrorand=1;var o;brorand.exports=function(_e){return o||(o=new _(null)),o.generate(_e)};function _(j){this.rand=j}if(brorand.exports.Rand=_,_.prototype.generate=function(_e){return this._rand(_e)},_.prototype._rand=function(_e){if(this.rand.getBytes)return this.rand.getBytes(_e);for(var et=new Uint8Array(_e),tt=0;tt0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var base=BaseCurve;BaseCurve.prototype.point=function o(){throw new Error("Not implemented")};BaseCurve.prototype.validate=function o(){throw new Error("Not implemented")};BaseCurve.prototype._fixedNafMul=function o(_,$){assert$b(_.precomputed);var j=_._getDoubles(),_e=getNAF($,1,this._bitLength),et=(1<=rt;ot--)nt=(nt<<1)+_e[ot];tt.push(nt)}for(var it=this.jpoint(null,null,null),st=this.jpoint(null,null,null),at=et;at>0;at--){for(rt=0;rt=0;nt--){for(var ot=0;nt>=0&&tt[nt]===0;nt--)ot++;if(nt>=0&&ot++,rt=rt.dblp(ot),nt<0)break;var it=tt[nt];assert$b(it!==0),_.type==="affine"?it>0?rt=rt.mixedAdd(et[it-1>>1]):rt=rt.mixedAdd(et[-it-1>>1].neg()):it>0?rt=rt.add(et[it-1>>1]):rt=rt.add(et[-it-1>>1].neg())}return _.type==="affine"?rt.toP():rt};BaseCurve.prototype._wnafMulAdd=function o(_,$,j,_e,et){var tt=this._wnafT1,rt=this._wnafT2,nt=this._wnafT3,ot=0,it,st,at;for(it=0;it<_e;it++){at=$[it];var lt=at._getNAFPoints(_);tt[it]=lt.wnd,rt[it]=lt.points}for(it=_e-1;it>=1;it-=2){var ct=it-1,ft=it;if(tt[ct]!==1||tt[ft]!==1){nt[ct]=getNAF(j[ct],tt[ct],this._bitLength),nt[ft]=getNAF(j[ft],tt[ft],this._bitLength),ot=Math.max(nt[ct].length,ot),ot=Math.max(nt[ft].length,ot);continue}var dt=[$[ct],null,null,$[ft]];$[ct].y.cmp($[ft].y)===0?(dt[1]=$[ct].add($[ft]),dt[2]=$[ct].toJ().mixedAdd($[ft].neg())):$[ct].y.cmp($[ft].y.redNeg())===0?(dt[1]=$[ct].toJ().mixedAdd($[ft]),dt[2]=$[ct].add($[ft].neg())):(dt[1]=$[ct].toJ().mixedAdd($[ft]),dt[2]=$[ct].toJ().mixedAdd($[ft].neg()));var pt=[-3,-1,-5,-7,0,7,5,1,3],yt=getJSF(j[ct],j[ft]);for(ot=Math.max(yt[0].length,ot),nt[ct]=new Array(ot),nt[ft]=new Array(ot),st=0;st=0;it--){for(var Bt=0;it>=0;){var At=!0;for(st=0;st<_e;st++)Pt[st]=nt[st][it]|0,Pt[st]!==0&&(At=!1);if(!At)break;Bt++,it--}if(it>=0&&Bt++,Ct=Ct.dblp(Bt),it<0)break;for(st=0;st<_e;st++){var kt=Pt[st];kt!==0&&(kt>0?at=rt[st][kt-1>>1]:kt<0&&(at=rt[st][-kt-1>>1].neg()),at.type==="affine"?Ct=Ct.mixedAdd(at):Ct=Ct.add(at))}}for(it=0;it<_e;it++)rt[it]=null;return et?Ct:Ct.toP()};function BasePoint(o,_){this.curve=o,this.type=_,this.precomputed=null}BaseCurve.BasePoint=BasePoint;BasePoint.prototype.eq=function o(){throw new Error("Not implemented")};BasePoint.prototype.validate=function o(){return this.curve.validate(this)};BaseCurve.prototype.decodePoint=function o(_,$){_=utils$a.toArray(_,$);var j=this.p.byteLength();if((_[0]===4||_[0]===6||_[0]===7)&&_.length-1===2*j){_[0]===6?assert$b(_[_.length-1]%2===0):_[0]===7&&assert$b(_[_.length-1]%2===1);var _e=this.point(_.slice(1,1+j),_.slice(1+j,1+2*j));return _e}else if((_[0]===2||_[0]===3)&&_.length-1===j)return this.pointFromX(_.slice(1,1+j),_[0]===3);throw new Error("Unknown point format")};BasePoint.prototype.encodeCompressed=function o(_){return this.encode(_,!0)};BasePoint.prototype._encode=function o(_){var $=this.curve.p.byteLength(),j=this.getX().toArray("be",$);return _?[this.getY().isEven()?2:3].concat(j):[4].concat(j,this.getY().toArray("be",$))};BasePoint.prototype.encode=function o(_,$){return utils$a.encode(this._encode($),_)};BasePoint.prototype.precompute=function o(_){if(this.precomputed)return this;var $={doubles:null,naf:null,beta:null};return $.naf=this._getNAFPoints(8),$.doubles=this._getDoubles(4,_),$.beta=this._getBeta(),this.precomputed=$,this};BasePoint.prototype._hasDoubles=function o(_){if(!this.precomputed)return!1;var $=this.precomputed.doubles;return $?$.points.length>=Math.ceil((_.bitLength()+1)/$.step):!1};BasePoint.prototype._getDoubles=function o(_,$){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var j=[this],_e=this,et=0;et<$;et+=_){for(var tt=0;tt<_;tt++)_e=_e.dbl();j.push(_e)}return{step:_,points:j}};BasePoint.prototype._getNAFPoints=function o(_){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var $=[this],j=(1<<_)-1,_e=j===1?null:this.dbl(),et=1;et=0&&(lt=ot,ct=it),st.negative&&(st=st.neg(),at=at.neg()),lt.negative&&(lt=lt.neg(),ct=ct.neg()),[{a:st,b:at},{a:lt,b:ct}]};ShortCurve.prototype._endoSplit=function o(_){var $=this.endo.basis,j=$[0],_e=$[1],et=_e.b.mul(_).divRound(this.n),tt=j.b.neg().mul(_).divRound(this.n),rt=et.mul(j.a),nt=tt.mul(_e.a),ot=et.mul(j.b),it=tt.mul(_e.b),st=_.sub(rt).sub(nt),at=ot.add(it).neg();return{k1:st,k2:at}};ShortCurve.prototype.pointFromX=function o(_,$){_=new BN$5(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr().redMul(_).redIAdd(_.redMul(this.a)).redIAdd(this.b),_e=j.redSqrt();if(_e.redSqr().redSub(j).cmp(this.zero)!==0)throw new Error("invalid point");var et=_e.fromRed().isOdd();return($&&!et||!$&&et)&&(_e=_e.redNeg()),this.point(_,_e)};ShortCurve.prototype.validate=function o(_){if(_.inf)return!0;var $=_.x,j=_.y,_e=this.a.redMul($),et=$.redSqr().redMul($).redIAdd(_e).redIAdd(this.b);return j.redSqr().redISub(et).cmpn(0)===0};ShortCurve.prototype._endoWnafMulAdd=function o(_,$,j){for(var _e=this._endoWnafT1,et=this._endoWnafT2,tt=0;tt<_.length;tt++){var rt=this._endoSplit($[tt]),nt=_[tt],ot=nt._getBeta();rt.k1.negative&&(rt.k1.ineg(),nt=nt.neg(!0)),rt.k2.negative&&(rt.k2.ineg(),ot=ot.neg(!0)),_e[tt*2]=nt,_e[tt*2+1]=ot,et[tt*2]=rt.k1,et[tt*2+1]=rt.k2}for(var it=this._wnafMulAdd(1,_e,et,tt*2,j),st=0;st":""};Point$2.prototype.isInfinity=function o(){return this.inf};Point$2.prototype.add=function o(_){if(this.inf)return _;if(_.inf)return this;if(this.eq(_))return this.dbl();if(this.neg().eq(_))return this.curve.point(null,null);if(this.x.cmp(_.x)===0)return this.curve.point(null,null);var $=this.y.redSub(_.y);$.cmpn(0)!==0&&($=$.redMul(this.x.redSub(_.x).redInvm()));var j=$.redSqr().redISub(this.x).redISub(_.x),_e=$.redMul(this.x.redSub(j)).redISub(this.y);return this.curve.point(j,_e)};Point$2.prototype.dbl=function o(){if(this.inf)return this;var _=this.y.redAdd(this.y);if(_.cmpn(0)===0)return this.curve.point(null,null);var $=this.curve.a,j=this.x.redSqr(),_e=_.redInvm(),et=j.redAdd(j).redIAdd(j).redIAdd($).redMul(_e),tt=et.redSqr().redISub(this.x.redAdd(this.x)),rt=et.redMul(this.x.redSub(tt)).redISub(this.y);return this.curve.point(tt,rt)};Point$2.prototype.getX=function o(){return this.x.fromRed()};Point$2.prototype.getY=function o(){return this.y.fromRed()};Point$2.prototype.mul=function o(_){return _=new BN$5(_,16),this.isInfinity()?this:this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve.endo?this.curve._endoWnafMulAdd([this],[_]):this.curve._wnafMul(this,_)};Point$2.prototype.mulAdd=function o(_,$,j){var _e=[this,$],et=[_,j];return this.curve.endo?this.curve._endoWnafMulAdd(_e,et):this.curve._wnafMulAdd(1,_e,et,2)};Point$2.prototype.jmulAdd=function o(_,$,j){var _e=[this,$],et=[_,j];return this.curve.endo?this.curve._endoWnafMulAdd(_e,et,!0):this.curve._wnafMulAdd(1,_e,et,2,!0)};Point$2.prototype.eq=function o(_){return this===_||this.inf===_.inf&&(this.inf||this.x.cmp(_.x)===0&&this.y.cmp(_.y)===0)};Point$2.prototype.neg=function o(_){if(this.inf)return this;var $=this.curve.point(this.x,this.y.redNeg());if(_&&this.precomputed){var j=this.precomputed,_e=function(et){return et.neg()};$.precomputed={naf:j.naf&&{wnd:j.naf.wnd,points:j.naf.points.map(_e)},doubles:j.doubles&&{step:j.doubles.step,points:j.doubles.points.map(_e)}}}return $};Point$2.prototype.toJ=function o(){if(this.inf)return this.curve.jpoint(null,null,null);var _=this.curve.jpoint(this.x,this.y,this.curve.one);return _};function JPoint(o,_,$,j){Base$2.BasePoint.call(this,o,"jacobian"),_===null&&$===null&&j===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new BN$5(0)):(this.x=new BN$5(_,16),this.y=new BN$5($,16),this.z=new BN$5(j,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}inherits$2(JPoint,Base$2.BasePoint);ShortCurve.prototype.jpoint=function o(_,$,j){return new JPoint(this,_,$,j)};JPoint.prototype.toP=function o(){if(this.isInfinity())return this.curve.point(null,null);var _=this.z.redInvm(),$=_.redSqr(),j=this.x.redMul($),_e=this.y.redMul($).redMul(_);return this.curve.point(j,_e)};JPoint.prototype.neg=function o(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};JPoint.prototype.add=function o(_){if(this.isInfinity())return _;if(_.isInfinity())return this;var $=_.z.redSqr(),j=this.z.redSqr(),_e=this.x.redMul($),et=_.x.redMul(j),tt=this.y.redMul($.redMul(_.z)),rt=_.y.redMul(j.redMul(this.z)),nt=_e.redSub(et),ot=tt.redSub(rt);if(nt.cmpn(0)===0)return ot.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var it=nt.redSqr(),st=it.redMul(nt),at=_e.redMul(it),lt=ot.redSqr().redIAdd(st).redISub(at).redISub(at),ct=ot.redMul(at.redISub(lt)).redISub(tt.redMul(st)),ft=this.z.redMul(_.z).redMul(nt);return this.curve.jpoint(lt,ct,ft)};JPoint.prototype.mixedAdd=function o(_){if(this.isInfinity())return _.toJ();if(_.isInfinity())return this;var $=this.z.redSqr(),j=this.x,_e=_.x.redMul($),et=this.y,tt=_.y.redMul($).redMul(this.z),rt=j.redSub(_e),nt=et.redSub(tt);if(rt.cmpn(0)===0)return nt.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var ot=rt.redSqr(),it=ot.redMul(rt),st=j.redMul(ot),at=nt.redSqr().redIAdd(it).redISub(st).redISub(st),lt=nt.redMul(st.redISub(at)).redISub(et.redMul(it)),ct=this.z.redMul(rt);return this.curve.jpoint(at,lt,ct)};JPoint.prototype.dblp=function o(_){if(_===0)return this;if(this.isInfinity())return this;if(!_)return this.dbl();var $;if(this.curve.zeroA||this.curve.threeA){var j=this;for($=0;$<_;$++)j=j.dbl();return j}var _e=this.curve.a,et=this.curve.tinv,tt=this.x,rt=this.y,nt=this.z,ot=nt.redSqr().redSqr(),it=rt.redAdd(rt);for($=0;$<_;$++){var st=tt.redSqr(),at=it.redSqr(),lt=at.redSqr(),ct=st.redAdd(st).redIAdd(st).redIAdd(_e.redMul(ot)),ft=tt.redMul(at),dt=ct.redSqr().redISub(ft.redAdd(ft)),pt=ft.redISub(dt),yt=ct.redMul(pt);yt=yt.redIAdd(yt).redISub(lt);var vt=it.redMul(nt);$+1<_&&(ot=ot.redMul(lt)),tt=dt,nt=vt,it=yt}return this.curve.jpoint(tt,it.redMul(et),nt)};JPoint.prototype.dbl=function o(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};JPoint.prototype._zeroDbl=function o(){var _,$,j;if(this.zOne){var _e=this.x.redSqr(),et=this.y.redSqr(),tt=et.redSqr(),rt=this.x.redAdd(et).redSqr().redISub(_e).redISub(tt);rt=rt.redIAdd(rt);var nt=_e.redAdd(_e).redIAdd(_e),ot=nt.redSqr().redISub(rt).redISub(rt),it=tt.redIAdd(tt);it=it.redIAdd(it),it=it.redIAdd(it),_=ot,$=nt.redMul(rt.redISub(ot)).redISub(it),j=this.y.redAdd(this.y)}else{var st=this.x.redSqr(),at=this.y.redSqr(),lt=at.redSqr(),ct=this.x.redAdd(at).redSqr().redISub(st).redISub(lt);ct=ct.redIAdd(ct);var ft=st.redAdd(st).redIAdd(st),dt=ft.redSqr(),pt=lt.redIAdd(lt);pt=pt.redIAdd(pt),pt=pt.redIAdd(pt),_=dt.redISub(ct).redISub(ct),$=ft.redMul(ct.redISub(_)).redISub(pt),j=this.y.redMul(this.z),j=j.redIAdd(j)}return this.curve.jpoint(_,$,j)};JPoint.prototype._threeDbl=function o(){var _,$,j;if(this.zOne){var _e=this.x.redSqr(),et=this.y.redSqr(),tt=et.redSqr(),rt=this.x.redAdd(et).redSqr().redISub(_e).redISub(tt);rt=rt.redIAdd(rt);var nt=_e.redAdd(_e).redIAdd(_e).redIAdd(this.curve.a),ot=nt.redSqr().redISub(rt).redISub(rt);_=ot;var it=tt.redIAdd(tt);it=it.redIAdd(it),it=it.redIAdd(it),$=nt.redMul(rt.redISub(ot)).redISub(it),j=this.y.redAdd(this.y)}else{var st=this.z.redSqr(),at=this.y.redSqr(),lt=this.x.redMul(at),ct=this.x.redSub(st).redMul(this.x.redAdd(st));ct=ct.redAdd(ct).redIAdd(ct);var ft=lt.redIAdd(lt);ft=ft.redIAdd(ft);var dt=ft.redAdd(ft);_=ct.redSqr().redISub(dt),j=this.y.redAdd(this.z).redSqr().redISub(at).redISub(st);var pt=at.redSqr();pt=pt.redIAdd(pt),pt=pt.redIAdd(pt),pt=pt.redIAdd(pt),$=ct.redMul(ft.redISub(_)).redISub(pt)}return this.curve.jpoint(_,$,j)};JPoint.prototype._dbl=function o(){var _=this.curve.a,$=this.x,j=this.y,_e=this.z,et=_e.redSqr().redSqr(),tt=$.redSqr(),rt=j.redSqr(),nt=tt.redAdd(tt).redIAdd(tt).redIAdd(_.redMul(et)),ot=$.redAdd($);ot=ot.redIAdd(ot);var it=ot.redMul(rt),st=nt.redSqr().redISub(it.redAdd(it)),at=it.redISub(st),lt=rt.redSqr();lt=lt.redIAdd(lt),lt=lt.redIAdd(lt),lt=lt.redIAdd(lt);var ct=nt.redMul(at).redISub(lt),ft=j.redAdd(j).redMul(_e);return this.curve.jpoint(st,ct,ft)};JPoint.prototype.trpl=function o(){if(!this.curve.zeroA)return this.dbl().add(this);var _=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr(),_e=$.redSqr(),et=_.redAdd(_).redIAdd(_),tt=et.redSqr(),rt=this.x.redAdd($).redSqr().redISub(_).redISub(_e);rt=rt.redIAdd(rt),rt=rt.redAdd(rt).redIAdd(rt),rt=rt.redISub(tt);var nt=rt.redSqr(),ot=_e.redIAdd(_e);ot=ot.redIAdd(ot),ot=ot.redIAdd(ot),ot=ot.redIAdd(ot);var it=et.redIAdd(rt).redSqr().redISub(tt).redISub(nt).redISub(ot),st=$.redMul(it);st=st.redIAdd(st),st=st.redIAdd(st);var at=this.x.redMul(nt).redISub(st);at=at.redIAdd(at),at=at.redIAdd(at);var lt=this.y.redMul(it.redMul(ot.redISub(it)).redISub(rt.redMul(nt)));lt=lt.redIAdd(lt),lt=lt.redIAdd(lt),lt=lt.redIAdd(lt);var ct=this.z.redAdd(rt).redSqr().redISub(j).redISub(nt);return this.curve.jpoint(at,lt,ct)};JPoint.prototype.mul=function o(_,$){return _=new BN$5(_,$),this.curve._wnafMul(this,_)};JPoint.prototype.eq=function o(_){if(_.type==="affine")return this.eq(_.toJ());if(this===_)return!0;var $=this.z.redSqr(),j=_.z.redSqr();if(this.x.redMul(j).redISub(_.x.redMul($)).cmpn(0)!==0)return!1;var _e=$.redMul(this.z),et=j.redMul(_.z);return this.y.redMul(et).redISub(_.y.redMul(_e)).cmpn(0)===0};JPoint.prototype.eqXToP=function o(_){var $=this.z.redSqr(),j=_.toRed(this.curve.red).redMul($);if(this.x.cmp(j)===0)return!0;for(var _e=_.clone(),et=this.curve.redN.redMul($);;){if(_e.iadd(this.curve.n),_e.cmp(this.curve.p)>=0)return!1;if(j.redIAdd(et),this.x.cmp(j)===0)return!0}};JPoint.prototype.inspect=function o(){return this.isInfinity()?"":""};JPoint.prototype.isInfinity=function o(){return this.z.cmpn(0)===0};var BN$4=bnExports,inherits$1=inherits_browserExports,Base$1=base,utils$8=utils$d;function MontCurve(o){Base$1.call(this,"mont",o),this.a=new BN$4(o.a,16).toRed(this.red),this.b=new BN$4(o.b,16).toRed(this.red),this.i4=new BN$4(4).toRed(this.red).redInvm(),this.two=new BN$4(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}inherits$1(MontCurve,Base$1);var mont=MontCurve;MontCurve.prototype.validate=function o(_){var $=_.normalize().x,j=$.redSqr(),_e=j.redMul($).redAdd(j.redMul(this.a)).redAdd($),et=_e.redSqrt();return et.redSqr().cmp(_e)===0};function Point$1(o,_,$){Base$1.BasePoint.call(this,o,"projective"),_===null&&$===null?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new BN$4(_,16),this.z=new BN$4($,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}inherits$1(Point$1,Base$1.BasePoint);MontCurve.prototype.decodePoint=function o(_,$){return this.point(utils$8.toArray(_,$),1)};MontCurve.prototype.point=function o(_,$){return new Point$1(this,_,$)};MontCurve.prototype.pointFromJSON=function o(_){return Point$1.fromJSON(this,_)};Point$1.prototype.precompute=function o(){};Point$1.prototype._encode=function o(){return this.getX().toArray("be",this.curve.p.byteLength())};Point$1.fromJSON=function o(_,$){return new Point$1(_,$[0],$[1]||_.one)};Point$1.prototype.inspect=function o(){return this.isInfinity()?"":""};Point$1.prototype.isInfinity=function o(){return this.z.cmpn(0)===0};Point$1.prototype.dbl=function o(){var _=this.x.redAdd(this.z),$=_.redSqr(),j=this.x.redSub(this.z),_e=j.redSqr(),et=$.redSub(_e),tt=$.redMul(_e),rt=et.redMul(_e.redAdd(this.curve.a24.redMul(et)));return this.curve.point(tt,rt)};Point$1.prototype.add=function o(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.diffAdd=function o(_,$){var j=this.x.redAdd(this.z),_e=this.x.redSub(this.z),et=_.x.redAdd(_.z),tt=_.x.redSub(_.z),rt=tt.redMul(j),nt=et.redMul(_e),ot=$.z.redMul(rt.redAdd(nt).redSqr()),it=$.x.redMul(rt.redISub(nt).redSqr());return this.curve.point(ot,it)};Point$1.prototype.mul=function o(_){for(var $=_.clone(),j=this,_e=this.curve.point(null,null),et=this,tt=[];$.cmpn(0)!==0;$.iushrn(1))tt.push($.andln(1));for(var rt=tt.length-1;rt>=0;rt--)tt[rt]===0?(j=j.diffAdd(_e,et),_e=_e.dbl()):(_e=j.diffAdd(_e,et),j=j.dbl());return _e};Point$1.prototype.mulAdd=function o(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.jumlAdd=function o(){throw new Error("Not supported on Montgomery curve")};Point$1.prototype.eq=function o(_){return this.getX().cmp(_.getX())===0};Point$1.prototype.normalize=function o(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this};Point$1.prototype.getX=function o(){return this.normalize(),this.x.fromRed()};var utils$7=utils$d,BN$3=bnExports,inherits=inherits_browserExports,Base=base,assert$9=utils$7.assert;function EdwardsCurve(o){this.twisted=(o.a|0)!==1,this.mOneA=this.twisted&&(o.a|0)===-1,this.extended=this.mOneA,Base.call(this,"edwards",o),this.a=new BN$3(o.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new BN$3(o.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new BN$3(o.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),assert$9(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(o.c|0)===1}inherits(EdwardsCurve,Base);var edwards=EdwardsCurve;EdwardsCurve.prototype._mulA=function o(_){return this.mOneA?_.redNeg():this.a.redMul(_)};EdwardsCurve.prototype._mulC=function o(_){return this.oneC?_:this.c.redMul(_)};EdwardsCurve.prototype.jpoint=function o(_,$,j,_e){return this.point(_,$,j,_e)};EdwardsCurve.prototype.pointFromX=function o(_,$){_=new BN$3(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr(),_e=this.c2.redSub(this.a.redMul(j)),et=this.one.redSub(this.c2.redMul(this.d).redMul(j)),tt=_e.redMul(et.redInvm()),rt=tt.redSqrt();if(rt.redSqr().redSub(tt).cmp(this.zero)!==0)throw new Error("invalid point");var nt=rt.fromRed().isOdd();return($&&!nt||!$&&nt)&&(rt=rt.redNeg()),this.point(_,rt)};EdwardsCurve.prototype.pointFromY=function o(_,$){_=new BN$3(_,16),_.red||(_=_.toRed(this.red));var j=_.redSqr(),_e=j.redSub(this.c2),et=j.redMul(this.d).redMul(this.c2).redSub(this.a),tt=_e.redMul(et.redInvm());if(tt.cmp(this.zero)===0){if($)throw new Error("invalid point");return this.point(this.zero,_)}var rt=tt.redSqrt();if(rt.redSqr().redSub(tt).cmp(this.zero)!==0)throw new Error("invalid point");return rt.fromRed().isOdd()!==$&&(rt=rt.redNeg()),this.point(rt,_)};EdwardsCurve.prototype.validate=function o(_){if(_.isInfinity())return!0;_.normalize();var $=_.x.redSqr(),j=_.y.redSqr(),_e=$.redMul(this.a).redAdd(j),et=this.c2.redMul(this.one.redAdd(this.d.redMul($).redMul(j)));return _e.cmp(et)===0};function Point(o,_,$,j,_e){Base.BasePoint.call(this,o,"projective"),_===null&&$===null&&j===null?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new BN$3(_,16),this.y=new BN$3($,16),this.z=j?new BN$3(j,16):this.curve.one,this.t=_e&&new BN$3(_e,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}inherits(Point,Base.BasePoint);EdwardsCurve.prototype.pointFromJSON=function o(_){return Point.fromJSON(this,_)};EdwardsCurve.prototype.point=function o(_,$,j,_e){return new Point(this,_,$,j,_e)};Point.fromJSON=function o(_,$){return new Point(_,$[0],$[1],$[2])};Point.prototype.inspect=function o(){return this.isInfinity()?"":""};Point.prototype.isInfinity=function o(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)};Point.prototype._extDbl=function o(){var _=this.x.redSqr(),$=this.y.redSqr(),j=this.z.redSqr();j=j.redIAdd(j);var _e=this.curve._mulA(_),et=this.x.redAdd(this.y).redSqr().redISub(_).redISub($),tt=_e.redAdd($),rt=tt.redSub(j),nt=_e.redSub($),ot=et.redMul(rt),it=tt.redMul(nt),st=et.redMul(nt),at=rt.redMul(tt);return this.curve.point(ot,it,at,st)};Point.prototype._projDbl=function o(){var _=this.x.redAdd(this.y).redSqr(),$=this.x.redSqr(),j=this.y.redSqr(),_e,et,tt,rt,nt,ot;if(this.curve.twisted){rt=this.curve._mulA($);var it=rt.redAdd(j);this.zOne?(_e=_.redSub($).redSub(j).redMul(it.redSub(this.curve.two)),et=it.redMul(rt.redSub(j)),tt=it.redSqr().redSub(it).redSub(it)):(nt=this.z.redSqr(),ot=it.redSub(nt).redISub(nt),_e=_.redSub($).redISub(j).redMul(ot),et=it.redMul(rt.redSub(j)),tt=it.redMul(ot))}else rt=$.redAdd(j),nt=this.curve._mulC(this.z).redSqr(),ot=rt.redSub(nt).redSub(nt),_e=this.curve._mulC(_.redISub(rt)).redMul(ot),et=this.curve._mulC(rt).redMul($.redISub(j)),tt=rt.redMul(ot);return this.curve.point(_e,et,tt)};Point.prototype.dbl=function o(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()};Point.prototype._extAdd=function o(_){var $=this.y.redSub(this.x).redMul(_.y.redSub(_.x)),j=this.y.redAdd(this.x).redMul(_.y.redAdd(_.x)),_e=this.t.redMul(this.curve.dd).redMul(_.t),et=this.z.redMul(_.z.redAdd(_.z)),tt=j.redSub($),rt=et.redSub(_e),nt=et.redAdd(_e),ot=j.redAdd($),it=tt.redMul(rt),st=nt.redMul(ot),at=tt.redMul(ot),lt=rt.redMul(nt);return this.curve.point(it,st,lt,at)};Point.prototype._projAdd=function o(_){var $=this.z.redMul(_.z),j=$.redSqr(),_e=this.x.redMul(_.x),et=this.y.redMul(_.y),tt=this.curve.d.redMul(_e).redMul(et),rt=j.redSub(tt),nt=j.redAdd(tt),ot=this.x.redAdd(this.y).redMul(_.x.redAdd(_.y)).redISub(_e).redISub(et),it=$.redMul(rt).redMul(ot),st,at;return this.curve.twisted?(st=$.redMul(nt).redMul(et.redSub(this.curve._mulA(_e))),at=rt.redMul(nt)):(st=$.redMul(nt).redMul(et.redSub(_e)),at=this.curve._mulC(rt).redMul(nt)),this.curve.point(it,st,at)};Point.prototype.add=function o(_){return this.isInfinity()?_:_.isInfinity()?this:this.curve.extended?this._extAdd(_):this._projAdd(_)};Point.prototype.mul=function o(_){return this._hasDoubles(_)?this.curve._fixedNafMul(this,_):this.curve._wnafMul(this,_)};Point.prototype.mulAdd=function o(_,$,j){return this.curve._wnafMulAdd(1,[this,$],[_,j],2,!1)};Point.prototype.jmulAdd=function o(_,$,j){return this.curve._wnafMulAdd(1,[this,$],[_,j],2,!0)};Point.prototype.normalize=function o(){if(this.zOne)return this;var _=this.z.redInvm();return this.x=this.x.redMul(_),this.y=this.y.redMul(_),this.t&&(this.t=this.t.redMul(_)),this.z=this.curve.one,this.zOne=!0,this};Point.prototype.neg=function o(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())};Point.prototype.getX=function o(){return this.normalize(),this.x.fromRed()};Point.prototype.getY=function o(){return this.normalize(),this.y.fromRed()};Point.prototype.eq=function o(_){return this===_||this.getX().cmp(_.getX())===0&&this.getY().cmp(_.getY())===0};Point.prototype.eqXToP=function o(_){var $=_.toRed(this.curve.red).redMul(this.z);if(this.x.cmp($)===0)return!0;for(var j=_.clone(),_e=this.curve.redN.redMul(this.z);;){if(j.iadd(this.curve.n),j.cmp(this.curve.p)>=0)return!1;if($.redIAdd(_e),this.x.cmp($)===0)return!0}};Point.prototype.toP=Point.prototype.normalize;Point.prototype.mixedAdd=Point.prototype.add;(function(o){var _=o;_.base=base,_.short=short,_.mont=mont,_.edwards=edwards})(curve);var curves$1={},secp256k1$1,hasRequiredSecp256k1;function requireSecp256k1(){return hasRequiredSecp256k1||(hasRequiredSecp256k1=1,secp256k1$1={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}),secp256k1$1}(function(o){var _=o,$=hash$4,j=curve,_e=utils$d,et=_e.assert;function tt(ot){ot.type==="short"?this.curve=new j.short(ot):ot.type==="edwards"?this.curve=new j.edwards(ot):this.curve=new j.mont(ot),this.g=this.curve.g,this.n=this.curve.n,this.hash=ot.hash,et(this.g.validate(),"Invalid curve"),et(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}_.PresetCurve=tt;function rt(ot,it){Object.defineProperty(_,ot,{configurable:!0,enumerable:!0,get:function(){var st=new tt(it);return Object.defineProperty(_,ot,{configurable:!0,enumerable:!0,value:st}),st}})}rt("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:$.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),rt("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:$.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),rt("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:$.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),rt("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:$.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"]}),rt("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:$.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"]}),rt("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:$.sha256,gRed:!1,g:["9"]}),rt("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:$.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var nt;try{nt=requireSecp256k1()}catch{nt=void 0}rt("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:$.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",nt]})})(curves$1);var hash$2=hash$4,utils$6=utils$c,assert$8=minimalisticAssert;function HmacDRBG(o){if(!(this instanceof HmacDRBG))return new HmacDRBG(o);this.hash=o.hash,this.predResist=!!o.predResist,this.outLen=this.hash.outSize,this.minEntropy=o.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var _=utils$6.toArray(o.entropy,o.entropyEnc||"hex"),$=utils$6.toArray(o.nonce,o.nonceEnc||"hex"),j=utils$6.toArray(o.pers,o.persEnc||"hex");assert$8(_.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(_,$,j)}var hmacDrbg=HmacDRBG;HmacDRBG.prototype._init=function o(_,$,j){var _e=_.concat($).concat(j);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var et=0;et=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(_.concat(j||[])),this._reseed=1};HmacDRBG.prototype.generate=function o(_,$,j,_e){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof $!="string"&&(_e=j,j=$,$=null),j&&(j=utils$6.toArray(j,_e||"hex"),this._update(j));for(var et=[];et.length<_;)this.V=this._hmac().update(this.V).digest(),et=et.concat(this.V);var tt=et.slice(0,_);return this._update(j),this._reseed++,utils$6.encode(tt,$)};var BN$2=bnExports,utils$5=utils$d,assert$7=utils$5.assert;function KeyPair$2(o,_){this.ec=o,this.priv=null,this.pub=null,_.priv&&this._importPrivate(_.priv,_.privEnc),_.pub&&this._importPublic(_.pub,_.pubEnc)}var key$1=KeyPair$2;KeyPair$2.fromPublic=function o(_,$,j){return $ instanceof KeyPair$2?$:new KeyPair$2(_,{pub:$,pubEnc:j})};KeyPair$2.fromPrivate=function o(_,$,j){return $ instanceof KeyPair$2?$:new KeyPair$2(_,{priv:$,privEnc:j})};KeyPair$2.prototype.validate=function o(){var _=this.getPublic();return _.isInfinity()?{result:!1,reason:"Invalid public key"}:_.validate()?_.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};KeyPair$2.prototype.getPublic=function o(_,$){return typeof _=="string"&&($=_,_=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),$?this.pub.encode($,_):this.pub};KeyPair$2.prototype.getPrivate=function o(_){return _==="hex"?this.priv.toString(16,2):this.priv};KeyPair$2.prototype._importPrivate=function o(_,$){this.priv=new BN$2(_,$||16),this.priv=this.priv.umod(this.ec.curve.n)};KeyPair$2.prototype._importPublic=function o(_,$){if(_.x||_.y){this.ec.curve.type==="mont"?assert$7(_.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&assert$7(_.x&&_.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(_.x,_.y);return}this.pub=this.ec.curve.decodePoint(_,$)};KeyPair$2.prototype.derive=function o(_){return _.validate()||assert$7(_.validate(),"public point not validated"),_.mul(this.priv).getX()};KeyPair$2.prototype.sign=function o(_,$,j){return this.ec.sign(_,this,$,j)};KeyPair$2.prototype.verify=function o(_,$,j){return this.ec.verify(_,$,this,void 0,j)};KeyPair$2.prototype.inspect=function o(){return""};var BN$1=bnExports,utils$4=utils$d,assert$6=utils$4.assert;function Signature$3(o,_){if(o instanceof Signature$3)return o;this._importDER(o,_)||(assert$6(o.r&&o.s,"Signature without r or s"),this.r=new BN$1(o.r,16),this.s=new BN$1(o.s,16),o.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=o.recoveryParam)}var signature$1=Signature$3;function Position(){this.place=0}function getLength(o,_){var $=o[_.place++];if(!($&128))return $;var j=$&15;if(j===0||j>4||o[_.place]===0)return!1;for(var _e=0,et=0,tt=_.place;et>>=0;return _e<=127?!1:(_.place=tt,_e)}function rmPadding(o){for(var _=0,$=o.length-1;!o[_]&&!(o[_+1]&128)&&_<$;)_++;return _===0?o:o.slice(_)}Signature$3.prototype._importDER=function o(_,$){_=utils$4.toArray(_,$);var j=new Position;if(_[j.place++]!==48)return!1;var _e=getLength(_,j);if(_e===!1||_e+j.place!==_.length||_[j.place++]!==2)return!1;var et=getLength(_,j);if(et===!1||_[j.place]&128)return!1;var tt=_.slice(j.place,et+j.place);if(j.place+=et,_[j.place++]!==2)return!1;var rt=getLength(_,j);if(rt===!1||_.length!==rt+j.place||_[j.place]&128)return!1;var nt=_.slice(j.place,rt+j.place);if(tt[0]===0)if(tt[1]&128)tt=tt.slice(1);else return!1;if(nt[0]===0)if(nt[1]&128)nt=nt.slice(1);else return!1;return this.r=new BN$1(tt),this.s=new BN$1(nt),this.recoveryParam=null,!0};function constructLength(o,_){if(_<128){o.push(_);return}var $=1+(Math.log(_)/Math.LN2>>>3);for(o.push($|128);--$;)o.push(_>>>($<<3)&255);o.push(_)}Signature$3.prototype.toDER=function o(_){var $=this.r.toArray(),j=this.s.toArray();for($[0]&128&&($=[0].concat($)),j[0]&128&&(j=[0].concat(j)),$=rmPadding($),j=rmPadding(j);!j[0]&&!(j[1]&128);)j=j.slice(1);var _e=[2];constructLength(_e,$.length),_e=_e.concat($),_e.push(2),constructLength(_e,j.length);var et=_e.concat(j),tt=[48];return constructLength(tt,et.length),tt=tt.concat(et),utils$4.encode(tt,_)};var ec$2,hasRequiredEc;function requireEc(){if(hasRequiredEc)return ec$2;hasRequiredEc=1;var o=bnExports,_=hmacDrbg,$=utils$d,j=curves$1,_e=requireBrorand(),et=$.assert,tt=key$1,rt=signature$1;function nt(ot){if(!(this instanceof nt))return new nt(ot);typeof ot=="string"&&(et(Object.prototype.hasOwnProperty.call(j,ot),"Unknown curve "+ot),ot=j[ot]),ot instanceof j.PresetCurve&&(ot={curve:ot}),this.curve=ot.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=ot.curve.g,this.g.precompute(ot.curve.n.bitLength()+1),this.hash=ot.hash||ot.curve.hash}return ec$2=nt,nt.prototype.keyPair=function(it){return new tt(this,it)},nt.prototype.keyFromPrivate=function(it,st){return tt.fromPrivate(this,it,st)},nt.prototype.keyFromPublic=function(it,st){return tt.fromPublic(this,it,st)},nt.prototype.genKeyPair=function(it){it||(it={});for(var st=new _({hash:this.hash,pers:it.pers,persEnc:it.persEnc||"utf8",entropy:it.entropy||_e(this.hash.hmacStrength),entropyEnc:it.entropy&&it.entropyEnc||"utf8",nonce:this.n.toArray()}),at=this.n.byteLength(),lt=this.n.sub(new o(2));;){var ct=new o(st.generate(at));if(!(ct.cmp(lt)>0))return ct.iaddn(1),this.keyFromPrivate(ct)}},nt.prototype._truncateToN=function(it,st,at){var lt;if(o.isBN(it)||typeof it=="number")it=new o(it,16),lt=it.byteLength();else if(typeof it=="object")lt=it.length,it=new o(it,16);else{var ct=it.toString();lt=ct.length+1>>>1,it=new o(ct,16)}typeof at!="number"&&(at=lt*8);var ft=at-this.n.bitLength();return ft>0&&(it=it.ushrn(ft)),!st&&it.cmp(this.n)>=0?it.sub(this.n):it},nt.prototype.sign=function(it,st,at,lt){if(typeof at=="object"&&(lt=at,at=null),lt||(lt={}),typeof it!="string"&&typeof it!="number"&&!o.isBN(it)){et(typeof it=="object"&&it&&typeof it.length=="number","Expected message to be an array-like, a hex string, or a BN instance"),et(it.length>>>0===it.length);for(var ct=0;ct=0)){var Pt=this.g.mul(Ct);if(!Pt.isInfinity()){var Bt=Pt.getX(),At=Bt.umod(this.n);if(At.cmpn(0)!==0){var kt=Ct.invm(this.n).mul(At.mul(st.getPrivate()).iadd(it));if(kt=kt.umod(this.n),kt.cmpn(0)!==0){var Ot=(Pt.getY().isOdd()?1:0)|(Bt.cmp(At)!==0?2:0);return lt.canonical&&kt.cmp(this.nh)>0&&(kt=this.n.sub(kt),Ot^=1),new rt({r:At,s:kt,recoveryParam:Ot})}}}}}},nt.prototype.verify=function(it,st,at,lt,ct){ct||(ct={}),it=this._truncateToN(it,!1,ct.msgBitLength),at=this.keyFromPublic(at,lt),st=new rt(st,"hex");var ft=st.r,dt=st.s;if(ft.cmpn(1)<0||ft.cmp(this.n)>=0||dt.cmpn(1)<0||dt.cmp(this.n)>=0)return!1;var pt=dt.invm(this.n),yt=pt.mul(it).umod(this.n),vt=pt.mul(ft).umod(this.n),wt;return this.curve._maxwellTrick?(wt=this.g.jmulAdd(yt,at.getPublic(),vt),wt.isInfinity()?!1:wt.eqXToP(ft)):(wt=this.g.mulAdd(yt,at.getPublic(),vt),wt.isInfinity()?!1:wt.getX().umod(this.n).cmp(ft)===0)},nt.prototype.recoverPubKey=function(ot,it,st,at){et((3&st)===st,"The recovery param is more than two bits"),it=new rt(it,at);var lt=this.n,ct=new o(ot),ft=it.r,dt=it.s,pt=st&1,yt=st>>1;if(ft.cmp(this.curve.p.umod(this.curve.n))>=0&&yt)throw new Error("Unable to find sencond key candinate");yt?ft=this.curve.pointFromX(ft.add(this.curve.n),pt):ft=this.curve.pointFromX(ft,pt);var vt=it.r.invm(lt),wt=lt.sub(ct).mul(vt).umod(lt),Ct=dt.mul(vt).umod(lt);return this.g.mulAdd(wt,ft,Ct)},nt.prototype.getKeyRecoveryParam=function(ot,it,st,at){if(it=new rt(it,at),it.recoveryParam!==null)return it.recoveryParam;for(var lt=0;lt<4;lt++){var ct;try{ct=this.recoverPubKey(ot,it,lt)}catch{continue}if(ct.eq(st))return lt}throw new Error("Unable to find valid recovery factor")},ec$2}var utils$3=utils$d,assert$5=utils$3.assert,parseBytes$2=utils$3.parseBytes,cachedProperty$1=utils$3.cachedProperty;function KeyPair$1(o,_){this.eddsa=o,this._secret=parseBytes$2(_.secret),o.isPoint(_.pub)?this._pub=_.pub:this._pubBytes=parseBytes$2(_.pub)}KeyPair$1.fromPublic=function o(_,$){return $ instanceof KeyPair$1?$:new KeyPair$1(_,{pub:$})};KeyPair$1.fromSecret=function o(_,$){return $ instanceof KeyPair$1?$:new KeyPair$1(_,{secret:$})};KeyPair$1.prototype.secret=function o(){return this._secret};cachedProperty$1(KeyPair$1,"pubBytes",function o(){return this.eddsa.encodePoint(this.pub())});cachedProperty$1(KeyPair$1,"pub",function o(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())});cachedProperty$1(KeyPair$1,"privBytes",function o(){var _=this.eddsa,$=this.hash(),j=_.encodingLength-1,_e=$.slice(0,_.encodingLength);return _e[0]&=248,_e[j]&=127,_e[j]|=64,_e});cachedProperty$1(KeyPair$1,"priv",function o(){return this.eddsa.decodeInt(this.privBytes())});cachedProperty$1(KeyPair$1,"hash",function o(){return this.eddsa.hash().update(this.secret()).digest()});cachedProperty$1(KeyPair$1,"messagePrefix",function o(){return this.hash().slice(this.eddsa.encodingLength)});KeyPair$1.prototype.sign=function o(_){return assert$5(this._secret,"KeyPair can only verify"),this.eddsa.sign(_,this)};KeyPair$1.prototype.verify=function o(_,$){return this.eddsa.verify(_,$,this)};KeyPair$1.prototype.getSecret=function o(_){return assert$5(this._secret,"KeyPair is public only"),utils$3.encode(this.secret(),_)};KeyPair$1.prototype.getPublic=function o(_){return utils$3.encode(this.pubBytes(),_)};var key=KeyPair$1,BN=bnExports,utils$2=utils$d,assert$4=utils$2.assert,cachedProperty=utils$2.cachedProperty,parseBytes$1=utils$2.parseBytes;function Signature$2(o,_){this.eddsa=o,typeof _!="object"&&(_=parseBytes$1(_)),Array.isArray(_)&&(assert$4(_.length===o.encodingLength*2,"Signature has invalid size"),_={R:_.slice(0,o.encodingLength),S:_.slice(o.encodingLength)}),assert$4(_.R&&_.S,"Signature without R or S"),o.isPoint(_.R)&&(this._R=_.R),_.S instanceof BN&&(this._S=_.S),this._Rencoded=Array.isArray(_.R)?_.R:_.Rencoded,this._Sencoded=Array.isArray(_.S)?_.S:_.Sencoded}cachedProperty(Signature$2,"S",function o(){return this.eddsa.decodeInt(this.Sencoded())});cachedProperty(Signature$2,"R",function o(){return this.eddsa.decodePoint(this.Rencoded())});cachedProperty(Signature$2,"Rencoded",function o(){return this.eddsa.encodePoint(this.R())});cachedProperty(Signature$2,"Sencoded",function o(){return this.eddsa.encodeInt(this.S())});Signature$2.prototype.toBytes=function o(){return this.Rencoded().concat(this.Sencoded())};Signature$2.prototype.toHex=function o(){return utils$2.encode(this.toBytes(),"hex").toUpperCase()};var signature=Signature$2,hash$1=hash$4,curves=curves$1,utils$1=utils$d,assert$3=utils$1.assert,parseBytes=utils$1.parseBytes,KeyPair=key,Signature$1=signature;function EDDSA(o){if(assert$3(o==="ed25519","only tested with ed25519 so far"),!(this instanceof EDDSA))return new EDDSA(o);o=curves[o].curve,this.curve=o,this.g=o.g,this.g.precompute(o.n.bitLength()+1),this.pointClass=o.point().constructor,this.encodingLength=Math.ceil(o.n.bitLength()/8),this.hash=hash$1.sha512}var eddsa=EDDSA;EDDSA.prototype.sign=function o(_,$){_=parseBytes(_);var j=this.keyFromSecret($),_e=this.hashInt(j.messagePrefix(),_),et=this.g.mul(_e),tt=this.encodePoint(et),rt=this.hashInt(tt,j.pubBytes(),_).mul(j.priv()),nt=_e.add(rt).umod(this.curve.n);return this.makeSignature({R:et,S:nt,Rencoded:tt})};EDDSA.prototype.verify=function o(_,$,j){if(_=parseBytes(_),$=this.makeSignature($),$.S().gte($.eddsa.curve.n)||$.S().isNeg())return!1;var _e=this.keyFromPublic(j),et=this.hashInt($.Rencoded(),_e.pubBytes(),_),tt=this.g.mul($.S()),rt=$.R().add(_e.pub().mul(et));return rt.eq(tt)};EDDSA.prototype.hashInt=function o(){for(var _=this.hash(),$=0;$=0&&ht<=pt.levels.SILENT)return ht;throw new TypeError("log.setLevel() called with invalid level: "+Tt)}pt.name=ft,pt.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},pt.methodFactory=dt||at,pt.getLevel=function(){return wt??vt??yt},pt.setLevel=function(Tt,ht){return wt=kt(Tt),ht!==!1&&Pt(wt),it.call(pt)},pt.setDefaultLevel=function(Tt){vt=kt(Tt),Bt()||pt.setLevel(Tt,!1)},pt.resetLevel=function(){wt=null,At(),it.call(pt)},pt.enableAll=function(Tt){pt.setLevel(pt.levels.TRACE,Tt)},pt.disableAll=function(Tt){pt.setLevel(pt.levels.SILENT,Tt)},pt.rebuild=function(){if(tt!==pt&&(yt=kt(tt.getLevel())),it.call(pt),tt===pt)for(var Tt in et)et[Tt].rebuild()},yt=kt(tt?tt.getLevel():"WARN");var Ot=Bt();Ot!=null&&(wt=kt(Ot)),it.call(pt)}tt=new lt,tt.getLogger=function(dt){if(typeof dt!="symbol"&&typeof dt!="string"||dt==="")throw new TypeError("You must supply a name when creating a logger.");var pt=et[dt];return pt||(pt=et[dt]=new lt(dt,tt.methodFactory)),pt};var ct=typeof window!==$?window.log:void 0;return tt.noConflict=function(){return typeof window!==$&&window.log===tt&&(window.log=ct),tt},tt.getLoggers=function(){return et},tt.default=tt,tt})})(loglevel$2);var loglevelExports=loglevel$2.exports;const log$3=getDefaultExportFromCjs$1(loglevelExports),loglevel$1=log$3.getLogger("auth");loglevel$1.setLevel("error");const TORUS_LEGACY_NETWORK={MAINNET:"mainnet",TESTNET:"testnet",CYAN:"cyan",AQUA:"aqua",CELESTE:"celeste"},TORUS_SAPPHIRE_NETWORK={SAPPHIRE_DEVNET:"sapphire_devnet",SAPPHIRE_MAINNET:"sapphire_mainnet"};TORUS_LEGACY_NETWORK.MAINNET+"",TORUS_LEGACY_NETWORK.TESTNET+"",TORUS_LEGACY_NETWORK.CYAN+"",TORUS_LEGACY_NETWORK.AQUA+"",TORUS_LEGACY_NETWORK.CELESTE+"";TORUS_LEGACY_NETWORK.AQUA+"",TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,TORUS_LEGACY_NETWORK.CELESTE+"",TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,TORUS_LEGACY_NETWORK.CYAN+"",TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,TORUS_LEGACY_NETWORK.MAINNET+"",TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET,TORUS_LEGACY_NETWORK.TESTNET+"",TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET;TORUS_LEGACY_NETWORK.MAINNET+"",TORUS_LEGACY_NETWORK.TESTNET+"",TORUS_LEGACY_NETWORK.CYAN+"",TORUS_LEGACY_NETWORK.AQUA+"",TORUS_LEGACY_NETWORK.CELESTE+"";const SIGNER_MAP={[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_MAINNET]:"https://api.web3auth.io/signer-service",[TORUS_SAPPHIRE_NETWORK.SAPPHIRE_DEVNET]:"https://api.web3auth.io/signer-service",[TORUS_LEGACY_NETWORK.MAINNET]:"https://api.web3auth.io/signer-service",[TORUS_LEGACY_NETWORK.TESTNET]:"https://api.web3auth.io/signer-service",[TORUS_LEGACY_NETWORK.CYAN]:"https://api.web3auth.io/signer-polygon-service",[TORUS_LEGACY_NETWORK.AQUA]:"https://api.web3auth.io/signer-polygon-service",[TORUS_LEGACY_NETWORK.CELESTE]:"https://api.web3auth.io/signer-polygon-service"};TORUS_LEGACY_NETWORK.MAINNET+"",TORUS_LEGACY_NETWORK.TESTNET+"",TORUS_LEGACY_NETWORK.CYAN+"",TORUS_LEGACY_NETWORK.AQUA+"",TORUS_LEGACY_NETWORK.CELESTE+"";const SESSION_SERVER_API_URL="https://api.web3auth.io/session-service",SESSION_SERVER_SOCKET_URL="https://session.web3auth.io";var isMergeableObject=function o(_){return isNonNullObject(_)&&!isSpecial(_)};function isNonNullObject(o){return!!o&&typeof o=="object"}function isSpecial(o){var _=Object.prototype.toString.call(o);return _==="[object RegExp]"||_==="[object Date]"||isReactElement(o)}var canUseSymbol=typeof Symbol=="function"&&Symbol.for,REACT_ELEMENT_TYPE=canUseSymbol?Symbol.for("react.element"):60103;function isReactElement(o){return o.$$typeof===REACT_ELEMENT_TYPE}function emptyTarget(o){return Array.isArray(o)?[]:{}}function cloneUnlessOtherwiseSpecified(o,_){return _.clone!==!1&&_.isMergeableObject(o)?deepmerge(emptyTarget(o),o,_):o}function defaultArrayMerge(o,_,$){return o.concat(_).map(function(j){return cloneUnlessOtherwiseSpecified(j,$)})}function getMergeFunction(o,_){if(!_.customMerge)return deepmerge;var $=_.customMerge(o);return typeof $=="function"?$:deepmerge}function getEnumerableOwnPropertySymbols(o){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(o).filter(function(_){return Object.propertyIsEnumerable.call(o,_)}):[]}function getKeys(o){return Object.keys(o).concat(getEnumerableOwnPropertySymbols(o))}function propertyIsOnObject(o,_){try{return _ in o}catch{return!1}}function propertyIsUnsafe(o,_){return propertyIsOnObject(o,_)&&!(Object.hasOwnProperty.call(o,_)&&Object.propertyIsEnumerable.call(o,_))}function mergeObject(o,_,$){var j={};return $.isMergeableObject(o)&&getKeys(o).forEach(function(_e){j[_e]=cloneUnlessOtherwiseSpecified(o[_e],$)}),getKeys(_).forEach(function(_e){propertyIsUnsafe(o,_e)||(propertyIsOnObject(o,_e)&&$.isMergeableObject(_[_e])?j[_e]=getMergeFunction(_e,$)(o[_e],_[_e],$):j[_e]=cloneUnlessOtherwiseSpecified(_[_e],$))}),j}function deepmerge(o,_,$){$=$||{},$.arrayMerge=$.arrayMerge||defaultArrayMerge,$.isMergeableObject=$.isMergeableObject||isMergeableObject,$.cloneUnlessOtherwiseSpecified=cloneUnlessOtherwiseSpecified;var j=Array.isArray(_),_e=Array.isArray(o),et=j===_e;return et?j?$.arrayMerge(o,_,$):mergeObject(o,_,$):cloneUnlessOtherwiseSpecified(_,$)}deepmerge.all=function o(_,$){if(!Array.isArray(_))throw new Error("first argument should be an array");return _.reduce(function(j,_e){return deepmerge(j,_e,$)},{})};var deepmerge_1=deepmerge,cjs=deepmerge_1;const deepmerge$1=getDefaultExportFromCjs$1(cjs),log$2=log$3.getLogger("http-helpers");log$2.setLevel(loglevelExports.levels.INFO);let apiKey="torus-default";const gatewayAuthHeader="x-api-key";function setLogLevel(o){log$2.setLevel(o)}async function fetchAndTrace(o,_){let $=null;try{$=new URL(o)}catch{}return fetch(o,_)}function getApiKeyHeaders(){const o={};return o[gatewayAuthHeader]=apiKey,o}function debugLogResponse(o){log$2.info(`Response: ${o.status} ${o.statusText}`),log$2.info(`Url: ${o.url}`)}function logTracingHeader(o){const _=o.headers.get("x-web3-correlation-id");_&&log$2.info(`Request tracing with traceID = ${_}`)}const promiseTimeout=async(o,_)=>{let $=null;try{const j=new Promise((et,tt)=>{$=setTimeout(()=>{tt(new Error(`Timed out in ${o}ms`))},o)}),_e=await Promise.race([_,j]);return $!=null&&clearTimeout($),_e}catch(j){throw $!=null&&clearTimeout($),j}},get$4=async(o,_={},$={})=>{const j={mode:"cors",headers:{}};$.useAPIKey&&(j.headers=_objectSpread2(_objectSpread2({},j.headers),getApiKeyHeaders())),_.method="GET";const _e=deepmerge$1(j,_),et=await fetchAndTrace(o,_e);if(et.ok){const tt=et.headers.get("content-type");return tt!=null&&tt.includes("application/json")?et.json():et.text()}throw debugLogResponse(et),et},post=(o,_={},$={},j={})=>{const _e={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};j.useAPIKey&&(_e.headers=_objectSpread2(_objectSpread2({},_e.headers),getApiKeyHeaders())),$.method="POST";const et=deepmerge$1(_e,$);return j.isUrlEncodedData?(et.body=_,et.headers["Content-Type"]==="application/json; charset=utf-8"&&delete et.headers["Content-Type"]):et.body=JSON.stringify(_),promiseTimeout(j.timeout||6e4,fetchAndTrace(o,et).then(tt=>{if(j.logTracingHeader&&logTracingHeader(tt),tt.ok){const rt=tt.headers.get("content-type");return rt!=null&&rt.includes("application/json")?tt.json():tt.text()}throw debugLogResponse(tt),tt}))},patch=async(o,_={},$={},j={})=>{const _e={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};j.useAPIKey&&(_e.headers=_objectSpread2(_objectSpread2({},_e.headers),getApiKeyHeaders())),$.method="PATCH";const et=deepmerge$1(_e,$);j.isUrlEncodedData?(et.body=_,et.headers["Content-Type"]==="application/json; charset=utf-8"&&delete et.headers["Content-Type"]):et.body=JSON.stringify(_);const tt=await fetchAndTrace(o,et);if(tt.ok){const rt=tt.headers.get("content-type");return rt!=null&&rt.includes("application/json")?tt.json():tt.text()}throw debugLogResponse(tt),tt},put=async(o,_={},$={},j={})=>{const _e={mode:"cors",headers:{"Content-Type":"application/json; charset=utf-8"}};j.useAPIKey&&(_e.headers=_objectSpread2(_objectSpread2({},_e.headers),getApiKeyHeaders())),$.method="PUT";const et=deepmerge$1(_e,$);j.isUrlEncodedData?(et.body=_,et.headers["Content-Type"]==="application/json; charset=utf-8"&&delete et.headers["Content-Type"]):et.body=JSON.stringify(_);const tt=await fetchAndTrace(o,et);if(tt.ok){const rt=tt.headers.get("content-type");return rt!=null&&rt.includes("application/json")?tt.json():tt.text()}throw debugLogResponse(tt),tt},padHexString=o=>o.padStart(64,"0").slice(0,64);class BaseSessionManager{constructor(){_defineProperty$z(this,"sessionId",void 0)}checkSessionParams(){if(!this.sessionId)throw new Error("Session id is required");this.sessionId=padHexString(this.sessionId)}request({method:_="GET",url:$,data:j={},headers:_e={}}){const et={headers:_e};switch(_){case"GET":return get$4($,et);case"POST":return post($,j,et);case"PUT":return put($,j,et);case"PATCH":return patch($,j,et)}throw new Error("Invalid method type")}}const ec$1=new ellipticExports.ec("secp256k1"),browserCrypto=globalThis.crypto||globalThis.msCrypto||{},subtle=browserCrypto.subtle||browserCrypto.webkitSubtle,EC_GROUP_ORDER=Buffer$3.from("fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141","hex"),ZERO32=Buffer$3.alloc(32,0);function assert$2(o,_){if(!o)throw new Error(_||"Assertion failed")}function isScalar(o){return Buffer$3.isBuffer(o)&&o.length===32}function isValidPrivateKey(o){return isScalar(o)?o.compare(ZERO32)>0&&o.compare(EC_GROUP_ORDER)<0:!1}function equalConstTime(o,_){if(o.length!==_.length)return!1;let $=0;for(let j=0;j"u")return Buffer$3.from(browserCrypto.randomBytes(o));const _=new Uint8Array(o);return browserCrypto.getRandomValues(_),Buffer$3.from(_)}async function sha512(o){if(!browserCrypto.createHash){const j=await subtle.digest("SHA-512",o);return new Uint8Array(j)}const $=browserCrypto.createHash("sha512").update(o).digest();return new Uint8Array($)}function getAes(o){return async function(_,$,j){if(subtle&&subtle[o]&&subtle.importKey){const _e={name:"AES-CBC"},et=await subtle.importKey("raw",$,_e,!1,[o]),tt={name:"AES-CBC",iv:_},rt=await subtle[o](tt,et,j);return Buffer$3.from(new Uint8Array(rt))}else if(o==="encrypt"&&browserCrypto.createCipheriv){const _e=browserCrypto.createCipheriv("aes-256-cbc",$,_),et=_e.update(j),tt=_e.final();return Buffer$3.concat([et,tt])}else if(o==="decrypt"&&browserCrypto.createDecipheriv){const _e=browserCrypto.createDecipheriv("aes-256-cbc",$,_),et=_e.update(j),tt=_e.final();return Buffer$3.concat([et,tt])}throw new Error(`Unsupported operation: ${o}`)}}const aesCbcEncrypt=getAes("encrypt"),aesCbcDecrypt=getAes("decrypt");async function hmacSha256Sign(o,_){if(!browserCrypto.createHmac){const _e={name:"HMAC",hash:{name:"SHA-256"}},et=await subtle.importKey("raw",new Uint8Array(o),_e,!1,["sign","verify"]),tt=await subtle.sign("HMAC",et,_);return Buffer$3.from(new Uint8Array(tt))}const $=browserCrypto.createHmac("sha256",Buffer$3.from(o));return $.update(_),$.digest()}async function hmacSha256Verify(o,_,$){const j=await hmacSha256Sign(o,_);return equalConstTime(j,$)}const generatePrivate=function(){let o=randomBytes$1(32);for(;!isValidPrivateKey(o);)o=randomBytes$1(32);return o},getPublic=function(o){return assert$2(o.length===32,"Bad private key"),assert$2(isValidPrivateKey(o),"Bad private key"),Buffer$3.from(ec$1.keyFromPrivate(o).getPublic("array"))},getPublicCompressed=function(o){return assert$2(o.length===32,"Bad private key"),assert$2(isValidPrivateKey(o),"Bad private key"),Buffer$3.from(ec$1.keyFromPrivate(o).getPublic(!0,"array"))},sign$1=async function(o,_){return assert$2(o.length===32,"Bad private key"),assert$2(isValidPrivateKey(o),"Bad private key"),assert$2(_.length>0,"Message should not be empty"),assert$2(_.length<=32,"Message is too long"),Buffer$3.from(ec$1.sign(_,o,{canonical:!0}).toDER())},derive=async function(o,_){assert$2(Buffer$3.isBuffer(o),"Bad private key"),assert$2(Buffer$3.isBuffer(_),"Bad public key"),assert$2(o.length===32,"Bad private key"),assert$2(isValidPrivateKey(o),"Bad private key"),assert$2(_.length===65||_.length===33,"Bad public key"),_.length===65&&assert$2(_[0]===4,"Bad public key"),_.length===33&&assert$2(_[0]===2||_[0]===3,"Bad public key");const $=ec$1.keyFromPrivate(o),j=ec$1.keyFromPublic(_),_e=$.derive(j.getPublic());return Buffer$3.from(_e.toArray())},deriveUnpadded=derive,derivePadded=async function(o,_){assert$2(Buffer$3.isBuffer(o),"Bad private key"),assert$2(Buffer$3.isBuffer(_),"Bad public key"),assert$2(o.length===32,"Bad private key"),assert$2(isValidPrivateKey(o),"Bad private key"),assert$2(_.length===65||_.length===33,"Bad public key"),_.length===65&&assert$2(_[0]===4,"Bad public key"),_.length===33&&assert$2(_[0]===2||_[0]===3,"Bad public key");const $=ec$1.keyFromPrivate(o),j=ec$1.keyFromPublic(_),_e=$.derive(j.getPublic());return Buffer$3.from(_e.toString(16,64),"hex")},encrypt=async function(o,_,$){$=$||{};let j=$.ephemPrivateKey||randomBytes$1(32);for(;!isValidPrivateKey(j);)j=$.ephemPrivateKey||randomBytes$1(32);const _e=getPublic(j),et=await deriveUnpadded(j,o),tt=await sha512(et),rt=$.iv||randomBytes$1(16),nt=tt.slice(0,32),ot=tt.slice(32),st=await aesCbcEncrypt(rt,Buffer$3.from(nt),_),at=Buffer$3.concat([rt,_e,st]),lt=await hmacSha256Sign(Buffer$3.from(ot),at);return{iv:rt,ephemPublicKey:_e,ciphertext:st,mac:lt}},decrypt=async function(o,_,$){const j=$??!1,et=await(j?derivePadded:deriveUnpadded)(o,_.ephemPublicKey),tt=await sha512(et),rt=tt.slice(0,32),nt=tt.slice(32),ot=Buffer$3.concat([_.iv,_.ephemPublicKey,_.ciphertext]),it=await hmacSha256Verify(Buffer$3.from(nt),ot,_.mac);if(!it&&j===!1)return decrypt(o,_,!0);if(!it&&j===!0)throw new Error("bad MAC after trying padded");const st=await aesCbcDecrypt(_.iv,Buffer$3.from(rt),_.ciphertext);return Buffer$3.from(new Uint8Array(st))};var jsonify={},parse$1,hasRequiredParse;function requireParse(){if(hasRequiredParse)return parse$1;hasRequiredParse=1;var o,_,$={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:` -`,r:"\r",t:" "},j;function _e(lt){throw{name:"SyntaxError",message:lt,at:o,text:j}}function et(lt){return lt&<!==_&&_e("Expected '"+lt+"' instead of '"+_+"'"),_=j.charAt(o),o+=1,_}function tt(){var lt,ct="";for(_==="-"&&(ct="-",et("-"));_>="0"&&_<="9";)ct+=_,et();if(_===".")for(ct+=".";et()&&_>="0"&&_<="9";)ct+=_;if(_==="e"||_==="E")for(ct+=_,et(),(_==="-"||_==="+")&&(ct+=_,et());_>="0"&&_<="9";)ct+=_,et();return lt=Number(ct),isFinite(lt)||_e("Bad number"),lt}function rt(){var lt,ct,ft="",dt;if(_==='"')for(;et();){if(_==='"')return et(),ft;if(_==="\\")if(et(),_==="u"){for(dt=0,ct=0;ct<4&&(lt=parseInt(et(),16),!!isFinite(lt));ct+=1)dt=dt*16+lt;ft+=String.fromCharCode(dt)}else if(typeof $[_]=="string")ft+=$[_];else break;else ft+=_}_e("Bad string")}function nt(){for(;_&&_<=" ";)et()}function ot(){switch(_){case"t":return et("t"),et("r"),et("u"),et("e"),!0;case"f":return et("f"),et("a"),et("l"),et("s"),et("e"),!1;case"n":return et("n"),et("u"),et("l"),et("l"),null;default:_e("Unexpected '"+_+"'")}}function it(){var lt=[];if(_==="["){if(et("["),nt(),_==="]")return et("]"),lt;for(;_;){if(lt.push(at()),nt(),_==="]")return et("]"),lt;et(","),nt()}}_e("Bad array")}function st(){var lt,ct={};if(_==="{"){if(et("{"),nt(),_==="}")return et("}"),ct;for(;_;){if(lt=rt(),nt(),et(":"),Object.prototype.hasOwnProperty.call(ct,lt)&&_e('Duplicate key "'+lt+'"'),ct[lt]=at(),nt(),_==="}")return et("}"),ct;et(","),nt()}}_e("Bad object")}function at(){switch(nt(),_){case"{":return st();case"[":return it();case'"':return rt();case"-":return tt();default:return _>="0"&&_<="9"?tt():ot()}}return parse$1=function(lt,ct){var ft;return j=lt,o=0,_=" ",ft=at(),nt(),_&&_e("Syntax error"),typeof ct=="function"?function dt(pt,yt){var vt,wt,Ct=pt[yt];if(Ct&&typeof Ct=="object")for(vt in at)Object.prototype.hasOwnProperty.call(Ct,vt)&&(wt=dt(Ct,vt),typeof wt>"u"?delete Ct[vt]:Ct[vt]=wt);return ct.call(pt,yt,Ct)}({"":ft},""):ft},parse$1}var stringify$2,hasRequiredStringify;function requireStringify(){if(hasRequiredStringify)return stringify$2;hasRequiredStringify=1;var o=/[\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,_,$,j={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},_e;function et(rt){return o.lastIndex=0,o.test(rt)?'"'+rt.replace(o,function(nt){var ot=j[nt];return typeof ot=="string"?ot:"\\u"+("0000"+nt.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+rt+'"'}function tt(rt,nt){var ot,it,st,at,lt=_,ct,ft=nt[rt];switch(ft&&typeof ft=="object"&&typeof ft.toJSON=="function"&&(ft=ft.toJSON(rt)),typeof _e=="function"&&(ft=_e.call(nt,rt,ft)),typeof ft){case"string":return et(ft);case"number":return isFinite(ft)?String(ft):"null";case"boolean":case"null":return String(ft);case"object":if(!ft)return"null";if(_+=$,ct=[],Object.prototype.toString.apply(ft)==="[object Array]"){for(at=ft.length,ot=0;ot1?arguments[1]:void 0,j=$&&$.space||"";typeof j=="number"&&(j=strRepeat(j," "));var _e=!!$&&typeof $.cycles=="boolean"&&$.cycles,et=$&&$.replacer?callBind($.replacer):defaultReplacer;if($&&typeof $.collapseEmpty<"u"&&typeof $.collapseEmpty!="boolean")throw new TypeError("`collapseEmpty` must be a boolean, if provided");var tt=!!$&&$.collapseEmpty,rt=typeof $=="function"?$:$&&$.cmp,nt=rt&&function(it){var st=rt.length>2&&function(lt){return it[lt]};return function(at,lt){return rt({key:at,value:it[at]},{key:lt,value:it[lt]},st?{__proto__:null,get:st}:void 0)}},ot=[];return function it(st,at,lt,ct){var ft=j?` -`+strRepeat(ct,j):"",dt=j?": ":":";if(lt&<.toJSON&&typeof lt.toJSON=="function"&&(lt=lt.toJSON()),lt=et(st,at,lt),lt!==void 0){if(typeof lt!="object"||lt===null)return jsonStringify(lt);var pt=function(At,kt){return tt&&At.length===0?kt:(kt==="[]"?"[":"{")+$join(At,",")+ft+(kt==="[]"?"]":"}")};if(isArray$1(lt)){for(var Ct=[],yt=0;yt>_7n$1)*_0x71n$1)%_256n$1,_&_2n$4&&(_e^=_1n$6<<(_1n$6<$>32?rotlBH$1(o,_,$):rotlSH$1(o,_,$),rotlL$1=(o,_,$)=>$>32?rotlBL$1(o,_,$):rotlSL$1(o,_,$);function keccakP$1(o,_=24){const $=new Uint32Array(10);for(let j=24-_;j<24;j++){for(let tt=0;tt<10;tt++)$[tt]=o[tt]^o[tt+10]^o[tt+20]^o[tt+30]^o[tt+40];for(let tt=0;tt<10;tt+=2){const rt=(tt+8)%10,nt=(tt+2)%10,ot=$[nt],it=$[nt+1],st=rotlH$1(ot,it,1)^$[rt],at=rotlL$1(ot,it,1)^$[rt+1];for(let lt=0;lt<50;lt+=10)o[tt+lt]^=st,o[tt+lt+1]^=at}let _e=o[2],et=o[3];for(let tt=0;tt<24;tt++){const rt=SHA3_ROTL$1[tt],nt=rotlH$1(_e,et,rt),ot=rotlL$1(_e,et,rt),it=SHA3_PI$1[tt];_e=o[it],et=o[it+1],o[it]=nt,o[it+1]=ot}for(let tt=0;tt<50;tt+=10){for(let rt=0;rt<10;rt++)$[rt]=o[tt+rt];for(let rt=0;rt<10;rt++)o[tt+rt]^=~$[(rt+2)%10]&$[(rt+4)%10]}o[0]^=SHA3_IOTA_H$1[j],o[1]^=SHA3_IOTA_L$1[j]}$.fill(0)}let Keccak$1=class Bn extends Hash$1{constructor(_,$,j,_e=!1,et=24){if(super(),this.blockLen=_,this.suffix=$,this.outputLen=j,this.enableXOF=_e,this.rounds=et,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$4(j),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32$1(this.state)}keccak(){isLE$1||byteSwap32(this.state32),keccakP$1(this.state32,this.rounds),isLE$1||byteSwap32(this.state32),this.posOut=0,this.pos=0}update(_){exists$1(this);const{blockLen:$,state:j}=this;_=toBytes$2(_);const _e=_.length;for(let et=0;et<_e;){const tt=Math.min($-this.pos,_e-et);for(let rt=0;rt=j&&this.keccak();const tt=Math.min(j-this.posOut,et-_e);_.set($.subarray(this.posOut,this.posOut+tt),_e),this.posOut+=tt,_e+=tt}return _}xofInto(_){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(_)}xof(_){return number$4(_),this.xofInto(new Uint8Array(_))}digestInto(_){if(output$1(_,this),this.finished)throw new Error("digest() was already called");return this.writeInto(_),this.destroy(),_}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(_){const{blockLen:$,suffix:j,outputLen:_e,rounds:et,enableXOF:tt}=this;return _||(_=new Bn($,j,_e,tt,et)),_.state32.set(this.state32),_.pos=this.pos,_.posOut=this.posOut,_.finished=this.finished,_.rounds=et,_.suffix=j,_.outputLen=_e,_.enableXOF=tt,_.destroyed=this.destroyed,_}};const gen$1=(o,_,$)=>wrapConstructor$1(()=>new Keccak$1(_,o,$)),keccak_256$1=gen$1(1,136,256/8);function wrapHash(o){return _=>(assert$i.bytes(_),o(_))}(()=>{const o=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0,_=typeof module<"u"&&typeof module.require=="function"&&module.require.bind(module);return{node:_&&!o?_("crypto"):void 0,web:o}})();const keccak256$2=(()=>{const o=wrapHash(keccak_256$1);return o.create=keccak_256$1.create,o})();function keccak256$1(o){return Buffer$3.from(keccak256$2(o))}const ec=new ellipticExports.ec("secp256k1");function encParamsHexToBuf(o){return{iv:Buffer$3.from(o.iv,"hex"),ephemPublicKey:Buffer$3.from(o.ephemPublicKey,"hex"),ciphertext:Buffer$3.from(o.ciphertext,"hex"),mac:Buffer$3.from(o.mac,"hex")}}function encParamsBufToHex(o){return{iv:Buffer$3.from(o.iv).toString("hex"),ephemPublicKey:Buffer$3.from(o.ephemPublicKey).toString("hex"),ciphertext:Buffer$3.from(o.ciphertext).toString("hex"),mac:Buffer$3.from(o.mac).toString("hex")}}async function encryptData(o,_){const $=JSON.stringify(_),j=Buffer$3.from($,"utf-8"),_e=await encrypt(getPublic(Buffer$3.from(o,"hex")),j),et=encParamsBufToHex(_e);return JSON.stringify(et)}async function decryptData(o,_){const $=JSON.parse(_),j=encParamsHexToBuf($),_e=ec.keyFromPrivate(o),tt=(await decrypt(Buffer$3.from(_e.getPrivate().toString("hex",64),"hex"),j)).toString("utf-8");return JSON.parse(tt)}const DEFAULT_SESSION_TIMEOUT=86400;class SessionManager extends BaseSessionManager{constructor({sessionServerBaseUrl:_,sessionNamespace:$,sessionTime:j,sessionId:_e,allowedOrigin:et}={}){super(),_defineProperty$z(this,"sessionServerBaseUrl",SESSION_SERVER_API_URL),_defineProperty$z(this,"sessionNamespace",void 0),_defineProperty$z(this,"allowedOrigin",void 0),_defineProperty$z(this,"sessionTime",DEFAULT_SESSION_TIMEOUT),_defineProperty$z(this,"sessionId",""),_&&(this.sessionServerBaseUrl=_),$&&(this.sessionNamespace=$),j&&(this.sessionTime=j),_e&&(this.sessionId=padHexString(_e)),et?this.allowedOrigin=et:this.allowedOrigin="*"}static generateRandomSessionKey(){return padHexString(generatePrivate().toString("hex"))}async createSession(_,$={}){super.checkSessionParams();const j=Buffer$3.from(this.sessionId,"hex"),_e=getPublic(j).toString("hex"),et=await encryptData(this.sessionId,_),tt=(await sign$1(j,keccak256$1(Buffer$3.from(et,"utf8")))).toString("hex"),rt={key:_e,data:et,signature:tt,namespace:this.sessionNamespace,timeout:this.sessionTime,allowedOrigin:this.allowedOrigin};return await super.request({method:"POST",url:`${this.sessionServerBaseUrl}/v2/store/set`,data:rt,headers:$}),this.sessionId}async authorizeSession({headers:_}={headers:{}}){super.checkSessionParams();const j={key:getPublic(Buffer$3.from(this.sessionId,"hex")).toString("hex"),namespace:this.sessionNamespace},_e=await super.request({method:"POST",url:`${this.sessionServerBaseUrl}/v2/store/get`,data:j,headers:_});if(!_e.message)throw new Error("Session Expired or Invalid public key");const et=await decryptData(this.sessionId,_e.message);if(et.error)throw new Error("There was an error decrypting data.");return et}async updateSession(_,$={}){super.checkSessionParams();const j=Buffer$3.from(this.sessionId,"hex"),_e=getPublic(j).toString("hex"),et=await encryptData(this.sessionId,_),tt=(await sign$1(j,keccak256$1(Buffer$3.from(et,"utf8")))).toString("hex"),rt={key:_e,data:et,signature:tt,namespace:this.sessionNamespace,allowedOrigin:this.allowedOrigin};await super.request({method:"PUT",url:`${this.sessionServerBaseUrl}/v2/store/update`,data:rt,headers:$})}async invalidateSession(_={}){super.checkSessionParams();const $=Buffer$3.from(this.sessionId,"hex"),j=getPublic($).toString("hex"),_e=await encryptData(this.sessionId,{}),et=(await sign$1($,keccak256$1(Buffer$3.from(_e,"utf8")))).toString("hex"),tt={key:j,data:_e,signature:et,namespace:this.sessionNamespace,timeout:1};return await super.request({method:"POST",url:`${this.sessionServerBaseUrl}/v2/store/set`,data:tt,headers:_}),this.sessionId="",!0}}function fixProto(o,_){var $=Object.setPrototypeOf;$?$(o,_):o.__proto__=_}function fixStack(o,_){_===void 0&&(_=o.constructor);var $=Error.captureStackTrace;$&&$(o,_)}var __extends=function(){var o=function($,j){return o=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(_e,et){_e.__proto__=et}||function(_e,et){for(var tt in et)Object.prototype.hasOwnProperty.call(et,tt)&&(_e[tt]=et[tt])},o($,j)};return function(_,$){if(typeof $!="function"&&$!==null)throw new TypeError("Class extends value "+String($)+" is not a constructor or null");o(_,$);function j(){this.constructor=_}_.prototype=$===null?Object.create($):(j.prototype=$.prototype,new j)}}(),CustomError=function(o){__extends(_,o);function _($,j){var _e=this.constructor,et=o.call(this,$,j)||this;return Object.defineProperty(et,"name",{value:_e.name,enumerable:!1,configurable:!0}),fixProto(et,_e.prototype),fixStack(et),et}return _}(Error);class AuthError extends CustomError{constructor(_,$){super($),_defineProperty$z(this,"code",void 0),_defineProperty$z(this,"message",void 0),this.code=_,this.message=$||"",Object.defineProperty(this,"name",{value:"AuthError"})}toJSON(){return{name:this.name,code:this.code,message:this.message}}toString(){return JSON.stringify(this.toJSON())}}class InitializationError extends AuthError{constructor(_,$){super(_,$),Object.defineProperty(this,"name",{value:"InitializationError"})}static fromCode(_,$=""){return new InitializationError(_,`${InitializationError.messages[_]}, ${$}`)}static invalidParams(_=""){return InitializationError.fromCode(5001,_)}static notInitialized(_=""){return InitializationError.fromCode(5002,_)}}_defineProperty$z(InitializationError,"messages",{5e3:"Custom",5001:"Invalid constructor params",5002:"SDK not initialized. please call init first"});class LoginError extends AuthError{constructor(_,$){super(_,$),Object.defineProperty(this,"name",{value:"LoginError"})}static fromCode(_,$=""){return new LoginError(_,`${LoginError.messages[_]}, ${$}`)}static invalidLoginParams(_=""){return LoginError.fromCode(5111,_)}static userNotLoggedIn(_=""){return LoginError.fromCode(5112,_)}static popupClosed(_=""){return LoginError.fromCode(5113,_)}static loginFailed(_=""){return LoginError.fromCode(5114,_)}static popupBlocked(_=""){return LoginError.fromCode(5115,_)}static mfaAlreadyEnabled(_=""){return LoginError.fromCode(5116,_)}static mfaNotEnabled(_=""){return LoginError.fromCode(5117,_)}}_defineProperty$z(LoginError,"messages",{5e3:"Custom",5111:"Invalid login params",5112:"User not logged in.",5113:"login popup has been closed by the user",5114:"Login failed",5115:"Popup was blocked. Please call this function as soon as user clicks button or use redirect mode",5116:"MFA already enabled",5117:"MFA not yet enabled. Please call `enableMFA` first"});const PACKET_TYPES=Object.create(null);PACKET_TYPES.open="0";PACKET_TYPES.close="1";PACKET_TYPES.ping="2";PACKET_TYPES.pong="3";PACKET_TYPES.message="4";PACKET_TYPES.upgrade="5";PACKET_TYPES.noop="6";const PACKET_TYPES_REVERSE=Object.create(null);Object.keys(PACKET_TYPES).forEach(o=>{PACKET_TYPES_REVERSE[PACKET_TYPES[o]]=o});const ERROR_PACKET={type:"error",data:"parser error"},withNativeBlob$1=typeof Blob=="function"||typeof Blob<"u"&&Object.prototype.toString.call(Blob)==="[object BlobConstructor]",withNativeArrayBuffer$2=typeof ArrayBuffer=="function",isView$1=o=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(o):o&&o.buffer instanceof ArrayBuffer,encodePacket=({type:o,data:_},$,j)=>withNativeBlob$1&&_ instanceof Blob?$?j(_):encodeBlobAsBase64(_,j):withNativeArrayBuffer$2&&(_ instanceof ArrayBuffer||isView$1(_))?$?j(_):encodeBlobAsBase64(new Blob([_]),j):j(PACKET_TYPES[o]+(_||"")),encodeBlobAsBase64=(o,_)=>{const $=new FileReader;return $.onload=function(){const j=$.result.split(",")[1];_("b"+(j||""))},$.readAsDataURL(o)};function toArray$2(o){return o instanceof Uint8Array?o:o instanceof ArrayBuffer?new Uint8Array(o):new Uint8Array(o.buffer,o.byteOffset,o.byteLength)}let TEXT_ENCODER;function encodePacketToBinary(o,_){if(withNativeBlob$1&&o.data instanceof Blob)return o.data.arrayBuffer().then(toArray$2).then(_);if(withNativeArrayBuffer$2&&(o.data instanceof ArrayBuffer||isView$1(o.data)))return _(toArray$2(o.data));encodePacket(o,!1,$=>{TEXT_ENCODER||(TEXT_ENCODER=new TextEncoder),_(TEXT_ENCODER.encode($))})}const chars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",lookup$1=typeof Uint8Array>"u"?[]:new Uint8Array(256);for(let o=0;o{let _=o.length*.75,$=o.length,j,_e=0,et,tt,rt,nt;o[o.length-1]==="="&&(_--,o[o.length-2]==="="&&_--);const ot=new ArrayBuffer(_),it=new Uint8Array(ot);for(j=0;j<$;j+=4)et=lookup$1[o.charCodeAt(j)],tt=lookup$1[o.charCodeAt(j+1)],rt=lookup$1[o.charCodeAt(j+2)],nt=lookup$1[o.charCodeAt(j+3)],it[_e++]=et<<2|tt>>4,it[_e++]=(tt&15)<<4|rt>>2,it[_e++]=(rt&3)<<6|nt&63;return ot},withNativeArrayBuffer$1=typeof ArrayBuffer=="function",decodePacket=(o,_)=>{if(typeof o!="string")return{type:"message",data:mapBinary(o,_)};const $=o.charAt(0);return $==="b"?{type:"message",data:decodeBase64Packet(o.substring(1),_)}:PACKET_TYPES_REVERSE[$]?o.length>1?{type:PACKET_TYPES_REVERSE[$],data:o.substring(1)}:{type:PACKET_TYPES_REVERSE[$]}:ERROR_PACKET},decodeBase64Packet=(o,_)=>{if(withNativeArrayBuffer$1){const $=decode$2(o);return mapBinary($,_)}else return{base64:!0,data:o}},mapBinary=(o,_)=>{switch(_){case"blob":return o instanceof Blob?o:new Blob([o]);case"arraybuffer":default:return o instanceof ArrayBuffer?o:o.buffer}},SEPARATOR="",encodePayload=(o,_)=>{const $=o.length,j=new Array($);let _e=0;o.forEach((et,tt)=>{encodePacket(et,!1,rt=>{j[tt]=rt,++_e===$&&_(j.join(SEPARATOR))})})},decodePayload=(o,_)=>{const $=o.split(SEPARATOR),j=[];for(let _e=0;_e<$.length;_e++){const et=decodePacket($[_e],_);if(j.push(et),et.type==="error")break}return j};function createPacketEncoderStream(){return new TransformStream({transform(o,_){encodePacketToBinary(o,$=>{const j=$.length;let _e;if(j<126)_e=new Uint8Array(1),new DataView(_e.buffer).setUint8(0,j);else if(j<65536){_e=new Uint8Array(3);const et=new DataView(_e.buffer);et.setUint8(0,126),et.setUint16(1,j)}else{_e=new Uint8Array(9);const et=new DataView(_e.buffer);et.setUint8(0,127),et.setBigUint64(1,BigInt(j))}o.data&&typeof o.data!="string"&&(_e[0]|=128),_.enqueue(_e),_.enqueue($)})}})}let TEXT_DECODER;function totalLength(o){return o.reduce((_,$)=>_+$.length,0)}function concatChunks(o,_){if(o[0].length===_)return o.shift();const $=new Uint8Array(_);let j=0;for(let _e=0;_e<_;_e++)$[_e]=o[0][j++],j===o[0].length&&(o.shift(),j=0);return o.length&&jMath.pow(2,21)-1){rt.enqueue(ERROR_PACKET);break}_e=it*Math.pow(2,32)+ot.getUint32(4),j=3}else{if(totalLength($)<_e)break;const nt=concatChunks($,_e);rt.enqueue(decodePacket(et?nt:TEXT_DECODER.decode(nt),_)),j=0}if(_e===0||_e>o){rt.enqueue(ERROR_PACKET);break}}}})}const protocol=4;function Emitter(o){if(o)return mixin(o)}function mixin(o){for(var _ in Emitter.prototype)o[_]=Emitter.prototype[_];return o}Emitter.prototype.on=Emitter.prototype.addEventListener=function(o,_){return this._callbacks=this._callbacks||{},(this._callbacks["$"+o]=this._callbacks["$"+o]||[]).push(_),this};Emitter.prototype.once=function(o,_){function $(){this.off(o,$),_.apply(this,arguments)}return $.fn=_,this.on(o,$),this};Emitter.prototype.off=Emitter.prototype.removeListener=Emitter.prototype.removeAllListeners=Emitter.prototype.removeEventListener=function(o,_){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var $=this._callbacks["$"+o];if(!$)return this;if(arguments.length==1)return delete this._callbacks["$"+o],this;for(var j,_e=0;_e<$.length;_e++)if(j=$[_e],j===_||j.fn===_){$.splice(_e,1);break}return $.length===0&&delete this._callbacks["$"+o],this};Emitter.prototype.emit=function(o){this._callbacks=this._callbacks||{};for(var _=new Array(arguments.length-1),$=this._callbacks["$"+o],j=1;jPromise.resolve().then(_):(_,$)=>$(_,0),globalThisShim=typeof self<"u"?self:typeof window<"u"?window:Function("return this")(),defaultBinaryType="arraybuffer";function createCookieJar(){}function pick(o,..._){return _.reduce(($,j)=>(o.hasOwnProperty(j)&&($[j]=o[j]),$),{})}const NATIVE_SET_TIMEOUT=globalThisShim.setTimeout,NATIVE_CLEAR_TIMEOUT=globalThisShim.clearTimeout;function installTimerFunctions(o,_){_.useNativeTimers?(o.setTimeoutFn=NATIVE_SET_TIMEOUT.bind(globalThisShim),o.clearTimeoutFn=NATIVE_CLEAR_TIMEOUT.bind(globalThisShim)):(o.setTimeoutFn=globalThisShim.setTimeout.bind(globalThisShim),o.clearTimeoutFn=globalThisShim.clearTimeout.bind(globalThisShim))}const BASE64_OVERHEAD=1.33;function byteLength(o){return typeof o=="string"?utf8Length(o):Math.ceil((o.byteLength||o.size)*BASE64_OVERHEAD)}function utf8Length(o){let _=0,$=0;for(let j=0,_e=o.length;j<_e;j++)_=o.charCodeAt(j),_<128?$+=1:_<2048?$+=2:_<55296||_>=57344?$+=3:(j++,$+=4);return $}function randomString$1(){return Date.now().toString(36).substring(3)+Math.random().toString(36).substring(2,5)}function encode$1(o){let _="";for(let $ in o)o.hasOwnProperty($)&&(_.length&&(_+="&"),_+=encodeURIComponent($)+"="+encodeURIComponent(o[$]));return _}function decode$1(o){let _={},$=o.split("&");for(let j=0,_e=$.length;j<_e;j++){let et=$[j].split("=");_[decodeURIComponent(et[0])]=decodeURIComponent(et[1])}return _}class TransportError extends Error{constructor(_,$,j){super(_),this.description=$,this.context=j,this.type="TransportError"}}class Transport extends Emitter{constructor(_){super(),this.writable=!1,installTimerFunctions(this,_),this.opts=_,this.query=_.query,this.socket=_.socket,this.supportsBinary=!_.forceBase64}onError(_,$,j){return super.emitReserved("error",new TransportError(_,$,j)),this}open(){return this.readyState="opening",this.doOpen(),this}close(){return(this.readyState==="opening"||this.readyState==="open")&&(this.doClose(),this.onClose()),this}send(_){this.readyState==="open"&&this.write(_)}onOpen(){this.readyState="open",this.writable=!0,super.emitReserved("open")}onData(_){const $=decodePacket(_,this.socket.binaryType);this.onPacket($)}onPacket(_){super.emitReserved("packet",_)}onClose(_){this.readyState="closed",super.emitReserved("close",_)}pause(_){}createUri(_,$={}){return _+"://"+this._hostname()+this._port()+this.opts.path+this._query($)}_hostname(){const _=this.opts.hostname;return _.indexOf(":")===-1?_:"["+_+"]"}_port(){return this.opts.port&&(this.opts.secure&&Number(this.opts.port)!==443||!this.opts.secure&&Number(this.opts.port)!==80)?":"+this.opts.port:""}_query(_){const $=encode$1(_);return $.length?"?"+$:""}}class Polling extends Transport{constructor(){super(...arguments),this._polling=!1}get name(){return"polling"}doOpen(){this._poll()}pause(_){this.readyState="pausing";const $=()=>{this.readyState="paused",_()};if(this._polling||!this.writable){let j=0;this._polling&&(j++,this.once("pollComplete",function(){--j||$()})),this.writable||(j++,this.once("drain",function(){--j||$()}))}else $()}_poll(){this._polling=!0,this.doPoll(),this.emitReserved("poll")}onData(_){const $=j=>{if(this.readyState==="opening"&&j.type==="open"&&this.onOpen(),j.type==="close")return this.onClose({description:"transport closed by the server"}),!1;this.onPacket(j)};decodePayload(_,this.socket.binaryType).forEach($),this.readyState!=="closed"&&(this._polling=!1,this.emitReserved("pollComplete"),this.readyState==="open"&&this._poll())}doClose(){const _=()=>{this.write([{type:"close"}])};this.readyState==="open"?_():this.once("open",_)}write(_){this.writable=!1,encodePayload(_,$=>{this.doWrite($,()=>{this.writable=!0,this.emitReserved("drain")})})}uri(){const _=this.opts.secure?"https":"http",$=this.query||{};return this.opts.timestampRequests!==!1&&($[this.opts.timestampParam]=randomString$1()),!this.supportsBinary&&!$.sid&&($.b64=1),this.createUri(_,$)}}let value=!1;try{value=typeof XMLHttpRequest<"u"&&"withCredentials"in new XMLHttpRequest}catch(o){}const hasCORS=value;function empty(){}class BaseXHR extends Polling{constructor(_){if(super(_),typeof location<"u"){const $=location.protocol==="https:";let j=location.port;j||(j=$?"443":"80"),this.xd=typeof location<"u"&&_.hostname!==location.hostname||j!==_.port}}doWrite(_,$){const j=this.request({method:"POST",data:_});j.on("success",$),j.on("error",(_e,et)=>{this.onError("xhr post error",_e,et)})}doPoll(){const _=this.request();_.on("data",this.onData.bind(this)),_.on("error",($,j)=>{this.onError("xhr poll error",$,j)}),this.pollXhr=_}}let Request$1=class $n extends Emitter{constructor(_,$,j){super(),this.createRequest=_,installTimerFunctions(this,j),this._opts=j,this._method=j.method||"GET",this._uri=$,this._data=j.data!==void 0?j.data:null,this._create()}_create(){var _;const $=pick(this._opts,"agent","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","autoUnref");$.xdomain=!!this._opts.xd;const j=this._xhr=this.createRequest($);try{j.open(this._method,this._uri,!0);try{if(this._opts.extraHeaders){j.setDisableHeaderCheck&&j.setDisableHeaderCheck(!0);for(let _e in this._opts.extraHeaders)this._opts.extraHeaders.hasOwnProperty(_e)&&j.setRequestHeader(_e,this._opts.extraHeaders[_e])}}catch{}if(this._method==="POST")try{j.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch{}try{j.setRequestHeader("Accept","*/*")}catch{}(_=this._opts.cookieJar)===null||_===void 0||_.addCookies(j),"withCredentials"in j&&(j.withCredentials=this._opts.withCredentials),this._opts.requestTimeout&&(j.timeout=this._opts.requestTimeout),j.onreadystatechange=()=>{var _e;j.readyState===3&&((_e=this._opts.cookieJar)===null||_e===void 0||_e.parseCookies(j.getResponseHeader("set-cookie"))),j.readyState===4&&(j.status===200||j.status===1223?this._onLoad():this.setTimeoutFn(()=>{this._onError(typeof j.status=="number"?j.status:0)},0))},j.send(this._data)}catch(_e){this.setTimeoutFn(()=>{this._onError(_e)},0);return}typeof document<"u"&&(this._index=$n.requestsCount++,$n.requests[this._index]=this)}_onError(_){this.emitReserved("error",_,this._xhr),this._cleanup(!0)}_cleanup(_){if(!(typeof this._xhr>"u"||this._xhr===null)){if(this._xhr.onreadystatechange=empty,_)try{this._xhr.abort()}catch{}typeof document<"u"&&delete $n.requests[this._index],this._xhr=null}}_onLoad(){const _=this._xhr.responseText;_!==null&&(this.emitReserved("data",_),this.emitReserved("success"),this._cleanup())}abort(){this._cleanup()}};Request$1.requestsCount=0;Request$1.requests={};if(typeof document<"u"){if(typeof attachEvent=="function")attachEvent("onunload",unloadHandler);else if(typeof addEventListener=="function"){const o="onpagehide"in globalThisShim?"pagehide":"unload";addEventListener(o,unloadHandler,!1)}}function unloadHandler(){for(let o in Request$1.requests)Request$1.requests.hasOwnProperty(o)&&Request$1.requests[o].abort()}const hasXHR2=function(){const o=newRequest({xdomain:!1});return o&&o.responseType!==null}();class XHR extends BaseXHR{constructor(_){super(_);const $=_&&_.forceBase64;this.supportsBinary=hasXHR2&&!$}request(_={}){return Object.assign(_,{xd:this.xd},this.opts),new Request$1(newRequest,this.uri(),_)}}function newRequest(o){const _=o.xdomain;try{if(typeof XMLHttpRequest<"u"&&(!_||hasCORS))return new XMLHttpRequest}catch{}if(!_)try{return new globalThisShim[["Active"].concat("Object").join("X")]("Microsoft.XMLHTTP")}catch{}}const isReactNative$1=typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative";class BaseWS extends Transport{get name(){return"websocket"}doOpen(){const _=this.uri(),$=this.opts.protocols,j=isReactNative$1?{}:pick(this.opts,"agent","perMessageDeflate","pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","localAddress","protocolVersion","origin","maxPayload","family","checkServerIdentity");this.opts.extraHeaders&&(j.headers=this.opts.extraHeaders);try{this.ws=this.createSocket(_,$,j)}catch(_e){return this.emitReserved("error",_e)}this.ws.binaryType=this.socket.binaryType,this.addEventListeners()}addEventListeners(){this.ws.onopen=()=>{this.opts.autoUnref&&this.ws._socket.unref(),this.onOpen()},this.ws.onclose=_=>this.onClose({description:"websocket connection closed",context:_}),this.ws.onmessage=_=>this.onData(_.data),this.ws.onerror=_=>this.onError("websocket error",_)}write(_){this.writable=!1;for(let $=0;$<_.length;$++){const j=_[$],_e=$===_.length-1;encodePacket(j,this.supportsBinary,et=>{try{this.doWrite(j,et)}catch{}_e&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){typeof this.ws<"u"&&(this.ws.onerror=()=>{},this.ws.close(),this.ws=null)}uri(){const _=this.opts.secure?"wss":"ws",$=this.query||{};return this.opts.timestampRequests&&($[this.opts.timestampParam]=randomString$1()),this.supportsBinary||($.b64=1),this.createUri(_,$)}}const WebSocketCtor=globalThisShim.WebSocket||globalThisShim.MozWebSocket;class WS extends BaseWS{createSocket(_,$,j){return isReactNative$1?new WebSocketCtor(_,$,j):$?new WebSocketCtor(_,$):new WebSocketCtor(_)}doWrite(_,$){this.ws.send($)}}class WT extends Transport{get name(){return"webtransport"}doOpen(){try{this._transport=new WebTransport(this.createUri("https"),this.opts.transportOptions[this.name])}catch(_){return this.emitReserved("error",_)}this._transport.closed.then(()=>{this.onClose()}).catch(_=>{this.onError("webtransport error",_)}),this._transport.ready.then(()=>{this._transport.createBidirectionalStream().then(_=>{const $=createPacketDecoderStream(Number.MAX_SAFE_INTEGER,this.socket.binaryType),j=_.readable.pipeThrough($).getReader(),_e=createPacketEncoderStream();_e.readable.pipeTo(_.writable),this._writer=_e.writable.getWriter();const et=()=>{j.read().then(({done:rt,value:nt})=>{rt||(this.onPacket(nt),et())}).catch(rt=>{})};et();const tt={type:"open"};this.query.sid&&(tt.data=`{"sid":"${this.query.sid}"}`),this._writer.write(tt).then(()=>this.onOpen())})})}write(_){this.writable=!1;for(let $=0;$<_.length;$++){const j=_[$],_e=$===_.length-1;this._writer.write(j).then(()=>{_e&&nextTick(()=>{this.writable=!0,this.emitReserved("drain")},this.setTimeoutFn)})}}doClose(){var _;(_=this._transport)===null||_===void 0||_.close()}}const transports={websocket:WS,webtransport:WT,polling:XHR},re$1=/^(?:(?![^:@\/?#]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@\/?#]*)(?::([^:@\/?#]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,parts=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"];function parse(o){if(o.length>8e3)throw"URI too long";const _=o,$=o.indexOf("["),j=o.indexOf("]");$!=-1&&j!=-1&&(o=o.substring(0,$)+o.substring($,j).replace(/:/g,";")+o.substring(j,o.length));let _e=re$1.exec(o||""),et={},tt=14;for(;tt--;)et[parts[tt]]=_e[tt]||"";return $!=-1&&j!=-1&&(et.source=_,et.host=et.host.substring(1,et.host.length-1).replace(/;/g,":"),et.authority=et.authority.replace("[","").replace("]","").replace(/;/g,":"),et.ipv6uri=!0),et.pathNames=pathNames(et,et.path),et.queryKey=queryKey(et,et.query),et}function pathNames(o,_){const $=/\/{2,9}/g,j=_.replace($,"/").split("/");return(_.slice(0,1)=="/"||_.length===0)&&j.splice(0,1),_.slice(-1)=="/"&&j.splice(j.length-1,1),j}function queryKey(o,_){const $={};return _.replace(/(?:^|&)([^&=]*)=?([^&]*)/g,function(j,_e,et){_e&&($[_e]=et)}),$}const withEventListeners=typeof addEventListener=="function"&&typeof removeEventListener=="function",OFFLINE_EVENT_LISTENERS=[];withEventListeners&&addEventListener("offline",()=>{OFFLINE_EVENT_LISTENERS.forEach(o=>o())},!1);class SocketWithoutUpgrade extends Emitter{constructor(_,$){if(super(),this.binaryType=defaultBinaryType,this.writeBuffer=[],this._prevBufferLen=0,this._pingInterval=-1,this._pingTimeout=-1,this._maxPayload=-1,this._pingTimeoutTime=1/0,_&&typeof _=="object"&&($=_,_=null),_){const j=parse(_);$.hostname=j.host,$.secure=j.protocol==="https"||j.protocol==="wss",$.port=j.port,j.query&&($.query=j.query)}else $.host&&($.hostname=parse($.host).host);installTimerFunctions(this,$),this.secure=$.secure!=null?$.secure:typeof location<"u"&&location.protocol==="https:",$.hostname&&!$.port&&($.port=this.secure?"443":"80"),this.hostname=$.hostname||(typeof location<"u"?location.hostname:"localhost"),this.port=$.port||(typeof location<"u"&&location.port?location.port:this.secure?"443":"80"),this.transports=[],this._transportsByName={},$.transports.forEach(j=>{const _e=j.prototype.name;this.transports.push(_e),this._transportsByName[_e]=j}),this.opts=Object.assign({path:"/engine.io",agent:!1,withCredentials:!1,upgrade:!0,timestampParam:"t",rememberUpgrade:!1,addTrailingSlash:!0,rejectUnauthorized:!0,perMessageDeflate:{threshold:1024},transportOptions:{},closeOnBeforeunload:!1},$),this.opts.path=this.opts.path.replace(/\/$/,"")+(this.opts.addTrailingSlash?"/":""),typeof this.opts.query=="string"&&(this.opts.query=decode$1(this.opts.query)),withEventListeners&&(this.opts.closeOnBeforeunload&&(this._beforeunloadEventListener=()=>{this.transport&&(this.transport.removeAllListeners(),this.transport.close())},addEventListener("beforeunload",this._beforeunloadEventListener,!1)),this.hostname!=="localhost"&&(this._offlineEventListener=()=>{this._onClose("transport close",{description:"network connection lost"})},OFFLINE_EVENT_LISTENERS.push(this._offlineEventListener))),this.opts.withCredentials&&(this._cookieJar=void 0),this._open()}createTransport(_){const $=Object.assign({},this.opts.query);$.EIO=protocol,$.transport=_,this.id&&($.sid=this.id);const j=Object.assign({},this.opts,{query:$,socket:this,hostname:this.hostname,secure:this.secure,port:this.port},this.opts.transportOptions[_]);return new this._transportsByName[_](j)}_open(){if(this.transports.length===0){this.setTimeoutFn(()=>{this.emitReserved("error","No transports available")},0);return}const _=this.opts.rememberUpgrade&&SocketWithoutUpgrade.priorWebsocketSuccess&&this.transports.indexOf("websocket")!==-1?"websocket":this.transports[0];this.readyState="opening";const $=this.createTransport(_);$.open(),this.setTransport($)}setTransport(_){this.transport&&this.transport.removeAllListeners(),this.transport=_,_.on("drain",this._onDrain.bind(this)).on("packet",this._onPacket.bind(this)).on("error",this._onError.bind(this)).on("close",$=>this._onClose("transport close",$))}onOpen(){this.readyState="open",SocketWithoutUpgrade.priorWebsocketSuccess=this.transport.name==="websocket",this.emitReserved("open"),this.flush()}_onPacket(_){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing")switch(this.emitReserved("packet",_),this.emitReserved("heartbeat"),_.type){case"open":this.onHandshake(JSON.parse(_.data));break;case"ping":this._sendPacket("pong"),this.emitReserved("ping"),this.emitReserved("pong"),this._resetPingTimeout();break;case"error":const $=new Error("server error");$.code=_.data,this._onError($);break;case"message":this.emitReserved("data",_.data),this.emitReserved("message",_.data);break}}onHandshake(_){this.emitReserved("handshake",_),this.id=_.sid,this.transport.query.sid=_.sid,this._pingInterval=_.pingInterval,this._pingTimeout=_.pingTimeout,this._maxPayload=_.maxPayload,this.onOpen(),this.readyState!=="closed"&&this._resetPingTimeout()}_resetPingTimeout(){this.clearTimeoutFn(this._pingTimeoutTimer);const _=this._pingInterval+this._pingTimeout;this._pingTimeoutTime=Date.now()+_,this._pingTimeoutTimer=this.setTimeoutFn(()=>{this._onClose("ping timeout")},_),this.opts.autoUnref&&this._pingTimeoutTimer.unref()}_onDrain(){this.writeBuffer.splice(0,this._prevBufferLen),this._prevBufferLen=0,this.writeBuffer.length===0?this.emitReserved("drain"):this.flush()}flush(){if(this.readyState!=="closed"&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length){const _=this._getWritablePackets();this.transport.send(_),this._prevBufferLen=_.length,this.emitReserved("flush")}}_getWritablePackets(){if(!(this._maxPayload&&this.transport.name==="polling"&&this.writeBuffer.length>1))return this.writeBuffer;let $=1;for(let j=0;j0&&$>this._maxPayload)return this.writeBuffer.slice(0,j);$+=2}return this.writeBuffer}_hasPingExpired(){if(!this._pingTimeoutTime)return!0;const _=Date.now()>this._pingTimeoutTime;return _&&(this._pingTimeoutTime=0,nextTick(()=>{this._onClose("ping timeout")},this.setTimeoutFn)),_}write(_,$,j){return this._sendPacket("message",_,$,j),this}send(_,$,j){return this._sendPacket("message",_,$,j),this}_sendPacket(_,$,j,_e){if(typeof $=="function"&&(_e=$,$=void 0),typeof j=="function"&&(_e=j,j=null),this.readyState==="closing"||this.readyState==="closed")return;j=j||{},j.compress=j.compress!==!1;const et={type:_,data:$,options:j};this.emitReserved("packetCreate",et),this.writeBuffer.push(et),_e&&this.once("flush",_e),this.flush()}close(){const _=()=>{this._onClose("forced close"),this.transport.close()},$=()=>{this.off("upgrade",$),this.off("upgradeError",$),_()},j=()=>{this.once("upgrade",$),this.once("upgradeError",$)};return(this.readyState==="opening"||this.readyState==="open")&&(this.readyState="closing",this.writeBuffer.length?this.once("drain",()=>{this.upgrading?j():_()}):this.upgrading?j():_()),this}_onError(_){if(SocketWithoutUpgrade.priorWebsocketSuccess=!1,this.opts.tryAllTransports&&this.transports.length>1&&this.readyState==="opening")return this.transports.shift(),this._open();this.emitReserved("error",_),this._onClose("transport error",_)}_onClose(_,$){if(this.readyState==="opening"||this.readyState==="open"||this.readyState==="closing"){if(this.clearTimeoutFn(this._pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),withEventListeners&&(this._beforeunloadEventListener&&removeEventListener("beforeunload",this._beforeunloadEventListener,!1),this._offlineEventListener)){const j=OFFLINE_EVENT_LISTENERS.indexOf(this._offlineEventListener);j!==-1&&OFFLINE_EVENT_LISTENERS.splice(j,1)}this.readyState="closed",this.id=null,this.emitReserved("close",_,$),this.writeBuffer=[],this._prevBufferLen=0}}}SocketWithoutUpgrade.protocol=protocol;class SocketWithUpgrade extends SocketWithoutUpgrade{constructor(){super(...arguments),this._upgrades=[]}onOpen(){if(super.onOpen(),this.readyState==="open"&&this.opts.upgrade)for(let _=0;_{j||($.send([{type:"ping",data:"probe"}]),$.once("packet",st=>{if(!j)if(st.type==="pong"&&st.data==="probe"){if(this.upgrading=!0,this.emitReserved("upgrading",$),!$)return;SocketWithoutUpgrade.priorWebsocketSuccess=$.name==="websocket",this.transport.pause(()=>{j||this.readyState!=="closed"&&(it(),this.setTransport($),$.send([{type:"upgrade"}]),this.emitReserved("upgrade",$),$=null,this.upgrading=!1,this.flush())})}else{const at=new Error("probe error");at.transport=$.name,this.emitReserved("upgradeError",at)}}))};function et(){j||(j=!0,it(),$.close(),$=null)}const tt=st=>{const at=new Error("probe error: "+st);at.transport=$.name,et(),this.emitReserved("upgradeError",at)};function rt(){tt("transport closed")}function nt(){tt("socket closed")}function ot(st){$&&st.name!==$.name&&et()}const it=()=>{$.removeListener("open",_e),$.removeListener("error",tt),$.removeListener("close",rt),this.off("close",nt),this.off("upgrading",ot)};$.once("open",_e),$.once("error",tt),$.once("close",rt),this.once("close",nt),this.once("upgrading",ot),this._upgrades.indexOf("webtransport")!==-1&&_!=="webtransport"?this.setTimeoutFn(()=>{j||$.open()},200):$.open()}onHandshake(_){this._upgrades=this._filterUpgrades(_.upgrades),super.onHandshake(_)}_filterUpgrades(_){const $=[];for(let j=0;j<_.length;j++)~this.transports.indexOf(_[j])&&$.push(_[j]);return $}}let Socket$1=class extends SocketWithUpgrade{constructor(_,$={}){const j=typeof _=="object"?_:$;(!j.transports||j.transports&&typeof j.transports[0]=="string")&&(j.transports=(j.transports||["polling","websocket","webtransport"]).map(_e=>transports[_e]).filter(_e=>!!_e)),super(_,j)}};function url(o,_="",$){let j=o;$=$||typeof location<"u"&&location,o==null&&(o=$.protocol+"//"+$.host),typeof o=="string"&&(o.charAt(0)==="/"&&(o.charAt(1)==="/"?o=$.protocol+o:o=$.host+o),/^(https?|wss?):\/\//.test(o)||(typeof $<"u"?o=$.protocol+"//"+o:o="https://"+o),j=parse(o)),j.port||(/^(http|ws)$/.test(j.protocol)?j.port="80":/^(http|ws)s$/.test(j.protocol)&&(j.port="443")),j.path=j.path||"/";const et=j.host.indexOf(":")!==-1?"["+j.host+"]":j.host;return j.id=j.protocol+"://"+et+":"+j.port+_,j.href=j.protocol+"://"+et+($&&$.port===j.port?"":":"+j.port),j}const withNativeArrayBuffer=typeof ArrayBuffer=="function",isView=o=>typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView(o):o.buffer instanceof ArrayBuffer,toString$2=Object.prototype.toString,withNativeBlob=typeof Blob=="function"||typeof Blob<"u"&&toString$2.call(Blob)==="[object BlobConstructor]",withNativeFile=typeof File=="function"||typeof File<"u"&&toString$2.call(File)==="[object FileConstructor]";function isBinary(o){return withNativeArrayBuffer&&(o instanceof ArrayBuffer||isView(o))||withNativeBlob&&o instanceof Blob||withNativeFile&&o instanceof File}function hasBinary(o,_){if(!o||typeof o!="object")return!1;if(Array.isArray(o)){for(let $=0,j=o.length;$=0&&o.num<_.length)return _[o.num];throw new Error("illegal attachments")}else if(Array.isArray(o))for(let $=0;${delete this.acks[_];for(let rt=0;rt{this.io.clearTimeoutFn(et),$.apply(this,rt)};tt.withError=!0,this.acks[_]=tt}emitWithAck(_,...$){return new Promise((j,_e)=>{const et=(tt,rt)=>tt?_e(tt):j(rt);et.withError=!0,$.push(et),this.emit(_,...$)})}_addToQueue(_){let $;typeof _[_.length-1]=="function"&&($=_.pop());const j={id:this._queueSeq++,tryCount:0,pending:!1,args:_,flags:Object.assign({fromQueue:!0},this.flags)};_.push((_e,...et)=>(this._queue[0],_e!==null?j.tryCount>this._opts.retries&&(this._queue.shift(),$&&$(_e)):(this._queue.shift(),$&&$(null,...et)),j.pending=!1,this._drainQueue())),this._queue.push(j),this._drainQueue()}_drainQueue(_=!1){if(!this.connected||this._queue.length===0)return;const $=this._queue[0];$.pending&&!_||($.pending=!0,$.tryCount++,this.flags=$.flags,this.emit.apply(this,$.args))}packet(_){_.nsp=this.nsp,this.io._packet(_)}onopen(){typeof this.auth=="function"?this.auth(_=>{this._sendConnectPacket(_)}):this._sendConnectPacket(this.auth)}_sendConnectPacket(_){this.packet({type:PacketType.CONNECT,data:this._pid?Object.assign({pid:this._pid,offset:this._lastOffset},_):_})}onerror(_){this.connected||this.emitReserved("connect_error",_)}onclose(_,$){this.connected=!1,delete this.id,this.emitReserved("disconnect",_,$),this._clearAcks()}_clearAcks(){Object.keys(this.acks).forEach(_=>{if(!this.sendBuffer.some(j=>String(j.id)===_)){const j=this.acks[_];delete this.acks[_],j.withError&&j.call(this,new Error("socket has been disconnected"))}})}onpacket(_){if(_.nsp===this.nsp)switch(_.type){case PacketType.CONNECT:_.data&&_.data.sid?this.onconnect(_.data.sid,_.data.pid):this.emitReserved("connect_error",new Error("It seems you are trying to reach a Socket.IO server in v2.x with a v3.x client, but they are not compatible (more information here: https://socket.io/docs/v3/migrating-from-2-x-to-3-0/)"));break;case PacketType.EVENT:case PacketType.BINARY_EVENT:this.onevent(_);break;case PacketType.ACK:case PacketType.BINARY_ACK:this.onack(_);break;case PacketType.DISCONNECT:this.ondisconnect();break;case PacketType.CONNECT_ERROR:this.destroy();const j=new Error(_.data.message);j.data=_.data.data,this.emitReserved("connect_error",j);break}}onevent(_){const $=_.data||[];_.id!=null&&$.push(this.ack(_.id)),this.connected?this.emitEvent($):this.receiveBuffer.push(Object.freeze($))}emitEvent(_){if(this._anyListeners&&this._anyListeners.length){const $=this._anyListeners.slice();for(const j of $)j.apply(this,_)}super.emit.apply(this,_),this._pid&&_.length&&typeof _[_.length-1]=="string"&&(this._lastOffset=_[_.length-1])}ack(_){const $=this;let j=!1;return function(..._e){j||(j=!0,$.packet({type:PacketType.ACK,id:_,data:_e}))}}onack(_){const $=this.acks[_.id];typeof $=="function"&&(delete this.acks[_.id],$.withError&&_.data.unshift(null),$.apply(this,_.data))}onconnect(_,$){this.id=_,this.recovered=$&&this._pid===$,this._pid=$,this.connected=!0,this.emitBuffered(),this._drainQueue(!0),this.emitReserved("connect")}emitBuffered(){this.receiveBuffer.forEach(_=>this.emitEvent(_)),this.receiveBuffer=[],this.sendBuffer.forEach(_=>{this.notifyOutgoingListeners(_),this.packet(_)}),this.sendBuffer=[]}ondisconnect(){this.destroy(),this.onclose("io server disconnect")}destroy(){this.subs&&(this.subs.forEach(_=>_()),this.subs=void 0),this.io._destroy(this)}disconnect(){return this.connected&&this.packet({type:PacketType.DISCONNECT}),this.destroy(),this.connected&&this.onclose("io client disconnect"),this}close(){return this.disconnect()}compress(_){return this.flags.compress=_,this}get volatile(){return this.flags.volatile=!0,this}timeout(_){return this.flags.timeout=_,this}onAny(_){return this._anyListeners=this._anyListeners||[],this._anyListeners.push(_),this}prependAny(_){return this._anyListeners=this._anyListeners||[],this._anyListeners.unshift(_),this}offAny(_){if(!this._anyListeners)return this;if(_){const $=this._anyListeners;for(let j=0;j<$.length;j++)if(_===$[j])return $.splice(j,1),this}else this._anyListeners=[];return this}listenersAny(){return this._anyListeners||[]}onAnyOutgoing(_){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.push(_),this}prependAnyOutgoing(_){return this._anyOutgoingListeners=this._anyOutgoingListeners||[],this._anyOutgoingListeners.unshift(_),this}offAnyOutgoing(_){if(!this._anyOutgoingListeners)return this;if(_){const $=this._anyOutgoingListeners;for(let j=0;j<$.length;j++)if(_===$[j])return $.splice(j,1),this}else this._anyOutgoingListeners=[];return this}listenersAnyOutgoing(){return this._anyOutgoingListeners||[]}notifyOutgoingListeners(_){if(this._anyOutgoingListeners&&this._anyOutgoingListeners.length){const $=this._anyOutgoingListeners.slice();for(const j of $)j.apply(this,_.data)}}}function Backoff(o){o=o||{},this.ms=o.min||100,this.max=o.max||1e4,this.factor=o.factor||2,this.jitter=o.jitter>0&&o.jitter<=1?o.jitter:0,this.attempts=0}Backoff.prototype.duration=function(){var o=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var _=Math.random(),$=Math.floor(_*this.jitter*o);o=Math.floor(_*10)&1?o+$:o-$}return Math.min(o,this.max)|0};Backoff.prototype.reset=function(){this.attempts=0};Backoff.prototype.setMin=function(o){this.ms=o};Backoff.prototype.setMax=function(o){this.max=o};Backoff.prototype.setJitter=function(o){this.jitter=o};class Manager extends Emitter{constructor(_,$){var j;super(),this.nsps={},this.subs=[],_&&typeof _=="object"&&($=_,_=void 0),$=$||{},$.path=$.path||"/socket.io",this.opts=$,installTimerFunctions(this,$),this.reconnection($.reconnection!==!1),this.reconnectionAttempts($.reconnectionAttempts||1/0),this.reconnectionDelay($.reconnectionDelay||1e3),this.reconnectionDelayMax($.reconnectionDelayMax||5e3),this.randomizationFactor((j=$.randomizationFactor)!==null&&j!==void 0?j:.5),this.backoff=new Backoff({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout($.timeout==null?2e4:$.timeout),this._readyState="closed",this.uri=_;const _e=$.parser||parser;this.encoder=new _e.Encoder,this.decoder=new _e.Decoder,this._autoConnect=$.autoConnect!==!1,this._autoConnect&&this.open()}reconnection(_){return arguments.length?(this._reconnection=!!_,_||(this.skipReconnect=!0),this):this._reconnection}reconnectionAttempts(_){return _===void 0?this._reconnectionAttempts:(this._reconnectionAttempts=_,this)}reconnectionDelay(_){var $;return _===void 0?this._reconnectionDelay:(this._reconnectionDelay=_,($=this.backoff)===null||$===void 0||$.setMin(_),this)}randomizationFactor(_){var $;return _===void 0?this._randomizationFactor:(this._randomizationFactor=_,($=this.backoff)===null||$===void 0||$.setJitter(_),this)}reconnectionDelayMax(_){var $;return _===void 0?this._reconnectionDelayMax:(this._reconnectionDelayMax=_,($=this.backoff)===null||$===void 0||$.setMax(_),this)}timeout(_){return arguments.length?(this._timeout=_,this):this._timeout}maybeReconnectOnOpen(){!this._reconnecting&&this._reconnection&&this.backoff.attempts===0&&this.reconnect()}open(_){if(~this._readyState.indexOf("open"))return this;this.engine=new Socket$1(this.uri,this.opts);const $=this.engine,j=this;this._readyState="opening",this.skipReconnect=!1;const _e=on($,"open",function(){j.onopen(),_&&_()}),et=rt=>{this.cleanup(),this._readyState="closed",this.emitReserved("error",rt),_?_(rt):this.maybeReconnectOnOpen()},tt=on($,"error",et);if(this._timeout!==!1){const rt=this._timeout,nt=this.setTimeoutFn(()=>{_e(),et(new Error("timeout")),$.close()},rt);this.opts.autoUnref&&nt.unref(),this.subs.push(()=>{this.clearTimeoutFn(nt)})}return this.subs.push(_e),this.subs.push(tt),this}connect(_){return this.open(_)}onopen(){this.cleanup(),this._readyState="open",this.emitReserved("open");const _=this.engine;this.subs.push(on(_,"ping",this.onping.bind(this)),on(_,"data",this.ondata.bind(this)),on(_,"error",this.onerror.bind(this)),on(_,"close",this.onclose.bind(this)),on(this.decoder,"decoded",this.ondecoded.bind(this)))}onping(){this.emitReserved("ping")}ondata(_){try{this.decoder.add(_)}catch($){this.onclose("parse error",$)}}ondecoded(_){nextTick(()=>{this.emitReserved("packet",_)},this.setTimeoutFn)}onerror(_){this.emitReserved("error",_)}socket(_,$){let j=this.nsps[_];return j?this._autoConnect&&!j.active&&j.connect():(j=new Socket(this,_,$),this.nsps[_]=j),j}_destroy(_){const $=Object.keys(this.nsps);for(const j of $)if(this.nsps[j].active)return;this._close()}_packet(_){const $=this.encoder.encode(_);for(let j=0;j<$.length;j++)this.engine.write($[j],_.options)}cleanup(){this.subs.forEach(_=>_()),this.subs.length=0,this.decoder.destroy()}_close(){this.skipReconnect=!0,this._reconnecting=!1,this.onclose("forced close")}disconnect(){return this._close()}onclose(_,$){var j;this.cleanup(),(j=this.engine)===null||j===void 0||j.close(),this.backoff.reset(),this._readyState="closed",this.emitReserved("close",_,$),this._reconnection&&!this.skipReconnect&&this.reconnect()}reconnect(){if(this._reconnecting||this.skipReconnect)return this;const _=this;if(this.backoff.attempts>=this._reconnectionAttempts)this.backoff.reset(),this.emitReserved("reconnect_failed"),this._reconnecting=!1;else{const $=this.backoff.duration();this._reconnecting=!0;const j=this.setTimeoutFn(()=>{_.skipReconnect||(this.emitReserved("reconnect_attempt",_.backoff.attempts),!_.skipReconnect&&_.open(_e=>{_e?(_._reconnecting=!1,_.reconnect(),this.emitReserved("reconnect_error",_e)):_.onreconnect()}))},$);this.opts.autoUnref&&j.unref(),this.subs.push(()=>{this.clearTimeoutFn(j)})}}onreconnect(){const _=this.backoff.attempts;this._reconnecting=!1,this.backoff.reset(),this.emitReserved("reconnect",_)}}const cache={};function lookup(o,_){typeof o=="object"&&(_=o,o=void 0),_=_||{};const $=url(o,_.path||"/socket.io"),j=$.source,_e=$.id,et=$.path,tt=cache[_e]&&et in cache[_e].nsps,rt=_.forceNew||_["force new connection"]||_.multiplex===!1||tt;let nt;return rt?nt=new Manager(j,_):(cache[_e]||(cache[_e]=new Manager(j,_)),nt=cache[_e]),$.query&&!_.query&&(_.query=$.queryKey),nt.socket($.path,_)}Object.assign(lookup,{Manager,Socket,io:lookup,connect:lookup});var log$1=log$3.getLogger("SecurePubSub");class SecurePubSub{constructor(_={}){_defineProperty$z(this,"options",void 0),_defineProperty$z(this,"SOCKET_CONN",null),this.options=_,this.options.timeout=_.timeout||600,this.options.serverUrl=_.serverUrl||SESSION_SERVER_API_URL,this.options.socketUrl=_.socketUrl||SESSION_SERVER_SOCKET_URL,this.options.enableLogging=_.enableLogging||!1,this.options.namespace=_.namespace||"",this.options.sameIpCheck=_.sameIpCheck||!1,this.options.sameOriginCheck=_.sameOriginCheck||!1,this.options.enableLogging?log$1.enableAll():log$1.disableAll()}static setLogLevel(_){log$1.setLevel(_),setLogLevel(_)}async publish(_,$){const j=keccak256$1(Buffer$3.from(_,"utf8")),_e=await encryptData(j.toString("hex"),$),et=await sign$1(j,keccak256$1(Buffer$3.from(_e,"utf8"))),tt={key:getPublic(j).toString("hex"),data:_e,signature:et.toString("hex"),timeout:this.options.timeout,namespace:this.options.namespace,sameIpCheck:this.options.sameIpCheck,sameOriginCheck:this.options.sameOriginCheck};return post(`${this.options.serverUrl}/channel/set`,tt)}async subscribe(_){let $=!0;const j=keccak256$1(Buffer$3.from(_,"utf8")),_e=getPublic(j).toString("hex"),et=this.getSocketConnection();et.connected?(log$1.debug("already connected with socket"),et.emit("check_auth_status",_e,{namespace:this.options.namespace,sameIpCheck:this.options.sameIpCheck,sameOriginCheck:this.options.sameOriginCheck})):et.once("connect",()=>{log$1.debug("connected with socket"),et.emit("check_auth_status",_e,{namespace:this.options.namespace,sameIpCheck:this.options.sameIpCheck,sameOriginCheck:this.options.sameOriginCheck})});const tt=()=>{et.once("connect",async()=>{log$1.debug("connected with socket using reconnect"),$&&et.emit("check_auth_status",_e,{namespace:this.options.namespace,sameIpCheck:this.options.sameIpCheck,sameOriginCheck:this.options.sameOriginCheck})})},rt=()=>{$||document.removeEventListener("visibilitychange",rt),!et.connected&&document.visibilityState==="visible"&&tt()},nt=()=>{log$1.debug("socket disconnected",$),$?(log$1.error("socket disconnected unexpectedly, reconnecting socket"),tt()):et.removeListener("disconnect",nt)};et.on("disconnect",nt);const ot=new Promise((it,st)=>{const at=async lt=>{try{const ct=await decryptData(j.toString("hex"),lt);log$1.info("got data",ct),it(ct)}catch(ct){log$1.error(ct),st(ct)}finally{$=!1,document.removeEventListener("visibilitychange",rt)}};log$1.info("listening to",`${_e}_success`),et.once(`${_e}_success`,at)});return typeof document<"u"&&document.addEventListener("visibilitychange",rt),ot}cleanup(){this.SOCKET_CONN&&(this.SOCKET_CONN.disconnect(),this.SOCKET_CONN=null)}getSocketConnection(){if(this.SOCKET_CONN)return this.SOCKET_CONN;const _=lookup(this.options.socketUrl,{transports:["websocket","polling"],withCredentials:!0,reconnectionDelayMax:1e4,reconnectionAttempts:10});return _.on("connect_error",$=>{_.io.opts.transports=["polling","websocket"],log$1.error("connect error",$)}),_.on("connect",async()=>{const{engine:$}=_.io;log$1.debug("initially connected to",$.transport.name),$.once("upgrade",()=>{log$1.debug("upgraded",$.transport.name)}),$.once("close",j=>{log$1.debug("connection closed",j)})}),_.on("error",$=>{log$1.error("socket errored",$),_.disconnect()}),this.SOCKET_CONN=_,this.SOCKET_CONN}}const BROWSER_ALIASES_MAP={AmazonBot:"amazonbot","Amazon Silk":"amazon_silk","Android Browser":"android",BaiduSpider:"baiduspider",Bada:"bada",BingCrawler:"bingcrawler",BlackBerry:"blackberry","ChatGPT-User":"chatgpt_user",Chrome:"chrome",ClaudeBot:"claudebot",Chromium:"chromium",Diffbot:"diffbot",DuckDuckBot:"duckduckbot",Electron:"electron",Epiphany:"epiphany",FacebookExternalHit:"facebookexternalhit",Firefox:"firefox",Focus:"focus",Generic:"generic","Google Search":"google_search",Googlebot:"googlebot",GPTBot:"gptbot","Internet Explorer":"ie",InternetArchiveCrawler:"internetarchivecrawler","K-Meleon":"k_meleon",LibreWolf:"librewolf",Maxthon:"maxthon","Meta-ExternalAds":"meta_externalads","Meta-ExternalAgent":"meta_externalagent","Meta-ExternalFetcher":"meta_externalfetcher","Meta-WebIndexer":"meta_webindexer","Microsoft Edge":"edge","MZ Browser":"mz","NAVER Whale Browser":"naver","OAI-SearchBot":"oai_searchbot",Omgilibot:"omgilibot",Opera:"opera","Opera Coast":"opera_coast","Pale Moon":"pale_moon",PerplexityBot:"perplexitybot","Perplexity-User":"perplexity_user",PhantomJS:"phantomjs",PingdomBot:"pingdombot",Puffin:"puffin",QQ:"qq",QQLite:"qqlite",QupZilla:"qupzilla",Roku:"roku",Safari:"safari",Sailfish:"sailfish","Samsung Internet for Android":"samsung_internet",SeaMonkey:"seamonkey",Sleipnir:"sleipnir","Sogou Browser":"sogou",Swing:"swing",Tizen:"tizen","UC Browser":"uc",Vivaldi:"vivaldi","WebOS Browser":"webos",WeChat:"wechat",YahooSlurp:"yahooslurp","Yandex Browser":"yandex",YandexBot:"yandexbot",YouBot:"youbot"},BROWSER_MAP={amazonbot:"AmazonBot",amazon_silk:"Amazon Silk",android:"Android Browser",baiduspider:"BaiduSpider",bada:"Bada",bingcrawler:"BingCrawler",blackberry:"BlackBerry",chatgpt_user:"ChatGPT-User",chrome:"Chrome",claudebot:"ClaudeBot",chromium:"Chromium",diffbot:"Diffbot",duckduckbot:"DuckDuckBot",edge:"Microsoft Edge",electron:"Electron",epiphany:"Epiphany",facebookexternalhit:"FacebookExternalHit",firefox:"Firefox",focus:"Focus",generic:"Generic",google_search:"Google Search",googlebot:"Googlebot",gptbot:"GPTBot",ie:"Internet Explorer",internetarchivecrawler:"InternetArchiveCrawler",k_meleon:"K-Meleon",librewolf:"LibreWolf",maxthon:"Maxthon",meta_externalads:"Meta-ExternalAds",meta_externalagent:"Meta-ExternalAgent",meta_externalfetcher:"Meta-ExternalFetcher",meta_webindexer:"Meta-WebIndexer",mz:"MZ Browser",naver:"NAVER Whale Browser",oai_searchbot:"OAI-SearchBot",omgilibot:"Omgilibot",opera:"Opera",opera_coast:"Opera Coast",pale_moon:"Pale Moon",perplexitybot:"PerplexityBot",perplexity_user:"Perplexity-User",phantomjs:"PhantomJS",pingdombot:"PingdomBot",puffin:"Puffin",qq:"QQ Browser",qqlite:"QQ Browser Lite",qupzilla:"QupZilla",roku:"Roku",safari:"Safari",sailfish:"Sailfish",samsung_internet:"Samsung Internet for Android",seamonkey:"SeaMonkey",sleipnir:"Sleipnir",sogou:"Sogou Browser",swing:"Swing",tizen:"Tizen",uc:"UC Browser",vivaldi:"Vivaldi",webos:"WebOS Browser",wechat:"WeChat",yahooslurp:"YahooSlurp",yandex:"Yandex Browser",yandexbot:"YandexBot",youbot:"YouBot"},PLATFORMS_MAP={bot:"bot",desktop:"desktop",mobile:"mobile",tablet:"tablet",tv:"tv"},OS_MAP={Android:"Android",Bada:"Bada",BlackBerry:"BlackBerry",ChromeOS:"Chrome OS",HarmonyOS:"HarmonyOS",iOS:"iOS",Linux:"Linux",MacOS:"macOS",PlayStation4:"PlayStation 4",Roku:"Roku",Tizen:"Tizen",WebOS:"WebOS",Windows:"Windows",WindowsPhone:"Windows Phone"},ENGINE_MAP={Blink:"Blink",EdgeHTML:"EdgeHTML",Gecko:"Gecko",Presto:"Presto",Trident:"Trident",WebKit:"WebKit"};class Utils{static getFirstMatch(_,$){const j=$.match(_);return j&&j.length>0&&j[1]||""}static getSecondMatch(_,$){const j=$.match(_);return j&&j.length>1&&j[2]||""}static matchAndReturnConst(_,$,j){if(_.test($))return j}static getWindowsVersionName(_){switch(_){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}}static getMacOSVersionName(_){const $=_.split(".").splice(0,2).map(et=>parseInt(et,10)||0);$.push(0);const j=$[0],_e=$[1];if(j===10)switch(_e){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}switch(j){case 11:return"Big Sur";case 12:return"Monterey";case 13:return"Ventura";case 14:return"Sonoma";case 15:return"Sequoia";default:return}}static getAndroidVersionName(_){const $=_.split(".").splice(0,2).map(j=>parseInt(j,10)||0);if($.push(0),!($[0]===1&&$[1]<5)){if($[0]===1&&$[1]<6)return"Cupcake";if($[0]===1&&$[1]>=6)return"Donut";if($[0]===2&&$[1]<2)return"Eclair";if($[0]===2&&$[1]===2)return"Froyo";if($[0]===2&&$[1]>2)return"Gingerbread";if($[0]===3)return"Honeycomb";if($[0]===4&&$[1]<1)return"Ice Cream Sandwich";if($[0]===4&&$[1]<4)return"Jelly Bean";if($[0]===4&&$[1]>=4)return"KitKat";if($[0]===5)return"Lollipop";if($[0]===6)return"Marshmallow";if($[0]===7)return"Nougat";if($[0]===8)return"Oreo";if($[0]===9)return"Pie"}}static getVersionPrecision(_){return _.split(".").length}static compareVersions(_,$,j=!1){const _e=Utils.getVersionPrecision(_),et=Utils.getVersionPrecision($);let tt=Math.max(_e,et),rt=0;const nt=Utils.map([_,$],ot=>{const it=tt-Utils.getVersionPrecision(ot),st=ot+new Array(it+1).join(".0");return Utils.map(st.split("."),at=>new Array(20-at.length).join("0")+at).reverse()});for(j&&(rt=tt-Math.min(_e,et)),tt-=1;tt>=rt;){if(nt[0][tt]>nt[1][tt])return 1;if(nt[0][tt]===nt[1][tt]){if(tt===rt)return 0;tt-=1}else if(nt[0][tt]{j[nt]=tt[nt]})}return _}static getBrowserAlias(_){return BROWSER_ALIASES_MAP[_]}static getBrowserTypeByAlias(_){return BROWSER_MAP[_]||""}}const commonVersionIdentifier=/version\/(\d+(\.?_?\d+)+)/i,browsersList=[{test:[/gptbot/i],describe(o){const _={name:"GPTBot"},$=Utils.getFirstMatch(/gptbot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/chatgpt-user/i],describe(o){const _={name:"ChatGPT-User"},$=Utils.getFirstMatch(/chatgpt-user\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/oai-searchbot/i],describe(o){const _={name:"OAI-SearchBot"},$=Utils.getFirstMatch(/oai-searchbot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(o){const _={name:"ClaudeBot"},$=Utils.getFirstMatch(/(?:claudebot|claude-web|claude-user|claude-searchbot)\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/omgilibot/i,/webzio-extended/i],describe(o){const _={name:"Omgilibot"},$=Utils.getFirstMatch(/(?:omgilibot|webzio-extended)\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/diffbot/i],describe(o){const _={name:"Diffbot"},$=Utils.getFirstMatch(/diffbot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/perplexitybot/i],describe(o){const _={name:"PerplexityBot"},$=Utils.getFirstMatch(/perplexitybot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/perplexity-user/i],describe(o){const _={name:"Perplexity-User"},$=Utils.getFirstMatch(/perplexity-user\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/youbot/i],describe(o){const _={name:"YouBot"},$=Utils.getFirstMatch(/youbot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/meta-webindexer/i],describe(o){const _={name:"Meta-WebIndexer"},$=Utils.getFirstMatch(/meta-webindexer\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/meta-externalads/i],describe(o){const _={name:"Meta-ExternalAds"},$=Utils.getFirstMatch(/meta-externalads\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/meta-externalagent/i],describe(o){const _={name:"Meta-ExternalAgent"},$=Utils.getFirstMatch(/meta-externalagent\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/meta-externalfetcher/i],describe(o){const _={name:"Meta-ExternalFetcher"},$=Utils.getFirstMatch(/meta-externalfetcher\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/googlebot/i],describe(o){const _={name:"Googlebot"},$=Utils.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/amazonbot/i],describe(o){const _={name:"AmazonBot"},$=Utils.getFirstMatch(/amazonbot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/bingbot/i],describe(o){const _={name:"BingCrawler"},$=Utils.getFirstMatch(/bingbot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/baiduspider/i],describe(o){const _={name:"BaiduSpider"},$=Utils.getFirstMatch(/baiduspider\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/duckduckbot/i],describe(o){const _={name:"DuckDuckBot"},$=Utils.getFirstMatch(/duckduckbot\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/ia_archiver/i],describe(o){const _={name:"InternetArchiveCrawler"},$=Utils.getFirstMatch(/ia_archiver\/(\d+(\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe(){return{name:"FacebookExternalHit"}}},{test:[/yahoo!?[\s/]*slurp/i],describe(){return{name:"YahooSlurp"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe(){return{name:"YandexBot"}}},{test:[/pingdom/i],describe(){return{name:"PingdomBot"}}},{test:[/opera/i],describe(o){const _={name:"Opera"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/opr\/|opios/i],describe(o){const _={name:"Opera"},$=Utils.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/SamsungBrowser/i],describe(o){const _={name:"Samsung Internet for Android"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/Whale/i],describe(o){const _={name:"NAVER Whale Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/PaleMoon/i],describe(o){const _={name:"Pale Moon"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:PaleMoon)[\s/](\d+(?:\.\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/MZBrowser/i],describe(o){const _={name:"MZ Browser"},$=Utils.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/focus/i],describe(o){const _={name:"Focus"},$=Utils.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/swing/i],describe(o){const _={name:"Swing"},$=Utils.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/coast/i],describe(o){const _={name:"Opera Coast"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe(o){const _={name:"Opera Touch"},$=Utils.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/yabrowser/i],describe(o){const _={name:"Yandex Browser"},$=Utils.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/ucbrowser/i],describe(o){const _={name:"UC Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/Maxthon|mxios/i],describe(o){const _={name:"Maxthon"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/epiphany/i],describe(o){const _={name:"Epiphany"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/puffin/i],describe(o){const _={name:"Puffin"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/sleipnir/i],describe(o){const _={name:"Sleipnir"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/k-meleon/i],describe(o){const _={name:"K-Meleon"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/micromessenger/i],describe(o){const _={name:"WeChat"},$=Utils.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/qqbrowser/i],describe(o){const _={name:/qqbrowserlite/i.test(o)?"QQ Browser Lite":"QQ Browser"},$=Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/msie|trident/i],describe(o){const _={name:"Internet Explorer"},$=Utils.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/\sedg\//i],describe(o){const _={name:"Microsoft Edge"},$=Utils.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/edg([ea]|ios)/i],describe(o){const _={name:"Microsoft Edge"},$=Utils.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/vivaldi/i],describe(o){const _={name:"Vivaldi"},$=Utils.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/seamonkey/i],describe(o){const _={name:"SeaMonkey"},$=Utils.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/sailfish/i],describe(o){const _={name:"Sailfish"},$=Utils.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,o);return $&&(_.version=$),_}},{test:[/silk/i],describe(o){const _={name:"Amazon Silk"},$=Utils.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/phantom/i],describe(o){const _={name:"PhantomJS"},$=Utils.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/slimerjs/i],describe(o){const _={name:"SlimerJS"},$=Utils.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(o){const _={name:"BlackBerry"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/(web|hpw)[o0]s/i],describe(o){const _={name:"WebOS Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,o)||Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/bada/i],describe(o){const _={name:"Bada"},$=Utils.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/tizen/i],describe(o){const _={name:"Tizen"},$=Utils.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/qupzilla/i],describe(o){const _={name:"QupZilla"},$=Utils.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/librewolf/i],describe(o){const _={name:"LibreWolf"},$=Utils.getFirstMatch(/(?:librewolf)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/firefox|iceweasel|fxios/i],describe(o){const _={name:"Firefox"},$=Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/electron/i],describe(o){const _={name:"Electron"},$=Utils.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/sogoumobilebrowser/i,/metasr/i,/se 2\.[x]/i],describe(o){const _={name:"Sogou Browser"},$=Utils.getFirstMatch(/(?:sogoumobilebrowser)[\s/](\d+(\.?_?\d+)+)/i,o),j=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,o),_e=Utils.getFirstMatch(/se ([\d.]+)x/i,o),et=$||j||_e;return et&&(_.version=et),_}},{test:[/MiuiBrowser/i],describe(o){const _={name:"Miui"},$=Utils.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/chromium/i],describe(o){const _={name:"Chromium"},$=Utils.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,o)||Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/chrome|crios|crmo/i],describe(o){const _={name:"Chrome"},$=Utils.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/GSA/i],describe(o){const _={name:"Google Search"},$=Utils.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test(o){const _=!o.test(/like android/i),$=o.test(/android/i);return _&&$},describe(o){const _={name:"Android Browser"},$=Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/playstation 4/i],describe(o){const _={name:"PlayStation 4"},$=Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/safari|applewebkit/i],describe(o){const _={name:"Safari"},$=Utils.getFirstMatch(commonVersionIdentifier,o);return $&&(_.version=$),_}},{test:[/.*/i],describe(o){const _=/^(.*)\/(.*) /,$=/^(.*)\/(.*)[ \t]\((.*)/,_e=o.search("\\(")!==-1?$:_;return{name:Utils.getFirstMatch(_e,o),version:Utils.getSecondMatch(_e,o)}}}],osParsersList=[{test:[/Roku\/DVP/],describe(o){const _=Utils.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,o);return{name:OS_MAP.Roku,version:_}}},{test:[/windows phone/i],describe(o){const _=Utils.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,o);return{name:OS_MAP.WindowsPhone,version:_}}},{test:[/windows /i],describe(o){const _=Utils.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,o),$=Utils.getWindowsVersionName(_);return{name:OS_MAP.Windows,version:_,versionName:$}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(o){const _={name:OS_MAP.iOS},$=Utils.getSecondMatch(/(Version\/)(\d[\d.]+)/,o);return $&&(_.version=$),_}},{test:[/macintosh/i],describe(o){const _=Utils.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,o).replace(/[_\s]/g,"."),$=Utils.getMacOSVersionName(_),j={name:OS_MAP.MacOS,version:_};return $&&(j.versionName=$),j}},{test:[/(ipod|iphone|ipad)/i],describe(o){const _=Utils.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,o).replace(/[_\s]/g,".");return{name:OS_MAP.iOS,version:_}}},{test:[/OpenHarmony/i],describe(o){const _=Utils.getFirstMatch(/OpenHarmony\s+(\d+(\.\d+)*)/i,o);return{name:OS_MAP.HarmonyOS,version:_}}},{test(o){const _=!o.test(/like android/i),$=o.test(/android/i);return _&&$},describe(o){const _=Utils.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,o),$=Utils.getAndroidVersionName(_),j={name:OS_MAP.Android,version:_};return $&&(j.versionName=$),j}},{test:[/(web|hpw)[o0]s/i],describe(o){const _=Utils.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,o),$={name:OS_MAP.WebOS};return _&&_.length&&($.version=_),$}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe(o){const _=Utils.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,o)||Utils.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,o)||Utils.getFirstMatch(/\bbb(\d+)/i,o);return{name:OS_MAP.BlackBerry,version:_}}},{test:[/bada/i],describe(o){const _=Utils.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,o);return{name:OS_MAP.Bada,version:_}}},{test:[/tizen/i],describe(o){const _=Utils.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,o);return{name:OS_MAP.Tizen,version:_}}},{test:[/linux/i],describe(){return{name:OS_MAP.Linux}}},{test:[/CrOS/],describe(){return{name:OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe(o){const _=Utils.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,o);return{name:OS_MAP.PlayStation4,version:_}}}],platformParsersList=[{test:[/googlebot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Google"}}},{test:[/amazonbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Amazon"}}},{test:[/gptbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/chatgpt-user/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/oai-searchbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"OpenAI"}}},{test:[/baiduspider/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Baidu"}}},{test:[/bingbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Bing"}}},{test:[/duckduckbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"DuckDuckGo"}}},{test:[/claudebot/i,/claude-web/i,/claude-user/i,/claude-searchbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Anthropic"}}},{test:[/omgilibot/i,/webzio-extended/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Webz.io"}}},{test:[/diffbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Diffbot"}}},{test:[/perplexitybot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/perplexity-user/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Perplexity AI"}}},{test:[/youbot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"You.com"}}},{test:[/ia_archiver/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Internet Archive"}}},{test:[/meta-webindexer/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalads/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalagent/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/meta-externalfetcher/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/facebookexternalhit/i,/facebookcatalog/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Meta"}}},{test:[/yahoo/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Yahoo"}}},{test:[/yandexbot/i,/yandexmobilebot/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Yandex"}}},{test:[/pingdom/i],describe(){return{type:PLATFORMS_MAP.bot,vendor:"Pingdom"}}},{test:[/huawei/i],describe(o){const _=Utils.getFirstMatch(/(can-l01)/i,o)&&"Nova",$={type:PLATFORMS_MAP.mobile,vendor:"Huawei"};return _&&($.model=_),$}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe(){return{type:PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe(){return{type:PLATFORMS_MAP.tablet}}},{test(o){const _=o.test(/ipod|iphone/i),$=o.test(/like (ipod|iphone)/i);return _&&!$},describe(o){const _=Utils.getFirstMatch(/(ipod|iphone)/i,o);return{type:PLATFORMS_MAP.mobile,vendor:"Apple",model:_}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/Nokia/i],describe(o){const _=Utils.getFirstMatch(/Nokia\s+([0-9]+(\.[0-9]+)?)/i,o),$={type:PLATFORMS_MAP.mobile,vendor:"Nokia"};return _&&($.model=_),$}},{test:[/[^-]mobi/i],describe(){return{type:PLATFORMS_MAP.mobile}}},{test(o){return o.getBrowserName(!0)==="blackberry"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test(o){return o.getBrowserName(!0)==="bada"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(o){return o.getBrowserName()==="windows phone"},describe(){return{type:PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test(o){const _=Number(String(o.getOSVersion()).split(".")[0]);return o.getOSName(!0)==="android"&&_>=3},describe(){return{type:PLATFORMS_MAP.tablet}}},{test(o){return o.getOSName(!0)==="android"},describe(){return{type:PLATFORMS_MAP.mobile}}},{test(o){return o.getOSName(!0)==="macos"},describe(){return{type:PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test(o){return o.getOSName(!0)==="windows"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(o){return o.getOSName(!0)==="linux"},describe(){return{type:PLATFORMS_MAP.desktop}}},{test(o){return o.getOSName(!0)==="playstation 4"},describe(){return{type:PLATFORMS_MAP.tv}}},{test(o){return o.getOSName(!0)==="roku"},describe(){return{type:PLATFORMS_MAP.tv}}}],enginesParsersList=[{test(o){return o.getBrowserName(!0)==="microsoft edge"},describe(o){if(/\sedg\//i.test(o))return{name:ENGINE_MAP.Blink};const $=Utils.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,o);return{name:ENGINE_MAP.EdgeHTML,version:$}}},{test:[/trident/i],describe(o){const _={name:ENGINE_MAP.Trident},$=Utils.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test(o){return o.test(/presto/i)},describe(o){const _={name:ENGINE_MAP.Presto},$=Utils.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test(o){const _=o.test(/gecko/i),$=o.test(/like gecko/i);return _&&!$},describe(o){const _={name:ENGINE_MAP.Gecko},$=Utils.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}},{test:[/(apple)?webkit\/537\.36/i],describe(){return{name:ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe(o){const _={name:ENGINE_MAP.WebKit},$=Utils.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,o);return $&&(_.version=$),_}}];class Parser{constructor(_,$=!1){if(_==null||_==="")throw new Error("UserAgent parameter can't be empty");this._ua=_,this.parsedResult={},$!==!0&&this.parse()}getUA(){return this._ua}test(_){return _.test(this._ua)}parseBrowser(){this.parsedResult.browser={};const _=Utils.find(browsersList,$=>{if(typeof $.test=="function")return $.test(this);if(Array.isArray($.test))return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.browser=_.describe(this.getUA())),this.parsedResult.browser}getBrowser(){return this.parsedResult.browser?this.parsedResult.browser:this.parseBrowser()}getBrowserName(_){return _?String(this.getBrowser().name).toLowerCase()||"":this.getBrowser().name||""}getBrowserVersion(){return this.getBrowser().version}getOS(){return this.parsedResult.os?this.parsedResult.os:this.parseOS()}parseOS(){this.parsedResult.os={};const _=Utils.find(osParsersList,$=>{if(typeof $.test=="function")return $.test(this);if(Array.isArray($.test))return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.os=_.describe(this.getUA())),this.parsedResult.os}getOSName(_){const{name:$}=this.getOS();return _?String($).toLowerCase()||"":$||""}getOSVersion(){return this.getOS().version}getPlatform(){return this.parsedResult.platform?this.parsedResult.platform:this.parsePlatform()}getPlatformType(_=!1){const{type:$}=this.getPlatform();return _?String($).toLowerCase()||"":$||""}parsePlatform(){this.parsedResult.platform={};const _=Utils.find(platformParsersList,$=>{if(typeof $.test=="function")return $.test(this);if(Array.isArray($.test))return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.platform=_.describe(this.getUA())),this.parsedResult.platform}getEngine(){return this.parsedResult.engine?this.parsedResult.engine:this.parseEngine()}getEngineName(_){return _?String(this.getEngine().name).toLowerCase()||"":this.getEngine().name||""}parseEngine(){this.parsedResult.engine={};const _=Utils.find(enginesParsersList,$=>{if(typeof $.test=="function")return $.test(this);if(Array.isArray($.test))return $.test.some(j=>this.test(j));throw new Error("Browser's test function is not valid")});return _&&(this.parsedResult.engine=_.describe(this.getUA())),this.parsedResult.engine}parse(){return this.parseBrowser(),this.parseOS(),this.parsePlatform(),this.parseEngine(),this}getResult(){return Utils.assign({},this.parsedResult)}satisfies(_){const $={};let j=0;const _e={};let et=0;if(Object.keys(_).forEach(rt=>{const nt=_[rt];typeof nt=="string"?(_e[rt]=nt,et+=1):typeof nt=="object"&&($[rt]=nt,j+=1)}),j>0){const rt=Object.keys($),nt=Utils.find(rt,it=>this.isOS(it));if(nt){const it=this.satisfies($[nt]);if(it!==void 0)return it}const ot=Utils.find(rt,it=>this.isPlatform(it));if(ot){const it=this.satisfies($[ot]);if(it!==void 0)return it}}if(et>0){const rt=Object.keys(_e),nt=Utils.find(rt,ot=>this.isBrowser(ot,!0));if(nt!==void 0)return this.compareVersion(_e[nt])}}isBrowser(_,$=!1){const j=this.getBrowserName().toLowerCase();let _e=_.toLowerCase();const et=Utils.getBrowserTypeByAlias(_e);return $&&et&&(_e=et.toLowerCase()),_e===j}compareVersion(_){let $=[0],j=_,_e=!1;const et=this.getBrowserVersion();if(typeof et=="string")return _[0]===">"||_[0]==="<"?(j=_.substr(1),_[1]==="="?(_e=!0,j=_.substr(2)):$=[],_[0]===">"?$.push(1):$.push(-1)):_[0]==="="?j=_.substr(1):_[0]==="~"&&(_e=!0,j=_.substr(1)),$.indexOf(Utils.compareVersions(et,j,_e))>-1}isOS(_){return this.getOSName(!0)===String(_).toLowerCase()}isPlatform(_){return this.getPlatformType(!0)===String(_).toLowerCase()}isEngine(_){return this.getEngineName(!0)===String(_).toLowerCase()}is(_,$=!1){return this.isBrowser(_,$)||this.isOS(_)||this.isPlatform(_)}some(_=[]){return _.some($=>this.is($))}}/*! - * Bowser - a browser detector - * https://github.com/lancedikson/bowser - * MIT License | (c) Dustin Diaz 2012-2015 - * MIT License | (c) Denis Demchenko 2015-2019 - */class Bowser{static getParser(_,$=!1){if(typeof _!="string")throw new Error("UserAgent should be a string");return new Parser(_,$)}static parse(_){return new Parser(_).getResult()}static get BROWSER_MAP(){return BROWSER_MAP}static get ENGINE_MAP(){return ENGINE_MAP}static get OS_MAP(){return OS_MAP}static get PLATFORMS_MAP(){return PLATFORMS_MAP}}var base64url$3={exports:{}},base64url$2={},padString$1={};Object.defineProperty(padString$1,"__esModule",{value:!0});function padString(o){var _=4,$=o.length,j=$%_;if(!j)return o;var _e=$,et=_-j,tt=$+et,rt=Buffer$3.alloc(tt);for(rt.write(o);et--;)rt.write("=",_e++);return rt.toString()}padString$1.default=padString;Object.defineProperty(base64url$2,"__esModule",{value:!0});var pad_string_1=padString$1;function encode(o,_){return _===void 0&&(_="utf8"),Buffer$3.isBuffer(o)?fromBase64(o.toString("base64")):fromBase64(Buffer$3.from(o,_).toString("base64"))}function decode(o,_){return _===void 0&&(_="utf8"),Buffer$3.from(toBase64(o),"base64").toString(_)}function toBase64(o){return o=o.toString(),pad_string_1.default(o).replace(/\-/g,"+").replace(/_/g,"/")}function fromBase64(o){return o.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function toBuffer(o){return Buffer$3.from(toBase64(o),"base64")}var base64url$1=encode;base64url$1.encode=encode;base64url$1.decode=decode;base64url$1.toBase64=toBase64;base64url$1.fromBase64=fromBase64;base64url$1.toBuffer=toBuffer;base64url$2.default=base64url$1;(function(o){o.exports=base64url$2.default,o.exports.default=o.exports})(base64url$3);var base64urlExports=base64url$3.exports;const base64urlLib=getDefaultExportFromCjs$1(base64urlExports),base64url=base64urlLib;function safeatob(o){return base64url.decode(o)}function jsonToBase64(o){return base64url.encode(JSON.stringify(o))}function storageAvailable$1(o){let _=!1,$=0,j;try{j=window[o],_=!0,$=j.length;const _e="__storage_test__";return j.setItem(_e,_e),j.removeItem(_e),!0}catch(_e){const et=_e;return et&&(et.code===22||et.code===1014||et.name==="QuotaExceededError"||et.name==="NS_ERROR_DOM_QUOTA_REACHED")&&_&&$!==0}}const WEB3AUTH_LEGACY_NETWORK=TORUS_LEGACY_NETWORK,WEB3AUTH_SAPPHIRE_NETWORK=TORUS_SAPPHIRE_NETWORK,UX_MODE={POPUP:"popup",REDIRECT:"redirect"},WEB3AUTH_NETWORK=_objectSpread2(_objectSpread2({},WEB3AUTH_SAPPHIRE_NETWORK),WEB3AUTH_LEGACY_NETWORK),SUPPORTED_KEY_CURVES={OTHER:"other"},LOGIN_PROVIDER={FACEBOOK:"facebook",LINE:"line",SMS_PASSWORDLESS:"sms_passwordless",PASSKEYS:"passkeys",AUTHENTICATOR:"authenticator"},AUTH_ACTIONS={LOGIN:"login",ENABLE_MFA:"enable_mfa",MANAGE_MFA:"manage_mfa",ADD_AUTHENTICATOR_FACTOR:"add_authenticator_factor",ADD_PASSKEY_FACTOR:"add_passkey_factor"},BUILD_ENV={PRODUCTION:"production",DEVELOPMENT:"development",STAGING:"staging",TESTING:"testing"},version$1="9.6.4";function getHashQueryParams(o=!1){const _={},$=new URLSearchParams(window.location.search.slice(1));$.forEach((tt,rt)=>{rt!=="b64Params"&&(_[rt]=tt)});const j=$.get("b64Params");if(j)try{const tt=JSON.parse(safeatob(j));Object.keys(tt).forEach(rt=>{_[rt]=tt[rt]})}catch(tt){loglevel$1.error(tt)}const _e=new URLSearchParams(window.location.hash.substring(1));_e.forEach((tt,rt)=>{rt!=="b64Params"&&(_[rt]=tt)});const et=_e.get("b64Params");if(et)try{const tt=JSON.parse(safeatob(et));Object.keys(tt).forEach(rt=>{_[rt]=tt[rt]})}catch(tt){loglevel$1.error(tt)}if(o){const tt=new URL(window.location.origin+window.location.pathname);$.size!==0&&($.delete("error"),$.delete("state"),$.delete("b64Params"),$.delete("sessionNamespace"),tt.search=$.toString()),_e.size!==0&&(_e.delete("error"),_e.delete("state"),_e.delete("b64Params"),_e.delete("sessionNamespace"),tt.hash=_e.toString()),window.history.replaceState(_objectSpread2(_objectSpread2({},window.history.state),{},{as:tt.href,url:tt.href}),"",tt.href)}return _}function constructURL(o){const{baseURL:_,query:$,hash:j}=o,_e=new URL(_);if($&&Object.keys($).forEach(et=>{_e.searchParams.append(et,$[et])}),j){const et=new URL(constructURL({baseURL:_,query:j})).searchParams.toString();_e.hash=et}return _e.toString()}function getPopupFeatures(){if(typeof window>"u")return"";const o=window.screenLeft!==void 0?window.screenLeft:window.screenX,_=window.screenTop!==void 0?window.screenTop:window.screenY,$=1200,j=700,_e=window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:window.screen.width,et=window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:window.screen.height,tt=1,rt=Math.abs((_e-$)/2/tt+o),nt=Math.abs((et-j)/2/tt+_);return`titlebar=0,toolbar=0,status=0,location=0,menubar=0,height=${j/tt},width=${$/tt},top=${nt},left=${rt}`}function isMobileOrTablet(){if(typeof window>"u")return!1;const _=Bowser.getParser(window.navigator.userAgent).getPlatform();return _.type===Bowser.PLATFORMS_MAP.tablet||_.type===Bowser.PLATFORMS_MAP.mobile}function getTimeout(o){return(o===LOGIN_PROVIDER.FACEBOOK||o===LOGIN_PROVIDER.LINE)&&isMobileOrTablet()?1e3*60*5:1e3*10}class PopupHandler extends eventsExports.EventEmitter{constructor({url:_,target:$,features:j,timeout:_e=3e4,sessionSocketUrl:et,sessionServerUrl:tt}){super(),_defineProperty$z(this,"url",void 0),_defineProperty$z(this,"target",void 0),_defineProperty$z(this,"features",void 0),_defineProperty$z(this,"window",void 0),_defineProperty$z(this,"windowTimer",void 0),_defineProperty$z(this,"iClosedWindow",void 0),_defineProperty$z(this,"timeout",void 0),_defineProperty$z(this,"sessionSocketUrl",void 0),_defineProperty$z(this,"sessionServerUrl",void 0),this.url=_,this.target=$||"_blank",this.features=j||getPopupFeatures(),this.window=void 0,this.windowTimer=void 0,this.iClosedWindow=!1,this.timeout=_e,this.sessionServerUrl=tt||SESSION_SERVER_API_URL,this.sessionSocketUrl=et||SESSION_SERVER_SOCKET_URL,this._setupTimer()}_setupTimer(){this.windowTimer=Number(setInterval(()=>{this.window&&this.window.closed&&(clearInterval(this.windowTimer),setTimeout(()=>{this.iClosedWindow||this.emit("close"),this.iClosedWindow=!1,this.window=void 0},this.timeout)),this.window===void 0&&clearInterval(this.windowTimer)},500))}open(){var _;if(this.window=window.open(this.url,this.target,this.features),!this.window)throw LoginError.popupBlocked();(_=this.window)!==null&&_!==void 0&&_.focus&&this.window.focus()}close(){this.iClosedWindow=!0,this.window&&this.window.close()}redirect(_){_?window.location.replace(this.url):window.location.href=this.url}async listenOnChannel(_){const $=new SecurePubSub({serverUrl:this.sessionServerUrl,socketUrl:this.sessionSocketUrl}),j=await $.subscribe(_);this.close(),$.cleanup();const _e=JSON.parse(j);return _e.error?{error:_e.error,state:_e.state}:_e.data}}class MemoryStore{constructor(){_defineProperty$z(this,"store",new Map)}getItem(_){return this.store.get(_)||null}setItem(_,$){this.store.set(_,$)}removeItem(_){this.store.delete(_)}}class BrowserStorage{constructor(_,$){_defineProperty$z(this,"storage",void 0),_defineProperty$z(this,"_storeKey",void 0),this.storage=$,this._storeKey=_;try{$.getItem(_)||this.resetStore()}catch{}}static getInstance(_,$="local"){if(!this.instanceMap.has(_)){let j;$==="local"&&storageAvailable$1("localStorage")?j=window.localStorage:$==="session"&&storageAvailable$1("sessionStorage")?j=window.sessionStorage:j=new MemoryStore,this.instanceMap.set(_,new this(_,j))}return this.instanceMap.get(_)}toJSON(){return this.storage.getItem(this._storeKey)}resetStore(){const _=this.getStore();return this.storage.removeItem(this._storeKey),_}getStore(){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")}get(_){return JSON.parse(this.storage.getItem(this._storeKey)||"{}")[_]}set(_,$){const j=JSON.parse(this.storage.getItem(this._storeKey)||"{}");j[_]=$,this.storage.setItem(this._storeKey,JSON.stringify(j))}}_defineProperty$z(BrowserStorage,"instanceMap",new Map);class Auth{constructor(_){if(_defineProperty$z(this,"state",{}),_defineProperty$z(this,"options",void 0),_defineProperty$z(this,"sessionManager",void 0),_defineProperty$z(this,"currentStorage",void 0),_defineProperty$z(this,"_storageBaseKey","auth_store"),_defineProperty$z(this,"dappState",void 0),_defineProperty$z(this,"addVersionInUrls",!0),!_.clientId)throw InitializationError.invalidParams("clientId is required");if(_.network||(_.network=WEB3AUTH_NETWORK.SAPPHIRE_MAINNET),_.buildEnv||(_.buildEnv=BUILD_ENV.PRODUCTION),(_.buildEnv===BUILD_ENV.DEVELOPMENT||_.buildEnv===BUILD_ENV.TESTING||_.sdkUrl)&&(this.addVersionInUrls=!1),!_.sdkUrl&&!_.useMpc&&(_.buildEnv===BUILD_ENV.DEVELOPMENT?(_.sdkUrl="http://localhost:3000",_.dashboardUrl="http://localhost:5173"):_.buildEnv===BUILD_ENV.STAGING?(_.sdkUrl="https://staging-auth.web3auth.io",_.dashboardUrl="https://staging-account.web3auth.io"):_.buildEnv===BUILD_ENV.TESTING?(_.sdkUrl="https://develop-auth.web3auth.io",_.dashboardUrl="https://develop-account.web3auth.io"):(_.sdkUrl="https://auth.web3auth.io",_.dashboardUrl="https://account.web3auth.io")),_.useMpc&&!_.sdkUrl){if(Object.values(WEB3AUTH_LEGACY_NETWORK).includes(_.network))throw InitializationError.invalidParams("MPC is not supported on legacy networks, please use sapphire_devnet or sapphire_mainnet.");_.buildEnv===BUILD_ENV.DEVELOPMENT?_.sdkUrl="http://localhost:3000":_.buildEnv===BUILD_ENV.STAGING?_.sdkUrl="https://staging-mpc-auth.web3auth.io":_.buildEnv===BUILD_ENV.TESTING?_.sdkUrl="https://develop-mpc-auth.web3auth.io":_.sdkUrl="https://mpc-auth.web3auth.io"}!_.redirectUrl&&typeof window<"u"&&(_.redirectUrl=`${window.location.protocol}//${window.location.host}${window.location.pathname}`),_.uxMode||(_.uxMode=UX_MODE.REDIRECT),typeof _.replaceUrlOnRedirect!="boolean"&&(_.replaceUrlOnRedirect=!0),_.originData||(_.originData={}),_.whiteLabel||(_.whiteLabel={}),_.loginConfig||(_.loginConfig={}),_.mfaSettings||(_.mfaSettings={}),_.storageServerUrl||(_.storageServerUrl=SESSION_SERVER_API_URL),_.sessionSocketUrl||(_.sessionSocketUrl=SESSION_SERVER_SOCKET_URL),_.storageKey||(_.storageKey="local"),_.webauthnTransports||(_.webauthnTransports=["internal"]),_.sessionTime||(_.sessionTime=86400),this.options=_}get privKey(){return this.options.useMpc?this.state.factorKey||"":this.state.privKey?this.state.privKey.padStart(64,"0"):""}get coreKitKey(){return this.state.coreKitKey?this.state.coreKitKey.padStart(64,"0"):""}get ed25519PrivKey(){return this.state.ed25519PrivKey?this.state.ed25519PrivKey.padStart(128,"0"):""}get coreKitEd25519Key(){return this.state.coreKitEd25519PrivKey?this.state.coreKitEd25519PrivKey.padStart(128,"0"):""}get sessionId(){return this.state.sessionId||""}get sessionNamespace(){return this.options.sessionNamespace||""}get appState(){return this.state.userInfo.appState||this.dappState||""}get baseUrl(){return this.addVersionInUrls?`${this.options.sdkUrl}/v${version$1.split(".")[0]}`:`${this.options.sdkUrl}`}get dashboardUrl(){return this.addVersionInUrls?`${this.options.dashboardUrl}/v${version$1.split(".")[0]}`:`${this.options.dashboardUrl}`}async init(){const _=getHashQueryParams(this.options.replaceUrlOnRedirect);_.sessionNamespace&&(this.options.sessionNamespace=_.sessionNamespace);const $=this.options.sessionNamespace?`${this._storageBaseKey}_${this.options.sessionNamespace}`:this._storageBaseKey;this.currentStorage=BrowserStorage.getInstance($,this.options.storageKey);const j=this.currentStorage.get("sessionId");if(this.sessionManager=new SessionManager({sessionServerBaseUrl:this.options.storageServerUrl,sessionNamespace:this.options.sessionNamespace,sessionTime:this.options.sessionTime,sessionId:j,allowedOrigin:this.options.sdkUrl}),(this.options.network===WEB3AUTH_NETWORK.TESTNET||this.options.network===WEB3AUTH_NETWORK.SAPPHIRE_DEVNET)&&console.log(`%c WARNING! You are on ${this.options.network}. Please set network: 'mainnet' or 'sapphire_mainnet' in production`,"color: #FF0000"),this.options.buildEnv!==BUILD_ENV.PRODUCTION&&console.log(`%c WARNING! You are using build env ${this.options.buildEnv}. Please set buildEnv: 'production' in production`,"color: #FF0000"),_.error)throw this.dappState=_.state,LoginError.loginFailed(_.error);if(_.sessionId&&(this.currentStorage.set("sessionId",_.sessionId),this.sessionManager.sessionId=_.sessionId),this.sessionManager.sessionId){const _e=await this._authorizeSession();this.updateState(_e),Object.keys(_e).length===0?this.currentStorage.set("sessionId",""):this.updateState({sessionId:this.sessionManager.sessionId})}}async login(_){if(!_.loginProvider)throw LoginError.invalidLoginParams("loginProvider is required");const $={redirectUrl:this.options.redirectUrl},j=_objectSpread2(_objectSpread2({loginProvider:_.loginProvider},$),_),_e={actionType:AUTH_ACTIONS.LOGIN,options:this.options,params:j},et=await this.authHandler(`${this.baseUrl}/start`,_e,getTimeout(_.loginProvider));if(this.options.uxMode===UX_MODE.REDIRECT)return null;if(et.error)throw this.dappState=et.state,LoginError.loginFailed(et.error);return this.sessionManager.sessionId=et.sessionId,this.options.sessionNamespace=et.sessionNamespace,this.currentStorage.set("sessionId",et.sessionId),await this.rehydrateSession(),{privKey:this.privKey}}async logout(){if(!this.sessionManager.sessionId)throw LoginError.userNotLoggedIn();await this.sessionManager.invalidateSession(),this.updateState({privKey:"",coreKitKey:"",coreKitEd25519PrivKey:"",ed25519PrivKey:"",walletKey:"",oAuthPrivateKey:"",tKey:"",metadataNonce:"",keyMode:void 0,userInfo:{name:"",profileImage:"",dappShare:"",idToken:"",oAuthIdToken:"",oAuthAccessToken:"",appState:"",email:"",verifier:"",verifierId:"",aggregateVerifier:"",typeOfLogin:"",isMfaEnabled:!1},authToken:"",sessionId:"",factorKey:"",signatures:[],tssShareIndex:-1,tssPubKey:"",tssShare:"",tssNonce:-1}),this.currentStorage.set("sessionId","")}async enableMFA(_){var $;if(!this.sessionId)throw LoginError.userNotLoggedIn();if(this.state.userInfo.isMfaEnabled)throw LoginError.mfaAlreadyEnabled();const j={redirectUrl:this.options.redirectUrl},_e={actionType:AUTH_ACTIONS.ENABLE_MFA,options:this.options,params:_objectSpread2(_objectSpread2(_objectSpread2({},j),_),{},{loginProvider:this.state.userInfo.typeOfLogin,extraLoginOptions:{login_hint:this.state.userInfo.verifierId},mfaLevel:"mandatory"}),sessionId:this.sessionId},et=await this.authHandler(`${this.baseUrl}/start`,_e,getTimeout(_e.params.loginProvider));if(this.options.uxMode===UX_MODE.REDIRECT)return null;if(et.error)throw this.dappState=et.state,LoginError.loginFailed(et.error);return this.sessionManager.sessionId=et.sessionId,this.options.sessionNamespace=et.sessionNamespace,this.currentStorage.set("sessionId",et.sessionId),await this.rehydrateSession(),!!(!(($=this.state.userInfo)===null||$===void 0)&&$.isMfaEnabled)}async manageMFA(_){if(!this.sessionId)throw LoginError.userNotLoggedIn();if(!this.state.userInfo.isMfaEnabled)throw LoginError.mfaNotEnabled();const $={redirectUrl:`${this.dashboardUrl}/wallet/account`,dappUrl:`${window.location.origin}${window.location.pathname}`},j=SessionManager.generateRandomSessionKey(),_e={actionType:AUTH_ACTIONS.MANAGE_MFA,options:_objectSpread2(_objectSpread2({},this.options),{},{uxMode:"redirect"}),params:_objectSpread2(_objectSpread2(_objectSpread2({},$),_),{},{loginProvider:this.state.userInfo.typeOfLogin,extraLoginOptions:{login_hint:this.state.userInfo.verifierId},appState:jsonToBase64({loginId:j})}),sessionId:this.sessionId};this.createLoginSession(j,_e,_e.options.sessionTime,!0);const et={loginId:j,sessionNamespace:this.options.sessionNamespace,storageServerUrl:this.options.storageServerUrl},tt=constructURL({baseURL:`${this.baseUrl}/start`,hash:{b64Params:jsonToBase64(et)}});window.open(tt,"_blank")}async manageSocialFactor(_,$){if(!this.sessionId)throw LoginError.userNotLoggedIn();const j={redirectUrl:this.options.redirectUrl},_e={actionType:_,options:this.options,params:_objectSpread2(_objectSpread2({},j),$),sessionId:this.sessionId},et=await this.authHandler(`${this.baseUrl}/start`,_e);if(this.options.uxMode!==UX_MODE.REDIRECT)return!et.error}async addAuthenticatorFactor(_){if(!this.sessionId)throw LoginError.userNotLoggedIn();const $={redirectUrl:this.options.redirectUrl},j={actionType:AUTH_ACTIONS.ADD_AUTHENTICATOR_FACTOR,options:this.options,params:_objectSpread2(_objectSpread2(_objectSpread2({},$),_),{},{loginProvider:LOGIN_PROVIDER.AUTHENTICATOR}),sessionId:this.sessionId},_e=await this.authHandler(`${this.baseUrl}/start`,j);if(this.options.uxMode!==UX_MODE.REDIRECT)return!_e.error}async addPasskeyFactor(_){if(!this.sessionId)throw LoginError.userNotLoggedIn();const $={redirectUrl:this.options.redirectUrl},j={actionType:AUTH_ACTIONS.ADD_PASSKEY_FACTOR,options:this.options,params:_objectSpread2(_objectSpread2(_objectSpread2({},$),_),{},{loginProvider:LOGIN_PROVIDER.PASSKEYS}),sessionId:this.sessionId},_e=await this.authHandler(`${this.baseUrl}/start`,j);if(this.options.uxMode!==UX_MODE.REDIRECT)return!_e.error}getUserInfo(){if(!this.sessionManager.sessionId)throw LoginError.userNotLoggedIn();return this.state.userInfo}async createLoginSession(_,$,j=600,_e=!1){if(!this.sessionManager)throw InitializationError.notInitialized();const tt=new SessionManager({sessionServerBaseUrl:$.options.storageServerUrl,sessionNamespace:$.options.sessionNamespace,sessionTime:j,sessionId:_,allowedOrigin:this.options.sdkUrl}).createSession(JSON.parse(JSON.stringify($)));$.options.uxMode===UX_MODE.REDIRECT&&!_e&&await tt}async _authorizeSession(){try{return this.sessionManager.sessionId?await this.sessionManager.authorizeSession():{}}catch(_){return loglevel$1.error("authorization failed",_),{}}}updateState(_){this.state=_objectSpread2(_objectSpread2({},this.state),_)}async rehydrateSession(){const _=await this._authorizeSession();this.updateState(_)}async authHandler(_,$,j=1e3*10){const _e=SessionManager.generateRandomSessionKey();await this.createLoginSession(_e,$);const et={loginId:_e,sessionNamespace:this.options.sessionNamespace,storageServerUrl:this.options.storageServerUrl};if(this.options.uxMode===UX_MODE.REDIRECT){const nt=constructURL({baseURL:_,hash:{b64Params:jsonToBase64(et)}});window.location.href=nt;return}const tt=constructURL({baseURL:_,hash:{b64Params:jsonToBase64(et)}}),rt=new PopupHandler({url:tt,timeout:j,sessionServerUrl:this.options.storageServerUrl,sessionSocketUrl:this.options.sessionSocketUrl});return new Promise((nt,ot)=>{rt.on("close",()=>{ot(LoginError.popupClosed())}),rt.listenOnChannel(_e).then(nt).catch(ot);try{rt.open()}catch(it){ot(it)}})}}var browser$1={exports:{}},stream={exports:{}};let AggregateError$2=class extends Error{constructor(_){if(!Array.isArray(_))throw new TypeError(`Expected input to be an Array, got ${typeof _}`);let $="";for(let j=0;j<_.length;j++)$+=` ${_[j].stack} -`;super($),this.name="AggregateError",this.errors=_}};var primordials={AggregateError:AggregateError$2,ArrayIsArray(o){return Array.isArray(o)},ArrayPrototypeIncludes(o,_){return o.includes(_)},ArrayPrototypeIndexOf(o,_){return o.indexOf(_)},ArrayPrototypeJoin(o,_){return o.join(_)},ArrayPrototypeMap(o,_){return o.map(_)},ArrayPrototypePop(o,_){return o.pop(_)},ArrayPrototypePush(o,_){return o.push(_)},ArrayPrototypeSlice(o,_,$){return o.slice(_,$)},Error,FunctionPrototypeCall(o,_,...$){return o.call(_,...$)},FunctionPrototypeSymbolHasInstance(o,_){return Function.prototype[Symbol.hasInstance].call(o,_)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(o,_){return Object.defineProperties(o,_)},ObjectDefineProperty(o,_,$){return Object.defineProperty(o,_,$)},ObjectGetOwnPropertyDescriptor(o,_){return Object.getOwnPropertyDescriptor(o,_)},ObjectKeys(o){return Object.keys(o)},ObjectSetPrototypeOf(o,_){return Object.setPrototypeOf(o,_)},Promise,PromisePrototypeCatch(o,_){return o.catch(_)},PromisePrototypeThen(o,_,$){return o.then(_,$)},PromiseReject(o){return Promise.reject(o)},PromiseResolve(o){return Promise.resolve(o)},ReflectApply:Reflect.apply,RegExpPrototypeTest(o,_){return o.test(_)},SafeSet:Set,String,StringPrototypeSlice(o,_,$){return o.slice(_,$)},StringPrototypeToLowerCase(o){return o.toLowerCase()},StringPrototypeToUpperCase(o){return o.toUpperCase()},StringPrototypeTrim(o){return o.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(o,_,$){return o.set(_,$)},Boolean,Uint8Array},util$1={exports:{}},inspect$3={format(o,..._){return o.replace(/%([sdifj])/g,function(...[$,j]){const _e=_.shift();return j==="f"?_e.toFixed(6):j==="j"?JSON.stringify(_e):j==="s"&&typeof _e=="object"?`${_e.constructor!==Object?_e.constructor.name:""} {}`.trim():_e.toString()})},inspect(o){switch(typeof o){case"string":if(o.includes("'"))if(o.includes('"')){if(!o.includes("`")&&!o.includes("${"))return`\`${o}\``}else return`"${o}"`;return`'${o}'`;case"number":return isNaN(o)?"NaN":Object.is(o,-0)?String(o):o;case"bigint":return`${String(o)}n`;case"boolean":case"undefined":return String(o);case"object":return"{}"}}};const{format:format$1,inspect:inspect$2}=inspect$3,{AggregateError:CustomAggregateError}=primordials,AggregateError$1=globalThis.AggregateError||CustomAggregateError,kIsNodeError=Symbol("kIsNodeError"),kTypes=["string","function","number","object","Function","Object","boolean","bigint","symbol"],classRegExp=/^([A-Z][a-z0-9]*)+$/,nodeInternalPrefix="__node_internal_",codes$1={};function assert$1(o,_){if(!o)throw new codes$1.ERR_INTERNAL_ASSERTION(_)}function addNumericalSeparator(o){let _="",$=o.length;const j=o[0]==="-"?1:0;for(;$>=j+4;$-=3)_=`_${o.slice($-3,$)}${_}`;return`${o.slice(0,$)}${_}`}function getMessage(o,_,$){if(typeof _=="function")return assert$1(_.length<=$.length,`Code: ${o}; The provided arguments length (${$.length}) does not match the required ones (${_.length}).`),_(...$);const j=(_.match(/%[dfijoOs]/g)||[]).length;return assert$1(j===$.length,`Code: ${o}; The provided arguments length (${$.length}) does not match the required ones (${j}).`),$.length===0?_:format$1(_,...$)}function E(o,_,$){$||($=Error);class j extends ${constructor(...et){super(getMessage(o,_,et))}toString(){return`${this.name} [${o}]: ${this.message}`}}Object.defineProperties(j.prototype,{name:{value:$.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${o}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),j.prototype.code=o,j.prototype[kIsNodeError]=!0,codes$1[o]=j}function hideStackFrames$1(o){const _=nodeInternalPrefix+o.name;return Object.defineProperty(o,"name",{value:_}),o}function aggregateTwoErrors$2(o,_){if(o&&_&&o!==_){if(Array.isArray(_.errors))return _.errors.push(o),_;const $=new AggregateError$1([_,o],_.message);return $.code=_.code,$}return o||_}let AbortError$5=class extends Error{constructor(_="The operation was aborted",$=void 0){if($!==void 0&&typeof $!="object")throw new codes$1.ERR_INVALID_ARG_TYPE("options","Object",$);super(_,$),this.code="ABORT_ERR",this.name="AbortError"}};E("ERR_ASSERTION","%s",Error);E("ERR_INVALID_ARG_TYPE",(o,_,$)=>{assert$1(typeof o=="string","'name' must be a string"),Array.isArray(_)||(_=[_]);let j="The ";o.endsWith(" argument")?j+=`${o} `:j+=`"${o}" ${o.includes(".")?"property":"argument"} `,j+="must be ";const _e=[],et=[],tt=[];for(const nt of _)assert$1(typeof nt=="string","All expected entries have to be of type string"),kTypes.includes(nt)?_e.push(nt.toLowerCase()):classRegExp.test(nt)?et.push(nt):(assert$1(nt!=="object",'The value "object" should be written as "Object"'),tt.push(nt));if(et.length>0){const nt=_e.indexOf("object");nt!==-1&&(_e.splice(_e,nt,1),et.push("Object"))}if(_e.length>0){switch(_e.length){case 1:j+=`of type ${_e[0]}`;break;case 2:j+=`one of type ${_e[0]} or ${_e[1]}`;break;default:{const nt=_e.pop();j+=`one of type ${_e.join(", ")}, or ${nt}`}}(et.length>0||tt.length>0)&&(j+=" or ")}if(et.length>0){switch(et.length){case 1:j+=`an instance of ${et[0]}`;break;case 2:j+=`an instance of ${et[0]} or ${et[1]}`;break;default:{const nt=et.pop();j+=`an instance of ${et.join(", ")}, or ${nt}`}}tt.length>0&&(j+=" or ")}switch(tt.length){case 0:break;case 1:tt[0].toLowerCase()!==tt[0]&&(j+="an "),j+=`${tt[0]}`;break;case 2:j+=`one of ${tt[0]} or ${tt[1]}`;break;default:{const nt=tt.pop();j+=`one of ${tt.join(", ")}, or ${nt}`}}if($==null)j+=`. Received ${$}`;else if(typeof $=="function"&&$.name)j+=`. Received function ${$.name}`;else if(typeof $=="object"){var rt;if((rt=$.constructor)!==null&&rt!==void 0&&rt.name)j+=`. Received an instance of ${$.constructor.name}`;else{const nt=inspect$2($,{depth:-1});j+=`. Received ${nt}`}}else{let nt=inspect$2($,{colors:!1});nt.length>25&&(nt=`${nt.slice(0,25)}...`),j+=`. Received type ${typeof $} (${nt})`}return j},TypeError);E("ERR_INVALID_ARG_VALUE",(o,_,$="is invalid")=>{let j=inspect$2(_);return j.length>128&&(j=j.slice(0,128)+"..."),`The ${o.includes(".")?"property":"argument"} '${o}' ${$}. Received ${j}`},TypeError);E("ERR_INVALID_RETURN_VALUE",(o,_,$)=>{var j;const _e=$!=null&&(j=$.constructor)!==null&&j!==void 0&&j.name?`instance of ${$.constructor.name}`:`type ${typeof $}`;return`Expected ${o} to be returned from the "${_}" function but got ${_e}.`},TypeError);E("ERR_MISSING_ARGS",(...o)=>{assert$1(o.length>0,"At least one arg needs to be specified");let _;const $=o.length;switch(o=(Array.isArray(o)?o:[o]).map(j=>`"${j}"`).join(" or "),$){case 1:_+=`The ${o[0]} argument`;break;case 2:_+=`The ${o[0]} and ${o[1]} arguments`;break;default:{const j=o.pop();_+=`The ${o.join(", ")}, and ${j} arguments`}break}return`${_} must be specified`},TypeError);E("ERR_OUT_OF_RANGE",(o,_,$)=>{assert$1(_,'Missing "range" argument');let j;if(Number.isInteger($)&&Math.abs($)>2**32)j=addNumericalSeparator(String($));else if(typeof $=="bigint"){j=String($);const _e=BigInt(2)**BigInt(32);($>_e||$<-_e)&&(j=addNumericalSeparator(j)),j+="n"}else j=inspect$2($);return`The value of "${o}" is out of range. It must be ${_}. Received ${j}`},RangeError);E("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);E("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);E("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);E("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);E("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);E("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);E("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);E("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);E("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);E("ERR_STREAM_WRITE_AFTER_END","write after end",Error);E("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);var errors={AbortError:AbortError$5,aggregateTwoErrors:hideStackFrames$1(aggregateTwoErrors$2),hideStackFrames:hideStackFrames$1,codes:codes$1},browser={exports:{}},hasRequiredBrowser;function requireBrowser(){if(hasRequiredBrowser)return browser.exports;hasRequiredBrowser=1;const{AbortController:o,AbortSignal:_}=typeof self<"u"?self:typeof window<"u"?window:void 0;return browser.exports=o,browser.exports.AbortSignal=_,browser.exports.default=o,browser.exports}(function(o){const _=require$$0$1,{format:$,inspect:j}=inspect$3,{codes:{ERR_INVALID_ARG_TYPE:_e}}=errors,{kResistStopPropagation:et,AggregateError:tt,SymbolDispose:rt}=primordials,nt=globalThis.AbortSignal||requireBrowser().AbortSignal,ot=globalThis.AbortController||requireBrowser().AbortController,it=Object.getPrototypeOf(async function(){}).constructor,st=globalThis.Blob||_.Blob,at=typeof st<"u"?function(dt){return dt instanceof st}:function(dt){return!1},lt=(ft,dt)=>{if(ft!==void 0&&(ft===null||typeof ft!="object"||!("aborted"in ft)))throw new _e(dt,"AbortSignal",ft)},ct=(ft,dt)=>{if(typeof ft!="function")throw new _e(dt,"Function",ft)};o.exports={AggregateError:tt,kEmptyObject:Object.freeze({}),once(ft){let dt=!1;return function(...pt){dt||(dt=!0,ft.apply(this,pt))}},createDeferredPromise:function(){let ft,dt;return{promise:new Promise((yt,vt)=>{ft=yt,dt=vt}),resolve:ft,reject:dt}},promisify(ft){return new Promise((dt,pt)=>{ft((yt,...vt)=>yt?pt(yt):dt(...vt))})},debuglog(){return function(){}},format:$,inspect:j,types:{isAsyncFunction(ft){return ft instanceof it},isArrayBufferView(ft){return ArrayBuffer.isView(ft)}},isBlob:at,deprecate(ft,dt){return ft},addAbortListener:eventsExports.addAbortListener||function(dt,pt){if(dt===void 0)throw new _e("signal","AbortSignal",dt);lt(dt,"signal"),ct(pt,"listener");let yt;return dt.aborted?queueMicrotask(()=>pt()):(dt.addEventListener("abort",pt,{__proto__:null,once:!0,[et]:!0}),yt=()=>{dt.removeEventListener("abort",pt)}),{__proto__:null,[rt](){var vt;(vt=yt)===null||vt===void 0||vt()}}},AbortSignalAny:nt.any||function(dt){if(dt.length===1)return dt[0];const pt=new ot,yt=()=>pt.abort();return dt.forEach(vt=>{lt(vt,"signals"),vt.addEventListener("abort",yt,{once:!0})}),pt.signal.addEventListener("abort",()=>{dt.forEach(vt=>vt.removeEventListener("abort",yt))},{once:!0}),pt.signal}},o.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")})(util$1);var utilExports=util$1.exports,operators={};const{ArrayIsArray:ArrayIsArray$2,ArrayPrototypeIncludes,ArrayPrototypeJoin,ArrayPrototypeMap,NumberIsInteger:NumberIsInteger$1,NumberIsNaN:NumberIsNaN$1,NumberMAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER,NumberParseInt,ObjectPrototypeHasOwnProperty,RegExpPrototypeExec,String:String$1,StringPrototypeToUpperCase,StringPrototypeTrim}=primordials,{hideStackFrames,codes:{ERR_SOCKET_BAD_PORT,ERR_INVALID_ARG_TYPE:ERR_INVALID_ARG_TYPE$4,ERR_INVALID_ARG_VALUE:ERR_INVALID_ARG_VALUE$3,ERR_OUT_OF_RANGE:ERR_OUT_OF_RANGE$1,ERR_UNKNOWN_SIGNAL}}=errors,{normalizeEncoding}=utilExports,{isAsyncFunction,isArrayBufferView}=utilExports.types,validateInteger$2=hideStackFrames((o,_,$=NumberMIN_SAFE_INTEGER,j=NumberMAX_SAFE_INTEGER)=>{if(typeof o!="number")throw new ERR_INVALID_ARG_TYPE$4(_,"number",o);if(!NumberIsInteger$1(o))throw new ERR_OUT_OF_RANGE$1(_,"an integer",o);if(o<$||o>j)throw new ERR_OUT_OF_RANGE$1(_,`>= ${$} && <= ${j}`,o)});hideStackFrames((o,_,$=-2147483648,j=2147483647)=>{if(typeof o!="number")throw new ERR_INVALID_ARG_TYPE$4(_,"number",o);if(!NumberIsInteger$1(o))throw new ERR_OUT_OF_RANGE$1(_,"an integer",o);if(o<$||o>j)throw new ERR_OUT_OF_RANGE$1(_,`>= ${$} && <= ${j}`,o)});hideStackFrames((o,_,$=!1)=>{if(typeof o!="number")throw new ERR_INVALID_ARG_TYPE$4(_,"number",o);if(!NumberIsInteger$1(o))throw new ERR_OUT_OF_RANGE$1(_,"an integer",o);const j=$?1:0,_e=4294967295;if(o_e)throw new ERR_OUT_OF_RANGE$1(_,`>= ${j} && <= ${_e}`,o)});hideStackFrames((o,_,$)=>{if(!ArrayPrototypeIncludes($,o)){const _e="must be one of: "+ArrayPrototypeJoin(ArrayPrototypeMap($,et=>typeof et=="string"?`'${et}'`:String$1(et)),", ");throw new ERR_INVALID_ARG_VALUE$3(_,o,_e)}});function validateBoolean$1(o,_){if(typeof o!="boolean")throw new ERR_INVALID_ARG_TYPE$4(_,"boolean",o)}function getOwnPropertyValueOrDefault(o,_,$){return o==null||!ObjectPrototypeHasOwnProperty(o,_)?$:o[_]}const validateObject$3=hideStackFrames((o,_,$=null)=>{const j=getOwnPropertyValueOrDefault($,"allowArray",!1),_e=getOwnPropertyValueOrDefault($,"allowFunction",!1);if(!getOwnPropertyValueOrDefault($,"nullable",!1)&&o===null||!j&&ArrayIsArray$2(o)||typeof o!="object"&&(!_e||typeof o!="function"))throw new ERR_INVALID_ARG_TYPE$4(_,"Object",o)});hideStackFrames((o,_)=>{if(o!=null&&typeof o!="object"&&typeof o!="function")throw new ERR_INVALID_ARG_TYPE$4(_,"a dictionary",o)});hideStackFrames((o,_,$=0)=>{if(!ArrayIsArray$2(o))throw new ERR_INVALID_ARG_TYPE$4(_,"Array",o);if(o.length<$){const j=`must be longer than ${$}`;throw new ERR_INVALID_ARG_VALUE$3(_,o,j)}});hideStackFrames((o,_="buffer")=>{if(!isArrayBufferView(o))throw new ERR_INVALID_ARG_TYPE$4(_,["Buffer","TypedArray","DataView"],o)});const validateAbortSignal$3=hideStackFrames((o,_)=>{if(o!==void 0&&(o===null||typeof o!="object"||!("aborted"in o)))throw new ERR_INVALID_ARG_TYPE$4(_,"AbortSignal",o)}),validateFunction$2=hideStackFrames((o,_)=>{if(typeof o!="function")throw new ERR_INVALID_ARG_TYPE$4(_,"Function",o)});hideStackFrames((o,_)=>{if(typeof o!="function"||isAsyncFunction(o))throw new ERR_INVALID_ARG_TYPE$4(_,"Function",o)});hideStackFrames((o,_)=>{if(o!==void 0)throw new ERR_INVALID_ARG_TYPE$4(_,"undefined",o)});var validators={validateBoolean:validateBoolean$1,validateFunction:validateFunction$2,validateInteger:validateInteger$2,validateObject:validateObject$3,validateAbortSignal:validateAbortSignal$3},endOfStream={exports:{}},dist={};(function(o){Object.defineProperties(o,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});function _(wt){return wt&&wt.__esModule&&Object.prototype.hasOwnProperty.call(wt,"default")?wt.default:wt}var $={exports:{}},j=$.exports={},_e,et;function tt(){throw new Error("setTimeout has not been defined")}function rt(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?_e=setTimeout:_e=tt}catch{_e=tt}try{typeof clearTimeout=="function"?et=clearTimeout:et=rt}catch{et=rt}})();function nt(wt){if(_e===setTimeout)return setTimeout(wt,0);if((_e===tt||!_e)&&setTimeout)return _e=setTimeout,setTimeout(wt,0);try{return _e(wt,0)}catch{try{return _e.call(null,wt,0)}catch{return _e.call(this,wt,0)}}}function ot(wt){if(et===clearTimeout)return clearTimeout(wt);if((et===rt||!et)&&clearTimeout)return et=clearTimeout,clearTimeout(wt);try{return et(wt)}catch{try{return et.call(null,wt)}catch{return et.call(this,wt)}}}var it=[],st=!1,at,lt=-1;function ct(){!st||!at||(st=!1,at.length?it=at.concat(it):lt=-1,it.length&&ft())}function ft(){if(!st){var wt=nt(ct);st=!0;for(var Ct=it.length;Ct;){for(at=it,it=[];++lt1)for(var Pt=1;Pt{};function eos$2(o,_,$){var j,_e;if(arguments.length===2?($=_,_=kEmptyObject):_==null?_=kEmptyObject:validateObject$2(_,"options"),validateFunction$1($,"callback"),validateAbortSignal$2(_.signal,"options.signal"),$=once$1($),isReadableStream$2(o)||isWritableStream$1(o))return eosWeb(o,_,$);if(!isNodeStream$3(o))throw new ERR_INVALID_ARG_TYPE$3("stream",["ReadableStream","WritableStream","Stream"],o);const et=(j=_.readable)!==null&&j!==void 0?j:isReadableNodeStream$1(o),tt=(_e=_.writable)!==null&&_e!==void 0?_e:isWritableNodeStream(o),rt=o._writableState,nt=o._readableState,ot=()=>{o.writable||at()};let it=_willEmitClose(o)&&isReadableNodeStream$1(o)===et&&isWritableNodeStream(o)===tt,st=isWritableFinished(o,!1);const at=()=>{st=!0,o.destroyed&&(it=!1),!(it&&(!o.readable||et))&&(!et||lt)&&$.call(o)};let lt=isReadableFinished$1(o,!1);const ct=()=>{lt=!0,o.destroyed&&(it=!1),!(it&&(!o.writable||tt))&&(!tt||st)&&$.call(o)},ft=Ct=>{$.call(o,Ct)};let dt=isClosed(o);const pt=()=>{dt=!0;const Ct=isWritableErrored(o)||isReadableErrored(o);if(Ct&&typeof Ct!="boolean")return $.call(o,Ct);if(et&&!lt&&isReadableNodeStream$1(o,!0)&&!isReadableFinished$1(o,!1))return $.call(o,new ERR_STREAM_PREMATURE_CLOSE$1);if(tt&&!st&&!isWritableFinished(o,!1))return $.call(o,new ERR_STREAM_PREMATURE_CLOSE$1);$.call(o)},yt=()=>{dt=!0;const Ct=isWritableErrored(o)||isReadableErrored(o);if(Ct&&typeof Ct!="boolean")return $.call(o,Ct);$.call(o)},vt=()=>{o.req.on("finish",at)};isRequest$1(o)?(o.on("complete",at),it||o.on("abort",pt),o.req?vt():o.on("request",vt)):tt&&!rt&&(o.on("end",ot),o.on("close",ot)),!it&&typeof o.aborted=="boolean"&&o.on("aborted",pt),o.on("end",ct),o.on("finish",at),_.error!==!1&&o.on("error",ft),o.on("close",pt),dt?process$3.nextTick(pt):rt!=null&&rt.errorEmitted||nt!=null&&nt.errorEmitted?it||process$3.nextTick(yt):(!et&&(!it||isReadable$2(o))&&(st||isWritable$2(o)===!1)||!tt&&(!it||isWritable$2(o))&&(lt||isReadable$2(o)===!1)||nt&&o.req&&o.aborted)&&process$3.nextTick(yt);const wt=()=>{$=nop,o.removeListener("aborted",pt),o.removeListener("complete",at),o.removeListener("abort",pt),o.removeListener("request",vt),o.req&&o.req.removeListener("finish",at),o.removeListener("end",ot),o.removeListener("close",ot),o.removeListener("finish",at),o.removeListener("end",ct),o.removeListener("error",ft),o.removeListener("close",pt)};if(_.signal&&!dt){const Ct=()=>{const Pt=$;wt(),Pt.call(o,new AbortError$4(void 0,{cause:_.signal.reason}))};if(_.signal.aborted)process$3.nextTick(Ct);else{addAbortListener$1=addAbortListener$1||utilExports.addAbortListener;const Pt=addAbortListener$1(_.signal,Ct),Bt=$;$=once$1((...At)=>{Pt[SymbolDispose$1](),Bt.apply(o,At)})}}return wt}function eosWeb(o,_,$){let j=!1,_e=nop;if(_.signal)if(_e=()=>{j=!0,$.call(o,new AbortError$4(void 0,{cause:_.signal.reason}))},_.signal.aborted)process$3.nextTick(_e);else{addAbortListener$1=addAbortListener$1||utilExports.addAbortListener;const tt=addAbortListener$1(_.signal,_e),rt=$;$=once$1((...nt)=>{tt[SymbolDispose$1](),rt.apply(o,nt)})}const et=(...tt)=>{j||process$3.nextTick(()=>$.apply(o,tt))};return PromisePrototypeThen$2(o[kIsClosedPromise].promise,et,et),nop}function finished$1(o,_){var $;let j=!1;return _===null&&(_=kEmptyObject),($=_)!==null&&$!==void 0&&$.cleanup&&(validateBoolean(_.cleanup,"cleanup"),j=_.cleanup),new Promise$3((_e,et)=>{const tt=eos$2(o,_,rt=>{j&&tt(),rt?et(rt):_e()})})}endOfStream.exports=eos$2;endOfStream.exports.finished=finished$1;var endOfStreamExports=endOfStream.exports;const process$2=dist,{aggregateTwoErrors:aggregateTwoErrors$1,codes:{ERR_MULTIPLE_CALLBACK},AbortError:AbortError$3}=errors,{Symbol:Symbol$4}=primordials,{kIsDestroyed,isDestroyed,isFinished,isServerRequest}=utils,kDestroy=Symbol$4("kDestroy"),kConstruct=Symbol$4("kConstruct");function checkError(o,_,$){o&&(o.stack,_&&!_.errored&&(_.errored=o),$&&!$.errored&&($.errored=o))}function destroy(o,_){const $=this._readableState,j=this._writableState,_e=j||$;return j!=null&&j.destroyed||$!=null&&$.destroyed?(typeof _=="function"&&_(),this):(checkError(o,j,$),j&&(j.destroyed=!0),$&&($.destroyed=!0),_e.constructed?_destroy(this,o,_):this.once(kDestroy,function(et){_destroy(this,aggregateTwoErrors$1(et,o),_)}),this)}function _destroy(o,_,$){let j=!1;function _e(et){if(j)return;j=!0;const tt=o._readableState,rt=o._writableState;checkError(et,rt,tt),rt&&(rt.closed=!0),tt&&(tt.closed=!0),typeof $=="function"&&$(et),et?process$2.nextTick(emitErrorCloseNT,o,et):process$2.nextTick(emitCloseNT,o)}try{o._destroy(_||null,_e)}catch(et){_e(et)}}function emitErrorCloseNT(o,_){emitErrorNT(o,_),emitCloseNT(o)}function emitCloseNT(o){const _=o._readableState,$=o._writableState;$&&($.closeEmitted=!0),_&&(_.closeEmitted=!0),($!=null&&$.emitClose||_!=null&&_.emitClose)&&o.emit("close")}function emitErrorNT(o,_){const $=o._readableState,j=o._writableState;j!=null&&j.errorEmitted||$!=null&&$.errorEmitted||(j&&(j.errorEmitted=!0),$&&($.errorEmitted=!0),o.emit("error",_))}function undestroy(){const o=this._readableState,_=this._writableState;o&&(o.constructed=!0,o.closed=!1,o.closeEmitted=!1,o.destroyed=!1,o.errored=null,o.errorEmitted=!1,o.reading=!1,o.ended=o.readable===!1,o.endEmitted=o.readable===!1),_&&(_.constructed=!0,_.destroyed=!1,_.closed=!1,_.closeEmitted=!1,_.errored=null,_.errorEmitted=!1,_.finalCalled=!1,_.prefinished=!1,_.ended=_.writable===!1,_.ending=_.writable===!1,_.finished=_.writable===!1)}function errorOrDestroy(o,_,$){const j=o._readableState,_e=o._writableState;if(_e!=null&&_e.destroyed||j!=null&&j.destroyed)return this;j!=null&&j.autoDestroy||_e!=null&&_e.autoDestroy?o.destroy(_):_&&(_.stack,_e&&!_e.errored&&(_e.errored=_),j&&!j.errored&&(j.errored=_),$?process$2.nextTick(emitErrorNT,o,_):emitErrorNT(o,_))}function construct(o,_){if(typeof o._construct!="function")return;const $=o._readableState,j=o._writableState;$&&($.constructed=!1),j&&(j.constructed=!1),o.once(kConstruct,_),!(o.listenerCount(kConstruct)>1)&&process$2.nextTick(constructNT,o)}function constructNT(o){let _=!1;function $(j){if(_){errorOrDestroy(o,j??new ERR_MULTIPLE_CALLBACK);return}_=!0;const _e=o._readableState,et=o._writableState,tt=et||_e;_e&&(_e.constructed=!0),et&&(et.constructed=!0),tt.destroyed?o.emit(kDestroy,j):j?errorOrDestroy(o,j,!0):process$2.nextTick(emitConstructNT,o)}try{o._construct(j=>{process$2.nextTick($,j)})}catch(j){process$2.nextTick($,j)}}function emitConstructNT(o){o.emit(kConstruct)}function isRequest(o){return(o==null?void 0:o.setHeader)&&typeof o.abort=="function"}function emitCloseLegacy(o){o.emit("close")}function emitErrorCloseLegacy(o,_){o.emit("error",_),process$2.nextTick(emitCloseLegacy,o)}function destroyer$2(o,_){!o||isDestroyed(o)||(!_&&!isFinished(o)&&(_=new AbortError$3),isServerRequest(o)?(o.socket=null,o.destroy(_)):isRequest(o)?o.abort():isRequest(o.req)?o.req.abort():typeof o.destroy=="function"?o.destroy(_):typeof o.close=="function"?o.close():_?process$2.nextTick(emitErrorCloseLegacy,o,_):process$2.nextTick(emitCloseLegacy,o),o.destroyed||(o[kIsDestroyed]=!0))}var destroy_1={construct,destroyer:destroyer$2,destroy,undestroy,errorOrDestroy};const{ArrayIsArray:ArrayIsArray$1,ObjectSetPrototypeOf:ObjectSetPrototypeOf$2}=primordials,{EventEmitter:EE}=eventsExports;function Stream(o){EE.call(this,o)}ObjectSetPrototypeOf$2(Stream.prototype,EE.prototype);ObjectSetPrototypeOf$2(Stream,EE);Stream.prototype.pipe=function(o,_){const $=this;function j(it){o.writable&&o.write(it)===!1&&$.pause&&$.pause()}$.on("data",j);function _e(){$.readable&&$.resume&&$.resume()}o.on("drain",_e),!o._isStdio&&(!_||_.end!==!1)&&($.on("end",tt),$.on("close",rt));let et=!1;function tt(){et||(et=!0,o.end())}function rt(){et||(et=!0,typeof o.destroy=="function"&&o.destroy())}function nt(it){ot(),EE.listenerCount(this,"error")===0&&this.emit("error",it)}prependListener($,"error",nt),prependListener(o,"error",nt);function ot(){$.removeListener("data",j),o.removeListener("drain",_e),$.removeListener("end",tt),$.removeListener("close",rt),$.removeListener("error",nt),o.removeListener("error",nt),$.removeListener("end",ot),$.removeListener("close",ot),o.removeListener("close",ot)}return $.on("end",ot),$.on("close",ot),o.on("close",ot),o.emit("pipe",$),o};function prependListener(o,_,$){if(typeof o.prependListener=="function")return o.prependListener(_,$);!o._events||!o._events[_]?o.on(_,$):ArrayIsArray$1(o._events[_])?o._events[_].unshift($):o._events[_]=[$,o._events[_]]}var legacy={Stream,prependListener},addAbortSignal={exports:{}};(function(o){const{SymbolDispose:_}=primordials,{AbortError:$,codes:j}=errors,{isNodeStream:_e,isWebStream:et,kControllerErrorFunction:tt}=utils,rt=endOfStreamExports,{ERR_INVALID_ARG_TYPE:nt}=j;let ot;const it=(st,at)=>{if(typeof st!="object"||!("aborted"in st))throw new nt(at,"AbortSignal",st)};o.exports.addAbortSignal=function(at,lt){if(it(at,"signal"),!_e(lt)&&!et(lt))throw new nt("stream",["ReadableStream","WritableStream","Stream"],lt);return o.exports.addAbortSignalNoValidate(at,lt)},o.exports.addAbortSignalNoValidate=function(st,at){if(typeof st!="object"||!("aborted"in st))return at;const lt=_e(at)?()=>{at.destroy(new $(void 0,{cause:st.reason}))}:()=>{at[tt](new $(void 0,{cause:st.reason}))};if(st.aborted)lt();else{ot=ot||utilExports.addAbortListener;const ct=ot(st,lt);rt(at,ct[_])}return at}})(addAbortSignal);var addAbortSignalExports=addAbortSignal.exports;const{StringPrototypeSlice,SymbolIterator:SymbolIterator$1,TypedArrayPrototypeSet,Uint8Array:Uint8Array$1}=primordials,{Buffer:Buffer$1}=require$$0$1,{inspect:inspect$1}=utilExports;var buffer_list=class{constructor(){this.head=null,this.tail=null,this.length=0}push(_){const $={data:_,next:null};this.length>0?this.tail.next=$:this.head=$,this.tail=$,++this.length}unshift(_){const $={data:_,next:this.head};this.length===0&&(this.tail=$),this.head=$,++this.length}shift(){if(this.length===0)return;const _=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,_}clear(){this.head=this.tail=null,this.length=0}join(_){if(this.length===0)return"";let $=this.head,j=""+$.data;for(;($=$.next)!==null;)j+=_+$.data;return j}concat(_){if(this.length===0)return Buffer$1.alloc(0);const $=Buffer$1.allocUnsafe(_>>>0);let j=this.head,_e=0;for(;j;)TypedArrayPrototypeSet($,j.data,_e),_e+=j.data.length,j=j.next;return $}consume(_,$){const j=this.head.data;if(_et.length)$+=et,_-=et.length;else{_===et.length?($+=et,++_e,j.next?this.head=j.next:this.head=this.tail=null):($+=StringPrototypeSlice(et,0,_),this.head=j,j.data=StringPrototypeSlice(et,_));break}++_e}while((j=j.next)!==null);return this.length-=_e,$}_getBuffer(_){const $=Buffer$1.allocUnsafe(_),j=_;let _e=this.head,et=0;do{const tt=_e.data;if(_>tt.length)TypedArrayPrototypeSet($,tt,j-_),_-=tt.length;else{_===tt.length?(TypedArrayPrototypeSet($,tt,j-_),++et,_e.next?this.head=_e.next:this.head=this.tail=null):(TypedArrayPrototypeSet($,new Uint8Array$1(tt.buffer,tt.byteOffset,_),j-_),this.head=_e,_e.data=tt.slice(_));break}++et}while((_e=_e.next)!==null);return this.length-=et,$}[Symbol.for("nodejs.util.inspect.custom")](_,$){return inspect$1(this,{...$,depth:0,customInspect:!1})}};const{MathFloor:MathFloor$1,NumberIsInteger}=primordials,{validateInteger:validateInteger$1}=validators,{ERR_INVALID_ARG_VALUE:ERR_INVALID_ARG_VALUE$2}=errors.codes;let defaultHighWaterMarkBytes=16*1024,defaultHighWaterMarkObjectMode=16;function highWaterMarkFrom(o,_,$){return o.highWaterMark!=null?o.highWaterMark:_?o[$]:null}function getDefaultHighWaterMark(o){return o?defaultHighWaterMarkObjectMode:defaultHighWaterMarkBytes}function setDefaultHighWaterMark(o,_){validateInteger$1(_,"value",0),o?defaultHighWaterMarkObjectMode=_:defaultHighWaterMarkBytes=_}function getHighWaterMark$1(o,_,$,j){const _e=highWaterMarkFrom(_,j,$);if(_e!=null){if(!NumberIsInteger(_e)||_e<0){const et=j?`options.${$}`:"options.highWaterMark";throw new ERR_INVALID_ARG_VALUE$2(et,_e)}return MathFloor$1(_e)}return getDefaultHighWaterMark(o.objectMode)}var state={getHighWaterMark:getHighWaterMark$1,getDefaultHighWaterMark,setDefaultHighWaterMark};const process$1=dist,{PromisePrototypeThen:PromisePrototypeThen$1,SymbolAsyncIterator:SymbolAsyncIterator$1,SymbolIterator}=primordials,{Buffer}=require$$0$1,{ERR_INVALID_ARG_TYPE:ERR_INVALID_ARG_TYPE$2,ERR_STREAM_NULL_VALUES}=errors.codes;function from$1(o,_,$){let j;if(typeof _=="string"||_ instanceof Buffer)return new o({objectMode:!0,...$,read(){this.push(_),this.push(null)}});let _e;if(_&&_[SymbolAsyncIterator$1])_e=!0,j=_[SymbolAsyncIterator$1]();else if(_&&_[SymbolIterator])_e=!1,j=_[SymbolIterator]();else throw new ERR_INVALID_ARG_TYPE$2("iterable",["Iterable"],_);const et=new o({objectMode:!0,highWaterMark:1,...$});let tt=!1;et._read=function(){tt||(tt=!0,nt())},et._destroy=function(ot,it){PromisePrototypeThen$1(rt(ot),()=>process$1.nextTick(it,ot),st=>process$1.nextTick(it,st||ot))};async function rt(ot){const it=ot!=null,st=typeof j.throw=="function";if(it&&st){const{value:at,done:lt}=await j.throw(ot);if(await at,lt)return}if(typeof j.return=="function"){const{value:at}=await j.return();await at}}async function nt(){for(;;){try{const{value:ot,done:it}=_e?await j.next():j.next();if(it)et.push(null);else{const st=ot&&typeof ot.then=="function"?await ot:ot;if(st===null)throw tt=!1,new ERR_STREAM_NULL_VALUES;if(et.push(st))continue;tt=!1}}catch(ot){et.destroy(ot)}break}}return et}var from_1=from$1,readable,hasRequiredReadable;function requireReadable(){if(hasRequiredReadable)return readable;hasRequiredReadable=1;const o=dist,{ArrayPrototypeIndexOf:_,NumberIsInteger:$,NumberIsNaN:j,NumberParseInt:_e,ObjectDefineProperties:et,ObjectKeys:tt,ObjectSetPrototypeOf:rt,Promise:nt,SafeSet:ot,SymbolAsyncDispose:it,SymbolAsyncIterator:st,Symbol:at}=primordials;readable=lr,lr.ReadableState=fr;const{EventEmitter:lt}=eventsExports,{Stream:ct,prependListener:ft}=legacy,{Buffer:dt}=require$$0$1,{addAbortSignal:pt}=addAbortSignalExports,yt=endOfStreamExports;let vt=utilExports.debuglog("stream",Zt=>{vt=Zt});const wt=buffer_list,Ct=destroy_1,{getHighWaterMark:Pt,getDefaultHighWaterMark:Bt}=state,{aggregateTwoErrors:At,codes:{ERR_INVALID_ARG_TYPE:kt,ERR_METHOD_NOT_IMPLEMENTED:Ot,ERR_OUT_OF_RANGE:Tt,ERR_STREAM_PUSH_AFTER_EOF:ht,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:bt},AbortError:mt}=errors,{validateObject:gt}=validators,xt=at("kPaused"),{StringDecoder:Et}=string_decoder,_t=from_1;rt(lr.prototype,ct.prototype),rt(lr,ct);const $t=()=>{},{errorOrDestroy:St}=Ct,Rt=1,It=2,Mt=4,Vt=8,Gt=16,zt=32,jt=64,Ft=128,qt=256,Xt=512,Ut=1024,Lt=2048,Ht=4096,Kt=8192,Jt=16384,tr=32768,nr=65536,ur=1<<17,rr=1<<18;function pr(Zt){return{enumerable:!1,get(){return(this.state&Zt)!==0},set(Qt){Qt?this.state|=Zt:this.state&=~Zt}}}et(fr.prototype,{objectMode:pr(Rt),ended:pr(It),endEmitted:pr(Mt),reading:pr(Vt),constructed:pr(Gt),sync:pr(zt),needReadable:pr(jt),emittedReadable:pr(Ft),readableListening:pr(qt),resumeScheduled:pr(Xt),errorEmitted:pr(Ut),emitClose:pr(Lt),autoDestroy:pr(Ht),destroyed:pr(Kt),closed:pr(Jt),closeEmitted:pr(tr),multiAwaitDrain:pr(nr),readingMore:pr(ur),dataEmitted:pr(rr)});function fr(Zt,Qt,or){typeof or!="boolean"&&(or=Qt instanceof requireDuplex()),this.state=Lt|Ht|Gt|zt,Zt&&Zt.objectMode&&(this.state|=Rt),or&&Zt&&Zt.readableObjectMode&&(this.state|=Rt),this.highWaterMark=Zt?Pt(this,Zt,"readableHighWaterMark",or):Bt(!1),this.buffer=new wt,this.length=0,this.pipes=[],this.flowing=null,this[xt]=null,Zt&&Zt.emitClose===!1&&(this.state&=~Lt),Zt&&Zt.autoDestroy===!1&&(this.state&=~Ht),this.errored=null,this.defaultEncoding=Zt&&Zt.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,Zt&&Zt.encoding&&(this.decoder=new Et(Zt.encoding),this.encoding=Zt.encoding)}function lr(Zt){if(!(this instanceof lr))return new lr(Zt);const Qt=this instanceof requireDuplex();this._readableState=new fr(Zt,this,Qt),Zt&&(typeof Zt.read=="function"&&(this._read=Zt.read),typeof Zt.destroy=="function"&&(this._destroy=Zt.destroy),typeof Zt.construct=="function"&&(this._construct=Zt.construct),Zt.signal&&!Qt&&pt(Zt.signal,this)),ct.call(this,Zt),Ct.construct(this,()=>{this._readableState.needReadable&&Nt(this,this._readableState)})}lr.prototype.destroy=Ct.destroy,lr.prototype._undestroy=Ct.undestroy,lr.prototype._destroy=function(Zt,Qt){Qt(Zt)},lr.prototype[lt.captureRejectionSymbol]=function(Zt){this.destroy(Zt)},lr.prototype[it]=function(){let Zt;return this.destroyed||(Zt=this.readableEnded?null:new mt,this.destroy(Zt)),new nt((Qt,or)=>yt(this,ar=>ar&&ar!==Zt?or(ar):Qt(null)))},lr.prototype.push=function(Zt,Qt){return wr(this,Zt,Qt,!1)},lr.prototype.unshift=function(Zt,Qt){return wr(this,Zt,Qt,!0)};function wr(Zt,Qt,or,ar){vt("readableAddChunk",Qt);const cr=Zt._readableState;let vr;if(cr.state&Rt||(typeof Qt=="string"?(or=or||cr.defaultEncoding,cr.encoding!==or&&(ar&&cr.encoding?Qt=dt.from(Qt,or).toString(cr.encoding):(Qt=dt.from(Qt,or),or=""))):Qt instanceof dt?or="":ct._isUint8Array(Qt)?(Qt=ct._uint8ArrayToBuffer(Qt),or=""):Qt!=null&&(vr=new kt("chunk",["string","Buffer","Uint8Array"],Qt))),vr)St(Zt,vr);else if(Qt===null)cr.state&=~Vt,_r(Zt,cr);else if(cr.state&Rt||Qt&&Qt.length>0)if(ar)if(cr.state&Mt)St(Zt,new bt);else{if(cr.destroyed||cr.errored)return!1;hr(Zt,cr,Qt,!0)}else if(cr.ended)St(Zt,new ht);else{if(cr.destroyed||cr.errored)return!1;cr.state&=~Vt,cr.decoder&&!or?(Qt=cr.decoder.write(Qt),cr.objectMode||Qt.length!==0?hr(Zt,cr,Qt,!1):Nt(Zt,cr)):hr(Zt,cr,Qt,!1)}else ar||(cr.state&=~Vt,Nt(Zt,cr));return!cr.ended&&(cr.length0?(Qt.state&nr?Qt.awaitDrainWriters.clear():Qt.awaitDrainWriters=null,Qt.dataEmitted=!0,Zt.emit("data",or)):(Qt.length+=Qt.objectMode?1:or.length,ar?Qt.buffer.unshift(or):Qt.buffer.push(or),Qt.state&jt&&Rr(Zt)),Nt(Zt,Qt)}lr.prototype.isPaused=function(){const Zt=this._readableState;return Zt[xt]===!0||Zt.flowing===!1},lr.prototype.setEncoding=function(Zt){const Qt=new Et(Zt);this._readableState.decoder=Qt,this._readableState.encoding=this._readableState.decoder.encoding;const or=this._readableState.buffer;let ar="";for(const cr of or)ar+=Qt.write(cr);return or.clear(),ar!==""&&or.push(ar),this._readableState.length=ar.length,this};const Er=1073741824;function Pr(Zt){if(Zt>Er)throw new Tt("size","<= 1GiB",Zt);return Zt--,Zt|=Zt>>>1,Zt|=Zt>>>2,Zt|=Zt>>>4,Zt|=Zt>>>8,Zt|=Zt>>>16,Zt++,Zt}function br(Zt,Qt){return Zt<=0||Qt.length===0&&Qt.ended?0:Qt.state&Rt?1:j(Zt)?Qt.flowing&&Qt.length?Qt.buffer.first().length:Qt.length:Zt<=Qt.length?Zt:Qt.ended?Qt.length:0}lr.prototype.read=function(Zt){vt("read",Zt),Zt===void 0?Zt=NaN:$(Zt)||(Zt=_e(Zt,10));const Qt=this._readableState,or=Zt;if(Zt>Qt.highWaterMark&&(Qt.highWaterMark=Pr(Zt)),Zt!==0&&(Qt.state&=~Ft),Zt===0&&Qt.needReadable&&((Qt.highWaterMark!==0?Qt.length>=Qt.highWaterMark:Qt.length>0)||Qt.ended))return vt("read: emitReadable",Qt.length,Qt.ended),Qt.length===0&&Qt.ended?yr(this):Rr(this),null;if(Zt=br(Zt,Qt),Zt===0&&Qt.ended)return Qt.length===0&&yr(this),null;let ar=(Qt.state&jt)!==0;if(vt("need readable",ar),(Qt.length===0||Qt.length-Zt0?cr=dr(Zt,Qt):cr=null,cr===null?(Qt.needReadable=Qt.length<=Qt.highWaterMark,Zt=0):(Qt.length-=Zt,Qt.multiAwaitDrain?Qt.awaitDrainWriters.clear():Qt.awaitDrainWriters=null),Qt.length===0&&(Qt.ended||(Qt.needReadable=!0),or!==Zt&&Qt.ended&&yr(this)),cr!==null&&!Qt.errorEmitted&&!Qt.closeEmitted&&(Qt.dataEmitted=!0,this.emit("data",cr)),cr};function _r(Zt,Qt){if(vt("onEofChunk"),!Qt.ended){if(Qt.decoder){const or=Qt.decoder.end();or&&or.length&&(Qt.buffer.push(or),Qt.length+=Qt.objectMode?1:or.length)}Qt.ended=!0,Qt.sync?Rr(Zt):(Qt.needReadable=!1,Qt.emittedReadable=!0,Wt(Zt))}}function Rr(Zt){const Qt=Zt._readableState;vt("emitReadable",Qt.needReadable,Qt.emittedReadable),Qt.needReadable=!1,Qt.emittedReadable||(vt("emitReadable",Qt.flowing),Qt.emittedReadable=!0,o.nextTick(Wt,Zt))}function Wt(Zt){const Qt=Zt._readableState;vt("emitReadable_",Qt.destroyed,Qt.length,Qt.ended),!Qt.destroyed&&!Qt.errored&&(Qt.length||Qt.ended)&&(Zt.emit("readable"),Qt.emittedReadable=!1),Qt.needReadable=!Qt.flowing&&!Qt.ended&&Qt.length<=Qt.highWaterMark,Sr(Zt)}function Nt(Zt,Qt){!Qt.readingMore&&Qt.constructed&&(Qt.readingMore=!0,o.nextTick(Dt,Zt,Qt))}function Dt(Zt,Qt){for(;!Qt.reading&&!Qt.ended&&(Qt.length1&&ar.pipes.includes(Zt)&&(vt("false write response, pause",ar.awaitDrainWriters.size),ar.awaitDrainWriters.add(Zt)),or.pause()),Mr||(Mr=Yt(or,Zt),Zt.on("drain",Mr))}or.on("data",Hr);function Hr(Wr){vt("ondata");const qr=Zt.write(Wr);vt("dest.write",qr),qr===!1&&Lr()}function Or(Wr){if(vt("onerror",Wr),Fr(),Zt.removeListener("error",Or),Zt.listenerCount("error")===0){const qr=Zt._writableState||Zt._readableState;qr&&!qr.errorEmitted?St(Zt,Wr):Zt.emit("error",Wr)}}ft(Zt,"error",Or);function zr(){Zt.removeListener("finish",Ur),Fr()}Zt.once("close",zr);function Ur(){vt("onfinish"),Zt.removeListener("close",zr),Fr()}Zt.once("finish",Ur);function Fr(){vt("unpipe"),or.unpipe(Zt)}return Zt.emit("pipe",or),Zt.writableNeedDrain===!0?Lr():ar.flowing||(vt("pipe resume"),or.resume()),Zt};function Yt(Zt,Qt){return function(){const ar=Zt._readableState;ar.awaitDrainWriters===Qt?(vt("pipeOnDrain",1),ar.awaitDrainWriters=null):ar.multiAwaitDrain&&(vt("pipeOnDrain",ar.awaitDrainWriters.size),ar.awaitDrainWriters.delete(Qt)),(!ar.awaitDrainWriters||ar.awaitDrainWriters.size===0)&&Zt.listenerCount("data")&&Zt.resume()}}lr.prototype.unpipe=function(Zt){const Qt=this._readableState,or={hasUnpiped:!1};if(Qt.pipes.length===0)return this;if(!Zt){const cr=Qt.pipes;Qt.pipes=[],this.pause();for(let vr=0;vr0,ar.flowing!==!1&&this.resume()):Zt==="readable"&&!ar.endEmitted&&!ar.readableListening&&(ar.readableListening=ar.needReadable=!0,ar.flowing=!1,ar.emittedReadable=!1,vt("on readable",ar.length,ar.reading),ar.length?Rr(this):ar.reading||o.nextTick(ir,this)),or},lr.prototype.addListener=lr.prototype.on,lr.prototype.removeListener=function(Zt,Qt){const or=ct.prototype.removeListener.call(this,Zt,Qt);return Zt==="readable"&&o.nextTick(er,this),or},lr.prototype.off=lr.prototype.removeListener,lr.prototype.removeAllListeners=function(Zt){const Qt=ct.prototype.removeAllListeners.apply(this,arguments);return(Zt==="readable"||Zt===void 0)&&o.nextTick(er,this),Qt};function er(Zt){const Qt=Zt._readableState;Qt.readableListening=Zt.listenerCount("readable")>0,Qt.resumeScheduled&&Qt[xt]===!1?Qt.flowing=!0:Zt.listenerCount("data")>0?Zt.resume():Qt.readableListening||(Qt.flowing=null)}function ir(Zt){vt("readable nexttick read 0"),Zt.read(0)}lr.prototype.resume=function(){const Zt=this._readableState;return Zt.flowing||(vt("resume"),Zt.flowing=!Zt.readableListening,sr(this,Zt)),Zt[xt]=!1,this};function sr(Zt,Qt){Qt.resumeScheduled||(Qt.resumeScheduled=!0,o.nextTick(xr,Zt,Qt))}function xr(Zt,Qt){vt("resume",Qt.reading),Qt.reading||Zt.read(0),Qt.resumeScheduled=!1,Zt.emit("resume"),Sr(Zt),Qt.flowing&&!Qt.reading&&Zt.read(0)}lr.prototype.pause=function(){return vt("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(vt("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[xt]=!0,this};function Sr(Zt){const Qt=Zt._readableState;for(vt("flow",Qt.flowing);Qt.flowing&&Zt.read()!==null;);}lr.prototype.wrap=function(Zt){let Qt=!1;Zt.on("data",ar=>{!this.push(ar)&&Zt.pause&&(Qt=!0,Zt.pause())}),Zt.on("end",()=>{this.push(null)}),Zt.on("error",ar=>{St(this,ar)}),Zt.on("close",()=>{this.destroy()}),Zt.on("destroy",()=>{this.destroy()}),this._read=()=>{Qt&&Zt.resume&&(Qt=!1,Zt.resume())};const or=tt(Zt);for(let ar=1;ar{cr=$r?At(cr,$r):null,or(),or=$t});try{for(;;){const $r=Zt.destroyed?null:Zt.read();if($r!==null)yield $r;else{if(cr)throw cr;if(cr===null)return;await new nt(ar)}}}catch($r){throw cr=At(cr,$r),cr}finally{(cr||(Qt==null?void 0:Qt.destroyOnReturn)!==!1)&&(cr===void 0||Zt._readableState.autoDestroy)?Ct.destroyer(Zt,null):(Zt.off("readable",ar),vr())}}et(lr.prototype,{readable:{__proto__:null,get(){const Zt=this._readableState;return!!Zt&&Zt.readable!==!1&&!Zt.destroyed&&!Zt.errorEmitted&&!Zt.endEmitted},set(Zt){this._readableState&&(this._readableState.readable=!!Zt)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(Zt){this._readableState&&(this._readableState.flowing=Zt)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(Zt){this._readableState&&(this._readableState.destroyed=Zt)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),et(fr.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[xt]!==!1},set(Zt){this[xt]=!!Zt}}}),lr._fromList=dr;function dr(Zt,Qt){if(Qt.length===0)return null;let or;return Qt.objectMode?or=Qt.buffer.shift():!Zt||Zt>=Qt.length?(Qt.decoder?or=Qt.buffer.join(""):Qt.buffer.length===1?or=Qt.buffer.first():or=Qt.buffer.concat(Qt.length),Qt.buffer.clear()):or=Qt.buffer.consume(Zt,Qt.decoder),or}function yr(Zt){const Qt=Zt._readableState;vt("endReadable",Qt.endEmitted),Qt.endEmitted||(Qt.ended=!0,o.nextTick(Ir,Qt,Zt))}function Ir(Zt,Qt){if(vt("endReadableNT",Zt.endEmitted,Zt.length),!Zt.errored&&!Zt.closeEmitted&&!Zt.endEmitted&&Zt.length===0){if(Zt.endEmitted=!0,Qt.emit("end"),Qt.writable&&Qt.allowHalfOpen===!1)o.nextTick(Nr,Qt);else if(Zt.autoDestroy){const or=Qt._writableState;(!or||or.autoDestroy&&(or.finished||or.writable===!1))&&Qt.destroy()}}}function Nr(Zt){Zt.writable&&!Zt.writableEnded&&!Zt.destroyed&&Zt.end()}lr.from=function(Zt,Qt){return _t(lr,Zt,Qt)};let Tr;function Dr(){return Tr===void 0&&(Tr={}),Tr}return lr.fromWeb=function(Zt,Qt){return Dr().newStreamReadableFromReadableStream(Zt,Qt)},lr.toWeb=function(Zt,Qt){return Dr().newReadableStreamFromStreamReadable(Zt,Qt)},lr.wrap=function(Zt,Qt){var or,ar;return new lr({objectMode:(or=(ar=Zt.readableObjectMode)!==null&&ar!==void 0?ar:Zt.objectMode)!==null&&or!==void 0?or:!0,...Qt,destroy(cr,vr){Ct.destroyer(Zt,cr),vr(cr)}}).wrap(Zt)},readable}var writable,hasRequiredWritable;function requireWritable(){if(hasRequiredWritable)return writable;hasRequiredWritable=1;const o=dist,{ArrayPrototypeSlice:_,Error:$,FunctionPrototypeSymbolHasInstance:j,ObjectDefineProperty:_e,ObjectDefineProperties:et,ObjectSetPrototypeOf:tt,StringPrototypeToLowerCase:rt,Symbol:nt,SymbolHasInstance:ot}=primordials;writable=gt,gt.WritableState=bt;const{EventEmitter:it}=eventsExports,st=legacy.Stream,{Buffer:at}=require$$0$1,lt=destroy_1,{addAbortSignal:ct}=addAbortSignalExports,{getHighWaterMark:ft,getDefaultHighWaterMark:dt}=state,{ERR_INVALID_ARG_TYPE:pt,ERR_METHOD_NOT_IMPLEMENTED:yt,ERR_MULTIPLE_CALLBACK:vt,ERR_STREAM_CANNOT_PIPE:wt,ERR_STREAM_DESTROYED:Ct,ERR_STREAM_ALREADY_FINISHED:Pt,ERR_STREAM_NULL_VALUES:Bt,ERR_STREAM_WRITE_AFTER_END:At,ERR_UNKNOWN_ENCODING:kt}=errors.codes,{errorOrDestroy:Ot}=lt;tt(gt.prototype,st.prototype),tt(gt,st);function Tt(){}const ht=nt("kOnFinished");function bt(Ht,Kt,Jt){typeof Jt!="boolean"&&(Jt=Kt instanceof requireDuplex()),this.objectMode=!!(Ht&&Ht.objectMode),Jt&&(this.objectMode=this.objectMode||!!(Ht&&Ht.writableObjectMode)),this.highWaterMark=Ht?ft(this,Ht,"writableHighWaterMark",Jt):dt(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;const tr=!!(Ht&&Ht.decodeStrings===!1);this.decodeStrings=!tr,this.defaultEncoding=Ht&&Ht.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=St.bind(void 0,Kt),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,mt(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!Ht||Ht.emitClose!==!1,this.autoDestroy=!Ht||Ht.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ht]=[]}function mt(Ht){Ht.buffered=[],Ht.bufferedIndex=0,Ht.allBuffers=!0,Ht.allNoop=!0}bt.prototype.getBuffer=function(){return _(this.buffered,this.bufferedIndex)},_e(bt.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function gt(Ht){const Kt=this instanceof requireDuplex();if(!Kt&&!j(gt,this))return new gt(Ht);this._writableState=new bt(Ht,this,Kt),Ht&&(typeof Ht.write=="function"&&(this._write=Ht.write),typeof Ht.writev=="function"&&(this._writev=Ht.writev),typeof Ht.destroy=="function"&&(this._destroy=Ht.destroy),typeof Ht.final=="function"&&(this._final=Ht.final),typeof Ht.construct=="function"&&(this._construct=Ht.construct),Ht.signal&&ct(Ht.signal,this)),st.call(this,Ht),lt.construct(this,()=>{const Jt=this._writableState;Jt.writing||Vt(this,Jt),Ft(this,Jt)})}_e(gt,ot,{__proto__:null,value:function(Ht){return j(this,Ht)?!0:this!==gt?!1:Ht&&Ht._writableState instanceof bt}}),gt.prototype.pipe=function(){Ot(this,new wt)};function xt(Ht,Kt,Jt,tr){const nr=Ht._writableState;if(typeof Jt=="function")tr=Jt,Jt=nr.defaultEncoding;else{if(!Jt)Jt=nr.defaultEncoding;else if(Jt!=="buffer"&&!at.isEncoding(Jt))throw new kt(Jt);typeof tr!="function"&&(tr=Tt)}if(Kt===null)throw new Bt;if(!nr.objectMode)if(typeof Kt=="string")nr.decodeStrings!==!1&&(Kt=at.from(Kt,Jt),Jt="buffer");else if(Kt instanceof at)Jt="buffer";else if(st._isUint8Array(Kt))Kt=st._uint8ArrayToBuffer(Kt),Jt="buffer";else throw new pt("chunk",["string","Buffer","Uint8Array"],Kt);let ur;return nr.ending?ur=new At:nr.destroyed&&(ur=new Ct("write")),ur?(o.nextTick(tr,ur),Ot(Ht,ur,!0),ur):(nr.pendingcb++,Et(Ht,nr,Kt,Jt,tr))}gt.prototype.write=function(Ht,Kt,Jt){return xt(this,Ht,Kt,Jt)===!0},gt.prototype.cork=function(){this._writableState.corked++},gt.prototype.uncork=function(){const Ht=this._writableState;Ht.corked&&(Ht.corked--,Ht.writing||Vt(this,Ht))},gt.prototype.setDefaultEncoding=function(Kt){if(typeof Kt=="string"&&(Kt=rt(Kt)),!at.isEncoding(Kt))throw new kt(Kt);return this._writableState.defaultEncoding=Kt,this};function Et(Ht,Kt,Jt,tr,nr){const ur=Kt.objectMode?1:Jt.length;Kt.length+=ur;const rr=Kt.lengthJt.bufferedIndex&&Vt(Ht,Jt),tr?Jt.afterWriteTickInfo!==null&&Jt.afterWriteTickInfo.cb===nr?Jt.afterWriteTickInfo.count++:(Jt.afterWriteTickInfo={count:1,cb:nr,stream:Ht,state:Jt},o.nextTick(Rt,Jt.afterWriteTickInfo)):It(Ht,Jt,1,nr))}function Rt({stream:Ht,state:Kt,count:Jt,cb:tr}){return Kt.afterWriteTickInfo=null,It(Ht,Kt,Jt,tr)}function It(Ht,Kt,Jt,tr){for(!Kt.ending&&!Ht.destroyed&&Kt.length===0&&Kt.needDrain&&(Kt.needDrain=!1,Ht.emit("drain"));Jt-- >0;)Kt.pendingcb--,tr();Kt.destroyed&&Mt(Kt),Ft(Ht,Kt)}function Mt(Ht){if(Ht.writing)return;for(let nr=Ht.bufferedIndex;nr1&&Ht._writev){Kt.pendingcb-=ur-1;const pr=Kt.allNoop?Tt:lr=>{for(let wr=rr;wr256?(Jt.splice(0,rr),Kt.bufferedIndex=0):Kt.bufferedIndex=rr}Kt.bufferProcessing=!1}gt.prototype._write=function(Ht,Kt,Jt){if(this._writev)this._writev([{chunk:Ht,encoding:Kt}],Jt);else throw new yt("_write()")},gt.prototype._writev=null,gt.prototype.end=function(Ht,Kt,Jt){const tr=this._writableState;typeof Ht=="function"?(Jt=Ht,Ht=null,Kt=null):typeof Kt=="function"&&(Jt=Kt,Kt=null);let nr;if(Ht!=null){const ur=xt(this,Ht,Kt);ur instanceof $&&(nr=ur)}return tr.corked&&(tr.corked=1,this.uncork()),nr||(!tr.errored&&!tr.ending?(tr.ending=!0,Ft(this,tr,!0),tr.ended=!0):tr.finished?nr=new Pt("end"):tr.destroyed&&(nr=new Ct("end"))),typeof Jt=="function"&&(nr||tr.finished?o.nextTick(Jt,nr):tr[ht].push(Jt)),this};function Gt(Ht){return Ht.ending&&!Ht.destroyed&&Ht.constructed&&Ht.length===0&&!Ht.errored&&Ht.buffered.length===0&&!Ht.finished&&!Ht.writing&&!Ht.errorEmitted&&!Ht.closeEmitted}function zt(Ht,Kt){let Jt=!1;function tr(nr){if(Jt){Ot(Ht,nr??vt());return}if(Jt=!0,Kt.pendingcb--,nr){const ur=Kt[ht].splice(0);for(let rr=0;rr{Gt(nr)?qt(tr,nr):nr.pendingcb--},Ht,Kt)):Gt(Kt)&&(Kt.pendingcb++,qt(Ht,Kt))))}function qt(Ht,Kt){Kt.pendingcb--,Kt.finished=!0;const Jt=Kt[ht].splice(0);for(let tr=0;tr{if(Mt!=null)throw new ct("nully","body",Mt)},Mt=>{ft(Rt,Mt)});return Rt=new kt({objectMode:!0,readable:!1,write:Et,final(Mt){_t(async()=>{try{await It,o.nextTick(Mt,null)}catch(Vt){o.nextTick(Mt,Vt)}})},destroy:$t})}throw new ct("Iterable, AsyncIterable or AsyncFunction",mt,xt)}if(Pt(bt))return ht(bt.arrayBuffer());if(_e(bt))return wt(kt,bt,{objectMode:!0,writable:!1});if(ot(bt==null?void 0:bt.readable)&&it(bt==null?void 0:bt.writable))return kt.fromWeb(bt);if(typeof(bt==null?void 0:bt.writable)=="object"||typeof(bt==null?void 0:bt.readable)=="object"){const xt=bt!=null&&bt.readable?tt(bt==null?void 0:bt.readable)?bt==null?void 0:bt.readable:ht(bt.readable):void 0,Et=bt!=null&&bt.writable?rt(bt==null?void 0:bt.writable)?bt==null?void 0:bt.writable:ht(bt.writable):void 0;return Tt({readable:xt,writable:Et})}const gt=bt==null?void 0:bt.then;if(typeof gt=="function"){let xt;return At(gt,bt,Et=>{Et!=null&&xt.push(Et),xt.push(null)},Et=>{ft(xt,Et)}),xt=new kt({objectMode:!0,writable:!1,read(){}})}throw new lt(mt,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],bt)};function Ot(ht){let{promise:bt,resolve:mt}=vt();const gt=new Bt,xt=gt.signal;return{value:ht(async function*(){for(;;){const _t=bt;bt=null;const{chunk:$t,done:St,cb:Rt}=await _t;if(o.nextTick(Rt),St)return;if(xt.aborted)throw new at(void 0,{cause:xt.reason});({promise:bt,resolve:mt}=vt()),yield $t}}(),{signal:xt}),write(_t,$t,St){const Rt=mt;mt=null,Rt({chunk:_t,done:!1,cb:St})},final(_t){const $t=mt;mt=null,$t({done:!0,cb:_t})},destroy(_t,$t){gt.abort(),$t(_t)}}}function Tt(ht){const bt=ht.readable&&typeof ht.readable.read!="function"?pt.wrap(ht.readable):ht.readable,mt=ht.writable;let gt=!!$(bt),xt=!!j(mt),Et,_t,$t,St,Rt;function It(Mt){const Vt=St;St=null,Vt?Vt(Mt):Mt&&Rt.destroy(Mt)}return Rt=new kt({readableObjectMode:!!(bt!=null&&bt.readableObjectMode),writableObjectMode:!!(mt!=null&&mt.writableObjectMode),readable:gt,writable:xt}),xt&&(st(mt,Mt=>{xt=!1,Mt&&ft(bt,Mt),It(Mt)}),Rt._write=function(Mt,Vt,Gt){mt.write(Mt,Vt)?Gt():Et=Gt},Rt._final=function(Mt){mt.end(),_t=Mt},mt.on("drain",function(){if(Et){const Mt=Et;Et=null,Mt()}}),mt.on("finish",function(){if(_t){const Mt=_t;_t=null,Mt()}})),gt&&(st(bt,Mt=>{gt=!1,Mt&&ft(bt,Mt),It(Mt)}),bt.on("readable",function(){if($t){const Mt=$t;$t=null,Mt()}}),bt.on("end",function(){Rt.push(null)}),Rt._read=function(){for(;;){const Mt=bt.read();if(Mt===null){$t=Rt._read;return}if(!Rt.push(Mt))return}}),Rt._destroy=function(Mt,Vt){!Mt&&St!==null&&(Mt=new at),$t=null,Et=null,_t=null,St===null?Vt(Mt):(St=Vt,ft(mt,Mt),ft(bt,Mt))},Rt}return duplexify}var duplex,hasRequiredDuplex;function requireDuplex(){if(hasRequiredDuplex)return duplex;hasRequiredDuplex=1;const{ObjectDefineProperties:o,ObjectGetOwnPropertyDescriptor:_,ObjectKeys:$,ObjectSetPrototypeOf:j}=primordials;duplex=tt;const _e=requireReadable(),et=requireWritable();j(tt.prototype,_e.prototype),j(tt,_e);{const it=$(et.prototype);for(let st=0;st{if(_){o?o(_):this.destroy(_);return}$!=null&&this.push($),this.push(null),o&&o()}):(this.push(null),o&&o())}function prefinish(){this._final!==final&&final.call(this)}Transform$1.prototype._final=final;Transform$1.prototype._transform=function(o,_,$){throw new ERR_METHOD_NOT_IMPLEMENTED("_transform()")};Transform$1.prototype._write=function(o,_,$){const j=this._readableState,_e=this._writableState,et=j.length;this._transform(o,_,(tt,rt)=>{if(tt){$(tt);return}rt!=null&&this.push(rt),_e.ended||et===j.length||j.length{j=!0});const _e=eos$1(o,{readable:_,writable:$},et=>{j=!et});return{destroy:et=>{j||(j=!0,destroyImpl.destroyer(o,et||new ERR_STREAM_DESTROYED("pipe")))},cleanup:_e}}function popCallback(o){return validateFunction(o[o.length-1],"streams[stream.length - 1]"),o.pop()}function makeAsyncIterable(o){if(isIterable(o))return o;if(isReadableNodeStream(o))return fromReadable(o);throw new ERR_INVALID_ARG_TYPE$1("val",["Readable","Iterable","AsyncIterable"],o)}async function*fromReadable(o){Readable||(Readable=requireReadable()),yield*Readable.prototype[SymbolAsyncIterator].call(o)}async function pumpToNode(o,_,$,{end:j}){let _e,et=null;const tt=ot=>{if(ot&&(_e=ot),et){const it=et;et=null,it()}},rt=()=>new Promise$2((ot,it)=>{_e?it(_e):et=()=>{_e?it(_e):ot()}});_.on("drain",tt);const nt=eos$1(_,{readable:!1},tt);try{_.writableNeedDrain&&await rt();for await(const ot of o)_.write(ot)||await rt();j&&(_.end(),await rt()),$()}catch(ot){$(_e!==ot?aggregateTwoErrors(_e,ot):ot)}finally{nt(),_.off("drain",tt)}}async function pumpToWeb(o,_,$,{end:j}){isTransformStream$1(_)&&(_=_.writable);const _e=_.getWriter();try{for await(const et of o)await _e.ready,_e.write(et).catch(()=>{});await _e.ready,j&&await _e.close(),$()}catch(et){try{await _e.abort(et),$(et)}catch(tt){$(tt)}}}function pipeline$1(...o){return pipelineImpl(o,once(popCallback(o)))}function pipelineImpl(o,_,$){if(o.length===1&&ArrayIsArray(o[0])&&(o=o[0]),o.length<2)throw new ERR_MISSING_ARGS$2("streams");const j=new AbortController$2,_e=j.signal,et=$==null?void 0:$.signal,tt=[];validateAbortSignal$1(et,"options.signal");function rt(){ct(new AbortError$2)}addAbortListener=addAbortListener||utilExports.addAbortListener;let nt;et&&(nt=addAbortListener(et,rt));let ot,it;const st=[];let at=0;function lt(yt){ct(yt,--at===0)}function ct(yt,vt){var wt;if(yt&&(!ot||ot.code==="ERR_STREAM_PREMATURE_CLOSE")&&(ot=yt),!(!ot&&!vt)){for(;st.length;)st.shift()(ot);(wt=nt)===null||wt===void 0||wt[SymbolDispose](),j.abort(),vt&&(ot||tt.forEach(Ct=>Ct()),process.nextTick(_,ot,it))}}let ft;for(let yt=0;yt0,Pt=wt||($==null?void 0:$.end)!==!1,Bt=yt===o.length-1;if(isNodeStream$2(vt)){let At=function(kt){kt&&kt.name!=="AbortError"&&kt.code!=="ERR_STREAM_PREMATURE_CLOSE"&<(kt)};if(Pt){const{destroy:kt,cleanup:Ot}=destroyer$1(vt,wt,Ct);st.push(kt),isReadable$1(vt)&&Bt&&tt.push(Ot)}vt.on("error",At),isReadable$1(vt)&&Bt&&tt.push(()=>{vt.removeListener("error",At)})}if(yt===0)if(typeof vt=="function"){if(ft=vt({signal:_e}),!isIterable(ft))throw new ERR_INVALID_RETURN_VALUE("Iterable, AsyncIterable or Stream","source",ft)}else isIterable(vt)||isReadableNodeStream(vt)||isTransformStream$1(vt)?ft=vt:ft=Duplex$1.from(vt);else if(typeof vt=="function"){if(isTransformStream$1(ft)){var dt;ft=makeAsyncIterable((dt=ft)===null||dt===void 0?void 0:dt.readable)}else ft=makeAsyncIterable(ft);if(ft=vt(ft,{signal:_e}),wt){if(!isIterable(ft,!0))throw new ERR_INVALID_RETURN_VALUE("AsyncIterable",`transform[${yt-1}]`,ft)}else{var pt;PassThrough||(PassThrough=passthrough);const At=new PassThrough({objectMode:!0}),kt=(pt=ft)===null||pt===void 0?void 0:pt.then;if(typeof kt=="function")at++,kt.call(ft,ht=>{it=ht,ht!=null&&At.write(ht),Pt&&At.end(),process.nextTick(lt)},ht=>{At.destroy(ht),process.nextTick(lt,ht)});else if(isIterable(ft,!0))at++,pumpToNode(ft,At,lt,{end:Pt});else if(isReadableStream$1(ft)||isTransformStream$1(ft)){const ht=ft.readable||ft;at++,pumpToNode(ht,At,lt,{end:Pt})}else throw new ERR_INVALID_RETURN_VALUE("AsyncIterable or Promise","destination",ft);ft=At;const{destroy:Ot,cleanup:Tt}=destroyer$1(ft,!1,!0);st.push(Ot),Bt&&tt.push(Tt)}}else if(isNodeStream$2(vt)){if(isReadableNodeStream(ft)){at+=2;const At=pipe(ft,vt,lt,{end:Pt});isReadable$1(vt)&&Bt&&tt.push(At)}else if(isTransformStream$1(ft)||isReadableStream$1(ft)){const At=ft.readable||ft;at++,pumpToNode(At,vt,lt,{end:Pt})}else if(isIterable(ft))at++,pumpToNode(ft,vt,lt,{end:Pt});else throw new ERR_INVALID_ARG_TYPE$1("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ft);ft=vt}else if(isWebStream$1(vt)){if(isReadableNodeStream(ft))at++,pumpToWeb(makeAsyncIterable(ft),vt,lt,{end:Pt});else if(isReadableStream$1(ft)||isIterable(ft))at++,pumpToWeb(ft,vt,lt,{end:Pt});else if(isTransformStream$1(ft))at++,pumpToWeb(ft.readable,vt,lt,{end:Pt});else throw new ERR_INVALID_ARG_TYPE$1("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],ft);ft=vt}else ft=Duplex$1.from(vt)}return(_e!=null&&_e.aborted||et!=null&&et.aborted)&&process.nextTick(rt),ft}function pipe(o,_,$,{end:j}){let _e=!1;if(_.on("close",()=>{_e||$(new ERR_STREAM_PREMATURE_CLOSE)}),o.pipe(_,{end:!1}),j){let et=function(){_e=!0,_.end()};isReadableFinished(o)?process.nextTick(et):o.once("end",et)}else $();return eos$1(o,{readable:!0,writable:!1},et=>{const tt=o._readableState;et&&et.code==="ERR_STREAM_PREMATURE_CLOSE"&&tt&&tt.ended&&!tt.errored&&!tt.errorEmitted?o.once("end",$).once("error",$):$(et)}),eos$1(_,{readable:!1,writable:!0},$)}var pipeline_1={pipelineImpl,pipeline:pipeline$1};const{pipeline}=pipeline_1,Duplex=requireDuplex(),{destroyer}=destroy_1,{isNodeStream:isNodeStream$1,isReadable,isWritable:isWritable$1,isWebStream,isTransformStream,isWritableStream,isReadableStream}=utils,{AbortError:AbortError$1,codes:{ERR_INVALID_ARG_VALUE:ERR_INVALID_ARG_VALUE$1,ERR_MISSING_ARGS:ERR_MISSING_ARGS$1}}=errors,eos=endOfStreamExports;var compose$2=function o(..._){if(_.length===0)throw new ERR_MISSING_ARGS$1("streams");if(_.length===1)return Duplex.from(_[0]);const $=[..._];if(typeof _[0]=="function"&&(_[0]=Duplex.from(_[0])),typeof _[_.length-1]=="function"){const lt=_.length-1;_[lt]=Duplex.from(_[lt])}for(let lt=0;lt<_.length;++lt)if(!(!isNodeStream$1(_[lt])&&!isWebStream(_[lt]))){if(lt<_.length-1&&!(isReadable(_[lt])||isReadableStream(_[lt])||isTransformStream(_[lt])))throw new ERR_INVALID_ARG_VALUE$1(`streams[${lt}]`,$[lt],"must be readable");if(lt>0&&!(isWritable$1(_[lt])||isWritableStream(_[lt])||isTransformStream(_[lt])))throw new ERR_INVALID_ARG_VALUE$1(`streams[${lt}]`,$[lt],"must be writable")}let j,_e,et,tt,rt;function nt(lt){const ct=tt;tt=null,ct?ct(lt):lt?rt.destroy(lt):!at&&!st&&rt.destroy()}const ot=_[0],it=pipeline(_,nt),st=!!(isWritable$1(ot)||isWritableStream(ot)||isTransformStream(ot)),at=!!(isReadable(it)||isReadableStream(it)||isTransformStream(it));if(rt=new Duplex({writableObjectMode:!!(ot!=null&&ot.writableObjectMode),readableObjectMode:!!(it!=null&&it.readableObjectMode),writable:st,readable:at}),st){if(isNodeStream$1(ot))rt._write=function(ct,ft,dt){ot.write(ct,ft)?dt():j=dt},rt._final=function(ct){ot.end(),_e=ct},ot.on("drain",function(){if(j){const ct=j;j=null,ct()}});else if(isWebStream(ot)){const ft=(isTransformStream(ot)?ot.writable:ot).getWriter();rt._write=async function(dt,pt,yt){try{await ft.ready,ft.write(dt).catch(()=>{}),yt()}catch(vt){yt(vt)}},rt._final=async function(dt){try{await ft.ready,ft.close().catch(()=>{}),_e=dt}catch(pt){dt(pt)}}}const lt=isTransformStream(it)?it.readable:it;eos(lt,()=>{if(_e){const ct=_e;_e=null,ct()}})}if(at){if(isNodeStream$1(it))it.on("readable",function(){if(et){const lt=et;et=null,lt()}}),it.on("end",function(){rt.push(null)}),rt._read=function(){for(;;){const lt=it.read();if(lt===null){et=rt._read;return}if(!rt.push(lt))return}};else if(isWebStream(it)){const ct=(isTransformStream(it)?it.readable:it).getReader();rt._read=async function(){for(;;)try{const{value:ft,done:dt}=await ct.read();if(!rt.push(ft))return;if(dt){rt.push(null);return}}catch{return}}}}return rt._destroy=function(lt,ct){!lt&&tt!==null&&(lt=new AbortError$1),et=null,j=null,_e=null,tt===null?ct(lt):(tt=ct,isNodeStream$1(it)&&destroyer(it,lt))},rt};const AbortController$1=globalThis.AbortController||requireBrowser().AbortController,{codes:{ERR_INVALID_ARG_VALUE,ERR_INVALID_ARG_TYPE,ERR_MISSING_ARGS,ERR_OUT_OF_RANGE},AbortError}=errors,{validateAbortSignal,validateInteger,validateObject:validateObject$1}=validators,kWeakHandler=primordials.Symbol("kWeak"),kResistStopPropagation=primordials.Symbol("kResistStopPropagation"),{finished}=endOfStreamExports,staticCompose=compose$2,{addAbortSignalNoValidate}=addAbortSignalExports,{isWritable,isNodeStream}=utils,{deprecate}=utilExports,{ArrayPrototypePush,Boolean:Boolean$1,MathFloor,Number:Number$1,NumberIsNaN,Promise:Promise$1,PromiseReject,PromiseResolve,PromisePrototypeThen,Symbol:Symbol$2}=primordials,kEmpty=Symbol$2("kEmpty"),kEof=Symbol$2("kEof");function compose$1(o,_){if(_!=null&&validateObject$1(_,"options"),(_==null?void 0:_.signal)!=null&&validateAbortSignal(_.signal,"options.signal"),isNodeStream(o)&&!isWritable(o))throw new ERR_INVALID_ARG_VALUE("stream",o,"must be writable");const $=staticCompose(this,o);return _!=null&&_.signal&&addAbortSignalNoValidate(_.signal,$),$}function map$1(o,_){if(typeof o!="function")throw new ERR_INVALID_ARG_TYPE("fn",["Function","AsyncFunction"],o);_!=null&&validateObject$1(_,"options"),(_==null?void 0:_.signal)!=null&&validateAbortSignal(_.signal,"options.signal");let $=1;(_==null?void 0:_.concurrency)!=null&&($=MathFloor(_.concurrency));let j=$-1;return(_==null?void 0:_.highWaterMark)!=null&&(j=MathFloor(_.highWaterMark)),validateInteger($,"options.concurrency",1),validateInteger(j,"options.highWaterMark",0),j+=$,(async function*(){const et=utilExports.AbortSignalAny([_==null?void 0:_.signal].filter(Boolean$1)),tt=this,rt=[],nt={signal:et};let ot,it,st=!1,at=0;function lt(){st=!0,ct()}function ct(){at-=1,ft()}function ft(){it&&!st&&at<$&&rt.length=j||at>=$)&&await new Promise$1(yt=>{it=yt})}rt.push(kEof)}catch(pt){const yt=PromiseReject(pt);PromisePrototypeThen(yt,ct,lt),rt.push(yt)}finally{st=!0,ot&&(ot(),ot=null)}}dt();try{for(;;){for(;rt.length>0;){const pt=await rt[0];if(pt===kEof)return;if(et.aborted)throw new AbortError;pt!==kEmpty&&(yield pt),rt.shift(),ft()}await new Promise$1(pt=>{ot=pt})}}finally{st=!0,it&&(it(),it=null)}}).call(this)}function asIndexedPairs(o=void 0){return o!=null&&validateObject$1(o,"options"),(o==null?void 0:o.signal)!=null&&validateAbortSignal(o.signal,"options.signal"),(async function*(){let $=0;for await(const _e of this){var j;if(o!=null&&(j=o.signal)!==null&&j!==void 0&&j.aborted)throw new AbortError({cause:o.signal.reason});yield[$++,_e]}}).call(this)}async function some(o,_=void 0){for await(const $ of filter.call(this,o,_))return!0;return!1}async function every(o,_=void 0){if(typeof o!="function")throw new ERR_INVALID_ARG_TYPE("fn",["Function","AsyncFunction"],o);return!await some.call(this,async(...$)=>!await o(...$),_)}async function find(o,_){for await(const $ of filter.call(this,o,_))return $}async function forEach(o,_){if(typeof o!="function")throw new ERR_INVALID_ARG_TYPE("fn",["Function","AsyncFunction"],o);async function $(j,_e){return await o(j,_e),kEmpty}for await(const j of map$1.call(this,$,_));}function filter(o,_){if(typeof o!="function")throw new ERR_INVALID_ARG_TYPE("fn",["Function","AsyncFunction"],o);async function $(j,_e){return await o(j,_e)?j:kEmpty}return map$1.call(this,$,_)}class ReduceAwareErrMissingArgs extends ERR_MISSING_ARGS{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function reduce(o,_,$){var j;if(typeof o!="function")throw new ERR_INVALID_ARG_TYPE("reducer",["Function","AsyncFunction"],o);$!=null&&validateObject$1($,"options"),($==null?void 0:$.signal)!=null&&validateAbortSignal($.signal,"options.signal");let _e=arguments.length>1;if($!=null&&(j=$.signal)!==null&&j!==void 0&&j.aborted){const ot=new AbortError(void 0,{cause:$.signal.reason});throw this.once("error",()=>{}),await finished(this.destroy(ot)),ot}const et=new AbortController$1,tt=et.signal;if($!=null&&$.signal){const ot={once:!0,[kWeakHandler]:this,[kResistStopPropagation]:!0};$.signal.addEventListener("abort",()=>et.abort(),ot)}let rt=!1;try{for await(const ot of this){var nt;if(rt=!0,$!=null&&(nt=$.signal)!==null&&nt!==void 0&&nt.aborted)throw new AbortError;_e?_=await o(_,ot,{signal:tt}):(_=ot,_e=!0)}if(!rt&&!_e)throw new ReduceAwareErrMissingArgs}finally{et.abort()}return _}async function toArray$1(o){o!=null&&validateObject$1(o,"options"),(o==null?void 0:o.signal)!=null&&validateAbortSignal(o.signal,"options.signal");const _=[];for await(const j of this){var $;if(o!=null&&($=o.signal)!==null&&$!==void 0&&$.aborted)throw new AbortError(void 0,{cause:o.signal.reason});ArrayPrototypePush(_,j)}return _}function flatMap(o,_){const $=map$1.call(this,o,_);return(async function*(){for await(const _e of $)yield*_e}).call(this)}function toIntegerOrInfinity(o){if(o=Number$1(o),NumberIsNaN(o))return 0;if(o<0)throw new ERR_OUT_OF_RANGE("number",">= 0",o);return o}function drop(o,_=void 0){return _!=null&&validateObject$1(_,"options"),(_==null?void 0:_.signal)!=null&&validateAbortSignal(_.signal,"options.signal"),o=toIntegerOrInfinity(o),(async function*(){var j;if(_!=null&&(j=_.signal)!==null&&j!==void 0&&j.aborted)throw new AbortError;for await(const et of this){var _e;if(_!=null&&(_e=_.signal)!==null&&_e!==void 0&&_e.aborted)throw new AbortError;o--<=0&&(yield et)}}).call(this)}function take(o,_=void 0){return _!=null&&validateObject$1(_,"options"),(_==null?void 0:_.signal)!=null&&validateAbortSignal(_.signal,"options.signal"),o=toIntegerOrInfinity(o),(async function*(){var j;if(_!=null&&(j=_.signal)!==null&&j!==void 0&&j.aborted)throw new AbortError;for await(const et of this){var _e;if(_!=null&&(_e=_.signal)!==null&&_e!==void 0&&_e.aborted)throw new AbortError;if(o-- >0&&(yield et),o<=0)return}}).call(this)}operators.streamReturningOperators={asIndexedPairs:deprecate(asIndexedPairs,"readable.asIndexedPairs will be removed in a future version."),drop,filter,flatMap,map:map$1,take,compose:compose$1};operators.promiseReturningOperators={every,forEach,reduce,toArray:toArray$1,some,find};var promises,hasRequiredPromises;function requirePromises(){if(hasRequiredPromises)return promises;hasRequiredPromises=1;const{ArrayPrototypePop:o,Promise:_}=primordials,{isIterable:$,isNodeStream:j,isWebStream:_e}=utils,{pipelineImpl:et}=pipeline_1,{finished:tt}=endOfStreamExports;requireStream();function rt(...nt){return new _((ot,it)=>{let st,at;const lt=nt[nt.length-1];if(lt&&typeof lt=="object"&&!j(lt)&&!$(lt)&&!_e(lt)){const ct=o(nt);st=ct.signal,at=ct.end}et(nt,(ct,ft)=>{ct?it(ct):ot(ft)},{signal:st,end:at})})}return promises={finished:tt,pipeline:rt},promises}var hasRequiredStream;function requireStream(){if(hasRequiredStream)return stream.exports;hasRequiredStream=1;const{Buffer:o}=require$$0$1,{ObjectDefineProperty:_,ObjectKeys:$,ReflectApply:j}=primordials,{promisify:{custom:_e}}=utilExports,{streamReturningOperators:et,promiseReturningOperators:tt}=operators,{codes:{ERR_ILLEGAL_CONSTRUCTOR:rt}}=errors,nt=compose$2,{setDefaultHighWaterMark:ot,getDefaultHighWaterMark:it}=state,{pipeline:st}=pipeline_1,{destroyer:at}=destroy_1,lt=endOfStreamExports,ct=requirePromises(),ft=utils,dt=stream.exports=legacy.Stream;dt.isDestroyed=ft.isDestroyed,dt.isDisturbed=ft.isDisturbed,dt.isErrored=ft.isErrored,dt.isReadable=ft.isReadable,dt.isWritable=ft.isWritable,dt.Readable=requireReadable();for(const yt of $(et)){let wt=function(...Ct){if(new.target)throw rt();return dt.Readable.from(j(vt,this,Ct))};const vt=et[yt];_(wt,"name",{__proto__:null,value:vt.name}),_(wt,"length",{__proto__:null,value:vt.length}),_(dt.Readable.prototype,yt,{__proto__:null,value:wt,enumerable:!1,configurable:!0,writable:!0})}for(const yt of $(tt)){let wt=function(...Ct){if(new.target)throw rt();return j(vt,this,Ct)};const vt=tt[yt];_(wt,"name",{__proto__:null,value:vt.name}),_(wt,"length",{__proto__:null,value:vt.length}),_(dt.Readable.prototype,yt,{__proto__:null,value:wt,enumerable:!1,configurable:!0,writable:!0})}dt.Writable=requireWritable(),dt.Duplex=requireDuplex(),dt.Transform=transform,dt.PassThrough=passthrough,dt.pipeline=st;const{addAbortSignal:pt}=addAbortSignalExports;return dt.addAbortSignal=pt,dt.finished=lt,dt.destroy=at,dt.compose=nt,dt.setDefaultHighWaterMark=ot,dt.getDefaultHighWaterMark=it,_(dt,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ct}}),_(st,_e,{__proto__:null,enumerable:!0,get(){return ct.pipeline}}),_(lt,_e,{__proto__:null,enumerable:!0,get(){return ct.finished}}),dt.Stream=dt,dt._isUint8Array=function(vt){return vt instanceof Uint8Array},dt._uint8ArrayToBuffer=function(vt){return o.from(vt.buffer,vt.byteOffset,vt.byteLength)},stream.exports}(function(o){const _=requireStream(),$=requirePromises(),j=_.Readable.destroy;o.exports=_.Readable,o.exports._uint8ArrayToBuffer=_._uint8ArrayToBuffer,o.exports._isUint8Array=_._isUint8Array,o.exports.isDisturbed=_.isDisturbed,o.exports.isErrored=_.isErrored,o.exports.isReadable=_.isReadable,o.exports.Readable=_.Readable,o.exports.Writable=_.Writable,o.exports.Duplex=_.Duplex,o.exports.Transform=_.Transform,o.exports.PassThrough=_.PassThrough,o.exports.addAbortSignal=_.addAbortSignal,o.exports.finished=_.finished,o.exports.destroy=_.destroy,o.exports.destroy=j,o.exports.pipeline=_.pipeline,o.exports.compose=_.compose,Object.defineProperty(_,"promises",{configurable:!0,enumerable:!0,get(){return $}}),o.exports.Stream=_.Stream,o.exports.default=o.exports})(browser$1);function safeApply(o,_,$){try{Reflect.apply(o,_,$)}catch(j){setTimeout(()=>{throw j})}}function arrayClone(o){const _=o.length,$=new Array(_);for(let j=0;j<_;j+=1)$[j]=o[j];return $}class SafeEventEmitter extends eventsExports.EventEmitter{emit(_,...$){let j=_==="error";const _e=this._events;if(_e!==void 0)j=j&&_e.error===void 0;else if(!j)return!1;if(j){let tt;if($.length>0&&([tt]=$),tt instanceof Error)throw tt;const rt=new Error(`Unhandled error.${tt?` (${tt.message})`:""}`);throw rt.context=tt,rt}const et=_e[_];if(et===void 0)return!1;if(typeof et=="function")safeApply(et,this,$);else{const tt=et.length,rt=arrayClone(et);for(let nt=0;nt0}function isObject$1(o){return!!o&&typeof o=="object"&&!Array.isArray(o)}function isPlainObject$6(o){if(typeof o!="object"||o===null)return!1;try{let _=o;for(;Object.getPrototypeOf(_)!==null;)_=Object.getPrototypeOf(_);return Object.getPrototypeOf(o)===_}catch{return!1}}function isJsonRpcServerError(o){return o>=-32099&&o<=-32e3}function isJsonRpcError(o){const _=o;return!(!_||!isValidCode(_.code)||!isValidString(_.message)||_.stack&&!isValidString(_.stack))}function getMessageFromCode(o,_=FALLBACK_MESSAGE){if(isValidCode(o)){const $=o.toString();if(Object.hasOwn(errorValues,$))return errorValues[$].message;if(isJsonRpcServerError(o))return JSON_RPC_SERVER_ERROR_MESSAGE}return _}const FALLBACK_ERROR={code:FALLBACK_ERROR_CODE,message:getMessageFromCode(FALLBACK_ERROR_CODE)};function isValidJson(o){try{JSON.parse(JSON.stringify(o,(_,$)=>{if(_==="__proto__"||_==="constructor")throw new Error("Not valid json");if(typeof $=="function"||typeof $=="symbol")throw new Error("Not valid json");return $}),(_,$)=>{if(!(_==="__proto__"||_==="constructor"))return $})}catch{return!1}return!0}function serializeObject(o){return Object.getOwnPropertyNames(o).reduce((_,$)=>{const j=o[$];return isValidJson(j)&&(_[$]=j),_},{})}function serializeCause(o){return Array.isArray(o)?o.map(_=>isValidJson(_)?_:isObject$1(_)?serializeObject(_):null):isObject$1(o)?serializeObject(o):isValidJson(o)?o:null}function buildError(o,_){if(o&&typeof o=="object"&&"serialize"in o&&typeof o.serialize=="function")return o.serialize();if(isJsonRpcError(o))return o;const $=serializeCause(o);return _objectSpread2(_objectSpread2({},_),{},{data:{cause:$}})}function serializeError$1(o,{fallbackError:_=FALLBACK_ERROR,shouldIncludeStack:$=!0}={}){if(!isJsonRpcError(_))throw new Error("Must provide fallback error with integer number code and string message.");const j=buildError(o,_);return $||delete j.stack,j}function dataHasCause(o){return isObject$1(o)&&Object.hasOwn(o,"cause")&&isObject$1(o.cause)}function isValidEthProviderCode(o){return Number.isInteger(o)&&o>=1e3&&o<=4999}function stringifyReplacer(o,_){if(_!=="[Circular]")return _}class JsonRpcError extends Error{constructor(_,$,j){if(!Number.isInteger(_))throw new Error('"code" must be an integer.');if(!$||typeof $!="string")throw new Error('"message" must be a non-empty string.');dataHasCause(j)?(super($,{cause:j.cause}),_defineProperty$z(this,"cause",void 0),_defineProperty$z(this,"code",void 0),_defineProperty$z(this,"data",void 0),Object.hasOwn(this,"cause")||Object.assign(this,{cause:j.cause})):(super($),_defineProperty$z(this,"cause",void 0),_defineProperty$z(this,"code",void 0),_defineProperty$z(this,"data",void 0)),j!==void 0&&(this.data=j),this.code=_,this.cause=j==null?void 0:j.cause}serialize(){const _={code:this.code,message:this.message};return this.data!==void 0&&(_.data=this.data,isPlainObject$6(this.data)&&(_.data.cause=serializeCause(this.data.cause))),this.stack&&(_.stack=this.stack),_}toString(){return stringify$1(this.serialize(),{replacer:stringifyReplacer,space:2})}}class EthereumProviderError extends JsonRpcError{constructor(_,$,j){if(!isValidEthProviderCode(_))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(_,$,j)}}function parseOpts(o){if(o){if(typeof o=="string")return[o];if(typeof o=="object"&&!Array.isArray(o)){const{message:_,data:$}=o;if(_&&typeof _!="string")throw new Error("Must specify string message.");return[_??void 0,$]}}return[]}function getJsonRpcError(o,_){const[$,j]=parseOpts(_);return new JsonRpcError(o,$??getMessageFromCode(o),j)}function getEthProviderError(o,_){const[$,j]=parseOpts(_);return new EthereumProviderError(o,$??getMessageFromCode(o),j)}const rpcErrors={parse:o=>getJsonRpcError(errorCodes.rpc.parse,o),invalidRequest:o=>getJsonRpcError(errorCodes.rpc.invalidRequest,o),invalidParams:o=>getJsonRpcError(errorCodes.rpc.invalidParams,o),methodNotFound:o=>getJsonRpcError(errorCodes.rpc.methodNotFound,o),internal:o=>getJsonRpcError(errorCodes.rpc.internal,o),server:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:_}=o;if(!Number.isInteger(_)||_>-32005||_<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return getJsonRpcError(_,o)},invalidInput:o=>getJsonRpcError(errorCodes.rpc.invalidInput,o),resourceNotFound:o=>getJsonRpcError(errorCodes.rpc.resourceNotFound,o),resourceUnavailable:o=>getJsonRpcError(errorCodes.rpc.resourceUnavailable,o),transactionRejected:o=>getJsonRpcError(errorCodes.rpc.transactionRejected,o),methodNotSupported:o=>getJsonRpcError(errorCodes.rpc.methodNotSupported,o),limitExceeded:o=>getJsonRpcError(errorCodes.rpc.limitExceeded,o)},providerErrors={userRejectedRequest:o=>getEthProviderError(errorCodes.provider.userRejectedRequest,o),unauthorized:o=>getEthProviderError(errorCodes.provider.unauthorized,o),unsupportedMethod:o=>getEthProviderError(errorCodes.provider.unsupportedMethod,o),disconnected:o=>getEthProviderError(errorCodes.provider.disconnected,o),chainDisconnected:o=>getEthProviderError(errorCodes.provider.chainDisconnected,o),custom:o=>{if(!o||typeof o!="object"||Array.isArray(o))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:_,message:$,data:j}=o;if(!$||typeof $!="string")throw new Error('"message" must be a nonempty string');return new EthereumProviderError(_,$,j)}};function createScaffoldMiddleware(o){return(_,$,j,_e)=>{const et=o[_.method];return et===void 0?j():typeof et=="function"?et(_,$,j,_e):($.result=et,_e())}}function createAsyncMiddleware(o){return async(_,$,j,_e)=>{let et;const tt=new Promise(it=>{et=it});let rt=null,nt=!1;const ot=async()=>{nt=!0,j(it=>{rt=it,et()}),await tt};try{await o(_,$,ot),nt?(await tt,rt(null)):_e(null)}catch(it){const st=it;rt?rt(st):_e(st)}}}function constructFallbackError(o){const{message:_="",code:$=-32603,stack:j="Stack trace is not available.",data:_e=""}=o,et=parseInt(($==null?void 0:$.toString())||"-32603");return{message:_||(o==null?void 0:o.toString())||getMessageFromCode(et),code:et,stack:j,data:_e||_||(o==null?void 0:o.toString())}}class JRPCEngine extends SafeEventEmitter{constructor(){super(),_defineProperty$z(this,"_middleware",void 0),this._middleware=[]}static async _runAllMiddleware(_,$,j){const _e=[];let et=null,tt=!1;for(const rt of j)if([et,tt]=await JRPCEngine._runMiddleware(_,$,rt,_e),tt)break;return[et,tt,_e.reverse()]}static _runMiddleware(_,$,j,_e){return new Promise(et=>{const tt=nt=>{const ot=nt||$.error;ot&&(typeof ot=="object"&&Object.keys(ot).includes("stack")===!1&&(ot.stack="Stack trace is not available."),loglevel$1.error(ot),$.error=serializeError$1(ot,{shouldIncludeStack:!0,fallbackError:constructFallbackError(ot)})),et([ot,!0])},rt=nt=>{$.error?tt($.error):(nt&&(typeof nt!="function"&&tt(new SerializableError({code:-32603,message:"JRPCEngine: 'next' return handlers must be functions"})),_e.push(nt)),et([null,!1]))};try{j(_,$,rt,tt)}catch(nt){tt(nt)}})}static async _runReturnHandlers(_){for(const $ of _)await new Promise((j,_e)=>{$(et=>et?_e(et):j())})}static _checkForCompletion(_,$,j){if(!("result"in $)&&!("error"in $))throw new SerializableError({code:-32603,message:"Response has no error or result for request"});if(!j)throw new SerializableError({code:-32603,message:"Nothing ended request"})}push(_){this._middleware.push(_)}handle(_,$){if($&&typeof $!="function")throw new Error('"callback" must be a function if provided.');return Array.isArray(_)?$?this._handleBatch(_,$):this._handleBatch(_):$?this._handle(_,$):this._promiseHandle(_)}asMiddleware(){return async(_,$,j,_e)=>{try{const[et,tt,rt]=await JRPCEngine._runAllMiddleware(_,$,this._middleware);return tt?(await JRPCEngine._runReturnHandlers(rt),_e(et)):j(async nt=>{try{await JRPCEngine._runReturnHandlers(rt)}catch(ot){return nt(ot)}return nt()})}catch(et){return _e(et)}}}async _handleBatch(_,$){try{const j=await Promise.all(_.map(this._promiseHandle.bind(this)));return $?$(null,j):j}catch(j){if($)return $(j);throw j}}_promiseHandle(_){return new Promise(($,j)=>{this._handle(_,(_e,et)=>{_e&&et===void 0?j(_e):$(et)}).catch(j)})}async _handle(_,$){if(!_||Array.isArray(_)||typeof _!="object"){const tt=new SerializableError({code:-32603,message:"request must be plain object"});return $(tt,{id:void 0,jsonrpc:"2.0",error:tt})}if(typeof _.method!="string"){const tt=new SerializableError({code:-32603,message:"method must be string"});return $(tt,{id:_.id,jsonrpc:"2.0",error:tt})}const j=_objectSpread2({},_),_e={id:j.id,jsonrpc:j.jsonrpc};let et=null;try{await this._processRequest(j,_e)}catch(tt){et=tt}return et&&(delete _e.result,_e.error||(typeof et=="object"&&Object.keys(et).includes("stack")===!1&&(et.stack="Stack trace is not available."),loglevel$1.error(et),_e.error=serializeError$1(et,{shouldIncludeStack:!0,fallbackError:constructFallbackError(et)}))),$(et,_e)}async _processRequest(_,$){const[j,_e,et]=await JRPCEngine._runAllMiddleware(_,$,this._middleware);if(JRPCEngine._checkForCompletion(_,$,_e),await JRPCEngine._runReturnHandlers(et),j)throw j}}function mergeMiddleware(o){const _=new JRPCEngine;return o.forEach($=>{_.push($)}),_.asMiddleware()}function providerFromEngine(o){const _=new SafeEventEmitter;return _.sendAsync=async $=>{const j=await o.handle($);if(j.error){typeof j.error=="object"&&Object.keys(j.error).includes("stack")===!1&&(j.error.stack="Stack trace is not available."),loglevel$1.error(j.error);const _e=serializeError$1(j.error,{fallbackError:constructFallbackError(j.error),shouldIncludeStack:!0});throw rpcErrors.internal(_e)}return j.result},_.send=($,j)=>{if(typeof j!="function")throw new Error('Must provide callback to "send" method.');o.handle($,j)},o.on&&o.on("notification",$=>{_.emit("data",null,$)}),_.request=async $=>{const j=_objectSpread2(_objectSpread2({},$),{},{id:Math.random().toString(36).slice(2),jsonrpc:"2.0"});return await _.sendAsync(j)},_}function isHexString$1(o,_){return!(typeof o!="string"||!o.match(/^0x[0-9A-Fa-f]*$/))}const stripHexPrefix=o=>{if(typeof o!="string")throw new Error(`[stripHexPrefix] input must be type 'string', received ${typeof o}`);return isHexString$1(o)?o.slice(2):o};function padToEven(o){let _=o;if(typeof _!="string")throw new Error(`[padToEven] value must be type 'string', received ${typeof _}`);return _.length%2&&(_=`0${_}`),_}const assertIsBytes=function(o){if(!(o instanceof Uint8Array)){const _=`This method only supports Uint8Array but input was: ${o}`;throw new Error(_)}},assertIsString=function(o){if(typeof o!="string"){const _=`This method only supports strings but input was: ${o}`;throw new Error(_)}},BIGINT_0=BigInt(0),hexToBytesMapFirstKey={},hexToBytesMapSecondKey={};for(let o=0;o<16;o++){const _=o,$=o*16,j=o.toString(16).toLowerCase();hexToBytesMapSecondKey[j]=_,hexToBytesMapSecondKey[j.toUpperCase()]=_,hexToBytesMapFirstKey[j]=$,hexToBytesMapFirstKey[j.toUpperCase()]=$}function _unprefixedHexToBytes(o){const _=o.length,$=new Uint8Array(_/2);for(let j=0;j<_;j+=2)$[j/2]=hexToBytesMapFirstKey[o[j]]+hexToBytesMapSecondKey[o[j+1]];return $}const unprefixedHexToBytes=o=>{if(o.slice(0,2)==="0x")throw new Error("hex string is prefixed with 0x, should be unprefixed");return _unprefixedHexToBytes(padToEven(o))},hexByByte=Array.from({length:256},(o,_)=>_.toString(16).padStart(2,"0")),bytesToHex$1=o=>{let _="0x";if(o===void 0||o.length===0)return _;for(const $ of o)_=`${_}${hexByByte[$]}`;return _},BIGINT_CACHE=[];for(let o=0;o<=256*256-1;o++)BIGINT_CACHE[o]=BigInt(o);const bytesToBigInt=(o,_=!1)=>{_&&o.reverse();const $=bytesToHex$1(o);return $==="0x"?BIGINT_0:$.length===4?BIGINT_CACHE[o[0]]:$.length===6?BIGINT_CACHE[o[0]*256+o[1]]:BigInt($)},hexToBytes$1=o=>{if(typeof o!="string")throw new Error(`hex argument type ${typeof o} must be of type string`);if(!/^0x[0-9a-fA-F]*$/.test(o))throw new Error(`Input must be a 0x-prefixed hexadecimal string, got ${o}`);const _=o.slice(2);return _unprefixedHexToBytes(_.length%2===0?_:padToEven(_))},intToHex=o=>{if(!Number.isSafeInteger(o)||o<0)throw new Error(`Received an invalid integer type: ${o}`);return`0x${o.toString(16)}`},intToBytes=o=>{const _=intToHex(o);return hexToBytes$1(_)},bigIntToBytes=(o,_=!1)=>{const $=toBytes$1(`0x${padToEven(o.toString(16))}`);return _?$.reverse():$},toBytes$1=o=>{if(o==null)return new Uint8Array;if(Array.isArray(o)||o instanceof Uint8Array)return Uint8Array.from(o);if(typeof o=="string"){if(!isHexString$1(o))throw new Error(`Cannot convert string to Uint8Array. toBytes only supports 0x-prefixed hex strings and this string was given: ${o}`);return hexToBytes$1(o)}if(typeof o=="number")return intToBytes(o);if(typeof o=="bigint"){if(oBigInt.asIntN(256,bytesToBigInt(o)),toUnsigned=o=>bigIntToBytes(BigInt.asUintN(256,o)),addHexPrefix=o=>typeof o!="string"||isHexString$1(o)?o:`0x${o}`,bigIntToHex=o=>`0x${o.toString(16)}`;BigInt("0xffffffffffffffff");BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");BigInt("115792089237316195423570985008687907853269984665640564039457584007913129639935");secp256k1$2.CURVE.n;secp256k1$2.CURVE.n/BigInt(2);BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");const KECCAK256_NULL_S="0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470";hexToBytes$1(KECCAK256_NULL_S);const KECCAK256_RLP_ARRAY_S="0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347";hexToBytes$1(KECCAK256_RLP_ARRAY_S);const KECCAK256_RLP_S="0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421";hexToBytes$1(KECCAK256_RLP_S);Uint8Array.from([128]);BigInt(-1);BigInt(0);BigInt(1);BigInt(2);BigInt(3);BigInt(7);BigInt(8);BigInt(27);BigInt(28);BigInt(31);BigInt(32);BigInt(64);BigInt(128);BigInt(255);BigInt(256);BigInt(96);BigInt(100);BigInt(160);BigInt(224);BigInt(7922816251426434e13);BigInt(1461501637330903e33);BigInt(2695994666715064e52);BigInt(1e9);Array.from({length:256},(o,_)=>_.toString(16).padStart(2,"0"));const isValidAddress=function(o){try{assertIsString(o)}catch{return!1}return/^0x[0-9a-fA-F]{40}$/.test(o)},pubToAddress=function(o,_=!1){if(assertIsBytes(o),_&&o.length!==64&&(o=secp256k1$2.ProjectivePoint.fromHex(o).toRawBytes(!1).slice(1)),o.length!==64)throw new Error("Expected pubKey to be of length 64");return keccak256$2(o).subarray(-20)},publicToAddress=pubToAddress,privateToPublic=function(o){return assertIsBytes(o),secp256k1$2.ProjectivePoint.fromPrivateKey(o).toRawBytes(!1).slice(1)},privateToAddress=function(o){return publicToAddress(privateToPublic(o))};var KeyEncoding;(function(o){o.String="string",o.Bytes="view",o.Number="number"})(KeyEncoding||(KeyEncoding={}));var ValueEncoding;(function(o){o.String="string",o.Bytes="view",o.JSON="json"})(ValueEncoding||(ValueEncoding={}));var TypeOutput;(function(o){o[o.Number=0]="Number",o[o.BigInt=1]="BigInt",o[o.Uint8Array=2]="Uint8Array",o[o.PrefixedHexString=3]="PrefixedHexString"})(TypeOutput||(TypeOutput={}));function ecsign(o,_,$){const j=secp256k1$2.sign(o,_),_e=j.toCompactRawBytes(),et=_e.slice(0,32),tt=_e.slice(32,64),rt=BigInt(j.recovery+27);return{r:et,s:tt,v:rt}}var CLRequestType;(function(o){o[o.Deposit=0]="Deposit",o[o.Withdrawal=1]="Withdrawal",o[o.Consolidation=2]="Consolidation"})(CLRequestType||(CLRequestType={}));var VerkleLeafType;(function(o){o[o.Version=0]="Version",o[o.Balance=1]="Balance",o[o.Nonce=2]="Nonce",o[o.CodeHash=3]="CodeHash",o[o.CodeSize=4]="CodeSize"})(VerkleLeafType||(VerkleLeafType={}));intToBytes(VerkleLeafType.Version);intToBytes(VerkleLeafType.Balance);intToBytes(VerkleLeafType.Nonce);intToBytes(VerkleLeafType.CodeHash);intToBytes(VerkleLeafType.CodeSize);BigInt(256)**BigInt(31);function serializeError(o){const _=o.findIndex(et=>et instanceof Error),$=o.findIndex(et=>typeof et=="string"),j=o.findIndex(et=>et&&typeof et=="object"&&"status"in et&&"type"in et);let _e;if(j!==-1){const et=o[j];_e=new Error(`${et.status} ${et.type.toString()} ${et.statusText}`)}else _!==-1?_e=o.splice(_,1)[0]:$!==-1?_e=new Error(o.splice($,1)[0]):_e=new Error("Unknown error");return[_e,o]}class Web3AuthError extends CustomError{constructor(_,$,j){super($),_defineProperty$z(this,"code",void 0),_defineProperty$z(this,"message",void 0),_defineProperty$z(this,"cause",void 0),this.code=_,this.message=$||"",this.cause=j,Object.defineProperty(this,"name",{value:"Web3AuthError"})}toJSON(){return{name:this.name,code:this.code,message:this.message,cause:serializeError([this.cause])}}toString(){return JSON.stringify(this.toJSON())}}class WalletInitializationError extends Web3AuthError{constructor(_,$,j){super(_,$,j),Object.defineProperty(this,"name",{value:"WalletInitializationError"})}static fromCode(_,$="",j){return new WalletInitializationError(_,`${WalletInitializationError.messages[_]}, ${$}`,j)}static notFound(_="",$){return WalletInitializationError.fromCode(5001,_,$)}static notInstalled(_="",$){return WalletInitializationError.fromCode(5002,_,$)}static notReady(_="",$){return WalletInitializationError.fromCode(5003,_,$)}static windowBlocked(_="",$){return WalletInitializationError.fromCode(5004,_,$)}static windowClosed(_="",$){return WalletInitializationError.fromCode(5005,_,$)}static incompatibleChainNameSpace(_="",$){return WalletInitializationError.fromCode(5006,_,$)}static duplicateAdapterError(_="",$){return WalletInitializationError.fromCode(5007,_,$)}static invalidProviderConfigError(_="",$){return WalletInitializationError.fromCode(5008,_,$)}static providerNotReadyError(_="",$){return WalletInitializationError.fromCode(5009,_,$)}static rpcConnectionError(_="",$){return WalletInitializationError.fromCode(5010,_,$)}static invalidParams(_="",$){return WalletInitializationError.fromCode(5011,_,$)}static invalidNetwork(_="",$){return WalletInitializationError.fromCode(5013,_,$)}}_defineProperty$z(WalletInitializationError,"messages",{5e3:"Custom",5001:"Wallet is not found",5002:"Wallet is not installed",5003:"Wallet is not ready yet",5004:"Wallet window is blocked",5005:"Wallet window has been closed by the user",5006:"Incompatible chain namespace provided",5007:"Adapter has already been included",5008:"Invalid provider Config",5009:"Provider is not ready yet",5010:"Failed to connect with rpc url",5011:"Invalid params passed in",5013:"Invalid network provided"});class WalletLoginError extends Web3AuthError{constructor(_,$,j){super(_,$,j),Object.defineProperty(this,"name",{value:"WalletLoginError"})}static fromCode(_,$="",j){return new WalletLoginError(_,`${WalletLoginError.messages[_]}. ${$}`,j)}static connectionError(_="",$){return WalletLoginError.fromCode(5111,_,$)}static disconnectionError(_="",$){return WalletLoginError.fromCode(5112,_,$)}static notConnectedError(_="",$){return WalletLoginError.fromCode(5113,_,$)}static popupClosed(_="",$){return WalletLoginError.fromCode(5114,_,$)}static mfaEnabled(_="",$){return WalletLoginError.fromCode(5115,_,$)}static chainConfigNotAdded(_="",$){return WalletLoginError.fromCode(5116,_,$)}static unsupportedOperation(_="",$){return WalletLoginError.fromCode(5117,_,$)}static coreKitKeyNotFound(_="",$){return WalletLoginError.fromCode(5118,_,$)}static userNotLoggedIn(_="",$){return WalletLoginError.fromCode(5119,_,$)}}_defineProperty$z(WalletLoginError,"messages",{5e3:"Custom",5111:"Failed to connect with wallet",5112:"Failed to disconnect from wallet",5113:"Wallet is not connected",5114:"Wallet popup has been closed by the user",5115:"User has already enabled mfa, please use the @web3auth/web3auth-web sdk for login with mfa",5116:"Chain config has not been added. Please add the chain config before calling switchChain",5117:"Unsupported operation",5118:"useCoreKitKey flag is enabled but coreKitKey is not available",5119:"User not logged in."});class WalletOperationsError extends Web3AuthError{constructor(_,$,j){super(_,$,j),Object.defineProperty(this,"name",{value:"WalletOperationsError"})}static fromCode(_,$="",j){return new WalletOperationsError(_,`${WalletOperationsError.messages[_]}, ${$}`,j)}static chainIDNotAllowed(_="",$){return WalletOperationsError.fromCode(5201,_,$)}static operationNotAllowed(_="",$){return WalletOperationsError.fromCode(5202,_,$)}static chainNamespaceNotAllowed(_="",$){return WalletOperationsError.fromCode(5203,_,$)}}_defineProperty$z(WalletOperationsError,"messages",{5e3:"Custom",5201:"Provided chainId is not allowed",5202:"This operation is not allowed"});class WalletProviderError extends Web3AuthError{constructor(_,$,j){super(_,$,j),Object.defineProperty(this,"name",{value:"WalletProviderError"})}static fromCode(_,$="",j){return new WalletOperationsError(_,`${WalletProviderError.messages[_]}, ${$}`,j)}static invalidRequestArgs(_="",$){return WalletOperationsError.fromCode(5301,_,$)}static invalidRequestMethod(_="",$){return WalletOperationsError.fromCode(5302,_,$)}static invalidRequestParams(_="",$){return WalletOperationsError.fromCode(5303,_,$)}}_defineProperty$z(WalletProviderError,"messages",{5e3:"Custom",5301:"Expected a single, non-array, object argument.",5302:"'args.method' must be a non-empty string.",5303:"'args.params' must be an object or array if provided."});const CHAIN_NAMESPACES={EIP155:"eip155",SOLANA:"solana",CASPER:"casper",XRPL:"xrpl",OTHER:"other"},ADAPTER_NAMESPACES={MULTICHAIN:"multichain"},INFURA_PROXY_URL="https://api.web3auth.io/infura-service/v1",getDefaultNetworkId=o=>{if(o===CHAIN_NAMESPACES.EIP155)return 1;if(o===CHAIN_NAMESPACES.SOLANA)return 1;if(o===CHAIN_NAMESPACES.XRPL)return 1;throw WalletInitializationError.invalidParams(`Chain namespace ${o} is not supported`)},getEvmChainConfig=(o,_="")=>{const $=CHAIN_NAMESPACES.EIP155,j=`${INFURA_PROXY_URL}/${o}/${_}`;return o===1?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:$,chainId:"0x1",rpcTarget:j,displayName:"Ethereum Mainnet",blockExplorerUrl:"https://etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:o===10?{chainNamespace:CHAIN_NAMESPACES.EIP155,decimals:18,blockExplorerUrl:"https://optimistic.etherscan.io",chainId:"0xa",displayName:"Optimism",logo:"optimism.svg",rpcTarget:j,ticker:"ETH",tickerName:"Ethereum"}:o===8453?{chainNamespace:CHAIN_NAMESPACES.EIP155,decimals:18,blockExplorerUrl:"https://basescan.org",chainId:"0x2105",displayName:"Base",logo:"base.svg",rpcTarget:j,ticker:"ETH",tickerName:"Ethereum"}:o===42161?{chainNamespace:CHAIN_NAMESPACES.EIP155,decimals:18,blockExplorerUrl:"https://arbiscan.io",chainId:"0xa4b1",displayName:"Arbitrum One",logo:"arbitrum.svg",rpcTarget:j,ticker:"ETH",tickerName:"Ethereum"}:o===59144?{chainNamespace:CHAIN_NAMESPACES.EIP155,decimals:18,blockExplorerUrl:"https://lineascan.build",chainId:"0xe708",logo:"https://images.toruswallet.io/eth.svg",rpcTarget:j,ticker:"ETH",tickerName:"Ethereum"}:o===11155111?{logo:"https://images.toruswallet.io/eth.svg",chainNamespace:$,chainId:"0xaa36a7",rpcTarget:j,displayName:"Sepolia Testnet",blockExplorerUrl:"https://sepolia.etherscan.io/",ticker:"ETH",tickerName:"Ethereum",decimals:18}:o===137?{logo:"https://images.toruswallet.io/polygon.svg",chainNamespace:$,chainId:"0x89",rpcTarget:j,displayName:"Polygon Mainnet",blockExplorerUrl:"https://polygonscan.com",ticker:"POL",tickerName:"Polygon Ecosystem Token"}:o===80002?{logo:"https://images.toruswallet.io/polygon.svg",chainNamespace:$,chainId:"0x13882",rpcTarget:j,displayName:"Polygon Amoy Testnet",blockExplorerUrl:"https://www.oklink.com/amoy",ticker:"POL",tickerName:"Polygon Ecosystem Token",decimals:18}:o===56?{logo:"https://images.toruswallet.io/bnb.png",chainNamespace:$,chainId:"0x38",rpcTarget:j,displayName:"Binance SmartChain Mainnet",blockExplorerUrl:"https://bscscan.com",ticker:"BNB",tickerName:"Binance SmartChain",decimals:18}:o===97?{logo:"https://images.toruswallet.io/bnb.png",chainNamespace:$,chainId:"0x61",rpcTarget:j,displayName:"Binance SmartChain Testnet",blockExplorerUrl:"https://testnet.bscscan.com",ticker:"BNB",tickerName:"Binance SmartChain",decimals:18}:o===25?{logo:"https://images.toruswallet.io/cro.svg",chainNamespace:$,chainId:"0x19",rpcTarget:"https://rpc.cronos.org",displayName:"Cronos Mainnet",blockExplorerUrl:"https://cronoscan.com/",ticker:"CRO",tickerName:"Cronos"}:o===338?{logo:"https://images.toruswallet.io/cro.svg",chainNamespace:$,chainId:"0x152",rpcTarget:"https://rpc-t3.cronos.org/",displayName:"Cronos Testnet",blockExplorerUrl:"https://cronoscan.com/",ticker:"CRO",tickerName:"Cronos",decimals:18}:o===8217?{logo:"https://images.toruswallet.io/klay.svg",chainNamespace:$,chainId:"0x2019",rpcTarget:"https://public-node-api.klaytnapi.com/v1/cypress",displayName:"Klaytn Mainnet",blockExplorerUrl:"https://scope.klaytn.com",ticker:"KLAY",tickerName:"Klaytn",decimals:18}:o===1946?{chainNamespace:CHAIN_NAMESPACES.EIP155,chainId:"0x79a",rpcTarget:"https://rpc.minato.soneium.org",displayName:"Soneium Minato Testnet",blockExplorerUrl:"https://explorer-testnet.soneium.org",ticker:"ETH",tickerName:"ETH",logo:"https://iili.io/2i5xce2.png"}:o===1868?{chainNamespace:CHAIN_NAMESPACES.EIP155,chainId:"0x74c",rpcTarget:"https://rpc.soneium.org",displayName:"Soneium Mainnet",blockExplorerUrl:"https://soneium.blockscout.com",ticker:"ETH",tickerName:"ETH",logo:"https://iili.io/2i5xce2.png"}:null},getSolanaChainConfig=o=>{const _=CHAIN_NAMESPACES.SOLANA;return o===101||o===1?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:_,chainId:"0x65",rpcTarget:"https://rpc.ankr.com/solana",displayName:"Solana Mainnet",blockExplorerUrl:"https://explorer.solana.com",ticker:"SOL",tickerName:"Solana",decimals:9}:o===102||o===2?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:_,chainId:"0x66",rpcTarget:"https://api.testnet.solana.com",displayName:"Solana Testnet",blockExplorerUrl:"https://explorer.solana.com?cluster=testnet",ticker:"SOL",tickerName:"Solana",decimals:9}:o===103||o===3?{logo:"https://images.toruswallet.io/sol.svg",chainNamespace:_,chainId:"0x67",rpcTarget:"https://api.devnet.solana.com",displayName:"Solana Devnet",blockExplorerUrl:"https://explorer.solana.com?cluster=devnet",ticker:"SOL",tickerName:"Solana",decimals:9}:null},getXrplChainConfig=o=>{const _=CHAIN_NAMESPACES.XRPL;return o===1?{chainNamespace:_,decimals:15,chainId:"0x1",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://ripple-node.tor.us",wsTarget:"wss://s2.ripple.com",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl mainnet",blockExplorerUrl:"https://livenet.xrpl.org"}:o===2?{chainNamespace:_,decimals:15,chainId:"0x2",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://testnet-ripple-node.tor.us",wsTarget:"wss://s.altnet.rippletest.net",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl testnet",blockExplorerUrl:"https://testnet.xrpl.org",isTestnet:!0}:o===3?{chainNamespace:_,decimals:15,chainId:"0x3",logo:"https://images.toruswallet.io/XRP.svg",rpcTarget:"https://devnet-ripple-node.tor.us",wsTarget:"wss://s.devnet.rippletest.net/",ticker:"XRP",tickerName:"XRPL",displayName:"xrpl devnet",blockExplorerUrl:"https://devnet.xrpl.org",isTestnet:!0}:null},getChainConfig=(o,_,$)=>{if(o===CHAIN_NAMESPACES.OTHER)return null;const j=_?typeof _=="number"?_:parseInt(_,16):getDefaultNetworkId(o);return o===CHAIN_NAMESPACES.EIP155?getEvmChainConfig(j,$):o===CHAIN_NAMESPACES.SOLANA?getSolanaChainConfig(j):o===CHAIN_NAMESPACES.XRPL?getXrplChainConfig(j):null};var loglevel=log$3.getLogger("web3auth-logger");class BaseController extends SafeEventEmitter{constructor({config:_={},state:$={}}){super(),_defineProperty$z(this,"defaultConfig",{}),_defineProperty$z(this,"defaultState",{}),_defineProperty$z(this,"disabled",!1),_defineProperty$z(this,"name","BaseController"),_defineProperty$z(this,"initialConfig",void 0),_defineProperty$z(this,"initialState",void 0),_defineProperty$z(this,"internalConfig",this.defaultConfig),_defineProperty$z(this,"internalState",this.defaultState),this.initialState=$,this.initialConfig=_}get config(){return this.internalConfig}get state(){return this.internalState}configure(_,$=!1,j=!0){if(j){this.internalConfig=$?_:Object.assign(this.internalConfig,_);for(const _e in this.internalConfig)typeof this.internalConfig[_e]<"u"&&(this[_e]=this.internalConfig[_e])}else for(const _e in _)typeof this.internalConfig[_e]<"u"&&(this.internalConfig[_e]=_[_e],this[_e]=_[_e])}update(_,$=!1){this.internalState=_objectSpread2($?{}:_objectSpread2({},this.internalState),_),this.emit("store",this.internalState)}initialize(){return this.internalState=this.defaultState,this.internalConfig=this.defaultConfig,this.configure(this.initialConfig),this.update(this.initialState),this}}const filterNoop=()=>!0,internalEvents=["newListener","removeListener"],externalEventFilter=o=>!internalEvents.includes(o);function getRawListeners(o,_){return typeof o.rawListeners<"u"?o.rawListeners(_):o.listeners(_)}function createEventEmitterProxy(o,_){let j={}.eventFilter||filterNoop;if(typeof j=="string"&&j==="skipInternal"&&(j=externalEventFilter),typeof j!="function")throw new Error("createEventEmitterProxy - Invalid eventFilter");let _e=o,et=rt=>{if(_e===rt)return;const nt=_e;_e=rt,nt.eventNames().filter(j).forEach(it=>{getRawListeners(nt,it).forEach(st=>{rt.on(it,st)})}),nt.removeAllListeners()};return new Proxy({},{get:(rt,nt)=>nt==="setTarget"?et:_e[nt],set:(rt,nt,ot)=>nt==="setTarget"?(et=ot,!0):(_e[nt]=ot,!0),has:(rt,nt)=>nt[0]==="_"?!1:nt in _e})}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor$1=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE$1=1e14,LOG_BASE$1=14,MAX_SAFE_INTEGER$1=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone$1(o){var _,$,j,_e=yt.prototype={constructor:yt,toString:null,valueOf:null},et=new yt(1),tt=20,rt=4,nt=-7,ot=21,it=-1e7,st=1e7,at=!1,lt=1,ct=0,ft={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:"Ā ",suffix:""},dt="0123456789abcdefghijklmnopqrstuvwxyz",pt=!0;function yt(At,kt){var Ot,Tt,ht,bt,mt,gt,xt,Et,_t=this;if(!(_t instanceof yt))return new yt(At,kt);if(kt==null){if(At&&At._isBigNumber===!0){_t.s=At.s,!At.c||At.e>st?_t.c=_t.e=null:At.e=10;mt/=10,bt++);bt>st?_t.c=_t.e=null:(_t.e=bt,_t.c=[At]);return}Et=String(At)}else{if(!isNumeric.test(Et=String(At)))return j(_t,Et,gt);_t.s=Et.charCodeAt(0)==45?(Et=Et.slice(1),-1):1}(bt=Et.indexOf("."))>-1&&(Et=Et.replace(".","")),(mt=Et.search(/e/i))>0?(bt<0&&(bt=mt),bt+=+Et.slice(mt+1),Et=Et.substring(0,mt)):bt<0&&(bt=Et.length)}else{if(intCheck(kt,2,dt.length,"Base"),kt==10&&pt)return _t=new yt(At),Pt(_t,tt+_t.e+1,rt);if(Et=String(At),gt=typeof At=="number"){if(At*0!=0)return j(_t,Et,gt,kt);if(_t.s=1/At<0?(Et=Et.slice(1),-1):1,yt.DEBUG&&Et.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+At)}else _t.s=Et.charCodeAt(0)===45?(Et=Et.slice(1),-1):1;for(Ot=dt.slice(0,kt),bt=mt=0,xt=Et.length;mtbt){bt=xt;continue}}else if(!ht&&(Et==Et.toUpperCase()&&(Et=Et.toLowerCase())||Et==Et.toLowerCase()&&(Et=Et.toUpperCase()))){ht=!0,mt=-1,bt=0;continue}return j(_t,String(At),gt,kt)}gt=!1,Et=$(Et,kt,10,_t.s),(bt=Et.indexOf("."))>-1?Et=Et.replace(".",""):bt=Et.length}for(mt=0;Et.charCodeAt(mt)===48;mt++);for(xt=Et.length;Et.charCodeAt(--xt)===48;);if(Et=Et.slice(mt,++xt)){if(xt-=mt,gt&&yt.DEBUG&&xt>15&&(At>MAX_SAFE_INTEGER$1||At!==mathfloor$1(At)))throw Error(tooManyDigits+_t.s*At);if((bt=bt-mt-1)>st)_t.c=_t.e=null;else if(bt=-MAX&&ht<=MAX&&ht===mathfloor$1(ht)){if(Tt[0]===0){if(ht===0&&Tt.length===1)return!0;break e}if(kt=(ht+1)%LOG_BASE$1,kt<1&&(kt+=LOG_BASE$1),String(Tt[0]).length==kt){for(kt=0;kt=BASE$1||Ot!==mathfloor$1(Ot))break e;if(Ot!==0)return!0}}}else if(Tt===null&&ht===null&&(bt===null||bt===1||bt===-1))return!0;throw Error(bignumberError+"Invalid BigNumber: "+At)},yt.maximum=yt.max=function(){return wt(arguments,-1)},yt.minimum=yt.min=function(){return wt(arguments,1)},yt.random=function(){var At=9007199254740992,kt=Math.random()*At&2097151?function(){return mathfloor$1(Math.random()*At)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(Ot){var Tt,ht,bt,mt,gt,xt=0,Et=[],_t=new yt(et);if(Ot==null?Ot=tt:intCheck(Ot,0,MAX),mt=mathceil(Ot/LOG_BASE$1),at)if(crypto.getRandomValues){for(Tt=crypto.getRandomValues(new Uint32Array(mt*=2));xt>>11),gt>=9e15?(ht=crypto.getRandomValues(new Uint32Array(2)),Tt[xt]=ht[0],Tt[xt+1]=ht[1]):(Et.push(gt%1e14),xt+=2);xt=mt/2}else if(crypto.randomBytes){for(Tt=crypto.randomBytes(mt*=7);xt=9e15?crypto.randomBytes(7).copy(Tt,xt):(Et.push(gt%1e14),xt+=7);xt=mt/7}else throw at=!1,Error(bignumberError+"crypto unavailable");if(!at)for(;xt=10;gt/=10,xt++);xtht-1&&(gt[mt+1]==null&&(gt[mt+1]=0),gt[mt+1]+=gt[mt]/ht|0,gt[mt]%=ht)}return gt.reverse()}return function(Ot,Tt,ht,bt,mt){var gt,xt,Et,_t,$t,St,Rt,It,Mt=Ot.indexOf("."),Vt=tt,Gt=rt;for(Mt>=0&&(_t=ct,ct=0,Ot=Ot.replace(".",""),It=new yt(Tt),St=It.pow(Ot.length-Mt),ct=_t,It.c=kt(toFixedPoint(coeffToString(St.c),St.e,"0"),10,ht,At),It.e=It.c.length),Rt=kt(Ot,Tt,ht,mt?(gt=dt,At):(gt=At,dt)),Et=_t=Rt.length;Rt[--_t]==0;Rt.pop());if(!Rt[0])return gt.charAt(0);if(Mt<0?--Et:(St.c=Rt,St.e=Et,St.s=bt,St=_(St,It,Vt,Gt,ht),Rt=St.c,$t=St.r,Et=St.e),xt=Et+Vt+1,Mt=Rt[xt],_t=ht/2,$t=$t||xt<0||Rt[xt+1]!=null,$t=Gt<4?(Mt!=null||$t)&&(Gt==0||Gt==(St.s<0?3:2)):Mt>_t||Mt==_t&&(Gt==4||$t||Gt==6&&Rt[xt-1]&1||Gt==(St.s<0?8:7)),xt<1||!Rt[0])Ot=$t?toFixedPoint(gt.charAt(1),-Vt,gt.charAt(0)):gt.charAt(0);else{if(Rt.length=xt,$t)for(--ht;++Rt[--xt]>ht;)Rt[xt]=0,xt||(++Et,Rt=[1].concat(Rt));for(_t=Rt.length;!Rt[--_t];);for(Mt=0,Ot="";Mt<=_t;Ot+=gt.charAt(Rt[Mt++]));Ot=toFixedPoint(Ot,Et,gt.charAt(0))}return Ot}}(),_=function(){function At(Tt,ht,bt){var mt,gt,xt,Et,_t=0,$t=Tt.length,St=ht%SQRT_BASE,Rt=ht/SQRT_BASE|0;for(Tt=Tt.slice();$t--;)xt=Tt[$t]%SQRT_BASE,Et=Tt[$t]/SQRT_BASE|0,mt=Rt*xt+Et*St,gt=St*xt+mt%SQRT_BASE*SQRT_BASE+_t,_t=(gt/bt|0)+(mt/SQRT_BASE|0)+Rt*Et,Tt[$t]=gt%bt;return _t&&(Tt=[_t].concat(Tt)),Tt}function kt(Tt,ht,bt,mt){var gt,xt;if(bt!=mt)xt=bt>mt?1:-1;else for(gt=xt=0;gtht[gt]?1:-1;break}return xt}function Ot(Tt,ht,bt,mt){for(var gt=0;bt--;)Tt[bt]-=gt,gt=Tt[bt]1;Tt.splice(0,1));}return function(Tt,ht,bt,mt,gt){var xt,Et,_t,$t,St,Rt,It,Mt,Vt,Gt,zt,jt,Ft,qt,Xt,Ut,Lt,Ht=Tt.s==ht.s?1:-1,Kt=Tt.c,Jt=ht.c;if(!Kt||!Kt[0]||!Jt||!Jt[0])return new yt(!Tt.s||!ht.s||(Kt?Jt&&Kt[0]==Jt[0]:!Jt)?NaN:Kt&&Kt[0]==0||!Jt?Ht*0:Ht/0);for(Mt=new yt(Ht),Vt=Mt.c=[],Et=Tt.e-ht.e,Ht=bt+Et+1,gt||(gt=BASE$1,Et=bitFloor(Tt.e/LOG_BASE$1)-bitFloor(ht.e/LOG_BASE$1),Ht=Ht/LOG_BASE$1|0),_t=0;Jt[_t]==(Kt[_t]||0);_t++);if(Jt[_t]>(Kt[_t]||0)&&Et--,Ht<0)Vt.push(1),$t=!0;else{for(qt=Kt.length,Ut=Jt.length,_t=0,Ht+=2,St=mathfloor$1(gt/(Jt[0]+1)),St>1&&(Jt=At(Jt,St,gt),Kt=At(Kt,St,gt),Ut=Jt.length,qt=Kt.length),Ft=Ut,Gt=Kt.slice(0,Ut),zt=Gt.length;zt=gt/2&&Xt++;do{if(St=0,xt=kt(Jt,Gt,Ut,zt),xt<0){if(jt=Gt[0],Ut!=zt&&(jt=jt*gt+(Gt[1]||0)),St=mathfloor$1(jt/Xt),St>1)for(St>=gt&&(St=gt-1),Rt=At(Jt,St,gt),It=Rt.length,zt=Gt.length;kt(Rt,Gt,It,zt)==1;)St--,Ot(Rt,Ut=10;Ht/=10,_t++);Pt(Mt,bt+(Mt.e=_t+Et*LOG_BASE$1-1)+1,mt,$t)}else Mt.e=Et,Mt.r=+$t;return Mt}}();function vt(At,kt,Ot,Tt){var ht,bt,mt,gt,xt;if(Ot==null?Ot=rt:intCheck(Ot,0,8),!At.c)return At.toString();if(ht=At.c[0],mt=At.e,kt==null)xt=coeffToString(At.c),xt=Tt==1||Tt==2&&(mt<=nt||mt>=ot)?toExponential(xt,mt):toFixedPoint(xt,mt,"0");else if(At=Pt(new yt(At),kt,Ot),bt=At.e,xt=coeffToString(At.c),gt=xt.length,Tt==1||Tt==2&&(kt<=bt||bt<=nt)){for(;gtmt),xt=toFixedPoint(xt,bt,"0"),bt+1>gt){if(--kt>0)for(xt+=".";kt--;xt+="0");}else if(kt+=bt-gt,kt>0)for(bt+1==gt&&(xt+=".");kt--;xt+="0");return At.s<0&&ht?"-"+xt:xt}function wt(At,kt){for(var Ot,Tt,ht=1,bt=new yt(At[0]);ht=10;ht/=10,Tt++);return(Ot=Tt+Ot*LOG_BASE$1-1)>st?At.c=At.e=null:Ot=10;gt/=10,ht++);if(bt=kt-ht,bt<0)bt+=LOG_BASE$1,mt=kt,xt=$t[Et=0],_t=mathfloor$1(xt/St[ht-mt-1]%10);else if(Et=mathceil((bt+1)/LOG_BASE$1),Et>=$t.length)if(Tt){for(;$t.length<=Et;$t.push(0));xt=_t=0,ht=1,bt%=LOG_BASE$1,mt=bt-LOG_BASE$1+1}else break e;else{for(xt=gt=$t[Et],ht=1;gt>=10;gt/=10,ht++);bt%=LOG_BASE$1,mt=bt-LOG_BASE$1+ht,_t=mt<0?0:mathfloor$1(xt/St[ht-mt-1]%10)}if(Tt=Tt||kt<0||$t[Et+1]!=null||(mt<0?xt:xt%St[ht-mt-1]),Tt=Ot<4?(_t||Tt)&&(Ot==0||Ot==(At.s<0?3:2)):_t>5||_t==5&&(Ot==4||Tt||Ot==6&&(bt>0?mt>0?xt/St[ht-mt]:0:$t[Et-1])%10&1||Ot==(At.s<0?8:7)),kt<1||!$t[0])return $t.length=0,Tt?(kt-=At.e+1,$t[0]=St[(LOG_BASE$1-kt%LOG_BASE$1)%LOG_BASE$1],At.e=-kt||0):$t[0]=At.e=0,At;if(bt==0?($t.length=Et,gt=1,Et--):($t.length=Et+1,gt=St[LOG_BASE$1-bt],$t[Et]=mt>0?mathfloor$1(xt/St[ht-mt]%St[mt])*gt:0),Tt)for(;;)if(Et==0){for(bt=1,mt=$t[0];mt>=10;mt/=10,bt++);for(mt=$t[0]+=gt,gt=1;mt>=10;mt/=10,gt++);bt!=gt&&(At.e++,$t[0]==BASE$1&&($t[0]=1));break}else{if($t[Et]+=gt,$t[Et]!=BASE$1)break;$t[Et--]=0,gt=1}for(bt=$t.length;$t[--bt]===0;$t.pop());}At.e>st?At.c=At.e=null:At.e=ot?toExponential(kt,Ot):toFixedPoint(kt,Ot,"0"),At.s<0?"-"+kt:kt)}return _e.absoluteValue=_e.abs=function(){var At=new yt(this);return At.s<0&&(At.s=1),At},_e.comparedTo=function(At,kt){return compare(this,new yt(At,kt))},_e.decimalPlaces=_e.dp=function(At,kt){var Ot,Tt,ht,bt=this;if(At!=null)return intCheck(At,0,MAX),kt==null?kt=rt:intCheck(kt,0,8),Pt(new yt(bt),At+bt.e+1,kt);if(!(Ot=bt.c))return null;if(Tt=((ht=Ot.length-1)-bitFloor(this.e/LOG_BASE$1))*LOG_BASE$1,ht=Ot[ht])for(;ht%10==0;ht/=10,Tt--);return Tt<0&&(Tt=0),Tt},_e.dividedBy=_e.div=function(At,kt){return _(this,new yt(At,kt),tt,rt)},_e.dividedToIntegerBy=_e.idiv=function(At,kt){return _(this,new yt(At,kt),0,1)},_e.exponentiatedBy=_e.pow=function(At,kt){var Ot,Tt,ht,bt,mt,gt,xt,Et,_t,$t=this;if(At=new yt(At),At.c&&!At.isInteger())throw Error(bignumberError+"Exponent not an integer: "+Bt(At));if(kt!=null&&(kt=new yt(kt)),gt=At.e>14,!$t.c||!$t.c[0]||$t.c[0]==1&&!$t.e&&$t.c.length==1||!At.c||!At.c[0])return _t=new yt(Math.pow(+Bt($t),gt?At.s*(2-isOdd(At)):+Bt(At))),kt?_t.mod(kt):_t;if(xt=At.s<0,kt){if(kt.c?!kt.c[0]:!kt.s)return new yt(NaN);Tt=!xt&&$t.isInteger()&&kt.isInteger(),Tt&&($t=$t.mod(kt))}else{if(At.e>9&&($t.e>0||$t.e<-1||($t.e==0?$t.c[0]>1||gt&&$t.c[1]>=24e7:$t.c[0]<8e13||gt&&$t.c[0]<=9999975e7)))return bt=$t.s<0&&isOdd(At)?-0:0,$t.e>-1&&(bt=1/bt),new yt(xt?1/bt:bt);ct&&(bt=mathceil(ct/LOG_BASE$1+2))}for(gt?(Ot=new yt(.5),xt&&(At.s=1),Et=isOdd(At)):(ht=Math.abs(+Bt(At)),Et=ht%2),_t=new yt(et);;){if(Et){if(_t=_t.times($t),!_t.c)break;bt?_t.c.length>bt&&(_t.c.length=bt):Tt&&(_t=_t.mod(kt))}if(ht){if(ht=mathfloor$1(ht/2),ht===0)break;Et=ht%2}else if(At=At.times(Ot),Pt(At,At.e+1,1),At.e>14)Et=isOdd(At);else{if(ht=+Bt(At),ht===0)break;Et=ht%2}$t=$t.times($t),bt?$t.c&&$t.c.length>bt&&($t.c.length=bt):Tt&&($t=$t.mod(kt))}return Tt?_t:(xt&&(_t=et.div(_t)),kt?_t.mod(kt):bt?Pt(_t,ct,rt,mt):_t)},_e.integerValue=function(At){var kt=new yt(this);return At==null?At=rt:intCheck(At,0,8),Pt(kt,kt.e+1,At)},_e.isEqualTo=_e.eq=function(At,kt){return compare(this,new yt(At,kt))===0},_e.isFinite=function(){return!!this.c},_e.isGreaterThan=_e.gt=function(At,kt){return compare(this,new yt(At,kt))>0},_e.isGreaterThanOrEqualTo=_e.gte=function(At,kt){return(kt=compare(this,new yt(At,kt)))===1||kt===0},_e.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE$1)>this.c.length-2},_e.isLessThan=_e.lt=function(At,kt){return compare(this,new yt(At,kt))<0},_e.isLessThanOrEqualTo=_e.lte=function(At,kt){return(kt=compare(this,new yt(At,kt)))===-1||kt===0},_e.isNaN=function(){return!this.s},_e.isNegative=function(){return this.s<0},_e.isPositive=function(){return this.s>0},_e.isZero=function(){return!!this.c&&this.c[0]==0},_e.minus=function(At,kt){var Ot,Tt,ht,bt,mt=this,gt=mt.s;if(At=new yt(At,kt),kt=At.s,!gt||!kt)return new yt(NaN);if(gt!=kt)return At.s=-kt,mt.plus(At);var xt=mt.e/LOG_BASE$1,Et=At.e/LOG_BASE$1,_t=mt.c,$t=At.c;if(!xt||!Et){if(!_t||!$t)return _t?(At.s=-kt,At):new yt($t?mt:NaN);if(!_t[0]||!$t[0])return $t[0]?(At.s=-kt,At):new yt(_t[0]?mt:rt==3?-0:0)}if(xt=bitFloor(xt),Et=bitFloor(Et),_t=_t.slice(),gt=xt-Et){for((bt=gt<0)?(gt=-gt,ht=_t):(Et=xt,ht=$t),ht.reverse(),kt=gt;kt--;ht.push(0));ht.reverse()}else for(Tt=(bt=(gt=_t.length)<(kt=$t.length))?gt:kt,gt=kt=0;kt0)for(;kt--;_t[Ot++]=0);for(kt=BASE$1-1;Tt>gt;){if(_t[--Tt]<$t[Tt]){for(Ot=Tt;Ot&&!_t[--Ot];_t[Ot]=kt);--_t[Ot],_t[Tt]+=BASE$1}_t[Tt]-=$t[Tt]}for(;_t[0]==0;_t.splice(0,1),--Et);return _t[0]?Ct(At,_t,Et):(At.s=rt==3?-1:1,At.c=[At.e=0],At)},_e.modulo=_e.mod=function(At,kt){var Ot,Tt,ht=this;return At=new yt(At,kt),!ht.c||!At.s||At.c&&!At.c[0]?new yt(NaN):!At.c||ht.c&&!ht.c[0]?new yt(ht):(lt==9?(Tt=At.s,At.s=1,Ot=_(ht,At,0,3),At.s=Tt,Ot.s*=Tt):Ot=_(ht,At,0,lt),At=ht.minus(Ot.times(At)),!At.c[0]&<==1&&(At.s=ht.s),At)},_e.multipliedBy=_e.times=function(At,kt){var Ot,Tt,ht,bt,mt,gt,xt,Et,_t,$t,St,Rt,It,Mt,Vt,Gt=this,zt=Gt.c,jt=(At=new yt(At,kt)).c;if(!zt||!jt||!zt[0]||!jt[0])return!Gt.s||!At.s||zt&&!zt[0]&&!jt||jt&&!jt[0]&&!zt?At.c=At.e=At.s=null:(At.s*=Gt.s,!zt||!jt?At.c=At.e=null:(At.c=[0],At.e=0)),At;for(Tt=bitFloor(Gt.e/LOG_BASE$1)+bitFloor(At.e/LOG_BASE$1),At.s*=Gt.s,xt=zt.length,$t=jt.length,xt<$t&&(It=zt,zt=jt,jt=It,ht=xt,xt=$t,$t=ht),ht=xt+$t,It=[];ht--;It.push(0));for(Mt=BASE$1,Vt=SQRT_BASE,ht=$t;--ht>=0;){for(Ot=0,St=jt[ht]%Vt,Rt=jt[ht]/Vt|0,mt=xt,bt=ht+mt;bt>ht;)Et=zt[--mt]%Vt,_t=zt[mt]/Vt|0,gt=Rt*Et+_t*St,Et=St*Et+gt%Vt*Vt+It[bt]+Ot,Ot=(Et/Mt|0)+(gt/Vt|0)+Rt*_t,It[bt--]=Et%Mt;It[bt]=Ot}return Ot?++Tt:It.splice(0,1),Ct(At,It,Tt)},_e.negated=function(){var At=new yt(this);return At.s=-At.s||null,At},_e.plus=function(At,kt){var Ot,Tt=this,ht=Tt.s;if(At=new yt(At,kt),kt=At.s,!ht||!kt)return new yt(NaN);if(ht!=kt)return At.s=-kt,Tt.minus(At);var bt=Tt.e/LOG_BASE$1,mt=At.e/LOG_BASE$1,gt=Tt.c,xt=At.c;if(!bt||!mt){if(!gt||!xt)return new yt(ht/0);if(!gt[0]||!xt[0])return xt[0]?At:new yt(gt[0]?Tt:ht*0)}if(bt=bitFloor(bt),mt=bitFloor(mt),gt=gt.slice(),ht=bt-mt){for(ht>0?(mt=bt,Ot=xt):(ht=-ht,Ot=gt),Ot.reverse();ht--;Ot.push(0));Ot.reverse()}for(ht=gt.length,kt=xt.length,ht-kt<0&&(Ot=xt,xt=gt,gt=Ot,kt=ht),ht=0;kt;)ht=(gt[--kt]=gt[kt]+xt[kt]+ht)/BASE$1|0,gt[kt]=BASE$1===gt[kt]?0:gt[kt]%BASE$1;return ht&&(gt=[ht].concat(gt),++mt),Ct(At,gt,mt)},_e.precision=_e.sd=function(At,kt){var Ot,Tt,ht,bt=this;if(At!=null&&At!==!!At)return intCheck(At,1,MAX),kt==null?kt=rt:intCheck(kt,0,8),Pt(new yt(bt),At,kt);if(!(Ot=bt.c))return null;if(ht=Ot.length-1,Tt=ht*LOG_BASE$1+1,ht=Ot[ht]){for(;ht%10==0;ht/=10,Tt--);for(ht=Ot[0];ht>=10;ht/=10,Tt++);}return At&&bt.e+1>Tt&&(Tt=bt.e+1),Tt},_e.shiftedBy=function(At){return intCheck(At,-MAX_SAFE_INTEGER$1,MAX_SAFE_INTEGER$1),this.times("1e"+At)},_e.squareRoot=_e.sqrt=function(){var At,kt,Ot,Tt,ht,bt=this,mt=bt.c,gt=bt.s,xt=bt.e,Et=tt+4,_t=new yt("0.5");if(gt!==1||!mt||!mt[0])return new yt(!gt||gt<0&&(!mt||mt[0])?NaN:mt?bt:1/0);if(gt=Math.sqrt(+Bt(bt)),gt==0||gt==1/0?(kt=coeffToString(mt),(kt.length+xt)%2==0&&(kt+="0"),gt=Math.sqrt(+kt),xt=bitFloor((xt+1)/2)-(xt<0||xt%2),gt==1/0?kt="5e"+xt:(kt=gt.toExponential(),kt=kt.slice(0,kt.indexOf("e")+1)+xt),Ot=new yt(kt)):Ot=new yt(gt+""),Ot.c[0]){for(xt=Ot.e,gt=xt+Et,gt<3&&(gt=0);;)if(ht=Ot,Ot=_t.times(ht.plus(_(bt,ht,Et,1))),coeffToString(ht.c).slice(0,gt)===(kt=coeffToString(Ot.c)).slice(0,gt))if(Ot.e0&&It>0){for(bt=It%gt||gt,_t=Rt.substr(0,bt);bt0&&(_t+=Et+Rt.slice(bt)),St&&(_t="-"+_t)}Tt=$t?_t+(Ot.decimalSeparator||"")+((xt=+Ot.fractionGroupSize)?$t.replace(new RegExp("\\d{"+xt+"}\\B","g"),"$&"+(Ot.fractionGroupSeparator||"")):$t):_t}return(Ot.prefix||"")+Tt+(Ot.suffix||"")},_e.toFraction=function(At){var kt,Ot,Tt,ht,bt,mt,gt,xt,Et,_t,$t,St,Rt=this,It=Rt.c;if(At!=null&&(gt=new yt(At),!gt.isInteger()&&(gt.c||gt.s!==1)||gt.lt(et)))throw Error(bignumberError+"Argument "+(gt.isInteger()?"out of range: ":"not an integer: ")+Bt(gt));if(!It)return new yt(Rt);for(kt=new yt(et),Et=Ot=new yt(et),Tt=xt=new yt(et),St=coeffToString(It),bt=kt.e=St.length-Rt.e-1,kt.c[0]=POWS_TEN[(mt=bt%LOG_BASE$1)<0?LOG_BASE$1+mt:mt],At=!At||gt.comparedTo(kt)>0?bt>0?kt:Et:gt,mt=st,st=1/0,gt=new yt(St),xt.c[0]=0;_t=_(gt,kt,0,1),ht=Ot.plus(_t.times(Tt)),ht.comparedTo(At)!=1;)Ot=Tt,Tt=ht,Et=xt.plus(_t.times(ht=Et)),xt=ht,kt=gt.minus(_t.times(ht=kt)),gt=ht;return ht=_(At.minus(Ot),Tt,0,1),xt=xt.plus(ht.times(Et)),Ot=Ot.plus(ht.times(Tt)),xt.s=Et.s=Rt.s,bt=bt*2,$t=_(Et,Tt,bt,rt).minus(Rt).abs().comparedTo(_(xt,Ot,bt,rt).minus(Rt).abs())<1?[Et,Tt]:[xt,Ot],st=mt,$t},_e.toNumber=function(){return+Bt(this)},_e.toPrecision=function(At,kt){return At!=null&&intCheck(At,1,MAX),vt(this,At,kt,2)},_e.toString=function(At){var kt,Ot=this,Tt=Ot.s,ht=Ot.e;return ht===null?Tt?(kt="Infinity",Tt<0&&(kt="-"+kt)):kt="NaN":(At==null?kt=ht<=nt||ht>=ot?toExponential(coeffToString(Ot.c),ht):toFixedPoint(coeffToString(Ot.c),ht,"0"):At===10&&pt?(Ot=Pt(new yt(Ot),tt+ht+1,rt),kt=toFixedPoint(coeffToString(Ot.c),Ot.e,"0")):(intCheck(At,2,dt.length,"Base"),kt=$(toFixedPoint(coeffToString(Ot.c),ht,"0"),10,At,Tt,!0)),Tt<0&&Ot.c[0]&&(kt="-"+kt)),kt},_e.valueOf=_e.toJSON=function(){return Bt(this)},_e._isBigNumber=!0,_e[Symbol.toStringTag]="BigNumber",_e[Symbol.for("nodejs.util.inspect.custom")]=_e.valueOf,o!=null&&yt.set(o),yt}function bitFloor(o){var _=o|0;return o>0||o===_?_:_-1}function coeffToString(o){for(var _,$,j=1,_e=o.length,et=o[0]+"";j<_e;){for(_=o[j++]+"",$=LOG_BASE$1-_.length;$--;_="0"+_);et+=_}for(_e=et.length;et.charCodeAt(--_e)===48;);return et.slice(0,_e+1||1)}function compare(o,_){var $,j,_e=o.c,et=_.c,tt=o.s,rt=_.s,nt=o.e,ot=_.e;if(!tt||!rt)return null;if($=_e&&!_e[0],j=et&&!et[0],$||j)return $?j?0:-rt:tt;if(tt!=rt)return tt;if($=tt<0,j=nt==ot,!_e||!et)return j?0:!_e^$?1:-1;if(!j)return nt>ot^$?1:-1;for(rt=(nt=_e.length)<(ot=et.length)?nt:ot,tt=0;ttet[tt]^$?1:-1;return nt==ot?0:nt>ot^$?1:-1}function intCheck(o,_,$,j){if(o<_||o>$||o!==mathfloor$1(o))throw Error(bignumberError+(j||"Argument")+(typeof o=="number"?o<_||o>$?" out of range: ":" not an integer: ":" not a primitive number: ")+String(o))}function isOdd(o){var _=o.c.length-1;return bitFloor(o.e/LOG_BASE$1)==_&&o.c[_]%2!=0}function toExponential(o,_){return(o.length>1?o.charAt(0)+"."+o.slice(1):o)+(_<0?"e":"e+")+_}function toFixedPoint(o,_,$){var j,_e;if(_<0){for(_e=$+".";++_;_e+=$);o=_e+o}else if(j=o.length,++_>j){for(_e=$,_-=j;--_;_e+=$);o+=_e}else _{const $=Buffer$3.from(o,"hex"),j=stripHexPrefix(_),_e=ecsign(Buffer$3.from(j,"hex"),$);return concatSig(Buffer$3.from(bigIntToBytes(_e.v)),Buffer$3.from(_e.r),Buffer$3.from(_e.s))},RETRIABLE_ERRORS=["Gateway timeout","ETIMEDOUT","failed to parse response body","Failed to fetch"];function checkForHttpErrors(o){switch(o.status){case 405:throw rpcErrors.methodNotFound();case 418:throw rpcErrors.internal({message:"Request is being rate limited.",data:{cause:o}});case 503:case 504:throw rpcErrors.internal({message:"Gateway timeout. The request took too long to process.This can happen when querying over too wide a block range.",data:{cause:o}})}}function timeout(o){return new Promise(_=>{setTimeout(_,o)})}function parseResponse(o,_){if(o.status!==200)throw rpcErrors.internal({message:`Non-200 status code: '${o.status}'`,data:_});if(_.error){var $;throw rpcErrors.internal({data:_.error,message:($=_.error)===null||$===void 0?void 0:$.message})}return _.result}function createFetchConfigFromReq({req:o,rpcTarget:_,originHttpHeaderKey:$}){const j=new URL(_),_e={id:o.id,jsonrpc:o.jsonrpc,method:o.method,params:o.params},et=o.origin,tt=JSON.stringify(_e),rt={method:"POST",headers:{Accept:"application/json","Content-Type":"application/json"},body:tt};return $&&et&&(rt.headers[$]=et),{fetchUrl:j.href,fetchParams:rt}}function createFetchMiddleware({rpcTarget:o,originHttpHeaderKey:_}){return createAsyncMiddleware(async($,j,_e)=>{const{fetchUrl:et,fetchParams:tt}=createFetchConfigFromReq({req:$,rpcTarget:o,originHttpHeaderKey:_}),rt=5,nt=1e3;for(let ot=0;otst.includes(lt)))throw it}await timeout(nt)}})}function cloneDeep$2(o){try{return structuredClone(o)}catch{return JSON.parse(JSON.stringify(o,($,j)=>typeof j=="bigint"?j.toString():j))}}const MULTI_CHAIN_ADAPTERS={AUTH:"auth",WALLET_CONNECT_V2:"wallet-connect-v2",SFA:"sfa"},SOLANA_ADAPTERS=_objectSpread2({TORUS_SOLANA:"torus-solana"},MULTI_CHAIN_ADAPTERS),EVM_ADAPTERS=_objectSpread2({TORUS_EVM:"torus-evm",COINBASE:"coinbase"},MULTI_CHAIN_ADAPTERS),WALLET_ADAPTERS=_objectSpread2(_objectSpread2({},EVM_ADAPTERS),SOLANA_ADAPTERS);MULTI_CHAIN_ADAPTERS.AUTH+"",MULTI_CHAIN_ADAPTERS.WALLET_CONNECT_V2+"",MULTI_CHAIN_ADAPTERS.SFA+"",SOLANA_ADAPTERS.TORUS_SOLANA+"",EVM_ADAPTERS.TORUS_EVM+"",EVM_ADAPTERS.COINBASE+"";const ADAPTER_CATEGORY={IN_APP:"in_app"},ADAPTER_STATUS={NOT_READY:"not_ready",READY:"ready",CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",ERRORED:"errored"},ADAPTER_EVENTS=_objectSpread2(_objectSpread2({},ADAPTER_STATUS),{},{ADAPTER_DATA_UPDATED:"adapter_data_updated",CACHE_CLEAR:"cache_clear"});class BaseAdapter extends SafeEventEmitter{constructor(_={}){super(),_defineProperty$z(this,"adapterData",{}),_defineProperty$z(this,"sessionTime",86400),_defineProperty$z(this,"clientId",void 0),_defineProperty$z(this,"web3AuthNetwork",WEB3AUTH_NETWORK.MAINNET),_defineProperty$z(this,"useCoreKitKey",void 0),_defineProperty$z(this,"rehydrated",!1),_defineProperty$z(this,"chainConfig",null),_defineProperty$z(this,"knownChainConfigs",{}),_defineProperty$z(this,"adapterNamespace",void 0),_defineProperty$z(this,"currentChainNamespace",void 0),_defineProperty$z(this,"type",void 0),_defineProperty$z(this,"name",void 0),_defineProperty$z(this,"status",void 0),this.setAdapterSettings(_)}get chainConfigProxy(){return this.chainConfig?_objectSpread2({},this.chainConfig):null}get connnected(){return this.status===ADAPTER_STATUS.CONNECTED}setAdapterSettings(_){if(this.status===ADAPTER_STATUS.READY)return;_!=null&&_.sessionTime&&(this.sessionTime=_.sessionTime),_!=null&&_.clientId&&(this.clientId=_.clientId),_!=null&&_.web3AuthNetwork&&(this.web3AuthNetwork=_.web3AuthNetwork),(_==null?void 0:_.useCoreKitKey)!==void 0&&(this.useCoreKitKey=_.useCoreKitKey);const $=_.chainConfig;if($){if(!$.chainNamespace)throw WalletInitializationError.notReady("ChainNamespace is required while setting chainConfig");this.currentChainNamespace=$.chainNamespace;const j=getChainConfig($.chainNamespace,$.chainId,this.clientId),_e=_objectSpread2(_objectSpread2({},j||{}),$);this.chainConfig=_e,this.addChainConfig(_e)}}checkConnectionRequirements(){if(!(this.name===WALLET_ADAPTERS.WALLET_CONNECT_V2&&this.status===ADAPTER_STATUS.CONNECTING)){if(this.status===ADAPTER_STATUS.CONNECTING)throw WalletInitializationError.notReady("Already connecting");if(this.status===ADAPTER_STATUS.CONNECTED)throw WalletLoginError.connectionError("Already connected");if(this.status!==ADAPTER_STATUS.READY)throw WalletLoginError.connectionError("Wallet adapter is not ready yet, Please wait for init function to resolve before calling connect/connectTo function")}}checkInitializationRequirements(){if(!this.clientId)throw WalletInitializationError.invalidParams("Please initialize Web3Auth with a valid clientId in constructor");if(!this.chainConfig||!this.chainConfig.rpcTarget&&this.chainConfig.chainNamespace!==CHAIN_NAMESPACES.OTHER)throw WalletInitializationError.invalidParams("rpcTarget is required in chainConfig");if(!this.chainConfig.chainId&&this.chainConfig.chainNamespace!==CHAIN_NAMESPACES.OTHER)throw WalletInitializationError.invalidParams("chainID is required in chainConfig");if(this.status!==ADAPTER_STATUS.NOT_READY){if(this.status===ADAPTER_STATUS.CONNECTED)throw WalletInitializationError.notReady("Already connected");if(this.status===ADAPTER_STATUS.READY)throw WalletInitializationError.notReady("Adapter is already initialized")}}checkDisconnectionRequirements(){if(this.status!==ADAPTER_STATUS.CONNECTED)throw WalletLoginError.disconnectionError("Not connected with wallet")}checkAddChainRequirements(_,$=!1){if(!$&&!this.provider)throw WalletLoginError.notConnectedError("Not connected with wallet.");if(this.currentChainNamespace!==_.chainNamespace)throw WalletOperationsError.chainNamespaceNotAllowed("This adapter doesn't support this chainNamespace")}checkSwitchChainRequirements({chainId:_},$=!1){if(!$&&!this.provider)throw WalletLoginError.notConnectedError("Not connected with wallet.");if(!this.knownChainConfigs[_])throw WalletLoginError.chainConfigNotAdded("Invalid chainId")}updateAdapterData(_){this.adapterData=_,this.emit(ADAPTER_EVENTS.ADAPTER_DATA_UPDATED,{adapterName:this.name,data:_})}addChainConfig(_){const $=this.knownChainConfigs[_.chainId];this.knownChainConfigs[_.chainId]=_objectSpread2(_objectSpread2({},$||{}),_)}getChainConfig(_){return this.knownChainConfigs[_]||null}}function storageAvailable(o){let _=!1,$=0,j;try{j=window[o],_=!0,$=j.length;const _e="__storage_test__";return j.setItem(_e,_e),j.removeItem(_e),!0}catch(_e){const et=_e;return!!(et&&(et.code===22||et.code===1014||et.name==="QuotaExceededError"||et.name==="NS_ERROR_DOM_QUOTA_REACHED")&&_&&$!==0)}}const signerHost=o=>SIGNER_MAP[o??WEB3AUTH_NETWORK.SAPPHIRE_MAINNET],fetchProjectConfig=async(o,_,$)=>{const j=new URL(`${signerHost(_)}/api/configuration`);return j.searchParams.append("project_id",o),j.searchParams.append("network",_),j.searchParams.append("whitelist","true"),$&&j.searchParams.append("aa_provider",$),await get$4(j.href)},PLUGIN_NAMESPACES=_objectSpread2(_objectSpread2({},CHAIN_NAMESPACES),{},{MULTICHAIN:"multichain"}),PLUGIN_STATUS={READY:"ready",CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",ERRORED:"errored"};_objectSpread2({},PLUGIN_STATUS);const EVM_PLUGINS={WALLET_SERVICES:"wallet-services",NFT_CHECKOUT:"nft-checkout"},SOLANA_PLUGINS={SOLANA:"solana"};_objectSpread2(_objectSpread2({},EVM_PLUGINS),SOLANA_PLUGINS);const getAuthDefaultOptions=()=>({adapterSettings:{network:WEB3AUTH_NETWORK.SAPPHIRE_MAINNET,clientId:"",uxMode:UX_MODE.POPUP},loginSettings:{},privateKeyProvider:void 0});class AuthAdapter extends BaseAdapter{constructor(_={}){super(_),_defineProperty$z(this,"name",WALLET_ADAPTERS.AUTH),_defineProperty$z(this,"adapterNamespace",ADAPTER_NAMESPACES.MULTICHAIN),_defineProperty$z(this,"type",ADAPTER_CATEGORY.IN_APP),_defineProperty$z(this,"authInstance",null),_defineProperty$z(this,"status",ADAPTER_STATUS.NOT_READY),_defineProperty$z(this,"currentChainNamespace",CHAIN_NAMESPACES.EIP155),_defineProperty$z(this,"privateKeyProvider",null),_defineProperty$z(this,"authOptions",void 0),_defineProperty$z(this,"loginSettings",{loginProvider:""}),this.setAdapterSettings(_objectSpread2(_objectSpread2({},_.adapterSettings),{},{chainConfig:_.chainConfig,clientId:_.clientId||"",sessionTime:_.sessionTime,web3AuthNetwork:_.web3AuthNetwork,useCoreKitKey:_.useCoreKitKey,privateKeyProvider:_.privateKeyProvider})),this.loginSettings=_.loginSettings||{loginProvider:""},this.privateKeyProvider=_.privateKeyProvider||null}get chainConfigProxy(){return this.chainConfig?_objectSpread2({},this.chainConfig):null}get provider(){return this.status!==ADAPTER_STATUS.NOT_READY&&this.privateKeyProvider?this.privateKeyProvider:null}set provider(_){throw new Error("Not implemented")}async init(_){if(super.checkInitializationRequirements(),!this.clientId)throw WalletInitializationError.invalidParams("clientId is required before auth's initialization");if(!this.authOptions)throw WalletInitializationError.invalidParams("authOptions is required before auth's initialization");const $=this.authOptions.uxMode===UX_MODE.REDIRECT;if(this.authOptions=_objectSpread2(_objectSpread2({},this.authOptions),{},{replaceUrlOnRedirect:$,useCoreKitKey:this.useCoreKitKey}),this.authInstance=new Auth(_objectSpread2(_objectSpread2({},this.authOptions),{},{clientId:this.clientId,network:this.authOptions.network||this.web3AuthNetwork||WEB3AUTH_NETWORK.SAPPHIRE_MAINNET})),loglevel.debug("initializing auth adapter init"),await this.authInstance.init(),!this.chainConfig)throw WalletInitializationError.invalidParams("chainConfig is required before initialization");this.status=ADAPTER_STATUS.READY,this.emit(ADAPTER_EVENTS.READY,WALLET_ADAPTERS.AUTH);try{loglevel.debug("initializing auth adapter"),this._getFinalPrivKey()&&(_.autoConnect||$)&&(this.rehydrated=!0,await this.connect())}catch(j){loglevel.error("Failed to connect with cached auth provider",j),this.emit(ADAPTER_EVENTS.ERRORED,j)}}async connect(_={loginProvider:""}){super.checkConnectionRequirements(),this.status=ADAPTER_STATUS.CONNECTING,this.emit(ADAPTER_EVENTS.CONNECTING,_objectSpread2(_objectSpread2({},_),{},{adapter:WALLET_ADAPTERS.AUTH}));try{return await this.connectWithProvider(_),this.provider}catch($){throw loglevel.error("Failed to connect with auth provider",$),this.status=ADAPTER_STATUS.READY,this.emit(ADAPTER_EVENTS.ERRORED,$),$!=null&&$.message.includes("user closed popup")?WalletLoginError.popupClosed():$ instanceof Web3AuthError?$:WalletLoginError.connectionError("Failed to login with auth",$)}}async enableMFA(_={loginProvider:""}){if(this.status!==ADAPTER_STATUS.CONNECTED)throw WalletLoginError.notConnectedError("Not connected with wallet");if(!this.authInstance)throw WalletInitializationError.notReady("authInstance is not ready");try{await this.authInstance.enableMFA(_)}catch($){throw loglevel.error("Failed to enable MFA with auth provider",$),$ instanceof Web3AuthError?$:WalletLoginError.connectionError("Failed to enable MFA with auth",$)}}async manageMFA(_={loginProvider:""}){if(this.status!==ADAPTER_STATUS.CONNECTED)throw WalletLoginError.notConnectedError("Not connected with wallet");if(!this.authInstance)throw WalletInitializationError.notReady("authInstance is not ready");try{await this.authInstance.manageMFA(_)}catch($){throw loglevel.error("Failed to manage MFA with auth provider",$),$ instanceof Web3AuthError?$:WalletLoginError.connectionError("Failed to manage MFA with auth",$)}}async disconnect(_={cleanup:!1}){if(this.status!==ADAPTER_STATUS.CONNECTED)throw WalletLoginError.notConnectedError("Not connected with wallet");if(!this.authInstance)throw WalletInitializationError.notReady("authInstance is not ready");await this.authInstance.logout(),_.cleanup?(this.status=ADAPTER_STATUS.NOT_READY,this.authInstance=null,this.privateKeyProvider=null):this.status=ADAPTER_STATUS.READY,this.rehydrated=!1,this.emit(ADAPTER_EVENTS.DISCONNECTED)}async authenticateUser(){if(this.status!==ADAPTER_STATUS.CONNECTED)throw WalletLoginError.notConnectedError("Not connected with wallet, Please login/connect first");return{idToken:(await this.getUserInfo()).idToken}}async getUserInfo(){if(this.status!==ADAPTER_STATUS.CONNECTED)throw WalletLoginError.notConnectedError("Not connected with wallet");if(!this.authInstance)throw WalletInitializationError.notReady("authInstance is not ready");return this.authInstance.getUserInfo()}setAdapterSettings(_){super.setAdapterSettings(_);const $=getAuthDefaultOptions();loglevel.info("setting adapter settings",_),this.authOptions=deepmerge$1.all([$.adapterSettings,this.authOptions||{},_||{}]),_.web3AuthNetwork&&(this.authOptions.network=_.web3AuthNetwork),_.privateKeyProvider&&(this.privateKeyProvider=_.privateKeyProvider)}async addChain(_,$=!1){var j;super.checkAddChainRequirements(_,$),(j=this.privateKeyProvider)===null||j===void 0||j.addChain(_),this.addChainConfig(_)}async switchChain(_,$=!1){var j;super.checkSwitchChainRequirements(_,$),await((j=this.privateKeyProvider)===null||j===void 0?void 0:j.switchChain(_)),this.setAdapterSettings({chainConfig:this.getChainConfig(_.chainId)})}_getFinalPrivKey(){if(!this.authInstance)return"";let _=this.authInstance.privKey;if(this.useCoreKitKey){if(this.authInstance.privKey&&!this.authInstance.coreKitKey)throw WalletLoginError.coreKitKeyNotFound();_=this.authInstance.coreKitKey}return _}_getFinalEd25519PrivKey(){if(!this.authInstance)return"";let _=this.authInstance.ed25519PrivKey;if(this.useCoreKitKey){if(this.authInstance.ed25519PrivKey&&!this.authInstance.coreKitEd25519Key)throw WalletLoginError.coreKitKeyNotFound();_=this.authInstance.coreKitEd25519Key}return _}async connectWithProvider(_={loginProvider:""}){var $;if(!this.privateKeyProvider)throw WalletInitializationError.invalidParams("PrivateKey Provider is required before initialization");if(!this.authInstance)throw WalletInitializationError.notReady("authInstance is not ready");if(!this._getFinalPrivKey()||($=_.extraLoginOptions)!==null&&$!==void 0&&$.id_token){var _e;if(this.loginSettings.curve=SUPPORTED_KEY_CURVES.OTHER,!_.loginProvider&&!this.loginSettings.loginProvider)throw WalletInitializationError.invalidParams("loginProvider is required for login");await this.authInstance.login(deepmerge$1.all([this.loginSettings,_,{extraLoginOptions:_objectSpread2(_objectSpread2({},_.extraLoginOptions||{}),{},{login_hint:_.login_hint||((_e=_.extraLoginOptions)===null||_e===void 0?void 0:_e.login_hint)})}]))}let et=this._getFinalPrivKey();et&&(this.currentChainNamespace===CHAIN_NAMESPACES.SOLANA&&(et=this._getFinalEd25519PrivKey()),await this.privateKeyProvider.setupProvider(et),this.status=ADAPTER_STATUS.CONNECTED,this.emit(ADAPTER_EVENTS.CONNECTED,{adapter:WALLET_ADAPTERS.AUTH,reconnected:this.rehydrated,provider:this.provider}))}}class BaseProvider extends BaseController{constructor({config:_,state:$}){if(super({config:_,state:$}),_defineProperty$z(this,"_providerEngineProxy",null),_defineProperty$z(this,"keyExportFlagSetByCode",!1),!_.chainConfig)throw WalletInitializationError.invalidProviderConfigError("Please provide chainConfig");if(!_.chainConfig.chainId)throw WalletInitializationError.invalidProviderConfigError("Please provide chainId inside chainConfig");if(!_.chainConfig.rpcTarget)throw WalletInitializationError.invalidProviderConfigError("Please provide rpcTarget inside chainConfig");typeof _.keyExportEnabled=="boolean"&&(this.keyExportFlagSetByCode=!0),this.defaultState={chainId:"loading"},this.defaultConfig={chainConfig:_.chainConfig,networks:{[_.chainConfig.chainId]:_.chainConfig},keyExportEnabled:typeof _.keyExportEnabled=="boolean"?_.keyExportEnabled:!0},super.initialize()}get currentChainConfig(){return this.config.chainConfig}get provider(){return this._providerEngineProxy}get chainId(){return this.state.chainId}set provider(_){throw new Error("Method not implemented.")}async request(_){var $;if(!_||typeof _!="object"||Array.isArray(_))throw rpcErrors.invalidRequest({message:WalletProviderError.invalidRequestArgs().message,data:_objectSpread2(_objectSpread2({},_||{}),{},{cause:WalletProviderError.invalidRequestArgs().message})});const{method:j,params:_e}=_;if(typeof j!="string"||j.length===0)throw rpcErrors.invalidRequest({message:WalletProviderError.invalidRequestMethod().message,data:_objectSpread2(_objectSpread2({},_||{}),{},{cause:WalletProviderError.invalidRequestMethod().message})});if(_e!==void 0&&!Array.isArray(_e)&&(typeof _e!="object"||_e===null))throw rpcErrors.invalidRequest({message:WalletProviderError.invalidRequestParams().message,data:_objectSpread2(_objectSpread2({},_||{}),{},{cause:WalletProviderError.invalidRequestParams().message})});return($=this.provider)===null||$===void 0?void 0:$.request(_)}sendAsync(_,$){return $?this.send(_,$):this.request(_)}send(_,$){this.request(_).then(j=>$(null,{result:j})).catch(j=>$(j,null))}addChain(_){if(!_.chainId||!_.rpcTarget)throw rpcErrors.invalidParams("chainId is required");this.configure({networks:_objectSpread2(_objectSpread2({},this.config.networks),{},{[_.chainId]:_})})}getChainConfig(_){var $;const j=($=this.config.networks)===null||$===void 0?void 0:$[_];if(!j)throw rpcErrors.invalidRequest(`Chain ${_} is not supported, please add chainConfig for it`);return j}updateProviderEngineProxy(_){this._providerEngineProxy?this._providerEngineProxy.setTarget(_):this._providerEngineProxy=createEventEmitterProxy(_)}setKeyExportFlag(_){this.keyExportFlagSetByCode||this.configure({keyExportEnabled:_})}getProviderEngineProxy(){return this._providerEngineProxy}}function createChainIdMiddleware$1(o){return(_,$,j,_e)=>_.method==="chainId"?($.result=o,_e()):j()}function createProviderConfigMiddleware$1(o){return(_,$,j,_e)=>_.method==="provider_config"?($.result=o,_e()):j()}function createJsonRpcClient$1(o){const{chainId:_,rpcTarget:$}=o,j=createFetchMiddleware({rpcTarget:$});return{networkMiddleware:mergeMiddleware([createChainIdMiddleware$1(_),createProviderConfigMiddleware$1(o),j]),fetchMiddleware:j}}var _CommonJRPCProvider;class CommonJRPCProvider extends BaseProvider{constructor({config:_,state:$}){super({config:_,state:$})}async setupProvider(){const{networkMiddleware:_}=createJsonRpcClient$1(this.config.chainConfig),$=new JRPCEngine;$.push(_);const j=providerFromEngine($);this.updateProviderEngineProxy(j);const _e=this.config.chainConfig.chainId;this.state.chainId!==_e&&(this.emit("chainChanged",_e),this.emit("connect",{chainId:_e})),this.update({chainId:this.config.chainConfig.chainId})}async switchChain(_){if(!this._providerEngineProxy)throw providerErrors.custom({message:"Provider is not initialized",code:4902});const $=this.getChainConfig(_.chainId);this.update({chainId:"loading"}),this.configure({chainConfig:$}),await this.setupProvider()}updateProviderEngineProxy(_){this._providerEngineProxy?this._providerEngineProxy.setTarget(_):this._providerEngineProxy=createEventEmitterProxy(_)}getProviderEngineProxy(){return this._providerEngineProxy}lookupNetwork(){throw new Error("Method not implemented.")}}_CommonJRPCProvider=CommonJRPCProvider;_defineProperty$z(CommonJRPCProvider,"getProviderInstance",async o=>{const _=new _CommonJRPCProvider({config:{chainConfig:o.chainConfig}});return await _.setupProvider(),_});const ADAPTER_CACHE_KEY="Web3Auth-cachedAdapter";class Web3AuthNoModal extends SafeEventEmitter{constructor(_){var $,j,_e,et;if(super(),_defineProperty$z(this,"coreOptions",void 0),_defineProperty$z(this,"connectedAdapterName",null),_defineProperty$z(this,"status",ADAPTER_STATUS.NOT_READY),_defineProperty$z(this,"cachedAdapter",null),_defineProperty$z(this,"walletAdapters",{}),_defineProperty$z(this,"commonJRPCProvider",null),_defineProperty$z(this,"plugins",{}),_defineProperty$z(this,"storage","localStorage"),!_.clientId)throw WalletInitializationError.invalidParams("Please provide a valid clientId in constructor");if(_.enableLogging?loglevel.enableAll():loglevel.setLevel("error"),!_.privateKeyProvider&&!_.chainConfig)throw WalletInitializationError.invalidParams("Please provide chainConfig or privateKeyProvider");if(_.chainConfig=_.chainConfig||_.privateKeyProvider.currentChainConfig,!(($=_.chainConfig)!==null&&$!==void 0&&$.chainNamespace)||!Object.values(CHAIN_NAMESPACES).includes((j=_.chainConfig)===null||j===void 0?void 0:j.chainNamespace))throw WalletInitializationError.invalidParams("Please provide a valid chainNamespace in chainConfig");_.storageKey==="session"&&(this.storage="sessionStorage"),this.cachedAdapter=storageAvailable(this.storage)?window[this.storage].getItem(ADAPTER_CACHE_KEY):null,this.coreOptions=_objectSpread2(_objectSpread2({},_),{},{chainConfig:_objectSpread2(_objectSpread2({},getChainConfig((_e=_.chainConfig)===null||_e===void 0?void 0:_e.chainNamespace,(et=_.chainConfig)===null||et===void 0?void 0:et.chainId,_.clientId)||{}),_.chainConfig)}),this.subscribeToAdapterEvents=this.subscribeToAdapterEvents.bind(this)}get connected(){return!!this.connectedAdapterName}get provider(){return this.status!==ADAPTER_STATUS.NOT_READY&&this.commonJRPCProvider?this.commonJRPCProvider:null}set provider(_){throw new Error("Not implemented")}async init(){this.commonJRPCProvider=await CommonJRPCProvider.getProviderInstance({chainConfig:this.coreOptions.chainConfig});let _;try{var $;_=await fetchProjectConfig(this.coreOptions.clientId,this.coreOptions.web3AuthNetwork,($=this.coreOptions.accountAbstractionProvider)===null||$===void 0?void 0:$.config.smartAccountInit.name)}catch(_e){throw loglevel.error("Failed to fetch project configurations",_e),WalletInitializationError.notReady("failed to fetch project configurations",_e)}const j=Object.keys(this.walletAdapters).map(async _e=>{if(this.subscribeToAdapterEvents(this.walletAdapters[_e]),this.walletAdapters[_e].chainConfigProxy)this.walletAdapters[_e].setAdapterSettings({sessionTime:this.coreOptions.sessionTime,clientId:this.coreOptions.clientId,web3AuthNetwork:this.coreOptions.web3AuthNetwork,useCoreKitKey:this.coreOptions.useCoreKitKey});else{const et=this.coreOptions.chainConfig;if(!et.chainNamespace)throw WalletInitializationError.invalidParams("Please provide chainNamespace in chainConfig");this.walletAdapters[_e].setAdapterSettings({chainConfig:et,sessionTime:this.coreOptions.sessionTime,clientId:this.coreOptions.clientId,web3AuthNetwork:this.coreOptions.web3AuthNetwork,useCoreKitKey:this.coreOptions.useCoreKitKey})}if(_e===WALLET_ADAPTERS.AUTH){const et=this.walletAdapters[_e],{whitelabel:tt}=_;this.coreOptions.uiConfig=deepmerge$1(cloneDeep$2(tt||{}),this.coreOptions.uiConfig||{}),this.coreOptions.uiConfig.mode||(this.coreOptions.uiConfig.mode="light");const{sms_otp_enabled:rt,whitelist:nt,key_export_enabled:ot}=_;if(rt!==void 0&&et.setAdapterSettings({loginConfig:{[LOGIN_PROVIDER.SMS_PASSWORDLESS]:{showOnModal:rt,showOnDesktop:rt,showOnMobile:rt,showOnSocialBackupFactor:rt}}}),nt&&et.setAdapterSettings({originData:nt.signed_urls}),typeof ot=="boolean"&&(this.coreOptions.privateKeyProvider.setKeyExportFlag(ot),this.commonJRPCProvider.setKeyExportFlag(ot)),this.coreOptions.privateKeyProvider){if(et.currentChainNamespace!==this.coreOptions.privateKeyProvider.currentChainConfig.chainNamespace)throw WalletInitializationError.incompatibleChainNameSpace("private key provider is not compatible with provided chainNamespace for auth adapter");et.setAdapterSettings({privateKeyProvider:this.coreOptions.privateKeyProvider})}if(et.setAdapterSettings({whiteLabel:this.coreOptions.uiConfig}),!et.privateKeyProvider)throw WalletInitializationError.invalidParams("privateKeyProvider is required for auth adapter")}else if(_e===WALLET_ADAPTERS.WALLET_CONNECT_V2){const et=this.walletAdapters[_e],{wallet_connect_enabled:tt,wallet_connect_project_id:rt}=_;if(tt===!1)throw WalletInitializationError.invalidParams("Please enable wallet connect v2 addon on dashboard");if(!rt)throw WalletInitializationError.invalidParams("Invalid wallet connect project id. Please configure it on the dashboard");et.setAdapterSettings({adapterSettings:{walletConnectInitOptions:{projectId:rt}}})}return this.walletAdapters[_e].init({autoConnect:this.cachedAdapter===_e}).catch(et=>loglevel.error(et,_e))});await Promise.all(j),this.status===ADAPTER_STATUS.NOT_READY&&(this.status=ADAPTER_STATUS.READY,this.emit(ADAPTER_EVENTS.READY))}getAdapter(_){return this.walletAdapters[_]||null}configureAdapter(_){this.checkInitRequirements();const $=this.coreOptions.chainConfig;if(!$.chainNamespace)throw WalletInitializationError.invalidParams("Please provide chainNamespace in chainConfig");if(this.walletAdapters[_.name])throw WalletInitializationError.duplicateAdapterError(`Wallet adapter for ${_.name} already exists`);if(_.adapterNamespace!==ADAPTER_NAMESPACES.MULTICHAIN&&_.adapterNamespace!==$.chainNamespace)throw WalletInitializationError.incompatibleChainNameSpace(`This wallet adapter belongs to ${_.adapterNamespace} which is incompatible with currently used namespace: ${$.chainNamespace}`);return _.adapterNamespace===ADAPTER_NAMESPACES.MULTICHAIN&&_.currentChainNamespace&&$.chainNamespace!==_.currentChainNamespace&&_.setAdapterSettings({chainConfig:$}),this.walletAdapters[_.name]=_,this}clearCache(){storageAvailable(this.storage)&&(window[this.storage].removeItem(ADAPTER_CACHE_KEY),this.cachedAdapter=null)}async addChain(_){if(this.status===ADAPTER_STATUS.CONNECTED&&this.connectedAdapterName)return this.walletAdapters[this.connectedAdapterName].addChain(_);if(this.commonJRPCProvider)return this.commonJRPCProvider.addChain(_);throw WalletInitializationError.notReady("No wallet is ready")}async switchChain(_){if(this.status===ADAPTER_STATUS.CONNECTED&&this.connectedAdapterName)return this.walletAdapters[this.connectedAdapterName].switchChain(_);if(this.commonJRPCProvider)return this.commonJRPCProvider.switchChain(_);throw WalletInitializationError.notReady("No wallet is ready")}async connectTo(_,$){if(!this.walletAdapters[_]||!this.commonJRPCProvider)throw WalletInitializationError.notFound(`Please add wallet adapter for ${_} wallet, before connecting`);return new Promise((j,_e)=>{this.once(ADAPTER_EVENTS.CONNECTED,et=>{j(this.provider)}),this.once(ADAPTER_EVENTS.ERRORED,et=>{_e(et)}),this.walletAdapters[_].connect($)})}async logout(_={cleanup:!1}){if(this.status!==ADAPTER_STATUS.CONNECTED||!this.connectedAdapterName)throw WalletLoginError.notConnectedError("No wallet is connected");await this.walletAdapters[this.connectedAdapterName].disconnect(_)}async getUserInfo(){if(loglevel.debug("Getting user info",this.status,this.connectedAdapterName),this.status!==ADAPTER_STATUS.CONNECTED||!this.connectedAdapterName)throw WalletLoginError.notConnectedError("No wallet is connected");return this.walletAdapters[this.connectedAdapterName].getUserInfo()}async enableMFA(_){if(this.status!==ADAPTER_STATUS.CONNECTED||!this.connectedAdapterName)throw WalletLoginError.notConnectedError("No wallet is connected");if(this.connectedAdapterName!==WALLET_ADAPTERS.AUTH)throw WalletLoginError.unsupportedOperation("EnableMFA is not supported for this adapter.");return this.walletAdapters[this.connectedAdapterName].enableMFA(_)}async manageMFA(_){if(this.status!==ADAPTER_STATUS.CONNECTED||!this.connectedAdapterName)throw WalletLoginError.notConnectedError("No wallet is connected");if(this.connectedAdapterName!==WALLET_ADAPTERS.AUTH)throw WalletLoginError.unsupportedOperation("ManageMFA is not supported for this adapter.");return this.walletAdapters[this.connectedAdapterName].manageMFA(_)}async authenticateUser(){if(this.status!==ADAPTER_STATUS.CONNECTED||!this.connectedAdapterName)throw WalletLoginError.notConnectedError("No wallet is connected");return this.walletAdapters[this.connectedAdapterName].authenticateUser()}addPlugin(_){if(this.plugins[_.name])throw WalletInitializationError.duplicateAdapterError(`Plugin ${_.name} already exist`);if(_.pluginNamespace!==PLUGIN_NAMESPACES.MULTICHAIN&&_.pluginNamespace!==this.coreOptions.chainConfig.chainNamespace)throw WalletInitializationError.incompatibleChainNameSpace(`This plugin belongs to ${_.pluginNamespace} namespace which is incompatible with currently used namespace: ${this.coreOptions.chainConfig.chainNamespace}`);return this.plugins[_.name]=_,this.status===ADAPTER_STATUS.CONNECTED&&this.connectedAdapterName&&this.connectToPlugins({adapter:this.connectedAdapterName}),this}getPlugin(_){return this.plugins[_]||null}subscribeToAdapterEvents(_){_.on(ADAPTER_EVENTS.CONNECTED,async $=>{if(!this.commonJRPCProvider)throw WalletInitializationError.notFound("CommonJrpcProvider not found");const{provider:j}=$;let _e=j.provider||j;this.coreOptions.accountAbstractionProvider&&($.adapter===WALLET_ADAPTERS.AUTH||$.adapter!==WALLET_ADAPTERS.AUTH&&this.coreOptions.useAAWithExternalWallet)&&(await this.coreOptions.accountAbstractionProvider.setupProvider(j),_e=this.coreOptions.accountAbstractionProvider),this.commonJRPCProvider.updateProviderEngineProxy(_e),this.connectedAdapterName=$.adapter,this.status=ADAPTER_STATUS.CONNECTED,this.cacheWallet($.adapter),loglevel.debug("connected",this.status,this.connectedAdapterName),this.connectToPlugins($),this.emit(ADAPTER_EVENTS.CONNECTED,_objectSpread2({},$))}),_.on(ADAPTER_EVENTS.DISCONNECTED,async()=>{if(this.status=ADAPTER_STATUS.READY,storageAvailable(this.storage)){const $=window[this.storage].getItem(ADAPTER_CACHE_KEY);this.connectedAdapterName===$&&this.clearCache()}loglevel.debug("disconnected",this.status,this.connectedAdapterName),await Promise.all(Object.values(this.plugins).map($=>$.disconnect().catch(j=>{j.code!==5211&&loglevel.error(j)}))),this.connectedAdapterName=null,this.emit(ADAPTER_EVENTS.DISCONNECTED)}),_.on(ADAPTER_EVENTS.CONNECTING,$=>{this.status=ADAPTER_STATUS.CONNECTING,this.emit(ADAPTER_EVENTS.CONNECTING,$),loglevel.debug("connecting",this.status,this.connectedAdapterName)}),_.on(ADAPTER_EVENTS.ERRORED,$=>{this.status=ADAPTER_STATUS.ERRORED,this.clearCache(),this.emit(ADAPTER_EVENTS.ERRORED,$),loglevel.debug("errored",this.status,this.connectedAdapterName)}),_.on(ADAPTER_EVENTS.ADAPTER_DATA_UPDATED,$=>{loglevel.debug("adapter data updated",$),this.emit(ADAPTER_EVENTS.ADAPTER_DATA_UPDATED,$)}),_.on(ADAPTER_EVENTS.CACHE_CLEAR,$=>{loglevel.debug("adapter cache clear",$),storageAvailable(this.storage)&&this.clearCache()})}checkInitRequirements(){if(this.status===ADAPTER_STATUS.CONNECTING)throw WalletInitializationError.notReady("Already pending connection");if(this.status===ADAPTER_STATUS.CONNECTED)throw WalletInitializationError.notReady("Already connected");if(this.status===ADAPTER_STATUS.READY)throw WalletInitializationError.notReady("Adapter is already initialized")}cacheWallet(_){storageAvailable(this.storage)&&(window[this.storage].setItem(ADAPTER_CACHE_KEY,_),this.cachedAdapter=_)}connectToPlugins(_){Object.values(this.plugins).map(async $=>{try{if(!$.SUPPORTED_ADAPTERS.includes("all")&&!$.SUPPORTED_ADAPTERS.includes(_.adapter)||$.status===PLUGIN_STATUS.CONNECTED)return;const{authInstance:j}=this.walletAdapters[this.connectedAdapterName],{options:_e,sessionId:et,sessionNamespace:tt}=j||{};await $.initWithWeb3Auth(this,_e==null?void 0:_e.whiteLabel),await $.connect({sessionId:et,sessionNamespace:tt})}catch(j){if(j.code===5211)return;loglevel.error(j)}})}}function createWalletMiddleware({getAccounts:o,getPrivateKey:_,getPublicKey:$,processEthSignMessage:j,processPersonalMessage:_e,processTransaction:et,processSignTransaction:tt,processTypedMessageV4:rt}){if(!o)throw new Error("opts.getAccounts is required");async function nt(pt,yt){if(typeof pt=="string"&&pt.length>0){const wt=(await o(yt)).map(Pt=>Pt.toLowerCase()),Ct=pt.toLowerCase();if(wt.includes(Ct))return Ct}throw rpcErrors.invalidParams({message:"Invalid parameters: must provide an Ethereum address."})}async function ot(pt,yt){yt.result=await o(pt)}async function it(pt,yt){if(!et)throw rpcErrors.methodNotSupported();const vt=pt.params[0]||{from:""};vt.from=await nt(vt.from,pt),yt.result=await et(vt,pt)}async function st(pt,yt){if(!tt)throw rpcErrors.methodNotSupported();const vt=pt.params[0]||{from:""};vt.from=await nt(vt.from,pt),yt.result=await tt(vt,pt)}async function at(pt,yt){if(!j)throw rpcErrors.methodNotSupported();let vt=pt.params;const wt=pt.params[2]||{};if(Array.isArray(pt.params)){if(pt.params.length!==2)throw new Error(`WalletMiddleware - incorrect params for ${pt.method} method. expected [address, message]`);const Ct=pt.params,Pt=Ct[0],Bt=Ct[1];vt={from:Pt,data:Bt}}vt=_objectSpread2(_objectSpread2({},wt),vt),yt.result=await j(vt,pt)}async function lt(pt,yt){if(!rt)throw rpcErrors.methodNotSupported();if(!(pt!=null&&pt.params))throw new Error("WalletMiddleware - missing params");let vt=pt.params;if(Array.isArray(pt.params)){if(pt.params.length!==2)throw new Error(`WalletMiddleware - incorrect params for ${pt.method} method. expected [address, typedData]`);const wt=pt.params,Ct=wt[0],Pt=wt[1];vt={from:Ct,data:Pt}}yt.result=await rt(vt,pt)}async function ct(pt,yt){if(!_e)throw rpcErrors.methodNotSupported();let vt=pt.params;const wt=pt.params[2]||{};if(Array.isArray(pt.params)){if(!(pt.params.length>=2))throw new Error(`WalletMiddleware - incorrect params for ${pt.method} method. expected [message, address]`);const Ct=pt.params;if(typeof Ct[0]=="object"){const{challenge:Pt,address:Bt}=Ct[0];vt={from:Bt,data:Pt}}else{const Pt=Ct[0];vt={from:Ct[1],data:Pt}}}vt=_objectSpread2(_objectSpread2({},wt),vt),yt.result=await _e(vt,pt)}async function ft(pt,yt){if(!_)throw rpcErrors.methodNotSupported();yt.result=await _(pt)}async function dt(pt,yt){if(!$)throw rpcErrors.methodNotSupported();yt.result=await $(pt)}return createScaffoldMiddleware({eth_accounts:createAsyncMiddleware(ot),eth_requestAccounts:createAsyncMiddleware(ot),eth_private_key:createAsyncMiddleware(ft),eth_public_key:createAsyncMiddleware(dt),public_key:createAsyncMiddleware(dt),private_key:createAsyncMiddleware(ft),eth_sendTransaction:createAsyncMiddleware(it),eth_signTransaction:createAsyncMiddleware(st),eth_sign:createAsyncMiddleware(at),eth_signTypedData_v4:createAsyncMiddleware(lt),personal_sign:createAsyncMiddleware(ct)})}function createEthMiddleware(o){const{getAccounts:_,getPrivateKey:$,getPublicKey:j,processTransaction:_e,processSignTransaction:et,processEthSignMessage:tt,processTypedMessageV4:rt,processPersonalMessage:nt}=o;return mergeMiddleware([createScaffoldMiddleware({eth_syncing:!1}),createWalletMiddleware({getAccounts:_,getPrivateKey:$,getPublicKey:j,processTransaction:_e,processEthSignMessage:tt,processSignTransaction:et,processTypedMessageV4:rt,processPersonalMessage:nt})])}function createChainSwitchMiddleware({addChain:o,switchChain:_}){async function $(_e,et){var tt;const rt=(tt=_e.params)!==null&&tt!==void 0&&tt.length?_e.params[0]:void 0;if(!rt)throw rpcErrors.invalidParams("Missing chain params");if(!rt.chainId)throw rpcErrors.invalidParams("Missing chainId in chainParams");if(!rt.rpcUrls||rt.rpcUrls.length===0)throw rpcErrors.invalidParams("Missing rpcUrls in chainParams");if(!rt.nativeCurrency)throw rpcErrors.invalidParams("Missing nativeCurrency in chainParams");et.result=await o(rt)}async function j(_e,et){var tt;const rt=(tt=_e.params)!==null&&tt!==void 0&&tt.length?_e.params[0]:void 0;if(!rt)throw rpcErrors.invalidParams("Missing chainId");et.result=await _(rt)}return createScaffoldMiddleware({wallet_addEthereumChain:createAsyncMiddleware($),wallet_switchEthereumChain:createAsyncMiddleware(j)})}function createAccountMiddleware({updatePrivatekey:o}){async function _($,j){var _e;const et=(_e=$.params)!==null&&_e!==void 0&&_e.length?$.params[0]:void 0;if(!(et!=null&&et.privateKey))throw rpcErrors.invalidParams("Missing privateKey");j.result=await o(et)}return createScaffoldMiddleware({wallet_updateAccount:createAsyncMiddleware(_)})}function createChainIdMiddleware(o){return(_,$,j,_e)=>_.method==="eth_chainId"?($.result=o,_e()):j()}function createProviderConfigMiddleware(o){return(_,$,j,_e)=>_.method==="eth_provider_config"?($.result=o,_e()):j()}function createJsonRpcClient(o){const{chainId:_,rpcTarget:$}=o,j=createFetchMiddleware({rpcTarget:$});return{networkMiddleware:mergeMiddleware([createChainIdMiddleware(_),createProviderConfigMiddleware(o),j]),fetchMiddleware:j}}const version="6.16.0";function defineProperties(o,_,$){for(let j in _){let _e=_[j];Object.defineProperty(o,j,{enumerable:!0,value:_e,writable:!1})}}function stringify(o,_){if(o==null)return"null";if(_==null&&(_=new Set),typeof o=="object"){if(_.has(o))return"[Circular]";_.add(o)}if(Array.isArray(o))return"[ "+o.map($=>stringify($,_)).join(", ")+" ]";if(o instanceof Uint8Array){const $="0123456789abcdef";let j="0x";for(let _e=0;_e>4],j+=$[o[_e]&15];return j}if(typeof o=="object"&&typeof o.toJSON=="function")return stringify(o.toJSON(),_);switch(typeof o){case"boolean":case"number":case"symbol":return o.toString();case"bigint":return BigInt(o).toString();case"string":return JSON.stringify(o);case"object":{const $=Object.keys(o);return $.sort(),"{ "+$.map(j=>`${stringify(j,_)}: ${stringify(o[j],_)}`).join(", ")+" }"}}return"[ COULD NOT SERIALIZE ]"}function makeError(o,_,$){let j=o;{const et=[];if($){if("message"in $||"code"in $||"name"in $)throw new Error(`value will overwrite populated values: ${stringify($)}`);for(const tt in $){if(tt==="shortMessage")continue;const rt=$[tt];et.push(tt+"="+stringify(rt))}}et.push(`code=${_}`),et.push(`version=${version}`),et.length&&(o+=" ("+et.join(", ")+")")}let _e;switch(_){case"INVALID_ARGUMENT":_e=new TypeError(o);break;case"NUMERIC_FAULT":case"BUFFER_OVERRUN":_e=new RangeError(o);break;default:_e=new Error(o)}return defineProperties(_e,{code:_}),$&&Object.assign(_e,$),_e.shortMessage==null&&defineProperties(_e,{shortMessage:j}),_e}function assert(o,_,$,j){if(!o)throw makeError(_,$,j)}function assertArgument(o,_,$,j){assert(o,_,"INVALID_ARGUMENT",{argument:$,value:j})}["NFD","NFC","NFKD","NFKC"].reduce((o,_)=>{try{if("test".normalize(_)!=="test")throw new Error("bad");if(_==="NFD"&&"Ć©".normalize("NFD")!=="é")throw new Error("broken");o.push(_)}catch{}return o},[]);function assertPrivate(o,_,$){if(o!==_){let j=$,_e="new";j+=".",_e+=" "+$,assert(!1,`private constructor; use ${j}from* methods`,"UNSUPPORTED_OPERATION",{operation:_e})}}function _getBytes(o,_,$){if(o instanceof Uint8Array)return $?new Uint8Array(o):o;if(typeof o=="string"&&o.length%2===0&&o.match(/^0x[0-9a-f]*$/i)){const j=new Uint8Array((o.length-2)/2);let _e=2;for(let et=0;et>4]+HexCharacters[_e&15]}return $}function concat(o){return"0x"+o.map(_=>hexlify(_).substring(2)).join("")}function dataLength(o){return isHexString(o,!0)?(o.length-2)/2:getBytes(o).length}function zeroPad(o,_,$){const j=getBytes(o);assert(_>=j.length,"padding exceeds data length","BUFFER_OVERRUN",{buffer:new Uint8Array(j),length:_,offset:_+1});const _e=new Uint8Array(_);return _e.fill(0),_e.set(j,_-j.length),hexlify(_e)}function zeroPadValue(o,_){return zeroPad(o,_)}const BN_0$1=BigInt(0);BigInt(1);const maxValue=9007199254740991;function getBigInt(o,_){switch(typeof o){case"bigint":return o;case"number":return assertArgument(Number.isInteger(o),"underflow",_||"value",o),assertArgument(o>=-maxValue&&o<=maxValue,"overflow",_||"value",o),BigInt(o);case"string":try{if(o==="")throw new Error("empty string");return o[0]==="-"&&o[1]!=="-"?-BigInt(o.substring(1)):BigInt(o)}catch($){assertArgument(!1,`invalid BigNumberish string: ${$.message}`,_||"value",o)}}assertArgument(!1,"invalid BigNumberish value",_||"value",o)}function getUint(o,_){const $=getBigInt(o,_);return assert($>=BN_0$1,"unsigned value cannot be negative","NUMERIC_FAULT",{fault:"overflow",operation:"getUint",value:o}),$}function getNumber(o,_){switch(typeof o){case"bigint":return assertArgument(o>=-maxValue&&o<=maxValue,"overflow",_||"value",o),Number(o);case"number":return assertArgument(Number.isInteger(o),"underflow",_||"value",o),assertArgument(o>=-maxValue&&o<=maxValue,"overflow",_||"value",o),o;case"string":try{if(o==="")throw new Error("empty string");return getNumber(BigInt(o),_)}catch($){assertArgument(!1,`invalid numeric string: ${$.message}`,_||"value",o)}}assertArgument(!1,"invalid numeric value",_||"value",o)}function toBeHex(o,_){const $=getUint(o,"value");let j=$.toString(16);{const _e=getNumber(_,"width");if(_e===0&&$===BN_0$1)return"0x";for(assert(_e*2>=j.length,`value exceeds width (${_e} bytes)`,"NUMERIC_FAULT",{operation:"toBeHex",fault:"overflow",value:o});j.length<_e*2;)j="0"+j}return"0x"+j}function toBeArray(o,_){const $=getUint(o,"value");if($===BN_0$1)return new Uint8Array(0);let j=$.toString(16);j.length%2&&(j="0"+j);const _e=new Uint8Array(j.length/2);for(let et=0;et<_e.length;et++){const tt=et*2;_e[et]=parseInt(j.substring(tt,tt+2),16)}return _e}function toUtf8Bytes(o,_){assertArgument(typeof o=="string","invalid string value","str",o);let $=[];for(let j=0;j>6|192),$.push(_e&63|128);else if((_e&64512)==55296){j++;const et=o.charCodeAt(j);assertArgument(j>18|240),$.push(tt>>12&63|128),$.push(tt>>6&63|128),$.push(tt&63|128)}else $.push(_e>>12|224),$.push(_e>>6&63|128),$.push(_e&63|128)}return new Uint8Array($)}function number$3(o){if(!Number.isSafeInteger(o)||o<0)throw new Error(`Wrong positive integer: ${o}`)}function bytes(o,..._){if(!(o instanceof Uint8Array))throw new Error("Expected Uint8Array");if(_.length>0&&!_.includes(o.length))throw new Error(`Expected Uint8Array of length ${_}, not of length=${o.length}`)}function hash(o){if(typeof o!="function"||typeof o.create!="function")throw new Error("Hash should be wrapped by utils.wrapConstructor");number$3(o.outputLen),number$3(o.blockLen)}function exists(o,_=!0){if(o.destroyed)throw new Error("Hash instance has been destroyed");if(_&&o.finished)throw new Error("Hash#digest() has already been called")}function output(o,_){bytes(o);const $=_.outputLen;if(o.length<$)throw new Error(`digestInto() expects output buffer of length at least ${$}`)}const crypto$1=typeof globalThis=="object"&&"crypto"in globalThis?globalThis.crypto:void 0;/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */const u8a$1=o=>o instanceof Uint8Array,u32=o=>new Uint32Array(o.buffer,o.byteOffset,Math.floor(o.byteLength/4)),createView=o=>new DataView(o.buffer,o.byteOffset,o.byteLength),rotr=(o,_)=>o<<32-_|o>>>_,isLE=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68;if(!isLE)throw new Error("Non little-endian hardware is not supported");function utf8ToBytes(o){if(typeof o!="string")throw new Error(`utf8ToBytes expected string, got ${typeof o}`);return new Uint8Array(new TextEncoder().encode(o))}function toBytes(o){if(typeof o=="string"&&(o=utf8ToBytes(o)),!u8a$1(o))throw new Error(`expected Uint8Array, got ${typeof o}`);return o}function concatBytes$1(...o){const _=new Uint8Array(o.reduce((j,_e)=>j+_e.length,0));let $=0;return o.forEach(j=>{if(!u8a$1(j))throw new Error("Uint8Array expected");_.set(j,$),$+=j.length}),_}class Hash{clone(){return this._cloneInto()}}function wrapConstructor(o){const _=j=>o().update(toBytes(j)).digest(),$=o();return _.outputLen=$.outputLen,_.blockLen=$.blockLen,_.create=()=>o(),_}function randomBytes(o=32){if(crypto$1&&typeof crypto$1.getRandomValues=="function")return crypto$1.getRandomValues(new Uint8Array(o));throw new Error("crypto.getRandomValues must be defined")}class HMAC extends Hash{constructor(_,$){super(),this.finished=!1,this.destroyed=!1,hash(_);const j=toBytes($);if(this.iHash=_.create(),typeof this.iHash.update!="function")throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const _e=this.blockLen,et=new Uint8Array(_e);et.set(j.length>_e?_.create().update(j).digest():j);for(let tt=0;ttnew HMAC(o,_).update($).digest();hmac.create=(o,_)=>new HMAC(o,_);function setBigUint64(o,_,$,j){if(typeof o.setBigUint64=="function")return o.setBigUint64(_,$,j);const _e=BigInt(32),et=BigInt(4294967295),tt=Number($>>_e&et),rt=Number($&et),nt=j?4:0,ot=j?0:4;o.setUint32(_+nt,tt,j),o.setUint32(_+ot,rt,j)}class SHA2 extends Hash{constructor(_,$,j,_e){super(),this.blockLen=_,this.outputLen=$,this.padOffset=j,this.isLE=_e,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(_),this.view=createView(this.buffer)}update(_){exists(this);const{view:$,buffer:j,blockLen:_e}=this;_=toBytes(_);const et=_.length;for(let tt=0;tt_e-tt&&(this.process(j,0),tt=0);for(let st=tt;st<_e;st++)$[st]=0;setBigUint64(j,_e-8,BigInt(this.length*8),et),this.process(j,0);const rt=createView(_),nt=this.outputLen;if(nt%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const ot=nt/4,it=this.get();if(ot>it.length)throw new Error("_sha2: outputLen bigger than state");for(let st=0;sto&_^~o&$,Maj=(o,_,$)=>o&_^o&$^_&$,SHA256_K=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),IV=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),SHA256_W=new Uint32Array(64);class SHA256 extends SHA2{constructor(){super(64,32,8,!1),this.A=IV[0]|0,this.B=IV[1]|0,this.C=IV[2]|0,this.D=IV[3]|0,this.E=IV[4]|0,this.F=IV[5]|0,this.G=IV[6]|0,this.H=IV[7]|0}get(){const{A:_,B:$,C:j,D:_e,E:et,F:tt,G:rt,H:nt}=this;return[_,$,j,_e,et,tt,rt,nt]}set(_,$,j,_e,et,tt,rt,nt){this.A=_|0,this.B=$|0,this.C=j|0,this.D=_e|0,this.E=et|0,this.F=tt|0,this.G=rt|0,this.H=nt|0}process(_,$){for(let st=0;st<16;st++,$+=4)SHA256_W[st]=_.getUint32($,!1);for(let st=16;st<64;st++){const at=SHA256_W[st-15],lt=SHA256_W[st-2],ct=rotr(at,7)^rotr(at,18)^at>>>3,ft=rotr(lt,17)^rotr(lt,19)^lt>>>10;SHA256_W[st]=ft+SHA256_W[st-7]+ct+SHA256_W[st-16]|0}let{A:j,B:_e,C:et,D:tt,E:rt,F:nt,G:ot,H:it}=this;for(let st=0;st<64;st++){const at=rotr(rt,6)^rotr(rt,11)^rotr(rt,25),lt=it+at+Chi(rt,nt,ot)+SHA256_K[st]+SHA256_W[st]|0,ft=(rotr(j,2)^rotr(j,13)^rotr(j,22))+Maj(j,_e,et)|0;it=ot,ot=nt,nt=rt,rt=tt+lt|0,tt=et,et=_e,_e=j,j=lt+ft|0}j=j+this.A|0,_e=_e+this.B|0,et=et+this.C|0,tt=tt+this.D|0,rt=rt+this.E|0,nt=nt+this.F|0,ot=ot+this.G|0,it=it+this.H|0,this.set(j,_e,et,tt,rt,nt,ot,it)}roundClean(){SHA256_W.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const sha256=wrapConstructor(()=>new SHA256),U32_MASK64=BigInt(2**32-1),_32n=BigInt(32);function fromBig(o,_=!1){return _?{h:Number(o&U32_MASK64),l:Number(o>>_32n&U32_MASK64)}:{h:Number(o>>_32n&U32_MASK64)|0,l:Number(o&U32_MASK64)|0}}function split(o,_=!1){let $=new Uint32Array(o.length),j=new Uint32Array(o.length);for(let _e=0;_eBigInt(o>>>0)<<_32n|BigInt(_>>>0),shrSH=(o,_,$)=>o>>>$,shrSL=(o,_,$)=>o<<32-$|_>>>$,rotrSH=(o,_,$)=>o>>>$|_<<32-$,rotrSL=(o,_,$)=>o<<32-$|_>>>$,rotrBH=(o,_,$)=>o<<64-$|_>>>$-32,rotrBL=(o,_,$)=>o>>>$-32|_<<64-$,rotr32H=(o,_)=>_,rotr32L=(o,_)=>o,rotlSH=(o,_,$)=>o<<$|_>>>32-$,rotlSL=(o,_,$)=>_<<$|o>>>32-$,rotlBH=(o,_,$)=>_<<$-32|o>>>64-$,rotlBL=(o,_,$)=>o<<$-32|_>>>64-$;function add$1(o,_,$,j){const _e=(_>>>0)+(j>>>0);return{h:o+$+(_e/2**32|0)|0,l:_e|0}}const add3L=(o,_,$)=>(o>>>0)+(_>>>0)+($>>>0),add3H=(o,_,$,j)=>_+$+j+(o/2**32|0)|0,add4L=(o,_,$,j)=>(o>>>0)+(_>>>0)+($>>>0)+(j>>>0),add4H=(o,_,$,j,_e)=>_+$+j+_e+(o/2**32|0)|0,add5L=(o,_,$,j,_e)=>(o>>>0)+(_>>>0)+($>>>0)+(j>>>0)+(_e>>>0),add5H=(o,_,$,j,_e,et)=>_+$+j+_e+et+(o/2**32|0)|0,u64={fromBig,split,toBig,shrSH,shrSL,rotrSH,rotrSL,rotrBH,rotrBL,rotr32H,rotr32L,rotlSH,rotlSL,rotlBH,rotlBL,add:add$1,add3L,add3H,add4L,add4H,add5H,add5L},[SHA3_PI,SHA3_ROTL,_SHA3_IOTA]=[[],[],[]],_0n$3=BigInt(0),_1n$5=BigInt(1),_2n$3=BigInt(2),_7n=BigInt(7),_256n=BigInt(256),_0x71n=BigInt(113);for(let o=0,_=_1n$5,$=1,j=0;o<24;o++){[$,j]=[j,(2*$+3*j)%5],SHA3_PI.push(2*(5*j+$)),SHA3_ROTL.push((o+1)*(o+2)/2%64);let _e=_0n$3;for(let et=0;et<7;et++)_=(_<<_1n$5^(_>>_7n)*_0x71n)%_256n,_&_2n$3&&(_e^=_1n$5<<(_1n$5<$>32?rotlBH(o,_,$):rotlSH(o,_,$),rotlL=(o,_,$)=>$>32?rotlBL(o,_,$):rotlSL(o,_,$);function keccakP(o,_=24){const $=new Uint32Array(10);for(let j=24-_;j<24;j++){for(let tt=0;tt<10;tt++)$[tt]=o[tt]^o[tt+10]^o[tt+20]^o[tt+30]^o[tt+40];for(let tt=0;tt<10;tt+=2){const rt=(tt+8)%10,nt=(tt+2)%10,ot=$[nt],it=$[nt+1],st=rotlH(ot,it,1)^$[rt],at=rotlL(ot,it,1)^$[rt+1];for(let lt=0;lt<50;lt+=10)o[tt+lt]^=st,o[tt+lt+1]^=at}let _e=o[2],et=o[3];for(let tt=0;tt<24;tt++){const rt=SHA3_ROTL[tt],nt=rotlH(_e,et,rt),ot=rotlL(_e,et,rt),it=SHA3_PI[tt];_e=o[it],et=o[it+1],o[it]=nt,o[it+1]=ot}for(let tt=0;tt<50;tt+=10){for(let rt=0;rt<10;rt++)$[rt]=o[tt+rt];for(let rt=0;rt<10;rt++)o[tt+rt]^=~$[(rt+2)%10]&$[(rt+4)%10]}o[0]^=SHA3_IOTA_H[j],o[1]^=SHA3_IOTA_L[j]}$.fill(0)}class Keccak extends Hash{constructor(_,$,j,_e=!1,et=24){if(super(),this.blockLen=_,this.suffix=$,this.outputLen=j,this.enableXOF=_e,this.rounds=et,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,number$3(j),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=u32(this.state)}keccak(){keccakP(this.state32,this.rounds),this.posOut=0,this.pos=0}update(_){exists(this);const{blockLen:$,state:j}=this;_=toBytes(_);const _e=_.length;for(let et=0;et<_e;){const tt=Math.min($-this.pos,_e-et);for(let rt=0;rt=j&&this.keccak();const tt=Math.min(j-this.posOut,et-_e);_.set($.subarray(this.posOut,this.posOut+tt),_e),this.posOut+=tt,_e+=tt}return _}xofInto(_){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(_)}xof(_){return number$3(_),this.xofInto(new Uint8Array(_))}digestInto(_){if(output(_,this),this.finished)throw new Error("digest() was already called");return this.writeInto(_),this.destroy(),_}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(_){const{blockLen:$,suffix:j,outputLen:_e,rounds:et,enableXOF:tt}=this;return _||(_=new Keccak($,j,_e,tt,et)),_.state32.set(this.state32),_.pos=this.pos,_.posOut=this.posOut,_.finished=this.finished,_.rounds=et,_.suffix=j,_.outputLen=_e,_.enableXOF=tt,_.destroyed=this.destroyed,_}}const gen=(o,_,$)=>wrapConstructor(()=>new Keccak(_,o,$)),keccak_256=gen(1,136,256/8);let locked=!1;const _keccak256=function(o){return keccak_256(o)};let __keccak256=_keccak256;function keccak256(o){const _=getBytes(o,"data");return hexlify(__keccak256(_))}keccak256._=_keccak256;keccak256.lock=function(){locked=!0};keccak256.register=function(o){if(locked)throw new TypeError("keccak256 is locked");__keccak256=o};Object.freeze(keccak256);/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */BigInt(0);const _1n$4=BigInt(1),_2n$2=BigInt(2),u8a=o=>o instanceof Uint8Array,hexes=Array.from({length:256},(o,_)=>_.toString(16).padStart(2,"0"));function bytesToHex(o){if(!u8a(o))throw new Error("Uint8Array expected");let _="";for(let $=0;$j+_e.length,0));let $=0;return o.forEach(j=>{if(!u8a(j))throw new Error("Uint8Array expected");_.set(j,$),$+=j.length}),_}const bitMask=o=>(_2n$2<new Uint8Array(o),u8fr=o=>Uint8Array.from(o);function createHmacDrbg(o,_,$){if(typeof o!="number"||o<2)throw new Error("hashLen must be a number");if(typeof _!="number"||_<2)throw new Error("qByteLen must be a number");if(typeof $!="function")throw new Error("hmacFn must be a function");let j=u8n(o),_e=u8n(o),et=0;const tt=()=>{j.fill(1),_e.fill(0),et=0},rt=(...st)=>$(_e,j,...st),nt=(st=u8n())=>{_e=rt(u8fr([0]),st),j=rt(),st.length!==0&&(_e=rt(u8fr([1]),st),j=rt())},ot=()=>{if(et++>=1e3)throw new Error("drbg: tried 1000 values");let st=0;const at=[];for(;st<_;){j=rt();const lt=j.slice();at.push(lt),st+=j.length}return concatBytes(...at)};return(st,at)=>{tt(),nt(st);let lt;for(;!(lt=at(ot()));)nt();return tt(),lt}}const validatorFns={bigint:o=>typeof o=="bigint",function:o=>typeof o=="function",boolean:o=>typeof o=="boolean",string:o=>typeof o=="string",stringOrUint8Array:o=>typeof o=="string"||o instanceof Uint8Array,isSafeInteger:o=>Number.isSafeInteger(o),array:o=>Array.isArray(o),field:(o,_)=>_.Fp.isValid(o),hash:o=>typeof o=="function"&&Number.isSafeInteger(o.outputLen)};function validateObject(o,_,$={}){const j=(_e,et,tt)=>{const rt=validatorFns[et];if(typeof rt!="function")throw new Error(`Invalid validator "${et}", expected function`);const nt=o[_e];if(!(tt&&nt===void 0)&&!rt(nt,o))throw new Error(`Invalid param ${String(_e)}=${nt} (${typeof nt}), expected ${et}`)};for(const[_e,et]of Object.entries(_))j(_e,et,!1);for(const[_e,et]of Object.entries($))j(_e,et,!0);return o}const ut=Object.freeze(Object.defineProperty({__proto__:null,bitMask,bytesToHex,bytesToNumberBE,bytesToNumberLE,concatBytes,createHmacDrbg,ensureBytes,hexToBytes,hexToNumber,numberToBytesBE,numberToBytesLE,validateObject},Symbol.toStringTag,{value:"Module"}));/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$2=BigInt(0),_1n$3=BigInt(1),_2n$1=BigInt(2),_3n$1=BigInt(3),_4n=BigInt(4),_5n=BigInt(5),_8n=BigInt(8);BigInt(9);BigInt(16);function mod(o,_){const $=o%_;return $>=_0n$2?$:_+$}function pow$1(o,_,$){if($<=_0n$2||_<_0n$2)throw new Error("Expected power/modulo > 0");if($===_1n$3)return _0n$2;let j=_1n$3;for(;_>_0n$2;)_&_1n$3&&(j=j*o%$),o=o*o%$,_>>=_1n$3;return j}function pow2(o,_,$){let j=o;for(;_-- >_0n$2;)j*=j,j%=$;return j}function invert(o,_){if(o===_0n$2||_<=_0n$2)throw new Error(`invert: expected positive integers, got n=${o} mod=${_}`);let $=mod(o,_),j=_,_e=_0n$2,et=_1n$3;for(;$!==_0n$2;){const rt=j/$,nt=j%$,ot=_e-et*rt;j=$,$=nt,_e=et,et=ot}if(j!==_1n$3)throw new Error("invert: does not exist");return mod(_e,_)}function tonelliShanks(o){const _=(o-_1n$3)/_2n$1;let $,j,_e;for($=o-_1n$3,j=0;$%_2n$1===_0n$2;$/=_2n$1,j++);for(_e=_2n$1;_e(j[_e]="function",j),_);return validateObject(o,$)}function FpPow(o,_,$){if($<_0n$2)throw new Error("Expected power > 0");if($===_0n$2)return o.ONE;if($===_1n$3)return _;let j=o.ONE,_e=_;for(;$>_0n$2;)$&_1n$3&&(j=o.mul(j,_e)),_e=o.sqr(_e),$>>=_1n$3;return j}function FpInvertBatch(o,_){const $=new Array(_.length),j=_.reduce((et,tt,rt)=>o.is0(tt)?et:($[rt]=et,o.mul(et,tt)),o.ONE),_e=o.inv(j);return _.reduceRight((et,tt,rt)=>o.is0(tt)?et:($[rt]=o.mul(et,$[rt]),o.mul(et,tt)),_e),$}function nLength(o,_){const $=_!==void 0?_:o.toString(2).length,j=Math.ceil($/8);return{nBitLength:$,nByteLength:j}}function Field(o,_,$=!1,j={}){if(o<=_0n$2)throw new Error(`Expected Field ORDER > 0, got ${o}`);const{nBitLength:_e,nByteLength:et}=nLength(o,_);if(et>2048)throw new Error("Field lengths over 2048 bytes are not supported");const tt=FpSqrt(o),rt=Object.freeze({ORDER:o,BITS:_e,BYTES:et,MASK:bitMask(_e),ZERO:_0n$2,ONE:_1n$3,create:nt=>mod(nt,o),isValid:nt=>{if(typeof nt!="bigint")throw new Error(`Invalid field element: expected bigint, got ${typeof nt}`);return _0n$2<=nt&&ntnt===_0n$2,isOdd:nt=>(nt&_1n$3)===_1n$3,neg:nt=>mod(-nt,o),eql:(nt,ot)=>nt===ot,sqr:nt=>mod(nt*nt,o),add:(nt,ot)=>mod(nt+ot,o),sub:(nt,ot)=>mod(nt-ot,o),mul:(nt,ot)=>mod(nt*ot,o),pow:(nt,ot)=>FpPow(rt,nt,ot),div:(nt,ot)=>mod(nt*invert(ot,o),o),sqrN:nt=>nt*nt,addN:(nt,ot)=>nt+ot,subN:(nt,ot)=>nt-ot,mulN:(nt,ot)=>nt*ot,inv:nt=>invert(nt,o),sqrt:j.sqrt||(nt=>tt(rt,nt)),invertBatch:nt=>FpInvertBatch(rt,nt),cmov:(nt,ot,it)=>it?ot:nt,toBytes:nt=>$?numberToBytesLE(nt,et):numberToBytesBE(nt,et),fromBytes:nt=>{if(nt.length!==et)throw new Error(`Fp.fromBytes: expected ${et}, got ${nt.length}`);return $?bytesToNumberLE(nt):bytesToNumberBE(nt)}});return Object.freeze(rt)}function getFieldBytesLength(o){if(typeof o!="bigint")throw new Error("field order must be bigint");const _=o.toString(2).length;return Math.ceil(_/8)}function getMinHashLength(o){const _=getFieldBytesLength(o);return _+Math.ceil(_/2)}function mapHashToField(o,_,$=!1){const j=o.length,_e=getFieldBytesLength(_),et=getMinHashLength(_);if(j<16||j1024)throw new Error(`expected ${et}-1024 bytes of input, got ${j}`);const tt=$?bytesToNumberBE(o):bytesToNumberLE(o),rt=mod(tt,_-_1n$3)+_1n$3;return $?numberToBytesLE(rt,_e):numberToBytesBE(rt,_e)}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const _0n$1=BigInt(0),_1n$2=BigInt(1);function wNAF(o,_){const $=(_e,et)=>{const tt=et.negate();return _e?tt:et},j=_e=>{const et=Math.ceil(_/_e)+1,tt=2**(_e-1);return{windows:et,windowSize:tt}};return{constTimeNegate:$,unsafeLadder(_e,et){let tt=o.ZERO,rt=_e;for(;et>_0n$1;)et&_1n$2&&(tt=tt.add(rt)),rt=rt.double(),et>>=_1n$2;return tt},precomputeWindow(_e,et){const{windows:tt,windowSize:rt}=j(et),nt=[];let ot=_e,it=ot;for(let st=0;st>=lt,dt>nt&&(dt-=at,tt+=_1n$2);const pt=ft,yt=ft+Math.abs(dt)-1,vt=ct%2!==0,wt=dt<0;dt===0?it=it.add($(vt,et[pt])):ot=ot.add($(wt,et[yt]))}return{p:ot,f:it}},wNAFCached(_e,et,tt,rt){const nt=_e._WINDOW_SIZE||1;let ot=et.get(_e);return ot||(ot=this.precomputeWindow(_e,nt),nt!==1&&et.set(_e,rt(ot))),this.wNAF(nt,ot,tt)}}}function validateBasic(o){return validateField(o.Fp),validateObject(o,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...nLength(o.n,o.nBitLength),...o,p:o.Fp.ORDER})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function validatePointOpts(o){const _=validateBasic(o);validateObject(_,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:$,Fp:j,a:_e}=_;if($){if(!j.eql(_e,j.ZERO))throw new Error("Endomorphism can only be defined for Koblitz curves that have a=0");if(typeof $!="object"||typeof $.beta!="bigint"||typeof $.splitScalar!="function")throw new Error("Expected endomorphism with beta: bigint and splitScalar: function")}return Object.freeze({..._})}const{bytesToNumberBE:b2n,hexToBytes:h2b}=ut,DER={Err:class extends Error{constructor(_=""){super(_)}},_parseInt(o){const{Err:_}=DER;if(o.length<2||o[0]!==2)throw new _("Invalid signature integer tag");const $=o[1],j=o.subarray(2,$+2);if(!$||j.length!==$)throw new _("Invalid signature integer: wrong length");if(j[0]&128)throw new _("Invalid signature integer: negative");if(j[0]===0&&!(j[1]&128))throw new _("Invalid signature integer: unnecessary leading zero");return{d:b2n(j),l:o.subarray($+2)}},toSig(o){const{Err:_}=DER,$=typeof o=="string"?h2b(o):o;if(!($ instanceof Uint8Array))throw new Error("ui8a expected");let j=$.length;if(j<2||$[0]!=48)throw new _("Invalid signature tag");if($[1]!==j-2)throw new _("Invalid signature: incorrect length");const{d:_e,l:et}=DER._parseInt($.subarray(2)),{d:tt,l:rt}=DER._parseInt(et);if(rt.length)throw new _("Invalid signature: left bytes after parsing");return{r:_e,s:tt}},hexFromSig(o){const _=ot=>Number.parseInt(ot[0],16)&8?"00"+ot:ot,$=ot=>{const it=ot.toString(16);return it.length&1?`0${it}`:it},j=_($(o.s)),_e=_($(o.r)),et=j.length/2,tt=_e.length/2,rt=$(et),nt=$(tt);return`30${$(tt+et+4)}02${nt}${_e}02${rt}${j}`}},_0n=BigInt(0),_1n$1=BigInt(1);BigInt(2);const _3n=BigInt(3);BigInt(4);function weierstrassPoints(o){const _=validatePointOpts(o),{Fp:$}=_,j=_.toBytes||((ct,ft,dt)=>{const pt=ft.toAffine();return concatBytes(Uint8Array.from([4]),$.toBytes(pt.x),$.toBytes(pt.y))}),_e=_.fromBytes||(ct=>{const ft=ct.subarray(1),dt=$.fromBytes(ft.subarray(0,$.BYTES)),pt=$.fromBytes(ft.subarray($.BYTES,2*$.BYTES));return{x:dt,y:pt}});function et(ct){const{a:ft,b:dt}=_,pt=$.sqr(ct),yt=$.mul(pt,ct);return $.add($.add(yt,$.mul(ct,ft)),dt)}if(!$.eql($.sqr(_.Gy),et(_.Gx)))throw new Error("bad generator point: equation left != right");function tt(ct){return typeof ct=="bigint"&&_0n$.eql(vt,$.ZERO);return yt(dt)&&yt(pt)?st.ZERO:new st(dt,pt,$.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(ft){const dt=$.invertBatch(ft.map(pt=>pt.pz));return ft.map((pt,yt)=>pt.toAffine(dt[yt])).map(st.fromAffine)}static fromHex(ft){const dt=st.fromAffine(_e(ensureBytes("pointHex",ft)));return dt.assertValidity(),dt}static fromPrivateKey(ft){return st.BASE.multiply(nt(ft))}_setWindowSize(ft){this._WINDOW_SIZE=ft,ot.delete(this)}assertValidity(){if(this.is0()){if(_.allowInfinityPoint&&!$.is0(this.py))return;throw new Error("bad point: ZERO")}const{x:ft,y:dt}=this.toAffine();if(!$.isValid(ft)||!$.isValid(dt))throw new Error("bad point: x or y not FE");const pt=$.sqr(dt),yt=et(ft);if(!$.eql(pt,yt))throw new Error("bad point: equation left != right");if(!this.isTorsionFree())throw new Error("bad point: not in prime-order subgroup")}hasEvenY(){const{y:ft}=this.toAffine();if($.isOdd)return!$.isOdd(ft);throw new Error("Field doesn't support isOdd")}equals(ft){it(ft);const{px:dt,py:pt,pz:yt}=this,{px:vt,py:wt,pz:Ct}=ft,Pt=$.eql($.mul(dt,Ct),$.mul(vt,yt)),Bt=$.eql($.mul(pt,Ct),$.mul(wt,yt));return Pt&&Bt}negate(){return new st(this.px,$.neg(this.py),this.pz)}double(){const{a:ft,b:dt}=_,pt=$.mul(dt,_3n),{px:yt,py:vt,pz:wt}=this;let Ct=$.ZERO,Pt=$.ZERO,Bt=$.ZERO,At=$.mul(yt,yt),kt=$.mul(vt,vt),Ot=$.mul(wt,wt),Tt=$.mul(yt,vt);return Tt=$.add(Tt,Tt),Bt=$.mul(yt,wt),Bt=$.add(Bt,Bt),Ct=$.mul(ft,Bt),Pt=$.mul(pt,Ot),Pt=$.add(Ct,Pt),Ct=$.sub(kt,Pt),Pt=$.add(kt,Pt),Pt=$.mul(Ct,Pt),Ct=$.mul(Tt,Ct),Bt=$.mul(pt,Bt),Ot=$.mul(ft,Ot),Tt=$.sub(At,Ot),Tt=$.mul(ft,Tt),Tt=$.add(Tt,Bt),Bt=$.add(At,At),At=$.add(Bt,At),At=$.add(At,Ot),At=$.mul(At,Tt),Pt=$.add(Pt,At),Ot=$.mul(vt,wt),Ot=$.add(Ot,Ot),At=$.mul(Ot,Tt),Ct=$.sub(Ct,At),Bt=$.mul(Ot,kt),Bt=$.add(Bt,Bt),Bt=$.add(Bt,Bt),new st(Ct,Pt,Bt)}add(ft){it(ft);const{px:dt,py:pt,pz:yt}=this,{px:vt,py:wt,pz:Ct}=ft;let Pt=$.ZERO,Bt=$.ZERO,At=$.ZERO;const kt=_.a,Ot=$.mul(_.b,_3n);let Tt=$.mul(dt,vt),ht=$.mul(pt,wt),bt=$.mul(yt,Ct),mt=$.add(dt,pt),gt=$.add(vt,wt);mt=$.mul(mt,gt),gt=$.add(Tt,ht),mt=$.sub(mt,gt),gt=$.add(dt,yt);let xt=$.add(vt,Ct);return gt=$.mul(gt,xt),xt=$.add(Tt,bt),gt=$.sub(gt,xt),xt=$.add(pt,yt),Pt=$.add(wt,Ct),xt=$.mul(xt,Pt),Pt=$.add(ht,bt),xt=$.sub(xt,Pt),At=$.mul(kt,gt),Pt=$.mul(Ot,bt),At=$.add(Pt,At),Pt=$.sub(ht,At),At=$.add(ht,At),Bt=$.mul(Pt,At),ht=$.add(Tt,Tt),ht=$.add(ht,Tt),bt=$.mul(kt,bt),gt=$.mul(Ot,gt),ht=$.add(ht,bt),bt=$.sub(Tt,bt),bt=$.mul(kt,bt),gt=$.add(gt,bt),Tt=$.mul(ht,gt),Bt=$.add(Bt,Tt),Tt=$.mul(xt,gt),Pt=$.mul(mt,Pt),Pt=$.sub(Pt,Tt),Tt=$.mul(mt,ht),At=$.mul(xt,At),At=$.add(At,Tt),new st(Pt,Bt,At)}subtract(ft){return this.add(ft.negate())}is0(){return this.equals(st.ZERO)}wNAF(ft){return lt.wNAFCached(this,ot,ft,dt=>{const pt=$.invertBatch(dt.map(yt=>yt.pz));return dt.map((yt,vt)=>yt.toAffine(pt[vt])).map(st.fromAffine)})}multiplyUnsafe(ft){const dt=st.ZERO;if(ft===_0n)return dt;if(rt(ft),ft===_1n$1)return this;const{endo:pt}=_;if(!pt)return lt.unsafeLadder(this,ft);let{k1neg:yt,k1:vt,k2neg:wt,k2:Ct}=pt.splitScalar(ft),Pt=dt,Bt=dt,At=this;for(;vt>_0n||Ct>_0n;)vt&_1n$1&&(Pt=Pt.add(At)),Ct&_1n$1&&(Bt=Bt.add(At)),At=At.double(),vt>>=_1n$1,Ct>>=_1n$1;return yt&&(Pt=Pt.negate()),wt&&(Bt=Bt.negate()),Bt=new st($.mul(Bt.px,pt.beta),Bt.py,Bt.pz),Pt.add(Bt)}multiply(ft){rt(ft);let dt=ft,pt,yt;const{endo:vt}=_;if(vt){const{k1neg:wt,k1:Ct,k2neg:Pt,k2:Bt}=vt.splitScalar(dt);let{p:At,f:kt}=this.wNAF(Ct),{p:Ot,f:Tt}=this.wNAF(Bt);At=lt.constTimeNegate(wt,At),Ot=lt.constTimeNegate(Pt,Ot),Ot=new st($.mul(Ot.px,vt.beta),Ot.py,Ot.pz),pt=At.add(Ot),yt=kt.add(Tt)}else{const{p:wt,f:Ct}=this.wNAF(dt);pt=wt,yt=Ct}return st.normalizeZ([pt,yt])[0]}multiplyAndAddUnsafe(ft,dt,pt){const yt=st.BASE,vt=(Ct,Pt)=>Pt===_0n||Pt===_1n$1||!Ct.equals(yt)?Ct.multiplyUnsafe(Pt):Ct.multiply(Pt),wt=vt(this,dt).add(vt(ft,pt));return wt.is0()?void 0:wt}toAffine(ft){const{px:dt,py:pt,pz:yt}=this,vt=this.is0();ft==null&&(ft=vt?$.ONE:$.inv(yt));const wt=$.mul(dt,ft),Ct=$.mul(pt,ft),Pt=$.mul(yt,ft);if(vt)return{x:$.ZERO,y:$.ZERO};if(!$.eql(Pt,$.ONE))throw new Error("invZ was invalid");return{x:wt,y:Ct}}isTorsionFree(){const{h:ft,isTorsionFree:dt}=_;if(ft===_1n$1)return!0;if(dt)return dt(st,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:ft,clearCofactor:dt}=_;return ft===_1n$1?this:dt?dt(st,this):this.multiplyUnsafe(_.h)}toRawBytes(ft=!0){return this.assertValidity(),j(st,this,ft)}toHex(ft=!0){return bytesToHex(this.toRawBytes(ft))}}st.BASE=new st(_.Gx,_.Gy,$.ONE),st.ZERO=new st($.ZERO,$.ONE,$.ZERO);const at=_.nBitLength,lt=wNAF(st,_.endo?Math.ceil(at/2):at);return{CURVE:_,ProjectivePoint:st,normPrivateKeyToScalar:nt,weierstrassEquation:et,isWithinCurveOrder:tt}}function validateOpts(o){const _=validateBasic(o);return validateObject(_,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,..._})}function weierstrass(o){const _=validateOpts(o),{Fp:$,n:j}=_,_e=$.BYTES+1,et=2*$.BYTES+1;function tt(gt){return _0nbytesToHex(numberToBytesBE(gt,_.nByteLength));function ct(gt){const xt=j>>_1n$1;return gt>xt}function ft(gt){return ct(gt)?rt(-gt):gt}const dt=(gt,xt,Et)=>bytesToNumberBE(gt.slice(xt,Et));class pt{constructor(xt,Et,_t){this.r=xt,this.s=Et,this.recovery=_t,this.assertValidity()}static fromCompact(xt){const Et=_.nByteLength;return xt=ensureBytes("compactSignature",xt,Et*2),new pt(dt(xt,0,Et),dt(xt,Et,2*Et))}static fromDER(xt){const{r:Et,s:_t}=DER.toSig(ensureBytes("DER",xt));return new pt(Et,_t)}assertValidity(){if(!at(this.r))throw new Error("r must be 0 < r < CURVE.n");if(!at(this.s))throw new Error("s must be 0 < s < CURVE.n")}addRecoveryBit(xt){return new pt(this.r,this.s,xt)}recoverPublicKey(xt){const{r:Et,s:_t,recovery:$t}=this,St=Bt(ensureBytes("msgHash",xt));if($t==null||![0,1,2,3].includes($t))throw new Error("recovery id invalid");const Rt=$t===2||$t===3?Et+_.n:Et;if(Rt>=$.ORDER)throw new Error("recovery id 2 or 3 invalid");const It=$t&1?"03":"02",Mt=ot.fromHex(It+lt(Rt)),Vt=nt(Rt),Gt=rt(-St*Vt),zt=rt(_t*Vt),jt=ot.BASE.multiplyAndAddUnsafe(Mt,Gt,zt);if(!jt)throw new Error("point at infinify");return jt.assertValidity(),jt}hasHighS(){return ct(this.s)}normalizeS(){return this.hasHighS()?new pt(this.r,rt(-this.s),this.recovery):this}toDERRawBytes(){return hexToBytes(this.toDERHex())}toDERHex(){return DER.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return hexToBytes(this.toCompactHex())}toCompactHex(){return lt(this.r)+lt(this.s)}}const yt={isValidPrivateKey(gt){try{return it(gt),!0}catch{return!1}},normPrivateKeyToScalar:it,randomPrivateKey:()=>{const gt=getMinHashLength(_.n);return mapHashToField(_.randomBytes(gt),_.n)},precompute(gt=8,xt=ot.BASE){return xt._setWindowSize(gt),xt.multiply(BigInt(3)),xt}};function vt(gt,xt=!0){return ot.fromPrivateKey(gt).toRawBytes(xt)}function wt(gt){const xt=gt instanceof Uint8Array,Et=typeof gt=="string",_t=(xt||Et)&>.length;return xt?_t===_e||_t===et:Et?_t===2*_e||_t===2*et:gt instanceof ot}function Ct(gt,xt,Et=!0){if(wt(gt))throw new Error("first arg must be private key");if(!wt(xt))throw new Error("second arg must be public key");return ot.fromHex(xt).multiply(it(gt)).toRawBytes(Et)}const Pt=_.bits2int||function(gt){const xt=bytesToNumberBE(gt),Et=gt.length*8-_.nBitLength;return Et>0?xt>>BigInt(Et):xt},Bt=_.bits2int_modN||function(gt){return rt(Pt(gt))},At=bitMask(_.nBitLength);function kt(gt){if(typeof gt!="bigint")throw new Error("bigint expected");if(!(_0n<=gt&>qt in Et))throw new Error("sign() legacy options not supported");const{hash:_t,randomBytes:$t}=_;let{lowS:St,prehash:Rt,extraEntropy:It}=Et;St==null&&(St=!0),gt=ensureBytes("msgHash",gt),Rt&&(gt=ensureBytes("prehashed msgHash",_t(gt)));const Mt=Bt(gt),Vt=it(xt),Gt=[kt(Vt),kt(Mt)];if(It!=null){const qt=It===!0?$t($.BYTES):It;Gt.push(ensureBytes("extraEntropy",qt))}const zt=concatBytes(...Gt),jt=Mt;function Ft(qt){const Xt=Pt(qt);if(!at(Xt))return;const Ut=nt(Xt),Lt=ot.BASE.multiply(Xt).toAffine(),Ht=rt(Lt.x);if(Ht===_0n)return;const Kt=rt(Ut*rt(jt+Ht*Vt));if(Kt===_0n)return;let Jt=(Lt.x===Ht?0:2)|Number(Lt.y&_1n$1),tr=Kt;return St&&ct(Kt)&&(tr=ft(Kt),Jt^=1),new pt(Ht,tr,Jt)}return{seed:zt,k2sig:Ft}}const Tt={lowS:_.lowS,prehash:!1},ht={lowS:_.lowS,prehash:!1};function bt(gt,xt,Et=Tt){const{seed:_t,k2sig:$t}=Ot(gt,xt,Et),St=_;return createHmacDrbg(St.hash.outputLen,St.nByteLength,St.hmac)(_t,$t)}ot.BASE._setWindowSize(8);function mt(gt,xt,Et,_t=ht){var Lt;const $t=gt;if(xt=ensureBytes("msgHash",xt),Et=ensureBytes("publicKey",Et),"strict"in _t)throw new Error("options.strict was renamed to lowS");const{lowS:St,prehash:Rt}=_t;let It,Mt;try{if(typeof $t=="string"||$t instanceof Uint8Array)try{It=pt.fromDER($t)}catch(Ht){if(!(Ht instanceof DER.Err))throw Ht;It=pt.fromCompact($t)}else if(typeof $t=="object"&&typeof $t.r=="bigint"&&typeof $t.s=="bigint"){const{r:Ht,s:Kt}=$t;It=new pt(Ht,Kt)}else throw new Error("PARSE");Mt=ot.fromHex(Et)}catch(Ht){if(Ht.message==="PARSE")throw new Error("signature must be Signature instance, Uint8Array or hex string");return!1}if(St&&It.hasHighS())return!1;Rt&&(xt=_.hash(xt));const{r:Vt,s:Gt}=It,zt=Bt(xt),jt=nt(Gt),Ft=rt(zt*jt),qt=rt(Vt*jt),Xt=(Lt=ot.BASE.multiplyAndAddUnsafe(Mt,Ft,qt))==null?void 0:Lt.toAffine();return Xt?rt(Xt.x)===Vt:!1}return{CURVE:_,getPublicKey:vt,getSharedSecret:Ct,sign:bt,verify:mt,ProjectivePoint:ot,Signature:pt,utils:yt}}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */function getHash(o){return{hash:o,hmac:(_,...$)=>hmac(o,_,concatBytes$1(...$)),randomBytes}}function createCurve(o,_){const $=j=>weierstrass({...o,...getHash(j)});return Object.freeze({...$(_),create:$})}/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const secp256k1P=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),secp256k1N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),_1n=BigInt(1),_2n=BigInt(2),divNearest=(o,_)=>(o+_/_2n)/_;function sqrtMod(o){const _=secp256k1P,$=BigInt(3),j=BigInt(6),_e=BigInt(11),et=BigInt(22),tt=BigInt(23),rt=BigInt(44),nt=BigInt(88),ot=o*o*o%_,it=ot*ot*o%_,st=pow2(it,$,_)*it%_,at=pow2(st,$,_)*it%_,lt=pow2(at,_2n,_)*ot%_,ct=pow2(lt,_e,_)*lt%_,ft=pow2(ct,et,_)*ct%_,dt=pow2(ft,rt,_)*ft%_,pt=pow2(dt,nt,_)*dt%_,yt=pow2(pt,rt,_)*ft%_,vt=pow2(yt,$,_)*it%_,wt=pow2(vt,tt,_)*ct%_,Ct=pow2(wt,j,_)*ot%_,Pt=pow2(Ct,_2n,_);if(!Fp.eql(Fp.sqr(Pt),o))throw new Error("Cannot find square root");return Pt}const Fp=Field(secp256k1P,void 0,void 0,{sqrt:sqrtMod}),secp256k1=createCurve({a:BigInt(0),b:BigInt(7),Fp,n:secp256k1N,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:o=>{const _=secp256k1N,$=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),j=-_1n*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),_e=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),et=$,tt=BigInt("0x100000000000000000000000000000000"),rt=divNearest(et*o,_),nt=divNearest(-j*o,_);let ot=mod(o-rt*$-nt*_e,_),it=mod(-rt*j-nt*et,_);const st=ot>tt,at=it>tt;if(st&&(ot=_-ot),at&&(it=_-it),ot>tt||it>tt)throw new Error("splitScalar: Endomorphism failed, k="+o);return{k1neg:st,k1:ot,k2neg:at,k2:it}}}},sha256);BigInt(0);secp256k1.ProjectivePoint;const ZeroHash="0x0000000000000000000000000000000000000000000000000000000000000000",MessagePrefix=`Ethereum Signed Message: -`,BN_0=BigInt(0),BN_1=BigInt(1),BN_2=BigInt(2),BN_27=BigInt(27),BN_28=BigInt(28),BN_35=BigInt(35),BN_N=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),BN_N_2=BN_N/BN_2,inspect=Symbol.for("nodejs.util.inspect.custom"),_guard={};function toUint256(o){return zeroPadValue(toBeArray(o),32)}var En,Zr,Sn,Xr;const Kr=class Kr{constructor(_,$,j,_e){wn(this,En);wn(this,Zr);wn(this,Sn);wn(this,Xr);assertPrivate(_,_guard,"Signature"),Gr(this,En,$),Gr(this,Zr,j),Gr(this,Sn,_e),Gr(this,Xr,null)}get r(){return Vr(this,En)}set r(_){assertArgument(dataLength(_)===32,"invalid r","value",_),Gr(this,En,hexlify(_))}get s(){return assertArgument(parseInt(Vr(this,Zr).substring(0,3))<8,"non-canonical s; use ._s","s",Vr(this,Zr)),Vr(this,Zr)}set s(_){assertArgument(dataLength(_)===32,"invalid s","value",_),Gr(this,Zr,hexlify(_))}get _s(){return Vr(this,Zr)}isValid(){return BigInt(Vr(this,Zr))<=BN_N_2}get v(){return Vr(this,Sn)}set v(_){const $=getNumber(_,"value");assertArgument($===27||$===28,"invalid v","v",_),Gr(this,Sn,$)}get networkV(){return Vr(this,Xr)}get legacyChainId(){const _=this.networkV;return _==null?null:Kr.getChainId(_)}get yParity(){return this.v===27?0:1}get yParityAndS(){const _=getBytes(this.s);return this.yParity&&(_[0]|=128),hexlify(_)}get compactSerialized(){return concat([this.r,this.yParityAndS])}get serialized(){return concat([this.r,this.s,this.yParity?"0x1c":"0x1b"])}getCanonical(){if(this.isValid())return this;const _=BN_N-BigInt(this._s),$=55-this.v,j=new Kr(_guard,this.r,toUint256(_),$);return this.networkV&&Gr(j,Xr,this.networkV),j}clone(){const _=new Kr(_guard,this.r,this._s,this.v);return this.networkV&&Gr(_,Xr,this.networkV),_}toJSON(){const _=this.networkV;return{_type:"signature",networkV:_!=null?_.toString():null,r:this.r,s:this._s,v:this.v}}[inspect](){return this.toString()}toString(){return this.isValid()?`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v} }`:`Signature { r: ${this.r}, s: ${this._s}, v: ${this.v}, valid: false }`}static getChainId(_){const $=getBigInt(_,"v");return $==BN_27||$==BN_28?BN_0:(assertArgument($>=BN_35,"invalid EIP-155 v","v",_),($-BN_35)/BN_2)}static getChainIdV(_,$){return getBigInt(_)*BN_2+BigInt(35+$-27)}static getNormalizedV(_){const $=getBigInt(_);return $===BN_0||$===BN_27?27:$===BN_1||$===BN_28?28:(assertArgument($>=BN_35,"invalid v","v",_),$&BN_1?27:28)}static from(_){function $(ot,it){assertArgument(ot,it,"signature",_)}if(_==null)return new Kr(_guard,ZeroHash,ZeroHash,27);if(typeof _=="string"){const ot=getBytes(_,"signature");if(ot.length===64){const it=hexlify(ot.slice(0,32)),st=ot.slice(32,64),at=st[0]&128?28:27;return st[0]&=127,new Kr(_guard,it,hexlify(st),at)}if(ot.length===65){const it=hexlify(ot.slice(0,32)),st=hexlify(ot.slice(32,64)),at=Kr.getNormalizedV(ot[64]);return new Kr(_guard,it,st,at)}$(!1,"invalid raw signature length")}if(_ instanceof Kr)return _.clone();const j=_.r;$(j!=null,"missing r");const _e=toUint256(j),et=function(ot,it){if(ot!=null)return toUint256(ot);if(it!=null){$(isHexString(it,32),"invalid yParityAndS");const st=getBytes(it);return st[0]&=127,hexlify(st)}$(!1,"missing s")}(_.s,_.yParityAndS),{networkV:tt,v:rt}=function(ot,it,st){if(ot!=null){const at=getBigInt(ot);return{networkV:at>=BN_35?at:void 0,v:Kr.getNormalizedV(at)}}if(it!=null)return $(isHexString(it,32),"invalid yParityAndS"),{v:getBytes(it)[0]&128?28:27};if(st!=null){switch(getNumber(st,"sig.yParity")){case 0:return{v:27};case 1:return{v:28}}$(!1,"invalid yParity")}$(!1,"missing v")}(_.v,_.yParityAndS,_.yParity),nt=new Kr(_guard,_e,et,rt);return tt&&Gr(nt,Xr,tt),$(_.yParity==null||getNumber(_.yParity,"sig.yParity")===nt.yParity,"yParity mismatch"),$(_.yParityAndS==null||_.yParityAndS===nt.yParityAndS,"yParityAndS mismatch"),nt}};En=new WeakMap,Zr=new WeakMap,Sn=new WeakMap,Xr=new WeakMap;let Signature=Kr;var Yr;const xn=class xn{constructor(_){wn(this,Yr);assertArgument(dataLength(_)===32,"invalid private key","privateKey","[REDACTED]"),Gr(this,Yr,hexlify(_))}get privateKey(){return Vr(this,Yr)}get publicKey(){return xn.computePublicKey(Vr(this,Yr))}get compressedPublicKey(){return xn.computePublicKey(Vr(this,Yr),!0)}sign(_){assertArgument(dataLength(_)===32,"invalid digest length","digest",_);const $=secp256k1.sign(getBytesCopy(_),getBytesCopy(Vr(this,Yr)),{lowS:!0});return Signature.from({r:toBeHex($.r,32),s:toBeHex($.s,32),v:$.recovery?28:27})}computeSharedSecret(_){const $=xn.computePublicKey(_);return hexlify(secp256k1.getSharedSecret(getBytesCopy(Vr(this,Yr)),getBytes($),!1))}static computePublicKey(_,$){let j=getBytes(_,"key");if(j.length===32){const et=secp256k1.getPublicKey(j,!!$);return hexlify(et)}if(j.length===64){const et=new Uint8Array(65);et[0]=4,et.set(j,1),j=et}const _e=secp256k1.ProjectivePoint.fromHex(j);return hexlify(_e.toRawBytes($))}static recoverPublicKey(_,$){assertArgument(dataLength(_)===32,"invalid digest length","digest",_);const j=Signature.from($);let _e=secp256k1.Signature.fromCompact(getBytesCopy(concat([j.r,j.s])));_e=_e.addRecoveryBit(j.yParity);const et=_e.recoverPublicKey(getBytesCopy(_));return assertArgument(et!=null,"invalid signature for digest","signature",$),"0x"+et.toHex(!1)}static addPoints(_,$,j){const _e=secp256k1.ProjectivePoint.fromHex(xn.computePublicKey(_).substring(2)),et=secp256k1.ProjectivePoint.fromHex(xn.computePublicKey($).substring(2));return"0x"+_e.add(et).toHex(!!j)}};Yr=new WeakMap;let SigningKey=xn;function hashMessage(o){return typeof o=="string"&&(o=toUtf8Bytes(o)),keccak256(concat([toUtf8Bytes(MessagePrefix),toUtf8Bytes(String(o.length)),o]))}const BIG_NUMBER_WEI_MULTIPLIER=new BigNumber("1e18"),BIG_NUMBER_GWEI_MULTIPLIER=new BigNumber("1e9"),BIG_NUMBER_ETH_MULTIPLIER=new BigNumber("1"),toBigNumber={hex:o=>typeof o=="string"?new BigNumber(stripHexPrefix(o),16):new BigNumber(o,16),dec:o=>new BigNumber(o,10)},toNormalizedDenomination={WEI:o=>o.div(BIG_NUMBER_WEI_MULTIPLIER),GWEI:o=>o.div(BIG_NUMBER_GWEI_MULTIPLIER),ETH:o=>o.div(BIG_NUMBER_ETH_MULTIPLIER)},toSpecifiedDenomination={WEI:o=>o.times(BIG_NUMBER_WEI_MULTIPLIER).dp(0,BigNumber.ROUND_HALF_UP),GWEI:o=>o.times(BIG_NUMBER_GWEI_MULTIPLIER).dp(9,BigNumber.ROUND_HALF_UP),ETH:o=>o.times(BIG_NUMBER_ETH_MULTIPLIER).dp(9,BigNumber.ROUND_HALF_UP)},baseChange={hex:o=>o.toString(16),dec:o=>new BigNumber(o).toString(10)},converter=o=>{const{value:_,fromNumericBase:$,fromDenomination:j,toNumericBase:_e,toDenomination:et,numberOfDecimals:tt}=o;let rt=toBigNumber[$](_);return j&&(rt=toNormalizedDenomination[j](rt)),et&&(rt=toSpecifiedDenomination[et](rt)),tt&&(rt=rt.dp(tt,BigNumber.ROUND_HALF_DOWN)),_e&&(rt=baseChange[_e](rt)),rt},conversionUtil=(o,{fromNumericBase:_="hex",toNumericBase:$,fromDenomination:j,toDenomination:_e,numberOfDecimals:et})=>converter({fromNumericBase:_,toNumericBase:$,fromDenomination:j,toDenomination:_e,numberOfDecimals:et,value:o||"0"});function decGWEIToHexWEI(o){return conversionUtil(o,{fromNumericBase:"dec",toNumericBase:"hex",fromDenomination:"GWEI",toDenomination:"WEI"})}function hexWEIToDecGWEI(o){return conversionUtil(o,{fromNumericBase:"hex",toNumericBase:"dec",fromDenomination:"WEI",toDenomination:"GWEI"})}function normalizeGWEIDecimalNumbers(o){const _=decGWEIToHexWEI(o);return hexWEIToDecGWEI(_).toString()}async function fetchEip1159GasEstimates(o){const _=await get$4(o);return _objectSpread2(_objectSpread2({},_),{},{estimatedBaseFee:normalizeGWEIDecimalNumbers(_.estimatedBaseFee),low:_objectSpread2(_objectSpread2({},_.low),{},{suggestedMaxPriorityFeePerGas:normalizeGWEIDecimalNumbers(_.low.suggestedMaxPriorityFeePerGas),suggestedMaxFeePerGas:normalizeGWEIDecimalNumbers(_.low.suggestedMaxFeePerGas)}),medium:_objectSpread2(_objectSpread2({},_.medium),{},{suggestedMaxPriorityFeePerGas:normalizeGWEIDecimalNumbers(_.medium.suggestedMaxPriorityFeePerGas),suggestedMaxFeePerGas:normalizeGWEIDecimalNumbers(_.medium.suggestedMaxFeePerGas)}),high:_objectSpread2(_objectSpread2({},_.high),{},{suggestedMaxPriorityFeePerGas:normalizeGWEIDecimalNumbers(_.high.suggestedMaxPriorityFeePerGas),suggestedMaxFeePerGas:normalizeGWEIDecimalNumbers(_.high.suggestedMaxFeePerGas)})})}async function fetchLegacyGasPriceEstimates(o){const _=await get$4(o,{referrer:o,referrerPolicy:"no-referrer-when-downgrade",method:"GET",mode:"cors"});return{low:_.SafeGasPrice,medium:_.ProposeGasPrice,high:_.FastGasPrice}}function validateAddress(o,_){if(!o||typeof o!="string"||!isValidAddress(o))throw new Error(`Invalid "${_}" address: ${o} must be a valid string.`)}async function validateTypedSignMessageDataV4(o,_){if(validateAddress(o.from,"from"),!o.data||Array.isArray(o.data)||typeof o.data!="object"&&typeof o.data!="string")throw new Error('Invalid message "data": Must be a valid string or object.');let $;if(typeof o.data=="object")$=o.data;else try{$=JSON.parse(o.data)}catch{throw new Error("Data must be passed as a valid JSON string.")}if(!_)throw new Error("Current chainId cannot be null or undefined.");let{chainId:j}=$.domain;if(j){typeof j=="string"&&(j=parseInt(j,j.startsWith("0x")?16:10));const _e=parseInt(_,16);if(Number.isNaN(_e))throw new Error(`Cannot sign messages for chainId "${j}", because Web3Auth is switching networks.`);if(j!==_e)throw new Error(`Provided chainId "${j}" must match the active chainId "${_e}"`)}}async function signTx(o,_,$){const j=await $.formatTransaction(o),{Transaction:_e}=await __vitePreload(async()=>{const{Transaction:rt}=await import("./index-SdYwD8P5.js");return{Transaction:rt}},[]),et=_e.from(_objectSpread2(_objectSpread2({},j),{},{from:void 0})),tt=new SigningKey(addHexPrefix(_));return et.signature=tt.sign(et.unsignedHash),et.serialized}function getProviderHandlers({txFormatter:o,privKey:_,keyExportEnabled:$,getProviderEngineProxy:j}){return{getAccounts:async _e=>[`0x${Buffer$3.from(privateToAddress(Buffer$3.from(_,"hex"))).toString("hex")}`],getPublicKey:async _e=>{const et=getPublicCompressed(Buffer$3.from(stripHexPrefix(_),"hex"));return`0x${Buffer$3.from(et).toString("hex")}`},getPrivateKey:async _e=>{if(!$)throw providerErrors.custom({message:"Private key export is disabled",code:4902});return _},processTransaction:async(_e,et)=>{const tt=j();if(!tt)throw providerErrors.custom({message:"Provider is not initialized",code:4902});_e.input&&!_e.data&&(_e.data=addHexPrefix(_e.input));const rt=await signTx(_e,_,o);return await tt.request({method:"eth_sendRawTransaction",params:[rt]})},processSignTransaction:async(_e,et)=>{if(!j())throw providerErrors.custom({message:"Provider is not initialized",code:4902});return _e.input&&!_e.data&&(_e.data=addHexPrefix(_e.input)),await signTx(_e,_,o)},processEthSignMessage:async(_e,et)=>signMessage(_,_e.data),processPersonalMessage:async(_e,et)=>{const tt=Buffer$3.from(_,"hex"),rt=new SigningKey(tt),{data:nt}=_e,ot=isHexString$1(nt)?Buffer$3.from(stripHexPrefix(nt),"hex"):Buffer$3.from(nt);return rt.sign(hashMessage(ot)).serialized},processTypedMessageV4:async(_e,et)=>{loglevel.debug("processTypedMessageV4",_e);const tt=Buffer$3.from(_,"hex"),rt=j();if(!rt)throw providerErrors.custom({message:"Provider is not initialized",code:4902});const nt=await rt.request({method:"eth_chainId"});await validateTypedSignMessageDataV4(_e,nt);const ot=typeof _e.data=="string"?JSON.parse(_e.data):_e.data,it=new SigningKey(tt);return validateTypedData(ot),it.sign(hashTypedData(ot)).serialized}}}function bnLessThan(o,_){return o==null||_===null||_===void 0?null:new BigNumber(o,10).lt(_,10)}function bnToHex(o){return addHexPrefix(o.toString(16))}function hexToBn(o){return BN$7.isBN(o)?o:new BN$7(stripHexPrefix(o),16)}function BnMultiplyByFraction(o,_,$){const j=new BN$7(_),_e=new BN$7($);return o.mul(j).div(_e)}const LegacyGasAPIEndpoint="https://gas-api.metaswap.codefi.network/networks//gasPrices",EIP1559APIEndpoint="https://gas-api.metaswap.codefi.network/networks//suggestedGasFees",TRANSACTION_ENVELOPE_TYPES={LEGACY:"0x0",FEE_MARKET:"0x2"},TRANSACTION_TYPES={SENT_ETHER:"sentEther",CONTRACT_INTERACTION:"contractInteraction",DEPLOY_CONTRACT:"contractDeployment"},GAS_ESTIMATE_TYPES={FEE_MARKET:"fee-market",LEGACY:"legacy",ETH_GASPRICE:"eth_gasPrice",NONE:"none"};class TransactionFormatter{constructor({getProviderEngineProxy:_}){_defineProperty$z(this,"API_SUPPORTED_CHAINIDS",new Set(["0x1","0x5","0x13881","0xa4b1","0xa86a","0x2105","0x38","0xfa","0xa","0x89"])),_defineProperty$z(this,"chainConfig",null),_defineProperty$z(this,"getProviderEngineProxy",void 0),_defineProperty$z(this,"isEIP1559Compatible",!1),this.getProviderEngineProxy=_}get providerProxy(){return this.getProviderEngineProxy()}async init(){this.chainConfig=await this.providerProxy.request({method:"eth_provider_config"}),this.isEIP1559Compatible=await this.getEIP1559Compatibility()}async formatTransaction(_){if(!this.chainConfig)throw new Error("Chain config not initialized");const $=_objectSpread2({},_);if($.nonce===void 0&&($.nonce=await this.providerProxy.request({method:"eth_getTransactionCount",params:[_.from,"latest"]})),!this.isEIP1559Compatible&&$.gasPrice){if($.maxFeePerGas&&delete $.maxFeePerGas,$.maxPriorityFeePerGas&&delete $.maxPriorityFeePerGas,!$.gasLimit)if($.gas)$.gasLimit=addHexPrefix($.gas);else{const tt=await this.getDefaultGasLimit($);tt&&($.gasLimit=tt)}return $}if(!$.gasLimit)if($.gas)$.gasLimit=addHexPrefix($.gas);else{const tt=await this.getDefaultGasLimit($);tt&&($.gasLimit=tt)}const{gasPrice:j,maxFeePerGas:_e,maxPriorityFeePerGas:et}=await this.getDefaultGasFees($);return this.isEIP1559Compatible?($.gasPrice&&!$.maxFeePerGas&&!$.maxPriorityFeePerGas?($.maxFeePerGas=$.gasPrice,$.maxPriorityFeePerGas=bnLessThan(typeof et=="string"?stripHexPrefix(et):et,typeof $.gasPrice=="string"?stripHexPrefix($.gasPrice):$.gasPrice.toString())?addHexPrefix(et):addHexPrefix($.gasPrice.toString())):(_e&&!$.maxFeePerGas&&($.maxFeePerGas=addHexPrefix(_e)),et&&!$.maxPriorityFeePerGas&&($.maxPriorityFeePerGas=addHexPrefix(et)),j&&!$.maxFeePerGas&&($.maxFeePerGas=addHexPrefix(j)),$.maxFeePerGas&&!$.maxPriorityFeePerGas&&($.maxPriorityFeePerGas=$.maxFeePerGas)),delete $.gasPrice):(delete $.maxPriorityFeePerGas,delete $.maxFeePerGas),j&&!$.gasPrice&&!$.maxPriorityFeePerGas&&!$.maxFeePerGas&&($.gasPrice=j),$.type=Number.parseInt(this.isEIP1559Compatible?TRANSACTION_ENVELOPE_TYPES.FEE_MARKET:TRANSACTION_ENVELOPE_TYPES.LEGACY,16),$.chainId=this.chainConfig.chainId,$}async fetchEthGasPriceEstimate(){const _=await this.providerProxy.request({method:"eth_gasPrice",params:[]});return{gasPrice:hexWEIToDecGWEI(_).toString()}}async fetchGasEstimatesViaEthFeeHistory(){const $="latest",j=[10,50,95],_e=await this.providerProxy.request({method:"eth_feeHistory",params:[10,$,j]}),et=_e.baseFeePerGas[_e.baseFeePerGas.length-1],tt=_e.reward.reduce((rt,nt)=>({slow:rt.slow.plus(new BigNumber(nt[0],16)),average:rt.average.plus(new BigNumber(nt[1],16)),fast:rt.fast.plus(new BigNumber(nt[2],16))}),{slow:new BigNumber(0),average:new BigNumber(0),fast:new BigNumber(0)});return{estimatedBaseFee:hexWEIToDecGWEI(et).toString(),high:{maxWaitTimeEstimate:3e4,minWaitTimeEstimate:15e3,suggestedMaxFeePerGas:hexWEIToDecGWEI(tt.fast.plus(et).toString(16)).toString(),suggestedMaxPriorityFeePerGas:hexWEIToDecGWEI(tt.fast.toString(16)).toString()},medium:{maxWaitTimeEstimate:45e3,minWaitTimeEstimate:15e3,suggestedMaxFeePerGas:hexWEIToDecGWEI(tt.average.plus(et).toString(16)).toString(),suggestedMaxPriorityFeePerGas:hexWEIToDecGWEI(tt.average.toString(16)).toString()},low:{maxWaitTimeEstimate:6e4,minWaitTimeEstimate:15e3,suggestedMaxFeePerGas:hexWEIToDecGWEI(tt.slow.plus(et).toString(16)).toString(),suggestedMaxPriorityFeePerGas:hexWEIToDecGWEI(tt.slow.toString(16)).toString()}}}async getEIP1559Compatibility(){const _=await this.providerProxy.request({method:"eth_getBlockByNumber",params:["latest",!1]});return!!(_&&_.baseFeePerGas!==void 0)}async fetchGasFeeEstimateData(){if(!this.chainConfig)throw new Error("Chain config not initialized");const _=this.chainConfig.chainId==="0x1",$=Number.parseInt(this.chainConfig.chainId,16);let j;try{if(this.isEIP1559Compatible){let _e;try{if(this.API_SUPPORTED_CHAINIDS.has(this.chainConfig.chainId))_e=await fetchEip1159GasEstimates(EIP1559APIEndpoint.replace("",`${$}`));else throw new Error("Chain id not supported by api")}catch{_e=await this.fetchGasEstimatesViaEthFeeHistory()}j={gasFeeEstimates:_e,gasEstimateType:GAS_ESTIMATE_TYPES.FEE_MARKET}}else if(_)j={gasFeeEstimates:await fetchLegacyGasPriceEstimates(LegacyGasAPIEndpoint.replace("",`${$}`)),gasEstimateType:GAS_ESTIMATE_TYPES.LEGACY};else throw new Error("Main gas fee/price estimation failed. Use fallback")}catch{try{j={gasFeeEstimates:await this.fetchEthGasPriceEstimate(),gasEstimateType:GAS_ESTIMATE_TYPES.ETH_GASPRICE}}catch(et){throw new Error(`Gas fee/price estimation failed. Message: ${et.message}`)}}return j}async getDefaultGasFees(_){if(!this.isEIP1559Compatible&&_.gasPrice||this.isEIP1559Compatible&&_.maxFeePerGas&&_.maxPriorityFeePerGas)return{};try{const{gasFeeEstimates:j,gasEstimateType:_e}=await this.fetchGasFeeEstimateData();if(this.isEIP1559Compatible&&_e===GAS_ESTIMATE_TYPES.FEE_MARKET){const{medium:{suggestedMaxPriorityFeePerGas:et,suggestedMaxFeePerGas:tt}={}}=j;if(et&&tt)return{maxFeePerGas:addHexPrefix(decGWEIToHexWEI(tt)),maxPriorityFeePerGas:addHexPrefix(decGWEIToHexWEI(et))}}else{if(_e===GAS_ESTIMATE_TYPES.LEGACY)return{gasPrice:addHexPrefix(decGWEIToHexWEI(j.medium))};if(_e===GAS_ESTIMATE_TYPES.ETH_GASPRICE)return{gasPrice:addHexPrefix(decGWEIToHexWEI(j.gasPrice))}}}catch(j){loglevel.error(j)}const{gasPrice:$}=await this.fetchEthGasPriceEstimate();return{gasPrice:addHexPrefix(decGWEIToHexWEI($))}}async estimateTxGas(_){const $=_objectSpread2({},_);return delete $.gasPrice,delete $.maxFeePerGas,delete $.maxPriorityFeePerGas,await this.providerProxy.request({method:"eth_estimateGas",params:[$]})}async analyzeGasUsage(_){const $=await this.providerProxy.request({method:"eth_getBlockByNumber",params:["latest",!1]}),j=hexToBn($.gasLimit),_e=BnMultiplyByFraction(j,19,20);let et=bnToHex(_e);try{et=await this.estimateTxGas(_)}catch(tt){loglevel.warn(tt)}return{blockGasLimit:$.gasLimit,estimatedGasHex:et}}addGasBuffer(_,$,j=1.5){const _e=hexToBn(_),tt=hexToBn($).muln(.9),rt=_e.muln(j);return _e.gt(tt)?bnToHex(_e):rt.lt(tt)?bnToHex(rt):bnToHex(tt)}async determineTransactionCategory(_){const{data:$,to:j}=_;let _e="",et;if($&&!j)et=TRANSACTION_TYPES.DEPLOY_CONTRACT;else{try{_e=await this.providerProxy.request({method:"eth_getCode",params:[j,"latest"]})}catch(rt){loglevel.warn(rt)}et=!_e||_e==="0x"||_e==="0x0"?TRANSACTION_TYPES.SENT_ETHER:TRANSACTION_TYPES.CONTRACT_INTERACTION}return{transactionCategory:et,code:_e}}async getDefaultGasLimit(_){const{transactionCategory:$}=await this.determineTransactionCategory(_objectSpread2({},_));if(_.gas)return addHexPrefix(_.gas);if(_.to&&$===TRANSACTION_TYPES.SENT_ETHER){if(_.data)throw Error("TxGasUtil - Trying to call a function on a non-contract address");return addHexPrefix(21e3.toString(16))}const{blockGasLimit:j,estimatedGasHex:_e}=await this.analyzeGasUsage(_);return this.addGasBuffer(addHexPrefix(_e),j)}}var _EthereumPrivateKeyProvider;class EthereumPrivateKeyProvider extends BaseProvider{constructor({config:_,state:$}){super({config:_,state:$}),_defineProperty$z(this,"PROVIDER_CHAIN_NAMESPACE",CHAIN_NAMESPACES.EIP155)}async enable(){if(!this.state.privateKey)throw providerErrors.custom({message:"Private key is not found in state, plz pass it in constructor state param",code:4902});return await this.setupProvider(this.state.privateKey),this._providerEngineProxy.request({method:"eth_accounts"})}async setupProvider(_){const{chainNamespace:$}=this.config.chainConfig;if($!==this.PROVIDER_CHAIN_NAMESPACE)throw WalletInitializationError.incompatibleChainNameSpace("Invalid chain namespace");const j=new TransactionFormatter({getProviderEngineProxy:this.getProviderEngineProxy.bind(this)}),_e=getProviderHandlers({txFormatter:j,privKey:_,getProviderEngineProxy:this.getProviderEngineProxy.bind(this),keyExportEnabled:this.config.keyExportEnabled}),et=createEthMiddleware(_e),tt=this.getChainSwitchMiddleware(),rt=new JRPCEngine,{networkMiddleware:nt}=createJsonRpcClient(this.config.chainConfig);rt.push(et),rt.push(tt),rt.push(this.getAccountMiddleware()),rt.push(nt);const ot=providerFromEngine(rt);this.updateProviderEngineProxy(ot),await j.init(),await this.lookupNetwork()}async updateAccount(_){if(!this._providerEngineProxy)throw providerErrors.custom({message:"Provider is not initialized",code:4902});if(await this._providerEngineProxy.request({method:"eth_private_key"})!==_.privateKey){await this.setupProvider(_.privateKey);const j=await this._providerEngineProxy.request({method:"eth_accounts"});this.emit("accountsChanged",j)}}async switchChain(_){if(!this._providerEngineProxy)throw providerErrors.custom({message:"Provider is not initialized",code:4902});const $=this.getChainConfig(_.chainId);this.update({chainId:"loading"}),this.configure({chainConfig:$});const j=await this._providerEngineProxy.request({method:"eth_private_key"});await this.setupProvider(j)}async lookupNetwork(){if(!this._providerEngineProxy)throw providerErrors.custom({message:"Provider is not initialized",code:4902});const{chainId:_}=this.config.chainConfig;if(!_)throw rpcErrors.invalidParams("chainId is required while lookupNetwork");const $=await this._providerEngineProxy.request({method:"net_version",params:[]}),j=isHexString$1($)?parseInt($,16):parseInt($,10);if(parseInt(_,16)!==j)throw providerErrors.chainDisconnected(`Invalid network, net_version is: ${$}`);return this.state.chainId!==_&&(this.emit("chainChanged",_),this.emit("connect",{chainId:_})),this.update({chainId:_}),$}getChainSwitchMiddleware(){return createChainSwitchMiddleware({addChain:async j=>{const{chainId:_e,chainName:et,rpcUrls:tt,blockExplorerUrls:rt,nativeCurrency:nt,iconUrls:ot}=j;this.addChain({chainNamespace:CHAIN_NAMESPACES.EIP155,chainId:_e,ticker:(nt==null?void 0:nt.symbol)||"ETH",tickerName:(nt==null?void 0:nt.name)||"Ether",displayName:et,rpcTarget:tt[0],blockExplorerUrl:(rt==null?void 0:rt[0])||"",decimals:(nt==null?void 0:nt.decimals)||18,logo:(ot==null?void 0:ot[0])||"https://images.toruswallet.io/eth.svg"})},switchChain:async j=>{const{chainId:_e}=j;await this.switchChain({chainId:_e})}})}getAccountMiddleware(){return createAccountMiddleware({updatePrivatekey:async $=>{const{privateKey:j}=$;await this.updateAccount({privateKey:j})}})}}_EthereumPrivateKeyProvider=EthereumPrivateKeyProvider;_defineProperty$z(EthereumPrivateKeyProvider,"getProviderInstance",async o=>{const _=new _EthereumPrivateKeyProvider({config:{chainConfig:o.chainConfig}});return await _.setupProvider(o.privKey),_});const Ctx$1=reactExports.createContext(void 0),Web3AuthProvider=({children:o})=>{const[_,$]=reactExports.useState(null),[j,_e]=reactExports.useState(null),[et,tt]=reactExports.useState(null),[rt,nt]=reactExports.useState(!1),ot=reactExports.useRef(null),it=reactExports.useRef(null);reactExports.useEffect(()=>{(async()=>{const ft="BIKasG1HwkyFsv8reWq_djHe7xWyW-NCnCGN4997DHH7lyoCabx4qedqGucyJ25NfOQxfPCvXWgb8P9ZsKmUA8k",dt="mainnet",pt={chainNamespace:CHAIN_NAMESPACES.EIP155,chainId:"0x14A34",rpcTarget:"https://sepolia.base.org",displayName:"Base Sepolia",ticker:"ETH",tickerName:"Ether"},yt=new EthereumPrivateKeyProvider({config:{chainConfig:pt}}),vt=new Web3AuthNoModal({clientId:ft,web3AuthNetwork:dt,chainConfig:pt,privateKeyProvider:yt,multiInjectedProviderDiscovery:!1}),wt=new AuthAdapter({privateKeyProvider:yt});vt.configureAdapter(wt),it.current=WALLET_ADAPTERS.AUTH,ot.current=vt.init(),await ot.current,$(vt),_e(vt.provider);try{if(vt.connected){const Ct=await getAddressFromProvider(vt.provider);tt(Ct)}}catch{}nt(!0)})()},[]);const st=reactExports.useCallback(async ct=>{if(!_)throw new Error("Web3Auth not ready");const ft=(ct==null?void 0:ct.loginProvider)??"github";try{await ot.current}catch{}const dt=it.current;if(!dt)throw new Error("Web3Auth auth adapter missing");const pt=await _.connectTo(dt,{loginProvider:ft});_e(pt);const yt=await getAddressFromProvider(pt);tt(yt)},[_]),at=reactExports.useCallback(async()=>{_&&(await _.logout(),_e(null),tt(null))},[_]),lt=reactExports.useMemo(()=>({web3auth:_,provider:j,eoaAddress:et,ready:rt,connect:st,disconnect:at}),[_,j,et,rt,st,at]);return jsxRuntimeExports.jsx(Ctx$1.Provider,{value:lt,children:o})};function useWeb3Auth(){const o=reactExports.useContext(Ctx$1);if(!o)throw new Error("useWeb3Auth must be used within Web3AuthProvider");return o}async function getAddressFromProvider(o){if(!o)return null;try{const _=await o.request({method:"eth_accounts"});if(_!=null&&_.length)return _[0];const $=await o.request({method:"eth_requestAccounts"});return($==null?void 0:$[0])??null}catch{return null}}var util;(function(o){o.assertEqual=_e=>{};function _(_e){}o.assertIs=_;function $(_e){throw new Error}o.assertNever=$,o.arrayToEnum=_e=>{const et={};for(const tt of _e)et[tt]=tt;return et},o.getValidEnumValues=_e=>{const et=o.objectKeys(_e).filter(rt=>typeof _e[_e[rt]]!="number"),tt={};for(const rt of et)tt[rt]=_e[rt];return o.objectValues(tt)},o.objectValues=_e=>o.objectKeys(_e).map(function(et){return _e[et]}),o.objectKeys=typeof Object.keys=="function"?_e=>Object.keys(_e):_e=>{const et=[];for(const tt in _e)Object.prototype.hasOwnProperty.call(_e,tt)&&et.push(tt);return et},o.find=(_e,et)=>{for(const tt of _e)if(et(tt))return tt},o.isInteger=typeof Number.isInteger=="function"?_e=>Number.isInteger(_e):_e=>typeof _e=="number"&&Number.isFinite(_e)&&Math.floor(_e)===_e;function j(_e,et=" | "){return _e.map(tt=>typeof tt=="string"?`'${tt}'`:tt).join(et)}o.joinValues=j,o.jsonStringifyReplacer=(_e,et)=>typeof et=="bigint"?et.toString():et})(util||(util={}));var objectUtil;(function(o){o.mergeShapes=(_,$)=>({..._,...$})})(objectUtil||(objectUtil={}));const ZodParsedType=util.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),getParsedType=o=>{switch(typeof o){case"undefined":return ZodParsedType.undefined;case"string":return ZodParsedType.string;case"number":return Number.isNaN(o)?ZodParsedType.nan:ZodParsedType.number;case"boolean":return ZodParsedType.boolean;case"function":return ZodParsedType.function;case"bigint":return ZodParsedType.bigint;case"symbol":return ZodParsedType.symbol;case"object":return Array.isArray(o)?ZodParsedType.array:o===null?ZodParsedType.null:o.then&&typeof o.then=="function"&&o.catch&&typeof o.catch=="function"?ZodParsedType.promise:typeof Map<"u"&&o instanceof Map?ZodParsedType.map:typeof Set<"u"&&o instanceof Set?ZodParsedType.set:typeof Date<"u"&&o instanceof Date?ZodParsedType.date:ZodParsedType.object;default:return ZodParsedType.unknown}},ZodIssueCode=util.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(_){super(),this.issues=[],this.addIssue=j=>{this.issues=[...this.issues,j]},this.addIssues=(j=[])=>{this.issues=[...this.issues,...j]};const $=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,$):this.__proto__=$,this.name="ZodError",this.issues=_}format(_){const $=_||function(et){return et.message},j={_errors:[]},_e=et=>{for(const tt of et.issues)if(tt.code==="invalid_union")tt.unionErrors.map(_e);else if(tt.code==="invalid_return_type")_e(tt.returnTypeError);else if(tt.code==="invalid_arguments")_e(tt.argumentsError);else if(tt.path.length===0)j._errors.push($(tt));else{let rt=j,nt=0;for(;nt$.message){const $={},j=[];for(const _e of this.issues)if(_e.path.length>0){const et=_e.path[0];$[et]=$[et]||[],$[et].push(_(_e))}else j.push(_(_e));return{formErrors:j,fieldErrors:$}}get formErrors(){return this.flatten()}}ZodError.create=o=>new ZodError(o);const errorMap=(o,_)=>{let $;switch(o.code){case ZodIssueCode.invalid_type:o.received===ZodParsedType.undefined?$="Required":$=`Expected ${o.expected}, received ${o.received}`;break;case ZodIssueCode.invalid_literal:$=`Invalid literal value, expected ${JSON.stringify(o.expected,util.jsonStringifyReplacer)}`;break;case ZodIssueCode.unrecognized_keys:$=`Unrecognized key(s) in object: ${util.joinValues(o.keys,", ")}`;break;case ZodIssueCode.invalid_union:$="Invalid input";break;case ZodIssueCode.invalid_union_discriminator:$=`Invalid discriminator value. Expected ${util.joinValues(o.options)}`;break;case ZodIssueCode.invalid_enum_value:$=`Invalid enum value. Expected ${util.joinValues(o.options)}, received '${o.received}'`;break;case ZodIssueCode.invalid_arguments:$="Invalid function arguments";break;case ZodIssueCode.invalid_return_type:$="Invalid function return type";break;case ZodIssueCode.invalid_date:$="Invalid date";break;case ZodIssueCode.invalid_string:typeof o.validation=="object"?"includes"in o.validation?($=`Invalid input: must include "${o.validation.includes}"`,typeof o.validation.position=="number"&&($=`${$} at one or more positions greater than or equal to ${o.validation.position}`)):"startsWith"in o.validation?$=`Invalid input: must start with "${o.validation.startsWith}"`:"endsWith"in o.validation?$=`Invalid input: must end with "${o.validation.endsWith}"`:util.assertNever(o.validation):o.validation!=="regex"?$=`Invalid ${o.validation}`:$="Invalid";break;case ZodIssueCode.too_small:o.type==="array"?$=`Array must contain ${o.exact?"exactly":o.inclusive?"at least":"more than"} ${o.minimum} element(s)`:o.type==="string"?$=`String must contain ${o.exact?"exactly":o.inclusive?"at least":"over"} ${o.minimum} character(s)`:o.type==="number"?$=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="bigint"?$=`Number must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${o.minimum}`:o.type==="date"?$=`Date must be ${o.exact?"exactly equal to ":o.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(o.minimum))}`:$="Invalid input";break;case ZodIssueCode.too_big:o.type==="array"?$=`Array must contain ${o.exact?"exactly":o.inclusive?"at most":"less than"} ${o.maximum} element(s)`:o.type==="string"?$=`String must contain ${o.exact?"exactly":o.inclusive?"at most":"under"} ${o.maximum} character(s)`:o.type==="number"?$=`Number must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="bigint"?$=`BigInt must be ${o.exact?"exactly":o.inclusive?"less than or equal to":"less than"} ${o.maximum}`:o.type==="date"?$=`Date must be ${o.exact?"exactly":o.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(o.maximum))}`:$="Invalid input";break;case ZodIssueCode.custom:$="Invalid input";break;case ZodIssueCode.invalid_intersection_types:$="Intersection results could not be merged";break;case ZodIssueCode.not_multiple_of:$=`Number must be a multiple of ${o.multipleOf}`;break;case ZodIssueCode.not_finite:$="Number must be finite";break;default:$=_.defaultError,util.assertNever(o)}return{message:$}};let overrideErrorMap=errorMap;function getErrorMap(){return overrideErrorMap}const makeIssue=o=>{const{data:_,path:$,errorMaps:j,issueData:_e}=o,et=[...$,..._e.path||[]],tt={..._e,path:et};if(_e.message!==void 0)return{..._e,path:et,message:_e.message};let rt="";const nt=j.filter(ot=>!!ot).slice().reverse();for(const ot of nt)rt=ot(tt,{data:_,defaultError:rt}).message;return{..._e,path:et,message:rt}};function addIssueToContext(o,_){const $=getErrorMap(),j=makeIssue({issueData:_,data:o.data,path:o.path,errorMaps:[o.common.contextualErrorMap,o.schemaErrorMap,$,$===errorMap?void 0:errorMap].filter(_e=>!!_e)});o.common.issues.push(j)}class ParseStatus{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(_,$){const j=[];for(const _e of $){if(_e.status==="aborted")return INVALID;_e.status==="dirty"&&_.dirty(),j.push(_e.value)}return{status:_.value,value:j}}static async mergeObjectAsync(_,$){const j=[];for(const _e of $){const et=await _e.key,tt=await _e.value;j.push({key:et,value:tt})}return ParseStatus.mergeObjectSync(_,j)}static mergeObjectSync(_,$){const j={};for(const _e of $){const{key:et,value:tt}=_e;if(et.status==="aborted"||tt.status==="aborted")return INVALID;et.status==="dirty"&&_.dirty(),tt.status==="dirty"&&_.dirty(),et.value!=="__proto__"&&(typeof tt.value<"u"||_e.alwaysSet)&&(j[et.value]=tt.value)}return{status:_.value,value:j}}}const INVALID=Object.freeze({status:"aborted"}),DIRTY=o=>({status:"dirty",value:o}),OK=o=>({status:"valid",value:o}),isAborted=o=>o.status==="aborted",isDirty=o=>o.status==="dirty",isValid=o=>o.status==="valid",isAsync=o=>typeof Promise<"u"&&o instanceof Promise;var errorUtil;(function(o){o.errToObj=_=>typeof _=="string"?{message:_}:_||{},o.toString=_=>typeof _=="string"?_:_==null?void 0:_.message})(errorUtil||(errorUtil={}));class ParseInputLazyPath{constructor(_,$,j,_e){this._cachedPath=[],this.parent=_,this.data=$,this._path=j,this._key=_e}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const handleResult=(o,_)=>{if(isValid(_))return{success:!0,data:_.value};if(!o.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const $=new ZodError(o.common.issues);return this._error=$,this._error}}};function processCreateParams(o){if(!o)return{};const{errorMap:_,invalid_type_error:$,required_error:j,description:_e}=o;if(_&&($||j))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return _?{errorMap:_,description:_e}:{errorMap:(tt,rt)=>{const{message:nt}=o;return tt.code==="invalid_enum_value"?{message:nt??rt.defaultError}:typeof rt.data>"u"?{message:nt??j??rt.defaultError}:tt.code!=="invalid_type"?{message:rt.defaultError}:{message:nt??$??rt.defaultError}},description:_e}}class ZodType{get description(){return this._def.description}_getType(_){return getParsedType(_.data)}_getOrReturnCtx(_,$){return $||{common:_.parent.common,data:_.data,parsedType:getParsedType(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}_processInputParams(_){return{status:new ParseStatus,ctx:{common:_.parent.common,data:_.data,parsedType:getParsedType(_.data),schemaErrorMap:this._def.errorMap,path:_.path,parent:_.parent}}}_parseSync(_){const $=this._parse(_);if(isAsync($))throw new Error("Synchronous parse encountered promise.");return $}_parseAsync(_){const $=this._parse(_);return Promise.resolve($)}parse(_,$){const j=this.safeParse(_,$);if(j.success)return j.data;throw j.error}safeParse(_,$){const j={common:{issues:[],async:($==null?void 0:$.async)??!1,contextualErrorMap:$==null?void 0:$.errorMap},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:getParsedType(_)},_e=this._parseSync({data:_,path:j.path,parent:j});return handleResult(j,_e)}"~validate"(_){var j,_e;const $={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:getParsedType(_)};if(!this["~standard"].async)try{const et=this._parseSync({data:_,path:[],parent:$});return isValid(et)?{value:et.value}:{issues:$.common.issues}}catch(et){(_e=(j=et==null?void 0:et.message)==null?void 0:j.toLowerCase())!=null&&_e.includes("encountered")&&(this["~standard"].async=!0),$.common={issues:[],async:!0}}return this._parseAsync({data:_,path:[],parent:$}).then(et=>isValid(et)?{value:et.value}:{issues:$.common.issues})}async parseAsync(_,$){const j=await this.safeParseAsync(_,$);if(j.success)return j.data;throw j.error}async safeParseAsync(_,$){const j={common:{issues:[],contextualErrorMap:$==null?void 0:$.errorMap,async:!0},path:($==null?void 0:$.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:_,parsedType:getParsedType(_)},_e=this._parse({data:_,path:j.path,parent:j}),et=await(isAsync(_e)?_e:Promise.resolve(_e));return handleResult(j,et)}refine(_,$){const j=_e=>typeof $=="string"||typeof $>"u"?{message:$}:typeof $=="function"?$(_e):$;return this._refinement((_e,et)=>{const tt=_(_e),rt=()=>et.addIssue({code:ZodIssueCode.custom,...j(_e)});return typeof Promise<"u"&&tt instanceof Promise?tt.then(nt=>nt?!0:(rt(),!1)):tt?!0:(rt(),!1)})}refinement(_,$){return this._refinement((j,_e)=>_(j)?!0:(_e.addIssue(typeof $=="function"?$(j,_e):$),!1))}_refinement(_){return new ZodEffects({schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"refinement",refinement:_}})}superRefine(_){return this._refinement(_)}constructor(_){this.spa=this.safeParseAsync,this._def=_,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:$=>this["~validate"]($)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(_){return ZodUnion.create([this,_],this._def)}and(_){return ZodIntersection.create(this,_,this._def)}transform(_){return new ZodEffects({...processCreateParams(this._def),schema:this,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:{type:"transform",transform:_}})}default(_){const $=typeof _=="function"?_:()=>_;return new ZodDefault({...processCreateParams(this._def),innerType:this,defaultValue:$,typeName:ZodFirstPartyTypeKind.ZodDefault})}brand(){return new ZodBranded({typeName:ZodFirstPartyTypeKind.ZodBranded,type:this,...processCreateParams(this._def)})}catch(_){const $=typeof _=="function"?_:()=>_;return new ZodCatch({...processCreateParams(this._def),innerType:this,catchValue:$,typeName:ZodFirstPartyTypeKind.ZodCatch})}describe(_){const $=this.constructor;return new $({...this._def,description:_})}pipe(_){return ZodPipeline.create(this,_)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const cuidRegex=/^c[^\s-]{8,}$/i,cuid2Regex=/^[0-9a-z]+$/,ulidRegex=/^[0-9A-HJKMNP-TV-Z]{26}$/i,uuidRegex=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nanoidRegex=/^[a-z0-9_-]{21}$/i,jwtRegex=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,durationRegex=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,emailRegex=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,_emojiRegex="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let emojiRegex;const ipv4Regex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4CidrRegex=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Regex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,ipv6CidrRegex=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64Regex=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64urlRegex=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,dateRegexSource="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",dateRegex=new RegExp(`^${dateRegexSource}$`);function timeRegexSource(o){let _="[0-5]\\d";o.precision?_=`${_}\\.\\d{${o.precision}}`:o.precision==null&&(_=`${_}(\\.\\d+)?`);const $=o.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${_})${$}`}function timeRegex(o){return new RegExp(`^${timeRegexSource(o)}$`)}function datetimeRegex(o){let _=`${dateRegexSource}T${timeRegexSource(o)}`;const $=[];return $.push(o.local?"Z?":"Z"),o.offset&&$.push("([+-]\\d{2}:?\\d{2})"),_=`${_}(${$.join("|")})`,new RegExp(`^${_}$`)}function isValidIP(o,_){return!!((_==="v4"||!_)&&ipv4Regex.test(o)||(_==="v6"||!_)&&ipv6Regex.test(o))}function isValidJWT(o,_){if(!jwtRegex.test(o))return!1;try{const[$]=o.split(".");if(!$)return!1;const j=$.replace(/-/g,"+").replace(/_/g,"/").padEnd($.length+(4-$.length%4)%4,"="),_e=JSON.parse(atob(j));return!(typeof _e!="object"||_e===null||"typ"in _e&&(_e==null?void 0:_e.typ)!=="JWT"||!_e.alg||_&&_e.alg!==_)}catch{return!1}}function isValidCidr(o,_){return!!((_==="v4"||!_)&&ipv4CidrRegex.test(o)||(_==="v6"||!_)&&ipv6CidrRegex.test(o))}class ZodString extends ZodType{_parse(_){if(this._def.coerce&&(_.data=String(_.data)),this._getType(_)!==ZodParsedType.string){const et=this._getOrReturnCtx(_);return addIssueToContext(et,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.string,received:et.parsedType}),INVALID}const j=new ParseStatus;let _e;for(const et of this._def.checks)if(et.kind==="min")_.data.lengthet.value&&(_e=this._getOrReturnCtx(_,_e),addIssueToContext(_e,{code:ZodIssueCode.too_big,maximum:et.value,type:"string",inclusive:!0,exact:!1,message:et.message}),j.dirty());else if(et.kind==="length"){const tt=_.data.length>et.value,rt=_.data.length_.test(_e),{validation:$,code:ZodIssueCode.invalid_string,...errorUtil.errToObj(j)})}_addCheck(_){return new ZodString({...this._def,checks:[...this._def.checks,_]})}email(_){return this._addCheck({kind:"email",...errorUtil.errToObj(_)})}url(_){return this._addCheck({kind:"url",...errorUtil.errToObj(_)})}emoji(_){return this._addCheck({kind:"emoji",...errorUtil.errToObj(_)})}uuid(_){return this._addCheck({kind:"uuid",...errorUtil.errToObj(_)})}nanoid(_){return this._addCheck({kind:"nanoid",...errorUtil.errToObj(_)})}cuid(_){return this._addCheck({kind:"cuid",...errorUtil.errToObj(_)})}cuid2(_){return this._addCheck({kind:"cuid2",...errorUtil.errToObj(_)})}ulid(_){return this._addCheck({kind:"ulid",...errorUtil.errToObj(_)})}base64(_){return this._addCheck({kind:"base64",...errorUtil.errToObj(_)})}base64url(_){return this._addCheck({kind:"base64url",...errorUtil.errToObj(_)})}jwt(_){return this._addCheck({kind:"jwt",...errorUtil.errToObj(_)})}ip(_){return this._addCheck({kind:"ip",...errorUtil.errToObj(_)})}cidr(_){return this._addCheck({kind:"cidr",...errorUtil.errToObj(_)})}datetime(_){return typeof _=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:_}):this._addCheck({kind:"datetime",precision:typeof(_==null?void 0:_.precision)>"u"?null:_==null?void 0:_.precision,offset:(_==null?void 0:_.offset)??!1,local:(_==null?void 0:_.local)??!1,...errorUtil.errToObj(_==null?void 0:_.message)})}date(_){return this._addCheck({kind:"date",message:_})}time(_){return typeof _=="string"?this._addCheck({kind:"time",precision:null,message:_}):this._addCheck({kind:"time",precision:typeof(_==null?void 0:_.precision)>"u"?null:_==null?void 0:_.precision,...errorUtil.errToObj(_==null?void 0:_.message)})}duration(_){return this._addCheck({kind:"duration",...errorUtil.errToObj(_)})}regex(_,$){return this._addCheck({kind:"regex",regex:_,...errorUtil.errToObj($)})}includes(_,$){return this._addCheck({kind:"includes",value:_,position:$==null?void 0:$.position,...errorUtil.errToObj($==null?void 0:$.message)})}startsWith(_,$){return this._addCheck({kind:"startsWith",value:_,...errorUtil.errToObj($)})}endsWith(_,$){return this._addCheck({kind:"endsWith",value:_,...errorUtil.errToObj($)})}min(_,$){return this._addCheck({kind:"min",value:_,...errorUtil.errToObj($)})}max(_,$){return this._addCheck({kind:"max",value:_,...errorUtil.errToObj($)})}length(_,$){return this._addCheck({kind:"length",value:_,...errorUtil.errToObj($)})}nonempty(_){return this.min(1,errorUtil.errToObj(_))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(_=>_.kind==="datetime")}get isDate(){return!!this._def.checks.find(_=>_.kind==="date")}get isTime(){return!!this._def.checks.find(_=>_.kind==="time")}get isDuration(){return!!this._def.checks.find(_=>_.kind==="duration")}get isEmail(){return!!this._def.checks.find(_=>_.kind==="email")}get isURL(){return!!this._def.checks.find(_=>_.kind==="url")}get isEmoji(){return!!this._def.checks.find(_=>_.kind==="emoji")}get isUUID(){return!!this._def.checks.find(_=>_.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(_=>_.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(_=>_.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(_=>_.kind==="cuid2")}get isULID(){return!!this._def.checks.find(_=>_.kind==="ulid")}get isIP(){return!!this._def.checks.find(_=>_.kind==="ip")}get isCIDR(){return!!this._def.checks.find(_=>_.kind==="cidr")}get isBase64(){return!!this._def.checks.find(_=>_.kind==="base64")}get isBase64url(){return!!this._def.checks.find(_=>_.kind==="base64url")}get minLength(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxLength(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}}ZodString.create=o=>new ZodString({checks:[],typeName:ZodFirstPartyTypeKind.ZodString,coerce:(o==null?void 0:o.coerce)??!1,...processCreateParams(o)});function floatSafeRemainder(o,_){const $=(o.toString().split(".")[1]||"").length,j=(_.toString().split(".")[1]||"").length,_e=$>j?$:j,et=Number.parseInt(o.toFixed(_e).replace(".","")),tt=Number.parseInt(_.toFixed(_e).replace(".",""));return et%tt/10**_e}class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(_){if(this._def.coerce&&(_.data=Number(_.data)),this._getType(_)!==ZodParsedType.number){const et=this._getOrReturnCtx(_);return addIssueToContext(et,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.number,received:et.parsedType}),INVALID}let j;const _e=new ParseStatus;for(const et of this._def.checks)et.kind==="int"?util.isInteger(_.data)||(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:"integer",received:"float",message:et.message}),_e.dirty()):et.kind==="min"?(et.inclusive?_.dataet.value:_.data>=et.value)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:et.value,type:"number",inclusive:et.inclusive,exact:!1,message:et.message}),_e.dirty()):et.kind==="multipleOf"?floatSafeRemainder(_.data,et.value)!==0&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:et.value,message:et.message}),_e.dirty()):et.kind==="finite"?Number.isFinite(_.data)||(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_finite,message:et.message}),_e.dirty()):util.assertNever(et);return{status:_e.value,value:_.data}}gte(_,$){return this.setLimit("min",_,!0,errorUtil.toString($))}gt(_,$){return this.setLimit("min",_,!1,errorUtil.toString($))}lte(_,$){return this.setLimit("max",_,!0,errorUtil.toString($))}lt(_,$){return this.setLimit("max",_,!1,errorUtil.toString($))}setLimit(_,$,j,_e){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:j,message:errorUtil.toString(_e)}]})}_addCheck(_){return new ZodNumber({...this._def,checks:[...this._def.checks,_]})}int(_){return this._addCheck({kind:"int",message:errorUtil.toString(_)})}positive(_){return this._addCheck({kind:"min",value:0,inclusive:!1,message:errorUtil.toString(_)})}negative(_){return this._addCheck({kind:"max",value:0,inclusive:!1,message:errorUtil.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:0,inclusive:!0,message:errorUtil.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:0,inclusive:!0,message:errorUtil.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:errorUtil.toString($)})}finite(_){return this._addCheck({kind:"finite",message:errorUtil.toString(_)})}safe(_){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:errorUtil.toString(_)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:errorUtil.toString(_)})}get minValue(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxValue(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}get isInt(){return!!this._def.checks.find(_=>_.kind==="int"||_.kind==="multipleOf"&&util.isInteger(_.value))}get isFinite(){let _=null,$=null;for(const j of this._def.checks){if(j.kind==="finite"||j.kind==="int"||j.kind==="multipleOf")return!0;j.kind==="min"?($===null||j.value>$)&&($=j.value):j.kind==="max"&&(_===null||j.value<_)&&(_=j.value)}return Number.isFinite($)&&Number.isFinite(_)}}ZodNumber.create=o=>new ZodNumber({checks:[],typeName:ZodFirstPartyTypeKind.ZodNumber,coerce:(o==null?void 0:o.coerce)||!1,...processCreateParams(o)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(_){if(this._def.coerce)try{_.data=BigInt(_.data)}catch{return this._getInvalidInput(_)}if(this._getType(_)!==ZodParsedType.bigint)return this._getInvalidInput(_);let j;const _e=new ParseStatus;for(const et of this._def.checks)et.kind==="min"?(et.inclusive?_.dataet.value:_.data>=et.value)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.too_big,type:"bigint",maximum:et.value,inclusive:et.inclusive,message:et.message}),_e.dirty()):et.kind==="multipleOf"?_.data%et.value!==BigInt(0)&&(j=this._getOrReturnCtx(_,j),addIssueToContext(j,{code:ZodIssueCode.not_multiple_of,multipleOf:et.value,message:et.message}),_e.dirty()):util.assertNever(et);return{status:_e.value,value:_.data}}_getInvalidInput(_){const $=this._getOrReturnCtx(_);return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.bigint,received:$.parsedType}),INVALID}gte(_,$){return this.setLimit("min",_,!0,errorUtil.toString($))}gt(_,$){return this.setLimit("min",_,!1,errorUtil.toString($))}lte(_,$){return this.setLimit("max",_,!0,errorUtil.toString($))}lt(_,$){return this.setLimit("max",_,!1,errorUtil.toString($))}setLimit(_,$,j,_e){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:_,value:$,inclusive:j,message:errorUtil.toString(_e)}]})}_addCheck(_){return new ZodBigInt({...this._def,checks:[...this._def.checks,_]})}positive(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:errorUtil.toString(_)})}negative(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:errorUtil.toString(_)})}nonpositive(_){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:errorUtil.toString(_)})}nonnegative(_){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:errorUtil.toString(_)})}multipleOf(_,$){return this._addCheck({kind:"multipleOf",value:_,message:errorUtil.toString($)})}get minValue(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _}get maxValue(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _}}ZodBigInt.create=o=>new ZodBigInt({checks:[],typeName:ZodFirstPartyTypeKind.ZodBigInt,coerce:(o==null?void 0:o.coerce)??!1,...processCreateParams(o)});class ZodBoolean extends ZodType{_parse(_){if(this._def.coerce&&(_.data=!!_.data),this._getType(_)!==ZodParsedType.boolean){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.boolean,received:j.parsedType}),INVALID}return OK(_.data)}}ZodBoolean.create=o=>new ZodBoolean({typeName:ZodFirstPartyTypeKind.ZodBoolean,coerce:(o==null?void 0:o.coerce)||!1,...processCreateParams(o)});class ZodDate extends ZodType{_parse(_){if(this._def.coerce&&(_.data=new Date(_.data)),this._getType(_)!==ZodParsedType.date){const et=this._getOrReturnCtx(_);return addIssueToContext(et,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.date,received:et.parsedType}),INVALID}if(Number.isNaN(_.data.getTime())){const et=this._getOrReturnCtx(_);return addIssueToContext(et,{code:ZodIssueCode.invalid_date}),INVALID}const j=new ParseStatus;let _e;for(const et of this._def.checks)et.kind==="min"?_.data.getTime()et.value&&(_e=this._getOrReturnCtx(_,_e),addIssueToContext(_e,{code:ZodIssueCode.too_big,message:et.message,inclusive:!0,exact:!1,maximum:et.value,type:"date"}),j.dirty()):util.assertNever(et);return{status:j.value,value:new Date(_.data.getTime())}}_addCheck(_){return new ZodDate({...this._def,checks:[...this._def.checks,_]})}min(_,$){return this._addCheck({kind:"min",value:_.getTime(),message:errorUtil.toString($)})}max(_,$){return this._addCheck({kind:"max",value:_.getTime(),message:errorUtil.toString($)})}get minDate(){let _=null;for(const $ of this._def.checks)$.kind==="min"&&(_===null||$.value>_)&&(_=$.value);return _!=null?new Date(_):null}get maxDate(){let _=null;for(const $ of this._def.checks)$.kind==="max"&&(_===null||$.value<_)&&(_=$.value);return _!=null?new Date(_):null}}ZodDate.create=o=>new ZodDate({checks:[],coerce:(o==null?void 0:o.coerce)||!1,typeName:ZodFirstPartyTypeKind.ZodDate,...processCreateParams(o)});class ZodSymbol extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.symbol){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.symbol,received:j.parsedType}),INVALID}return OK(_.data)}}ZodSymbol.create=o=>new ZodSymbol({typeName:ZodFirstPartyTypeKind.ZodSymbol,...processCreateParams(o)});class ZodUndefined extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.undefined,received:j.parsedType}),INVALID}return OK(_.data)}}ZodUndefined.create=o=>new ZodUndefined({typeName:ZodFirstPartyTypeKind.ZodUndefined,...processCreateParams(o)});class ZodNull extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.null){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.null,received:j.parsedType}),INVALID}return OK(_.data)}}ZodNull.create=o=>new ZodNull({typeName:ZodFirstPartyTypeKind.ZodNull,...processCreateParams(o)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(_){return OK(_.data)}}ZodAny.create=o=>new ZodAny({typeName:ZodFirstPartyTypeKind.ZodAny,...processCreateParams(o)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(_){return OK(_.data)}}ZodUnknown.create=o=>new ZodUnknown({typeName:ZodFirstPartyTypeKind.ZodUnknown,...processCreateParams(o)});class ZodNever extends ZodType{_parse(_){const $=this._getOrReturnCtx(_);return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.never,received:$.parsedType}),INVALID}}ZodNever.create=o=>new ZodNever({typeName:ZodFirstPartyTypeKind.ZodNever,...processCreateParams(o)});class ZodVoid extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.undefined){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.void,received:j.parsedType}),INVALID}return OK(_.data)}}ZodVoid.create=o=>new ZodVoid({typeName:ZodFirstPartyTypeKind.ZodVoid,...processCreateParams(o)});class ZodArray extends ZodType{_parse(_){const{ctx:$,status:j}=this._processInputParams(_),_e=this._def;if($.parsedType!==ZodParsedType.array)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:$.parsedType}),INVALID;if(_e.exactLength!==null){const tt=$.data.length>_e.exactLength.value,rt=$.data.length<_e.exactLength.value;(tt||rt)&&(addIssueToContext($,{code:tt?ZodIssueCode.too_big:ZodIssueCode.too_small,minimum:rt?_e.exactLength.value:void 0,maximum:tt?_e.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:_e.exactLength.message}),j.dirty())}if(_e.minLength!==null&&$.data.length<_e.minLength.value&&(addIssueToContext($,{code:ZodIssueCode.too_small,minimum:_e.minLength.value,type:"array",inclusive:!0,exact:!1,message:_e.minLength.message}),j.dirty()),_e.maxLength!==null&&$.data.length>_e.maxLength.value&&(addIssueToContext($,{code:ZodIssueCode.too_big,maximum:_e.maxLength.value,type:"array",inclusive:!0,exact:!1,message:_e.maxLength.message}),j.dirty()),$.common.async)return Promise.all([...$.data].map((tt,rt)=>_e.type._parseAsync(new ParseInputLazyPath($,tt,$.path,rt)))).then(tt=>ParseStatus.mergeArray(j,tt));const et=[...$.data].map((tt,rt)=>_e.type._parseSync(new ParseInputLazyPath($,tt,$.path,rt)));return ParseStatus.mergeArray(j,et)}get element(){return this._def.type}min(_,$){return new ZodArray({...this._def,minLength:{value:_,message:errorUtil.toString($)}})}max(_,$){return new ZodArray({...this._def,maxLength:{value:_,message:errorUtil.toString($)}})}length(_,$){return new ZodArray({...this._def,exactLength:{value:_,message:errorUtil.toString($)}})}nonempty(_){return this.min(1,_)}}ZodArray.create=(o,_)=>new ZodArray({type:o,minLength:null,maxLength:null,exactLength:null,typeName:ZodFirstPartyTypeKind.ZodArray,...processCreateParams(_)});function deepPartialify(o){if(o instanceof ZodObject){const _={};for(const $ in o.shape){const j=o.shape[$];_[$]=ZodOptional.create(deepPartialify(j))}return new ZodObject({...o._def,shape:()=>_})}else return o instanceof ZodArray?new ZodArray({...o._def,type:deepPartialify(o.element)}):o instanceof ZodOptional?ZodOptional.create(deepPartialify(o.unwrap())):o instanceof ZodNullable?ZodNullable.create(deepPartialify(o.unwrap())):o instanceof ZodTuple?ZodTuple.create(o.items.map(_=>deepPartialify(_))):o}class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const _=this._def.shape(),$=util.objectKeys(_);return this._cached={shape:_,keys:$},this._cached}_parse(_){if(this._getType(_)!==ZodParsedType.object){const ot=this._getOrReturnCtx(_);return addIssueToContext(ot,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.object,received:ot.parsedType}),INVALID}const{status:j,ctx:_e}=this._processInputParams(_),{shape:et,keys:tt}=this._getCached(),rt=[];if(!(this._def.catchall instanceof ZodNever&&this._def.unknownKeys==="strip"))for(const ot in _e.data)tt.includes(ot)||rt.push(ot);const nt=[];for(const ot of tt){const it=et[ot],st=_e.data[ot];nt.push({key:{status:"valid",value:ot},value:it._parse(new ParseInputLazyPath(_e,st,_e.path,ot)),alwaysSet:ot in _e.data})}if(this._def.catchall instanceof ZodNever){const ot=this._def.unknownKeys;if(ot==="passthrough")for(const it of rt)nt.push({key:{status:"valid",value:it},value:{status:"valid",value:_e.data[it]}});else if(ot==="strict")rt.length>0&&(addIssueToContext(_e,{code:ZodIssueCode.unrecognized_keys,keys:rt}),j.dirty());else if(ot!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const ot=this._def.catchall;for(const it of rt){const st=_e.data[it];nt.push({key:{status:"valid",value:it},value:ot._parse(new ParseInputLazyPath(_e,st,_e.path,it)),alwaysSet:it in _e.data})}}return _e.common.async?Promise.resolve().then(async()=>{const ot=[];for(const it of nt){const st=await it.key,at=await it.value;ot.push({key:st,value:at,alwaysSet:it.alwaysSet})}return ot}).then(ot=>ParseStatus.mergeObjectSync(j,ot)):ParseStatus.mergeObjectSync(j,nt)}get shape(){return this._def.shape()}strict(_){return errorUtil.errToObj,new ZodObject({...this._def,unknownKeys:"strict",..._!==void 0?{errorMap:($,j)=>{var et,tt;const _e=((tt=(et=this._def).errorMap)==null?void 0:tt.call(et,$,j).message)??j.defaultError;return $.code==="unrecognized_keys"?{message:errorUtil.errToObj(_).message??_e}:{message:_e}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(_){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),..._})})}merge(_){return new ZodObject({unknownKeys:_._def.unknownKeys,catchall:_._def.catchall,shape:()=>({...this._def.shape(),..._._def.shape()}),typeName:ZodFirstPartyTypeKind.ZodObject})}setKey(_,$){return this.augment({[_]:$})}catchall(_){return new ZodObject({...this._def,catchall:_})}pick(_){const $={};for(const j of util.objectKeys(_))_[j]&&this.shape[j]&&($[j]=this.shape[j]);return new ZodObject({...this._def,shape:()=>$})}omit(_){const $={};for(const j of util.objectKeys(this.shape))_[j]||($[j]=this.shape[j]);return new ZodObject({...this._def,shape:()=>$})}deepPartial(){return deepPartialify(this)}partial(_){const $={};for(const j of util.objectKeys(this.shape)){const _e=this.shape[j];_&&!_[j]?$[j]=_e:$[j]=_e.optional()}return new ZodObject({...this._def,shape:()=>$})}required(_){const $={};for(const j of util.objectKeys(this.shape))if(_&&!_[j])$[j]=this.shape[j];else{let et=this.shape[j];for(;et instanceof ZodOptional;)et=et._def.innerType;$[j]=et}return new ZodObject({...this._def,shape:()=>$})}keyof(){return createZodEnum(util.objectKeys(this.shape))}}ZodObject.create=(o,_)=>new ZodObject({shape:()=>o,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});ZodObject.strictCreate=(o,_)=>new ZodObject({shape:()=>o,unknownKeys:"strict",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});ZodObject.lazycreate=(o,_)=>new ZodObject({shape:o,unknownKeys:"strip",catchall:ZodNever.create(),typeName:ZodFirstPartyTypeKind.ZodObject,...processCreateParams(_)});class ZodUnion extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j=this._def.options;function _e(et){for(const rt of et)if(rt.result.status==="valid")return rt.result;for(const rt of et)if(rt.result.status==="dirty")return $.common.issues.push(...rt.ctx.common.issues),rt.result;const tt=et.map(rt=>new ZodError(rt.ctx.common.issues));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:tt}),INVALID}if($.common.async)return Promise.all(j.map(async et=>{const tt={...$,common:{...$.common,issues:[]},parent:null};return{result:await et._parseAsync({data:$.data,path:$.path,parent:tt}),ctx:tt}})).then(_e);{let et;const tt=[];for(const nt of j){const ot={...$,common:{...$.common,issues:[]},parent:null},it=nt._parseSync({data:$.data,path:$.path,parent:ot});if(it.status==="valid")return it;it.status==="dirty"&&!et&&(et={result:it,ctx:ot}),ot.common.issues.length&&tt.push(ot.common.issues)}if(et)return $.common.issues.push(...et.ctx.common.issues),et.result;const rt=tt.map(nt=>new ZodError(nt));return addIssueToContext($,{code:ZodIssueCode.invalid_union,unionErrors:rt}),INVALID}}get options(){return this._def.options}}ZodUnion.create=(o,_)=>new ZodUnion({options:o,typeName:ZodFirstPartyTypeKind.ZodUnion,...processCreateParams(_)});function mergeValues(o,_){const $=getParsedType(o),j=getParsedType(_);if(o===_)return{valid:!0,data:o};if($===ZodParsedType.object&&j===ZodParsedType.object){const _e=util.objectKeys(_),et=util.objectKeys(o).filter(rt=>_e.indexOf(rt)!==-1),tt={...o,..._};for(const rt of et){const nt=mergeValues(o[rt],_[rt]);if(!nt.valid)return{valid:!1};tt[rt]=nt.data}return{valid:!0,data:tt}}else if($===ZodParsedType.array&&j===ZodParsedType.array){if(o.length!==_.length)return{valid:!1};const _e=[];for(let et=0;et{if(isAborted(et)||isAborted(tt))return INVALID;const rt=mergeValues(et.value,tt.value);return rt.valid?((isDirty(et)||isDirty(tt))&&$.dirty(),{status:$.value,value:rt.data}):(addIssueToContext(j,{code:ZodIssueCode.invalid_intersection_types}),INVALID)};return j.common.async?Promise.all([this._def.left._parseAsync({data:j.data,path:j.path,parent:j}),this._def.right._parseAsync({data:j.data,path:j.path,parent:j})]).then(([et,tt])=>_e(et,tt)):_e(this._def.left._parseSync({data:j.data,path:j.path,parent:j}),this._def.right._parseSync({data:j.data,path:j.path,parent:j}))}}ZodIntersection.create=(o,_,$)=>new ZodIntersection({left:o,right:_,typeName:ZodFirstPartyTypeKind.ZodIntersection,...processCreateParams($)});class ZodTuple extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.array)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.array,received:j.parsedType}),INVALID;if(j.data.lengththis._def.items.length&&(addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),$.dirty());const et=[...j.data].map((tt,rt)=>{const nt=this._def.items[rt]||this._def.rest;return nt?nt._parse(new ParseInputLazyPath(j,tt,j.path,rt)):null}).filter(tt=>!!tt);return j.common.async?Promise.all(et).then(tt=>ParseStatus.mergeArray($,tt)):ParseStatus.mergeArray($,et)}get items(){return this._def.items}rest(_){return new ZodTuple({...this._def,rest:_})}}ZodTuple.create=(o,_)=>{if(!Array.isArray(o))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:o,typeName:ZodFirstPartyTypeKind.ZodTuple,rest:null,...processCreateParams(_)})};class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.map)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.map,received:j.parsedType}),INVALID;const _e=this._def.keyType,et=this._def.valueType,tt=[...j.data.entries()].map(([rt,nt],ot)=>({key:_e._parse(new ParseInputLazyPath(j,rt,j.path,[ot,"key"])),value:et._parse(new ParseInputLazyPath(j,nt,j.path,[ot,"value"]))}));if(j.common.async){const rt=new Map;return Promise.resolve().then(async()=>{for(const nt of tt){const ot=await nt.key,it=await nt.value;if(ot.status==="aborted"||it.status==="aborted")return INVALID;(ot.status==="dirty"||it.status==="dirty")&&$.dirty(),rt.set(ot.value,it.value)}return{status:$.value,value:rt}})}else{const rt=new Map;for(const nt of tt){const ot=nt.key,it=nt.value;if(ot.status==="aborted"||it.status==="aborted")return INVALID;(ot.status==="dirty"||it.status==="dirty")&&$.dirty(),rt.set(ot.value,it.value)}return{status:$.value,value:rt}}}}ZodMap.create=(o,_,$)=>new ZodMap({valueType:_,keyType:o,typeName:ZodFirstPartyTypeKind.ZodMap,...processCreateParams($)});class ZodSet extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.parsedType!==ZodParsedType.set)return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.set,received:j.parsedType}),INVALID;const _e=this._def;_e.minSize!==null&&j.data.size<_e.minSize.value&&(addIssueToContext(j,{code:ZodIssueCode.too_small,minimum:_e.minSize.value,type:"set",inclusive:!0,exact:!1,message:_e.minSize.message}),$.dirty()),_e.maxSize!==null&&j.data.size>_e.maxSize.value&&(addIssueToContext(j,{code:ZodIssueCode.too_big,maximum:_e.maxSize.value,type:"set",inclusive:!0,exact:!1,message:_e.maxSize.message}),$.dirty());const et=this._def.valueType;function tt(nt){const ot=new Set;for(const it of nt){if(it.status==="aborted")return INVALID;it.status==="dirty"&&$.dirty(),ot.add(it.value)}return{status:$.value,value:ot}}const rt=[...j.data.values()].map((nt,ot)=>et._parse(new ParseInputLazyPath(j,nt,j.path,ot)));return j.common.async?Promise.all(rt).then(nt=>tt(nt)):tt(rt)}min(_,$){return new ZodSet({...this._def,minSize:{value:_,message:errorUtil.toString($)}})}max(_,$){return new ZodSet({...this._def,maxSize:{value:_,message:errorUtil.toString($)}})}size(_,$){return this.min(_,$).max(_,$)}nonempty(_){return this.min(1,_)}}ZodSet.create=(o,_)=>new ZodSet({valueType:o,minSize:null,maxSize:null,typeName:ZodFirstPartyTypeKind.ZodSet,...processCreateParams(_)});class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(_){const{ctx:$}=this._processInputParams(_);return this._def.getter()._parse({data:$.data,path:$.path,parent:$})}}ZodLazy.create=(o,_)=>new ZodLazy({getter:o,typeName:ZodFirstPartyTypeKind.ZodLazy,...processCreateParams(_)});class ZodLiteral extends ZodType{_parse(_){if(_.data!==this._def.value){const $=this._getOrReturnCtx(_);return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_literal,expected:this._def.value}),INVALID}return{status:"valid",value:_.data}}get value(){return this._def.value}}ZodLiteral.create=(o,_)=>new ZodLiteral({value:o,typeName:ZodFirstPartyTypeKind.ZodLiteral,...processCreateParams(_)});function createZodEnum(o,_){return new ZodEnum({values:o,typeName:ZodFirstPartyTypeKind.ZodEnum,...processCreateParams(_)})}class ZodEnum extends ZodType{_parse(_){if(typeof _.data!="string"){const $=this._getOrReturnCtx(_),j=this._def.values;return addIssueToContext($,{expected:util.joinValues(j),received:$.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(_.data)){const $=this._getOrReturnCtx(_),j=this._def.values;return addIssueToContext($,{received:$.data,code:ZodIssueCode.invalid_enum_value,options:j}),INVALID}return OK(_.data)}get options(){return this._def.values}get enum(){const _={};for(const $ of this._def.values)_[$]=$;return _}get Values(){const _={};for(const $ of this._def.values)_[$]=$;return _}get Enum(){const _={};for(const $ of this._def.values)_[$]=$;return _}extract(_,$=this._def){return ZodEnum.create(_,{...this._def,...$})}exclude(_,$=this._def){return ZodEnum.create(this.options.filter(j=>!_.includes(j)),{...this._def,...$})}}ZodEnum.create=createZodEnum;class ZodNativeEnum extends ZodType{_parse(_){const $=util.getValidEnumValues(this._def.values),j=this._getOrReturnCtx(_);if(j.parsedType!==ZodParsedType.string&&j.parsedType!==ZodParsedType.number){const _e=util.objectValues($);return addIssueToContext(j,{expected:util.joinValues(_e),received:j.parsedType,code:ZodIssueCode.invalid_type}),INVALID}if(this._cache||(this._cache=new Set(util.getValidEnumValues(this._def.values))),!this._cache.has(_.data)){const _e=util.objectValues($);return addIssueToContext(j,{received:j.data,code:ZodIssueCode.invalid_enum_value,options:_e}),INVALID}return OK(_.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(o,_)=>new ZodNativeEnum({values:o,typeName:ZodFirstPartyTypeKind.ZodNativeEnum,...processCreateParams(_)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(_){const{ctx:$}=this._processInputParams(_);if($.parsedType!==ZodParsedType.promise&&$.common.async===!1)return addIssueToContext($,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.promise,received:$.parsedType}),INVALID;const j=$.parsedType===ZodParsedType.promise?$.data:Promise.resolve($.data);return OK(j.then(_e=>this._def.type.parseAsync(_e,{path:$.path,errorMap:$.common.contextualErrorMap})))}}ZodPromise.create=(o,_)=>new ZodPromise({type:o,typeName:ZodFirstPartyTypeKind.ZodPromise,...processCreateParams(_)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ZodFirstPartyTypeKind.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(_){const{status:$,ctx:j}=this._processInputParams(_),_e=this._def.effect||null,et={addIssue:tt=>{addIssueToContext(j,tt),tt.fatal?$.abort():$.dirty()},get path(){return j.path}};if(et.addIssue=et.addIssue.bind(et),_e.type==="preprocess"){const tt=_e.transform(j.data,et);if(j.common.async)return Promise.resolve(tt).then(async rt=>{if($.value==="aborted")return INVALID;const nt=await this._def.schema._parseAsync({data:rt,path:j.path,parent:j});return nt.status==="aborted"?INVALID:nt.status==="dirty"||$.value==="dirty"?DIRTY(nt.value):nt});{if($.value==="aborted")return INVALID;const rt=this._def.schema._parseSync({data:tt,path:j.path,parent:j});return rt.status==="aborted"?INVALID:rt.status==="dirty"||$.value==="dirty"?DIRTY(rt.value):rt}}if(_e.type==="refinement"){const tt=rt=>{const nt=_e.refinement(rt,et);if(j.common.async)return Promise.resolve(nt);if(nt instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return rt};if(j.common.async===!1){const rt=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});return rt.status==="aborted"?INVALID:(rt.status==="dirty"&&$.dirty(),tt(rt.value),{status:$.value,value:rt.value})}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then(rt=>rt.status==="aborted"?INVALID:(rt.status==="dirty"&&$.dirty(),tt(rt.value).then(()=>({status:$.value,value:rt.value}))))}if(_e.type==="transform")if(j.common.async===!1){const tt=this._def.schema._parseSync({data:j.data,path:j.path,parent:j});if(!isValid(tt))return INVALID;const rt=_e.transform(tt.value,et);if(rt instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:$.value,value:rt}}else return this._def.schema._parseAsync({data:j.data,path:j.path,parent:j}).then(tt=>isValid(tt)?Promise.resolve(_e.transform(tt.value,et)).then(rt=>({status:$.value,value:rt})):INVALID);util.assertNever(_e)}}ZodEffects.create=(o,_,$)=>new ZodEffects({schema:o,typeName:ZodFirstPartyTypeKind.ZodEffects,effect:_,...processCreateParams($)});ZodEffects.createWithPreprocess=(o,_,$)=>new ZodEffects({schema:_,effect:{type:"preprocess",transform:o},typeName:ZodFirstPartyTypeKind.ZodEffects,...processCreateParams($)});class ZodOptional extends ZodType{_parse(_){return this._getType(_)===ZodParsedType.undefined?OK(void 0):this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}ZodOptional.create=(o,_)=>new ZodOptional({innerType:o,typeName:ZodFirstPartyTypeKind.ZodOptional,...processCreateParams(_)});class ZodNullable extends ZodType{_parse(_){return this._getType(_)===ZodParsedType.null?OK(null):this._def.innerType._parse(_)}unwrap(){return this._def.innerType}}ZodNullable.create=(o,_)=>new ZodNullable({innerType:o,typeName:ZodFirstPartyTypeKind.ZodNullable,...processCreateParams(_)});class ZodDefault extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_);let j=$.data;return $.parsedType===ZodParsedType.undefined&&(j=this._def.defaultValue()),this._def.innerType._parse({data:j,path:$.path,parent:$})}removeDefault(){return this._def.innerType}}ZodDefault.create=(o,_)=>new ZodDefault({innerType:o,typeName:ZodFirstPartyTypeKind.ZodDefault,defaultValue:typeof _.default=="function"?_.default:()=>_.default,...processCreateParams(_)});class ZodCatch extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j={...$,common:{...$.common,issues:[]}},_e=this._def.innerType._parse({data:j.data,path:j.path,parent:{...j}});return isAsync(_e)?_e.then(et=>({status:"valid",value:et.status==="valid"?et.value:this._def.catchValue({get error(){return new ZodError(j.common.issues)},input:j.data})})):{status:"valid",value:_e.status==="valid"?_e.value:this._def.catchValue({get error(){return new ZodError(j.common.issues)},input:j.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(o,_)=>new ZodCatch({innerType:o,typeName:ZodFirstPartyTypeKind.ZodCatch,catchValue:typeof _.catch=="function"?_.catch:()=>_.catch,...processCreateParams(_)});class ZodNaN extends ZodType{_parse(_){if(this._getType(_)!==ZodParsedType.nan){const j=this._getOrReturnCtx(_);return addIssueToContext(j,{code:ZodIssueCode.invalid_type,expected:ZodParsedType.nan,received:j.parsedType}),INVALID}return{status:"valid",value:_.data}}}ZodNaN.create=o=>new ZodNaN({typeName:ZodFirstPartyTypeKind.ZodNaN,...processCreateParams(o)});class ZodBranded extends ZodType{_parse(_){const{ctx:$}=this._processInputParams(_),j=$.data;return this._def.type._parse({data:j,path:$.path,parent:$})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(_){const{status:$,ctx:j}=this._processInputParams(_);if(j.common.async)return(async()=>{const et=await this._def.in._parseAsync({data:j.data,path:j.path,parent:j});return et.status==="aborted"?INVALID:et.status==="dirty"?($.dirty(),DIRTY(et.value)):this._def.out._parseAsync({data:et.value,path:j.path,parent:j})})();{const _e=this._def.in._parseSync({data:j.data,path:j.path,parent:j});return _e.status==="aborted"?INVALID:_e.status==="dirty"?($.dirty(),{status:"dirty",value:_e.value}):this._def.out._parseSync({data:_e.value,path:j.path,parent:j})}}static create(_,$){return new ZodPipeline({in:_,out:$,typeName:ZodFirstPartyTypeKind.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(_){const $=this._def.innerType._parse(_),j=_e=>(isValid(_e)&&(_e.value=Object.freeze(_e.value)),_e);return isAsync($)?$.then(_e=>j(_e)):j($)}unwrap(){return this._def.innerType}}ZodReadonly.create=(o,_)=>new ZodReadonly({innerType:o,typeName:ZodFirstPartyTypeKind.ZodReadonly,...processCreateParams(_)});var ZodFirstPartyTypeKind;(function(o){o.ZodString="ZodString",o.ZodNumber="ZodNumber",o.ZodNaN="ZodNaN",o.ZodBigInt="ZodBigInt",o.ZodBoolean="ZodBoolean",o.ZodDate="ZodDate",o.ZodSymbol="ZodSymbol",o.ZodUndefined="ZodUndefined",o.ZodNull="ZodNull",o.ZodAny="ZodAny",o.ZodUnknown="ZodUnknown",o.ZodNever="ZodNever",o.ZodVoid="ZodVoid",o.ZodArray="ZodArray",o.ZodObject="ZodObject",o.ZodUnion="ZodUnion",o.ZodDiscriminatedUnion="ZodDiscriminatedUnion",o.ZodIntersection="ZodIntersection",o.ZodTuple="ZodTuple",o.ZodRecord="ZodRecord",o.ZodMap="ZodMap",o.ZodSet="ZodSet",o.ZodFunction="ZodFunction",o.ZodLazy="ZodLazy",o.ZodLiteral="ZodLiteral",o.ZodEnum="ZodEnum",o.ZodEffects="ZodEffects",o.ZodNativeEnum="ZodNativeEnum",o.ZodOptional="ZodOptional",o.ZodNullable="ZodNullable",o.ZodDefault="ZodDefault",o.ZodCatch="ZodCatch",o.ZodPromise="ZodPromise",o.ZodBranded="ZodBranded",o.ZodPipeline="ZodPipeline",o.ZodReadonly="ZodReadonly"})(ZodFirstPartyTypeKind||(ZodFirstPartyTypeKind={}));const stringType=ZodString.create,numberType=ZodNumber.create,booleanType=ZodBoolean.create;ZodNever.create;ZodArray.create;const objectType=ZodObject.create;ZodUnion.create;ZodIntersection.create;ZodTuple.create;ZodEnum.create;ZodPromise.create;ZodOptional.create;ZodNullable.create;const __vite_import_meta_env__$1={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_CHAIN_ID:"84532",VITE_EAS_ADDRESS:"0x4200000000000000000000000000000000000021",VITE_EAS_SCHEMA_UID:"0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af",VITE_GITHUB_CLIENT_ID:"Ov23liHcCbZ43H9BKIAi",VITE_GITHUB_REDIRECT_URI:"https://didgit.dev",VITE_GITHUB_TOKEN_PROXY:"https://didgit0.ops7622.workers.dev/",VITE_RESOLVER_ADDRESS:"0x4092543CBba00A105d4974616bEF71CB4b2AF9a5",VITE_WEB3AUTH_CLIENT_ID:"BIKasG1HwkyFsv8reWq_djHe7xWyW-NCnCGN4997DHH7lyoCabx4qedqGucyJ25NfOQxfPCvXWgb8P9ZsKmUA8k",VITE_WEB3AUTH_NETWORK:"mainnet",VITE_ZERODEV_BUNDLER_RPC:"https://rpc.zerodev.app/api/v3/aa40f236-4eff-41e1-8737-ab95ab7e1850/chain/84532",VITE_ZERODEV_PROJECT_ID:"aa40f236-4eff-41e1-8737-ab95ab7e1850"},envSchema=objectType({VITE_CHAIN_ID:stringType().optional(),VITE_EAS_SCHEMA_UID:stringType().startsWith("0x").length(66).optional(),VITE_EAS_ADDRESS:stringType().optional(),VITE_EAS_BASE_SEPOLIA_SCHEMA_UID:stringType().startsWith("0x").length(66).optional(),VITE_EAS_BASE_SEPOLIA_ADDRESS:stringType().optional(),VITE_ZERODEV_PROJECT_ID:stringType().optional(),VITE_ZERODEV_BUNDLER_RPC:stringType().url().optional(),VITE_RESOLVER_ADDRESS:stringType().optional(),VITE_STANDALONE_ATTESTOR_ADDRESS:stringType().optional()});function appConfig(){const o=envSchema.safeParse(__vite_import_meta_env__$1);if(!o.success)return{CHAIN_ID:parseInt("84532"),EAS_SCHEMA_UID:"0x7e4a502d6e04b8ff7a80ac8b852c8b53199fe297ddf092a63fffb2a5a062b1b7",EAS_ADDRESS:"0x4200000000000000000000000000000000000021",ZERODEV_PROJECT_ID:"aa40f236-4eff-41e1-8737-ab95ab7e1850"};const _=parseInt(o.data.VITE_CHAIN_ID??"8453"),$=o.data.VITE_EAS_SCHEMA_UID??o.data.VITE_EAS_BASE_SEPOLIA_SCHEMA_UID??"0x7e4a502d6e04b8ff7a80ac8b852c8b53199fe297ddf092a63fffb2a5a062b1b7";let j=o.data.VITE_EAS_ADDRESS??o.data.VITE_EAS_BASE_SEPOLIA_ADDRESS;return j&&(j.trim().toLowerCase()==="undefined"||j.trim()==="")&&(j=void 0),{CHAIN_ID:_,EAS_SCHEMA_UID:$,EAS_ADDRESS:j,ZERODEV_PROJECT_ID:o.data.VITE_ZERODEV_PROJECT_ID,ZERODEV_BUNDLER_RPC:o.data.VITE_ZERODEV_BUNDLER_RPC,RESOLVER_ADDRESS:o.data.VITE_RESOLVER_ADDRESS,STANDALONE_ATTESTOR_ADDRESS:o.data.VITE_STANDALONE_ATTESTOR_ADDRESS}}async function createZeroDevClient(o,_){const{createKernelAccount:$,createKernelAccountClient:j}=await __vitePreload(async()=>{const{createKernelAccount:dt,createKernelAccountClient:pt}=await import("./index-3O4qPenO.js");return{createKernelAccount:dt,createKernelAccountClient:pt}},__vite__mapDeps([0,1,2])),{getEntryPoint:_e,KERNEL_V3_1:et}=await __vitePreload(async()=>{const{getEntryPoint:dt,KERNEL_V3_1:pt}=await import("./constants-VN1kIEzb.js").then(yt=>yt.c);return{getEntryPoint:dt,KERNEL_V3_1:pt}},[]),{signerToEcdsaValidator:tt}=await __vitePreload(async()=>{const{signerToEcdsaValidator:dt}=await import("./index-0jpWsoRj.js");return{signerToEcdsaValidator:dt}},__vite__mapDeps([3,1,2])),rt=appConfig();if(!rt.ZERODEV_BUNDLER_RPC)throw new Error("Missing VITE_ZERODEV_BUNDLER_RPC");const nt=createPublicClient({chain:baseSepolia,transport:http(baseSepolia.rpcUrls.default.http[0])}),ot=createWalletClient({chain:baseSepolia,transport:custom(o)}),it=_e("0.7"),st=et,at=await tt(nt,{signer:ot,entryPoint:it,kernelVersion:st}),lt=await $(nt,{entryPoint:it,kernelVersion:st,plugins:{sudo:at}}),ct=http(rt.ZERODEV_BUNDLER_RPC),ft=j({account:lt,client:nt,bundlerTransport:ct,userOperation:{estimateFeesPerGas:async()=>{const dt=await nt.estimateFeesPerGas();return{maxFeePerGas:dt.maxFeePerGas??dt.gasPrice??0n,maxPriorityFeePerGas:dt.maxPriorityFeePerGas??0n}}}});return{getAddress:async()=>lt.address,sendUserOp:async({to:dt,data:pt,value:yt})=>await ft.sendUserOperation({calls:[{to:dt,data:pt,value:yt??0n}]}),waitForUserOp:async dt=>ft.waitForUserOperationReceipt({hash:dt}),debugTryEp:async dt=>{try{const{createKernelAccount:pt}=await __vitePreload(async()=>{const{createKernelAccount:Ot}=await import("./index-3O4qPenO.js");return{createKernelAccount:Ot}},__vite__mapDeps([0,1,2])),{getEntryPoint:yt,KERNEL_V3_1:vt}=await __vitePreload(async()=>{const{getEntryPoint:Ot,KERNEL_V3_1:Tt}=await import("./constants-VN1kIEzb.js").then(ht=>ht.c);return{getEntryPoint:Ot,KERNEL_V3_1:Tt}},[]),{signerToEcdsaValidator:wt}=await __vitePreload(async()=>{const{signerToEcdsaValidator:Ot}=await import("./index-0jpWsoRj.js");return{signerToEcdsaValidator:Ot}},__vite__mapDeps([3,1,2])),Ct=yt(dt),Pt=dt==="0.6"?"0.2.4":vt,Bt=await wt(nt,{signer:ot,entryPoint:Ct,kernelVersion:Pt}),kt=await(await pt(nt,{entryPoint:Ct,kernelVersion:Pt,plugins:{sudo:Bt}})).getAddress();return{ok:!0,message:`EP ${dt} constructed (address ${kt})`}}catch(pt){return{ok:!1,message:pt.message??"unknown error"}}}}}function useWallet$1(){const{provider:o,eoaAddress:_,connect:$,disconnect:j}=useWeb3Auth(),_e=reactExports.useMemo(()=>appConfig(),[]),et=reactExports.useMemo(()=>getChainConfig$1(_e.CHAIN_ID),[_e.CHAIN_ID]),[tt,rt]=reactExports.useState(null),[nt,ot]=reactExports.useState(null),[it,st]=reactExports.useState(!1),[at,lt]=reactExports.useState(null),[ct,ft]=reactExports.useState(null),[dt,pt]=reactExports.useState(!1),[yt,vt]=reactExports.useState(!1),[wt,Ct]=reactExports.useState(null),[Pt,Bt]=reactExports.useState(null),At=!!tt,kt=!!ct&&!!nt,Ot=reactExports.useCallback(async()=>{var Rt;Ct(null);try{const It=typeof window<"u"&&window.ethereum?window.ethereum:null;if(It)try{await((Rt=It.request)==null?void 0:Rt.call(It,{method:"eth_requestAccounts"}))}catch{}else await $({loginProvider:"github"})}catch{}try{pt(!0);const It=appConfig();if(!It.ZERODEV_BUNDLER_RPC)throw new Error("VITE_ZERODEV_BUNDLER_RPC is not set");const Mt=await ht();try{const qt=createWalletClient({chain:et,transport:custom(Mt)}),[Xt]=await qt.getAddresses();Xt&&rt(Xt)}catch{}const Vt=await createZeroDevClient(Mt,It.ZERODEV_PROJECT_ID??"");ft(Vt);const Gt=await Vt.getAddress();ot(Gt);const zt=createPublicClient({chain:et,transport:http(et.rpcUrls.default.http[0])}),[jt,Ft]=await Promise.all([zt.getCode({address:Gt}),zt.getBalance({address:Gt})]);st(!!jt&&jt!=="0x"),lt(Ft)}catch(It){Ct(It.message??"Failed to create smart wallet")}finally{pt(!1)}},[$,o]),Tt=reactExports.useCallback(async()=>{try{await j()}catch{}rt(null),ot(null),ft(null),st(!1),lt(null)},[j]),ht=reactExports.useCallback(async()=>{const Rt=typeof window<"u"&&window.ethereum?window.ethereum:null;if(Rt)return Rt;if(!o)throw new Error("Web3Auth provider unavailable");return o},[o]),bt=reactExports.useCallback(async()=>{const Rt=await ht();return createWalletClient({chain:et,transport:custom(Rt)})},[ht,et]),mt=reactExports.useCallback(async()=>{const Rt=nt;if(!Rt){st(!1),lt(null);return}const It=createPublicClient({chain:et,transport:http(et.rpcUrls.default.http[0])}),[Mt,Vt]=await Promise.all([It.getCode({address:Rt}),It.getBalance({address:Rt})]);st(!!Mt&&Mt!=="0x"),lt(Vt)},[nt,et]),gt=reactExports.useCallback(async()=>{if(ct)return ct;try{const Rt=appConfig();if(!Rt.ZERODEV_BUNDLER_RPC)return null;const It=await ht(),Mt=await createZeroDevClient(It,Rt.ZERODEV_PROJECT_ID??"");if(ft(Mt),!nt){const Vt=await Mt.getAddress();ot(Vt)}return Mt}catch(Rt){return Ct(Rt.message??"Failed to initialize AA client"),null}},[ct,ht,nt]),xt=reactExports.useCallback(async()=>!!await gt(),[gt]),Et=reactExports.useCallback(async()=>{await $()},[$]),_t=reactExports.useCallback(async()=>{Ct(null);try{vt(!0);const Rt=appConfig();if(!Rt.ZERODEV_BUNDLER_RPC)throw new Error("VITE_ZERODEV_BUNDLER_RPC is not set");let It=ct;if(!It){const jt=await ht();try{const Ft=createWalletClient({chain:et,transport:custom(jt)}),[qt]=await Ft.getAddresses();qt&&rt(qt)}catch{}It=await createZeroDevClient(jt,Rt.ZERODEV_PROJECT_ID??""),ft(It)}const Mt=await It.getAddress();ot(Mt);const Vt=createPublicClient({chain:et,transport:http(et.rpcUrls.default.http[0])}),[Gt,zt]=await Promise.all([Vt.getCode({address:Mt}),Vt.getBalance({address:Mt})]);st(!!Gt&&Gt!=="0x"),lt(zt)}catch(Rt){Ct(Rt.message??"Failed to open smart wallet")}finally{vt(!1)}},[ct,o]),$t=reactExports.useCallback(async Rt=>{Bt("Testing…");try{const It=appConfig();if(!It.ZERODEV_BUNDLER_RPC){Bt("FAIL: VITE_ZERODEV_BUNDLER_RPC is not set");return}let Mt=ct;if(!Mt){const Gt=await ht();Mt=await createZeroDevClient(Gt,It.ZERODEV_PROJECT_ID??""),ft(Mt)}const Vt=await Mt.debugTryEp(Rt);Bt(`${Vt.ok?"OK":"FAIL"}: ${Vt.message}`)}catch(It){Bt(`FAIL: ${It.message??"unknown error"}`)}},[ct,ht]),St=reactExports.useCallback(async({message:Rt})=>{const It=await ht(),Mt=createWalletClient({chain:et,transport:custom(It)});let Vt;try{Vt=await Mt.getAddresses()}catch{throw new Error("Failed to get wallet addresses. Please make sure your wallet is connected.")}if(!Vt||Vt.length===0)throw new Error("No wallet account available for signing. Please connect your wallet.");const[Gt]=Vt;if(!Gt)throw new Error("No wallet account available for signing");return await Mt.signMessage({account:Gt,message:Rt})},[ht]);return reactExports.useEffect(()=>{(async()=>{try{const Rt=await ht(),It=createWalletClient({chain:et,transport:custom(Rt)}),[Mt]=await It.getAddresses();if(Mt){rt(Mt);return}}catch{}_&&rt(_)})()},[_,ht]),reactExports.useEffect(()=>{mt()},[nt,mt]),reactExports.useEffect(()=>{const Rt=It=>{It.length===0&&(rt(null),ot(null),ft(null),st(!1),lt(null))};if(typeof window<"u"&&window.ethereum)return window.ethereum.on("accountsChanged",Rt),()=>{window.ethereum.removeListener("accountsChanged",Rt)}},[]),{connected:At,address:tt,smartAddress:nt,connect:Ot,disconnect:Tt,signMessage:St,getWalletClient:bt,getSmartWalletClient:gt,refreshOnchain:mt,isContract:it,balanceWei:at,canAttest:kt,createSmartWallet:Et,provisioning:dt,busyOpen:yt,openWallet:_t,wallets:[],privyUser:null,lastError:wt,ensureAa:xt,diag:Pt,testEp:$t}}const WalletContext=reactExports.createContext(null),WalletProvider=({children:o})=>{const _=useWallet$1();return jsxRuntimeExports.jsx(WalletContext.Provider,{value:_,children:o})},useWallet=()=>{const o=reactExports.useContext(WalletContext);if(!o)throw new Error("useWallet must be used within a WalletProvider");return o},WalletButton=()=>{const o=useWallet(),{connected:_,address:$,smartAddress:j,connect:_e,disconnect:et,provisioning:tt}=o,[rt,nt]=reactExports.useState(null),ot=!!rt,it=ct=>{_?nt(ct.currentTarget):_e()},st=()=>{nt(null)},at=async ct=>{try{await navigator.clipboard.writeText(ct)}catch{const dt=document.createElement("textarea");dt.value=ct,document.body.appendChild(dt),dt.select(),document.execCommand("copy"),document.body.removeChild(dt)}st()},lt=ct=>!ct||ct.length<10?"Connect Wallet":`${ct.slice(0,6)}...${ct.slice(-4)}`;return _?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Button$1,{variant:"outlined",onClick:it,sx:{borderRadius:2,textTransform:"none",color:"white",borderColor:"rgba(255, 255, 255, 0.3)","&:hover":{borderColor:"white",bgcolor:"rgba(255, 255, 255, 0.1)"}},children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntimeExports.jsx(AccountBalanceWallet,{fontSize:"small"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",fontWeight:500,sx:{color:"white"},children:lt($||"")})]})}),jsxRuntimeExports.jsxs(Menu,{anchorEl:rt,open:ot,onClose:st,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},PaperProps:{sx:{mt:1,minWidth:200}},children:[$&&jsxRuntimeExports.jsx(MenuItem,{onClick:()=>at($),children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:1,width:"100%",children:[jsxRuntimeExports.jsx(ContentCopy,{fontSize:"small"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"EOA Wallet"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",fontFamily:"monospace",children:lt($)})]})]})}),j&&jsxRuntimeExports.jsx(MenuItem,{onClick:()=>at(j),children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:1,width:"100%",children:[jsxRuntimeExports.jsx(ContentCopy,{fontSize:"small"}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Smart Wallet"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",fontFamily:"monospace",children:lt(j)})]})]})}),jsxRuntimeExports.jsx(MenuItem,{onClick:()=>{et(),st()},children:jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:1,children:[jsxRuntimeExports.jsx(ExitToApp,{fontSize:"small"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Disconnect"})]})})]})]}):jsxRuntimeExports.jsx(Button$1,{variant:"contained",startIcon:jsxRuntimeExports.jsx(AccountBalanceWallet,{}),onClick:it,disabled:tt,sx:{borderRadius:2,textTransform:"none",fontWeight:600},children:tt?"Connecting...":"Connect Wallet"})},Navigation=({currentPage:o,onPageChange:_})=>{const $=(j,_e)=>{_(_e)};return jsxRuntimeExports.jsx(AppBar,{position:"static",elevation:1,children:jsxRuntimeExports.jsxs(Toolbar,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",component:"h1",sx:{mr:4},children:"didgit.dev"}),jsxRuntimeExports.jsx(Box,{sx:{flexGrow:1},children:jsxRuntimeExports.jsxs(Tabs,{value:o,onChange:$,sx:{"& .MuiTab-root":{color:"rgba(255, 255, 255, 0.7)",textTransform:"none",fontWeight:500,minWidth:80,"&.Mui-selected":{color:"white !important"}},"& .MuiTabs-indicator":{backgroundColor:"white"}},children:[jsxRuntimeExports.jsx(Tab,{label:"Register",value:"register"}),jsxRuntimeExports.jsx(Tab,{label:"Settings",value:"settings"})]})}),jsxRuntimeExports.jsx(WalletButton,{})]})})},AAWalletStatus=()=>{const{smartAddress:o,connected:_,isContract:$,balanceWei:j,refreshOnchain:_e,ensureAa:et,lastError:tt,address:rt}=useWallet(),[nt,ot]=reactExports.useState(!1),[it,st]=reactExports.useState(!1),[at,lt]=reactExports.useState(0),ct=appConfig(),ft=j?parseFloat(formatEther(j)):0,dt=ft>0,pt=_&&o&&dt,yt=ct.CHAIN_ID===8453,vt=async()=>{st(!0);try{await et(),await _e()}catch{}finally{st(!1)}};reactExports.useEffect(()=>{lt(Bt=>Bt+1),_?vt():(ot(!1),st(!1))},[_]),reactExports.useEffect(()=>{_&&o&&vt()},[_,o]);const wt=async()=>{if(o)try{await navigator.clipboard.writeText(o)}catch{const At=document.createElement("textarea");At.value=o,document.body.appendChild(At),At.select(),document.execCommand("copy"),document.body.removeChild(At)}},Ct=async()=>{ot(!0);try{ct.CHAIN_ID===84532?window.open(`https://www.coinbase.com/faucets/base-sepolia-faucet?address=${o}`,"_blank"):window.open("https://bridge.base.org/","_blank"),setTimeout(async()=>{await _e(),ot(!1)},2e3)}catch{ot(!1)}},Pt=Bt=>`${Bt.slice(0,6)}...${Bt.slice(-4)}`;return _?jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,mb:2,children:[jsxRuntimeExports.jsx(AccountBalanceWallet,{color:"primary"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Smart Wallet Status"}),jsxRuntimeExports.jsx(Tooltip$1,{title:"Refresh status",children:jsxRuntimeExports.jsx(IconButton,{onClick:vt,size:"small",disabled:it,children:it?jsxRuntimeExports.jsx(CircularProgress,{size:20}):jsxRuntimeExports.jsx(Refresh,{})})})]}),o&&jsxRuntimeExports.jsx(Paper,{variant:"outlined",sx:{p:2,mb:2},children:jsxRuntimeExports.jsxs(Stack,{spacing:2,children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Address"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",fontFamily:"monospace",children:Pt(o)})]}),jsxRuntimeExports.jsx(Tooltip$1,{title:"Copy address",children:jsxRuntimeExports.jsx(IconButton,{onClick:wt,size:"small",children:jsxRuntimeExports.jsx(ContentCopy,{fontSize:"small"})})})]}),jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Balance"}),jsxRuntimeExports.jsxs(Typography,{variant:"body1",children:[ft.toFixed(8)," ETH"]})]}),jsxRuntimeExports.jsx(Chip,{icon:dt?jsxRuntimeExports.jsx(CheckCircle,{}):jsxRuntimeExports.jsx(Warning,{}),label:dt?"Funded":"Needs Gas",color:dt?"success":"warning",size:"small"})]}),jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",justifyContent:"space-between",children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Status"}),jsxRuntimeExports.jsx(Typography,{variant:"body1",children:pt?"Ready for attestations":"Setup required"})]}),jsxRuntimeExports.jsx(Chip,{icon:pt?jsxRuntimeExports.jsx(CheckCircle,{}):jsxRuntimeExports.jsx(Warning,{}),label:pt?"Ready":"Not Ready",color:pt?"success":"warning",size:"small"})]})]})}),!dt&&o&&jsxRuntimeExports.jsxs(Alert$1,{severity:"warning",sx:{mb:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"Wallet Needs Funding"}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:{mb:2},children:["Your smart wallet needs ETH to pay for transaction gas on ",yt?"Base":"Base Sepolia","."]}),jsxRuntimeExports.jsx(Stack,{direction:"row",spacing:1,children:jsxRuntimeExports.jsx(Button$1,{variant:"contained",size:"small",onClick:Ct,disabled:nt,startIcon:nt?jsxRuntimeExports.jsx(CircularProgress,{size:16}):void 0,children:nt?yt?"Opening Bridge...":"Opening Faucet...":yt?"Bridge ETH":"Get Test ETH"})})]}),tt&&jsxRuntimeExports.jsx(Alert$1,{severity:"error",sx:{mt:2},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",children:tt})}),pt&&jsxRuntimeExports.jsx(Alert$1,{severity:"success",children:jsxRuntimeExports.jsx(Typography,{variant:"body2",children:"āœ… Your smart wallet is ready! You can now create attestations without switching networks."})})]}):jsxRuntimeExports.jsx(Alert$1,{severity:"info",children:"Connect your wallet using the button in the top-right corner to get started."})},__vite_import_meta_env__={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_CHAIN_ID:"84532",VITE_EAS_ADDRESS:"0x4200000000000000000000000000000000000021",VITE_EAS_SCHEMA_UID:"0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af",VITE_GITHUB_CLIENT_ID:"Ov23liHcCbZ43H9BKIAi",VITE_GITHUB_REDIRECT_URI:"https://didgit.dev",VITE_GITHUB_TOKEN_PROXY:"https://didgit0.ops7622.workers.dev/",VITE_RESOLVER_ADDRESS:"0x4092543CBba00A105d4974616bEF71CB4b2AF9a5",VITE_WEB3AUTH_CLIENT_ID:"BIKasG1HwkyFsv8reWq_djHe7xWyW-NCnCGN4997DHH7lyoCabx4qedqGucyJ25NfOQxfPCvXWgb8P9ZsKmUA8k",VITE_WEB3AUTH_NETWORK:"mainnet",VITE_ZERODEV_BUNDLER_RPC:"https://rpc.zerodev.app/api/v3/aa40f236-4eff-41e1-8737-ab95ab7e1850/chain/84532",VITE_ZERODEV_PROJECT_ID:"aa40f236-4eff-41e1-8737-ab95ab7e1850"},ghEnvSchema=objectType({VITE_GITHUB_CLIENT_ID:stringType().min(1),VITE_GITHUB_REDIRECT_URI:stringType().url().optional(),VITE_GITHUB_TOKEN_PROXY:stringType().url().optional()});function ghConfig(){const o=ghEnvSchema.safeParse(__vite_import_meta_env__);return o.success?{clientId:o.data.VITE_GITHUB_CLIENT_ID,redirectUri:o.data.VITE_GITHUB_REDIRECT_URI??`${window.location.origin}`,tokenProxy:o.data.VITE_GITHUB_TOKEN_PROXY}:{clientId:void 0,redirectUri:void 0}}function base64UrlEncode(o){const _=new Uint8Array(o);let $="";return _.forEach(j=>$+=String.fromCharCode(j)),btoa($).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function createCodeChallenge(o){const _=new TextEncoder().encode(o),$=await crypto.subtle.digest("SHA-256",_);return base64UrlEncode($)}const TokenResp=objectType({access_token:stringType(),token_type:stringType(),scope:stringType().optional()}),TokenError=objectType({error:stringType(),error_description:stringType().optional(),error_uri:stringType().optional()});async function exchangeCodeForToken(o){const{tokenProxy:_}=ghConfig(),$=_??`${window.location.origin}/api/github/token`,j=await fetch($,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({client_id:o.clientId,code:o.code,redirect_uri:o.redirectUri,code_verifier:o.codeVerifier})});if(!j.ok){try{const rt=await j.json(),nt=TokenError.safeParse(rt);if(nt.success){const ot=`${nt.data.error}${nt.data.error_description?`: ${nt.data.error_description}`:""}`;throw new Error(`GitHub token exchange failed: ${j.status} ${ot}`)}}catch{}throw new Error(`GitHub token exchange failed: ${j.status}`)}const _e=await j.json(),et=TokenError.safeParse(_e);if(et.success){const rt=`${et.data.error}${et.data.error_description?`: ${et.data.error_description}`:""}`;throw new Error(rt)}const tt=TokenResp.safeParse(_e);if(!tt.success)throw new Error("Unexpected token response");return tt.data}const UserResp=objectType({login:stringType(),id:numberType(),avatar_url:stringType().url().optional()});async function fetchGitHubUser(o){const _=await fetch("https://api.github.com/user",{headers:{Authorization:`Bearer ${o.access_token}`,Accept:"application/vnd.github+json"}});if(!_.ok)throw new Error("Failed to load user");const $=await _.json(),j=UserResp.safeParse($);if(!j.success)throw new Error("Unexpected user payload");return j.data}const Ctx=reactExports.createContext(void 0),GithubAuthProvider=({children:o})=>{const _=ghConfig(),[$,j]=reactExports.useState(null),[_e,et]=reactExports.useState(null),[tt,rt]=reactExports.useState(!1);reactExports.useEffect(()=>{var vt;const st=window.location.origin,at=wt=>{if(wt.origin!==st)return;const Ct=wt.data;if(!Ct||Ct.type!=="GH_OAUTH")return;const Pt=Ct.code,Bt=Ct.state,At=sessionStorage.getItem("gh_oauth_state"),kt=sessionStorage.getItem("gh_pkce_verifier");!Pt||!Bt||!At||Bt!==At||!kt||!_.clientId||(async()=>{try{rt(!0);const Ot=await exchangeCodeForToken({clientId:_.clientId,code:Pt,redirectUri:_.redirectUri??st,codeVerifier:kt});j(Ot);const Tt=await fetchGitHubUser(Ot);et(Tt)}finally{sessionStorage.removeItem("gh_oauth_state"),sessionStorage.removeItem("gh_pkce_verifier"),rt(!1)}})()};window.addEventListener("message",at);const lt=new URL(window.location.href),ct=lt.searchParams.get("code"),ft=lt.searchParams.get("state"),dt=sessionStorage.getItem("gh_oauth_state"),pt=sessionStorage.getItem("gh_pkce_verifier");if(!!window.opener&&ct&&ft){try{(vt=window.opener)==null||vt.postMessage({type:"GH_OAUTH",code:ct,state:ft},st)}finally{window.close()}return()=>window.removeEventListener("message",at)}return ct&&ft&&dt&&ft===dt&&pt&&_.clientId&&(async()=>{try{rt(!0);const wt=await exchangeCodeForToken({clientId:_.clientId,code:ct,redirectUri:_.redirectUri??st,codeVerifier:pt});j(wt);const Ct=await fetchGitHubUser(wt);et(Ct)}catch{}finally{lt.searchParams.delete("code"),lt.searchParams.delete("state"),window.history.replaceState({},"",lt.pathname+lt.search+lt.hash),sessionStorage.removeItem("gh_oauth_state"),sessionStorage.removeItem("gh_pkce_verifier"),rt(!1)}})(),()=>window.removeEventListener("message",at)},[_.clientId,_.redirectUri]);const nt=reactExports.useCallback(async()=>{if(!_.clientId)throw new Error("VITE_GITHUB_CLIENT_ID is not set");const st=Math.random().toString(36).slice(2),at=crypto.getRandomValues(new Uint8Array(32)).reduce((Ct,Pt)=>Ct+("0"+(Pt&255).toString(16)).slice(-2),""),lt=await createCodeChallenge(at);sessionStorage.setItem("gh_oauth_state",st),sessionStorage.setItem("gh_pkce_verifier",at);const ct=_.redirectUri??`${window.location.origin}`,dt=`https://github.com/login/oauth/authorize?${new URLSearchParams({client_id:_.clientId,redirect_uri:ct,login:"",scope:"read:user gist",state:st,response_type:"code",code_challenge:lt,code_challenge_method:"S256",allow_signup:"true"}).toString()}`,pt=500,yt=650,vt=window.screenX+(window.outerWidth-pt)/2,wt=window.screenY+(window.outerHeight-yt)/2.5;window.open(dt,"github_oauth",`width=${pt},height=${yt},left=${vt},top=${wt}`)},[_.clientId,_.redirectUri]),ot=reactExports.useCallback(()=>{et(null),j(null)},[]),it=reactExports.useMemo(()=>({token:$,user:_e,connecting:tt,connect:nt,disconnect:ot}),[$,_e,tt,nt,ot]);return jsxRuntimeExports.jsx(Ctx.Provider,{value:it,children:o})};function useGithubAuth(){const o=reactExports.useContext(Ctx);if(!o)throw new Error("useGithubAuth must be used within GithubAuthProvider");return o}function setRef(o,_){if(typeof o=="function")return o(_);o!=null&&(o.current=_)}function composeRefs(...o){return _=>{let $=!1;const j=o.map(_e=>{const et=setRef(_e,_);return!$&&typeof et=="function"&&($=!0),et});if($)return()=>{for(let _e=0;_e{let{children:et,...tt}=j;isLazyComponent(et)&&typeof use=="function"&&(et=use(et._payload));const rt=reactExports.Children.toArray(et),nt=rt.find(isSlottable);if(nt){const ot=nt.props.children,it=rt.map(st=>st===nt?reactExports.Children.count(ot)>1?reactExports.Children.only(null):reactExports.isValidElement(ot)?ot.props.children:null:st);return jsxRuntimeExports.jsx(_,{...tt,ref:_e,children:reactExports.isValidElement(ot)?reactExports.cloneElement(ot,void 0,it):null})}return jsxRuntimeExports.jsx(_,{...tt,ref:_e,children:et})});return $.displayName=`${o}.Slot`,$}var Slot=createSlot("Slot");function createSlotClone(o){const _=reactExports.forwardRef(($,j)=>{let{children:_e,...et}=$;if(isLazyComponent(_e)&&typeof use=="function"&&(_e=use(_e._payload)),reactExports.isValidElement(_e)){const tt=getElementRef(_e),rt=mergeProps(et,_e.props);return _e.type!==reactExports.Fragment&&(rt.ref=j?composeRefs(j,tt):tt),reactExports.cloneElement(_e,rt)}return reactExports.Children.count(_e)>1?reactExports.Children.only(null):null});return _.displayName=`${o}.SlotClone`,_}var SLOTTABLE_IDENTIFIER=Symbol("radix.slottable");function isSlottable(o){return reactExports.isValidElement(o)&&typeof o.type=="function"&&"__radixId"in o.type&&o.type.__radixId===SLOTTABLE_IDENTIFIER}function mergeProps(o,_){const $={..._};for(const j in _){const _e=o[j],et=_[j];/^on[A-Z]/.test(j)?_e&&et?$[j]=(...rt)=>{const nt=et(...rt);return _e(...rt),nt}:_e&&($[j]=_e):j==="style"?$[j]={..._e,...et}:j==="className"&&($[j]=[_e,et].filter(Boolean).join(" "))}return{...o,...$}}function getElementRef(o){var j,_e;let _=(j=Object.getOwnPropertyDescriptor(o.props,"ref"))==null?void 0:j.get,$=_&&"isReactWarning"in _&&_.isReactWarning;return $?o.ref:(_=(_e=Object.getOwnPropertyDescriptor(o,"ref"))==null?void 0:_e.get,$=_&&"isReactWarning"in _&&_.isReactWarning,$?o.props.ref:o.props.ref||o.ref)}const falsyToString=o=>typeof o=="boolean"?`${o}`:o===0?"0":o,cx=clsx,cva=(o,_)=>$=>{var j;if((_==null?void 0:_.variants)==null)return cx(o,$==null?void 0:$.class,$==null?void 0:$.className);const{variants:_e,defaultVariants:et}=_,tt=Object.keys(_e).map(ot=>{const it=$==null?void 0:$[ot],st=et==null?void 0:et[ot];if(it===null)return null;const at=falsyToString(it)||falsyToString(st);return _e[ot][at]}),rt=$&&Object.entries($).reduce((ot,it)=>{let[st,at]=it;return at===void 0||(ot[st]=at),ot},{}),nt=_==null||(j=_.compoundVariants)===null||j===void 0?void 0:j.reduce((ot,it)=>{let{class:st,className:at,...lt}=it;return Object.entries(lt).every(ct=>{let[ft,dt]=ct;return Array.isArray(dt)?dt.includes({...et,...rt}[ft]):{...et,...rt}[ft]===dt})?[...ot,st,at]:ot},[]);return cx(o,tt,nt,$==null?void 0:$.class,$==null?void 0:$.className)},CLASS_PART_SEPARATOR="-",createClassGroupUtils=o=>{const _=createClassMap(o),{conflictingClassGroups:$,conflictingClassGroupModifiers:j}=o;return{getClassGroupId:tt=>{const rt=tt.split(CLASS_PART_SEPARATOR);return rt[0]===""&&rt.length!==1&&rt.shift(),getGroupRecursive(rt,_)||getGroupIdForArbitraryProperty(tt)},getConflictingClassGroupIds:(tt,rt)=>{const nt=$[tt]||[];return rt&&j[tt]?[...nt,...j[tt]]:nt}}},getGroupRecursive=(o,_)=>{var tt;if(o.length===0)return _.classGroupId;const $=o[0],j=_.nextPart.get($),_e=j?getGroupRecursive(o.slice(1),j):void 0;if(_e)return _e;if(_.validators.length===0)return;const et=o.join(CLASS_PART_SEPARATOR);return(tt=_.validators.find(({validator:rt})=>rt(et)))==null?void 0:tt.classGroupId},arbitraryPropertyRegex=/^\[(.+)\]$/,getGroupIdForArbitraryProperty=o=>{if(arbitraryPropertyRegex.test(o)){const _=arbitraryPropertyRegex.exec(o)[1],$=_==null?void 0:_.substring(0,_.indexOf(":"));if($)return"arbitrary.."+$}},createClassMap=o=>{const{theme:_,prefix:$}=o,j={nextPart:new Map,validators:[]};return getPrefixedClassGroupEntries(Object.entries(o.classGroups),$).forEach(([et,tt])=>{processClassesRecursively(tt,j,et,_)}),j},processClassesRecursively=(o,_,$,j)=>{o.forEach(_e=>{if(typeof _e=="string"){const et=_e===""?_:getPart(_,_e);et.classGroupId=$;return}if(typeof _e=="function"){if(isThemeGetter(_e)){processClassesRecursively(_e(j),_,$,j);return}_.validators.push({validator:_e,classGroupId:$});return}Object.entries(_e).forEach(([et,tt])=>{processClassesRecursively(tt,getPart(_,et),$,j)})})},getPart=(o,_)=>{let $=o;return _.split(CLASS_PART_SEPARATOR).forEach(j=>{$.nextPart.has(j)||$.nextPart.set(j,{nextPart:new Map,validators:[]}),$=$.nextPart.get(j)}),$},isThemeGetter=o=>o.isThemeGetter,getPrefixedClassGroupEntries=(o,_)=>_?o.map(([$,j])=>{const _e=j.map(et=>typeof et=="string"?_+et:typeof et=="object"?Object.fromEntries(Object.entries(et).map(([tt,rt])=>[_+tt,rt])):et);return[$,_e]}):o,createLruCache=o=>{if(o<1)return{get:()=>{},set:()=>{}};let _=0,$=new Map,j=new Map;const _e=(et,tt)=>{$.set(et,tt),_++,_>o&&(_=0,j=$,$=new Map)};return{get(et){let tt=$.get(et);if(tt!==void 0)return tt;if((tt=j.get(et))!==void 0)return _e(et,tt),tt},set(et,tt){$.has(et)?$.set(et,tt):_e(et,tt)}}},IMPORTANT_MODIFIER="!",createParseClassName=o=>{const{separator:_,experimentalParseClassName:$}=o,j=_.length===1,_e=_[0],et=_.length,tt=rt=>{const nt=[];let ot=0,it=0,st;for(let dt=0;dtit?st-it:void 0;return{modifiers:nt,hasImportantModifier:lt,baseClassName:ct,maybePostfixModifierPosition:ft}};return $?rt=>$({className:rt,parseClassName:tt}):tt},sortModifiers=o=>{if(o.length<=1)return o;const _=[];let $=[];return o.forEach(j=>{j[0]==="["?(_.push(...$.sort(),j),$=[]):$.push(j)}),_.push(...$.sort()),_},createConfigUtils=o=>({cache:createLruCache(o.cacheSize),parseClassName:createParseClassName(o),...createClassGroupUtils(o)}),SPLIT_CLASSES_REGEX=/\s+/,mergeClassList=(o,_)=>{const{parseClassName:$,getClassGroupId:j,getConflictingClassGroupIds:_e}=_,et=[],tt=o.trim().split(SPLIT_CLASSES_REGEX);let rt="";for(let nt=tt.length-1;nt>=0;nt-=1){const ot=tt[nt],{modifiers:it,hasImportantModifier:st,baseClassName:at,maybePostfixModifierPosition:lt}=$(ot);let ct=!!lt,ft=j(ct?at.substring(0,lt):at);if(!ft){if(!ct){rt=ot+(rt.length>0?" "+rt:rt);continue}if(ft=j(at),!ft){rt=ot+(rt.length>0?" "+rt:rt);continue}ct=!1}const dt=sortModifiers(it).join(":"),pt=st?dt+IMPORTANT_MODIFIER:dt,yt=pt+ft;if(et.includes(yt))continue;et.push(yt);const vt=_e(ft,ct);for(let wt=0;wt0?" "+rt:rt)}return rt};function twJoin(){let o=0,_,$,j="";for(;o{if(typeof o=="string")return o;let _,$="";for(let j=0;jst(it),o());return $=createConfigUtils(ot),j=$.cache.get,_e=$.cache.set,et=rt,rt(nt)}function rt(nt){const ot=j(nt);if(ot)return ot;const it=mergeClassList(nt,$);return _e(nt,it),it}return function(){return et(twJoin.apply(null,arguments))}}const fromTheme=o=>{const _=$=>$[o]||[];return _.isThemeGetter=!0,_},arbitraryValueRegex=/^\[(?:([a-z-]+):)?(.+)\]$/i,fractionRegex=/^\d+\/\d+$/,stringLengths=new Set(["px","full","screen"]),tshirtUnitRegex=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,lengthUnitRegex=/\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$/,colorFunctionRegex=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,shadowRegex=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,imageRegex=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,isLength$1=o=>isNumber$1(o)||stringLengths.has(o)||fractionRegex.test(o),isArbitraryLength=o=>getIsArbitraryValue(o,"length",isLengthOnly),isNumber$1=o=>!!o&&!Number.isNaN(Number(o)),isArbitraryNumber=o=>getIsArbitraryValue(o,"number",isNumber$1),isInteger=o=>!!o&&Number.isInteger(Number(o)),isPercent$1=o=>o.endsWith("%")&&isNumber$1(o.slice(0,-1)),isArbitraryValue=o=>arbitraryValueRegex.test(o),isTshirtSize=o=>tshirtUnitRegex.test(o),sizeLabels=new Set(["length","size","percentage"]),isArbitrarySize=o=>getIsArbitraryValue(o,sizeLabels,isNever),isArbitraryPosition=o=>getIsArbitraryValue(o,"position",isNever),imageLabels=new Set(["image","url"]),isArbitraryImage=o=>getIsArbitraryValue(o,imageLabels,isImage),isArbitraryShadow=o=>getIsArbitraryValue(o,"",isShadow),isAny=()=>!0,getIsArbitraryValue=(o,_,$)=>{const j=arbitraryValueRegex.exec(o);return j?j[1]?typeof _=="string"?j[1]===_:_.has(j[1]):$(j[2]):!1},isLengthOnly=o=>lengthUnitRegex.test(o)&&!colorFunctionRegex.test(o),isNever=()=>!1,isShadow=o=>shadowRegex.test(o),isImage=o=>imageRegex.test(o),getDefaultConfig=()=>{const o=fromTheme("colors"),_=fromTheme("spacing"),$=fromTheme("blur"),j=fromTheme("brightness"),_e=fromTheme("borderColor"),et=fromTheme("borderRadius"),tt=fromTheme("borderSpacing"),rt=fromTheme("borderWidth"),nt=fromTheme("contrast"),ot=fromTheme("grayscale"),it=fromTheme("hueRotate"),st=fromTheme("invert"),at=fromTheme("gap"),lt=fromTheme("gradientColorStops"),ct=fromTheme("gradientColorStopPositions"),ft=fromTheme("inset"),dt=fromTheme("margin"),pt=fromTheme("opacity"),yt=fromTheme("padding"),vt=fromTheme("saturate"),wt=fromTheme("scale"),Ct=fromTheme("sepia"),Pt=fromTheme("skew"),Bt=fromTheme("space"),At=fromTheme("translate"),kt=()=>["auto","contain","none"],Ot=()=>["auto","hidden","clip","visible","scroll"],Tt=()=>["auto",isArbitraryValue,_],ht=()=>[isArbitraryValue,_],bt=()=>["",isLength$1,isArbitraryLength],mt=()=>["auto",isNumber$1,isArbitraryValue],gt=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],xt=()=>["solid","dashed","dotted","double","none"],Et=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],_t=()=>["start","end","center","between","around","evenly","stretch"],$t=()=>["","0",isArbitraryValue],St=()=>["auto","avoid","all","avoid-page","page","left","right","column"],Rt=()=>[isNumber$1,isArbitraryValue];return{cacheSize:500,separator:":",theme:{colors:[isAny],spacing:[isLength$1,isArbitraryLength],blur:["none","",isTshirtSize,isArbitraryValue],brightness:Rt(),borderColor:[o],borderRadius:["none","","full",isTshirtSize,isArbitraryValue],borderSpacing:ht(),borderWidth:bt(),contrast:Rt(),grayscale:$t(),hueRotate:Rt(),invert:$t(),gap:ht(),gradientColorStops:[o],gradientColorStopPositions:[isPercent$1,isArbitraryLength],inset:Tt(),margin:Tt(),opacity:Rt(),padding:ht(),saturate:Rt(),scale:Rt(),sepia:$t(),skew:Rt(),space:ht(),translate:ht()},classGroups:{aspect:[{aspect:["auto","square","video",isArbitraryValue]}],container:["container"],columns:[{columns:[isTshirtSize]}],"break-after":[{"break-after":St()}],"break-before":[{"break-before":St()}],"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:[...gt(),isArbitraryValue]}],overflow:[{overflow:Ot()}],"overflow-x":[{"overflow-x":Ot()}],"overflow-y":[{"overflow-y":Ot()}],overscroll:[{overscroll:kt()}],"overscroll-x":[{"overscroll-x":kt()}],"overscroll-y":[{"overscroll-y":kt()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[ft]}],"inset-x":[{"inset-x":[ft]}],"inset-y":[{"inset-y":[ft]}],start:[{start:[ft]}],end:[{end:[ft]}],top:[{top:[ft]}],right:[{right:[ft]}],bottom:[{bottom:[ft]}],left:[{left:[ft]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",isInteger,isArbitraryValue]}],basis:[{basis:Tt()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",isArbitraryValue]}],grow:[{grow:$t()}],shrink:[{shrink:$t()}],order:[{order:["first","last","none",isInteger,isArbitraryValue]}],"grid-cols":[{"grid-cols":[isAny]}],"col-start-end":[{col:["auto",{span:["full",isInteger,isArbitraryValue]},isArbitraryValue]}],"col-start":[{"col-start":mt()}],"col-end":[{"col-end":mt()}],"grid-rows":[{"grid-rows":[isAny]}],"row-start-end":[{row:["auto",{span:[isInteger,isArbitraryValue]},isArbitraryValue]}],"row-start":[{"row-start":mt()}],"row-end":[{"row-end":mt()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",isArbitraryValue]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",isArbitraryValue]}],gap:[{gap:[at]}],"gap-x":[{"gap-x":[at]}],"gap-y":[{"gap-y":[at]}],"justify-content":[{justify:["normal",..._t()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",..._t(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[..._t(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[yt]}],px:[{px:[yt]}],py:[{py:[yt]}],ps:[{ps:[yt]}],pe:[{pe:[yt]}],pt:[{pt:[yt]}],pr:[{pr:[yt]}],pb:[{pb:[yt]}],pl:[{pl:[yt]}],m:[{m:[dt]}],mx:[{mx:[dt]}],my:[{my:[dt]}],ms:[{ms:[dt]}],me:[{me:[dt]}],mt:[{mt:[dt]}],mr:[{mr:[dt]}],mb:[{mb:[dt]}],ml:[{ml:[dt]}],"space-x":[{"space-x":[Bt]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[Bt]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",isArbitraryValue,_]}],"min-w":[{"min-w":[isArbitraryValue,_,"min","max","fit"]}],"max-w":[{"max-w":[isArbitraryValue,_,"none","full","min","max","fit","prose",{screen:[isTshirtSize]},isTshirtSize]}],h:[{h:[isArbitraryValue,_,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[isArbitraryValue,_,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[isArbitraryValue,_,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[isArbitraryValue,_,"auto","min","max","fit"]}],"font-size":[{text:["base",isTshirtSize,isArbitraryLength]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",isArbitraryNumber]}],"font-family":[{font:[isAny]}],"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-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",isArbitraryValue]}],"line-clamp":[{"line-clamp":["none",isNumber$1,isArbitraryNumber]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",isLength$1,isArbitraryValue]}],"list-image":[{"list-image":["none",isArbitraryValue]}],"list-style-type":[{list:["none","disc","decimal",isArbitraryValue]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[o]}],"placeholder-opacity":[{"placeholder-opacity":[pt]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[o]}],"text-opacity":[{"text-opacity":[pt]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...xt(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",isLength$1,isArbitraryLength]}],"underline-offset":[{"underline-offset":["auto",isLength$1,isArbitraryValue]}],"text-decoration-color":[{decoration:[o]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:ht()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",isArbitraryValue]}],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",isArbitraryValue]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[pt]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...gt(),isArbitraryPosition]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",isArbitrarySize]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},isArbitraryImage]}],"bg-color":[{bg:[o]}],"gradient-from-pos":[{from:[ct]}],"gradient-via-pos":[{via:[ct]}],"gradient-to-pos":[{to:[ct]}],"gradient-from":[{from:[lt]}],"gradient-via":[{via:[lt]}],"gradient-to":[{to:[lt]}],rounded:[{rounded:[et]}],"rounded-s":[{"rounded-s":[et]}],"rounded-e":[{"rounded-e":[et]}],"rounded-t":[{"rounded-t":[et]}],"rounded-r":[{"rounded-r":[et]}],"rounded-b":[{"rounded-b":[et]}],"rounded-l":[{"rounded-l":[et]}],"rounded-ss":[{"rounded-ss":[et]}],"rounded-se":[{"rounded-se":[et]}],"rounded-ee":[{"rounded-ee":[et]}],"rounded-es":[{"rounded-es":[et]}],"rounded-tl":[{"rounded-tl":[et]}],"rounded-tr":[{"rounded-tr":[et]}],"rounded-br":[{"rounded-br":[et]}],"rounded-bl":[{"rounded-bl":[et]}],"border-w":[{border:[rt]}],"border-w-x":[{"border-x":[rt]}],"border-w-y":[{"border-y":[rt]}],"border-w-s":[{"border-s":[rt]}],"border-w-e":[{"border-e":[rt]}],"border-w-t":[{"border-t":[rt]}],"border-w-r":[{"border-r":[rt]}],"border-w-b":[{"border-b":[rt]}],"border-w-l":[{"border-l":[rt]}],"border-opacity":[{"border-opacity":[pt]}],"border-style":[{border:[...xt(),"hidden"]}],"divide-x":[{"divide-x":[rt]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[rt]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[pt]}],"divide-style":[{divide:xt()}],"border-color":[{border:[_e]}],"border-color-x":[{"border-x":[_e]}],"border-color-y":[{"border-y":[_e]}],"border-color-s":[{"border-s":[_e]}],"border-color-e":[{"border-e":[_e]}],"border-color-t":[{"border-t":[_e]}],"border-color-r":[{"border-r":[_e]}],"border-color-b":[{"border-b":[_e]}],"border-color-l":[{"border-l":[_e]}],"divide-color":[{divide:[_e]}],"outline-style":[{outline:["",...xt()]}],"outline-offset":[{"outline-offset":[isLength$1,isArbitraryValue]}],"outline-w":[{outline:[isLength$1,isArbitraryLength]}],"outline-color":[{outline:[o]}],"ring-w":[{ring:bt()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[o]}],"ring-opacity":[{"ring-opacity":[pt]}],"ring-offset-w":[{"ring-offset":[isLength$1,isArbitraryLength]}],"ring-offset-color":[{"ring-offset":[o]}],shadow:[{shadow:["","inner","none",isTshirtSize,isArbitraryShadow]}],"shadow-color":[{shadow:[isAny]}],opacity:[{opacity:[pt]}],"mix-blend":[{"mix-blend":[...Et(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":Et()}],filter:[{filter:["","none"]}],blur:[{blur:[$]}],brightness:[{brightness:[j]}],contrast:[{contrast:[nt]}],"drop-shadow":[{"drop-shadow":["","none",isTshirtSize,isArbitraryValue]}],grayscale:[{grayscale:[ot]}],"hue-rotate":[{"hue-rotate":[it]}],invert:[{invert:[st]}],saturate:[{saturate:[vt]}],sepia:[{sepia:[Ct]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[$]}],"backdrop-brightness":[{"backdrop-brightness":[j]}],"backdrop-contrast":[{"backdrop-contrast":[nt]}],"backdrop-grayscale":[{"backdrop-grayscale":[ot]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[it]}],"backdrop-invert":[{"backdrop-invert":[st]}],"backdrop-opacity":[{"backdrop-opacity":[pt]}],"backdrop-saturate":[{"backdrop-saturate":[vt]}],"backdrop-sepia":[{"backdrop-sepia":[Ct]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[tt]}],"border-spacing-x":[{"border-spacing-x":[tt]}],"border-spacing-y":[{"border-spacing-y":[tt]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",isArbitraryValue]}],duration:[{duration:Rt()}],ease:[{ease:["linear","in","out","in-out",isArbitraryValue]}],delay:[{delay:Rt()}],animate:[{animate:["none","spin","ping","pulse","bounce",isArbitraryValue]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[wt]}],"scale-x":[{"scale-x":[wt]}],"scale-y":[{"scale-y":[wt]}],rotate:[{rotate:[isInteger,isArbitraryValue]}],"translate-x":[{"translate-x":[At]}],"translate-y":[{"translate-y":[At]}],"skew-x":[{"skew-x":[Pt]}],"skew-y":[{"skew-y":[Pt]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",isArbitraryValue]}],accent:[{accent:["auto",o]}],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",isArbitraryValue]}],"caret-color":[{caret:[o]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":ht()}],"scroll-mx":[{"scroll-mx":ht()}],"scroll-my":[{"scroll-my":ht()}],"scroll-ms":[{"scroll-ms":ht()}],"scroll-me":[{"scroll-me":ht()}],"scroll-mt":[{"scroll-mt":ht()}],"scroll-mr":[{"scroll-mr":ht()}],"scroll-mb":[{"scroll-mb":ht()}],"scroll-ml":[{"scroll-ml":ht()}],"scroll-p":[{"scroll-p":ht()}],"scroll-px":[{"scroll-px":ht()}],"scroll-py":[{"scroll-py":ht()}],"scroll-ps":[{"scroll-ps":ht()}],"scroll-pe":[{"scroll-pe":ht()}],"scroll-pt":[{"scroll-pt":ht()}],"scroll-pr":[{"scroll-pr":ht()}],"scroll-pb":[{"scroll-pb":ht()}],"scroll-pl":[{"scroll-pl":ht()}],"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",isArbitraryValue]}],fill:[{fill:[o,"none"]}],"stroke-w":[{stroke:[isLength$1,isArbitraryLength,isArbitraryNumber]}],stroke:[{stroke:[o,"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-s","border-color-e","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"]}}},twMerge=createTailwindMerge(getDefaultConfig);function cn(...o){return twMerge(clsx(o))}const buttonVariants=cva("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-gray-900 text-white hover:bg-gray-800",secondary:"bg-blue-600 text-white hover:bg-blue-500",outline:"border border-gray-300 bg-white hover:bg-gray-50",ghost:"hover:bg-gray-100",destructive:"bg-red-600 text-white hover:bg-red-500"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button=reactExports.forwardRef(({className:o,variant:_,size:$,asChild:j=!1,..._e},et)=>{const tt=j?Slot:"button";return jsxRuntimeExports.jsx(tt,{className:cn(buttonVariants({variant:_,size:$,className:o})),ref:et,..._e})});Button.displayName="Button";const GithubSection=()=>{const{user:o,connect:_,disconnect:$,connecting:j}=useGithubAuth();return jsxRuntimeExports.jsxs("section",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg font-semibold mb-2",children:"GitHub"}),o?jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntimeExports.jsx("img",{src:o.avatar_url||void 0,alt:o.login,className:"h-7 w-7 rounded-full"}),jsxRuntimeExports.jsxs("span",{children:["Logged in as ",jsxRuntimeExports.jsx("strong",{children:o.login})]}),jsxRuntimeExports.jsx(Button,{variant:"ghost",onClick:$,children:"Disconnect"})]}):jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntimeExports.jsx(Button,{onClick:_,disabled:j,children:"Connect GitHub"}),jsxRuntimeExports.jsx("span",{className:"text-sm text-gray-500",children:"Scopes: read:user, gist"})]}),!o&&jsxRuntimeExports.jsxs("div",{className:"text-xs text-gray-500 mt-2",children:[jsxRuntimeExports.jsxs("div",{children:["Client ID: ",jsxRuntimeExports.jsx("code",{children:"Ov23liHcCbZ43H9BKIAi"})]}),jsxRuntimeExports.jsxs("div",{children:["Redirect URI: ",jsxRuntimeExports.jsx("code",{children:"https://didgit.dev"})]})]})]})},Input=reactExports.forwardRef(({className:o,..._},$)=>jsxRuntimeExports.jsx("input",{className:cn("flex h-9 w-full rounded-md border border-gray-300 bg-white px-3 py-1 text-sm shadow-sm placeholder:text-gray-400 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-gray-900 disabled:cursor-not-allowed disabled:opacity-50",o),ref:$,..._}));Input.displayName="Input";function Alert({className:o,..._}){return jsxRuntimeExports.jsx("div",{role:"alert",className:cn("rounded-md border border-red-200 bg-red-50 p-3 text-sm text-red-800",o),..._})}const formSchema=objectType({github_username:stringType().min(1).max(39)}),AttestForm=()=>{const{address:o,smartAddress:_,signMessage:$,connected:j,getWalletClient:_e,getSmartWalletClient:et,canAttest:tt,isContract:rt,balanceWei:nt,refreshOnchain:ot,ensureAa:it,lastError:st}=useWallet(),{user:at,token:lt}=useGithubAuth(),ct=reactExports.useMemo(()=>appConfig(),[]),ft=!!ct.EAS_ADDRESS,dt=ct.CHAIN_ID===8453,pt=dt?"https://basescan.org":"https://sepolia.basescan.org",yt=dt?"https://base.easscan.org":"https://base-sepolia.easscan.org",[vt,wt]=reactExports.useState({github_username:""}),[Ct,Pt]=reactExports.useState(null),[Bt,At]=reactExports.useState(null),[kt,Ot]=reactExports.useState(!1),[Tt,ht]=reactExports.useState(!1),[bt,mt]=reactExports.useState(!1),[gt,xt]=reactExports.useState(null),[Et,_t]=reactExports.useState(null),[$t,St]=reactExports.useState(null),Rt=jt=>{wt(Ft=>({...Ft,[jt.target.name]:jt.target.value}))};React$3.useEffect(()=>{at!=null&&at.login&&wt(jt=>({...jt,github_username:at.login.toLowerCase()}))},[at==null?void 0:at.login]);const It=async()=>{var Ft;if(xt(null),!j||!o)return xt("Connect wallet first");const jt=formSchema.safeParse(vt);if(!jt.success)return xt(((Ft=jt.error.errors[0])==null?void 0:Ft.message)??"Invalid input");try{Ot(!0);const qt=`github.com:${jt.data.github_username}`,Xt=await $({message:qt});if(!await verifyMessage$1({message:qt,signature:Xt,address:o}))throw new Error("Signature does not match connected wallet");At(Xt)}catch(qt){xt(qt.message??"Failed to sign")}finally{Ot(!1)}},Mt=[{type:"function",name:"setRepoPattern",inputs:[{name:"domain",type:"string"},{name:"username",type:"string"},{name:"namespace",type:"string"},{name:"name",type:"string"},{name:"enabled",type:"bool"}],outputs:[],stateMutability:"nonpayable"}],Vt=async(jt,Ft)=>{const qt=ct.RESOLVER_ADDRESS;if(!qt)throw new Error("Resolver address not configured");await Ft.writeContract({address:qt,abi:Mt,functionName:"setRepoPattern",args:["github.com",jt,"*","*",!0],gas:BigInt(2e5)})},Gt=async()=>{var Lt;if(xt(null),_t(null),St(null),!j||!o)return xt("Connect wallet first");const jt=formSchema.safeParse(vt);if(!jt.success)return xt(((Lt=jt.error.errors[0])==null?void 0:Lt.message)??"Invalid input");if(!Bt)return xt("Sign your GitHub username first");if(!Ct)return xt("Create a proof gist first");if(!ft)return xt("EAS contract address not configured (set VITE_EAS_ADDRESS)");const Ft=_??o;if(!Ft)return xt("No account address available");let qt=null;try{qt=EASAddresses.forChain(ct.CHAIN_ID,ct)}catch(Ht){return xt(Ht.message??"EAS configuration missing")}const Xt=/^0x[0-9a-fA-F]{40}$/;if(!Xt.test(Ft))return xt("Resolved account address is invalid");if(!Xt.test(qt.contract))return xt("EAS contract address is invalid");const Ut={domain:"github.com",username:jt.data.github_username,wallet:o,message:`github.com:${jt.data.github_username}`,signature:Bt,proof_url:Ct};try{mt(!0);let Ht;try{Ht=encodeBindingData(Ut)}catch{return xt("Invalid account address for binding")}const Jt=await it()?await et():null;if(!Jt||!(_??o))throw new Error(st??"AA smart wallet not ready");const tr=await attestIdentityBinding({schemaUid:ct.EAS_SCHEMA_UID,data:Ht,recipient:o},qt,{aaClient:Jt});if(_t(tr.txHash),tr.attestationUid){St(tr.attestationUid);try{await Vt(jt.data.github_username,Jt)}catch(nr){console.warn("Failed to set default repository pattern:",nr)}}}catch(Ht){const Kt={eoaAddress:o??null,easContract:(()=>{try{return EASAddresses.forChain(ct.CHAIN_ID,ct).contract}catch{return null}})(),hasAaClient:!!await et(),hasSig:!!Bt,hasGist:!!Ct};xt(`${Ht.message} -context=${JSON.stringify(Kt)}`)}finally{mt(!1)}},zt=async()=>{if(xt(null),!lt)return xt("Connect GitHub first");try{ht(!0);const jt={domain:"github.com",username:vt.github_username,wallet:o??"",message:`github.com:${vt.github_username}`,signature:Bt??"",chain_id:ct.CHAIN_ID,schema_uid:ct.EAS_SCHEMA_UID},Ft=JSON.stringify(jt,null,2),qt=await fetch("https://api.github.com/gists",{method:"POST",headers:{Authorization:`Bearer ${lt.access_token}`,"Content-Type":"application/json",Accept:"application/vnd.github+json"},body:JSON.stringify({description:"GitHub activity attestation proof",public:!0,files:{"didgit.dev-proof.json":{content:Ft}}})});if(!qt.ok)throw new Error("Failed to create gist");const Xt=await qt.json();Xt.html_url&&Pt(Xt.html_url)}catch(jt){xt(jt.message)}finally{ht(!1)}};return jsxRuntimeExports.jsxs("section",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Create GitHub Identity Attestation"}),jsxRuntimeExports.jsxs("div",{className:"max-w-2xl space-y-3",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("label",{className:"text-sm text-gray-600",children:'GitHub Username (will sign "github.com:username")'}),jsxRuntimeExports.jsx(Input,{name:"github_username",value:vt.github_username,onChange:Rt,placeholder:"Connect GitHub first",disabled:!0,readOnly:!0})]}),jsxRuntimeExports.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[jsxRuntimeExports.jsx(Button,{onClick:It,disabled:kt||!o||!vt.github_username,children:kt?"Signing…":`Sign "github.com:${vt.github_username}"`}),Ct?jsxRuntimeExports.jsx(Button,{variant:"outline",disabled:!0,children:"didgit.dev-proof.json Created"}):jsxRuntimeExports.jsx(Button,{onClick:zt,disabled:!lt||Tt,variant:"outline",children:Tt?"Creating Gist…":"Create didgit.dev-proof.json"}),jsxRuntimeExports.jsx(Button,{onClick:Gt,disabled:!Bt||!Ct||bt||!ft||!(_||o),variant:"secondary",children:bt?"Submitting…":"Submit Attestation"})]}),_&&nt!==null&&nt===0n&&jsxRuntimeExports.jsxs(Alert,{children:["AA wallet has 0 balance on ",dt?"Base":"Base Sepolia",". Fund it, then ",jsxRuntimeExports.jsx("button",{className:"underline",onClick:()=>ot(),children:"refresh"}),"."]}),!ft&&jsxRuntimeExports.jsx(Alert,{children:"EAS contract address is not set. Add VITE_EAS_ADDRESS to .env and reload."}),rt&&nt!==null&&nt===0n&&jsxRuntimeExports.jsx(Alert,{children:"AA wallet has 0 balance. Fund it to proceed."}),Ct&&jsxRuntimeExports.jsxs("div",{className:"text-sm",children:["Proof Gist: ",jsxRuntimeExports.jsx("a",{className:"text-blue-600 underline",href:Ct,target:"_blank",rel:"noreferrer",children:Ct})]}),Bt&&jsxRuntimeExports.jsxs("div",{className:"text-xs text-gray-500",children:["Signature: ",jsxRuntimeExports.jsx("code",{children:Bt})]}),Et&&jsxRuntimeExports.jsxs("div",{className:"space-y-1",children:[jsxRuntimeExports.jsxs("div",{children:["Tx: ",jsxRuntimeExports.jsx("a",{className:"text-blue-600 underline",href:`${pt}/tx/${Et}`,target:"_blank",rel:"noreferrer",children:Et})]}),$t&&jsxRuntimeExports.jsxs("div",{children:["Attestation: ",jsxRuntimeExports.jsx("a",{className:"text-blue-600 underline",href:`${yt}/attestation/view/${$t}`,target:"_blank",rel:"noreferrer",children:$t})]})]}),gt&&jsxRuntimeExports.jsx(Alert,{children:gt})]})]})};function Card({className:o,..._}){return jsxRuntimeExports.jsx("div",{className:cn("rounded-lg border border-gray-200 bg-white text-gray-900 shadow-sm",o),..._})}function CardContent({className:o,..._}){return jsxRuntimeExports.jsx("div",{className:cn("p-6 pt-0",o),..._})}const inputSchema=objectType({q:stringType().min(1)}),EAS_GQL="https://base-sepolia.easscan.org/graphql",VerifyPanel=()=>{const o=reactExports.useMemo(()=>appConfig(),[]),[_,$]=reactExports.useState(""),[j,_e]=reactExports.useState(null),[et,tt]=reactExports.useState(!1),[rt,nt]=reactExports.useState(null),ot=async()=>{var st;const it=inputSchema.safeParse({q:_});if(it.success){nt(null),_e(null),tt(!0);try{const ft=(((st=(await(await fetch(EAS_GQL,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:`query ($schemaId: String!, $q: String!) { - attestations(take: 20, where: { schemaId: { equals: $schemaId }, OR: [ - { decodedDataJson: { contains: $q } }, - { recipient: { equals: $q } } - ] }) { - id - recipient - decodedDataJson - } - }`,variables:{schemaId:o.EAS_SCHEMA_UID,q:it.data.q}})})).json()).data)==null?void 0:st.attestations)??[]).map(dt=>({id:dt.id,recipient:dt.recipient,decoded:safeParseDecoded(dt.decodedDataJson)}));_e(ft)}catch(at){nt(at.message)}finally{tt(!1)}}};return jsxRuntimeExports.jsxs("section",{children:[jsxRuntimeExports.jsx("h3",{className:"text-lg font-semibold mb-2",children:"Verify"}),jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[jsxRuntimeExports.jsx(Input,{placeholder:"Search by username, wallet or URL",value:_,onChange:it=>$(it.target.value)}),jsxRuntimeExports.jsx(Button,{onClick:ot,disabled:et,children:"Search"})]}),rt&&jsxRuntimeExports.jsx("div",{className:"mt-2",children:jsxRuntimeExports.jsx(Alert,{children:rt})}),j&&jsxRuntimeExports.jsxs("div",{className:"grid gap-2 mt-2",children:[j.length===0&&jsxRuntimeExports.jsx("div",{children:"No results."}),j.map(it=>jsxRuntimeExports.jsx(Card,{children:jsxRuntimeExports.jsxs(CardContent,{children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("strong",{children:"Attestation:"})," ",jsxRuntimeExports.jsx("a",{className:"text-blue-600 underline",href:`https://base-sepolia.easscan.org/attestation/view/${it.id}`,target:"_blank",rel:"noreferrer",children:it.id})]}),jsxRuntimeExports.jsxs("div",{className:"text-sm",children:["Recipient: ",jsxRuntimeExports.jsx("code",{children:it.recipient})]}),it.decoded&&jsxRuntimeExports.jsxs("div",{className:"mt-1 text-sm",children:[jsxRuntimeExports.jsxs("div",{children:["Username: ",jsxRuntimeExports.jsx("code",{children:it.decoded.github_username})]}),jsxRuntimeExports.jsxs("div",{children:["Wallet: ",jsxRuntimeExports.jsx("code",{children:it.decoded.wallet_address})]}),jsxRuntimeExports.jsxs("div",{children:["Gist: ",jsxRuntimeExports.jsx("a",{className:"text-blue-600 underline",href:it.decoded.github_proof_url,target:"_blank",rel:"noreferrer",children:it.decoded.github_proof_url})]})]})]})},it.id))]})]})};function safeParseDecoded(o){var _;if(!o)return null;try{const $=JSON.parse(o),j=new Map;for(const et of $)j.set(et.name,(_=et.value)==null?void 0:_.value);const _e={github_username:String(j.get("github_username")??""),wallet_address:String(j.get("wallet_address")??""),github_proof_url:String(j.get("github_proof_url")??""),wallet_signature:String(j.get("wallet_signature")??"")};return!_e.github_username||!_e.wallet_address?null:_e}catch{return null}}var EventKeys=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function isEventKey(o){if(typeof o!="string")return!1;var _=EventKeys;return _.includes(o)}var SVGElementPropKeys=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],SVGElementPropKeySet=new Set(SVGElementPropKeys);function isSvgElementPropKey(o){return typeof o!="string"?!1:SVGElementPropKeySet.has(o)}function isDataAttribute(o){return typeof o=="string"&&o.startsWith("data-")}function svgPropertiesNoEvents(o){if(typeof o!="object"||o===null)return{};var _={};for(var $ in o)Object.prototype.hasOwnProperty.call(o,$)&&(isSvgElementPropKey($)||isDataAttribute($))&&(_[$]=o[$]);return _}function svgPropertiesNoEventsFromUnknown(o){if(o==null)return null;if(reactExports.isValidElement(o)&&typeof o.props=="object"&&o.props!==null){var _=o.props;return svgPropertiesNoEvents(_)}return typeof o=="object"&&!Array.isArray(o)?svgPropertiesNoEvents(o):null}function svgPropertiesAndEvents(o){var _={};for(var $ in o)Object.prototype.hasOwnProperty.call(o,$)&&(isSvgElementPropKey($)||isDataAttribute($)||isEventKey($))&&(_[$]=o[$]);return _}function svgPropertiesAndEventsFromUnknown(o){return o==null?null:reactExports.isValidElement(o)?svgPropertiesAndEvents(o.props):typeof o=="object"&&!Array.isArray(o)?svgPropertiesAndEvents(o):null}var _excluded$e=["children","width","height","viewBox","className","style","title","desc"];function _extends$j(){return _extends$j=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var{children:$,width:j,height:_e,viewBox:et,className:tt,style:rt,title:nt,desc:ot}=o,it=_objectWithoutProperties$e(o,_excluded$e),st=et||{width:j,height:_e,x:0,y:0},at=clsx("recharts-surface",tt);return reactExports.createElement("svg",_extends$j({},svgPropertiesAndEvents(it),{className:at,width:j,height:_e,style:rt,viewBox:"".concat(st.x," ").concat(st.y," ").concat(st.width," ").concat(st.height),ref:_}),reactExports.createElement("title",null,nt),reactExports.createElement("desc",null,ot),$)}),_excluded$d=["children","className"];function _extends$i(){return _extends$i=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var{children:$,className:j}=o,_e=_objectWithoutProperties$d(o,_excluded$d),et=clsx("recharts-layer",j);return reactExports.createElement("g",_extends$i({className:et},svgPropertiesAndEvents(_e),{ref:_}),$)}),LegendPortalContext=reactExports.createContext(null);function constant$1(o){return function(){return o}}const cos=Math.cos,sin=Math.sin,sqrt$1=Math.sqrt,pi$1=Math.PI,tau$1=2*pi$1,pi=Math.PI,tau=2*pi,epsilon=1e-6,tauEpsilon=tau-epsilon;function append(o){this._+=o[0];for(let _=1,$=o.length;_<$;++_)this._+=arguments[_]+o[_]}function appendRound(o){let _=Math.floor(o);if(!(_>=0))throw new Error(`invalid digits: ${o}`);if(_>15)return append;const $=10**_;return function(j){this._+=j[0];for(let _e=1,et=j.length;_eepsilon)if(!(Math.abs(st*nt-ot*it)>epsilon)||!et)this._append`L${this._x1=_},${this._y1=$}`;else{let lt=j-tt,ct=_e-rt,ft=nt*nt+ot*ot,dt=lt*lt+ct*ct,pt=Math.sqrt(ft),yt=Math.sqrt(at),vt=et*Math.tan((pi-Math.acos((ft+at-dt)/(2*pt*yt)))/2),wt=vt/yt,Ct=vt/pt;Math.abs(wt-1)>epsilon&&this._append`L${_+wt*it},${$+wt*st}`,this._append`A${et},${et},0,0,${+(st*lt>it*ct)},${this._x1=_+Ct*nt},${this._y1=$+Ct*ot}`}}arc(_,$,j,_e,et,tt){if(_=+_,$=+$,j=+j,tt=!!tt,j<0)throw new Error(`negative radius: ${j}`);let rt=j*Math.cos(_e),nt=j*Math.sin(_e),ot=_+rt,it=$+nt,st=1^tt,at=tt?_e-et:et-_e;this._x1===null?this._append`M${ot},${it}`:(Math.abs(this._x1-ot)>epsilon||Math.abs(this._y1-it)>epsilon)&&this._append`L${ot},${it}`,j&&(at<0&&(at=at%tau+tau),at>tauEpsilon?this._append`A${j},${j},0,1,${st},${_-rt},${$-nt}A${j},${j},0,1,${st},${this._x1=ot},${this._y1=it}`:at>epsilon&&this._append`A${j},${j},0,${+(at>=pi)},${st},${this._x1=_+j*Math.cos(et)},${this._y1=$+j*Math.sin(et)}`)}rect(_,$,j,_e){this._append`M${this._x0=this._x1=+_},${this._y0=this._y1=+$}h${j=+j}v${+_e}h${-j}Z`}toString(){return this._}}function withPath(o){let _=3;return o.digits=function($){if(!arguments.length)return _;if($==null)_=null;else{const j=Math.floor($);if(!(j>=0))throw new RangeError(`invalid digits: ${$}`);_=j}return o},()=>new Path(_)}function array(o){return typeof o=="object"&&"length"in o?o:Array.from(o)}function Linear(o){this._context=o}Linear.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(o,_){switch(o=+o,_=+_,this._point){case 0:this._point=1,this._line?this._context.lineTo(o,_):this._context.moveTo(o,_);break;case 1:this._point=2;default:this._context.lineTo(o,_);break}}};function curveLinear(o){return new Linear(o)}function x(o){return o[0]}function y(o){return o[1]}function shapeLine(o,_){var $=constant$1(!0),j=null,_e=curveLinear,et=null,tt=withPath(rt);o=typeof o=="function"?o:o===void 0?x:constant$1(o),_=typeof _=="function"?_:_===void 0?y:constant$1(_);function rt(nt){var ot,it=(nt=array(nt)).length,st,at=!1,lt;for(j==null&&(et=_e(lt=tt())),ot=0;ot<=it;++ot)!(ot=lt;--ct)rt.point(vt[ct],wt[ct]);rt.lineEnd(),rt.areaEnd()}pt&&(vt[at]=+o(dt,at,st),wt[at]=+_(dt,at,st),rt.point(j?+j(dt,at,st):vt[at],$?+$(dt,at,st):wt[at]))}if(yt)return rt=null,yt+""||null}function it(){return shapeLine().defined(_e).curve(tt).context(et)}return ot.x=function(st){return arguments.length?(o=typeof st=="function"?st:constant$1(+st),j=null,ot):o},ot.x0=function(st){return arguments.length?(o=typeof st=="function"?st:constant$1(+st),ot):o},ot.x1=function(st){return arguments.length?(j=st==null?null:typeof st=="function"?st:constant$1(+st),ot):j},ot.y=function(st){return arguments.length?(_=typeof st=="function"?st:constant$1(+st),$=null,ot):_},ot.y0=function(st){return arguments.length?(_=typeof st=="function"?st:constant$1(+st),ot):_},ot.y1=function(st){return arguments.length?($=st==null?null:typeof st=="function"?st:constant$1(+st),ot):$},ot.lineX0=ot.lineY0=function(){return it().x(o).y(_)},ot.lineY1=function(){return it().x(o).y($)},ot.lineX1=function(){return it().x(j).y(_)},ot.defined=function(st){return arguments.length?(_e=typeof st=="function"?st:constant$1(!!st),ot):_e},ot.curve=function(st){return arguments.length?(tt=st,et!=null&&(rt=tt(et)),ot):tt},ot.context=function(st){return arguments.length?(st==null?et=rt=null:rt=tt(et=st),ot):et},ot}class Bump{constructor(_,$){this._context=_,this._x=$}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(_,$){switch(_=+_,$=+$,this._point){case 0:{this._point=1,this._line?this._context.lineTo(_,$):this._context.moveTo(_,$);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+_)/2,this._y0,this._x0,$,_,$):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+$)/2,_,this._y0,_,$);break}}this._x0=_,this._y0=$}}function bumpX(o){return new Bump(o,!0)}function bumpY(o){return new Bump(o,!1)}const symbolCircle={draw(o,_){const $=sqrt$1(_/pi$1);o.moveTo($,0),o.arc(0,0,$,0,tau$1)}},symbolCross={draw(o,_){const $=sqrt$1(_/5)/2;o.moveTo(-3*$,-$),o.lineTo(-$,-$),o.lineTo(-$,-3*$),o.lineTo($,-3*$),o.lineTo($,-$),o.lineTo(3*$,-$),o.lineTo(3*$,$),o.lineTo($,$),o.lineTo($,3*$),o.lineTo(-$,3*$),o.lineTo(-$,$),o.lineTo(-3*$,$),o.closePath()}},tan30=sqrt$1(1/3),tan30_2=tan30*2,symbolDiamond={draw(o,_){const $=sqrt$1(_/tan30_2),j=$*tan30;o.moveTo(0,-$),o.lineTo(j,0),o.lineTo(0,$),o.lineTo(-j,0),o.closePath()}},symbolSquare={draw(o,_){const $=sqrt$1(_),j=-$/2;o.rect(j,j,$,$)}},ka=.8908130915292852,kr=sin(pi$1/10)/sin(7*pi$1/10),kx=sin(tau$1/10)*kr,ky=-cos(tau$1/10)*kr,symbolStar={draw(o,_){const $=sqrt$1(_*ka),j=kx*$,_e=ky*$;o.moveTo(0,-$),o.lineTo(j,_e);for(let et=1;et<5;++et){const tt=tau$1*et/5,rt=cos(tt),nt=sin(tt);o.lineTo(nt*$,-rt*$),o.lineTo(rt*j-nt*_e,nt*j+rt*_e)}o.closePath()}},sqrt3=sqrt$1(3),symbolTriangle={draw(o,_){const $=-sqrt$1(_/(sqrt3*3));o.moveTo(0,$*2),o.lineTo(-sqrt3*$,-$),o.lineTo(sqrt3*$,-$),o.closePath()}},c=-.5,s=sqrt$1(3)/2,k=1/sqrt$1(12),a=(k/2+1)*3,symbolWye={draw(o,_){const $=sqrt$1(_/a),j=$/2,_e=$*k,et=j,tt=$*k+$,rt=-et,nt=tt;o.moveTo(j,_e),o.lineTo(et,tt),o.lineTo(rt,nt),o.lineTo(c*j-s*_e,s*j+c*_e),o.lineTo(c*et-s*tt,s*et+c*tt),o.lineTo(c*rt-s*nt,s*rt+c*nt),o.lineTo(c*j+s*_e,c*_e-s*j),o.lineTo(c*et+s*tt,c*tt-s*et),o.lineTo(c*rt+s*nt,c*nt-s*rt),o.closePath()}};function Symbol$1(o,_){let $=null,j=withPath(_e);o=typeof o=="function"?o:constant$1(o||symbolCircle),_=typeof _=="function"?_:constant$1(_===void 0?64:+_);function _e(){let et;if($||($=et=j()),o.apply(this,arguments).draw($,+_.apply(this,arguments)),et)return $=null,et+""||null}return _e.type=function(et){return arguments.length?(o=typeof et=="function"?et:constant$1(et),_e):o},_e.size=function(et){return arguments.length?(_=typeof et=="function"?et:constant$1(+et),_e):_},_e.context=function(et){return arguments.length?($=et??null,_e):$},_e}function noop$3(){}function point$2(o,_,$){o._context.bezierCurveTo((2*o._x0+o._x1)/3,(2*o._y0+o._y1)/3,(o._x0+2*o._x1)/3,(o._y0+2*o._y1)/3,(o._x0+4*o._x1+_)/6,(o._y0+4*o._y1+$)/6)}function Basis(o){this._context=o}Basis.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:point$2(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(o,_){switch(o=+o,_=+_,this._point){case 0:this._point=1,this._line?this._context.lineTo(o,_):this._context.moveTo(o,_);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:point$2(this,o,_);break}this._x0=this._x1,this._x1=o,this._y0=this._y1,this._y1=_}};function curveBasis(o){return new Basis(o)}function BasisClosed(o){this._context=o}BasisClosed.prototype={areaStart:noop$3,areaEnd:noop$3,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(o,_){switch(o=+o,_=+_,this._point){case 0:this._point=1,this._x2=o,this._y2=_;break;case 1:this._point=2,this._x3=o,this._y3=_;break;case 2:this._point=3,this._x4=o,this._y4=_,this._context.moveTo((this._x0+4*this._x1+o)/6,(this._y0+4*this._y1+_)/6);break;default:point$2(this,o,_);break}this._x0=this._x1,this._x1=o,this._y0=this._y1,this._y1=_}};function curveBasisClosed(o){return new BasisClosed(o)}function BasisOpen(o){this._context=o}BasisOpen.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(o,_){switch(o=+o,_=+_,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var $=(this._x0+4*this._x1+o)/6,j=(this._y0+4*this._y1+_)/6;this._line?this._context.lineTo($,j):this._context.moveTo($,j);break;case 3:this._point=4;default:point$2(this,o,_);break}this._x0=this._x1,this._x1=o,this._y0=this._y1,this._y1=_}};function curveBasisOpen(o){return new BasisOpen(o)}function LinearClosed(o){this._context=o}LinearClosed.prototype={areaStart:noop$3,areaEnd:noop$3,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(o,_){o=+o,_=+_,this._point?this._context.lineTo(o,_):(this._point=1,this._context.moveTo(o,_))}};function curveLinearClosed(o){return new LinearClosed(o)}function sign(o){return o<0?-1:1}function slope3(o,_,$){var j=o._x1-o._x0,_e=_-o._x1,et=(o._y1-o._y0)/(j||_e<0&&-0),tt=($-o._y1)/(_e||j<0&&-0),rt=(et*_e+tt*j)/(j+_e);return(sign(et)+sign(tt))*Math.min(Math.abs(et),Math.abs(tt),.5*Math.abs(rt))||0}function slope2(o,_){var $=o._x1-o._x0;return $?(3*(o._y1-o._y0)/$-_)/2:_}function point$1(o,_,$){var j=o._x0,_e=o._y0,et=o._x1,tt=o._y1,rt=(et-j)/3;o._context.bezierCurveTo(j+rt,_e+rt*_,et-rt,tt-rt*$,et,tt)}function MonotoneX(o){this._context=o}MonotoneX.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:point$1(this,this._t0,slope2(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(o,_){var $=NaN;if(o=+o,_=+_,!(o===this._x1&&_===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(o,_):this._context.moveTo(o,_);break;case 1:this._point=2;break;case 2:this._point=3,point$1(this,slope2(this,$=slope3(this,o,_)),$);break;default:point$1(this,this._t0,$=slope3(this,o,_));break}this._x0=this._x1,this._x1=o,this._y0=this._y1,this._y1=_,this._t0=$}}};function MonotoneY(o){this._context=new ReflectContext(o)}(MonotoneY.prototype=Object.create(MonotoneX.prototype)).point=function(o,_){MonotoneX.prototype.point.call(this,_,o)};function ReflectContext(o){this._context=o}ReflectContext.prototype={moveTo:function(o,_){this._context.moveTo(_,o)},closePath:function(){this._context.closePath()},lineTo:function(o,_){this._context.lineTo(_,o)},bezierCurveTo:function(o,_,$,j,_e,et){this._context.bezierCurveTo(_,o,j,$,et,_e)}};function monotoneX(o){return new MonotoneX(o)}function monotoneY(o){return new MonotoneY(o)}function Natural(o){this._context=o}Natural.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var o=this._x,_=this._y,$=o.length;if($)if(this._line?this._context.lineTo(o[0],_[0]):this._context.moveTo(o[0],_[0]),$===2)this._context.lineTo(o[1],_[1]);else for(var j=controlPoints(o),_e=controlPoints(_),et=0,tt=1;tt<$;++et,++tt)this._context.bezierCurveTo(j[0][et],_e[0][et],j[1][et],_e[1][et],o[tt],_[tt]);(this._line||this._line!==0&&$===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(o,_){this._x.push(+o),this._y.push(+_)}};function controlPoints(o){var _,$=o.length-1,j,_e=new Array($),et=new Array($),tt=new Array($);for(_e[0]=0,et[0]=2,tt[0]=o[0]+2*o[1],_=1;_<$-1;++_)_e[_]=1,et[_]=4,tt[_]=4*o[_]+2*o[_+1];for(_e[$-1]=2,et[$-1]=7,tt[$-1]=8*o[$-1]+o[$],_=1;_<$;++_)j=_e[_]/et[_-1],et[_]-=j,tt[_]-=j*tt[_-1];for(_e[$-1]=tt[$-1]/et[$-1],_=$-2;_>=0;--_)_e[_]=(tt[_]-_e[_+1])/et[_];for(et[$-1]=(o[$]+_e[$-1])/2,_=0;_<$-1;++_)et[_]=2*o[_+1]-_e[_+1];return[_e,et]}function curveNatural(o){return new Natural(o)}function Step(o,_){this._context=o,this._t=_}Step.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(o,_){switch(o=+o,_=+_,this._point){case 0:this._point=1,this._line?this._context.lineTo(o,_):this._context.moveTo(o,_);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,_),this._context.lineTo(o,_);else{var $=this._x*(1-this._t)+o*this._t;this._context.lineTo($,this._y),this._context.lineTo($,_)}break}}this._x=o,this._y=_}};function curveStep(o){return new Step(o,.5)}function stepBefore(o){return new Step(o,0)}function stepAfter(o){return new Step(o,1)}function stackOffsetNone(o,_){if((tt=o.length)>1)for(var $=1,j,_e,et=o[_[0]],tt,rt=et.length;$=0;)$[_]=_;return $}function stackValue(o,_){return o[_]}function stackSeries(o){const _=[];return _.key=o,_}function shapeStack(){var o=constant$1([]),_=stackOrderNone,$=stackOffsetNone,j=stackValue;function _e(et){var tt=Array.from(o.apply(this,arguments),stackSeries),rt,nt=tt.length,ot=-1,it;for(const st of et)for(rt=0,++ot;rt0){for(var $,j,_e=0,et=o[0].length,tt;_e0){for(var $=0,j=o[_[0]],_e,et=j.length;$0)||!((et=(_e=o[_[0]]).length)>0))){for(var $=0,j=1,_e,et,tt;j1&&arguments[1]!==void 0?arguments[1]:defaultRoundPrecision,$=10**_,j=Math.round(o*$)/$;return Object.is(j,-0)?0:j}function roundTemplateLiteral(o){for(var _=arguments.length,$=new Array(_>1?_-1:0),j=1;j<_;j++)$[j-1]=arguments[j];return o.reduce((_e,et,tt)=>{var rt=$[tt-1];return typeof rt=="string"?_e+rt+et:rt!==void 0?_e+round$1(rt)+et:_e+et},"")}var mathSign=o=>o===0?0:o>0?1:-1,isNan=o=>typeof o=="number"&&o!=+o,isPercent=o=>typeof o=="string"&&o.indexOf("%")===o.length-1,isNumber=o=>(typeof o=="number"||o instanceof Number)&&!isNan(o),isNumOrStr=o=>isNumber(o)||typeof o=="string",idCounter=0,uniqueId=o=>{var _=++idCounter;return"".concat(o||"").concat(_)},getPercentValue=function o(_,$){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,_e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!isNumber(_)&&typeof _!="string")return j;var et;if(isPercent(_)){if($==null)return j;var tt=_.indexOf("%");et=$*parseFloat(_.slice(0,tt))/100}else et=+_;return isNan(et)&&(et=j),_e&&$!=null&&et>$&&(et=$),et},hasDuplicate=o=>{if(!Array.isArray(o))return!1;for(var _=o.length,$={},j=0;j<_;j++)if(!$[String(o[j])])$[String(o[j])]=!0;else return!0;return!1};function interpolate$1(o,_,$){return isNumber(o)&&isNumber(_)?round$1(o+$*(_-o)):_}function findEntryInArray(o,_,$){if(!(!o||!o.length))return o.find(j=>j&&(typeof _=="function"?_(j):get$2(j,_))===$)}var isNullish=o=>o===null||typeof o>"u",upperFirst=o=>isNullish(o)?o:"".concat(o.charAt(0).toUpperCase()).concat(o.slice(1));function isNotNil(o){return o!=null}function noop$2(){}var _excluded$c=["type","size","sizeType"];function _extends$h(){return _extends$h=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var _="symbol".concat(upperFirst(o));return symbolFactories[_]||symbolCircle},calculateAreaSize=(o,_,$)=>{if(_==="area")return o;switch($){case"cross":return 5*o*o/9;case"diamond":return .5*o*o/Math.sqrt(3);case"square":return o*o;case"star":{var j=18*RADIAN$1;return 1.25*o*o*(Math.tan(j)-Math.tan(j*2)*Math.tan(j)**2)}case"triangle":return Math.sqrt(3)*o*o/4;case"wye":return(21-10*Math.sqrt(3))*o*o/8;default:return Math.PI*o*o/4}},registerSymbol=(o,_)=>{symbolFactories["symbol".concat(upperFirst(o))]=_},Symbols=o=>{var{type:_="circle",size:$=64,sizeType:j="area"}=o,_e=_objectWithoutProperties$c(o,_excluded$c),et=_objectSpread$w(_objectSpread$w({},_e),{},{type:_,size:$,sizeType:j}),tt="circle";typeof _=="string"&&(tt=_);var rt=()=>{var at=getSymbolFactory(tt),lt=Symbol$1().type(at).size(calculateAreaSize($,j,tt)),ct=lt();if(ct!==null)return ct},{className:nt,cx:ot,cy:it}=et,st=svgPropertiesAndEvents(et);return isNumber(ot)&&isNumber(it)&&isNumber($)?reactExports.createElement("path",_extends$h({},st,{className:clsx("recharts-symbols",nt),transform:"translate(".concat(ot,", ").concat(it,")"),d:rt()})):null};Symbols.registerSymbol=registerSymbol;var isPolarCoordinate=o=>"radius"in o&&"startAngle"in o&&"endAngle"in o,adaptEventHandlers=(o,_)=>{if(!o||typeof o=="function"||typeof o=="boolean")return null;var $=o;if(reactExports.isValidElement(o)&&($=o.props),typeof $!="object"&&typeof $!="function")return null;var j={};return Object.keys($).forEach(_e=>{isEventKey(_e)&&(j[_e]=et=>$[_e]($,et))}),j};function ownKeys$v(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$v(o){for(var _=1;_(tt[rt]===void 0&&j[rt]!==void 0&&(tt[rt]=j[rt]),tt),$);return et}var uniqBy$3={},uniqBy$2={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($,j){const _e=new Map;for(let et=0;et<$.length;et++){const tt=$[et],rt=j(tt,et,$);_e.has(rt)||_e.set(rt,tt)}return Array.from(_e.values())}o.uniqBy=_})(uniqBy$2);var ary={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($,j){return function(..._e){return $.apply(this,_e.slice(0,j))}}o.ary=_})(ary);var identity$3={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return $}o.identity=_})(identity$3);var isArrayLikeObject={},isArrayLike={},isLength={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return Number.isSafeInteger($)&&$>=0}o.isLength=_})(isLength);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=isLength;function $(j){return j!=null&&typeof j!="function"&&_.isLength(j.length)}o.isArrayLike=$})(isArrayLike);var isObjectLike={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return typeof $=="object"&&$!==null}o.isObjectLike=_})(isObjectLike);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=isArrayLike,$=isObjectLike;function j(_e){return $.isObjectLike(_e)&&_.isArrayLike(_e)}o.isArrayLikeObject=j})(isArrayLikeObject);var iteratee={},property={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=get$3;function $(j){return function(_e){return _.get(_e,j)}}o.property=$})(property);var matches={},isMatch={},isMatchWith={},isObject={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return $!==null&&(typeof $=="object"||typeof $=="function")}o.isObject=_})(isObject);var isPrimitive={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return $==null||typeof $!="object"&&typeof $!="function"}o.isPrimitive=_})(isPrimitive);var isEqualsSameValueZero={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($,j){return $===j||Number.isNaN($)&&Number.isNaN(j)}o.isEqualsSameValueZero=_})(isEqualsSameValueZero);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=isObject,$=isPrimitive,j=isEqualsSameValueZero;function _e(it,st,at){return typeof at!="function"?_e(it,st,()=>{}):et(it,st,function lt(ct,ft,dt,pt,yt,vt){const wt=at(ct,ft,dt,pt,yt,vt);return wt!==void 0?!!wt:et(ct,ft,lt,vt)},new Map)}function et(it,st,at,lt){if(st===it)return!0;switch(typeof st){case"object":return tt(it,st,at,lt);case"function":return Object.keys(st).length>0?et(it,{...st},at,lt):j.isEqualsSameValueZero(it,st);default:return _.isObject(it)?typeof st=="string"?st==="":!0:j.isEqualsSameValueZero(it,st)}}function tt(it,st,at,lt){if(st==null)return!0;if(Array.isArray(st))return nt(it,st,at,lt);if(st instanceof Map)return rt(it,st,at,lt);if(st instanceof Set)return ot(it,st,at,lt);const ct=Object.keys(st);if(it==null||$.isPrimitive(it))return ct.length===0;if(ct.length===0)return!0;if(lt!=null&<.has(st))return lt.get(st)===it;lt==null||lt.set(st,it);try{for(let ft=0;ft{})}o.isMatch=$})(isMatch);var cloneDeep$1={},cloneDeepWith$1={},getSymbols={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return Object.getOwnPropertySymbols($).filter(j=>Object.prototype.propertyIsEnumerable.call($,j))}o.getSymbols=_})(getSymbols);var getTag={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return $==null?$===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call($)}o.getTag=_})(getTag);var tags={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _="[object RegExp]",$="[object String]",j="[object Number]",_e="[object Boolean]",et="[object Arguments]",tt="[object Symbol]",rt="[object Date]",nt="[object Map]",ot="[object Set]",it="[object Array]",st="[object Function]",at="[object ArrayBuffer]",lt="[object Object]",ct="[object Error]",ft="[object DataView]",dt="[object Uint8Array]",pt="[object Uint8ClampedArray]",yt="[object Uint16Array]",vt="[object Uint32Array]",wt="[object BigUint64Array]",Ct="[object Int8Array]",Pt="[object Int16Array]",Bt="[object Int32Array]",At="[object BigInt64Array]",kt="[object Float32Array]",Ot="[object Float64Array]";o.argumentsTag=et,o.arrayBufferTag=at,o.arrayTag=it,o.bigInt64ArrayTag=At,o.bigUint64ArrayTag=wt,o.booleanTag=_e,o.dataViewTag=ft,o.dateTag=rt,o.errorTag=ct,o.float32ArrayTag=kt,o.float64ArrayTag=Ot,o.functionTag=st,o.int16ArrayTag=Pt,o.int32ArrayTag=Bt,o.int8ArrayTag=Ct,o.mapTag=nt,o.numberTag=j,o.objectTag=lt,o.regexpTag=_,o.setTag=ot,o.stringTag=$,o.symbolTag=tt,o.uint16ArrayTag=yt,o.uint32ArrayTag=vt,o.uint8ArrayTag=dt,o.uint8ClampedArrayTag=pt})(tags);var isTypedArray={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return ArrayBuffer.isView($)&&!($ instanceof DataView)}o.isTypedArray=_})(isTypedArray);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=getSymbols,$=getTag,j=tags,_e=isPrimitive,et=isTypedArray;function tt(it,st){return rt(it,void 0,it,new Map,st)}function rt(it,st,at,lt=new Map,ct=void 0){const ft=ct==null?void 0:ct(it,st,at,lt);if(ft!==void 0)return ft;if(_e.isPrimitive(it))return it;if(lt.has(it))return lt.get(it);if(Array.isArray(it)){const dt=new Array(it.length);lt.set(it,dt);for(let pt=0;pt_.isMatch(et,_e)}o.matches=j})(matches);var matchesProperty={},cloneDeep={},cloneDeepWith={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=cloneDeepWith$1,$=getTag,j=tags;function _e(et,tt){return _.cloneDeepWith(et,(rt,nt,ot,it)=>{const st=tt==null?void 0:tt(rt,nt,ot,it);if(st!==void 0)return st;if(typeof et=="object"){if($.getTag(et)===j.objectTag&&typeof et.constructor!="function"){const at={};return it.set(et,at),_.copyProperties(at,et,ot,it),at}switch(Object.prototype.toString.call(et)){case j.numberTag:case j.stringTag:case j.booleanTag:{const at=new et.constructor(et==null?void 0:et.valueOf());return _.copyProperties(at,et),at}case j.argumentsTag:{const at={};return _.copyProperties(at,et),at.length=et.length,at[Symbol.iterator]=et[Symbol.iterator],at}default:return}}})}o.cloneDeepWith=_e})(cloneDeepWith);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=cloneDeepWith;function $(j){return _.cloneDeepWith(j)}o.cloneDeep=$})(cloneDeep);var has$2={},isIndex={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=/^(?:0|[1-9]\d*)$/;function $(j,_e=Number.MAX_SAFE_INTEGER){switch(typeof j){case"number":return Number.isInteger(j)&&j>=0&&j<_e;case"symbol":return!1;case"string":return _.test(j)}}o.isIndex=$})(isIndex);var isArguments={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=getTag;function $(j){return j!==null&&typeof j=="object"&&_.getTag(j)==="[object Arguments]"}o.isArguments=$})(isArguments);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=isDeepKey,$=isIndex,j=isArguments,_e=toPath;function et(tt,rt){let nt;if(Array.isArray(rt)?nt=rt:typeof rt=="string"&&_.isDeepKey(rt)&&(tt==null?void 0:tt[rt])==null?nt=_e.toPath(rt):nt=[rt],nt.length===0)return!1;let ot=tt;for(let it=0;it"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?useSyncExternalStore$1$1:useSyncExternalStore$2;useSyncExternalStoreShim_production.useSyncExternalStore=React$2.useSyncExternalStore!==void 0?React$2.useSyncExternalStore:shim$1;shim$2.exports=useSyncExternalStoreShim_production;var shimExports=shim$2.exports;/** - * @license React - * use-sync-external-store-shim/with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var React$1=reactExports,shim=shimExports;function is$4(o,_){return o===_&&(o!==0||1/o===1/_)||o!==o&&_!==_}var objectIs$1=typeof Object.is=="function"?Object.is:is$4,useSyncExternalStore$1=shim.useSyncExternalStore,useRef$1=React$1.useRef,useEffect$1=React$1.useEffect,useMemo$1=React$1.useMemo,useDebugValue$1=React$1.useDebugValue;withSelector_production.useSyncExternalStoreWithSelector=function(o,_,$,j,_e){var et=useRef$1(null);if(et.current===null){var tt={hasValue:!1,value:null};et.current=tt}else tt=et.current;et=useMemo$1(function(){function nt(lt){if(!ot){if(ot=!0,it=lt,lt=j(lt),_e!==void 0&&tt.hasValue){var ct=tt.value;if(_e(ct,lt))return st=ct}return st=lt}if(ct=st,objectIs$1(it,lt))return ct;var ft=j(lt);return _e!==void 0&&_e(ct,ft)?(it=lt,ct):(it=lt,st=ft)}var ot=!1,it,st,at=$===void 0?null:$;return[function(){return nt(_())},at===null?void 0:function(){return nt(at())}]},[_,$,j,_e]);var rt=useSyncExternalStore$1(o,et[0],et[1]);return useEffect$1(function(){tt.hasValue=!0,tt.value=rt},[rt]),useDebugValue$1(rt),rt};withSelector.exports=withSelector_production;var withSelectorExports=withSelector.exports,RechartsReduxContext=reactExports.createContext(null),noopDispatch=o=>o,useAppDispatch=()=>{var o=reactExports.useContext(RechartsReduxContext);return o?o.store.dispatch:noopDispatch},noop$1=()=>{},addNestedSubNoop=()=>noop$1,refEquality=(o,_)=>o===_;function useAppSelector(o){var _=reactExports.useContext(RechartsReduxContext),$=reactExports.useMemo(()=>_?j=>{if(j!=null)return o(j)}:noop$1,[_,o]);return withSelectorExports.useSyncExternalStoreWithSelector(_?_.subscription.addNestedSub:addNestedSubNoop,_?_.store.getState:noop$1,_?_.store.getState:noop$1,$,refEquality)}function assertIsFunction(o,_=`expected a function, instead received ${typeof o}`){if(typeof o!="function")throw new TypeError(_)}function assertIsObject(o,_=`expected an object, instead received ${typeof o}`){if(typeof o!="object")throw new TypeError(_)}function assertIsArrayOfFunctions(o,_="expected all items to be functions, instead received the following types: "){if(!o.every($=>typeof $=="function")){const $=o.map(j=>typeof j=="function"?`function ${j.name||"unnamed"}()`:typeof j).join(", ");throw new TypeError(`${_}[${$}]`)}}var ensureIsArray=o=>Array.isArray(o)?o:[o];function getDependencies(o){const _=Array.isArray(o[0])?o[0]:o;return assertIsArrayOfFunctions(_,"createSelector expects all input-selectors to be functions, but received the following types: "),_}function collectInputSelectorResults(o,_){const $=[],{length:j}=o;for(let _e=0;_e{$=createCacheNode(),tt.resetResultsCount()},tt.resultsCount=()=>et,tt.resetResultsCount=()=>{et=0},tt}function createSelectorCreator(o,..._){const $=typeof o=="function"?{memoize:o,memoizeOptions:_}:o,j=(..._e)=>{let et=0,tt=0,rt,nt={},ot=_e.pop();typeof ot=="object"&&(nt=ot,ot=_e.pop()),assertIsFunction(ot,`createSelector expects an output function after the inputs, but received: [${typeof ot}]`);const it={...$,...nt},{memoize:st,memoizeOptions:at=[],argsMemoize:lt=weakMapMemoize,argsMemoizeOptions:ct=[]}=it,ft=ensureIsArray(at),dt=ensureIsArray(ct),pt=getDependencies(_e),yt=st(function(){return et++,ot.apply(null,arguments)},...ft),vt=lt(function(){tt++;const Ct=collectInputSelectorResults(pt,arguments);return rt=yt.apply(null,Ct),rt},...dt);return Object.assign(vt,{resultFunc:ot,memoizedResultFunc:yt,dependencies:pt,dependencyRecomputations:()=>tt,resetDependencyRecomputations:()=>{tt=0},lastResult:()=>rt,recomputations:()=>et,resetRecomputations:()=>{et=0},memoize:st,argsMemoize:lt})};return Object.assign(j,{withTypes:()=>j}),j}var createSelector=createSelectorCreator(weakMapMemoize),createStructuredSelector=Object.assign((o,_=createSelector)=>{assertIsObject(o,`createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof o}`);const $=Object.keys(o),j=$.map(et=>o[et]);return _(j,(...et)=>et.reduce((tt,rt,nt)=>(tt[$[nt]]=rt,tt),{}))},{withTypes:()=>createStructuredSelector}),sortBy$2={},orderBy={},compareValues={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _(j){return typeof j=="symbol"?1:j===null?2:j===void 0?3:j!==j?4:0}const $=(j,_e,et)=>{if(j!==_e){const tt=_(j),rt=_(_e);if(tt===rt&&tt===0){if(j<_e)return et==="desc"?1:-1;if(j>_e)return et==="desc"?-1:1}return et==="desc"?rt-tt:tt-rt}return 0};o.compareValues=$})(compareValues);var isKey={},isSymbol={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return typeof $=="symbol"||$ instanceof Symbol}o.isSymbol=_})(isSymbol);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=isSymbol,$=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,j=/^\w*$/;function _e(et,tt){return Array.isArray(et)?!1:typeof et=="number"||typeof et=="boolean"||et==null||_.isSymbol(et)?!0:typeof et=="string"&&(j.test(et)||!$.test(et))||tt!=null&&Object.hasOwn(tt,et)}o.isKey=_e})(isKey);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=compareValues,$=isKey,j=toPath;function _e(et,tt,rt,nt){if(et==null)return[];rt=nt?void 0:rt,Array.isArray(et)||(et=Object.values(et)),Array.isArray(tt)||(tt=tt==null?[null]:[tt]),tt.length===0&&(tt=[null]),Array.isArray(rt)||(rt=rt==null?[]:[rt]),rt=rt.map(lt=>String(lt));const ot=(lt,ct)=>{let ft=lt;for(let dt=0;dtct==null||lt==null?ct:typeof lt=="object"&&"key"in lt?Object.hasOwn(ct,lt.key)?ct[lt.key]:ot(ct,lt.path):typeof lt=="function"?lt(ct):Array.isArray(lt)?ot(ct,lt):typeof ct=="object"?ct[lt]:ct,st=tt.map(lt=>(Array.isArray(lt)&<.length===1&&(lt=lt[0]),lt==null||typeof lt=="function"||Array.isArray(lt)||$.isKey(lt)?lt:{key:lt,path:j.toPath(lt)}));return et.map(lt=>({original:lt,criteria:st.map(ct=>it(ct,lt))})).slice().sort((lt,ct)=>{for(let ft=0;ftlt.original)}o.orderBy=_e})(orderBy);var flatten={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($,j=1){const _e=[],et=Math.floor(j),tt=(rt,nt)=>{for(let ot=0;ot1&&j.isIterateeCall(et,tt[0],tt[1])?tt=[]:rt>2&&j.isIterateeCall(tt[0],tt[1],tt[2])&&(tt=[tt[0]]),_.orderBy(et,$.flatten(tt),["asc"])}o.sortBy=_e})(sortBy$2);var sortBy=sortBy$2.sortBy;const sortBy$1=getDefaultExportFromCjs$1(sortBy);var selectLegendSettings=o=>o.legend.settings,selectLegendSize=o=>o.legend.size,selectAllLegendPayload2DArray=o=>o.legend.payload;createSelector([selectAllLegendPayload2DArray,selectLegendSettings],(o,_)=>{var{itemSorter:$}=_,j=o.flat(1);return $?sortBy$1(j,$):j});var EPS=1;function useElementOffset(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],[_,$]=reactExports.useState({height:0,left:0,top:0,width:0}),j=reactExports.useCallback(_e=>{if(_e!=null){var et=_e.getBoundingClientRect(),tt={height:et.height,left:et.left,top:et.top,width:et.width};(Math.abs(tt.height-_.height)>EPS||Math.abs(tt.left-_.left)>EPS||Math.abs(tt.top-_.top)>EPS||Math.abs(tt.width-_.width)>EPS)&&$({height:tt.height,left:tt.left,top:tt.top,width:tt.width})}},[_.width,_.height,_.top,_.left,...o]);return[_,j]}function formatProdErrorMessage$1(o){return`Minified Redux error #${o}; visit https://redux.js.org/Errors?code=${o} for the full message or use the non-minified dev environment for full errors. `}var $$observable=typeof Symbol=="function"&&Symbol.observable||"@@observable",symbol_observable_default=$$observable,randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$5(o){if(typeof o!="object"||o===null)return!1;let _=o;for(;Object.getPrototypeOf(_)!==null;)_=Object.getPrototypeOf(_);return Object.getPrototypeOf(o)===_||Object.getPrototypeOf(o)===null}function createStore(o,_,$){if(typeof o!="function")throw new Error(formatProdErrorMessage$1(2));if(typeof _=="function"&&typeof $=="function"||typeof $=="function"&&typeof arguments[3]=="function")throw new Error(formatProdErrorMessage$1(0));if(typeof _=="function"&&typeof $>"u"&&($=_,_=void 0),typeof $<"u"){if(typeof $!="function")throw new Error(formatProdErrorMessage$1(1));return $(createStore)(o,_)}let j=o,_e=_,et=new Map,tt=et,rt=0,nt=!1;function ot(){tt===et&&(tt=new Map,et.forEach((dt,pt)=>{tt.set(pt,dt)}))}function it(){if(nt)throw new Error(formatProdErrorMessage$1(3));return _e}function st(dt){if(typeof dt!="function")throw new Error(formatProdErrorMessage$1(4));if(nt)throw new Error(formatProdErrorMessage$1(5));let pt=!0;ot();const yt=rt++;return tt.set(yt,dt),function(){if(pt){if(nt)throw new Error(formatProdErrorMessage$1(6));pt=!1,ot(),tt.delete(yt),et=null}}}function at(dt){if(!isPlainObject$5(dt))throw new Error(formatProdErrorMessage$1(7));if(typeof dt.type>"u")throw new Error(formatProdErrorMessage$1(8));if(typeof dt.type!="string")throw new Error(formatProdErrorMessage$1(17));if(nt)throw new Error(formatProdErrorMessage$1(9));try{nt=!0,_e=j(_e,dt)}finally{nt=!1}return(et=tt).forEach(yt=>{yt()}),dt}function lt(dt){if(typeof dt!="function")throw new Error(formatProdErrorMessage$1(10));j=dt,at({type:actionTypes_default.REPLACE})}function ct(){const dt=st;return{subscribe(pt){if(typeof pt!="object"||pt===null)throw new Error(formatProdErrorMessage$1(11));function yt(){const wt=pt;wt.next&&wt.next(it())}return yt(),{unsubscribe:dt(yt)}},[symbol_observable_default](){return this}}}return at({type:actionTypes_default.INIT}),{dispatch:at,subscribe:st,getState:it,replaceReducer:lt,[symbol_observable_default]:ct}}function assertReducerShape(o){Object.keys(o).forEach(_=>{const $=o[_];if(typeof $(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(formatProdErrorMessage$1(12));if(typeof $(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(formatProdErrorMessage$1(13))})}function combineReducers(o){const _=Object.keys(o),$={};for(let et=0;et<_.length;et++){const tt=_[et];typeof o[tt]=="function"&&($[tt]=o[tt])}const j=Object.keys($);let _e;try{assertReducerShape($)}catch(et){_e=et}return function(tt={},rt){if(_e)throw _e;let nt=!1;const ot={};for(let it=0;it"u")throw rt&&rt.type,new Error(formatProdErrorMessage$1(14));ot[st]=ct,nt=nt||ct!==lt}return nt=nt||j.length!==Object.keys(tt).length,nt?ot:tt}}function compose(...o){return o.length===0?_=>_:o.length===1?o[0]:o.reduce((_,$)=>(...j)=>_($(...j)))}function applyMiddleware(...o){return _=>($,j)=>{const _e=_($,j);let et=()=>{throw new Error(formatProdErrorMessage$1(15))};const tt={getState:_e.getState,dispatch:(nt,...ot)=>et(nt,...ot)},rt=o.map(nt=>nt(tt));return et=compose(...rt)(_e.dispatch),{..._e,dispatch:et}}}function isAction(o){return isPlainObject$5(o)&&"type"in o&&typeof o.type=="string"}var NOTHING$1=Symbol.for("immer-nothing"),DRAFTABLE$1=Symbol.for("immer-draftable"),DRAFT_STATE$1=Symbol.for("immer-state");function die$1(o,..._){throw new Error(`[Immer] minified error nr: ${o}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object,getPrototypeOf$1=O.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft$1=o=>!!o&&!!o[DRAFT_STATE$1];function isDraftable$1(o){var _;return o?isPlainObject$4(o)||isArray(o)||!!o[DRAFTABLE$1]||!!((_=o[CONSTRUCTOR])!=null&&_[DRAFTABLE$1])||isMap$1(o)||isSet$1(o):!1}var objectCtorString$1=O[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings$1=new WeakMap;function isPlainObject$4(o){if(!o||!isObjectish(o))return!1;const _=getPrototypeOf$1(o);if(_===null||_===O[PROTOTYPE])return!0;const $=O.hasOwnProperty.call(_,CONSTRUCTOR)&&_[CONSTRUCTOR];if($===Object)return!0;if(!isFunction($))return!1;let j=cachedCtorStrings$1.get($);return j===void 0&&(j=Function.toString.call($),cachedCtorStrings$1.set($,j)),j===objectCtorString$1}function each$1(o,_,$=!0){getArchtype$1(o)===0?($?Reflect.ownKeys(o):O.keys(o)).forEach(_e=>{_(_e,o[_e],o)}):o.forEach((j,_e)=>_(_e,j,o))}function getArchtype$1(o){const _=o[DRAFT_STATE$1];return _?_.type_:isArray(o)?1:isMap$1(o)?2:isSet$1(o)?3:0}var has$1=(o,_,$=getArchtype$1(o))=>$===2?o.has(_):O[PROTOTYPE].hasOwnProperty.call(o,_),get=(o,_,$=getArchtype$1(o))=>$===2?o.get(_):o[_],set$1=(o,_,$,j=getArchtype$1(o))=>{j===2?o.set(_,$):j===3?o.add($):o[_]=$};function is$3(o,_){return o===_?o!==0||1/o===1/_:o!==o&&_!==_}var isArray=Array.isArray,isMap$1=o=>o instanceof Map,isSet$1=o=>o instanceof Set,isObjectish=o=>typeof o=="object",isFunction=o=>typeof o=="function",isBoolean$1=o=>typeof o=="boolean";function isArrayIndex(o){const _=+o;return Number.isInteger(_)&&String(_)===o}var latest$1=o=>o.copy_||o.base_,getFinalValue=o=>o.modified_?o.copy_:o.base_;function shallowCopy$1(o,_){if(isMap$1(o))return new Map(o);if(isSet$1(o))return new Set(o);if(isArray(o))return Array[PROTOTYPE].slice.call(o);const $=isPlainObject$4(o);if(_===!0||_==="class_only"&&!$){const j=O.getOwnPropertyDescriptors(o);delete j[DRAFT_STATE$1];let _e=Reflect.ownKeys(j);for(let et=0;et<_e.length;et++){const tt=_e[et],rt=j[tt];rt[WRITABLE]===!1&&(rt[WRITABLE]=!0,rt[CONFIGURABLE]=!0),(rt.get||rt.set)&&(j[tt]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:rt[ENUMERABLE],[VALUE]:o[tt]})}return O.create(getPrototypeOf$1(o),j)}else{const j=getPrototypeOf$1(o);if(j!==null&&$)return{...o};const _e=O.create(j);return O.assign(_e,o)}}function freeze$1(o,_=!1){return isFrozen$1(o)||isDraft$1(o)||!isDraftable$1(o)||(getArchtype$1(o)>1&&O.defineProperties(o,{set:dontMutateMethodOverride$1,add:dontMutateMethodOverride$1,clear:dontMutateMethodOverride$1,delete:dontMutateMethodOverride$1}),O.freeze(o),_&&each$1(o,($,j)=>{freeze$1(j,!0)},!1)),o}function dontMutateFrozenCollections$1(){die$1(2)}var dontMutateMethodOverride$1={[VALUE]:dontMutateFrozenCollections$1};function isFrozen$1(o){return o===null||!isObjectish(o)?!0:O.isFrozen(o)}var PluginMapSet="MapSet",PluginPatches="Patches",PluginArrayMethods="ArrayMethods",plugins$1={};function getPlugin$1(o){const _=plugins$1[o];return _||die$1(0,o),_}var isPluginLoaded=o=>!!plugins$1[o],currentScope$1,getCurrentScope$1=()=>currentScope$1,createScope$1=(o,_)=>({drafts_:[],parent_:o,immer_:_,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin$1(PluginMapSet):void 0,arrayMethodsPlugin_:isPluginLoaded(PluginArrayMethods)?getPlugin$1(PluginArrayMethods):void 0});function usePatchesInScope$1(o,_){_&&(o.patchPlugin_=getPlugin$1(PluginPatches),o.patches_=[],o.inversePatches_=[],o.patchListener_=_)}function revokeScope$1(o){leaveScope$1(o),o.drafts_.forEach(revokeDraft$1),o.drafts_=null}function leaveScope$1(o){o===currentScope$1&&(currentScope$1=o.parent_)}var enterScope$1=o=>currentScope$1=createScope$1(currentScope$1,o);function revokeDraft$1(o){const _=o[DRAFT_STATE$1];_.type_===0||_.type_===1?_.revoke_():_.revoked_=!0}function processResult$1(o,_){_.unfinalizedDrafts_=_.drafts_.length;const $=_.drafts_[0];if(o!==void 0&&o!==$){$[DRAFT_STATE$1].modified_&&(revokeScope$1(_),die$1(4)),isDraftable$1(o)&&(o=finalize$1(_,o));const{patchPlugin_:_e}=_;_e&&_e.generateReplacementPatches_($[DRAFT_STATE$1].base_,o,_)}else o=finalize$1(_,$);return maybeFreeze$1(_,o,!0),revokeScope$1(_),_.patches_&&_.patchListener_(_.patches_,_.inversePatches_),o!==NOTHING$1?o:void 0}function finalize$1(o,_){if(isFrozen$1(_))return _;const $=_[DRAFT_STATE$1];if(!$)return handleValue(_,o.handledSet_,o);if(!isSameScope($,o))return _;if(!$.modified_)return $.base_;if(!$.finalized_){const{callbacks_:j}=$;if(j)for(;j.length>0;)j.pop()(o);generatePatchesAndFinalize($,o)}return $.copy_}function maybeFreeze$1(o,_,$=!1){!o.parent_&&o.immer_.autoFreeze_&&o.canAutoFreeze_&&freeze$1(_,$)}function markStateFinalized(o){o.finalized_=!0,o.scope_.unfinalizedDrafts_--}var isSameScope=(o,_)=>o.scope_===_,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(o,_,$,j){const _e=latest$1(o),et=o.type_;if(j!==void 0&&get(_e,j,et)===_){set$1(_e,j,$,et);return}if(!o.draftLocations_){const rt=o.draftLocations_=new Map;each$1(_e,(nt,ot)=>{if(isDraft$1(ot)){const it=rt.get(ot)||[];it.push(nt),rt.set(ot,it)}})}const tt=o.draftLocations_.get(_)??EMPTY_LOCATIONS_RESULT;for(const rt of tt)set$1(_e,rt,$,et)}function registerChildFinalizationCallback(o,_,$){o.callbacks_.push(function(_e){var rt;const et=_;if(!et||!isSameScope(et,_e))return;(rt=_e.mapSetPlugin_)==null||rt.fixSetContents(et);const tt=getFinalValue(et);updateDraftInParent(o,et.draft_??et,tt,$),generatePatchesAndFinalize(et,_e)})}function generatePatchesAndFinalize(o,_){var j;if(o.modified_&&!o.finalized_&&(o.type_===3||o.type_===1&&o.allIndicesReassigned_||(((j=o.assigned_)==null?void 0:j.size)??0)>0)){const{patchPlugin_:_e}=_;if(_e){const et=_e.getPath(o);et&&_e.generatePatches_(o,et,_)}markStateFinalized(o)}}function handleCrossReference(o,_,$){const{scope_:j}=o;if(isDraft$1($)){const _e=$[DRAFT_STATE$1];isSameScope(_e,j)&&_e.callbacks_.push(function(){prepareCopy$1(o);const tt=getFinalValue(_e);updateDraftInParent(o,$,tt,_)})}else isDraftable$1($)&&o.callbacks_.push(function(){const et=latest$1(o);o.type_===3?et.has($)&&handleValue($,j.handledSet_,j):get(et,_,o.type_)===$&&j.drafts_.length>1&&(o.assigned_.get(_)??!1)===!0&&o.copy_&&handleValue(get(o.copy_,_,o.type_),j.handledSet_,j)})}function handleValue(o,_,$){return!$.immer_.autoFreeze_&&$.unfinalizedDrafts_<1||isDraft$1(o)||_.has(o)||!isDraftable$1(o)||isFrozen$1(o)||(_.add(o),each$1(o,(j,_e)=>{if(isDraft$1(_e)){const et=_e[DRAFT_STATE$1];if(isSameScope(et,$)){const tt=getFinalValue(et);set$1(o,j,tt,o.type_),markStateFinalized(et)}}else isDraftable$1(_e)&&handleValue(_e,_,$)})),o}function createProxyProxy$1(o,_){const $=isArray(o),j={type_:$?1:0,scope_:_?_.scope_:getCurrentScope$1(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:_,base_:o,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let _e=j,et=objectTraps$1;$&&(_e=[j],et=arrayTraps$1);const{revoke:tt,proxy:rt}=Proxy.revocable(_e,et);return j.draft_=rt,j.revoke_=tt,[rt,j]}var objectTraps$1={get(o,_){if(_===DRAFT_STATE$1)return o;let $=o.scope_.arrayMethodsPlugin_;const j=o.type_===1&&typeof _=="string";if(j&&$!=null&&$.isArrayOperationMethod(_))return $.createMethodInterceptor(o,_);const _e=latest$1(o);if(!has$1(_e,_,o.type_))return readPropFromProto$1(o,_e,_);const et=_e[_];if(o.finalized_||!isDraftable$1(et)||j&&o.operationMethod&&($!=null&&$.isMutatingArrayMethod(o.operationMethod))&&isArrayIndex(_))return et;if(et===peek$1(o.base_,_)){prepareCopy$1(o);const tt=o.type_===1?+_:_,rt=createProxy$1(o.scope_,et,o,tt);return o.copy_[tt]=rt}return et},has(o,_){return _ in latest$1(o)},ownKeys(o){return Reflect.ownKeys(latest$1(o))},set(o,_,$){const j=getDescriptorFromProto$1(latest$1(o),_);if(j!=null&&j.set)return j.set.call(o.draft_,$),!0;if(!o.modified_){const _e=peek$1(latest$1(o),_),et=_e==null?void 0:_e[DRAFT_STATE$1];if(et&&et.base_===$)return o.copy_[_]=$,o.assigned_.set(_,!1),!0;if(is$3($,_e)&&($!==void 0||has$1(o.base_,_,o.type_)))return!0;prepareCopy$1(o),markChanged$1(o)}return o.copy_[_]===$&&($!==void 0||_ in o.copy_)||Number.isNaN($)&&Number.isNaN(o.copy_[_])||(o.copy_[_]=$,o.assigned_.set(_,!0),handleCrossReference(o,_,$)),!0},deleteProperty(o,_){return prepareCopy$1(o),peek$1(o.base_,_)!==void 0||_ in o.base_?(o.assigned_.set(_,!1),markChanged$1(o)):o.assigned_.delete(_),o.copy_&&delete o.copy_[_],!0},getOwnPropertyDescriptor(o,_){const $=latest$1(o),j=Reflect.getOwnPropertyDescriptor($,_);return j&&{[WRITABLE]:!0,[CONFIGURABLE]:o.type_!==1||_!=="length",[ENUMERABLE]:j[ENUMERABLE],[VALUE]:$[_]}},defineProperty(){die$1(11)},getPrototypeOf(o){return getPrototypeOf$1(o.base_)},setPrototypeOf(){die$1(12)}},arrayTraps$1={};for(let o in objectTraps$1){let _=objectTraps$1[o];arrayTraps$1[o]=function(){const $=arguments;return $[0]=$[0][0],_.apply(this,$)}}arrayTraps$1.deleteProperty=function(o,_){return arrayTraps$1.set.call(this,o,_,void 0)};arrayTraps$1.set=function(o,_,$){return objectTraps$1.set.call(this,o[0],_,$,o[0])};function peek$1(o,_){const $=o[DRAFT_STATE$1];return($?latest$1($):o)[_]}function readPropFromProto$1(o,_,$){var _e;const j=getDescriptorFromProto$1(_,$);return j?VALUE in j?j[VALUE]:(_e=j.get)==null?void 0:_e.call(o.draft_):void 0}function getDescriptorFromProto$1(o,_){if(!(_ in o))return;let $=getPrototypeOf$1(o);for(;$;){const j=Object.getOwnPropertyDescriptor($,_);if(j)return j;$=getPrototypeOf$1($)}}function markChanged$1(o){o.modified_||(o.modified_=!0,o.parent_&&markChanged$1(o.parent_))}function prepareCopy$1(o){o.copy_||(o.assigned_=new Map,o.copy_=shallowCopy$1(o.base_,o.scope_.immer_.useStrictShallowCopy_))}var Immer2$1=class{constructor(_){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=($,j,_e)=>{if(isFunction($)&&!isFunction(j)){const tt=j;j=$;const rt=this;return function(ot=tt,...it){return rt.produce(ot,st=>j.call(this,st,...it))}}isFunction(j)||die$1(6),_e!==void 0&&!isFunction(_e)&&die$1(7);let et;if(isDraftable$1($)){const tt=enterScope$1(this),rt=createProxy$1(tt,$,void 0);let nt=!0;try{et=j(rt),nt=!1}finally{nt?revokeScope$1(tt):leaveScope$1(tt)}return usePatchesInScope$1(tt,_e),processResult$1(et,tt)}else if(!$||!isObjectish($)){if(et=j($),et===void 0&&(et=$),et===NOTHING$1&&(et=void 0),this.autoFreeze_&&freeze$1(et,!0),_e){const tt=[],rt=[];getPlugin$1(PluginPatches).generateReplacementPatches_($,et,{patches_:tt,inversePatches_:rt}),_e(tt,rt)}return et}else die$1(1,$)},this.produceWithPatches=($,j)=>{if(isFunction($))return(rt,...nt)=>this.produceWithPatches(rt,ot=>$(ot,...nt));let _e,et;return[this.produce($,j,(rt,nt)=>{_e=rt,et=nt}),_e,et]},isBoolean$1(_==null?void 0:_.autoFreeze)&&this.setAutoFreeze(_.autoFreeze),isBoolean$1(_==null?void 0:_.useStrictShallowCopy)&&this.setUseStrictShallowCopy(_.useStrictShallowCopy),isBoolean$1(_==null?void 0:_.useStrictIteration)&&this.setUseStrictIteration(_.useStrictIteration)}createDraft(_){isDraftable$1(_)||die$1(8),isDraft$1(_)&&(_=current$1(_));const $=enterScope$1(this),j=createProxy$1($,_,void 0);return j[DRAFT_STATE$1].isManual_=!0,leaveScope$1($),j}finishDraft(_,$){const j=_&&_[DRAFT_STATE$1];(!j||!j.isManual_)&&die$1(9);const{scope_:_e}=j;return usePatchesInScope$1(_e,$),processResult$1(void 0,_e)}setAutoFreeze(_){this.autoFreeze_=_}setUseStrictShallowCopy(_){this.useStrictShallowCopy_=_}setUseStrictIteration(_){this.useStrictIteration_=_}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(_,$){let j;for(j=$.length-1;j>=0;j--){const et=$[j];if(et.path.length===0&&et.op==="replace"){_=et.value;break}}j>-1&&($=$.slice(j+1));const _e=getPlugin$1(PluginPatches).applyPatches_;return isDraft$1(_)?_e(_,$):this.produce(_,et=>_e(et,$))}};function createProxy$1(o,_,$,j){const[_e,et]=isMap$1(_)?getPlugin$1(PluginMapSet).proxyMap_(_,$):isSet$1(_)?getPlugin$1(PluginMapSet).proxySet_(_,$):createProxyProxy$1(_,$);return(($==null?void 0:$.scope_)??getCurrentScope$1()).drafts_.push(_e),et.callbacks_=($==null?void 0:$.callbacks_)??[],et.key_=j,$&&j!==void 0?registerChildFinalizationCallback($,et,j):et.callbacks_.push(function(nt){var it;(it=nt.mapSetPlugin_)==null||it.fixSetContents(et);const{patchPlugin_:ot}=nt;et.modified_&&ot&&ot.generatePatches_(et,[],nt)}),_e}function current$1(o){return isDraft$1(o)||die$1(10,o),currentImpl$1(o)}function currentImpl$1(o){if(!isDraftable$1(o)||isFrozen$1(o))return o;const _=o[DRAFT_STATE$1];let $,j=!0;if(_){if(!_.modified_)return _.base_;_.finalized_=!0,$=shallowCopy$1(o,_.scope_.immer_.useStrictShallowCopy_),j=_.scope_.immer_.shouldUseStrictIteration()}else $=shallowCopy$1(o,!0);return each$1($,(_e,et)=>{set$1($,_e,currentImpl$1(et))},j),_&&(_.finalized_=!1),$}var immer$1=new Immer2$1,produce=immer$1.produce;function createThunkMiddleware(o){return({dispatch:$,getState:j})=>_e=>et=>typeof et=="function"?et($,j,o):_e(et)}var thunk=createThunkMiddleware(),withExtraArgument=createThunkMiddleware,composeWithDevTools=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?compose:compose.apply(null,arguments)};function createAction(o,_){function $(...j){if(_){let _e=_(...j);if(!_e)throw new Error(formatProdErrorMessage(0));return{type:o,payload:_e.payload,..."meta"in _e&&{meta:_e.meta},..."error"in _e&&{error:_e.error}}}return{type:o,payload:j[0]}}return $.toString=()=>`${o}`,$.type=o,$.match=j=>isAction(j)&&j.type===o,$}var Tuple=class _n extends Array{constructor(..._){super(..._),Object.setPrototypeOf(this,_n.prototype)}static get[Symbol.species](){return _n}concat(..._){return super.concat.apply(this,_)}prepend(..._){return _.length===1&&Array.isArray(_[0])?new _n(..._[0].concat(this)):new _n(..._.concat(this))}};function freezeDraftable(o){return isDraftable$1(o)?produce(o,()=>{}):o}function getOrInsertComputed(o,_,$){return o.has(_)?o.get(_):o.set(_,$(_)).get(_)}function isBoolean(o){return typeof o=="boolean"}var buildGetDefaultMiddleware=()=>function(_){const{thunk:$=!0,immutableCheck:j=!0,serializableCheck:_e=!0,actionCreatorCheck:et=!0}=_??{};let tt=new Tuple;return $&&(isBoolean($)?tt.push(thunk):tt.push(withExtraArgument($.extraArgument))),tt},SHOULD_AUTOBATCH="RTK_autoBatch",prepareAutoBatched=()=>o=>({payload:o,meta:{[SHOULD_AUTOBATCH]:!0}}),createQueueWithTimer=o=>_=>{setTimeout(_,o)},autoBatchEnhancer=(o={type:"raf"})=>_=>(...$)=>{const j=_(...$);let _e=!0,et=!1,tt=!1;const rt=new Set,nt=o.type==="tick"?queueMicrotask:o.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?window.requestAnimationFrame:createQueueWithTimer(10):o.type==="callback"?o.queueNotification:createQueueWithTimer(o.timeout),ot=()=>{tt=!1,et&&(et=!1,rt.forEach(it=>it()))};return Object.assign({},j,{subscribe(it){const st=()=>_e&&it(),at=j.subscribe(st);return rt.add(it),()=>{at(),rt.delete(it)}},dispatch(it){var st;try{return _e=!((st=it==null?void 0:it.meta)!=null&&st[SHOULD_AUTOBATCH]),et=!_e,et&&(tt||(tt=!0,nt(ot))),j.dispatch(it)}finally{_e=!0}}})},buildGetDefaultEnhancers=o=>function($){const{autoBatch:j=!0}=$??{};let _e=new Tuple(o);return j&&_e.push(autoBatchEnhancer(typeof j=="object"?j:void 0)),_e};function configureStore(o){const _=buildGetDefaultMiddleware(),{reducer:$=void 0,middleware:j,devTools:_e=!0,preloadedState:et=void 0,enhancers:tt=void 0}=o||{};let rt;if(typeof $=="function")rt=$;else if(isPlainObject$5($))rt=combineReducers($);else throw new Error(formatProdErrorMessage(1));let nt;typeof j=="function"?nt=j(_):nt=_();let ot=compose;_e&&(ot=composeWithDevTools({trace:!1,...typeof _e=="object"&&_e}));const it=applyMiddleware(...nt),st=buildGetDefaultEnhancers(it);let at=typeof tt=="function"?tt(st):st();const lt=ot(...at);return createStore(rt,et,lt)}function executeReducerBuilderCallback(o){const _={},$=[];let j;const _e={addCase(et,tt){const rt=typeof et=="string"?et:et.type;if(!rt)throw new Error(formatProdErrorMessage(28));if(rt in _)throw new Error(formatProdErrorMessage(29));return _[rt]=tt,_e},addAsyncThunk(et,tt){return tt.pending&&(_[et.pending.type]=tt.pending),tt.rejected&&(_[et.rejected.type]=tt.rejected),tt.fulfilled&&(_[et.fulfilled.type]=tt.fulfilled),tt.settled&&$.push({matcher:et.settled,reducer:tt.settled}),_e},addMatcher(et,tt){return $.push({matcher:et,reducer:tt}),_e},addDefaultCase(et){return j=et,_e}};return o(_e),[_,$,j]}function isStateFunction(o){return typeof o=="function"}function createReducer(o,_){let[$,j,_e]=executeReducerBuilderCallback(_),et;if(isStateFunction(o))et=()=>freezeDraftable(o());else{const rt=freezeDraftable(o);et=()=>rt}function tt(rt=et(),nt){let ot=[$[nt.type],...j.filter(({matcher:it})=>it(nt)).map(({reducer:it})=>it)];return ot.filter(it=>!!it).length===0&&(ot=[_e]),ot.reduce((it,st)=>{if(st)if(isDraft$1(it)){const lt=st(it,nt);return lt===void 0?it:lt}else{if(isDraftable$1(it))return produce(it,at=>st(at,nt));{const at=st(it,nt);if(at===void 0){if(it===null)return it;throw Error("A case reducer on a non-draftable value must not return undefined")}return at}}return it},rt)}return tt.getInitialState=et,tt}var urlAlphabet="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",nanoid=(o=21)=>{let _="",$=o;for(;$--;)_+=urlAlphabet[Math.random()*64|0];return _},asyncThunkSymbol=Symbol.for("rtk-slice-createasyncthunk");function getType(o,_){return`${o}/${_}`}function buildCreateSlice({creators:o}={}){var $;const _=($=o==null?void 0:o.asyncThunk)==null?void 0:$[asyncThunkSymbol];return function(_e){const{name:et,reducerPath:tt=et}=_e;if(!et)throw new Error(formatProdErrorMessage(11));typeof process$1$1<"u";const rt=(typeof _e.reducers=="function"?_e.reducers(buildReducerCreators()):_e.reducers)||{},nt=Object.keys(rt),ot={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},it={addCase(wt,Ct){const Pt=typeof wt=="string"?wt:wt.type;if(!Pt)throw new Error(formatProdErrorMessage(12));if(Pt in ot.sliceCaseReducersByType)throw new Error(formatProdErrorMessage(13));return ot.sliceCaseReducersByType[Pt]=Ct,it},addMatcher(wt,Ct){return ot.sliceMatchers.push({matcher:wt,reducer:Ct}),it},exposeAction(wt,Ct){return ot.actionCreators[wt]=Ct,it},exposeCaseReducer(wt,Ct){return ot.sliceCaseReducersByName[wt]=Ct,it}};nt.forEach(wt=>{const Ct=rt[wt],Pt={reducerName:wt,type:getType(et,wt),createNotation:typeof _e.reducers=="function"};isAsyncThunkSliceReducerDefinition(Ct)?handleThunkCaseReducerDefinition(Pt,Ct,it,_):handleNormalReducerDefinition(Pt,Ct,it)});function st(){const[wt={},Ct=[],Pt=void 0]=typeof _e.extraReducers=="function"?executeReducerBuilderCallback(_e.extraReducers):[_e.extraReducers],Bt={...wt,...ot.sliceCaseReducersByType};return createReducer(_e.initialState,At=>{for(let kt in Bt)At.addCase(kt,Bt[kt]);for(let kt of ot.sliceMatchers)At.addMatcher(kt.matcher,kt.reducer);for(let kt of Ct)At.addMatcher(kt.matcher,kt.reducer);Pt&&At.addDefaultCase(Pt)})}const at=wt=>wt,lt=new Map,ct=new WeakMap;let ft;function dt(wt,Ct){return ft||(ft=st()),ft(wt,Ct)}function pt(){return ft||(ft=st()),ft.getInitialState()}function yt(wt,Ct=!1){function Pt(At){let kt=At[wt];return typeof kt>"u"&&Ct&&(kt=getOrInsertComputed(ct,Pt,pt)),kt}function Bt(At=at){const kt=getOrInsertComputed(lt,Ct,()=>new WeakMap);return getOrInsertComputed(kt,At,()=>{const Ot={};for(const[Tt,ht]of Object.entries(_e.selectors??{}))Ot[Tt]=wrapSelector(ht,At,()=>getOrInsertComputed(ct,At,pt),Ct);return Ot})}return{reducerPath:wt,getSelectors:Bt,get selectors(){return Bt(Pt)},selectSlice:Pt}}const vt={name:et,reducer:dt,actions:ot.actionCreators,caseReducers:ot.sliceCaseReducersByName,getInitialState:pt,...yt(tt),injectInto(wt,{reducerPath:Ct,...Pt}={}){const Bt=Ct??tt;return wt.inject({reducerPath:Bt,reducer:dt},Pt),{...vt,...yt(Bt,!0)}}};return vt}}function wrapSelector(o,_,$,j){function _e(et,...tt){let rt=_(et);return typeof rt>"u"&&j&&(rt=$()),o(rt,...tt)}return _e.unwrapped=o,_e}var createSlice=buildCreateSlice();function buildReducerCreators(){function o(_,$){return{_reducerDefinitionType:"asyncThunk",payloadCreator:_,...$}}return o.withTypes=()=>o,{reducer(_){return Object.assign({[_.name](...$){return _(...$)}}[_.name],{_reducerDefinitionType:"reducer"})},preparedReducer(_,$){return{_reducerDefinitionType:"reducerWithPrepare",prepare:_,reducer:$}},asyncThunk:o}}function handleNormalReducerDefinition({type:o,reducerName:_,createNotation:$},j,_e){let et,tt;if("reducer"in j){if($&&!isCaseReducerWithPrepareDefinition(j))throw new Error(formatProdErrorMessage(17));et=j.reducer,tt=j.prepare}else et=j;_e.addCase(o,et).exposeCaseReducer(_,et).exposeAction(_,tt?createAction(o,tt):createAction(o))}function isAsyncThunkSliceReducerDefinition(o){return o._reducerDefinitionType==="asyncThunk"}function isCaseReducerWithPrepareDefinition(o){return o._reducerDefinitionType==="reducerWithPrepare"}function handleThunkCaseReducerDefinition({type:o,reducerName:_},$,j,_e){if(!_e)throw new Error(formatProdErrorMessage(18));const{payloadCreator:et,fulfilled:tt,pending:rt,rejected:nt,settled:ot,options:it}=$,st=_e(o,et,it);j.exposeAction(_,st),tt&&j.addCase(st.fulfilled,tt),rt&&j.addCase(st.pending,rt),nt&&j.addCase(st.rejected,nt),ot&&j.addMatcher(st.settled,ot),j.exposeCaseReducer(_,{fulfilled:tt||noop,pending:rt||noop,rejected:nt||noop,settled:ot||noop})}function noop(){}var task="task",listener="listener",completed="completed",cancelled="cancelled",taskCancelled=`task-${cancelled}`,taskCompleted=`task-${completed}`,listenerCancelled=`${listener}-${cancelled}`,listenerCompleted=`${listener}-${completed}`,TaskAbortError=class{constructor(o){vn(this,"name","TaskAbortError");vn(this,"message");this.code=o,this.message=`${task} ${cancelled} (reason: ${o})`}},assertFunction=(o,_)=>{if(typeof o!="function")throw new TypeError(formatProdErrorMessage(32))},noop2=()=>{},catchRejection=(o,_=noop2)=>(o.catch(_),o),addAbortSignalListener=(o,_)=>(o.addEventListener("abort",_,{once:!0}),()=>o.removeEventListener("abort",_)),validateActive=o=>{if(o.aborted)throw new TaskAbortError(o.reason)};function raceWithSignal(o,_){let $=noop2;return new Promise((j,_e)=>{const et=()=>_e(new TaskAbortError(o.reason));if(o.aborted){et();return}$=addAbortSignalListener(o,et),_.finally(()=>$()).then(j,_e)}).finally(()=>{$=noop2})}var runTask=async(o,_)=>{try{return await Promise.resolve(),{status:"ok",value:await o()}}catch($){return{status:$ instanceof TaskAbortError?"cancelled":"rejected",error:$}}finally{_==null||_()}},createPause=o=>_=>catchRejection(raceWithSignal(o,_).then($=>(validateActive(o),$))),createDelay=o=>{const _=createPause(o);return $=>_(new Promise(j=>setTimeout(j,$)))},{assign}=Object,INTERNAL_NIL_TOKEN={},alm="listenerMiddleware",createFork=(o,_)=>{const $=j=>addAbortSignalListener(o,()=>j.abort(o.reason));return(j,_e)=>{assertFunction(j);const et=new AbortController;$(et);const tt=runTask(async()=>{validateActive(o),validateActive(et.signal);const rt=await j({pause:createPause(et.signal),delay:createDelay(et.signal),signal:et.signal});return validateActive(et.signal),rt},()=>et.abort(taskCompleted));return _e!=null&&_e.autoJoin&&_.push(tt.catch(noop2)),{result:createPause(o)(tt),cancel(){et.abort(taskCancelled)}}}},createTakePattern=(o,_)=>{const $=async(j,_e)=>{validateActive(_);let et=()=>{};const rt=[new Promise((nt,ot)=>{let it=o({predicate:j,effect:(st,at)=>{at.unsubscribe(),nt([st,at.getState(),at.getOriginalState()])}});et=()=>{it(),ot()}})];_e!=null&&rt.push(new Promise(nt=>setTimeout(nt,_e,null)));try{const nt=await raceWithSignal(_,Promise.race(rt));return validateActive(_),nt}finally{et()}};return(j,_e)=>catchRejection($(j,_e))},getListenerEntryPropsFrom=o=>{let{type:_,actionCreator:$,matcher:j,predicate:_e,effect:et}=o;if(_)_e=createAction(_).match;else if($)_=$.type,_e=$.match;else if(j)_e=j;else if(!_e)throw new Error(formatProdErrorMessage(21));return assertFunction(et),{predicate:_e,type:_,effect:et}},createListenerEntry=assign(o=>{const{type:_,predicate:$,effect:j}=getListenerEntryPropsFrom(o);return{id:nanoid(),effect:j,type:_,predicate:$,pending:new Set,unsubscribe:()=>{throw new Error(formatProdErrorMessage(22))}}},{withTypes:()=>createListenerEntry}),findListenerEntry=(o,_)=>{const{type:$,effect:j,predicate:_e}=getListenerEntryPropsFrom(_);return Array.from(o.values()).find(et=>(typeof $=="string"?et.type===$:et.predicate===_e)&&et.effect===j)},cancelActiveListeners=o=>{o.pending.forEach(_=>{_.abort(listenerCancelled)})},createClearListenerMiddleware=(o,_)=>()=>{for(const $ of _.keys())cancelActiveListeners($);o.clear()},safelyNotifyError=(o,_,$)=>{try{o(_,$)}catch(j){setTimeout(()=>{throw j},0)}},addListener=assign(createAction(`${alm}/add`),{withTypes:()=>addListener}),clearAllListeners=createAction(`${alm}/removeAll`),removeListener=assign(createAction(`${alm}/remove`),{withTypes:()=>removeListener}),defaultErrorHandler=(...o)=>{console.error(`${alm}/error`,...o)},createListenerMiddleware=(o={})=>{const _=new Map,$=new Map,j=lt=>{const ct=$.get(lt)??0;$.set(lt,ct+1)},_e=lt=>{const ct=$.get(lt)??1;ct===1?$.delete(lt):$.set(lt,ct-1)},{extra:et,onError:tt=defaultErrorHandler}=o;assertFunction(tt);const rt=lt=>(lt.unsubscribe=()=>_.delete(lt.id),_.set(lt.id,lt),ct=>{lt.unsubscribe(),ct!=null&&ct.cancelActive&&cancelActiveListeners(lt)}),nt=lt=>{const ct=findListenerEntry(_,lt)??createListenerEntry(lt);return rt(ct)};assign(nt,{withTypes:()=>nt});const ot=lt=>{const ct=findListenerEntry(_,lt);return ct&&(ct.unsubscribe(),lt.cancelActive&&cancelActiveListeners(ct)),!!ct};assign(ot,{withTypes:()=>ot});const it=async(lt,ct,ft,dt)=>{const pt=new AbortController,yt=createTakePattern(nt,pt.signal),vt=[];try{lt.pending.add(pt),j(lt),await Promise.resolve(lt.effect(ct,assign({},ft,{getOriginalState:dt,condition:(wt,Ct)=>yt(wt,Ct).then(Boolean),take:yt,delay:createDelay(pt.signal),pause:createPause(pt.signal),extra:et,signal:pt.signal,fork:createFork(pt.signal,vt),unsubscribe:lt.unsubscribe,subscribe:()=>{_.set(lt.id,lt)},cancelActiveListeners:()=>{lt.pending.forEach((wt,Ct,Pt)=>{wt!==pt&&(wt.abort(listenerCancelled),Pt.delete(wt))})},cancel:()=>{pt.abort(listenerCancelled),lt.pending.delete(pt)},throwIfCancelled:()=>{validateActive(pt.signal)}})))}catch(wt){wt instanceof TaskAbortError||safelyNotifyError(tt,wt,{raisedBy:"effect"})}finally{await Promise.all(vt),pt.abort(listenerCompleted),_e(lt),lt.pending.delete(pt)}},st=createClearListenerMiddleware(_,$);return{middleware:lt=>ct=>ft=>{if(!isAction(ft))return ct(ft);if(addListener.match(ft))return nt(ft.payload);if(clearAllListeners.match(ft)){st();return}if(removeListener.match(ft))return ot(ft.payload);let dt=lt.getState();const pt=()=>{if(dt===INTERNAL_NIL_TOKEN)throw new Error(formatProdErrorMessage(23));return dt};let yt;try{if(yt=ct(ft),_.size>0){const vt=lt.getState(),wt=Array.from(_.values());for(const Ct of wt){let Pt=!1;try{Pt=Ct.predicate(ft,vt,dt)}catch(Bt){Pt=!1,safelyNotifyError(tt,Bt,{raisedBy:"predicate"})}Pt&&it(Ct,ft,lt,pt)}}}finally{dt=INTERNAL_NIL_TOKEN}return yt},startListening:nt,stopListening:ot,clearListeners:st}};function formatProdErrorMessage(o){return`Minified Redux Toolkit error #${o}; visit https://redux-toolkit.js.org/Errors?code=${o} for the full message or use the non-minified dev environment for full errors. `}var initialState$c={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},chartLayoutSlice=createSlice({name:"chartLayout",initialState:initialState$c,reducers:{setLayout(o,_){o.layoutType=_.payload},setChartSize(o,_){o.width=_.payload.width,o.height=_.payload.height},setMargin(o,_){var $,j,_e,et;o.margin.top=($=_.payload.top)!==null&&$!==void 0?$:0,o.margin.right=(j=_.payload.right)!==null&&j!==void 0?j:0,o.margin.bottom=(_e=_.payload.bottom)!==null&&_e!==void 0?_e:0,o.margin.left=(et=_.payload.left)!==null&&et!==void 0?et:0},setScale(o,_){o.scale=_.payload}}}),{setMargin,setLayout,setChartSize,setScale}=chartLayoutSlice.actions,chartLayoutReducer=chartLayoutSlice.reducer;function getSliced(o,_,$){return Array.isArray(o)&&o&&_+$!==0?o.slice(_,$+1):o}function isWellBehavedNumber(o){return Number.isFinite(o)}function isPositiveNumber(o){return typeof o=="number"&&o>0&&Number.isFinite(o)}function ownKeys$u(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$u(o){for(var _=1;_{if(_&&$){var{width:j,height:_e}=$,{align:et,verticalAlign:tt,layout:rt}=_;if((rt==="vertical"||rt==="horizontal"&&tt==="middle")&&et!=="center"&&isNumber(o[et]))return _objectSpread$u(_objectSpread$u({},o),{},{[et]:o[et]+(j||0)});if((rt==="horizontal"||rt==="vertical"&&et==="center")&&tt!=="middle"&&isNumber(o[tt]))return _objectSpread$u(_objectSpread$u({},o),{},{[tt]:o[tt]+(_e||0)})}return o},isCategoricalAxis=(o,_)=>o==="horizontal"&&_==="xAxis"||o==="vertical"&&_==="yAxis"||o==="centric"&&_==="angleAxis"||o==="radial"&&_==="radiusAxis",offsetSign=o=>{var _,$=o.length;if(!($<=0)){var j=(_=o[0])===null||_===void 0?void 0:_.length;if(!(j==null||j<=0))for(var _e=0;_e=0?(ot[0]=et,et+=at,ot[1]=et):(ot[0]=tt,tt+=at,ot[1]=tt)}}}},offsetPositive=o=>{var _,$=o.length;if(!($<=0)){var j=(_=o[0])===null||_===void 0?void 0:_.length;if(!(j==null||j<=0))for(var _e=0;_e=0?(nt[0]=et,et+=ot,nt[1]=et):(nt[0]=0,nt[1]=0)}}}},STACK_OFFSET_MAP={sign:offsetSign,expand:stackOffsetExpand,none:stackOffsetNone,silhouette:stackOffsetSilhouette,wiggle:stackOffsetWiggle,positive:offsetPositive},getStackedData=(o,_,$)=>{var j,_e=(j=STACK_OFFSET_MAP[$])!==null&&j!==void 0?j:stackOffsetNone,et=shapeStack().keys(_).value((rt,nt)=>Number(getValueByDataKey(rt,nt,0))).order(stackOrderNone).offset(_e),tt=et(o);return tt.forEach((rt,nt)=>{rt.forEach((ot,it)=>{var st=getValueByDataKey(o[it],_[nt],0);Array.isArray(st)&&st.length===2&&isNumber(st[0])&&isNumber(st[1])&&(ot[0]=st[0],ot[1]=st[1])})}),tt};function getCateCoordinateOfLine(o){var{axis:_,ticks:$,bandSize:j,entry:_e,index:et,dataKey:tt}=o;if(_.type==="category"){if(!_.allowDuplicatedCategory&&_.dataKey&&!isNullish(_e[_.dataKey])){var rt=findEntryInArray($,"value",_e[_.dataKey]);if(rt)return rt.coordinate+j/2}return $!=null&&$[et]?$[et].coordinate+j/2:null}var nt=getValueByDataKey(_e,isNullish(tt)?_.dataKey:tt),ot=_.scale.map(nt);return isNumber(ot)?ot:null}var getDomainOfSingle=o=>{var _=o.flat(2).filter(isNumber);return[Math.min(..._),Math.max(..._)]},makeDomainFinite=o=>[o[0]===1/0?0:o[0],o[1]===-1/0?0:o[1]],getDomainOfStackGroups=(o,_,$)=>{if(o!=null)return makeDomainFinite(Object.keys(o).reduce((j,_e)=>{var et=o[_e];if(!et)return j;var{stackedData:tt}=et,rt=tt.reduce((nt,ot)=>{var it=getSliced(ot,_,$),st=getDomainOfSingle(it);return!isWellBehavedNumber(st[0])||!isWellBehavedNumber(st[1])?nt:[Math.min(nt[0],st[0]),Math.max(nt[1],st[1])]},[1/0,-1/0]);return[Math.min(rt[0],j[0]),Math.max(rt[1],j[1])]},[1/0,-1/0]))},MIN_VALUE_REG=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,MAX_VALUE_REG=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,getBandSizeOfAxis=(o,_,$)=>{if(o&&o.scale&&o.scale.bandwidth){var j=o.scale.bandwidth();if(!$||j>0)return j}if(o&&_&&_.length>=2){for(var _e=sortBy$1(_,it=>it.coordinate),et=1/0,tt=1,rt=_e.length;tt{if(_==="horizontal")return o.chartX;if(_==="vertical")return o.chartY},calculatePolarTooltipPos=(o,_)=>_==="centric"?o.angle:o.radius,selectChartWidth=o=>o.layout.width,selectChartHeight=o=>o.layout.height,selectContainerScale=o=>o.layout.scale,selectMargin=o=>o.layout.margin,selectAllXAxes=createSelector(o=>o.cartesianAxis.xAxis,o=>Object.values(o)),selectAllYAxes=createSelector(o=>o.cartesianAxis.yAxis,o=>Object.values(o)),DATA_ITEM_INDEX_ATTRIBUTE_NAME="data-recharts-item-index",DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME="data-recharts-item-id",DEFAULT_Y_AXIS_WIDTH=60;function ownKeys$t(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$t(o){for(var _=1;_o.brush.height;function selectLeftAxesOffset(o){var _=selectAllYAxes(o);return _.reduce(($,j)=>{if(j.orientation==="left"&&!j.mirror&&!j.hide){var _e=typeof j.width=="number"?j.width:DEFAULT_Y_AXIS_WIDTH;return $+_e}return $},0)}function selectRightAxesOffset(o){var _=selectAllYAxes(o);return _.reduce(($,j)=>{if(j.orientation==="right"&&!j.mirror&&!j.hide){var _e=typeof j.width=="number"?j.width:DEFAULT_Y_AXIS_WIDTH;return $+_e}return $},0)}function selectTopAxesOffset(o){var _=selectAllXAxes(o);return _.reduce(($,j)=>j.orientation==="top"&&!j.mirror&&!j.hide?$+j.height:$,0)}function selectBottomAxesOffset(o){var _=selectAllXAxes(o);return _.reduce(($,j)=>j.orientation==="bottom"&&!j.mirror&&!j.hide?$+j.height:$,0)}var selectChartOffsetInternal=createSelector([selectChartWidth,selectChartHeight,selectMargin,selectBrushHeight,selectLeftAxesOffset,selectRightAxesOffset,selectTopAxesOffset,selectBottomAxesOffset,selectLegendSettings,selectLegendSize],(o,_,$,j,_e,et,tt,rt,nt,ot)=>{var it={left:($.left||0)+_e,right:($.right||0)+et},st={top:($.top||0)+tt,bottom:($.bottom||0)+rt},at=_objectSpread$t(_objectSpread$t({},st),it),lt=at.bottom;at.bottom+=j,at=appendOffsetOfLegend(at,nt,ot);var ct=o-at.left-at.right,ft=_-at.top-at.bottom;return _objectSpread$t(_objectSpread$t({brushBottom:lt},at),{},{width:Math.max(ct,0),height:Math.max(ft,0)})}),selectChartViewBox=createSelector(selectChartOffsetInternal,o=>({x:o.left,y:o.top,width:o.width,height:o.height}));createSelector(selectChartWidth,selectChartHeight,(o,_)=>({x:0,y:0,width:o,height:_}));var PanoramaContext=reactExports.createContext(null),useIsPanorama=()=>reactExports.useContext(PanoramaContext)!=null,selectBrushSettings=o=>o.brush,selectBrushDimensions=createSelector([selectBrushSettings,selectChartOffsetInternal,selectMargin],(o,_,$)=>({height:o.height,x:isNumber(o.x)?o.x:_.left,y:isNumber(o.y)?o.y:_.top+_.height+_.brushBottom-(($==null?void 0:$.bottom)||0),width:isNumber(o.width)?o.width:_.width})),throttle$2={},debounce$1={},debounce={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($,j,{signal:_e,edges:et}={}){let tt,rt=null;const nt=et!=null&&et.includes("leading"),ot=et==null||et.includes("trailing"),it=()=>{rt!==null&&($.apply(tt,rt),tt=void 0,rt=null)},st=()=>{ot&&it(),ft()};let at=null;const lt=()=>{at!=null&&clearTimeout(at),at=setTimeout(()=>{at=null,st()},j)},ct=()=>{at!==null&&(clearTimeout(at),at=null)},ft=()=>{ct(),tt=void 0,rt=null},dt=()=>{it()},pt=function(...yt){if(_e!=null&&_e.aborted)return;tt=this,rt=yt;const vt=at==null;lt(),nt&&vt&&it()};return pt.schedule=lt,pt.cancel=ft,pt.flush=dt,_e==null||_e.addEventListener("abort",ft,{once:!0}),pt}o.debounce=_})(debounce);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=debounce;function $(j,_e=0,et={}){typeof et!="object"&&(et={});const{leading:tt=!1,trailing:rt=!0,maxWait:nt}=et,ot=Array(2);tt&&(ot[0]="leading"),rt&&(ot[1]="trailing");let it,st=null;const at=_.debounce(function(...ft){it=j.apply(this,ft),st=null},_e,{edges:ot}),lt=function(...ft){return nt!=null&&(st===null&&(st=Date.now()),Date.now()-st>=nt)?(it=j.apply(this,ft),st=Date.now(),at.cancel(),at.schedule(),it):(at.apply(this,ft),it)},ct=()=>(at.flush(),it);return lt.cancel=at.cancel,lt.flush=ct,lt}o.debounce=$})(debounce$1);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=debounce$1;function $(j,_e=0,et={}){const{leading:tt=!0,trailing:rt=!0}=et;return _.debounce(j,_e,{leading:tt,maxWait:_e,trailing:rt})}o.throttle=$})(throttle$2);var throttle=throttle$2.throttle;const throttle$1=getDefaultExportFromCjs$1(throttle);var warn=function o(_,$){for(var j=arguments.length,_e=new Array(j>2?j-2:0),et=2;et_e[tt++]))}},defaultResponsiveContainerProps={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},calculateChartDimensions=(o,_,$)=>{var{width:j=defaultResponsiveContainerProps.width,height:_e=defaultResponsiveContainerProps.height,aspect:et,maxHeight:tt}=$,rt=isPercent(j)?o:Number(j),nt=isPercent(_e)?_:Number(_e);return et&&et>0&&(rt?nt=rt/et:nt&&(rt=nt*et),tt&&nt!=null&&nt>tt&&(nt=tt)),{calculatedWidth:rt,calculatedHeight:nt}},bothOverflow={width:0,height:0,overflow:"visible"},overflowX={width:0,overflowX:"visible"},overflowY={height:0,overflowY:"visible"},noStyle={},getInnerDivStyle=o=>{var{width:_,height:$}=o,j=isPercent(_),_e=isPercent($);return j&&_e?bothOverflow:j?overflowX:_e?overflowY:noStyle};function getDefaultWidthAndHeight(o){var{width:_,height:$,aspect:j}=o,_e=_,et=$;return _e===void 0&&et===void 0?(_e=defaultResponsiveContainerProps.width,et=defaultResponsiveContainerProps.height):_e===void 0?_e=j&&j>0?void 0:defaultResponsiveContainerProps.width:et===void 0&&(et=j&&j>0?void 0:defaultResponsiveContainerProps.height),{width:_e,height:et}}function _extends$g(){return _extends$g=Object.assign?Object.assign.bind():function(o){for(var _=1;_({width:$,height:j}),[$,j]);return isAcceptableSize(_e)?reactExports.createElement(ResponsiveContainerContext.Provider,{value:_e},_):null}var useResponsiveContainerContext=()=>reactExports.useContext(ResponsiveContainerContext),SizeDetectorContainer=reactExports.forwardRef((o,_)=>{var{aspect:$,initialDimension:j=defaultResponsiveContainerProps.initialDimension,width:_e,height:et,minWidth:tt=defaultResponsiveContainerProps.minWidth,minHeight:rt,maxHeight:nt,children:ot,debounce:it=defaultResponsiveContainerProps.debounce,id:st,className:at,onResize:lt,style:ct={}}=o,ft=reactExports.useRef(null),dt=reactExports.useRef();dt.current=lt,reactExports.useImperativeHandle(_,()=>ft.current);var[pt,yt]=reactExports.useState({containerWidth:j.width,containerHeight:j.height}),vt=reactExports.useCallback((At,kt)=>{yt(Ot=>{var Tt=Math.round(At),ht=Math.round(kt);return Ot.containerWidth===Tt&&Ot.containerHeight===ht?Ot:{containerWidth:Tt,containerHeight:ht}})},[]);reactExports.useEffect(()=>{if(ft.current==null||typeof ResizeObserver>"u")return noop$2;var At=ht=>{var bt,mt=ht[0];if(mt!=null){var{width:gt,height:xt}=mt.contentRect;vt(gt,xt),(bt=dt.current)===null||bt===void 0||bt.call(dt,gt,xt)}};it>0&&(At=throttle$1(At,it,{trailing:!0,leading:!1}));var kt=new ResizeObserver(At),{width:Ot,height:Tt}=ft.current.getBoundingClientRect();return vt(Ot,Tt),kt.observe(ft.current),()=>{kt.disconnect()}},[vt,it]);var{containerWidth:wt,containerHeight:Ct}=pt;warn(!$||$>0,"The aspect(%s) must be greater than zero.",$);var{calculatedWidth:Pt,calculatedHeight:Bt}=calculateChartDimensions(wt,Ct,{width:_e,height:et,aspect:$,maxHeight:nt});return warn(Pt!=null&&Pt>0||Bt!=null&&Bt>0,`The width(%s) and height(%s) of chart should be greater than 0, - please check the style of container, or the props width(%s) and height(%s), - or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the - height and width.`,Pt,Bt,_e,et,tt,rt,$),reactExports.createElement("div",{id:st?"".concat(st):void 0,className:clsx("recharts-responsive-container",at),style:_objectSpread$s(_objectSpread$s({},ct),{},{width:_e,height:et,minWidth:tt,minHeight:rt,maxHeight:nt}),ref:ft},reactExports.createElement("div",{style:getInnerDivStyle({width:_e,height:et})},reactExports.createElement(ResponsiveContainerContextProvider,{width:Pt,height:Bt},ot)))}),ResponsiveContainer=reactExports.forwardRef((o,_)=>{var $=useResponsiveContainerContext();if(isPositiveNumber($.width)&&isPositiveNumber($.height))return o.children;var{width:j,height:_e}=getDefaultWidthAndHeight({width:o.width,height:o.height,aspect:o.aspect}),{calculatedWidth:et,calculatedHeight:tt}=calculateChartDimensions(void 0,void 0,{width:j,height:_e,aspect:o.aspect,maxHeight:o.maxHeight});return isNumber(et)&&isNumber(tt)?reactExports.createElement(ResponsiveContainerContextProvider,{width:et,height:tt},o.children):reactExports.createElement(SizeDetectorContainer,_extends$g({},o,{width:j,height:_e,ref:_}))});function cartesianViewBoxToTrapezoid(o){if(o)return{x:o.x,y:o.y,upperWidth:"upperWidth"in o?o.upperWidth:o.width,lowerWidth:"lowerWidth"in o?o.lowerWidth:o.width,width:o.width,height:o.height}}var useViewBox=()=>{var o,_=useIsPanorama(),$=useAppSelector(selectChartViewBox),j=useAppSelector(selectBrushDimensions),_e=(o=useAppSelector(selectBrushSettings))===null||o===void 0?void 0:o.padding;return!_||!j||!_e?$:{width:j.width-_e.left-_e.right,height:j.height-_e.top-_e.bottom,x:_e.left,y:_e.top}},manyComponentsThrowErrorsIfOffsetIsUndefined={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},useOffsetInternal=()=>{var o;return(o=useAppSelector(selectChartOffsetInternal))!==null&&o!==void 0?o:manyComponentsThrowErrorsIfOffsetIsUndefined},useChartWidth=()=>useAppSelector(selectChartWidth),useChartHeight=()=>useAppSelector(selectChartHeight),selectChartLayout=o=>o.layout.layoutType,useChartLayout=()=>useAppSelector(selectChartLayout),selectPolarChartLayout=o=>{var _=o.layout.layoutType;if(_==="centric"||_==="radial")return _},useIsInChartContext=()=>{var o=useChartLayout();return o!==void 0},ReportChartSize=o=>{var _=useAppDispatch(),$=useIsPanorama(),{width:j,height:_e}=o,et=useResponsiveContainerContext(),tt=j,rt=_e;return et&&(tt=et.width>0?et.width:j,rt=et.height>0?et.height:_e),reactExports.useEffect(()=>{!$&&isPositiveNumber(tt)&&isPositiveNumber(rt)&&_(setChartSize({width:tt,height:rt}))},[_,$,tt,rt]),null},NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state");function die(o,..._){throw new Error(`[Immer] minified error nr: ${o}. Full error at: https://bit.ly/3cXEKWf`)}var getPrototypeOf=Object.getPrototypeOf;function isDraft(o){return!!o&&!!o[DRAFT_STATE]}function isDraftable(o){var _;return o?isPlainObject$3(o)||Array.isArray(o)||!!o[DRAFTABLE]||!!((_=o.constructor)!=null&&_[DRAFTABLE])||isMap(o)||isSet(o):!1}var objectCtorString=Object.prototype.constructor.toString(),cachedCtorStrings=new WeakMap;function isPlainObject$3(o){if(!o||typeof o!="object")return!1;const _=Object.getPrototypeOf(o);if(_===null||_===Object.prototype)return!0;const $=Object.hasOwnProperty.call(_,"constructor")&&_.constructor;if($===Object)return!0;if(typeof $!="function")return!1;let j=cachedCtorStrings.get($);return j===void 0&&(j=Function.toString.call($),cachedCtorStrings.set($,j)),j===objectCtorString}function each(o,_,$=!0){getArchtype(o)===0?($?Reflect.ownKeys(o):Object.keys(o)).forEach(_e=>{_(_e,o[_e],o)}):o.forEach((j,_e)=>_(_e,j,o))}function getArchtype(o){const _=o[DRAFT_STATE];return _?_.type_:Array.isArray(o)?1:isMap(o)?2:isSet(o)?3:0}function has(o,_){return getArchtype(o)===2?o.has(_):Object.prototype.hasOwnProperty.call(o,_)}function set(o,_,$){const j=getArchtype(o);j===2?o.set(_,$):j===3?o.add($):o[_]=$}function is$2(o,_){return o===_?o!==0||1/o===1/_:o!==o&&_!==_}function isMap(o){return o instanceof Map}function isSet(o){return o instanceof Set}function latest(o){return o.copy_||o.base_}function shallowCopy(o,_){if(isMap(o))return new Map(o);if(isSet(o))return new Set(o);if(Array.isArray(o))return Array.prototype.slice.call(o);const $=isPlainObject$3(o);if(_===!0||_==="class_only"&&!$){const j=Object.getOwnPropertyDescriptors(o);delete j[DRAFT_STATE];let _e=Reflect.ownKeys(j);for(let et=0;et<_e.length;et++){const tt=_e[et],rt=j[tt];rt.writable===!1&&(rt.writable=!0,rt.configurable=!0),(rt.get||rt.set)&&(j[tt]={configurable:!0,writable:!0,enumerable:rt.enumerable,value:o[tt]})}return Object.create(getPrototypeOf(o),j)}else{const j=getPrototypeOf(o);if(j!==null&&$)return{...o};const _e=Object.create(j);return Object.assign(_e,o)}}function freeze(o,_=!1){return isFrozen(o)||isDraft(o)||!isDraftable(o)||(getArchtype(o)>1&&Object.defineProperties(o,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),Object.freeze(o),_&&Object.values(o).forEach($=>freeze($,!0))),o}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={value:dontMutateFrozenCollections};function isFrozen(o){return o===null||typeof o!="object"?!0:Object.isFrozen(o)}var plugins={};function getPlugin(o){const _=plugins[o];return _||die(0,o),_}var currentScope;function getCurrentScope(){return currentScope}function createScope(o,_){return{drafts_:[],parent_:o,immer_:_,canAutoFreeze_:!0,unfinalizedDrafts_:0}}function usePatchesInScope(o,_){_&&(getPlugin("Patches"),o.patches_=[],o.inversePatches_=[],o.patchListener_=_)}function revokeScope(o){leaveScope(o),o.drafts_.forEach(revokeDraft),o.drafts_=null}function leaveScope(o){o===currentScope&&(currentScope=o.parent_)}function enterScope(o){return currentScope=createScope(currentScope,o)}function revokeDraft(o){const _=o[DRAFT_STATE];_.type_===0||_.type_===1?_.revoke_():_.revoked_=!0}function processResult(o,_){_.unfinalizedDrafts_=_.drafts_.length;const $=_.drafts_[0];return o!==void 0&&o!==$?($[DRAFT_STATE].modified_&&(revokeScope(_),die(4)),isDraftable(o)&&(o=finalize(_,o),_.parent_||maybeFreeze(_,o)),_.patches_&&getPlugin("Patches").generateReplacementPatches_($[DRAFT_STATE].base_,o,_.patches_,_.inversePatches_)):o=finalize(_,$,[]),revokeScope(_),_.patches_&&_.patchListener_(_.patches_,_.inversePatches_),o!==NOTHING?o:void 0}function finalize(o,_,$){if(isFrozen(_))return _;const j=o.immer_.shouldUseStrictIteration(),_e=_[DRAFT_STATE];if(!_e)return each(_,(et,tt)=>finalizeProperty(o,_e,_,et,tt,$),j),_;if(_e.scope_!==o)return _;if(!_e.modified_)return maybeFreeze(o,_e.base_,!0),_e.base_;if(!_e.finalized_){_e.finalized_=!0,_e.scope_.unfinalizedDrafts_--;const et=_e.copy_;let tt=et,rt=!1;_e.type_===3&&(tt=new Set(et),et.clear(),rt=!0),each(tt,(nt,ot)=>finalizeProperty(o,_e,et,nt,ot,$,rt),j),maybeFreeze(o,et,!1),$&&o.patches_&&getPlugin("Patches").generatePatches_(_e,$,o.patches_,o.inversePatches_)}return _e.copy_}function finalizeProperty(o,_,$,j,_e,et,tt){if(_e==null||typeof _e!="object"&&!tt)return;const rt=isFrozen(_e);if(!(rt&&!tt)){if(isDraft(_e)){const nt=et&&_&&_.type_!==3&&!has(_.assigned_,j)?et.concat(j):void 0,ot=finalize(o,_e,nt);if(set($,j,ot),isDraft(ot))o.canAutoFreeze_=!1;else return}else tt&&$.add(_e);if(isDraftable(_e)&&!rt){if(!o.immer_.autoFreeze_&&o.unfinalizedDrafts_<1||_&&_.base_&&_.base_[j]===_e&&rt)return;finalize(o,_e),(!_||!_.scope_.parent_)&&typeof j!="symbol"&&(isMap($)?$.has(j):Object.prototype.propertyIsEnumerable.call($,j))&&maybeFreeze(o,_e)}}}function maybeFreeze(o,_,$=!1){!o.parent_&&o.immer_.autoFreeze_&&o.canAutoFreeze_&&freeze(_,$)}function createProxyProxy(o,_){const $=Array.isArray(o),j={type_:$?1:0,scope_:_?_.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:{},parent_:_,base_:o,draft_:null,copy_:null,revoke_:null,isManual_:!1};let _e=j,et=objectTraps;$&&(_e=[j],et=arrayTraps);const{revoke:tt,proxy:rt}=Proxy.revocable(_e,et);return j.draft_=rt,j.revoke_=tt,rt}var objectTraps={get(o,_){if(_===DRAFT_STATE)return o;const $=latest(o);if(!has($,_))return readPropFromProto(o,$,_);const j=$[_];return o.finalized_||!isDraftable(j)?j:j===peek(o.base_,_)?(prepareCopy(o),o.copy_[_]=createProxy(j,o)):j},has(o,_){return _ in latest(o)},ownKeys(o){return Reflect.ownKeys(latest(o))},set(o,_,$){const j=getDescriptorFromProto(latest(o),_);if(j!=null&&j.set)return j.set.call(o.draft_,$),!0;if(!o.modified_){const _e=peek(latest(o),_),et=_e==null?void 0:_e[DRAFT_STATE];if(et&&et.base_===$)return o.copy_[_]=$,o.assigned_[_]=!1,!0;if(is$2($,_e)&&($!==void 0||has(o.base_,_)))return!0;prepareCopy(o),markChanged(o)}return o.copy_[_]===$&&($!==void 0||_ in o.copy_)||Number.isNaN($)&&Number.isNaN(o.copy_[_])||(o.copy_[_]=$,o.assigned_[_]=!0),!0},deleteProperty(o,_){return peek(o.base_,_)!==void 0||_ in o.base_?(o.assigned_[_]=!1,prepareCopy(o),markChanged(o)):delete o.assigned_[_],o.copy_&&delete o.copy_[_],!0},getOwnPropertyDescriptor(o,_){const $=latest(o),j=Reflect.getOwnPropertyDescriptor($,_);return j&&{writable:!0,configurable:o.type_!==1||_!=="length",enumerable:j.enumerable,value:$[_]}},defineProperty(){die(11)},getPrototypeOf(o){return getPrototypeOf(o.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(o,_)=>{arrayTraps[o]=function(){return arguments[0]=arguments[0][0],_.apply(this,arguments)}});arrayTraps.deleteProperty=function(o,_){return arrayTraps.set.call(this,o,_,void 0)};arrayTraps.set=function(o,_,$){return objectTraps.set.call(this,o[0],_,$,o[0])};function peek(o,_){const $=o[DRAFT_STATE];return($?latest($):o)[_]}function readPropFromProto(o,_,$){var _e;const j=getDescriptorFromProto(_,$);return j?"value"in j?j.value:(_e=j.get)==null?void 0:_e.call(o.draft_):void 0}function getDescriptorFromProto(o,_){if(!(_ in o))return;let $=getPrototypeOf(o);for(;$;){const j=Object.getOwnPropertyDescriptor($,_);if(j)return j;$=getPrototypeOf($)}}function markChanged(o){o.modified_||(o.modified_=!0,o.parent_&&markChanged(o.parent_))}function prepareCopy(o){o.copy_||(o.copy_=shallowCopy(o.base_,o.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(o){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!0,this.produce=(_,$,j)=>{if(typeof _=="function"&&typeof $!="function"){const et=$;$=_;const tt=this;return function(nt=et,...ot){return tt.produce(nt,it=>$.call(this,it,...ot))}}typeof $!="function"&&die(6),j!==void 0&&typeof j!="function"&&die(7);let _e;if(isDraftable(_)){const et=enterScope(this),tt=createProxy(_,void 0);let rt=!0;try{_e=$(tt),rt=!1}finally{rt?revokeScope(et):leaveScope(et)}return usePatchesInScope(et,j),processResult(_e,et)}else if(!_||typeof _!="object"){if(_e=$(_),_e===void 0&&(_e=_),_e===NOTHING&&(_e=void 0),this.autoFreeze_&&freeze(_e,!0),j){const et=[],tt=[];getPlugin("Patches").generateReplacementPatches_(_,_e,et,tt),j(et,tt)}return _e}else die(1,_)},this.produceWithPatches=(_,$)=>{if(typeof _=="function")return(tt,...rt)=>this.produceWithPatches(tt,nt=>_(nt,...rt));let j,_e;return[this.produce(_,$,(tt,rt)=>{j=tt,_e=rt}),j,_e]},typeof(o==null?void 0:o.autoFreeze)=="boolean"&&this.setAutoFreeze(o.autoFreeze),typeof(o==null?void 0:o.useStrictShallowCopy)=="boolean"&&this.setUseStrictShallowCopy(o.useStrictShallowCopy),typeof(o==null?void 0:o.useStrictIteration)=="boolean"&&this.setUseStrictIteration(o.useStrictIteration)}createDraft(o){isDraftable(o)||die(8),isDraft(o)&&(o=current(o));const _=enterScope(this),$=createProxy(o,void 0);return $[DRAFT_STATE].isManual_=!0,leaveScope(_),$}finishDraft(o,_){const $=o&&o[DRAFT_STATE];(!$||!$.isManual_)&&die(9);const{scope_:j}=$;return usePatchesInScope(j,_),processResult(void 0,j)}setAutoFreeze(o){this.autoFreeze_=o}setUseStrictShallowCopy(o){this.useStrictShallowCopy_=o}setUseStrictIteration(o){this.useStrictIteration_=o}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(o,_){let $;for($=_.length-1;$>=0;$--){const _e=_[$];if(_e.path.length===0&&_e.op==="replace"){o=_e.value;break}}$>-1&&(_=_.slice($+1));const j=getPlugin("Patches").applyPatches_;return isDraft(o)?j(o,_):this.produce(o,_e=>j(_e,_))}};function createProxy(o,_){const $=isMap(o)?getPlugin("MapSet").proxyMap_(o,_):isSet(o)?getPlugin("MapSet").proxySet_(o,_):createProxyProxy(o,_);return(_?_.scope_:getCurrentScope()).drafts_.push($),$}function current(o){return isDraft(o)||die(10,o),currentImpl(o)}function currentImpl(o){if(!isDraftable(o)||isFrozen(o))return o;const _=o[DRAFT_STATE];let $,j=!0;if(_){if(!_.modified_)return _.base_;_.finalized_=!0,$=shallowCopy(o,_.scope_.immer_.useStrictShallowCopy_),j=_.scope_.immer_.shouldUseStrictIteration()}else $=shallowCopy(o,!0);return each($,(_e,et)=>{set($,_e,currentImpl(et))},j),_&&(_.finalized_=!1),$}var immer=new Immer2;immer.produce;function castDraft(o){return o}var initialState$b={settings:{layout:"horizontal",align:"center",verticalAlign:"middle",itemSorter:"value"},size:{width:0,height:0},payload:[]},legendSlice=createSlice({name:"legend",initialState:initialState$b,reducers:{setLegendSize(o,_){o.size.width=_.payload.width,o.size.height=_.payload.height},setLegendSettings(o,_){o.settings.align=_.payload.align,o.settings.layout=_.payload.layout,o.settings.verticalAlign=_.payload.verticalAlign,o.settings.itemSorter=_.payload.itemSorter},addLegendPayload:{reducer(o,_){o.payload.push(_.payload)},prepare:prepareAutoBatched()},replaceLegendPayload:{reducer(o,_){var{prev:$,next:j}=_.payload,_e=current$1(o).payload.indexOf($);_e>-1&&(o.payload[_e]=j)},prepare:prepareAutoBatched()},removeLegendPayload:{reducer(o,_){var $=current$1(o).payload.indexOf(_.payload);$>-1&&o.payload.splice($,1)},prepare:prepareAutoBatched()}}}),{setLegendSize,setLegendSettings,addLegendPayload,replaceLegendPayload,removeLegendPayload}=legendSlice.actions,legendReducer=legendSlice.reducer;function _extends$f(){return _extends$f=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var{separator:_=defaultDefaultTooltipContentProps.separator,contentStyle:$,itemStyle:j,labelStyle:_e=defaultDefaultTooltipContentProps.labelStyle,payload:et,formatter:tt,itemSorter:rt,wrapperClassName:nt,labelClassName:ot,label:it,labelFormatter:st,accessibilityLayer:at=defaultDefaultTooltipContentProps.accessibilityLayer}=o,lt=()=>{if(et&&et.length){var Ct={padding:0,margin:0},Pt=(rt?sortBy$1(et,rt):et).map((Bt,At)=>{if(Bt.type==="none")return null;var kt=Bt.formatter||tt||defaultFormatter,{value:Ot,name:Tt}=Bt,ht=Ot,bt=Tt;if(kt){var mt=kt(Ot,Tt,Bt,At,et);if(Array.isArray(mt))[ht,bt]=mt;else if(mt!=null)ht=mt;else return null}var gt=_objectSpread$r(_objectSpread$r({},defaultDefaultTooltipContentProps.itemStyle),{},{color:Bt.color||defaultDefaultTooltipContentProps.itemStyle.color},j);return reactExports.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(At),style:gt},isNumOrStr(bt)?reactExports.createElement("span",{className:"recharts-tooltip-item-name"},bt):null,isNumOrStr(bt)?reactExports.createElement("span",{className:"recharts-tooltip-item-separator"},_):null,reactExports.createElement("span",{className:"recharts-tooltip-item-value"},ht),reactExports.createElement("span",{className:"recharts-tooltip-item-unit"},Bt.unit||""))});return reactExports.createElement("ul",{className:"recharts-tooltip-item-list",style:Ct},Pt)}return null},ct=_objectSpread$r(_objectSpread$r({},defaultDefaultTooltipContentProps.contentStyle),$),ft=_objectSpread$r({margin:0},_e),dt=!isNullish(it),pt=dt?it:"",yt=clsx("recharts-default-tooltip",nt),vt=clsx("recharts-tooltip-label",ot);dt&&st&&et!==void 0&&et!==null&&(pt=st(it,et));var wt=at?{role:"status","aria-live":"assertive"}:{};return reactExports.createElement("div",_extends$f({className:yt,style:ct},wt),reactExports.createElement("p",{className:vt,style:ft},reactExports.isValidElement(pt)?pt:"".concat(pt)),lt())},CSS_CLASS_PREFIX="recharts-tooltip-wrapper",TOOLTIP_HIDDEN={visibility:"hidden"};function getTooltipCSSClassName(o){var{coordinate:_,translateX:$,translateY:j}=o;return clsx(CSS_CLASS_PREFIX,{["".concat(CSS_CLASS_PREFIX,"-right")]:isNumber($)&&_&&isNumber(_.x)&&$>=_.x,["".concat(CSS_CLASS_PREFIX,"-left")]:isNumber($)&&_&&isNumber(_.x)&&$<_.x,["".concat(CSS_CLASS_PREFIX,"-bottom")]:isNumber(j)&&_&&isNumber(_.y)&&j>=_.y,["".concat(CSS_CLASS_PREFIX,"-top")]:isNumber(j)&&_&&isNumber(_.y)&&j<_.y})}function getTooltipTranslateXY(o){var{allowEscapeViewBox:_,coordinate:$,key:j,offset:_e,position:et,reverseDirection:tt,tooltipDimension:rt,viewBox:nt,viewBoxDimension:ot}=o;if(et&&isNumber(et[j]))return et[j];var it=$[j]-rt-(_e>0?_e:0),st=$[j]+_e;if(_[j])return tt[j]?it:st;var at=nt[j];if(at==null)return 0;if(tt[j]){var lt=it,ct=at;return ltdt?Math.max(it,at):Math.max(st,at)}function getTransformStyle(o){var{translateX:_,translateY:$,useTranslate3d:j}=o;return{transform:j?"translate3d(".concat(_,"px, ").concat($,"px, 0)"):"translate(".concat(_,"px, ").concat($,"px)")}}function getTooltipTranslate(o){var{allowEscapeViewBox:_,coordinate:$,offsetTop:j,offsetLeft:_e,position:et,reverseDirection:tt,tooltipBox:rt,useTranslate3d:nt,viewBox:ot}=o,it,st,at;return rt.height>0&&rt.width>0&&$?(st=getTooltipTranslateXY({allowEscapeViewBox:_,coordinate:$,key:"x",offset:_e,position:et,reverseDirection:tt,tooltipDimension:rt.width,viewBox:ot,viewBoxDimension:ot.width}),at=getTooltipTranslateXY({allowEscapeViewBox:_,coordinate:$,key:"y",offset:j,position:et,reverseDirection:tt,tooltipDimension:rt.height,viewBox:ot,viewBoxDimension:ot.height}),it=getTransformStyle({translateX:st,translateY:at,useTranslate3d:nt})):it=TOOLTIP_HIDDEN,{cssProperties:it,cssClasses:getTooltipCSSClassName({translateX:st,translateY:at,coordinate:$})}}function ownKeys$q(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$q(o){for(var _=1;_{if(_.key==="Escape"){var $,j,_e,et;this.setState({dismissed:!0,dismissedAtCoordinate:{x:($=(j=this.props.coordinate)===null||j===void 0?void 0:j.x)!==null&&$!==void 0?$:0,y:(_e=(et=this.props.coordinate)===null||et===void 0?void 0:et.y)!==null&&_e!==void 0?_e:0}})}})}componentDidMount(){document.addEventListener("keydown",this.handleKeyDown)}componentWillUnmount(){document.removeEventListener("keydown",this.handleKeyDown)}componentDidUpdate(){var _,$;this.state.dismissed&&(((_=this.props.coordinate)===null||_===void 0?void 0:_.x)!==this.state.dismissedAtCoordinate.x||(($=this.props.coordinate)===null||$===void 0?void 0:$.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}render(){var{active:_,allowEscapeViewBox:$,animationDuration:j,animationEasing:_e,children:et,coordinate:tt,hasPayload:rt,isAnimationActive:nt,offset:ot,position:it,reverseDirection:st,useTranslate3d:at,viewBox:lt,wrapperStyle:ct,lastBoundingBox:ft,innerRef:dt,hasPortalFromProps:pt}=this.props,yt=typeof ot=="number"?ot:ot.x,vt=typeof ot=="number"?ot:ot.y,{cssClasses:wt,cssProperties:Ct}=getTooltipTranslate({allowEscapeViewBox:$,coordinate:tt,offsetLeft:yt,offsetTop:vt,position:it,reverseDirection:st,tooltipBox:{height:ft.height,width:ft.width},useTranslate3d:at,viewBox:lt}),Pt=pt?{}:_objectSpread$q(_objectSpread$q({transition:nt&&_?"transform ".concat(j,"ms ").concat(_e):void 0},Ct),{},{pointerEvents:"none",visibility:!this.state.dismissed&&_&&rt?"visible":"hidden",position:"absolute",top:0,left:0}),Bt=_objectSpread$q(_objectSpread$q({},Pt),{},{visibility:!this.state.dismissed&&_&&rt?"visible":"hidden"},ct);return reactExports.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:wt,style:Bt,ref:dt},et)}}var useAccessibilityLayer=()=>{var o;return(o=useAppSelector(_=>_.rootProps.accessibilityLayer))!==null&&o!==void 0?o:!0};function _extends$e(){return _extends$e=Object.assign?Object.assign.bind():function(o){for(var _=1;_isWellBehavedNumber(o.x)&&isWellBehavedNumber(o.y),areaDefined=o=>o.base!=null&&defined(o.base)&&defined(o),getX=o=>o.x,getY=o=>o.y,getCurveFactory=(o,_)=>{if(typeof o=="function")return o;var $="curve".concat(upperFirst(o));if(($==="curveMonotone"||$==="curveBump")&&_){var j=CURVE_FACTORIES["".concat($).concat(_==="vertical"?"Y":"X")];if(j)return j}return CURVE_FACTORIES[$]||curveLinear},defaultCurveProps={connectNulls:!1,type:"linear"},getPath$1=o=>{var{type:_=defaultCurveProps.type,points:$=[],baseLine:j,layout:_e,connectNulls:et=defaultCurveProps.connectNulls}=o,tt=getCurveFactory(_,_e),rt=et?$.filter(defined):$;if(Array.isArray(j)){var nt,ot=$.map((ct,ft)=>_objectSpread$p(_objectSpread$p({},ct),{},{base:j[ft]}));_e==="vertical"?nt=shapeArea().y(getY).x1(getX).x0(ct=>ct.base.x):nt=shapeArea().x(getX).y1(getY).y0(ct=>ct.base.y);var it=nt.defined(areaDefined).curve(tt),st=et?ot.filter(areaDefined):ot;return it(st)}var at;_e==="vertical"&&isNumber(j)?at=shapeArea().y(getY).x1(getX).x0(j):isNumber(j)?at=shapeArea().x(getX).y1(getY).y0(j):at=shapeLine().x(getX).y(getY);var lt=at.defined(defined).curve(tt);return lt(rt)},Curve=o=>{var{className:_,points:$,path:j,pathRef:_e}=o,et=useChartLayout();if((!$||!$.length)&&!j)return null;var tt={type:o.type,points:o.points,baseLine:o.baseLine,layout:o.layout||et,connectNulls:o.connectNulls},rt=$&&$.length?getPath$1(tt):j;return reactExports.createElement("path",_extends$e({},svgPropertiesNoEvents(o),adaptEventHandlers(o),{className:clsx("recharts-curve",_),d:rt===null?void 0:rt,ref:_e}))},_excluded$b=["x","y","top","left","width","height","className"];function _extends$d(){return _extends$d=Object.assign?Object.assign.bind():function(o){for(var _=1;_"M".concat(o,",").concat(_e,"v").concat(j,"M").concat(et,",").concat(_,"h").concat($),Cross=o=>{var{x:_=0,y:$=0,top:j=0,left:_e=0,width:et=0,height:tt=0,className:rt}=o,nt=_objectWithoutProperties$b(o,_excluded$b),ot=_objectSpread$o({x:_,y:$,top:j,left:_e,width:et,height:tt},nt);return!isNumber(_)||!isNumber($)||!isNumber(et)||!isNumber(tt)||!isNumber(j)||!isNumber(_e)?null:reactExports.createElement("path",_extends$d({},svgPropertiesAndEvents(ot),{className:clsx("recharts-cross",rt),d:getPath(_,$,et,tt,j,_e)}))};function getCursorRectangle(o,_,$,j){var _e=j/2;return{stroke:"none",fill:"#ccc",x:o==="horizontal"?_.x-_e:$.left+.5,y:o==="horizontal"?$.top+.5:_.y-_e,width:o==="horizontal"?j:$.width-1,height:o==="horizontal"?$.height-1:j}}function ownKeys$n(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$n(o){for(var _=1;_o.replace(/([A-Z])/g,_=>"-".concat(_.toLowerCase())),getTransitionVal=(o,_,$)=>o.map(j=>"".concat(getDashCase(j)," ").concat(_,"ms ").concat($)).join(","),getIntersectionKeys=(o,_)=>[Object.keys(o),Object.keys(_)].reduce(($,j)=>$.filter(_e=>j.includes(_e))),mapObject=(o,_)=>Object.keys(_).reduce(($,j)=>_objectSpread$n(_objectSpread$n({},$),{},{[j]:o(j,_[j])}),{});function ownKeys$m(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$m(o){for(var _=1;_o+(_-o)*$,needContinue=o=>{var{from:_,to:$}=o;return _!==$},calStepperVals=(o,_,$)=>{var j=mapObject((_e,et)=>{if(needContinue(et)){var[tt,rt]=o(et.from,et.to,et.velocity);return _objectSpread$m(_objectSpread$m({},et),{},{from:tt,velocity:rt})}return et},_);return $<1?mapObject((_e,et)=>needContinue(et)&&j[_e]!=null?_objectSpread$m(_objectSpread$m({},et),{},{velocity:alpha(et.velocity,j[_e].velocity,$),from:alpha(et.from,j[_e].from,$)}):et,_):calStepperVals(o,j,$-1)};function createStepperUpdate(o,_,$,j,_e,et){var tt,rt=j.reduce((at,lt)=>_objectSpread$m(_objectSpread$m({},at),{},{[lt]:{from:o[lt],velocity:0,to:_[lt]}}),{}),nt=()=>mapObject((at,lt)=>lt.from,rt),ot=()=>!Object.values(rt).filter(needContinue).length,it=null,st=at=>{tt||(tt=at);var lt=at-tt,ct=lt/$.dt;rt=calStepperVals($,rt,ct),_e(_objectSpread$m(_objectSpread$m(_objectSpread$m({},o),_),nt())),tt=at,ot()||(it=et.setTimeout(st))};return()=>(it=et.setTimeout(st),()=>{var at;(at=it)===null||at===void 0||at()})}function createTimingUpdate(o,_,$,j,_e,et,tt){var rt=null,nt=_e.reduce((st,at)=>{var lt=o[at],ct=_[at];return lt==null||ct==null?st:_objectSpread$m(_objectSpread$m({},st),{},{[at]:[lt,ct]})},{}),ot,it=st=>{ot||(ot=st);var at=(st-ot)/j,lt=mapObject((ft,dt)=>alpha(...dt,$(at)),nt);if(et(_objectSpread$m(_objectSpread$m(_objectSpread$m({},o),_),lt)),at<1)rt=tt.setTimeout(it);else{var ct=mapObject((ft,dt)=>alpha(...dt,$(1)),nt);et(_objectSpread$m(_objectSpread$m(_objectSpread$m({},o),_),ct))}};return()=>(rt=tt.setTimeout(it),()=>{var st;(st=rt)===null||st===void 0||st()})}const configUpdate=(o,_,$,j,_e,et)=>{var tt=getIntersectionKeys(o,_);return $==null?()=>(_e(_objectSpread$m(_objectSpread$m({},o),_)),()=>{}):$.isStepper===!0?createStepperUpdate(o,_,$,tt,_e,et):createTimingUpdate(o,_,$,j,tt,_e,et)};var ACCURACY=1e-4,cubicBezierFactor=(o,_)=>[0,3*o,3*_-6*o,3*o-3*_+1],evaluatePolynomial=(o,_)=>o.map(($,j)=>$*_**j).reduce(($,j)=>$+j),cubicBezier=(o,_)=>$=>{var j=cubicBezierFactor(o,_);return evaluatePolynomial(j,$)},derivativeCubicBezier=(o,_)=>$=>{var j=cubicBezierFactor(o,_),_e=[...j.map((et,tt)=>et*tt).slice(1),0];return evaluatePolynomial(_e,$)},parseCubicBezier=o=>{var _,$=o.split("(");if($.length!==2||$[0]!=="cubic-bezier")return null;var j=(_=$[1])===null||_===void 0||(_=_.split(")")[0])===null||_===void 0?void 0:_.split(",");if(j==null||j.length!==4)return null;var _e=j.map(et=>parseFloat(et));return[_e[0],_e[1],_e[2],_e[3]]},getBezierCoordinates=function o(){for(var _=arguments.length,$=new Array(_),j=0;j<_;j++)$[j]=arguments[j];if($.length===1)switch($[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var _e=parseCubicBezier($[0]);if(_e)return _e}}return $.length===4?$:[0,0,1,1]},createBezierEasing=(o,_,$,j)=>{var _e=cubicBezier(o,$),et=cubicBezier(_,j),tt=derivativeCubicBezier(o,$),rt=ot=>ot>1?1:ot<0?0:ot,nt=ot=>{for(var it=ot>1?1:ot,st=it,at=0;at<8;++at){var lt=_e(st)-it,ct=tt(st);if(Math.abs(lt-it)0&&arguments[0]!==void 0?arguments[0]:{},{stiff:$=100,damping:j=8,dt:_e=17}=_,et=(tt,rt,nt)=>{var ot=-(tt-rt)*$,it=nt*j,st=nt+(ot-it)*_e/1e3,at=nt*_e/1e3+tt;return Math.abs(at-rt){if(typeof o=="string")switch(o){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return configBezier(o);case"spring":return configSpring();default:if(o.split("(")[0]==="cubic-bezier")return configBezier(o)}return typeof o=="function"?o:null};function createAnimateManager(o){var _,$=()=>null,j=!1,_e=null,et=tt=>{if(!j){if(Array.isArray(tt)){if(!tt.length)return;var rt=tt,[nt,...ot]=rt;if(typeof nt=="number"){_e=o.setTimeout(et.bind(null,ot),nt);return}et(nt),_e=o.setTimeout(et.bind(null,ot));return}typeof tt=="string"&&(_=tt,$(_)),typeof tt=="object"&&(_=tt,$(_)),typeof tt=="function"&&tt()}};return{stop:()=>{j=!0},start:tt=>{j=!1,_e&&(_e(),_e=null),et(tt)},subscribe:tt=>($=tt,()=>{$=()=>null}),getTimeoutController:()=>o}}class RequestAnimationFrameTimeoutController{setTimeout(_){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,j=performance.now(),_e=null,et=tt=>{tt-j>=$?_(tt):typeof requestAnimationFrame=="function"&&(_e=requestAnimationFrame(et))};return _e=requestAnimationFrame(et),()=>{_e!=null&&cancelAnimationFrame(_e)}}}function createDefaultAnimationManager(){return createAnimateManager(new RequestAnimationFrameTimeoutController)}var AnimationManagerContext=reactExports.createContext(createDefaultAnimationManager);function useAnimationManager(o,_){var $=reactExports.useContext(AnimationManagerContext);return reactExports.useMemo(()=>_??$(o),[o,_,$])}var parseIsSsrByDefault=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),Global={isSsr:parseIsSsrByDefault()},defaultJavascriptAnimateProps={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},from={t:0},to={t:1};function JavascriptAnimate(o){var _=resolveDefaultProps(o,defaultJavascriptAnimateProps),{isActive:$,canBegin:j,duration:_e,easing:et,begin:tt,onAnimationEnd:rt,onAnimationStart:nt,children:ot}=_,it=$==="auto"?!Global.isSsr:$,st=useAnimationManager(_.animationId,_.animationManager),[at,lt]=reactExports.useState(it?from:to),ct=reactExports.useRef(null);return reactExports.useEffect(()=>{it||lt(to)},[it]),reactExports.useEffect(()=>{if(!it||!j)return noop$2;var ft=configUpdate(from,to,configEasing(et),_e,lt,st.getTimeoutController()),dt=()=>{ct.current=ft()};return st.start([nt,tt,dt,_e,rt]),()=>{st.stop(),ct.current&&ct.current(),rt()}},[it,j,_e,et,tt,nt,rt,st]),ot(at.t)}function useAnimationId(o){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",$=reactExports.useRef(uniqueId(_)),j=reactExports.useRef(o);return j.current!==o&&($.current=uniqueId(_),j.current=o),$.current}var _excluded$a=["radius"],_excluded2$4=["radius"],_templateObject$2,_templateObject2$2,_templateObject3$2,_templateObject4$2,_templateObject5$2,_templateObject6$1,_templateObject7$1,_templateObject8,_templateObject9,_templateObject0;function ownKeys$l(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$l(o){for(var _=1;_{var et=round$1($),tt=round$1(j),rt=Math.min(Math.abs(et)/2,Math.abs(tt)/2),nt=tt>=0?1:-1,ot=et>=0?1:-1,it=tt>=0&&et>=0||tt<0&&et<0?1:0,st;if(rt>0&&Array.isArray(_e)){for(var at=[0,0,0,0],lt=0,ct=4;ltrt?rt:dt}st=roundTemplateLiteral(_templateObject$2||(_templateObject$2=_taggedTemplateLiteral$2(["M",",",""])),o,_+nt*at[0]),at[0]>0&&(st+=roundTemplateLiteral(_templateObject2$2||(_templateObject2$2=_taggedTemplateLiteral$2(["A ",",",",0,0,",",",",",""])),at[0],at[0],it,o+ot*at[0],_)),st+=roundTemplateLiteral(_templateObject3$2||(_templateObject3$2=_taggedTemplateLiteral$2(["L ",",",""])),o+$-ot*at[1],_),at[1]>0&&(st+=roundTemplateLiteral(_templateObject4$2||(_templateObject4$2=_taggedTemplateLiteral$2(["A ",",",",0,0,",`, - `,",",""])),at[1],at[1],it,o+$,_+nt*at[1])),st+=roundTemplateLiteral(_templateObject5$2||(_templateObject5$2=_taggedTemplateLiteral$2(["L ",",",""])),o+$,_+j-nt*at[2]),at[2]>0&&(st+=roundTemplateLiteral(_templateObject6$1||(_templateObject6$1=_taggedTemplateLiteral$2(["A ",",",",0,0,",`, - `,",",""])),at[2],at[2],it,o+$-ot*at[2],_+j)),st+=roundTemplateLiteral(_templateObject7$1||(_templateObject7$1=_taggedTemplateLiteral$2(["L ",",",""])),o+ot*at[3],_+j),at[3]>0&&(st+=roundTemplateLiteral(_templateObject8||(_templateObject8=_taggedTemplateLiteral$2(["A ",",",",0,0,",`, - `,",",""])),at[3],at[3],it,o,_+j-nt*at[3])),st+="Z"}else if(rt>0&&_e===+_e&&_e>0){var pt=Math.min(rt,_e);st=roundTemplateLiteral(_templateObject9||(_templateObject9=_taggedTemplateLiteral$2(["M ",",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",",",` - L `,",",` - A `,",",",0,0,",",",","," Z"])),o,_+nt*pt,pt,pt,it,o+ot*pt,_,o+$-ot*pt,_,pt,pt,it,o+$,_+nt*pt,o+$,_+j-nt*pt,pt,pt,it,o+$-ot*pt,_+j,o+ot*pt,_+j,pt,pt,it,o,_+j-nt*pt)}else st=roundTemplateLiteral(_templateObject0||(_templateObject0=_taggedTemplateLiteral$2(["M ",","," h "," v "," h "," Z"])),o,_,$,j,-$);return st},defaultRectangleProps={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Rectangle=o=>{var _=resolveDefaultProps(o,defaultRectangleProps),$=reactExports.useRef(null),[j,_e]=reactExports.useState(-1);reactExports.useEffect(()=>{if($.current&&$.current.getTotalLength)try{var Et=$.current.getTotalLength();Et&&_e(Et)}catch{}},[]);var{x:et,y:tt,width:rt,height:nt,radius:ot,className:it}=_,{animationEasing:st,animationDuration:at,animationBegin:lt,isAnimationActive:ct,isUpdateAnimationActive:ft}=_,dt=reactExports.useRef(rt),pt=reactExports.useRef(nt),yt=reactExports.useRef(et),vt=reactExports.useRef(tt),wt=reactExports.useMemo(()=>({x:et,y:tt,width:rt,height:nt,radius:ot}),[et,tt,rt,nt,ot]),Ct=useAnimationId(wt,"rectangle-");if(et!==+et||tt!==+tt||rt!==+rt||nt!==+nt||rt===0||nt===0)return null;var Pt=clsx("recharts-rectangle",it);if(!ft){var Bt=svgPropertiesAndEvents(_),{radius:At}=Bt,kt=_objectWithoutProperties$a(Bt,_excluded$a);return reactExports.createElement("path",_extends$c({},kt,{x:round$1(et),y:round$1(tt),width:round$1(rt),height:round$1(nt),radius:typeof ot=="number"?ot:void 0,className:Pt,d:getRectanglePath(et,tt,rt,nt,ot)}))}var Ot=dt.current,Tt=pt.current,ht=yt.current,bt=vt.current,mt="0px ".concat(j===-1?1:j,"px"),gt="".concat(j,"px 0px"),xt=getTransitionVal(["strokeDasharray"],at,typeof st=="string"?st:defaultRectangleProps.animationEasing);return reactExports.createElement(JavascriptAnimate,{animationId:Ct,key:Ct,canBegin:j>0,duration:at,easing:st,isActive:ft,begin:lt},Et=>{var _t=interpolate$1(Ot,rt,Et),$t=interpolate$1(Tt,nt,Et),St=interpolate$1(ht,et,Et),Rt=interpolate$1(bt,tt,Et);$.current&&(dt.current=_t,pt.current=$t,yt.current=St,vt.current=Rt);var It;ct?Et>0?It={transition:xt,strokeDasharray:gt}:It={strokeDasharray:mt}:It={strokeDasharray:gt};var Mt=svgPropertiesAndEvents(_),{radius:Vt}=Mt,Gt=_objectWithoutProperties$a(Mt,_excluded2$4);return reactExports.createElement("path",_extends$c({},Gt,{radius:typeof ot=="number"?ot:void 0,className:Pt,d:getRectanglePath(St,Rt,_t,$t,ot),ref:$,style:_objectSpread$l(_objectSpread$l({},It),_.style)}))})};function ownKeys$k(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$k(o){for(var _=1;_o*180/Math.PI,polarToCartesian=(o,_,$,j)=>({x:o+Math.cos(-RADIAN*j)*$,y:_+Math.sin(-RADIAN*j)*$}),getMaxRadius=function o(_,$){var j=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(_-(j.left||0)-(j.right||0)),Math.abs($-(j.top||0)-(j.bottom||0)))/2},distanceBetweenPoints=(o,_)=>{var{x:$,y:j}=o,{x:_e,y:et}=_;return Math.sqrt(($-_e)**2+(j-et)**2)},getAngleOfPoint=(o,_)=>{var{x:$,y:j}=o,{cx:_e,cy:et}=_,tt=distanceBetweenPoints({x:$,y:j},{x:_e,y:et});if(tt<=0)return{radius:tt,angle:0};var rt=($-_e)/tt,nt=Math.acos(rt);return j>et&&(nt=2*Math.PI-nt),{radius:tt,angle:radianToDegree(nt),angleInRadian:nt}},formatAngleOfSector=o=>{var{startAngle:_,endAngle:$}=o,j=Math.floor(_/360),_e=Math.floor($/360),et=Math.min(j,_e);return{startAngle:_-et*360,endAngle:$-et*360}},reverseFormatAngleOfSector=(o,_)=>{var{startAngle:$,endAngle:j}=_,_e=Math.floor($/360),et=Math.floor(j/360),tt=Math.min(_e,et);return o+tt*360},inRangeOfSector=(o,_)=>{var{chartX:$,chartY:j}=o,{radius:_e,angle:et}=getAngleOfPoint({x:$,y:j},_),{innerRadius:tt,outerRadius:rt}=_;if(_ert||_e===0)return null;var{startAngle:nt,endAngle:ot}=formatAngleOfSector(_),it=et,st;if(nt<=ot){for(;it>ot;)it-=360;for(;it=nt&&it<=ot}else{for(;it>nt;)it-=360;for(;it=ot&&it<=nt}return st?_objectSpread$k(_objectSpread$k({},_),{},{radius:_e,angle:reverseFormatAngleOfSector(it,_)}):null};function getRadialCursorPoints(o){var{cx:_,cy:$,radius:j,startAngle:_e,endAngle:et}=o,tt=polarToCartesian(_,$,j,_e),rt=polarToCartesian(_,$,j,et);return{points:[tt,rt],cx:_,cy:$,radius:j,startAngle:_e,endAngle:et}}var _templateObject$1,_templateObject2$1,_templateObject3$1,_templateObject4$1,_templateObject5$1,_templateObject6,_templateObject7;function _extends$b(){return _extends$b=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var $=mathSign(_-o),j=Math.min(Math.abs(_-o),359.999);return $*j},getTangentCircle=o=>{var{cx:_,cy:$,radius:j,angle:_e,sign:et,isExternal:tt,cornerRadius:rt,cornerIsExternal:nt}=o,ot=rt*(tt?1:-1)+j,it=Math.asin(rt/ot)/RADIAN,st=nt?_e:_e+et*it,at=polarToCartesian(_,$,ot,st),lt=polarToCartesian(_,$,j,st),ct=nt?_e-et*it:_e,ft=polarToCartesian(_,$,ot*Math.cos(it*RADIAN),ct);return{center:at,circleTangency:lt,lineTangency:ft,theta:it}},getSectorPath=o=>{var{cx:_,cy:$,innerRadius:j,outerRadius:_e,startAngle:et,endAngle:tt}=o,rt=getDeltaAngle$1(et,tt),nt=et+rt,ot=polarToCartesian(_,$,_e,et),it=polarToCartesian(_,$,_e,nt),st=roundTemplateLiteral(_templateObject$1||(_templateObject$1=_taggedTemplateLiteral$1(["M ",",",` - A `,",",`,0, - `,",",`, - `,",",` - `])),ot.x,ot.y,_e,_e,+(Math.abs(rt)>180),+(et>nt),it.x,it.y);if(j>0){var at=polarToCartesian(_,$,j,et),lt=polarToCartesian(_,$,j,nt);st+=roundTemplateLiteral(_templateObject2$1||(_templateObject2$1=_taggedTemplateLiteral$1(["L ",",",` - A `,",",`,0, - `,",",`, - `,","," Z"])),lt.x,lt.y,j,j,+(Math.abs(rt)>180),+(et<=nt),at.x,at.y)}else st+=roundTemplateLiteral(_templateObject3$1||(_templateObject3$1=_taggedTemplateLiteral$1(["L ",","," Z"])),_,$);return st},getSectorWithCorner=o=>{var{cx:_,cy:$,innerRadius:j,outerRadius:_e,cornerRadius:et,forceCornerRadius:tt,cornerIsExternal:rt,startAngle:nt,endAngle:ot}=o,it=mathSign(ot-nt),{circleTangency:st,lineTangency:at,theta:lt}=getTangentCircle({cx:_,cy:$,radius:_e,angle:nt,sign:it,cornerRadius:et,cornerIsExternal:rt}),{circleTangency:ct,lineTangency:ft,theta:dt}=getTangentCircle({cx:_,cy:$,radius:_e,angle:ot,sign:-it,cornerRadius:et,cornerIsExternal:rt}),pt=rt?Math.abs(nt-ot):Math.abs(nt-ot)-lt-dt;if(pt<0)return tt?roundTemplateLiteral(_templateObject4$1||(_templateObject4$1=_taggedTemplateLiteral$1(["M ",",",` - a`,",",",0,0,1,",`,0 - a`,",",",0,0,1,",`,0 - `])),at.x,at.y,et,et,et*2,et,et,-et*2):getSectorPath({cx:_,cy:$,innerRadius:j,outerRadius:_e,startAngle:nt,endAngle:ot});var yt=roundTemplateLiteral(_templateObject5$1||(_templateObject5$1=_taggedTemplateLiteral$1(["M ",",",` - A`,",",",0,0,",",",",",` - A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",",` - `])),at.x,at.y,et,et,+(it<0),st.x,st.y,_e,_e,+(pt>180),+(it<0),ct.x,ct.y,et,et,+(it<0),ft.x,ft.y);if(j>0){var{circleTangency:vt,lineTangency:wt,theta:Ct}=getTangentCircle({cx:_,cy:$,radius:j,angle:nt,sign:it,isExternal:!0,cornerRadius:et,cornerIsExternal:rt}),{circleTangency:Pt,lineTangency:Bt,theta:At}=getTangentCircle({cx:_,cy:$,radius:j,angle:ot,sign:-it,isExternal:!0,cornerRadius:et,cornerIsExternal:rt}),kt=rt?Math.abs(nt-ot):Math.abs(nt-ot)-Ct-At;if(kt<0&&et===0)return"".concat(yt,"L").concat(_,",").concat($,"Z");yt+=roundTemplateLiteral(_templateObject6||(_templateObject6=_taggedTemplateLiteral$1(["L",",",` - A`,",",",0,0,",",",",",` - A`,",",",0,",",",",",",",` - A`,",",",0,0,",",",",","Z"])),Bt.x,Bt.y,et,et,+(it<0),Pt.x,Pt.y,j,j,+(kt>180),+(it>0),vt.x,vt.y,et,et,+(it<0),wt.x,wt.y)}else yt+=roundTemplateLiteral(_templateObject7||(_templateObject7=_taggedTemplateLiteral$1(["L",",","Z"])),_,$);return yt},defaultSectorProps={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},Sector=o=>{var _=resolveDefaultProps(o,defaultSectorProps),{cx:$,cy:j,innerRadius:_e,outerRadius:et,cornerRadius:tt,forceCornerRadius:rt,cornerIsExternal:nt,startAngle:ot,endAngle:it,className:st}=_;if(et<_e||ot===it)return null;var at=clsx("recharts-sector",st),lt=et-_e,ct=getPercentValue(tt,lt,0,!0),ft;return ct>0&&Math.abs(ot-it)<360?ft=getSectorWithCorner({cx:$,cy:j,innerRadius:_e,outerRadius:et,cornerRadius:Math.min(ct,lt/2),forceCornerRadius:rt,cornerIsExternal:nt,startAngle:ot,endAngle:it}):ft=getSectorPath({cx:$,cy:j,innerRadius:_e,outerRadius:et,startAngle:ot,endAngle:it}),reactExports.createElement("path",_extends$b({},svgPropertiesAndEvents(_),{className:at,d:ft}))};function getCursorPoints(o,_,$){if(o==="horizontal")return[{x:_.x,y:$.top},{x:_.x,y:$.top+$.height}];if(o==="vertical")return[{x:$.left,y:_.y},{x:$.left+$.width,y:_.y}];if(isPolarCoordinate(_)){if(o==="centric"){var{cx:j,cy:_e,innerRadius:et,outerRadius:tt,angle:rt}=_,nt=polarToCartesian(j,_e,et,rt),ot=polarToCartesian(j,_e,tt,rt);return[{x:nt.x,y:nt.y},{x:ot.x,y:ot.y}]}return getRadialCursorPoints(_)}}var range$3={},toFinite={},toNumber={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=isSymbol;function $(j){return _.isSymbol(j)?NaN:Number(j)}o.toNumber=$})(toNumber);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=toNumber;function $(j){return j?(j=_.toNumber(j),j===1/0||j===-1/0?(j<0?-1:1)*Number.MAX_VALUE:j===j?j:0):j===0?j:0}o.toFinite=$})(toFinite);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=isIterateeCall,$=toFinite;function j(_e,et,tt){tt&&typeof tt!="number"&&_.isIterateeCall(_e,et,tt)&&(et=tt=void 0),_e=$.toFinite(_e),et===void 0?(et=_e,_e=0):et=$.toFinite(et),tt=tt===void 0?_e_?1:o>=_?0:NaN}function descending(o,_){return o==null||_==null?NaN:_o?1:_>=o?0:NaN}function bisector(o){let _,$,j;o.length!==2?(_=ascending,$=(rt,nt)=>ascending(o(rt),nt),j=(rt,nt)=>o(rt)-nt):(_=o===ascending||o===descending?o:zero$1,$=o,j=o);function _e(rt,nt,ot=0,it=rt.length){if(ot>>1;$(rt[st],nt)<0?ot=st+1:it=st}while(ot>>1;$(rt[st],nt)<=0?ot=st+1:it=st}while(otot&&j(rt[st-1],nt)>-j(rt[st],nt)?st-1:st}return{left:_e,center:tt,right:et}}function zero$1(){return 0}function number$2(o){return o===null?NaN:+o}function*numbers(o,_){for(let $ of o)$!=null&&($=+$)>=$&&(yield $)}const ascendingBisect=bisector(ascending),bisectRight=ascendingBisect.right;bisector(number$2).center;class InternMap extends Map{constructor(_,$=keyof){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:$}}),_!=null)for(const[j,_e]of _)this.set(j,_e)}get(_){return super.get(intern_get(this,_))}has(_){return super.has(intern_get(this,_))}set(_,$){return super.set(intern_set(this,_),$)}delete(_){return super.delete(intern_delete(this,_))}}function intern_get({_intern:o,_key:_},$){const j=_($);return o.has(j)?o.get(j):$}function intern_set({_intern:o,_key:_},$){const j=_($);return o.has(j)?o.get(j):(o.set(j,$),$)}function intern_delete({_intern:o,_key:_},$){const j=_($);return o.has(j)&&($=o.get(j),o.delete(j)),$}function keyof(o){return o!==null&&typeof o=="object"?o.valueOf():o}function compareDefined(o=ascending){if(o===ascending)return ascendingDefined;if(typeof o!="function")throw new TypeError("compare is not a function");return(_,$)=>{const j=o(_,$);return j||j===0?j:(o($,$)===0)-(o(_,_)===0)}}function ascendingDefined(o,_){return(o==null||!(o>=o))-(_==null||!(_>=_))||(o<_?-1:o>_?1:0)}const e10=Math.sqrt(50),e5=Math.sqrt(10),e2=Math.sqrt(2);function tickSpec(o,_,$){const j=(_-o)/Math.max(0,$),_e=Math.floor(Math.log10(j)),et=j/Math.pow(10,_e),tt=et>=e10?10:et>=e5?5:et>=e2?2:1;let rt,nt,ot;return _e<0?(ot=Math.pow(10,-_e)/tt,rt=Math.round(o*ot),nt=Math.round(_*ot),rt/ot_&&--nt,ot=-ot):(ot=Math.pow(10,_e)*tt,rt=Math.round(o/ot),nt=Math.round(_/ot),rt*ot_&&--nt),nt0))return[];if(o===_)return[o];const j=_=_e))return[];const rt=et-_e+1,nt=new Array(rt);if(j)if(tt<0)for(let ot=0;ot=j)&&($=j);return $}function min(o,_){let $;for(const j of o)j!=null&&($>j||$===void 0&&j>=j)&&($=j);return $}function quickselect(o,_,$=0,j=1/0,_e){if(_=Math.floor(_),$=Math.floor(Math.max(0,$)),j=Math.floor(Math.min(o.length-1,j)),!($<=_&&_<=j))return o;for(_e=_e===void 0?ascendingDefined:compareDefined(_e);j>$;){if(j-$>600){const nt=j-$+1,ot=_-$+1,it=Math.log(nt),st=.5*Math.exp(2*it/3),at=.5*Math.sqrt(it*st*(nt-st)/nt)*(ot-nt/2<0?-1:1),lt=Math.max($,Math.floor(_-ot*st/nt+at)),ct=Math.min(j,Math.floor(_+(nt-ot)*st/nt+at));quickselect(o,_,lt,ct,_e)}const et=o[_];let tt=$,rt=j;for(swap(o,$,_),_e(o[j],et)>0&&swap(o,$,j);tt0;)--rt}_e(o[$],et)===0?swap(o,$,rt):(++rt,swap(o,rt,j)),rt<=_&&($=rt+1),_<=rt&&(j=rt-1)}return o}function swap(o,_,$){const j=o[_];o[_]=o[$],o[$]=j}function quantile$1(o,_,$){if(o=Float64Array.from(numbers(o)),!(!(j=o.length)||isNaN(_=+_))){if(_<=0||j<2)return min(o);if(_>=1)return max(o);var j,_e=(j-1)*_,et=Math.floor(_e),tt=max(quickselect(o,et).subarray(0,et+1)),rt=min(o.subarray(et+1));return tt+(rt-tt)*(_e-et)}}function quantileSorted(o,_,$=number$2){if(!(!(j=o.length)||isNaN(_=+_))){if(_<=0||j<2)return+$(o[0],0,o);if(_>=1)return+$(o[j-1],j-1,o);var j,_e=(j-1)*_,et=Math.floor(_e),tt=+$(o[et],et,o),rt=+$(o[et+1],et+1,o);return tt+(rt-tt)*(_e-et)}}function range(o,_,$){o=+o,_=+_,$=(_e=arguments.length)<2?(_=o,o=0,1):_e<3?1:+$;for(var j=-1,_e=Math.max(0,Math.ceil((_-o)/$))|0,et=new Array(_e);++j<_e;)et[j]=o+j*$;return et}function initRange(o,_){switch(arguments.length){case 0:break;case 1:this.range(o);break;default:this.range(_).domain(o);break}return this}function initInterpolator(o,_){switch(arguments.length){case 0:break;case 1:{typeof o=="function"?this.interpolator(o):this.range(o);break}default:{this.domain(o),typeof _=="function"?this.interpolator(_):this.range(_);break}}return this}const implicit=Symbol("implicit");function ordinal(){var o=new InternMap,_=[],$=[],j=implicit;function _e(et){let tt=o.get(et);if(tt===void 0){if(j!==implicit)return j;o.set(et,tt=_.push(et)-1)}return $[tt%$.length]}return _e.domain=function(et){if(!arguments.length)return _.slice();_=[],o=new InternMap;for(const tt of et)o.has(tt)||o.set(tt,_.push(tt)-1);return _e},_e.range=function(et){return arguments.length?($=Array.from(et),_e):$.slice()},_e.unknown=function(et){return arguments.length?(j=et,_e):j},_e.copy=function(){return ordinal(_,$).unknown(j)},initRange.apply(_e,arguments),_e}function band(){var o=ordinal().unknown(void 0),_=o.domain,$=o.range,j=0,_e=1,et,tt,rt=!1,nt=0,ot=0,it=.5;delete o.unknown;function st(){var at=_().length,lt=_e>8&15|_>>4&240,_>>4&15|_&240,(_&15)<<4|_&15,1):$===8?rgba(_>>24&255,_>>16&255,_>>8&255,(_&255)/255):$===4?rgba(_>>12&15|_>>8&240,_>>8&15|_>>4&240,_>>4&15|_&240,((_&15)<<4|_&15)/255):null):(_=reRgbInteger.exec(o))?new Rgb(_[1],_[2],_[3],1):(_=reRgbPercent.exec(o))?new Rgb(_[1]*255/100,_[2]*255/100,_[3]*255/100,1):(_=reRgbaInteger.exec(o))?rgba(_[1],_[2],_[3],_[4]):(_=reRgbaPercent.exec(o))?rgba(_[1]*255/100,_[2]*255/100,_[3]*255/100,_[4]):(_=reHslPercent.exec(o))?hsla(_[1],_[2]/100,_[3]/100,1):(_=reHslaPercent.exec(o))?hsla(_[1],_[2]/100,_[3]/100,_[4]):named.hasOwnProperty(o)?rgbn(named[o]):o==="transparent"?new Rgb(NaN,NaN,NaN,0):null}function rgbn(o){return new Rgb(o>>16&255,o>>8&255,o&255,1)}function rgba(o,_,$,j){return j<=0&&(o=_=$=NaN),new Rgb(o,_,$,j)}function rgbConvert(o){return o instanceof Color||(o=color(o)),o?(o=o.rgb(),new Rgb(o.r,o.g,o.b,o.opacity)):new Rgb}function rgb$1(o,_,$,j){return arguments.length===1?rgbConvert(o):new Rgb(o,_,$,j??1)}function Rgb(o,_,$,j){this.r=+o,this.g=+_,this.b=+$,this.opacity=+j}define(Rgb,rgb$1,extend(Color,{brighter(o){return o=o==null?brighter:Math.pow(brighter,o),new Rgb(this.r*o,this.g*o,this.b*o,this.opacity)},darker(o){return o=o==null?darker:Math.pow(darker,o),new Rgb(this.r*o,this.g*o,this.b*o,this.opacity)},rgb(){return this},clamp(){return new Rgb(clampi(this.r),clampi(this.g),clampi(this.b),clampa(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:rgb_formatHex,formatHex:rgb_formatHex,formatHex8:rgb_formatHex8,formatRgb:rgb_formatRgb,toString:rgb_formatRgb}));function rgb_formatHex(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}`}function rgb_formatHex8(){return`#${hex(this.r)}${hex(this.g)}${hex(this.b)}${hex((isNaN(this.opacity)?1:this.opacity)*255)}`}function rgb_formatRgb(){const o=clampa(this.opacity);return`${o===1?"rgb(":"rgba("}${clampi(this.r)}, ${clampi(this.g)}, ${clampi(this.b)}${o===1?")":`, ${o})`}`}function clampa(o){return isNaN(o)?1:Math.max(0,Math.min(1,o))}function clampi(o){return Math.max(0,Math.min(255,Math.round(o)||0))}function hex(o){return o=clampi(o),(o<16?"0":"")+o.toString(16)}function hsla(o,_,$,j){return j<=0?o=_=$=NaN:$<=0||$>=1?o=_=NaN:_<=0&&(o=NaN),new Hsl(o,_,$,j)}function hslConvert(o){if(o instanceof Hsl)return new Hsl(o.h,o.s,o.l,o.opacity);if(o instanceof Color||(o=color(o)),!o)return new Hsl;if(o instanceof Hsl)return o;o=o.rgb();var _=o.r/255,$=o.g/255,j=o.b/255,_e=Math.min(_,$,j),et=Math.max(_,$,j),tt=NaN,rt=et-_e,nt=(et+_e)/2;return rt?(_===et?tt=($-j)/rt+($0&&nt<1?0:tt,new Hsl(tt,rt,nt,o.opacity)}function hsl(o,_,$,j){return arguments.length===1?hslConvert(o):new Hsl(o,_,$,j??1)}function Hsl(o,_,$,j){this.h=+o,this.s=+_,this.l=+$,this.opacity=+j}define(Hsl,hsl,extend(Color,{brighter(o){return o=o==null?brighter:Math.pow(brighter,o),new Hsl(this.h,this.s,this.l*o,this.opacity)},darker(o){return o=o==null?darker:Math.pow(darker,o),new Hsl(this.h,this.s,this.l*o,this.opacity)},rgb(){var o=this.h%360+(this.h<0)*360,_=isNaN(o)||isNaN(this.s)?0:this.s,$=this.l,j=$+($<.5?$:1-$)*_,_e=2*$-j;return new Rgb(hsl2rgb(o>=240?o-240:o+120,_e,j),hsl2rgb(o,_e,j),hsl2rgb(o<120?o+240:o-120,_e,j),this.opacity)},clamp(){return new Hsl(clamph(this.h),clampt(this.s),clampt(this.l),clampa(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const o=clampa(this.opacity);return`${o===1?"hsl(":"hsla("}${clamph(this.h)}, ${clampt(this.s)*100}%, ${clampt(this.l)*100}%${o===1?")":`, ${o})`}`}}));function clamph(o){return o=(o||0)%360,o<0?o+360:o}function clampt(o){return Math.max(0,Math.min(1,o||0))}function hsl2rgb(o,_,$){return(o<60?_+($-_)*o/60:o<180?$:o<240?_+($-_)*(240-o)/60:_)*255}const constant=o=>()=>o;function linear$1(o,_){return function($){return o+$*_}}function exponential(o,_,$){return o=Math.pow(o,$),_=Math.pow(_,$)-o,$=1/$,function(j){return Math.pow(o+j*_,$)}}function gamma(o){return(o=+o)==1?nogamma:function(_,$){return $-_?exponential(_,$,o):constant(isNaN(_)?$:_)}}function nogamma(o,_){var $=_-o;return $?linear$1(o,$):constant(isNaN(o)?_:o)}const rgb=function o(_){var $=gamma(_);function j(_e,et){var tt=$((_e=rgb$1(_e)).r,(et=rgb$1(et)).r),rt=$(_e.g,et.g),nt=$(_e.b,et.b),ot=nogamma(_e.opacity,et.opacity);return function(it){return _e.r=tt(it),_e.g=rt(it),_e.b=nt(it),_e.opacity=ot(it),_e+""}}return j.gamma=o,j}(1);function numberArray(o,_){_||(_=[]);var $=o?Math.min(_.length,o.length):0,j=_.slice(),_e;return function(et){for(_e=0;_e<$;++_e)j[_e]=o[_e]*(1-et)+_[_e]*et;return j}}function isNumberArray(o){return ArrayBuffer.isView(o)&&!(o instanceof DataView)}function genericArray(o,_){var $=_?_.length:0,j=o?Math.min($,o.length):0,_e=new Array(j),et=new Array($),tt;for(tt=0;tt$&&(et=_.slice($,et),rt[tt]?rt[tt]+=et:rt[++tt]=et),(j=j[0])===(_e=_e[0])?rt[tt]?rt[tt]+=_e:rt[++tt]=_e:(rt[++tt]=null,nt.push({i:tt,x:interpolateNumber(j,_e)})),$=reB.lastIndex;return $<_.length&&(et=_.slice($),rt[tt]?rt[tt]+=et:rt[++tt]=et),rt.length<2?nt[0]?one(nt[0].x):zero(_):(_=nt.length,function(ot){for(var it=0,st;it<_;++it)rt[(st=nt[it]).i]=st.x(ot);return rt.join("")})}function interpolate(o,_){var $=typeof _,j;return _==null||$==="boolean"?constant(_):($==="number"?interpolateNumber:$==="string"?(j=color(_))?(_=j,rgb):string:_ instanceof color?rgb:_ instanceof Date?date$1:isNumberArray(_)?numberArray:Array.isArray(_)?genericArray:typeof _.valueOf!="function"&&typeof _.toString!="function"||isNaN(_)?object:interpolateNumber)(o,_)}function interpolateRound(o,_){return o=+o,_=+_,function($){return Math.round(o*(1-$)+_*$)}}function piecewise(o,_){_===void 0&&(_=o,o=interpolate);for(var $=0,j=_.length-1,_e=_[0],et=new Array(j<0?0:j);$_&&($=o,o=_,_=$),function(j){return Math.max(o,Math.min(_,j))}}function bimap(o,_,$){var j=o[0],_e=o[1],et=_[0],tt=_[1];return _e2?polymap:bimap,nt=ot=null,st}function st(at){return at==null||isNaN(at=+at)?et:(nt||(nt=rt(o.map(j),_,$)))(j(tt(at)))}return st.invert=function(at){return tt(_e((ot||(ot=rt(_,o.map(j),interpolateNumber)))(at)))},st.domain=function(at){return arguments.length?(o=Array.from(at,number$1),it()):o.slice()},st.range=function(at){return arguments.length?(_=Array.from(at),it()):_.slice()},st.rangeRound=function(at){return _=Array.from(at),$=interpolateRound,it()},st.clamp=function(at){return arguments.length?(tt=at?!0:identity$2,it()):tt!==identity$2},st.interpolate=function(at){return arguments.length?($=at,it()):$},st.unknown=function(at){return arguments.length?(et=at,st):et},function(at,lt){return j=at,_e=lt,it()}}function continuous(){return transformer$2()(identity$2,identity$2)}function formatDecimal(o){return Math.abs(o=Math.round(o))>=1e21?o.toLocaleString("en").replace(/,/g,""):o.toString(10)}function formatDecimalParts(o,_){if(!isFinite(o)||o===0)return null;var $=(o=_?o.toExponential(_-1):o.toExponential()).indexOf("e"),j=o.slice(0,$);return[j.length>1?j[0]+j.slice(2):j,+o.slice($+1)]}function exponent(o){return o=formatDecimalParts(Math.abs(o)),o?o[1]:NaN}function formatGroup(o,_){return function($,j){for(var _e=$.length,et=[],tt=0,rt=o[0],nt=0;_e>0&&rt>0&&(nt+rt+1>j&&(rt=Math.max(1,j-nt)),et.push($.substring(_e-=rt,_e+rt)),!((nt+=rt+1)>j));)rt=o[tt=(tt+1)%o.length];return et.reverse().join(_)}}function formatNumerals(o){return function(_){return _.replace(/[0-9]/g,function($){return o[+$]})}}var re=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function formatSpecifier(o){if(!(_=re.exec(o)))throw new Error("invalid format: "+o);var _;return new FormatSpecifier({fill:_[1],align:_[2],sign:_[3],symbol:_[4],zero:_[5],width:_[6],comma:_[7],precision:_[8]&&_[8].slice(1),trim:_[9],type:_[10]})}formatSpecifier.prototype=FormatSpecifier.prototype;function FormatSpecifier(o){this.fill=o.fill===void 0?" ":o.fill+"",this.align=o.align===void 0?">":o.align+"",this.sign=o.sign===void 0?"-":o.sign+"",this.symbol=o.symbol===void 0?"":o.symbol+"",this.zero=!!o.zero,this.width=o.width===void 0?void 0:+o.width,this.comma=!!o.comma,this.precision=o.precision===void 0?void 0:+o.precision,this.trim=!!o.trim,this.type=o.type===void 0?"":o.type+""}FormatSpecifier.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function formatTrim(o){e:for(var _=o.length,$=1,j=-1,_e;$<_;++$)switch(o[$]){case".":j=_e=$;break;case"0":j===0&&(j=$),_e=$;break;default:if(!+o[$])break e;j>0&&(j=0);break}return j>0?o.slice(0,j)+o.slice(_e+1):o}var prefixExponent;function formatPrefixAuto(o,_){var $=formatDecimalParts(o,_);if(!$)return prefixExponent=void 0,o.toPrecision(_);var j=$[0],_e=$[1],et=_e-(prefixExponent=Math.max(-8,Math.min(8,Math.floor(_e/3)))*3)+1,tt=j.length;return et===tt?j:et>tt?j+new Array(et-tt+1).join("0"):et>0?j.slice(0,et)+"."+j.slice(et):"0."+new Array(1-et).join("0")+formatDecimalParts(o,Math.max(0,_+et-1))[0]}function formatRounded(o,_){var $=formatDecimalParts(o,_);if(!$)return o+"";var j=$[0],_e=$[1];return _e<0?"0."+new Array(-_e).join("0")+j:j.length>_e+1?j.slice(0,_e+1)+"."+j.slice(_e+1):j+new Array(_e-j.length+2).join("0")}const formatTypes={"%":(o,_)=>(o*100).toFixed(_),b:o=>Math.round(o).toString(2),c:o=>o+"",d:formatDecimal,e:(o,_)=>o.toExponential(_),f:(o,_)=>o.toFixed(_),g:(o,_)=>o.toPrecision(_),o:o=>Math.round(o).toString(8),p:(o,_)=>formatRounded(o*100,_),r:formatRounded,s:formatPrefixAuto,X:o=>Math.round(o).toString(16).toUpperCase(),x:o=>Math.round(o).toString(16)};function identity$1(o){return o}var map=Array.prototype.map,prefixes=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function formatLocale$1(o){var _=o.grouping===void 0||o.thousands===void 0?identity$1:formatGroup(map.call(o.grouping,Number),o.thousands+""),$=o.currency===void 0?"":o.currency[0]+"",j=o.currency===void 0?"":o.currency[1]+"",_e=o.decimal===void 0?".":o.decimal+"",et=o.numerals===void 0?identity$1:formatNumerals(map.call(o.numerals,String)),tt=o.percent===void 0?"%":o.percent+"",rt=o.minus===void 0?"āˆ’":o.minus+"",nt=o.nan===void 0?"NaN":o.nan+"";function ot(st,at){st=formatSpecifier(st);var lt=st.fill,ct=st.align,ft=st.sign,dt=st.symbol,pt=st.zero,yt=st.width,vt=st.comma,wt=st.precision,Ct=st.trim,Pt=st.type;Pt==="n"?(vt=!0,Pt="g"):formatTypes[Pt]||(wt===void 0&&(wt=12),Ct=!0,Pt="g"),(pt||lt==="0"&&ct==="=")&&(pt=!0,lt="0",ct="=");var Bt=(at&&at.prefix!==void 0?at.prefix:"")+(dt==="$"?$:dt==="#"&&/[boxX]/.test(Pt)?"0"+Pt.toLowerCase():""),At=(dt==="$"?j:/[%p]/.test(Pt)?tt:"")+(at&&at.suffix!==void 0?at.suffix:""),kt=formatTypes[Pt],Ot=/[defgprs%]/.test(Pt);wt=wt===void 0?6:/[gprs]/.test(Pt)?Math.max(1,Math.min(21,wt)):Math.max(0,Math.min(20,wt));function Tt(ht){var bt=Bt,mt=At,gt,xt,Et;if(Pt==="c")mt=kt(ht)+mt,ht="";else{ht=+ht;var _t=ht<0||1/ht<0;if(ht=isNaN(ht)?nt:kt(Math.abs(ht),wt),Ct&&(ht=formatTrim(ht)),_t&&+ht==0&&ft!=="+"&&(_t=!1),bt=(_t?ft==="("?ft:rt:ft==="-"||ft==="("?"":ft)+bt,mt=(Pt==="s"&&!isNaN(ht)&&prefixExponent!==void 0?prefixes[8+prefixExponent/3]:"")+mt+(_t&&ft==="("?")":""),Ot){for(gt=-1,xt=ht.length;++gtEt||Et>57){mt=(Et===46?_e+ht.slice(gt+1):ht.slice(gt))+mt,ht=ht.slice(0,gt);break}}}vt&&!pt&&(ht=_(ht,1/0));var $t=bt.length+ht.length+mt.length,St=$t>1)+bt+ht+mt+St.slice($t);break;default:ht=St+bt+ht+mt;break}return et(ht)}return Tt.toString=function(){return st+""},Tt}function it(st,at){var lt=Math.max(-8,Math.min(8,Math.floor(exponent(at)/3)))*3,ct=Math.pow(10,-lt),ft=ot((st=formatSpecifier(st),st.type="f",st),{suffix:prefixes[8+lt/3]});return function(dt){return ft(ct*dt)}}return{format:ot,formatPrefix:it}}var locale$1,format,formatPrefix;defaultLocale$1({thousands:",",grouping:[3],currency:["$",""]});function defaultLocale$1(o){return locale$1=formatLocale$1(o),format=locale$1.format,formatPrefix=locale$1.formatPrefix,locale$1}function precisionFixed(o){return Math.max(0,-exponent(Math.abs(o)))}function precisionPrefix(o,_){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(exponent(_)/3)))*3-exponent(Math.abs(o)))}function precisionRound(o,_){return o=Math.abs(o),_=Math.abs(_)-o,Math.max(0,exponent(_)-exponent(o))+1}function tickFormat(o,_,$,j){var _e=tickStep(o,_,$),et;switch(j=formatSpecifier(j??",f"),j.type){case"s":{var tt=Math.max(Math.abs(o),Math.abs(_));return j.precision==null&&!isNaN(et=precisionPrefix(_e,tt))&&(j.precision=et),formatPrefix(j,tt)}case"":case"e":case"g":case"p":case"r":{j.precision==null&&!isNaN(et=precisionRound(_e,Math.max(Math.abs(o),Math.abs(_))))&&(j.precision=et-(j.type==="e"));break}case"f":case"%":{j.precision==null&&!isNaN(et=precisionFixed(_e))&&(j.precision=et-(j.type==="%")*2);break}}return format(j)}function linearish(o){var _=o.domain;return o.ticks=function($){var j=_();return ticks(j[0],j[j.length-1],$??10)},o.tickFormat=function($,j){var _e=_();return tickFormat(_e[0],_e[_e.length-1],$??10,j)},o.nice=function($){$==null&&($=10);var j=_(),_e=0,et=j.length-1,tt=j[_e],rt=j[et],nt,ot,it=10;for(rt0;){if(ot=tickIncrement(tt,rt,$),ot===nt)return j[_e]=tt,j[et]=rt,_(j);if(ot>0)tt=Math.floor(tt/ot)*ot,rt=Math.ceil(rt/ot)*ot;else if(ot<0)tt=Math.ceil(tt*ot)/ot,rt=Math.floor(rt*ot)/ot;else break;nt=ot}return o},o}function linear(){var o=continuous();return o.copy=function(){return copy$1(o,linear())},initRange.apply(o,arguments),linearish(o)}function identity(o){var _;function $(j){return j==null||isNaN(j=+j)?_:j}return $.invert=$,$.domain=$.range=function(j){return arguments.length?(o=Array.from(j,number$1),$):o.slice()},$.unknown=function(j){return arguments.length?(_=j,$):_},$.copy=function(){return identity(o).unknown(_)},o=arguments.length?Array.from(o,number$1):[0,1],linearish($)}function nice(o,_){o=o.slice();var $=0,j=o.length-1,_e=o[$],et=o[j],tt;return et<_e&&(tt=$,$=j,j=tt,tt=_e,_e=et,et=tt),o[$]=_.floor(_e),o[j]=_.ceil(et),o}function transformLog(o){return Math.log(o)}function transformExp(o){return Math.exp(o)}function transformLogn(o){return-Math.log(-o)}function transformExpn(o){return-Math.exp(-o)}function pow10(o){return isFinite(o)?+("1e"+o):o<0?0:o}function powp(o){return o===10?pow10:o===Math.E?Math.exp:_=>Math.pow(o,_)}function logp(o){return o===Math.E?Math.log:o===10&&Math.log10||o===2&&Math.log2||(o=Math.log(o),_=>Math.log(_)/o)}function reflect(o){return(_,$)=>-o(-_,$)}function loggish(o){const _=o(transformLog,transformExp),$=_.domain;let j=10,_e,et;function tt(){return _e=logp(j),et=powp(j),$()[0]<0?(_e=reflect(_e),et=reflect(et),o(transformLogn,transformExpn)):o(transformLog,transformExp),_}return _.base=function(rt){return arguments.length?(j=+rt,tt()):j},_.domain=function(rt){return arguments.length?($(rt),tt()):$()},_.ticks=rt=>{const nt=$();let ot=nt[0],it=nt[nt.length-1];const st=it0){for(;at<=lt;++at)for(ct=1;ctit)break;pt.push(ft)}}else for(;at<=lt;++at)for(ct=j-1;ct>=1;--ct)if(ft=at>0?ct/et(-at):ct*et(at),!(ftit)break;pt.push(ft)}pt.length*2{if(rt==null&&(rt=10),nt==null&&(nt=j===10?"s":","),typeof nt!="function"&&(!(j%1)&&(nt=formatSpecifier(nt)).precision==null&&(nt.trim=!0),nt=format(nt)),rt===1/0)return nt;const ot=Math.max(1,j*rt/_.ticks().length);return it=>{let st=it/et(Math.round(_e(it)));return st*j$(nice($(),{floor:rt=>et(Math.floor(_e(rt))),ceil:rt=>et(Math.ceil(_e(rt)))})),_}function log(){const o=loggish(transformer$2()).domain([1,10]);return o.copy=()=>copy$1(o,log()).base(o.base()),initRange.apply(o,arguments),o}function transformSymlog(o){return function(_){return Math.sign(_)*Math.log1p(Math.abs(_/o))}}function transformSymexp(o){return function(_){return Math.sign(_)*Math.expm1(Math.abs(_))*o}}function symlogish(o){var _=1,$=o(transformSymlog(_),transformSymexp(_));return $.constant=function(j){return arguments.length?o(transformSymlog(_=+j),transformSymexp(_)):_},linearish($)}function symlog(){var o=symlogish(transformer$2());return o.copy=function(){return copy$1(o,symlog()).constant(o.constant())},initRange.apply(o,arguments)}function transformPow(o){return function(_){return _<0?-Math.pow(-_,o):Math.pow(_,o)}}function transformSqrt(o){return o<0?-Math.sqrt(-o):Math.sqrt(o)}function transformSquare(o){return o<0?-o*o:o*o}function powish(o){var _=o(identity$2,identity$2),$=1;function j(){return $===1?o(identity$2,identity$2):$===.5?o(transformSqrt,transformSquare):o(transformPow($),transformPow(1/$))}return _.exponent=function(_e){return arguments.length?($=+_e,j()):$},linearish(_)}function pow(){var o=powish(transformer$2());return o.copy=function(){return copy$1(o,pow()).exponent(o.exponent())},initRange.apply(o,arguments),o}function sqrt(){return pow.apply(null,arguments).exponent(.5)}function square(o){return Math.sign(o)*o*o}function unsquare(o){return Math.sign(o)*Math.sqrt(Math.abs(o))}function radial(){var o=continuous(),_=[0,1],$=!1,j;function _e(et){var tt=unsquare(o(et));return isNaN(tt)?j:$?Math.round(tt):tt}return _e.invert=function(et){return o.invert(square(et))},_e.domain=function(et){return arguments.length?(o.domain(et),_e):o.domain()},_e.range=function(et){return arguments.length?(o.range((_=Array.from(et,number$1)).map(square)),_e):_.slice()},_e.rangeRound=function(et){return _e.range(et).round(!0)},_e.round=function(et){return arguments.length?($=!!et,_e):$},_e.clamp=function(et){return arguments.length?(o.clamp(et),_e):o.clamp()},_e.unknown=function(et){return arguments.length?(j=et,_e):j},_e.copy=function(){return radial(o.domain(),_).round($).clamp(o.clamp()).unknown(j)},initRange.apply(_e,arguments),linearish(_e)}function quantile(){var o=[],_=[],$=[],j;function _e(){var tt=0,rt=Math.max(1,_.length);for($=new Array(rt-1);++tt0?$[rt-1]:o[0],rt<$.length?$[rt]:o[o.length-1]]},et.domain=function(tt){if(!arguments.length)return o.slice();o=[];for(let rt of tt)rt!=null&&!isNaN(rt=+rt)&&o.push(rt);return o.sort(ascending),_e()},et.range=function(tt){return arguments.length?(_=Array.from(tt),_e()):_.slice()},et.unknown=function(tt){return arguments.length?(j=tt,et):j},et.quantiles=function(){return $.slice()},et.copy=function(){return quantile().domain(o).range(_).unknown(j)},initRange.apply(et,arguments)}function quantize(){var o=0,_=1,$=1,j=[.5],_e=[0,1],et;function tt(nt){return nt!=null&&nt<=nt?_e[bisectRight(j,nt,0,$)]:et}function rt(){var nt=-1;for(j=new Array($);++nt<$;)j[nt]=((nt+1)*_-(nt-$)*o)/($+1);return tt}return tt.domain=function(nt){return arguments.length?([o,_]=nt,o=+o,_=+_,rt()):[o,_]},tt.range=function(nt){return arguments.length?($=(_e=Array.from(nt)).length-1,rt()):_e.slice()},tt.invertExtent=function(nt){var ot=_e.indexOf(nt);return ot<0?[NaN,NaN]:ot<1?[o,j[0]]:ot>=$?[j[$-1],_]:[j[ot-1],j[ot]]},tt.unknown=function(nt){return arguments.length&&(et=nt),tt},tt.thresholds=function(){return j.slice()},tt.copy=function(){return quantize().domain([o,_]).range(_e).unknown(et)},initRange.apply(linearish(tt),arguments)}function threshold(){var o=[.5],_=[0,1],$,j=1;function _e(et){return et!=null&&et<=et?_[bisectRight(o,et,0,j)]:$}return _e.domain=function(et){return arguments.length?(o=Array.from(et),j=Math.min(o.length,_.length-1),_e):o.slice()},_e.range=function(et){return arguments.length?(_=Array.from(et),j=Math.min(o.length,_.length-1),_e):_.slice()},_e.invertExtent=function(et){var tt=_.indexOf(et);return[o[tt-1],o[tt]]},_e.unknown=function(et){return arguments.length?($=et,_e):$},_e.copy=function(){return threshold().domain(o).range(_).unknown($)},initRange.apply(_e,arguments)}const t0=new Date,t1=new Date;function timeInterval(o,_,$,j){function _e(et){return o(et=arguments.length===0?new Date:new Date(+et)),et}return _e.floor=et=>(o(et=new Date(+et)),et),_e.ceil=et=>(o(et=new Date(et-1)),_(et,1),o(et),et),_e.round=et=>{const tt=_e(et),rt=_e.ceil(et);return et-tt(_(et=new Date(+et),tt==null?1:Math.floor(tt)),et),_e.range=(et,tt,rt)=>{const nt=[];if(et=_e.ceil(et),rt=rt==null?1:Math.floor(rt),!(et0))return nt;let ot;do nt.push(ot=new Date(+et)),_(et,rt),o(et);while(ottimeInterval(tt=>{if(tt>=tt)for(;o(tt),!et(tt);)tt.setTime(tt-1)},(tt,rt)=>{if(tt>=tt)if(rt<0)for(;++rt<=0;)for(;_(tt,-1),!et(tt););else for(;--rt>=0;)for(;_(tt,1),!et(tt););}),$&&(_e.count=(et,tt)=>(t0.setTime(+et),t1.setTime(+tt),o(t0),o(t1),Math.floor($(t0,t1))),_e.every=et=>(et=Math.floor(et),!isFinite(et)||!(et>0)?null:et>1?_e.filter(j?tt=>j(tt)%et===0:tt=>_e.count(0,tt)%et===0):_e)),_e}const millisecond=timeInterval(()=>{},(o,_)=>{o.setTime(+o+_)},(o,_)=>_-o);millisecond.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?timeInterval(_=>{_.setTime(Math.floor(_/o)*o)},(_,$)=>{_.setTime(+_+$*o)},(_,$)=>($-_)/o):millisecond);millisecond.range;const durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,second=timeInterval(o=>{o.setTime(o-o.getMilliseconds())},(o,_)=>{o.setTime(+o+_*durationSecond)},(o,_)=>(_-o)/durationSecond,o=>o.getUTCSeconds());second.range;const timeMinute=timeInterval(o=>{o.setTime(o-o.getMilliseconds()-o.getSeconds()*durationSecond)},(o,_)=>{o.setTime(+o+_*durationMinute)},(o,_)=>(_-o)/durationMinute,o=>o.getMinutes());timeMinute.range;const utcMinute=timeInterval(o=>{o.setUTCSeconds(0,0)},(o,_)=>{o.setTime(+o+_*durationMinute)},(o,_)=>(_-o)/durationMinute,o=>o.getUTCMinutes());utcMinute.range;const timeHour=timeInterval(o=>{o.setTime(o-o.getMilliseconds()-o.getSeconds()*durationSecond-o.getMinutes()*durationMinute)},(o,_)=>{o.setTime(+o+_*durationHour)},(o,_)=>(_-o)/durationHour,o=>o.getHours());timeHour.range;const utcHour=timeInterval(o=>{o.setUTCMinutes(0,0,0)},(o,_)=>{o.setTime(+o+_*durationHour)},(o,_)=>(_-o)/durationHour,o=>o.getUTCHours());utcHour.range;const timeDay=timeInterval(o=>o.setHours(0,0,0,0),(o,_)=>o.setDate(o.getDate()+_),(o,_)=>(_-o-(_.getTimezoneOffset()-o.getTimezoneOffset())*durationMinute)/durationDay,o=>o.getDate()-1);timeDay.range;const utcDay=timeInterval(o=>{o.setUTCHours(0,0,0,0)},(o,_)=>{o.setUTCDate(o.getUTCDate()+_)},(o,_)=>(_-o)/durationDay,o=>o.getUTCDate()-1);utcDay.range;const unixDay=timeInterval(o=>{o.setUTCHours(0,0,0,0)},(o,_)=>{o.setUTCDate(o.getUTCDate()+_)},(o,_)=>(_-o)/durationDay,o=>Math.floor(o/durationDay));unixDay.range;function timeWeekday(o){return timeInterval(_=>{_.setDate(_.getDate()-(_.getDay()+7-o)%7),_.setHours(0,0,0,0)},(_,$)=>{_.setDate(_.getDate()+$*7)},(_,$)=>($-_-($.getTimezoneOffset()-_.getTimezoneOffset())*durationMinute)/durationWeek)}const timeSunday=timeWeekday(0),timeMonday=timeWeekday(1),timeTuesday=timeWeekday(2),timeWednesday=timeWeekday(3),timeThursday=timeWeekday(4),timeFriday=timeWeekday(5),timeSaturday=timeWeekday(6);timeSunday.range;timeMonday.range;timeTuesday.range;timeWednesday.range;timeThursday.range;timeFriday.range;timeSaturday.range;function utcWeekday(o){return timeInterval(_=>{_.setUTCDate(_.getUTCDate()-(_.getUTCDay()+7-o)%7),_.setUTCHours(0,0,0,0)},(_,$)=>{_.setUTCDate(_.getUTCDate()+$*7)},(_,$)=>($-_)/durationWeek)}const utcSunday=utcWeekday(0),utcMonday=utcWeekday(1),utcTuesday=utcWeekday(2),utcWednesday=utcWeekday(3),utcThursday=utcWeekday(4),utcFriday=utcWeekday(5),utcSaturday=utcWeekday(6);utcSunday.range;utcMonday.range;utcTuesday.range;utcWednesday.range;utcThursday.range;utcFriday.range;utcSaturday.range;const timeMonth=timeInterval(o=>{o.setDate(1),o.setHours(0,0,0,0)},(o,_)=>{o.setMonth(o.getMonth()+_)},(o,_)=>_.getMonth()-o.getMonth()+(_.getFullYear()-o.getFullYear())*12,o=>o.getMonth());timeMonth.range;const utcMonth=timeInterval(o=>{o.setUTCDate(1),o.setUTCHours(0,0,0,0)},(o,_)=>{o.setUTCMonth(o.getUTCMonth()+_)},(o,_)=>_.getUTCMonth()-o.getUTCMonth()+(_.getUTCFullYear()-o.getUTCFullYear())*12,o=>o.getUTCMonth());utcMonth.range;const timeYear=timeInterval(o=>{o.setMonth(0,1),o.setHours(0,0,0,0)},(o,_)=>{o.setFullYear(o.getFullYear()+_)},(o,_)=>_.getFullYear()-o.getFullYear(),o=>o.getFullYear());timeYear.every=o=>!isFinite(o=Math.floor(o))||!(o>0)?null:timeInterval(_=>{_.setFullYear(Math.floor(_.getFullYear()/o)*o),_.setMonth(0,1),_.setHours(0,0,0,0)},(_,$)=>{_.setFullYear(_.getFullYear()+$*o)});timeYear.range;const utcYear=timeInterval(o=>{o.setUTCMonth(0,1),o.setUTCHours(0,0,0,0)},(o,_)=>{o.setUTCFullYear(o.getUTCFullYear()+_)},(o,_)=>_.getUTCFullYear()-o.getUTCFullYear(),o=>o.getUTCFullYear());utcYear.every=o=>!isFinite(o=Math.floor(o))||!(o>0)?null:timeInterval(_=>{_.setUTCFullYear(Math.floor(_.getUTCFullYear()/o)*o),_.setUTCMonth(0,1),_.setUTCHours(0,0,0,0)},(_,$)=>{_.setUTCFullYear(_.getUTCFullYear()+$*o)});utcYear.range;function ticker(o,_,$,j,_e,et){const tt=[[second,1,durationSecond],[second,5,5*durationSecond],[second,15,15*durationSecond],[second,30,30*durationSecond],[et,1,durationMinute],[et,5,5*durationMinute],[et,15,15*durationMinute],[et,30,30*durationMinute],[_e,1,durationHour],[_e,3,3*durationHour],[_e,6,6*durationHour],[_e,12,12*durationHour],[j,1,durationDay],[j,2,2*durationDay],[$,1,durationWeek],[_,1,durationMonth],[_,3,3*durationMonth],[o,1,durationYear]];function rt(ot,it,st){const at=itdt).right(tt,at);if(lt===tt.length)return o.every(tickStep(ot/durationYear,it/durationYear,st));if(lt===0)return millisecond.every(Math.max(tickStep(ot,it,st),1));const[ct,ft]=tt[at/tt[lt-1][2]53)return null;"w"in Lt||(Lt.w=1),"Z"in Lt?(Kt=utcDate(newDate(Lt.y,0,1)),Jt=Kt.getUTCDay(),Kt=Jt>4||Jt===0?utcMonday.ceil(Kt):utcMonday(Kt),Kt=utcDay.offset(Kt,(Lt.V-1)*7),Lt.y=Kt.getUTCFullYear(),Lt.m=Kt.getUTCMonth(),Lt.d=Kt.getUTCDate()+(Lt.w+6)%7):(Kt=localDate(newDate(Lt.y,0,1)),Jt=Kt.getDay(),Kt=Jt>4||Jt===0?timeMonday.ceil(Kt):timeMonday(Kt),Kt=timeDay.offset(Kt,(Lt.V-1)*7),Lt.y=Kt.getFullYear(),Lt.m=Kt.getMonth(),Lt.d=Kt.getDate()+(Lt.w+6)%7)}else("W"in Lt||"U"in Lt)&&("w"in Lt||(Lt.w="u"in Lt?Lt.u%7:"W"in Lt?1:0),Jt="Z"in Lt?utcDate(newDate(Lt.y,0,1)).getUTCDay():localDate(newDate(Lt.y,0,1)).getDay(),Lt.m=0,Lt.d="W"in Lt?(Lt.w+6)%7+Lt.W*7-(Jt+5)%7:Lt.w+Lt.U*7-(Jt+6)%7);return"Z"in Lt?(Lt.H+=Lt.Z/100|0,Lt.M+=Lt.Z%100,utcDate(Lt)):localDate(Lt)}}function At(qt,Xt,Ut,Lt){for(var Ht=0,Kt=Xt.length,Jt=Ut.length,tr,nr;Ht=Jt)return-1;if(tr=Xt.charCodeAt(Ht++),tr===37){if(tr=Xt.charAt(Ht++),nr=Ct[tr in pads?Xt.charAt(Ht++):tr],!nr||(Lt=nr(qt,Ut,Lt))<0)return-1}else if(tr!=Ut.charCodeAt(Lt++))return-1}return Lt}function kt(qt,Xt,Ut){var Lt=ot.exec(Xt.slice(Ut));return Lt?(qt.p=it.get(Lt[0].toLowerCase()),Ut+Lt[0].length):-1}function Ot(qt,Xt,Ut){var Lt=lt.exec(Xt.slice(Ut));return Lt?(qt.w=ct.get(Lt[0].toLowerCase()),Ut+Lt[0].length):-1}function Tt(qt,Xt,Ut){var Lt=st.exec(Xt.slice(Ut));return Lt?(qt.w=at.get(Lt[0].toLowerCase()),Ut+Lt[0].length):-1}function ht(qt,Xt,Ut){var Lt=pt.exec(Xt.slice(Ut));return Lt?(qt.m=yt.get(Lt[0].toLowerCase()),Ut+Lt[0].length):-1}function bt(qt,Xt,Ut){var Lt=ft.exec(Xt.slice(Ut));return Lt?(qt.m=dt.get(Lt[0].toLowerCase()),Ut+Lt[0].length):-1}function mt(qt,Xt,Ut){return At(qt,_,Xt,Ut)}function gt(qt,Xt,Ut){return At(qt,$,Xt,Ut)}function xt(qt,Xt,Ut){return At(qt,j,Xt,Ut)}function Et(qt){return tt[qt.getDay()]}function _t(qt){return et[qt.getDay()]}function $t(qt){return nt[qt.getMonth()]}function St(qt){return rt[qt.getMonth()]}function Rt(qt){return _e[+(qt.getHours()>=12)]}function It(qt){return 1+~~(qt.getMonth()/3)}function Mt(qt){return tt[qt.getUTCDay()]}function Vt(qt){return et[qt.getUTCDay()]}function Gt(qt){return nt[qt.getUTCMonth()]}function zt(qt){return rt[qt.getUTCMonth()]}function jt(qt){return _e[+(qt.getUTCHours()>=12)]}function Ft(qt){return 1+~~(qt.getUTCMonth()/3)}return{format:function(qt){var Xt=Pt(qt+="",vt);return Xt.toString=function(){return qt},Xt},parse:function(qt){var Xt=Bt(qt+="",!1);return Xt.toString=function(){return qt},Xt},utcFormat:function(qt){var Xt=Pt(qt+="",wt);return Xt.toString=function(){return qt},Xt},utcParse:function(qt){var Xt=Bt(qt+="",!0);return Xt.toString=function(){return qt},Xt}}}var pads={"-":"",_:" ",0:"0"},numberRe=/^\s*\d+/,percentRe=/^%/,requoteRe=/[\\^$*+?|[\]().{}]/g;function pad(o,_,$){var j=o<0?"-":"",_e=(j?-o:o)+"",et=_e.length;return j+(et<$?new Array($-et+1).join(_)+_e:_e)}function requote(o){return o.replace(requoteRe,"\\$&")}function formatRe(o){return new RegExp("^(?:"+o.map(requote).join("|")+")","i")}function formatLookup(o){return new Map(o.map((_,$)=>[_.toLowerCase(),$]))}function parseWeekdayNumberSunday(o,_,$){var j=numberRe.exec(_.slice($,$+1));return j?(o.w=+j[0],$+j[0].length):-1}function parseWeekdayNumberMonday(o,_,$){var j=numberRe.exec(_.slice($,$+1));return j?(o.u=+j[0],$+j[0].length):-1}function parseWeekNumberSunday(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.U=+j[0],$+j[0].length):-1}function parseWeekNumberISO(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.V=+j[0],$+j[0].length):-1}function parseWeekNumberMonday(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.W=+j[0],$+j[0].length):-1}function parseFullYear(o,_,$){var j=numberRe.exec(_.slice($,$+4));return j?(o.y=+j[0],$+j[0].length):-1}function parseYear(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.y=+j[0]+(+j[0]>68?1900:2e3),$+j[0].length):-1}function parseZone(o,_,$){var j=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(_.slice($,$+6));return j?(o.Z=j[1]?0:-(j[2]+(j[3]||"00")),$+j[0].length):-1}function parseQuarter(o,_,$){var j=numberRe.exec(_.slice($,$+1));return j?(o.q=j[0]*3-3,$+j[0].length):-1}function parseMonthNumber(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.m=j[0]-1,$+j[0].length):-1}function parseDayOfMonth(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.d=+j[0],$+j[0].length):-1}function parseDayOfYear(o,_,$){var j=numberRe.exec(_.slice($,$+3));return j?(o.m=0,o.d=+j[0],$+j[0].length):-1}function parseHour24(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.H=+j[0],$+j[0].length):-1}function parseMinutes(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.M=+j[0],$+j[0].length):-1}function parseSeconds(o,_,$){var j=numberRe.exec(_.slice($,$+2));return j?(o.S=+j[0],$+j[0].length):-1}function parseMilliseconds(o,_,$){var j=numberRe.exec(_.slice($,$+3));return j?(o.L=+j[0],$+j[0].length):-1}function parseMicroseconds(o,_,$){var j=numberRe.exec(_.slice($,$+6));return j?(o.L=Math.floor(j[0]/1e3),$+j[0].length):-1}function parseLiteralPercent(o,_,$){var j=percentRe.exec(_.slice($,$+1));return j?$+j[0].length:-1}function parseUnixTimestamp(o,_,$){var j=numberRe.exec(_.slice($));return j?(o.Q=+j[0],$+j[0].length):-1}function parseUnixTimestampSeconds(o,_,$){var j=numberRe.exec(_.slice($));return j?(o.s=+j[0],$+j[0].length):-1}function formatDayOfMonth(o,_){return pad(o.getDate(),_,2)}function formatHour24(o,_){return pad(o.getHours(),_,2)}function formatHour12(o,_){return pad(o.getHours()%12||12,_,2)}function formatDayOfYear(o,_){return pad(1+timeDay.count(timeYear(o),o),_,3)}function formatMilliseconds(o,_){return pad(o.getMilliseconds(),_,3)}function formatMicroseconds(o,_){return formatMilliseconds(o,_)+"000"}function formatMonthNumber(o,_){return pad(o.getMonth()+1,_,2)}function formatMinutes(o,_){return pad(o.getMinutes(),_,2)}function formatSeconds(o,_){return pad(o.getSeconds(),_,2)}function formatWeekdayNumberMonday(o){var _=o.getDay();return _===0?7:_}function formatWeekNumberSunday(o,_){return pad(timeSunday.count(timeYear(o)-1,o),_,2)}function dISO(o){var _=o.getDay();return _>=4||_===0?timeThursday(o):timeThursday.ceil(o)}function formatWeekNumberISO(o,_){return o=dISO(o),pad(timeThursday.count(timeYear(o),o)+(timeYear(o).getDay()===4),_,2)}function formatWeekdayNumberSunday(o){return o.getDay()}function formatWeekNumberMonday(o,_){return pad(timeMonday.count(timeYear(o)-1,o),_,2)}function formatYear(o,_){return pad(o.getFullYear()%100,_,2)}function formatYearISO(o,_){return o=dISO(o),pad(o.getFullYear()%100,_,2)}function formatFullYear(o,_){return pad(o.getFullYear()%1e4,_,4)}function formatFullYearISO(o,_){var $=o.getDay();return o=$>=4||$===0?timeThursday(o):timeThursday.ceil(o),pad(o.getFullYear()%1e4,_,4)}function formatZone(o){var _=o.getTimezoneOffset();return(_>0?"-":(_*=-1,"+"))+pad(_/60|0,"0",2)+pad(_%60,"0",2)}function formatUTCDayOfMonth(o,_){return pad(o.getUTCDate(),_,2)}function formatUTCHour24(o,_){return pad(o.getUTCHours(),_,2)}function formatUTCHour12(o,_){return pad(o.getUTCHours()%12||12,_,2)}function formatUTCDayOfYear(o,_){return pad(1+utcDay.count(utcYear(o),o),_,3)}function formatUTCMilliseconds(o,_){return pad(o.getUTCMilliseconds(),_,3)}function formatUTCMicroseconds(o,_){return formatUTCMilliseconds(o,_)+"000"}function formatUTCMonthNumber(o,_){return pad(o.getUTCMonth()+1,_,2)}function formatUTCMinutes(o,_){return pad(o.getUTCMinutes(),_,2)}function formatUTCSeconds(o,_){return pad(o.getUTCSeconds(),_,2)}function formatUTCWeekdayNumberMonday(o){var _=o.getUTCDay();return _===0?7:_}function formatUTCWeekNumberSunday(o,_){return pad(utcSunday.count(utcYear(o)-1,o),_,2)}function UTCdISO(o){var _=o.getUTCDay();return _>=4||_===0?utcThursday(o):utcThursday.ceil(o)}function formatUTCWeekNumberISO(o,_){return o=UTCdISO(o),pad(utcThursday.count(utcYear(o),o)+(utcYear(o).getUTCDay()===4),_,2)}function formatUTCWeekdayNumberSunday(o){return o.getUTCDay()}function formatUTCWeekNumberMonday(o,_){return pad(utcMonday.count(utcYear(o)-1,o),_,2)}function formatUTCYear(o,_){return pad(o.getUTCFullYear()%100,_,2)}function formatUTCYearISO(o,_){return o=UTCdISO(o),pad(o.getUTCFullYear()%100,_,2)}function formatUTCFullYear(o,_){return pad(o.getUTCFullYear()%1e4,_,4)}function formatUTCFullYearISO(o,_){var $=o.getUTCDay();return o=$>=4||$===0?utcThursday(o):utcThursday.ceil(o),pad(o.getUTCFullYear()%1e4,_,4)}function formatUTCZone(){return"+0000"}function formatLiteralPercent(){return"%"}function formatUnixTimestamp(o){return+o}function formatUnixTimestampSeconds(o){return Math.floor(+o/1e3)}var locale,timeFormat,utcFormat;defaultLocale({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function defaultLocale(o){return locale=formatLocale(o),timeFormat=locale.format,locale.parse,utcFormat=locale.utcFormat,locale.utcParse,locale}function date(o){return new Date(o)}function number(o){return o instanceof Date?+o:+new Date(+o)}function calendar(o,_,$,j,_e,et,tt,rt,nt,ot){var it=continuous(),st=it.invert,at=it.domain,lt=ot(".%L"),ct=ot(":%S"),ft=ot("%I:%M"),dt=ot("%I %p"),pt=ot("%a %d"),yt=ot("%b %d"),vt=ot("%B"),wt=ot("%Y");function Ct(Pt){return(nt(Pt)_(_e/(o.length-1)))},$.quantiles=function(j){return Array.from({length:j+1},(_e,et)=>quantile$1(o,et/j))},$.copy=function(){return sequentialQuantile(_).domain(o)},initInterpolator.apply($,arguments)}function transformer(){var o=0,_=.5,$=1,j=1,_e,et,tt,rt,nt,ot=identity$2,it,st=!1,at;function lt(ft){return isNaN(ft=+ft)?at:(ft=.5+((ft=+it(ft))-et)*(j*fto.chartData,selectChartDataAndAlwaysIgnoreIndexes=createSelector([selectChartDataWithIndexes],o=>{var _=o.chartData!=null?o.chartData.length-1:0;return{chartData:o.chartData,computedData:o.computedData,dataEndIndex:_,dataStartIndex:0}}),selectChartDataWithIndexesIfNotInPanoramaPosition4=(o,_,$,j)=>j?selectChartDataAndAlwaysIgnoreIndexes(o):selectChartDataWithIndexes(o);function isWellFormedNumberDomain(o){if(Array.isArray(o)&&o.length===2){var[_,$]=o;if(isWellBehavedNumber(_)&&isWellBehavedNumber($))return!0}return!1}function extendDomain(o,_,$){return $?o:[Math.min(o[0],_[0]),Math.max(o[1],_[1])]}function numericalDomainSpecifiedWithoutRequiringData(o,_){if(_&&typeof o!="function"&&Array.isArray(o)&&o.length===2){var[$,j]=o,_e,et;if(isWellBehavedNumber($))_e=$;else if(typeof $=="function")return;if(isWellBehavedNumber(j))et=j;else if(typeof j=="function")return;var tt=[_e,et];if(isWellFormedNumberDomain(tt))return tt}}function parseNumericalUserDomain(o,_,$){if(!(!$&&_==null)){if(typeof o=="function"&&_!=null)try{var j=o(_,$);if(isWellFormedNumberDomain(j))return extendDomain(j,_,$)}catch{}if(Array.isArray(o)&&o.length===2){var[_e,et]=o,tt,rt;if(_e==="auto")_!=null&&(tt=Math.min(..._));else if(isNumber(_e))tt=_e;else if(typeof _e=="function")try{_!=null&&(tt=_e(_==null?void 0:_[0]))}catch{}else if(typeof _e=="string"&&MIN_VALUE_REG.test(_e)){var nt=MIN_VALUE_REG.exec(_e);if(nt==null||nt[1]==null||_==null)tt=void 0;else{var ot=+nt[1];tt=_[0]-ot}}else tt=_==null?void 0:_[0];if(et==="auto")_!=null&&(rt=Math.max(..._));else if(isNumber(et))rt=et;else if(typeof et=="function")try{_!=null&&(rt=et(_==null?void 0:_[1]))}catch{}else if(typeof et=="string"&&MAX_VALUE_REG.test(et)){var it=MAX_VALUE_REG.exec(et);if(it==null||it[1]==null||_==null)rt=void 0;else{var st=+it[1];rt=_[1]+st}}else rt=_==null?void 0:_[1];var at=[tt,rt];if(isWellFormedNumberDomain(at))return _==null?at:extendDomain(at,_,$)}}}var MAX_DIGITS=1e9,defaults={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},Decimal,external=!0,decimalError="[DecimalError] ",invalidArgument=decimalError+"Invalid argument: ",exponentOutOfRange=decimalError+"Exponent out of range: ",mathfloor=Math.floor,mathpow=Math.pow,isDecimal=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ONE,BASE=1e7,LOG_BASE=7,MAX_SAFE_INTEGER=9007199254740991,MAX_E=mathfloor(MAX_SAFE_INTEGER/LOG_BASE),P={};P.absoluteValue=P.abs=function(){var o=new this.constructor(this);return o.s&&(o.s=1),o};P.comparedTo=P.cmp=function(o){var _,$,j,_e,et=this;if(o=new et.constructor(o),et.s!==o.s)return et.s||-o.s;if(et.e!==o.e)return et.e>o.e^et.s<0?1:-1;for(j=et.d.length,_e=o.d.length,_=0,$=j<_e?j:_e;_<$;++_)if(et.d[_]!==o.d[_])return et.d[_]>o.d[_]^et.s<0?1:-1;return j===_e?0:j>_e^et.s<0?1:-1};P.decimalPlaces=P.dp=function(){var o=this,_=o.d.length-1,$=(_-o.e)*LOG_BASE;if(_=o.d[_],_)for(;_%10==0;_/=10)$--;return $<0?0:$};P.dividedBy=P.div=function(o){return divide(this,new this.constructor(o))};P.dividedToIntegerBy=P.idiv=function(o){var _=this,$=_.constructor;return round(divide(_,new $(o),0,1),$.precision)};P.equals=P.eq=function(o){return!this.cmp(o)};P.exponent=function(){return getBase10Exponent(this)};P.greaterThan=P.gt=function(o){return this.cmp(o)>0};P.greaterThanOrEqualTo=P.gte=function(o){return this.cmp(o)>=0};P.isInteger=P.isint=function(){return this.e>this.d.length-2};P.isNegative=P.isneg=function(){return this.s<0};P.isPositive=P.ispos=function(){return this.s>0};P.isZero=function(){return this.s===0};P.lessThan=P.lt=function(o){return this.cmp(o)<0};P.lessThanOrEqualTo=P.lte=function(o){return this.cmp(o)<1};P.logarithm=P.log=function(o){var _,$=this,j=$.constructor,_e=j.precision,et=_e+5;if(o===void 0)o=new j(10);else if(o=new j(o),o.s<1||o.eq(ONE))throw Error(decimalError+"NaN");if($.s<1)throw Error(decimalError+($.s?"NaN":"-Infinity"));return $.eq(ONE)?new j(0):(external=!1,_=divide(ln($,et),ln(o,et),et),external=!0,round(_,_e))};P.minus=P.sub=function(o){var _=this;return o=new _.constructor(o),_.s==o.s?subtract(_,o):add(_,(o.s=-o.s,o))};P.modulo=P.mod=function(o){var _,$=this,j=$.constructor,_e=j.precision;if(o=new j(o),!o.s)throw Error(decimalError+"NaN");return $.s?(external=!1,_=divide($,o,0,1).times(o),external=!0,$.minus(_)):round(new j($),_e)};P.naturalExponential=P.exp=function(){return exp(this)};P.naturalLogarithm=P.ln=function(){return ln(this)};P.negated=P.neg=function(){var o=new this.constructor(this);return o.s=-o.s||0,o};P.plus=P.add=function(o){var _=this;return o=new _.constructor(o),_.s==o.s?add(_,o):subtract(_,(o.s=-o.s,o))};P.precision=P.sd=function(o){var _,$,j,_e=this;if(o!==void 0&&o!==!!o&&o!==1&&o!==0)throw Error(invalidArgument+o);if(_=getBase10Exponent(_e)+1,j=_e.d.length-1,$=j*LOG_BASE+1,j=_e.d[j],j){for(;j%10==0;j/=10)$--;for(j=_e.d[0];j>=10;j/=10)$++}return o&&_>$?_:$};P.squareRoot=P.sqrt=function(){var o,_,$,j,_e,et,tt,rt=this,nt=rt.constructor;if(rt.s<1){if(!rt.s)return new nt(0);throw Error(decimalError+"NaN")}for(o=getBase10Exponent(rt),external=!1,_e=Math.sqrt(+rt),_e==0||_e==1/0?(_=digitsToString(rt.d),(_.length+o)%2==0&&(_+="0"),_e=Math.sqrt(_),o=mathfloor((o+1)/2)-(o<0||o%2),_e==1/0?_="5e"+o:(_=_e.toExponential(),_=_.slice(0,_.indexOf("e")+1)+o),j=new nt(_)):j=new nt(_e.toString()),$=nt.precision,_e=tt=$+3;;)if(et=j,j=et.plus(divide(rt,et,tt+2)).times(.5),digitsToString(et.d).slice(0,tt)===(_=digitsToString(j.d)).slice(0,tt)){if(_=_.slice(tt-3,tt+1),_e==tt&&_=="4999"){if(round(et,$+1,0),et.times(et).eq(rt)){j=et;break}}else if(_!="9999")break;tt+=4}return external=!0,round(j,$)};P.times=P.mul=function(o){var _,$,j,_e,et,tt,rt,nt,ot,it=this,st=it.constructor,at=it.d,lt=(o=new st(o)).d;if(!it.s||!o.s)return new st(0);for(o.s*=it.s,$=it.e+o.e,nt=at.length,ot=lt.length,nt=0;){for(_=0,_e=nt+j;_e>j;)rt=et[_e]+lt[j]*at[_e-j-1]+_,et[_e--]=rt%BASE|0,_=rt/BASE|0;et[_e]=(et[_e]+_)%BASE|0}for(;!et[--tt];)et.pop();return _?++$:et.shift(),o.d=et,o.e=$,external?round(o,st.precision):o};P.toDecimalPlaces=P.todp=function(o,_){var $=this,j=$.constructor;return $=new j($),o===void 0?$:(checkInt32(o,0,MAX_DIGITS),_===void 0?_=j.rounding:checkInt32(_,0,8),round($,o+getBase10Exponent($)+1,_))};P.toExponential=function(o,_){var $,j=this,_e=j.constructor;return o===void 0?$=toString(j,!0):(checkInt32(o,0,MAX_DIGITS),_===void 0?_=_e.rounding:checkInt32(_,0,8),j=round(new _e(j),o+1,_),$=toString(j,!0,o+1)),$};P.toFixed=function(o,_){var $,j,_e=this,et=_e.constructor;return o===void 0?toString(_e):(checkInt32(o,0,MAX_DIGITS),_===void 0?_=et.rounding:checkInt32(_,0,8),j=round(new et(_e),o+getBase10Exponent(_e)+1,_),$=toString(j.abs(),!1,o+getBase10Exponent(j)+1),_e.isneg()&&!_e.isZero()?"-"+$:$)};P.toInteger=P.toint=function(){var o=this,_=o.constructor;return round(new _(o),getBase10Exponent(o)+1,_.rounding)};P.toNumber=function(){return+this};P.toPower=P.pow=function(o){var _,$,j,_e,et,tt,rt=this,nt=rt.constructor,ot=12,it=+(o=new nt(o));if(!o.s)return new nt(ONE);if(rt=new nt(rt),!rt.s){if(o.s<1)throw Error(decimalError+"Infinity");return rt}if(rt.eq(ONE))return rt;if(j=nt.precision,o.eq(ONE))return round(rt,j);if(_=o.e,$=o.d.length-1,tt=_>=$,et=rt.s,tt){if(($=it<0?-it:it)<=MAX_SAFE_INTEGER){for(_e=new nt(ONE),_=Math.ceil(j/LOG_BASE+4),external=!1;$%2&&(_e=_e.times(rt),truncate(_e.d,_)),$=mathfloor($/2),$!==0;)rt=rt.times(rt),truncate(rt.d,_);return external=!0,o.s<0?new nt(ONE).div(_e):round(_e,j)}}else if(et<0)throw Error(decimalError+"NaN");return et=et<0&&o.d[Math.max(_,$)]&1?-1:1,rt.s=1,external=!1,_e=o.times(ln(rt,j+ot)),external=!0,_e=exp(_e),_e.s=et,_e};P.toPrecision=function(o,_){var $,j,_e=this,et=_e.constructor;return o===void 0?($=getBase10Exponent(_e),j=toString(_e,$<=et.toExpNeg||$>=et.toExpPos)):(checkInt32(o,1,MAX_DIGITS),_===void 0?_=et.rounding:checkInt32(_,0,8),_e=round(new et(_e),o,_),$=getBase10Exponent(_e),j=toString(_e,o<=$||$<=et.toExpNeg,o)),j};P.toSignificantDigits=P.tosd=function(o,_){var $=this,j=$.constructor;return o===void 0?(o=j.precision,_=j.rounding):(checkInt32(o,1,MAX_DIGITS),_===void 0?_=j.rounding:checkInt32(_,0,8)),round(new j($),o,_)};P.toString=P.valueOf=P.val=P.toJSON=P[Symbol.for("nodejs.util.inspect.custom")]=function(){var o=this,_=getBase10Exponent(o),$=o.constructor;return toString(o,_<=$.toExpNeg||_>=$.toExpPos)};function add(o,_){var $,j,_e,et,tt,rt,nt,ot,it=o.constructor,st=it.precision;if(!o.s||!_.s)return _.s||(_=new it(o)),external?round(_,st):_;if(nt=o.d,ot=_.d,tt=o.e,_e=_.e,nt=nt.slice(),et=tt-_e,et){for(et<0?(j=nt,et=-et,rt=ot.length):(j=ot,_e=tt,rt=nt.length),tt=Math.ceil(st/LOG_BASE),rt=tt>rt?tt+1:rt+1,et>rt&&(et=rt,j.length=1),j.reverse();et--;)j.push(0);j.reverse()}for(rt=nt.length,et=ot.length,rt-et<0&&(et=rt,j=ot,ot=nt,nt=j),$=0;et;)$=(nt[--et]=nt[et]+ot[et]+$)/BASE|0,nt[et]%=BASE;for($&&(nt.unshift($),++_e),rt=nt.length;nt[--rt]==0;)nt.pop();return _.d=nt,_.e=_e,external?round(_,st):_}function checkInt32(o,_,$){if(o!==~~o||o<_||o>$)throw Error(invalidArgument+o)}function digitsToString(o){var _,$,j,_e=o.length-1,et="",tt=o[0];if(_e>0){for(et+=tt,_=1;_<_e;_++)j=o[_]+"",$=LOG_BASE-j.length,$&&(et+=getZeroString($)),et+=j;tt=o[_],j=tt+"",$=LOG_BASE-j.length,$&&(et+=getZeroString($))}else if(tt===0)return"0";for(;tt%10===0;)tt/=10;return et+tt}var divide=function(){function o(j,_e){var et,tt=0,rt=j.length;for(j=j.slice();rt--;)et=j[rt]*_e+tt,j[rt]=et%BASE|0,tt=et/BASE|0;return tt&&j.unshift(tt),j}function _(j,_e,et,tt){var rt,nt;if(et!=tt)nt=et>tt?1:-1;else for(rt=nt=0;rt_e[rt]?1:-1;break}return nt}function $(j,_e,et){for(var tt=0;et--;)j[et]-=tt,tt=j[et]<_e[et]?1:0,j[et]=tt*BASE+j[et]-_e[et];for(;!j[0]&&j.length>1;)j.shift()}return function(j,_e,et,tt){var rt,nt,ot,it,st,at,lt,ct,ft,dt,pt,yt,vt,wt,Ct,Pt,Bt,At,kt=j.constructor,Ot=j.s==_e.s?1:-1,Tt=j.d,ht=_e.d;if(!j.s)return new kt(j);if(!_e.s)throw Error(decimalError+"Division by zero");for(nt=j.e-_e.e,Bt=ht.length,Ct=Tt.length,lt=new kt(Ot),ct=lt.d=[],ot=0;ht[ot]==(Tt[ot]||0);)++ot;if(ht[ot]>(Tt[ot]||0)&&--nt,et==null?yt=et=kt.precision:tt?yt=et+(getBase10Exponent(j)-getBase10Exponent(_e))+1:yt=et,yt<0)return new kt(0);if(yt=yt/LOG_BASE+2|0,ot=0,Bt==1)for(it=0,ht=ht[0],yt++;(ot1&&(ht=o(ht,it),Tt=o(Tt,it),Bt=ht.length,Ct=Tt.length),wt=Bt,ft=Tt.slice(0,Bt),dt=ft.length;dt=BASE/2&&++Pt;do it=0,rt=_(ht,ft,Bt,dt),rt<0?(pt=ft[0],Bt!=dt&&(pt=pt*BASE+(ft[1]||0)),it=pt/Pt|0,it>1?(it>=BASE&&(it=BASE-1),st=o(ht,it),at=st.length,dt=ft.length,rt=_(st,ft,at,dt),rt==1&&(it--,$(st,Bt16)throw Error(exponentOutOfRange+getBase10Exponent(o));if(!o.s)return new it(ONE);for(external=!1,rt=st,tt=new it(.03125);o.abs().gte(.1);)o=o.times(tt),ot+=5;for(j=Math.log(mathpow(2,ot))/Math.LN10*2+5|0,rt+=j,$=_e=et=new it(ONE),it.precision=rt;;){if(_e=round(_e.times(o),rt),$=$.times(++nt),tt=et.plus(divide(_e,$,rt)),digitsToString(tt.d).slice(0,rt)===digitsToString(et.d).slice(0,rt)){for(;ot--;)et=round(et.times(et),rt);return it.precision=st,_==null?(external=!0,round(et,st)):et}et=tt}}function getBase10Exponent(o){for(var _=o.e*LOG_BASE,$=o.d[0];$>=10;$/=10)_++;return _}function getLn10(o,_,$){if(_>o.LN10.sd())throw external=!0,$&&(o.precision=$),Error(decimalError+"LN10 precision limit exceeded");return round(new o(o.LN10),_)}function getZeroString(o){for(var _="";o--;)_+="0";return _}function ln(o,_){var $,j,_e,et,tt,rt,nt,ot,it,st=1,at=10,lt=o,ct=lt.d,ft=lt.constructor,dt=ft.precision;if(lt.s<1)throw Error(decimalError+(lt.s?"NaN":"-Infinity"));if(lt.eq(ONE))return new ft(0);if(_==null?(external=!1,ot=dt):ot=_,lt.eq(10))return _==null&&(external=!0),getLn10(ft,ot);if(ot+=at,ft.precision=ot,$=digitsToString(ct),j=$.charAt(0),et=getBase10Exponent(lt),Math.abs(et)<15e14){for(;j<7&&j!=1||j==1&&$.charAt(1)>3;)lt=lt.times(o),$=digitsToString(lt.d),j=$.charAt(0),st++;et=getBase10Exponent(lt),j>1?(lt=new ft("0."+$),et++):lt=new ft(j+"."+$.slice(1))}else return nt=getLn10(ft,ot+2,dt).times(et+""),lt=ln(new ft(j+"."+$.slice(1)),ot-at).plus(nt),ft.precision=dt,_==null?(external=!0,round(lt,dt)):lt;for(rt=tt=lt=divide(lt.minus(ONE),lt.plus(ONE),ot),it=round(lt.times(lt),ot),_e=3;;){if(tt=round(tt.times(it),ot),nt=rt.plus(divide(tt,new ft(_e),ot)),digitsToString(nt.d).slice(0,ot)===digitsToString(rt.d).slice(0,ot))return rt=rt.times(2),et!==0&&(rt=rt.plus(getLn10(ft,ot+2,dt).times(et+""))),rt=divide(rt,new ft(st),ot),ft.precision=dt,_==null?(external=!0,round(rt,dt)):rt;rt=nt,_e+=2}}function parseDecimal(o,_){var $,j,_e;for(($=_.indexOf("."))>-1&&(_=_.replace(".","")),(j=_.search(/e/i))>0?($<0&&($=j),$+=+_.slice(j+1),_=_.substring(0,j)):$<0&&($=_.length),j=0;_.charCodeAt(j)===48;)++j;for(_e=_.length;_.charCodeAt(_e-1)===48;)--_e;if(_=_.slice(j,_e),_){if(_e-=j,$=$-j-1,o.e=mathfloor($/LOG_BASE),o.d=[],j=($+1)%LOG_BASE,$<0&&(j+=LOG_BASE),j<_e){for(j&&o.d.push(+_.slice(0,j)),_e-=LOG_BASE;j<_e;)o.d.push(+_.slice(j,j+=LOG_BASE));_=_.slice(j),j=LOG_BASE-_.length}else j-=_e;for(;j--;)_+="0";if(o.d.push(+_),external&&(o.e>MAX_E||o.e<-MAX_E))throw Error(exponentOutOfRange+$)}else o.s=0,o.e=0,o.d=[0];return o}function round(o,_,$){var j,_e,et,tt,rt,nt,ot,it,st=o.d;for(tt=1,et=st[0];et>=10;et/=10)tt++;if(j=_-tt,j<0)j+=LOG_BASE,_e=_,ot=st[it=0];else{if(it=Math.ceil((j+1)/LOG_BASE),et=st.length,it>=et)return o;for(ot=et=st[it],tt=1;et>=10;et/=10)tt++;j%=LOG_BASE,_e=j-LOG_BASE+tt}if($!==void 0&&(et=mathpow(10,tt-_e-1),rt=ot/et%10|0,nt=_<0||st[it+1]!==void 0||ot%et,nt=$<4?(rt||nt)&&($==0||$==(o.s<0?3:2)):rt>5||rt==5&&($==4||nt||$==6&&(j>0?_e>0?ot/mathpow(10,tt-_e):0:st[it-1])%10&1||$==(o.s<0?8:7))),_<1||!st[0])return nt?(et=getBase10Exponent(o),st.length=1,_=_-et-1,st[0]=mathpow(10,(LOG_BASE-_%LOG_BASE)%LOG_BASE),o.e=mathfloor(-_/LOG_BASE)||0):(st.length=1,st[0]=o.e=o.s=0),o;if(j==0?(st.length=it,et=1,it--):(st.length=it+1,et=mathpow(10,LOG_BASE-j),st[it]=_e>0?(ot/mathpow(10,tt-_e)%mathpow(10,_e)|0)*et:0),nt)for(;;)if(it==0){(st[0]+=et)==BASE&&(st[0]=1,++o.e);break}else{if(st[it]+=et,st[it]!=BASE)break;st[it--]=0,et=1}for(j=st.length;st[--j]===0;)st.pop();if(external&&(o.e>MAX_E||o.e<-MAX_E))throw Error(exponentOutOfRange+getBase10Exponent(o));return o}function subtract(o,_){var $,j,_e,et,tt,rt,nt,ot,it,st,at=o.constructor,lt=at.precision;if(!o.s||!_.s)return _.s?_.s=-_.s:_=new at(o),external?round(_,lt):_;if(nt=o.d,st=_.d,j=_.e,ot=o.e,nt=nt.slice(),tt=ot-j,tt){for(it=tt<0,it?($=nt,tt=-tt,rt=st.length):($=st,j=ot,rt=nt.length),_e=Math.max(Math.ceil(lt/LOG_BASE),rt)+2,tt>_e&&(tt=_e,$.length=1),$.reverse(),_e=tt;_e--;)$.push(0);$.reverse()}else{for(_e=nt.length,rt=st.length,it=_e0;--_e)nt[rt++]=0;for(_e=st.length;_e>tt;){if(nt[--_e]0?et=et.charAt(0)+"."+et.slice(1)+getZeroString(j):tt>1&&(et=et.charAt(0)+"."+et.slice(1)),et=et+(_e<0?"e":"e+")+_e):_e<0?(et="0."+getZeroString(-_e-1)+et,$&&(j=$-tt)>0&&(et+=getZeroString(j))):_e>=tt?(et+=getZeroString(_e+1-tt),$&&(j=$-_e-1)>0&&(et=et+"."+getZeroString(j))):((j=_e+1)0&&(_e+1===tt&&(et+="."),et+=getZeroString(j))),o.s<0?"-"+et:et}function truncate(o,_){if(o.length>_)return o.length=_,!0}function clone(o){var _,$,j;function _e(et){var tt=this;if(!(tt instanceof _e))return new _e(et);if(tt.constructor=_e,et instanceof _e){tt.s=et.s,tt.e=et.e,tt.d=(et=et.d)?et.slice():et;return}if(typeof et=="number"){if(et*0!==0)throw Error(invalidArgument+et);if(et>0)tt.s=1;else if(et<0)et=-et,tt.s=-1;else{tt.s=0,tt.e=0,tt.d=[0];return}if(et===~~et&&et<1e7){tt.e=0,tt.d=[et];return}return parseDecimal(tt,et.toString())}else if(typeof et!="string")throw Error(invalidArgument+et);if(et.charCodeAt(0)===45?(et=et.slice(1),tt.s=-1):tt.s=1,isDecimal.test(et))parseDecimal(tt,et);else throw Error(invalidArgument+et)}if(_e.prototype=P,_e.ROUND_UP=0,_e.ROUND_DOWN=1,_e.ROUND_CEIL=2,_e.ROUND_FLOOR=3,_e.ROUND_HALF_UP=4,_e.ROUND_HALF_DOWN=5,_e.ROUND_HALF_EVEN=6,_e.ROUND_HALF_CEIL=7,_e.ROUND_HALF_FLOOR=8,_e.clone=clone,_e.config=_e.set=config,o===void 0&&(o={}),o)for(j=["precision","rounding","toExpNeg","toExpPos","LN10"],_=0;_=_e[_+1]&&j<=_e[_+2])this[$]=j;else throw Error(invalidArgument+$+": "+j);if((j=o[$="LN10"])!==void 0)if(j==Math.LN10)this[$]=new this(j);else throw Error(invalidArgument+$+": "+j);return this}var Decimal=clone(defaults);ONE=new Decimal(1);const Decimal$1=Decimal;function getDigitCount(o){var _;return o===0?_=1:_=Math.floor(new Decimal$1(o).abs().log(10).toNumber())+1,_}function rangeStep(o,_,$){for(var j=new Decimal$1(o),_e=0,et=[];j.lt(_)&&_e<1e5;)et.push(j.toNumber()),j=j.add($),_e++;return et}var getValidInterval=o=>{var[_,$]=o,[j,_e]=[_,$];return _>$&&([j,_e]=[$,_]),[j,_e]},getFormatStep=(o,_,$)=>{if(o.lte(0))return new Decimal$1(0);var j=getDigitCount(o.toNumber()),_e=new Decimal$1(10).pow(j),et=o.div(_e),tt=j!==1?.05:.1,rt=new Decimal$1(Math.ceil(et.div(tt).toNumber())).add($).mul(tt),nt=rt.mul(_e);return _?new Decimal$1(nt.toNumber()):new Decimal$1(Math.ceil(nt.toNumber()))},getTickOfSingleValue=(o,_,$)=>{var j=new Decimal$1(1),_e=new Decimal$1(o);if(!_e.isint()&&$){var et=Math.abs(o);et<1?(j=new Decimal$1(10).pow(getDigitCount(o)-1),_e=new Decimal$1(Math.floor(_e.div(j).toNumber())).mul(j)):et>1&&(_e=new Decimal$1(Math.floor(o)))}else o===0?_e=new Decimal$1(Math.floor((_-1)/2)):$||(_e=new Decimal$1(Math.floor(o)));for(var tt=Math.floor((_-1)/2),rt=[],nt=0;nt<_;nt++)rt.push(_e.add(new Decimal$1(nt-tt).mul(j)).toNumber());return rt},_calculateStep=function o(_,$,j,_e){var et=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite(($-_)/(j-1)))return{step:new Decimal$1(0),tickMin:new Decimal$1(0),tickMax:new Decimal$1(0)};var tt=getFormatStep(new Decimal$1($).sub(_).div(j-1),_e,et),rt;_<=0&&$>=0?rt=new Decimal$1(0):(rt=new Decimal$1(_).add($).div(2),rt=rt.sub(new Decimal$1(rt).mod(tt)));var nt=Math.ceil(rt.sub(_).div(tt).toNumber()),ot=Math.ceil(new Decimal$1($).sub(rt).div(tt).toNumber()),it=nt+ot+1;return it>j?_calculateStep(_,$,j,_e,et+1):(it0?ot+(j-it):ot,nt=$>0?nt:nt+(j-it)),{step:tt,tickMin:rt.sub(new Decimal$1(nt).mul(tt)),tickMax:rt.add(new Decimal$1(ot).mul(tt))})},getNiceTickValues=function o(_){var[$,j]=_,_e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,tt=Math.max(_e,2),[rt,nt]=getValidInterval([$,j]);if(rt===-1/0||nt===1/0){var ot=nt===1/0?[rt,...Array(_e-1).fill(1/0)]:[...Array(_e-1).fill(-1/0),nt];return $>j?ot.reverse():ot}if(rt===nt)return getTickOfSingleValue(rt,_e,et);var{step:it,tickMin:st,tickMax:at}=_calculateStep(rt,nt,tt,et,0),lt=rangeStep(st,at.add(new Decimal$1(.1).mul(it)),it);return $>j?lt.reverse():lt},getTickValuesFixedDomain=function o(_,$){var[j,_e]=_,et=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,[tt,rt]=getValidInterval([j,_e]);if(tt===-1/0||rt===1/0)return[j,_e];if(tt===rt)return[tt];var nt=Math.max($,2),ot=getFormatStep(new Decimal$1(rt).sub(tt).div(nt-1),et,0),it=[...rangeStep(new Decimal$1(tt),new Decimal$1(rt),ot),rt];return et===!1&&(it=it.map(st=>Math.round(st))),j>_e?it.reverse():it},selectBarCategoryGap=o=>o.rootProps.barCategoryGap,selectStackOffsetType=o=>o.rootProps.stackOffset,selectReverseStackOrder=o=>o.rootProps.reverseStackOrder,selectChartName=o=>o.options.chartName,selectSyncId=o=>o.rootProps.syncId,selectSyncMethod=o=>o.rootProps.syncMethod,selectEventEmitter=o=>o.options.eventEmitter,DefaultZIndexes={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},defaultPolarAngleAxisProps={allowDecimals:!1,allowDataOverflow:!1,angleAxisId:0,reversed:!1,scale:"auto",tick:!0,type:"auto"},defaultPolarRadiusAxisProps={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,includeHidden:!1,radiusAxisId:0,reversed:!1,scale:"auto",tick:!0,tickCount:5,type:"auto"},combineAxisRangeWithReverse=(o,_)=>{if(!(!o||!_))return o!=null&&o.reversed?[_[1],_[0]]:_};function getAxisTypeBasedOnLayout(o,_,$){if($!=="auto")return $;if(o!=null)return isCategoricalAxis(o,_)?"category":"number"}function ownKeys$j(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$j(o){for(var _=1;_{if(_!=null)return o.polarAxis.angleAxis[_]},selectAngleAxis=createSelector([selectAngleAxisNoDefaults,selectPolarChartLayout],(o,_)=>{var $;if(o!=null)return o;var j=($=getAxisTypeBasedOnLayout(_,"angleAxis",implicitAngleAxis.type))!==null&&$!==void 0?$:"category";return _objectSpread$j(_objectSpread$j({},implicitAngleAxis),{},{type:j})}),selectRadiusAxisNoDefaults=(o,_)=>o.polarAxis.radiusAxis[_],selectRadiusAxis=createSelector([selectRadiusAxisNoDefaults,selectPolarChartLayout],(o,_)=>{var $;if(o!=null)return o;var j=($=getAxisTypeBasedOnLayout(_,"radiusAxis",implicitRadiusAxis.type))!==null&&$!==void 0?$:"category";return _objectSpread$j(_objectSpread$j({},implicitRadiusAxis),{},{type:j})}),selectPolarOptions=o=>o.polarOptions,selectMaxRadius=createSelector([selectChartWidth,selectChartHeight,selectChartOffsetInternal],getMaxRadius),selectInnerRadius=createSelector([selectPolarOptions,selectMaxRadius],(o,_)=>{if(o!=null)return getPercentValue(o.innerRadius,_,0)}),selectOuterRadius=createSelector([selectPolarOptions,selectMaxRadius],(o,_)=>{if(o!=null)return getPercentValue(o.outerRadius,_,_*.8)}),combineAngleAxisRange=o=>{if(o==null)return[0,0];var{startAngle:_,endAngle:$}=o;return[_,$]},selectAngleAxisRange=createSelector([selectPolarOptions],combineAngleAxisRange);createSelector([selectAngleAxis,selectAngleAxisRange],combineAxisRangeWithReverse);var selectRadiusAxisRange=createSelector([selectMaxRadius,selectInnerRadius,selectOuterRadius],(o,_,$)=>{if(!(o==null||_==null||$==null))return[_,$]});createSelector([selectRadiusAxis,selectRadiusAxisRange],combineAxisRangeWithReverse);var selectPolarViewBox=createSelector([selectChartLayout,selectPolarOptions,selectInnerRadius,selectOuterRadius,selectChartWidth,selectChartHeight],(o,_,$,j,_e,et)=>{if(!(o!=="centric"&&o!=="radial"||_==null||$==null||j==null)){var{cx:tt,cy:rt,startAngle:nt,endAngle:ot}=_;return{cx:getPercentValue(tt,_e,_e/2),cy:getPercentValue(rt,et,et/2),innerRadius:$,outerRadius:j,startAngle:nt,endAngle:ot,clockWise:!1}}}),pickAxisType=(o,_)=>_,pickAxisId=(o,_,$)=>$;function getStackSeriesIdentifier(o){return o==null?void 0:o.id}function combineDisplayedStackedData(o,_,$){var{chartData:j=[]}=_,{allowDuplicatedCategory:_e,dataKey:et}=$,tt=new Map;return o.forEach(rt=>{var nt,ot=(nt=rt.data)!==null&&nt!==void 0?nt:j;if(!(ot==null||ot.length===0)){var it=getStackSeriesIdentifier(rt);ot.forEach((st,at)=>{var lt=et==null||_e?at:String(getValueByDataKey(st,et,null)),ct=getValueByDataKey(st,rt.dataKey,0),ft;tt.has(lt)?ft=tt.get(lt):ft={},Object.assign(ft,{[it]:ct}),tt.set(lt,ft)})}}),Array.from(tt.values())}function isStacked(o){return"stackId"in o&&o.stackId!=null&&o.dataKey!=null}var numberDomainEqualityCheck=(o,_)=>o===_?!0:o==null||_==null?!1:o[0]===_[0]&&o[1]===_[1];function emptyArraysAreEqualCheck(o,_){return Array.isArray(o)&&Array.isArray(_)&&o.length===0&&_.length===0?!0:o===_}function arrayContentsAreEqualCheck(o,_){if(o.length===_.length){for(var $=0;${var _=selectChartLayout(o);return _==="horizontal"?"xAxis":_==="vertical"?"yAxis":_==="centric"?"angleAxis":"radiusAxis"},selectTooltipAxisId=o=>o.tooltip.settings.axisId;function getD3ScaleFromType(o){if(o in d3Scales)return d3Scales[o]();var _="scale".concat(upperFirst(o));if(_ in d3Scales)return d3Scales[_]()}function d3ScaleToRechartsScale(o){var _=o.ticks,$=o.bandwidth,j=o.range(),_e=[Math.min(...j),Math.max(...j)];return{domain:()=>o.domain(),range:function(et){function tt(){return et.apply(this,arguments)}return tt.toString=function(){return et.toString()},tt}(()=>_e),rangeMin:()=>_e[0],rangeMax:()=>_e[1],isInRange(et){var tt=_e[0],rt=_e[1];return tt<=rt?et>=tt&&et<=rt:et>=rt&&et<=tt},bandwidth:$?()=>$.call(o):void 0,ticks:_?et=>_.call(o,et):void 0,map:(et,tt)=>{var rt=o(et);if(rt!=null){if(o.bandwidth&&tt!==null&&tt!==void 0&&tt.position){var nt=o.bandwidth();switch(tt.position){case"middle":rt+=nt/2;break;case"end":rt+=nt;break}}return rt}}}}function rechartsScaleFactory(o,_,$){if(typeof o=="function")return d3ScaleToRechartsScale(o.copy().domain(_).range($));if(o!=null){var j=getD3ScaleFromType(o);if(j!=null)return j.domain(_).range($),d3ScaleToRechartsScale(j)}}var combineCheckedDomain=(o,_)=>{if(_!=null)switch(o){case"linear":{if(!isWellFormedNumberDomain(_)){for(var $,j,_e=0;_e<_.length;_e++){var et=_[_e];isWellBehavedNumber(et)&&(($===void 0||et<$)&&($=et),(j===void 0||et>j)&&(j=et))}return $!==void 0&&j!==void 0?[$,j]:void 0}return _}default:return _}};function ownKeys$i(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$i(o){for(var _=1;_o.cartesianAxis.xAxis[_],selectXAxisSettings=(o,_)=>{var $=selectXAxisSettingsNoDefaults(o,_);return $??implicitXAxis},implicitYAxis={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:defaultNumericDomain,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,width:DEFAULT_Y_AXIS_WIDTH},selectYAxisSettingsNoDefaults=(o,_)=>o.cartesianAxis.yAxis[_],selectYAxisSettings=(o,_)=>{var $=selectYAxisSettingsNoDefaults(o,_);return $??implicitYAxis},implicitZAxis={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},selectZAxisSettings=(o,_)=>{var $=o.cartesianAxis.zAxis[_];return $??implicitZAxis},selectBaseAxis=(o,_,$)=>{switch(_){case"xAxis":return selectXAxisSettings(o,$);case"yAxis":return selectYAxisSettings(o,$);case"zAxis":return selectZAxisSettings(o,$);case"angleAxis":return selectAngleAxis(o,$);case"radiusAxis":return selectRadiusAxis(o,$);default:throw new Error("Unexpected axis type: ".concat(_))}},selectCartesianAxisSettings=(o,_,$)=>{switch(_){case"xAxis":return selectXAxisSettings(o,$);case"yAxis":return selectYAxisSettings(o,$);default:throw new Error("Unexpected axis type: ".concat(_))}},selectRenderableAxisSettings=(o,_,$)=>{switch(_){case"xAxis":return selectXAxisSettings(o,$);case"yAxis":return selectYAxisSettings(o,$);case"angleAxis":return selectAngleAxis(o,$);case"radiusAxis":return selectRadiusAxis(o,$);default:throw new Error("Unexpected axis type: ".concat(_))}},selectHasBar=o=>o.graphicalItems.cartesianItems.some(_=>_.type==="bar")||o.graphicalItems.polarItems.some(_=>_.type==="radialBar");function itemAxisPredicate(o,_){return $=>{switch(o){case"xAxis":return"xAxisId"in $&&$.xAxisId===_;case"yAxis":return"yAxisId"in $&&$.yAxisId===_;case"zAxis":return"zAxisId"in $&&$.zAxisId===_;case"angleAxis":return"angleAxisId"in $&&$.angleAxisId===_;case"radiusAxis":return"radiusAxisId"in $&&$.radiusAxisId===_;default:return!1}}}var selectUnfilteredCartesianItems=o=>o.graphicalItems.cartesianItems,selectAxisPredicate=createSelector([pickAxisType,pickAxisId],itemAxisPredicate),combineGraphicalItemsSettings=(o,_,$)=>o.filter($).filter(j=>(_==null?void 0:_.includeHidden)===!0?!0:!j.hide),selectCartesianItemsSettings=createSelector([selectUnfilteredCartesianItems,selectBaseAxis,selectAxisPredicate],combineGraphicalItemsSettings,{memoizeOptions:{resultEqualityCheck:emptyArraysAreEqualCheck}}),selectStackedCartesianItemsSettings=createSelector([selectCartesianItemsSettings],o=>o.filter(_=>_.type==="area"||_.type==="bar").filter(isStacked)),filterGraphicalNotStackedItems=o=>o.filter(_=>!("stackId"in _)||_.stackId===void 0),selectCartesianItemsSettingsExceptStacked=createSelector([selectCartesianItemsSettings],filterGraphicalNotStackedItems),combineGraphicalItemsData=o=>o.map(_=>_.data).filter(Boolean).flat(1),selectCartesianGraphicalItemsData=createSelector([selectCartesianItemsSettings],combineGraphicalItemsData,{memoizeOptions:{resultEqualityCheck:emptyArraysAreEqualCheck}}),combineDisplayedData=(o,_)=>{var{chartData:$=[],dataStartIndex:j,dataEndIndex:_e}=_;return o.length>0?o:$.slice(j,_e+1)},selectDisplayedData=createSelector([selectCartesianGraphicalItemsData,selectChartDataWithIndexesIfNotInPanoramaPosition4],combineDisplayedData),combineAppliedValues=(o,_,$)=>(_==null?void 0:_.dataKey)!=null?o.map(j=>({value:getValueByDataKey(j,_.dataKey)})):$.length>0?$.map(j=>j.dataKey).flatMap(j=>o.map(_e=>({value:getValueByDataKey(_e,j)}))):o.map(j=>({value:j})),selectAllAppliedValues=createSelector([selectDisplayedData,selectBaseAxis,selectCartesianItemsSettings],combineAppliedValues);function isErrorBarRelevantForAxisType(o,_){switch(o){case"xAxis":return _.direction==="x";case"yAxis":return _.direction==="y";default:return!1}}function makeNumber(o){if(isNumOrStr(o)||o instanceof Date){var _=Number(o);if(isWellBehavedNumber(_))return _}}function makeDomain(o){if(Array.isArray(o)){var _=[makeNumber(o[0]),makeNumber(o[1])];return isWellFormedNumberDomain(_)?_:void 0}var $=makeNumber(o);if($!=null)return[$,$]}function onlyAllowNumbers(o){return o.map(makeNumber).filter(isNotNil)}function getErrorDomainByDataKey(o,_,$){return!$||typeof _!="number"||isNan(_)?[]:$.length?onlyAllowNumbers($.flatMap(j=>{var _e=getValueByDataKey(o,j.dataKey),et,tt;if(Array.isArray(_e)?[et,tt]=_e:et=tt=_e,!(!isWellBehavedNumber(et)||!isWellBehavedNumber(tt)))return[_-et,_+tt]})):[]}var selectTooltipAxis=o=>{var _=selectTooltipAxisType(o),$=selectTooltipAxisId(o);return selectRenderableAxisSettings(o,_,$)},selectTooltipAxisDataKey=createSelector([selectTooltipAxis],o=>o==null?void 0:o.dataKey),selectDisplayedStackedData=createSelector([selectStackedCartesianItemsSettings,selectChartDataWithIndexesIfNotInPanoramaPosition4,selectTooltipAxis],combineDisplayedStackedData),combineStackGroups=(o,_,$,j)=>{var _e={},et=_.reduce((tt,rt)=>{if(rt.stackId==null)return tt;var nt=tt[rt.stackId];return nt==null&&(nt=[]),nt.push(rt),tt[rt.stackId]=nt,tt},_e);return Object.fromEntries(Object.entries(et).map(tt=>{var[rt,nt]=tt,ot=j?[...nt].reverse():nt,it=ot.map(getStackSeriesIdentifier);return[rt,{stackedData:getStackedData(o,it,$),graphicalItems:ot}]}))},selectStackGroups=createSelector([selectDisplayedStackedData,selectStackedCartesianItemsSettings,selectStackOffsetType,selectReverseStackOrder],combineStackGroups),combineDomainOfStackGroups=(o,_,$,j)=>{var{dataStartIndex:_e,dataEndIndex:et}=_;if(j==null&&$!=="zAxis"){var tt=getDomainOfStackGroups(o,_e,et);if(!(tt!=null&&tt[0]===0&&tt[1]===0))return tt}},selectAllowsDataOverflow=createSelector([selectBaseAxis],o=>o.allowDataOverflow),getDomainDefinition=o=>{var _;if(o==null||!("domain"in o))return defaultNumericDomain;if(o.domain!=null)return o.domain;if("ticks"in o&&o.ticks!=null){if(o.type==="number"){var $=onlyAllowNumbers(o.ticks);return[Math.min(...$),Math.max(...$)]}if(o.type==="category")return o.ticks.map(String)}return(_=o==null?void 0:o.domain)!==null&&_!==void 0?_:defaultNumericDomain},selectDomainDefinition=createSelector([selectBaseAxis],getDomainDefinition),selectDomainFromUserPreference=createSelector([selectDomainDefinition,selectAllowsDataOverflow],numericalDomainSpecifiedWithoutRequiringData),selectDomainOfStackGroups=createSelector([selectStackGroups,selectChartDataWithIndexes,pickAxisType,selectDomainFromUserPreference],combineDomainOfStackGroups,{memoizeOptions:{resultEqualityCheck:numberDomainEqualityCheck}}),selectAllErrorBarSettings=o=>o.errorBars,combineRelevantErrorBarSettings=(o,_,$)=>o.flatMap(j=>_[j.id]).filter(Boolean).filter(j=>isErrorBarRelevantForAxisType($,j)),mergeDomains=function o(){for(var _=arguments.length,$=new Array(_),j=0;j<_;j++)$[j]=arguments[j];var _e=$.filter(Boolean);if(_e.length!==0){var et=_e.flat(),tt=Math.min(...et),rt=Math.max(...et);return[tt,rt]}},combineDomainOfAllAppliedNumericalValuesIncludingErrorValues=(o,_,$,j,_e)=>{var et,tt;if($.length>0&&o.forEach(rt=>{$.forEach(nt=>{var ot,it,st=(ot=j[nt.id])===null||ot===void 0?void 0:ot.filter(pt=>isErrorBarRelevantForAxisType(_e,pt)),at=getValueByDataKey(rt,(it=_.dataKey)!==null&&it!==void 0?it:nt.dataKey),lt=getErrorDomainByDataKey(rt,at,st);if(lt.length>=2){var ct=Math.min(...lt),ft=Math.max(...lt);(et==null||cttt)&&(tt=ft)}var dt=makeDomain(at);dt!=null&&(et=et==null?dt[0]:Math.min(et,dt[0]),tt=tt==null?dt[1]:Math.max(tt,dt[1]))})}),(_==null?void 0:_.dataKey)!=null&&o.forEach(rt=>{var nt=makeDomain(getValueByDataKey(rt,_.dataKey));nt!=null&&(et=et==null?nt[0]:Math.min(et,nt[0]),tt=tt==null?nt[1]:Math.max(tt,nt[1]))}),isWellBehavedNumber(et)&&isWellBehavedNumber(tt))return[et,tt]},selectDomainOfAllAppliedNumericalValuesIncludingErrorValues$1=createSelector([selectDisplayedData,selectBaseAxis,selectCartesianItemsSettingsExceptStacked,selectAllErrorBarSettings,pickAxisType],combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,{memoizeOptions:{resultEqualityCheck:numberDomainEqualityCheck}});function onlyAllowNumbersAndStringsAndDates(o){var{value:_}=o;if(isNumOrStr(_)||_ instanceof Date)return _}var computeDomainOfTypeCategory=(o,_,$)=>{var j=o.map(onlyAllowNumbersAndStringsAndDates).filter(_e=>_e!=null);return $&&(_.dataKey==null||_.allowDuplicatedCategory&&hasDuplicate(j))?range$2(0,o.length):_.allowDuplicatedCategory?j:Array.from(new Set(j))},selectReferenceDots=o=>o.referenceElements.dots,filterReferenceElements=(o,_,$)=>o.filter(j=>j.ifOverflow==="extendDomain").filter(j=>_==="xAxis"?j.xAxisId===$:j.yAxisId===$),selectReferenceDotsByAxis=createSelector([selectReferenceDots,pickAxisType,pickAxisId],filterReferenceElements),selectReferenceAreas=o=>o.referenceElements.areas,selectReferenceAreasByAxis=createSelector([selectReferenceAreas,pickAxisType,pickAxisId],filterReferenceElements),selectReferenceLines=o=>o.referenceElements.lines,selectReferenceLinesByAxis=createSelector([selectReferenceLines,pickAxisType,pickAxisId],filterReferenceElements),combineDotsDomain=(o,_)=>{if(o!=null){var $=onlyAllowNumbers(o.map(j=>_==="xAxis"?j.x:j.y));if($.length!==0)return[Math.min(...$),Math.max(...$)]}},selectReferenceDotsDomain=createSelector(selectReferenceDotsByAxis,pickAxisType,combineDotsDomain),combineAreasDomain=(o,_)=>{if(o!=null){var $=onlyAllowNumbers(o.flatMap(j=>[_==="xAxis"?j.x1:j.y1,_==="xAxis"?j.x2:j.y2]));if($.length!==0)return[Math.min(...$),Math.max(...$)]}},selectReferenceAreasDomain=createSelector([selectReferenceAreasByAxis,pickAxisType],combineAreasDomain);function extractXCoordinates(o){var _;if(o.x!=null)return onlyAllowNumbers([o.x]);var $=(_=o.segment)===null||_===void 0?void 0:_.map(j=>j.x);return $==null||$.length===0?[]:onlyAllowNumbers($)}function extractYCoordinates(o){var _;if(o.y!=null)return onlyAllowNumbers([o.y]);var $=(_=o.segment)===null||_===void 0?void 0:_.map(j=>j.y);return $==null||$.length===0?[]:onlyAllowNumbers($)}var combineLinesDomain=(o,_)=>{if(o!=null){var $=o.flatMap(j=>_==="xAxis"?extractXCoordinates(j):extractYCoordinates(j));if($.length!==0)return[Math.min(...$),Math.max(...$)]}},selectReferenceLinesDomain=createSelector([selectReferenceLinesByAxis,pickAxisType],combineLinesDomain),selectReferenceElementsDomain=createSelector(selectReferenceDotsDomain,selectReferenceLinesDomain,selectReferenceAreasDomain,(o,_,$)=>mergeDomains(o,$,_)),combineNumericalDomain=(o,_,$,j,_e,et,tt,rt)=>{if($!=null)return $;var nt=tt==="vertical"&&rt==="xAxis"||tt==="horizontal"&&rt==="yAxis",ot=nt?mergeDomains(j,et,_e):mergeDomains(et,_e);return parseNumericalUserDomain(_,ot,o.allowDataOverflow)},selectNumericalDomain=createSelector([selectBaseAxis,selectDomainDefinition,selectDomainFromUserPreference,selectDomainOfStackGroups,selectDomainOfAllAppliedNumericalValuesIncludingErrorValues$1,selectReferenceElementsDomain,selectChartLayout,pickAxisType],combineNumericalDomain,{memoizeOptions:{resultEqualityCheck:numberDomainEqualityCheck}}),expandDomain=[0,1],combineAxisDomain=(o,_,$,j,_e,et,tt)=>{if(!((o==null||$==null||$.length===0)&&tt===void 0)){var{dataKey:rt,type:nt}=o,ot=isCategoricalAxis(_,et);if(ot&&rt==null){var it;return range$2(0,(it=$==null?void 0:$.length)!==null&&it!==void 0?it:0)}return nt==="category"?computeDomainOfTypeCategory(j,o,ot):_e==="expand"?expandDomain:tt}},selectAxisDomain=createSelector([selectBaseAxis,selectChartLayout,selectDisplayedData,selectAllAppliedValues,selectStackOffsetType,pickAxisType,selectNumericalDomain],combineAxisDomain);function isSupportedScaleName(o){return o in d3Scales}var combineRealScaleType=(o,_,$)=>{if(o!=null){var{scale:j,type:_e}=o;if(j==="auto")return _e==="category"&&$&&($.indexOf("LineChart")>=0||$.indexOf("AreaChart")>=0||$.indexOf("ComposedChart")>=0&&!_)?"point":_e==="category"?"band":"linear";if(typeof j=="string"){var et="scale".concat(upperFirst(j));return isSupportedScaleName(et)?et:"point"}}},selectRealScaleType=createSelector([selectBaseAxis,selectHasBar,selectChartName],combineRealScaleType);function combineScaleFunction(o,_,$,j){if(!($==null||j==null))return typeof o.scale=="function"?rechartsScaleFactory(o.scale,$,j):rechartsScaleFactory(_,$,j)}var combineNiceTicks=(o,_,$)=>{var j=getDomainDefinition(_);if(!($!=="auto"&&$!=="linear")){if(_!=null&&_.tickCount&&Array.isArray(j)&&(j[0]==="auto"||j[1]==="auto")&&isWellFormedNumberDomain(o))return getNiceTickValues(o,_.tickCount,_.allowDecimals);if(_!=null&&_.tickCount&&_.type==="number"&&isWellFormedNumberDomain(o))return getTickValuesFixedDomain(o,_.tickCount,_.allowDecimals)}},selectNiceTicks=createSelector([selectAxisDomain,selectRenderableAxisSettings,selectRealScaleType],combineNiceTicks),combineAxisDomainWithNiceTicks=(o,_,$,j)=>{if(j!=="angleAxis"&&(o==null?void 0:o.type)==="number"&&isWellFormedNumberDomain(_)&&Array.isArray($)&&$.length>0){var _e,et,tt=_[0],rt=(_e=$[0])!==null&&_e!==void 0?_e:0,nt=_[1],ot=(et=$[$.length-1])!==null&&et!==void 0?et:0;return[Math.min(tt,rt),Math.max(nt,ot)]}return _},selectAxisDomainIncludingNiceTicks=createSelector([selectBaseAxis,selectAxisDomain,selectNiceTicks,pickAxisType],combineAxisDomainWithNiceTicks),selectSmallestDistanceBetweenValues=createSelector(selectAllAppliedValues,selectBaseAxis,(o,_)=>{if(!(!_||_.type!=="number")){var $=1/0,j=Array.from(onlyAllowNumbers(o.map(st=>st.value))).sort((st,at)=>st-at),_e=j[0],et=j[j.length-1];if(_e==null||et==null)return 1/0;var tt=et-_e;if(tt===0)return 1/0;for(var rt=0;rt_e,(o,_,$,j,_e)=>{if(!isWellBehavedNumber(o))return 0;var et=_==="vertical"?j.height:j.width;if(_e==="gap")return o*et/2;if(_e==="no-gap"){var tt=getPercentValue($,o*et),rt=o*et/2;return rt-tt-(rt-tt)/et*tt}return 0}),selectCalculatedXAxisPadding=(o,_,$)=>{var j=selectXAxisSettings(o,_);return j==null||typeof j.padding!="string"?0:selectCalculatedPadding(o,"xAxis",_,$,j.padding)},selectCalculatedYAxisPadding=(o,_,$)=>{var j=selectYAxisSettings(o,_);return j==null||typeof j.padding!="string"?0:selectCalculatedPadding(o,"yAxis",_,$,j.padding)},selectXAxisPadding=createSelector(selectXAxisSettings,selectCalculatedXAxisPadding,(o,_)=>{var $,j;if(o==null)return{left:0,right:0};var{padding:_e}=o;return typeof _e=="string"?{left:_,right:_}:{left:(($=_e.left)!==null&&$!==void 0?$:0)+_,right:((j=_e.right)!==null&&j!==void 0?j:0)+_}}),selectYAxisPadding=createSelector(selectYAxisSettings,selectCalculatedYAxisPadding,(o,_)=>{var $,j;if(o==null)return{top:0,bottom:0};var{padding:_e}=o;return typeof _e=="string"?{top:_,bottom:_}:{top:(($=_e.top)!==null&&$!==void 0?$:0)+_,bottom:((j=_e.bottom)!==null&&j!==void 0?j:0)+_}}),combineXAxisRange=createSelector([selectChartOffsetInternal,selectXAxisPadding,selectBrushDimensions,selectBrushSettings,(o,_,$)=>$],(o,_,$,j,_e)=>{var{padding:et}=j;return _e?[et.left,$.width-et.right]:[o.left+_.left,o.left+o.width-_.right]}),combineYAxisRange=createSelector([selectChartOffsetInternal,selectChartLayout,selectYAxisPadding,selectBrushDimensions,selectBrushSettings,(o,_,$)=>$],(o,_,$,j,_e,et)=>{var{padding:tt}=_e;return et?[j.height-tt.bottom,tt.top]:_==="horizontal"?[o.top+o.height-$.bottom,o.top+$.top]:[o.top+$.top,o.top+o.height-$.bottom]}),selectAxisRange=(o,_,$,j)=>{var _e;switch(_){case"xAxis":return combineXAxisRange(o,$,j);case"yAxis":return combineYAxisRange(o,$,j);case"zAxis":return(_e=selectZAxisSettings(o,$))===null||_e===void 0?void 0:_e.range;case"angleAxis":return selectAngleAxisRange(o);case"radiusAxis":return selectRadiusAxisRange(o,$);default:return}},selectAxisRangeWithReverse=createSelector([selectBaseAxis,selectAxisRange],combineAxisRangeWithReverse),selectCheckedAxisDomain=createSelector([selectRealScaleType,selectAxisDomainIncludingNiceTicks],combineCheckedDomain),selectAxisScale=createSelector([selectBaseAxis,selectRealScaleType,selectCheckedAxisDomain,selectAxisRangeWithReverse],combineScaleFunction);createSelector([selectCartesianItemsSettings,selectAllErrorBarSettings,pickAxisType],combineRelevantErrorBarSettings);function compareIds(o,_){return o.id<_.id?-1:o.id>_.id?1:0}var pickAxisOrientation=(o,_)=>_,pickMirror=(o,_,$)=>$,selectAllXAxesWithOffsetType=createSelector(selectAllXAxes,pickAxisOrientation,pickMirror,(o,_,$)=>o.filter(j=>j.orientation===_).filter(j=>j.mirror===$).sort(compareIds)),selectAllYAxesWithOffsetType=createSelector(selectAllYAxes,pickAxisOrientation,pickMirror,(o,_,$)=>o.filter(j=>j.orientation===_).filter(j=>j.mirror===$).sort(compareIds)),getXAxisSize=(o,_)=>({width:o.width,height:_.height}),getYAxisSize=(o,_)=>{var $=typeof _.width=="number"?_.width:DEFAULT_Y_AXIS_WIDTH;return{width:$,height:o.height}};createSelector(selectChartOffsetInternal,selectXAxisSettings,getXAxisSize);var combineXAxisPositionStartingPoint=(o,_,$)=>{switch(_){case"top":return o.top;case"bottom":return $-o.bottom;default:return 0}},combineYAxisPositionStartingPoint=(o,_,$)=>{switch(_){case"left":return o.left;case"right":return $-o.right;default:return 0}},selectAllXAxesOffsetSteps=createSelector(selectChartHeight,selectChartOffsetInternal,selectAllXAxesWithOffsetType,pickAxisOrientation,pickMirror,(o,_,$,j,_e)=>{var et={},tt;return $.forEach(rt=>{var nt=getXAxisSize(_,rt);tt==null&&(tt=combineXAxisPositionStartingPoint(_,j,o));var ot=j==="top"&&!_e||j==="bottom"&&_e;et[rt.id]=tt-Number(ot)*nt.height,tt+=(ot?-1:1)*nt.height}),et}),selectAllYAxesOffsetSteps=createSelector(selectChartWidth,selectChartOffsetInternal,selectAllYAxesWithOffsetType,pickAxisOrientation,pickMirror,(o,_,$,j,_e)=>{var et={},tt;return $.forEach(rt=>{var nt=getYAxisSize(_,rt);tt==null&&(tt=combineYAxisPositionStartingPoint(_,j,o));var ot=j==="left"&&!_e||j==="right"&&_e;et[rt.id]=tt-Number(ot)*nt.width,tt+=(ot?-1:1)*nt.width}),et}),selectXAxisOffsetSteps=(o,_)=>{var $=selectXAxisSettings(o,_);if($!=null)return selectAllXAxesOffsetSteps(o,$.orientation,$.mirror)};createSelector([selectChartOffsetInternal,selectXAxisSettings,selectXAxisOffsetSteps,(o,_)=>_],(o,_,$,j)=>{if(_!=null){var _e=$==null?void 0:$[j];return _e==null?{x:o.left,y:0}:{x:o.left,y:_e}}});var selectYAxisOffsetSteps=(o,_)=>{var $=selectYAxisSettings(o,_);if($!=null)return selectAllYAxesOffsetSteps(o,$.orientation,$.mirror)};createSelector([selectChartOffsetInternal,selectYAxisSettings,selectYAxisOffsetSteps,(o,_)=>_],(o,_,$,j)=>{if(_!=null){var _e=$==null?void 0:$[j];return _e==null?{x:0,y:o.top}:{x:_e,y:o.top}}});createSelector(selectChartOffsetInternal,selectYAxisSettings,(o,_)=>{var $=typeof _.width=="number"?_.width:DEFAULT_Y_AXIS_WIDTH;return{width:$,height:o.height}});var combineDuplicateDomain=(o,_,$,j)=>{if($!=null){var{allowDuplicatedCategory:_e,type:et,dataKey:tt}=$,rt=isCategoricalAxis(o,j),nt=_.map(ot=>ot.value);if(tt&&rt&&et==="category"&&_e&&hasDuplicate(nt))return nt}},selectDuplicateDomain=createSelector([selectChartLayout,selectAllAppliedValues,selectBaseAxis,pickAxisType],combineDuplicateDomain),combineCategoricalDomain=(o,_,$,j)=>{if(!($==null||$.dataKey==null)){var{type:_e,scale:et}=$,tt=isCategoricalAxis(o,j);if(tt&&(_e==="number"||et!=="auto"))return _.map(rt=>rt.value)}},selectCategoricalDomain=createSelector([selectChartLayout,selectAllAppliedValues,selectRenderableAxisSettings,pickAxisType],combineCategoricalDomain);createSelector([selectChartLayout,selectCartesianAxisSettings,selectRealScaleType,selectAxisScale,selectDuplicateDomain,selectCategoricalDomain,selectAxisRange,selectNiceTicks,pickAxisType],(o,_,$,j,_e,et,tt,rt,nt)=>{if(_!=null){var ot=isCategoricalAxis(o,nt);return{angle:_.angle,interval:_.interval,minTickGap:_.minTickGap,orientation:_.orientation,tick:_.tick,tickCount:_.tickCount,tickFormatter:_.tickFormatter,ticks:_.ticks,type:_.type,unit:_.unit,axisType:nt,categoricalDomain:et,duplicateDomain:_e,isCategorical:ot,niceTicks:rt,range:tt,realScaleType:$,scale:j}}});var combineAxisTicks=(o,_,$,j,_e,et,tt,rt,nt)=>{if(!(_==null||j==null)){var ot=isCategoricalAxis(o,nt),{type:it,ticks:st,tickCount:at}=_,lt=$==="scaleBand"&&typeof j.bandwidth=="function"?j.bandwidth()/2:2,ct=it==="category"&&j.bandwidth?j.bandwidth()/lt:0;ct=nt==="angleAxis"&&et!=null&&et.length>=2?mathSign(et[0]-et[1])*2*ct:ct;var ft=st||_e;return ft?ft.map((dt,pt)=>{var yt=tt?tt.indexOf(dt):dt,vt=j.map(yt);return isWellBehavedNumber(vt)?{index:pt,coordinate:vt+ct,value:dt,offset:ct}:null}).filter(isNotNil):ot&&rt?rt.map((dt,pt)=>{var yt=j.map(dt);return isWellBehavedNumber(yt)?{coordinate:yt+ct,value:dt,index:pt,offset:ct}:null}).filter(isNotNil):j.ticks?j.ticks(at).map((dt,pt)=>{var yt=j.map(dt);return isWellBehavedNumber(yt)?{coordinate:yt+ct,value:dt,index:pt,offset:ct}:null}).filter(isNotNil):j.domain().map((dt,pt)=>{var yt=j.map(dt);return isWellBehavedNumber(yt)?{coordinate:yt+ct,value:tt?tt[dt]:dt,index:pt,offset:ct}:null}).filter(isNotNil)}};createSelector([selectChartLayout,selectRenderableAxisSettings,selectRealScaleType,selectAxisScale,selectNiceTicks,selectAxisRange,selectDuplicateDomain,selectCategoricalDomain,pickAxisType],combineAxisTicks);var combineGraphicalItemTicks=(o,_,$,j,_e,et,tt)=>{if(!(_==null||$==null||j==null||j[0]===j[1])){var rt=isCategoricalAxis(o,tt),{tickCount:nt}=_,ot=0;return ot=tt==="angleAxis"&&(j==null?void 0:j.length)>=2?mathSign(j[0]-j[1])*2*ot:ot,rt&&et?et.map((it,st)=>{var at=$.map(it);return isWellBehavedNumber(at)?{coordinate:at+ot,value:it,index:st,offset:ot}:null}).filter(isNotNil):$.ticks?$.ticks(nt).map((it,st)=>{var at=$.map(it);return isWellBehavedNumber(at)?{coordinate:at+ot,value:it,index:st,offset:ot}:null}).filter(isNotNil):$.domain().map((it,st)=>{var at=$.map(it);return isWellBehavedNumber(at)?{coordinate:at+ot,value:_e?_e[it]:it,index:st,offset:ot}:null}).filter(isNotNil)}},selectTicksOfGraphicalItem=createSelector([selectChartLayout,selectRenderableAxisSettings,selectAxisScale,selectAxisRange,selectDuplicateDomain,selectCategoricalDomain,pickAxisType],combineGraphicalItemTicks),selectAxisWithScale=createSelector(selectBaseAxis,selectAxisScale,(o,_)=>{if(!(o==null||_==null))return _objectSpread$i(_objectSpread$i({},o),{},{scale:_})}),selectZAxisScale=createSelector([selectBaseAxis,selectRealScaleType,selectAxisDomain,selectAxisRangeWithReverse],combineScaleFunction);createSelector((o,_,$)=>selectZAxisSettings(o,$),selectZAxisScale,(o,_)=>{if(!(o==null||_==null))return _objectSpread$i(_objectSpread$i({},o),{},{scale:_})});var selectChartDirection=createSelector([selectChartLayout,selectAllXAxes,selectAllYAxes],(o,_,$)=>{switch(o){case"horizontal":return _.some(j=>j.reversed)?"right-to-left":"left-to-right";case"vertical":return $.some(j=>j.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),selectDefaultTooltipEventType=o=>o.options.defaultTooltipEventType,selectValidateTooltipEventTypes=o=>o.options.validateTooltipEventTypes;function combineTooltipEventType(o,_,$){if(o==null)return _;var j=o?"axis":"item";return $==null?_:$.includes(j)?j:_}function selectTooltipEventType$1(o,_){var $=selectDefaultTooltipEventType(o),j=selectValidateTooltipEventTypes(o);return combineTooltipEventType(_,$,j)}function useTooltipEventType(o){return useAppSelector(_=>selectTooltipEventType$1(_,o))}var combineActiveLabel=(o,_)=>{var $,j=Number(_);if(!(isNan(j)||_==null))return j>=0?o==null||($=o[j])===null||$===void 0?void 0:$.value:void 0},selectTooltipSettings=o=>o.tooltip.settings,noInteraction={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},initialState$a={itemInteraction:{click:noInteraction,hover:noInteraction},axisInteraction:{click:noInteraction,hover:noInteraction},keyboardInteraction:noInteraction,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},tooltipSlice=createSlice({name:"tooltip",initialState:initialState$a,reducers:{addTooltipEntrySettings:{reducer(o,_){o.tooltipItemPayloads.push(_.payload)},prepare:prepareAutoBatched()},replaceTooltipEntrySettings:{reducer(o,_){var{prev:$,next:j}=_.payload,_e=current$1(o).tooltipItemPayloads.indexOf($);_e>-1&&(o.tooltipItemPayloads[_e]=j)},prepare:prepareAutoBatched()},removeTooltipEntrySettings:{reducer(o,_){var $=current$1(o).tooltipItemPayloads.indexOf(_.payload);$>-1&&o.tooltipItemPayloads.splice($,1)},prepare:prepareAutoBatched()},setTooltipSettingsState(o,_){o.settings=_.payload},setActiveMouseOverItemIndex(o,_){o.syncInteraction.active=!1,o.keyboardInteraction.active=!1,o.itemInteraction.hover.active=!0,o.itemInteraction.hover.index=_.payload.activeIndex,o.itemInteraction.hover.dataKey=_.payload.activeDataKey,o.itemInteraction.hover.graphicalItemId=_.payload.activeGraphicalItemId,o.itemInteraction.hover.coordinate=_.payload.activeCoordinate},mouseLeaveChart(o){o.itemInteraction.hover.active=!1,o.axisInteraction.hover.active=!1},mouseLeaveItem(o){o.itemInteraction.hover.active=!1},setActiveClickItemIndex(o,_){o.syncInteraction.active=!1,o.itemInteraction.click.active=!0,o.keyboardInteraction.active=!1,o.itemInteraction.click.index=_.payload.activeIndex,o.itemInteraction.click.dataKey=_.payload.activeDataKey,o.itemInteraction.click.graphicalItemId=_.payload.activeGraphicalItemId,o.itemInteraction.click.coordinate=_.payload.activeCoordinate},setMouseOverAxisIndex(o,_){o.syncInteraction.active=!1,o.axisInteraction.hover.active=!0,o.keyboardInteraction.active=!1,o.axisInteraction.hover.index=_.payload.activeIndex,o.axisInteraction.hover.dataKey=_.payload.activeDataKey,o.axisInteraction.hover.coordinate=_.payload.activeCoordinate},setMouseClickAxisIndex(o,_){o.syncInteraction.active=!1,o.keyboardInteraction.active=!1,o.axisInteraction.click.active=!0,o.axisInteraction.click.index=_.payload.activeIndex,o.axisInteraction.click.dataKey=_.payload.activeDataKey,o.axisInteraction.click.coordinate=_.payload.activeCoordinate},setSyncInteraction(o,_){o.syncInteraction=_.payload},setKeyboardInteraction(o,_){o.keyboardInteraction.active=_.payload.active,o.keyboardInteraction.index=_.payload.activeIndex,o.keyboardInteraction.coordinate=_.payload.activeCoordinate}}}),{addTooltipEntrySettings,replaceTooltipEntrySettings,removeTooltipEntrySettings,setTooltipSettingsState,setActiveMouseOverItemIndex,mouseLeaveItem,mouseLeaveChart,setActiveClickItemIndex,setMouseOverAxisIndex,setMouseClickAxisIndex,setSyncInteraction,setKeyboardInteraction}=tooltipSlice.actions,tooltipReducer=tooltipSlice.reducer;function ownKeys$h(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$h(o){for(var _=1;_{if(_==null)return noInteraction;var _e=chooseAppropriateMouseInteraction(o,_,$);if(_e==null)return noInteraction;if(_e.active)return _e;if(o.keyboardInteraction.active)return o.keyboardInteraction;if(o.syncInteraction.active&&o.syncInteraction.index!=null)return o.syncInteraction;var et=o.settings.active===!0;if(hasBeenActivePreviously(_e)){if(et)return _objectSpread$h(_objectSpread$h({},_e),{},{active:!0})}else if(j!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:j,graphicalItemId:void 0};return _objectSpread$h(_objectSpread$h({},noInteraction),{},{coordinate:_e.coordinate})};function toFiniteNumber(o){if(typeof o=="number")return Number.isFinite(o)?o:void 0;if(o instanceof Date){var _=o.valueOf();return Number.isFinite(_)?_:void 0}var $=Number(o);return Number.isFinite($)?$:void 0}function isValueWithinNumberDomain(o,_){var $=toFiniteNumber(o),j=_[0],_e=_[1];if($===void 0)return!1;var et=Math.min(j,_e),tt=Math.max(j,_e);return $>=et&&$<=tt}function isValueWithinDomain(o,_,$){if($==null||_==null)return!0;var j=getValueByDataKey(o,_);return j==null||!isWellFormedNumberDomain($)?!0:isValueWithinNumberDomain(j,$)}var combineActiveTooltipIndex=(o,_,$,j)=>{var _e=o==null?void 0:o.index;if(_e==null)return null;var et=Number(_e);if(!isWellBehavedNumber(et))return _e;var tt=0,rt=1/0;_.length>0&&(rt=_.length-1);var nt=Math.max(tt,Math.min(et,rt)),ot=_[nt];return ot==null||isValueWithinDomain(ot,$,j)?String(nt):null},combineCoordinateForDefaultIndex=(o,_,$,j,_e,et,tt)=>{if(et!=null){var rt=tt[0],nt=rt==null?void 0:rt.getPosition(et);if(nt!=null)return nt;var ot=_e==null?void 0:_e[Number(et)];if(ot)switch($){case"horizontal":return{x:ot.coordinate,y:(j.top+_)/2};default:return{x:(j.left+o)/2,y:ot.coordinate}}}},combineTooltipPayloadConfigurations=(o,_,$,j)=>{if(_==="axis")return o.tooltipItemPayloads;if(o.tooltipItemPayloads.length===0)return[];var _e;if($==="hover"?_e=o.itemInteraction.hover.graphicalItemId:_e=o.itemInteraction.click.graphicalItemId,_e==null&&j!=null){var et=o.tooltipItemPayloads[0];return et!=null?[et]:[]}return o.tooltipItemPayloads.filter(tt=>{var rt;return((rt=tt.settings)===null||rt===void 0?void 0:rt.graphicalItemId)===_e})},selectTooltipPayloadSearcher=o=>o.options.tooltipPayloadSearcher,selectTooltipState=o=>o.tooltip;function ownKeys$g(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$g(o){for(var _=1;_{if(!(_==null||et==null)){var{chartData:rt,computedData:nt,dataStartIndex:ot,dataEndIndex:it}=$,st=[];return o.reduce((at,lt)=>{var ct,{dataDefinedOnItem:ft,settings:dt}=lt,pt=selectFinalData(ft,rt),yt=Array.isArray(pt)?getSliced(pt,ot,it):pt,vt=(ct=dt==null?void 0:dt.dataKey)!==null&&ct!==void 0?ct:j,wt=dt==null?void 0:dt.nameKey,Ct;if(j&&Array.isArray(yt)&&!Array.isArray(yt[0])&&tt==="axis"?Ct=findEntryInArray(yt,j,_e):Ct=et(yt,_,nt,wt),Array.isArray(Ct))Ct.forEach(Bt=>{var At=_objectSpread$g(_objectSpread$g({},dt),{},{name:Bt.name,unit:Bt.unit,color:void 0,fill:void 0});at.push(getTooltipEntry({tooltipEntrySettings:At,dataKey:Bt.dataKey,payload:Bt.payload,value:getValueByDataKey(Bt.payload,Bt.dataKey),name:Bt.name}))});else{var Pt;at.push(getTooltipEntry({tooltipEntrySettings:dt,dataKey:vt,payload:Ct,value:getValueByDataKey(Ct,vt),name:(Pt=getValueByDataKey(Ct,wt))!==null&&Pt!==void 0?Pt:dt==null?void 0:dt.name}))}return at},st)}},selectTooltipAxisRealScaleType=createSelector([selectTooltipAxis,selectHasBar,selectChartName],combineRealScaleType),selectAllUnfilteredGraphicalItems=createSelector([o=>o.graphicalItems.cartesianItems,o=>o.graphicalItems.polarItems],(o,_)=>[...o,..._]),selectTooltipAxisPredicate=createSelector([selectTooltipAxisType,selectTooltipAxisId],itemAxisPredicate),selectAllGraphicalItemsSettings=createSelector([selectAllUnfilteredGraphicalItems,selectTooltipAxis,selectTooltipAxisPredicate],combineGraphicalItemsSettings,{memoizeOptions:{resultEqualityCheck:emptyArraysAreEqualCheck}}),selectAllStackedGraphicalItemsSettings=createSelector([selectAllGraphicalItemsSettings],o=>o.filter(isStacked)),selectTooltipGraphicalItemsData=createSelector([selectAllGraphicalItemsSettings],combineGraphicalItemsData,{memoizeOptions:{resultEqualityCheck:emptyArraysAreEqualCheck}}),selectTooltipDisplayedData=createSelector([selectTooltipGraphicalItemsData,selectChartDataWithIndexes],combineDisplayedData),selectTooltipStackedData=createSelector([selectAllStackedGraphicalItemsSettings,selectChartDataWithIndexes,selectTooltipAxis],combineDisplayedStackedData),selectAllTooltipAppliedValues=createSelector([selectTooltipDisplayedData,selectTooltipAxis,selectAllGraphicalItemsSettings],combineAppliedValues),selectTooltipAxisDomainDefinition=createSelector([selectTooltipAxis],getDomainDefinition),selectTooltipDataOverflow=createSelector([selectTooltipAxis],o=>o.allowDataOverflow),selectTooltipDomainFromUserPreferences=createSelector([selectTooltipAxisDomainDefinition,selectTooltipDataOverflow],numericalDomainSpecifiedWithoutRequiringData),selectAllStackedGraphicalItems=createSelector([selectAllGraphicalItemsSettings],o=>o.filter(isStacked)),selectTooltipStackGroups=createSelector([selectTooltipStackedData,selectAllStackedGraphicalItems,selectStackOffsetType,selectReverseStackOrder],combineStackGroups),selectTooltipDomainOfStackGroups=createSelector([selectTooltipStackGroups,selectChartDataWithIndexes,selectTooltipAxisType,selectTooltipDomainFromUserPreferences],combineDomainOfStackGroups),selectTooltipItemsSettingsExceptStacked=createSelector([selectAllGraphicalItemsSettings],filterGraphicalNotStackedItems),selectDomainOfAllAppliedNumericalValuesIncludingErrorValues=createSelector([selectTooltipDisplayedData,selectTooltipAxis,selectTooltipItemsSettingsExceptStacked,selectAllErrorBarSettings,selectTooltipAxisType],combineDomainOfAllAppliedNumericalValuesIncludingErrorValues,{memoizeOptions:{resultEqualityCheck:numberDomainEqualityCheck}}),selectReferenceDotsByTooltipAxis=createSelector([selectReferenceDots,selectTooltipAxisType,selectTooltipAxisId],filterReferenceElements),selectTooltipReferenceDotsDomain=createSelector([selectReferenceDotsByTooltipAxis,selectTooltipAxisType],combineDotsDomain),selectReferenceAreasByTooltipAxis=createSelector([selectReferenceAreas,selectTooltipAxisType,selectTooltipAxisId],filterReferenceElements),selectTooltipReferenceAreasDomain=createSelector([selectReferenceAreasByTooltipAxis,selectTooltipAxisType],combineAreasDomain),selectReferenceLinesByTooltipAxis=createSelector([selectReferenceLines,selectTooltipAxisType,selectTooltipAxisId],filterReferenceElements),selectTooltipReferenceLinesDomain=createSelector([selectReferenceLinesByTooltipAxis,selectTooltipAxisType],combineLinesDomain),selectTooltipReferenceElementsDomain=createSelector([selectTooltipReferenceDotsDomain,selectTooltipReferenceLinesDomain,selectTooltipReferenceAreasDomain],mergeDomains),selectTooltipNumericalDomain=createSelector([selectTooltipAxis,selectTooltipAxisDomainDefinition,selectTooltipDomainFromUserPreferences,selectTooltipDomainOfStackGroups,selectDomainOfAllAppliedNumericalValuesIncludingErrorValues,selectTooltipReferenceElementsDomain,selectChartLayout,selectTooltipAxisType],combineNumericalDomain),selectTooltipAxisDomain=createSelector([selectTooltipAxis,selectChartLayout,selectTooltipDisplayedData,selectAllTooltipAppliedValues,selectStackOffsetType,selectTooltipAxisType,selectTooltipNumericalDomain],combineAxisDomain),selectTooltipNiceTicks=createSelector([selectTooltipAxisDomain,selectTooltipAxis,selectTooltipAxisRealScaleType],combineNiceTicks),selectTooltipAxisDomainIncludingNiceTicks=createSelector([selectTooltipAxis,selectTooltipAxisDomain,selectTooltipNiceTicks,selectTooltipAxisType],combineAxisDomainWithNiceTicks),selectTooltipAxisRange=o=>{var _=selectTooltipAxisType(o),$=selectTooltipAxisId(o),j=!1;return selectAxisRange(o,_,$,j)},selectTooltipAxisRangeWithReverse=createSelector([selectTooltipAxis,selectTooltipAxisRange],combineAxisRangeWithReverse),selectTooltipAxisScale=createSelector([selectTooltipAxis,selectTooltipAxisRealScaleType,selectTooltipAxisDomainIncludingNiceTicks,selectTooltipAxisRangeWithReverse],combineScaleFunction),selectTooltipDuplicateDomain=createSelector([selectChartLayout,selectAllTooltipAppliedValues,selectTooltipAxis,selectTooltipAxisType],combineDuplicateDomain),selectTooltipCategoricalDomain=createSelector([selectChartLayout,selectAllTooltipAppliedValues,selectTooltipAxis,selectTooltipAxisType],combineCategoricalDomain),combineTicksOfTooltipAxis=(o,_,$,j,_e,et,tt,rt)=>{if(_){var{type:nt}=_,ot=isCategoricalAxis(o,rt);if(j){var it=$==="scaleBand"&&j.bandwidth?j.bandwidth()/2:2,st=nt==="category"&&j.bandwidth?j.bandwidth()/it:0;return st=rt==="angleAxis"&&_e!=null&&(_e==null?void 0:_e.length)>=2?mathSign(_e[0]-_e[1])*2*st:st,ot&&tt?tt.map((at,lt)=>{var ct=j.map(at);return isWellBehavedNumber(ct)?{coordinate:ct+st,value:at,index:lt,offset:st}:null}).filter(isNotNil):j.domain().map((at,lt)=>{var ct=j.map(at);return isWellBehavedNumber(ct)?{coordinate:ct+st,value:et?et[at]:at,index:lt,offset:st}:null}).filter(isNotNil)}}},selectTooltipAxisTicks=createSelector([selectChartLayout,selectTooltipAxis,selectTooltipAxisRealScaleType,selectTooltipAxisScale,selectTooltipAxisRange,selectTooltipDuplicateDomain,selectTooltipCategoricalDomain,selectTooltipAxisType],combineTicksOfTooltipAxis),selectTooltipEventType=createSelector([selectDefaultTooltipEventType,selectValidateTooltipEventTypes,selectTooltipSettings],(o,_,$)=>combineTooltipEventType($.shared,o,_)),selectTooltipTrigger=o=>o.tooltip.settings.trigger,selectDefaultIndex=o=>o.tooltip.settings.defaultIndex,selectTooltipInteractionState$1=createSelector([selectTooltipState,selectTooltipEventType,selectTooltipTrigger,selectDefaultIndex],combineTooltipInteractionState),selectActiveTooltipIndex=createSelector([selectTooltipInteractionState$1,selectTooltipDisplayedData,selectTooltipAxisDataKey,selectTooltipAxisDomain],combineActiveTooltipIndex),selectActiveLabel$1=createSelector([selectTooltipAxisTicks,selectActiveTooltipIndex],combineActiveLabel),selectActiveTooltipDataKey=createSelector([selectTooltipInteractionState$1],o=>{if(o)return o.dataKey});createSelector([selectTooltipInteractionState$1],o=>{if(o)return o.graphicalItemId});var selectTooltipPayloadConfigurations$1=createSelector([selectTooltipState,selectTooltipEventType,selectTooltipTrigger,selectDefaultIndex],combineTooltipPayloadConfigurations),selectTooltipCoordinateForDefaultIndex=createSelector([selectChartWidth,selectChartHeight,selectChartLayout,selectChartOffsetInternal,selectTooltipAxisTicks,selectDefaultIndex,selectTooltipPayloadConfigurations$1],combineCoordinateForDefaultIndex),selectActiveTooltipCoordinate=createSelector([selectTooltipInteractionState$1,selectTooltipCoordinateForDefaultIndex],(o,_)=>o!=null&&o.coordinate?o.coordinate:_),selectIsTooltipActive$1=createSelector([selectTooltipInteractionState$1],o=>{var _;return(_=o==null?void 0:o.active)!==null&&_!==void 0?_:!1}),selectActiveTooltipPayload=createSelector([selectTooltipPayloadConfigurations$1,selectActiveTooltipIndex,selectChartDataWithIndexes,selectTooltipAxisDataKey,selectActiveLabel$1,selectTooltipPayloadSearcher,selectTooltipEventType],combineTooltipPayload),selectActiveTooltipDataPoints=createSelector([selectActiveTooltipPayload],o=>{if(o!=null){var _=o.map($=>$.payload).filter($=>$!=null);return Array.from(new Set(_))}});function ownKeys$f(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$f(o){for(var _=1;_useAppSelector(selectTooltipAxis),useTooltipAxisBandSize=()=>{var o=useTooltipAxis(),_=useAppSelector(selectTooltipAxisTicks),$=useAppSelector(selectTooltipAxisScale);return getBandSizeOfAxis(!o||!$?void 0:_objectSpread$f(_objectSpread$f({},o),{},{scale:$}),_)};function ownKeys$e(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$e(o){for(var _=1;_{var _e=_.find(et=>et&&et.index===$);if(_e){if(o==="horizontal")return{x:_e.coordinate,y:j.chartY};if(o==="vertical")return{x:j.chartX,y:_e.coordinate}}return{x:0,y:0}},getActivePolarCoordinate=(o,_,$,j)=>{var _e=_.find(ot=>ot&&ot.index===$);if(_e){if(o==="centric"){var et=_e.coordinate,{radius:tt}=j;return _objectSpread$e(_objectSpread$e(_objectSpread$e({},j),polarToCartesian(j.cx,j.cy,tt,et)),{},{angle:et,radius:tt})}var rt=_e.coordinate,{angle:nt}=j;return _objectSpread$e(_objectSpread$e(_objectSpread$e({},j),polarToCartesian(j.cx,j.cy,rt,nt)),{},{angle:nt,radius:rt})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function isInCartesianRange(o,_){var{chartX:$,chartY:j}=o;return $>=_.left&&$<=_.left+_.width&&j>=_.top&&j<=_.top+_.height}var calculateActiveTickIndex=(o,_,$,j,_e)=>{var et,tt=(et=_==null?void 0:_.length)!==null&&et!==void 0?et:0;if(tt<=1||o==null)return 0;if(j==="angleAxis"&&_e!=null&&Math.abs(Math.abs(_e[1]-_e[0])-360)<=1e-6)for(var rt=0;rt0?(nt=$[rt-1])===null||nt===void 0?void 0:nt.coordinate:(ot=$[tt-1])===null||ot===void 0?void 0:ot.coordinate,ct=(it=$[rt])===null||it===void 0?void 0:it.coordinate,ft=rt>=tt-1?(st=$[0])===null||st===void 0?void 0:st.coordinate:(at=$[rt+1])===null||at===void 0?void 0:at.coordinate,dt=void 0;if(!(lt==null||ct==null||ft==null))if(mathSign(ct-lt)!==mathSign(ft-ct)){var pt=[];if(mathSign(ft-ct)===mathSign(_e[1]-_e[0])){dt=ft;var yt=ct+_e[1]-_e[0];pt[0]=Math.min(yt,(yt+lt)/2),pt[1]=Math.max(yt,(yt+lt)/2)}else{dt=lt;var vt=ft+_e[1]-_e[0];pt[0]=Math.min(ct,(vt+ct)/2),pt[1]=Math.max(ct,(vt+ct)/2)}var wt=[Math.min(ct,(dt+ct)/2),Math.max(ct,(dt+ct)/2)];if(o>wt[0]&&o<=wt[1]||o>=pt[0]&&o<=pt[1]){var Ct;return(Ct=$[rt])===null||Ct===void 0?void 0:Ct.index}}else{var Pt=Math.min(lt,ft),Bt=Math.max(lt,ft);if(o>(Pt+ct)/2&&o<=(Bt+ct)/2){var At;return(At=$[rt])===null||At===void 0?void 0:At.index}}}else if(_)for(var kt=0;kt(Ot.coordinate+ht.coordinate)/2||kt>0&&kt(Ot.coordinate+ht.coordinate)/2&&o<=(Ot.coordinate+Tt.coordinate)/2)return Ot.index}}return-1},useChartName=()=>useAppSelector(selectChartName),pickTooltipEventType=(o,_)=>_,pickTrigger=(o,_,$)=>$,pickDefaultIndex=(o,_,$,j)=>j,selectOrderedTooltipTicks=createSelector(selectTooltipAxisTicks,o=>sortBy$1(o,_=>_.coordinate)),selectTooltipInteractionState=createSelector([selectTooltipState,pickTooltipEventType,pickTrigger,pickDefaultIndex],combineTooltipInteractionState),selectActiveIndex=createSelector([selectTooltipInteractionState,selectTooltipDisplayedData,selectTooltipAxisDataKey,selectTooltipAxisDomain],combineActiveTooltipIndex),selectTooltipDataKey=(o,_,$)=>{if(_!=null){var j=selectTooltipState(o);return _==="axis"?$==="hover"?j.axisInteraction.hover.dataKey:j.axisInteraction.click.dataKey:$==="hover"?j.itemInteraction.hover.dataKey:j.itemInteraction.click.dataKey}},selectTooltipPayloadConfigurations=createSelector([selectTooltipState,pickTooltipEventType,pickTrigger,pickDefaultIndex],combineTooltipPayloadConfigurations),selectCoordinateForDefaultIndex=createSelector([selectChartWidth,selectChartHeight,selectChartLayout,selectChartOffsetInternal,selectTooltipAxisTicks,pickDefaultIndex,selectTooltipPayloadConfigurations],combineCoordinateForDefaultIndex),selectActiveCoordinate=createSelector([selectTooltipInteractionState,selectCoordinateForDefaultIndex],(o,_)=>{var $;return($=o.coordinate)!==null&&$!==void 0?$:_}),selectActiveLabel=createSelector([selectTooltipAxisTicks,selectActiveIndex],combineActiveLabel),selectTooltipPayload=createSelector([selectTooltipPayloadConfigurations,selectActiveIndex,selectChartDataWithIndexes,selectTooltipAxisDataKey,selectActiveLabel,selectTooltipPayloadSearcher,pickTooltipEventType],combineTooltipPayload),selectIsTooltipActive=createSelector([selectTooltipInteractionState,selectActiveIndex],(o,_)=>({isActive:o.active&&_!=null,activeIndex:_})),combineActiveCartesianProps=(o,_,$,j,_e,et,tt)=>{if(!(!o||!$||!j||!_e)&&isInCartesianRange(o,tt)){var rt=calculateCartesianTooltipPos(o,_),nt=calculateActiveTickIndex(rt,et,_e,$,j),ot=getActiveCartesianCoordinate(_,_e,nt,o);return{activeIndex:String(nt),activeCoordinate:ot}}},combineActivePolarProps=(o,_,$,j,_e,et,tt)=>{if(!(!o||!j||!_e||!et||!$)){var rt=inRangeOfSector(o,$);if(rt){var nt=calculatePolarTooltipPos(rt,_),ot=calculateActiveTickIndex(nt,tt,et,j,_e),it=getActivePolarCoordinate(_,et,ot,rt);return{activeIndex:String(ot),activeCoordinate:it}}}},combineActiveProps=(o,_,$,j,_e,et,tt,rt)=>{if(!(!o||!_||!j||!_e||!et))return _==="horizontal"||_==="vertical"?combineActiveCartesianProps(o,_,j,_e,et,tt,rt):combineActivePolarProps(o,_,$,j,_e,et,tt)},selectZIndexPortalElement=createSelector(o=>o.zIndex.zIndexMap,(o,_)=>_,(o,_,$)=>$,(o,_,$)=>{if(_!=null){var j=o[_];if(j!=null)return $?j.panoramaElement:j.element}}),selectAllRegisteredZIndexes=createSelector(o=>o.zIndex.zIndexMap,o=>{var _=Object.keys(o).map(j=>parseInt(j,10)).concat(Object.values(DefaultZIndexes)),$=Array.from(new Set(_));return $.sort((j,_e)=>j-_e)},{memoizeOptions:{resultEqualityCheck:arrayContentsAreEqualCheck}});function ownKeys$d(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$d(o){for(var _=1;__objectSpread$d(_objectSpread$d({},o),{},{[_]:{element:void 0,panoramaElement:void 0,consumers:0}}),seed)},defaultZIndexSet=new Set(Object.values(DefaultZIndexes));function isDefaultZIndex(o){return defaultZIndexSet.has(o)}var zIndexSlice=createSlice({name:"zIndex",initialState:initialState$9,reducers:{registerZIndexPortal:{reducer:(o,_)=>{var{zIndex:$}=_.payload;o.zIndexMap[$]?o.zIndexMap[$].consumers+=1:o.zIndexMap[$]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:prepareAutoBatched()},unregisterZIndexPortal:{reducer:(o,_)=>{var{zIndex:$}=_.payload;o.zIndexMap[$]&&(o.zIndexMap[$].consumers-=1,o.zIndexMap[$].consumers<=0&&!isDefaultZIndex($)&&delete o.zIndexMap[$])},prepare:prepareAutoBatched()},registerZIndexPortalElement:{reducer:(o,_)=>{var{zIndex:$,element:j,isPanorama:_e}=_.payload;o.zIndexMap[$]?_e?o.zIndexMap[$].panoramaElement=j:o.zIndexMap[$].element=j:o.zIndexMap[$]={consumers:0,element:_e?void 0:j,panoramaElement:_e?j:void 0}},prepare:prepareAutoBatched()},unregisterZIndexPortalElement:{reducer:(o,_)=>{var{zIndex:$}=_.payload;o.zIndexMap[$]&&(_.payload.isPanorama?o.zIndexMap[$].panoramaElement=void 0:o.zIndexMap[$].element=void 0)},prepare:prepareAutoBatched()}}}),{registerZIndexPortal,unregisterZIndexPortal,registerZIndexPortalElement,unregisterZIndexPortalElement}=zIndexSlice.actions,zIndexReducer=zIndexSlice.reducer;function ZIndexLayer(o){var{zIndex:_,children:$}=o,j=useIsInChartContext(),_e=j&&_!==void 0&&_!==0,et=useIsPanorama(),tt=useAppDispatch();reactExports.useLayoutEffect(()=>_e?(tt(registerZIndexPortal({zIndex:_})),()=>{tt(unregisterZIndexPortal({zIndex:_}))}):noop$2,[tt,_,_e]);var rt=useAppSelector(nt=>selectZIndexPortalElement(nt,_,et));return _e?rt?reactDomExports.createPortal($,rt):null:$}function _extends$a(){return _extends$a=Object.assign?Object.assign.bind():function(o){for(var _=1;_reactExports.useContext(TooltipPortalContext),eventemitter3={exports:{}};(function(o){var _=Object.prototype.hasOwnProperty,$="~";function j(){}Object.create&&(j.prototype=Object.create(null),new j().__proto__||($=!1));function _e(nt,ot,it){this.fn=nt,this.context=ot,this.once=it||!1}function et(nt,ot,it,st,at){if(typeof it!="function")throw new TypeError("The listener must be a function");var lt=new _e(it,st||nt,at),ct=$?$+ot:ot;return nt._events[ct]?nt._events[ct].fn?nt._events[ct]=[nt._events[ct],lt]:nt._events[ct].push(lt):(nt._events[ct]=lt,nt._eventsCount++),nt}function tt(nt,ot){--nt._eventsCount===0?nt._events=new j:delete nt._events[ot]}function rt(){this._events=new j,this._eventsCount=0}rt.prototype.eventNames=function(){var ot=[],it,st;if(this._eventsCount===0)return ot;for(st in it=this._events)_.call(it,st)&&ot.push($?st.slice(1):st);return Object.getOwnPropertySymbols?ot.concat(Object.getOwnPropertySymbols(it)):ot},rt.prototype.listeners=function(ot){var it=$?$+ot:ot,st=this._events[it];if(!st)return[];if(st.fn)return[st.fn];for(var at=0,lt=st.length,ct=new Array(lt);at{if(_&&Array.isArray(o)){var $=Number.parseInt(_,10);if(!isNan($))return o[$]}},initialState$8={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},optionsSlice=createSlice({name:"options",initialState:initialState$8,reducers:{createEventEmitter:o=>{o.eventEmitter==null&&(o.eventEmitter=Symbol("rechartsEventEmitter"))}}}),optionsReducer=optionsSlice.reducer,{createEventEmitter}=optionsSlice.actions;function selectSynchronisedTooltipState(o){return o.tooltip.syncInteraction}var initialChartDataState={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},chartDataSlice=createSlice({name:"chartData",initialState:initialChartDataState,reducers:{setChartData(o,_){if(o.chartData=_.payload,_.payload==null){o.dataStartIndex=0,o.dataEndIndex=0;return}_.payload.length>0&&o.dataEndIndex!==_.payload.length-1&&(o.dataEndIndex=_.payload.length-1)},setComputedData(o,_){o.computedData=_.payload},setDataStartEndIndexes(o,_){var{startIndex:$,endIndex:j}=_.payload;$!=null&&(o.dataStartIndex=$),j!=null&&(o.dataEndIndex=j)}}}),{setChartData,setDataStartEndIndexes,setComputedData}=chartDataSlice.actions,chartDataReducer=chartDataSlice.reducer,_excluded$9=["x","y"];function ownKeys$b(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$b(o){for(var _=1;_nt.rootProps.className);reactExports.useEffect(()=>{if(o==null)return noop$2;var nt=(ot,it,st)=>{if(_!==st&&o===ot){if(j==="index"){var at;if(tt&&it!==null&&it!==void 0&&(at=it.payload)!==null&&at!==void 0&&at.coordinate&&it.payload.sourceViewBox){var lt=it.payload.coordinate,{x:ct,y:ft}=lt,dt=_objectWithoutProperties$9(lt,_excluded$9),{x:pt,y:yt,width:vt,height:wt}=it.payload.sourceViewBox,Ct=_objectSpread$b(_objectSpread$b({},dt),{},{x:tt.x+(vt?(ct-pt)/vt:0)*tt.width,y:tt.y+(wt?(ft-yt)/wt:0)*tt.height});$(_objectSpread$b(_objectSpread$b({},it),{},{payload:_objectSpread$b(_objectSpread$b({},it.payload),{},{coordinate:Ct})}))}else $(it);return}if(_e!=null){var Pt;if(typeof j=="function"){var Bt={activeTooltipIndex:it.payload.index==null?void 0:Number(it.payload.index),isTooltipActive:it.payload.active,activeIndex:it.payload.index==null?void 0:Number(it.payload.index),activeLabel:it.payload.label,activeDataKey:it.payload.dataKey,activeCoordinate:it.payload.coordinate},At=j(_e,Bt);Pt=_e[At]}else j==="value"&&(Pt=_e.find(xt=>String(xt.value)===it.payload.label));var{coordinate:kt}=it.payload;if(Pt==null||it.payload.active===!1||kt==null||tt==null){$(setSyncInteraction({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}var{x:Ot,y:Tt}=kt,ht=Math.min(Ot,tt.x+tt.width),bt=Math.min(Tt,tt.y+tt.height),mt={x:et==="horizontal"?Pt.coordinate:ht,y:et==="horizontal"?bt:Pt.coordinate},gt=setSyncInteraction({active:it.payload.active,coordinate:mt,dataKey:it.payload.dataKey,index:String(Pt.index),label:it.payload.label,sourceViewBox:it.payload.sourceViewBox,graphicalItemId:it.payload.graphicalItemId});$(gt)}}};return eventCenter.on(TOOLTIP_SYNC_EVENT,nt),()=>{eventCenter.off(TOOLTIP_SYNC_EVENT,nt)}},[rt,$,_,o,j,_e,et,tt])}function useBrushSyncEventsListener(){var o=useAppSelector(selectSyncId),_=useAppSelector(selectEventEmitter),$=useAppDispatch();reactExports.useEffect(()=>{if(o==null)return noop$2;var j=(_e,et,tt)=>{_!==tt&&o===_e&&$(setDataStartEndIndexes(et))};return eventCenter.on(BRUSH_SYNC_EVENT,j),()=>{eventCenter.off(BRUSH_SYNC_EVENT,j)}},[$,_,o])}function useSynchronisedEventsFromOtherCharts(){var o=useAppDispatch();reactExports.useEffect(()=>{o(createEventEmitter())},[o]),useTooltipSyncEventsListener(),useBrushSyncEventsListener()}function useTooltipChartSynchronisation(o,_,$,j,_e,et){var tt=useAppSelector(lt=>selectTooltipDataKey(lt,o,_)),rt=useAppSelector(selectEventEmitter),nt=useAppSelector(selectSyncId),ot=useAppSelector(selectSyncMethod),it=useAppSelector(selectSynchronisedTooltipState),st=it==null?void 0:it.active,at=useViewBox();reactExports.useEffect(()=>{if(!st&&nt!=null&&rt!=null){var lt=setSyncInteraction({active:et,coordinate:$,dataKey:tt,index:_e,label:typeof j=="number"?String(j):j,sourceViewBox:at,graphicalItemId:void 0});eventCenter.emit(TOOLTIP_SYNC_EVENT,nt,lt,rt)}},[st,$,tt,_e,j,rt,nt,ot,et,at])}function ownKeys$a(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$a(o){for(var _=1;_{Bt(setTooltipSettingsState({shared:yt,trigger:vt,axisId:Pt,active:_e,defaultIndex:At}))},[Bt,yt,vt,Pt,_e,At]);var kt=useViewBox(),Ot=useAccessibilityLayer(),Tt=useTooltipEventType(yt),{activeIndex:ht,isActive:bt}=(_=useAppSelector(jt=>selectIsTooltipActive(jt,Tt,vt,At)))!==null&&_!==void 0?_:{},mt=useAppSelector(jt=>selectTooltipPayload(jt,Tt,vt,At)),gt=useAppSelector(jt=>selectActiveLabel(jt,Tt,vt,At)),xt=useAppSelector(jt=>selectActiveCoordinate(jt,Tt,vt,At)),Et=mt,_t=useTooltipPortal(),$t=($=_e??bt)!==null&&$!==void 0?$:!1,[St,Rt]=useElementOffset([Et,$t]),It=Tt==="axis"?gt:void 0;useTooltipChartSynchronisation(Tt,vt,xt,It,ht,$t);var Mt=Ct??_t;if(Mt==null||kt==null||Tt==null)return null;var Vt=Et??emptyPayload;$t||(Vt=emptyPayload),ot&&Vt.length&&(Vt=getUniqPayload(Vt.filter(jt=>jt.value!=null&&(jt.hide!==!0||j.includeHidden)),at,defaultUniqBy));var Gt=Vt.length>0,zt=reactExports.createElement(TooltipBoundingBox,{allowEscapeViewBox:et,animationDuration:tt,animationEasing:rt,isAnimationActive:it,active:$t,coordinate:xt,hasPayload:Gt,offset:st,position:lt,reverseDirection:ct,useTranslate3d:ft,viewBox:kt,wrapperStyle:dt,lastBoundingBox:St,innerRef:Rt,hasPortalFromProps:!!Ct},renderContent(nt,_objectSpread$a(_objectSpread$a({},j),{},{payload:Vt,label:It,active:$t,activeIndex:ht,coordinate:xt,accessibilityLayer:Ot})));return reactExports.createElement(reactExports.Fragment,null,reactDomExports.createPortal(zt,Mt),$t&&reactExports.createElement(Cursor,{cursor:pt,tooltipEventType:Tt,coordinate:xt,payload:Vt,index:ht}))}function _defineProperty$b(o,_,$){return(_=_toPropertyKey$b(_))in o?Object.defineProperty(o,_,{value:$,enumerable:!0,configurable:!0,writable:!0}):o[_]=$,o}function _toPropertyKey$b(o){var _=_toPrimitive$b(o,"string");return typeof _=="symbol"?_:_+""}function _toPrimitive$b(o,_){if(typeof o!="object"||!o)return o;var $=o[Symbol.toPrimitive];if($!==void 0){var j=$.call(o,_);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(o)}class LRUCache{constructor(_){_defineProperty$b(this,"cache",new Map),this.maxSize=_}get(_){var $=this.cache.get(_);return $!==void 0&&(this.cache.delete(_),this.cache.set(_,$)),$}set(_,$){if(this.cache.has(_))this.cache.delete(_);else if(this.cache.size>=this.maxSize){var j=this.cache.keys().next().value;j!=null&&this.cache.delete(j)}this.cache.set(_,$)}clear(){this.cache.clear()}size(){return this.cache.size}}function ownKeys$9(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$9(o){for(var _=1;_{try{var $=document.getElementById(MEASUREMENT_SPAN_ID);$||($=document.createElement("span"),$.setAttribute("id",MEASUREMENT_SPAN_ID),$.setAttribute("aria-hidden","true"),document.body.appendChild($)),Object.assign($.style,SPAN_STYLE,_),$.textContent="".concat(o);var j=$.getBoundingClientRect();return{width:j.width,height:j.height}}catch{return{width:0,height:0}}},getStringSize=function o(_){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(_==null||Global.isSsr)return{width:0,height:0};if(!currentConfig.enableCache)return measureTextWithDOM(_,$);var j=createCacheKey(_,$),_e=stringCache.get(j);if(_e)return _e;var et=measureTextWithDOM(_,$);return stringCache.set(j,et),et},_DecimalCSS;function _defineProperty$9(o,_,$){return(_=_toPropertyKey$9(_))in o?Object.defineProperty(o,_,{value:$,enumerable:!0,configurable:!0,writable:!0}):o[_]=$,o}function _toPropertyKey$9(o){var _=_toPrimitive$9(o,"string");return typeof _=="symbol"?_:_+""}function _toPrimitive$9(o,_){if(typeof o!="object"||!o)return o;var $=o[Symbol.toPrimitive];if($!==void 0){var j=$.call(o,_);if(typeof j!="object")return j;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(o)}var MULTIPLY_OR_DIVIDE_REGEX=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,ADD_OR_SUBTRACT_REGEX=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,CSS_LENGTH_UNIT_REGEX=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,NUM_SPLIT_REGEX=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,CONVERSION_RATES={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},FIXED_CSS_LENGTH_UNITS=["cm","mm","pt","pc","in","Q","px"];function isSupportedUnit(o){return FIXED_CSS_LENGTH_UNITS.includes(o)}var STR_NAN="NaN";function convertToPx(o,_){return o*CONVERSION_RATES[_]}class DecimalCSS{static parse(_){var $,[,j,_e]=($=NUM_SPLIT_REGEX.exec(_))!==null&&$!==void 0?$:[];return j==null?DecimalCSS.NaN:new DecimalCSS(parseFloat(j),_e??"")}constructor(_,$){this.num=_,this.unit=$,this.num=_,this.unit=$,isNan(_)&&(this.unit=""),$!==""&&!CSS_LENGTH_UNIT_REGEX.test($)&&(this.num=NaN,this.unit=""),isSupportedUnit($)&&(this.num=convertToPx(_,$),this.unit="px")}add(_){return this.unit!==_.unit?new DecimalCSS(NaN,""):new DecimalCSS(this.num+_.num,this.unit)}subtract(_){return this.unit!==_.unit?new DecimalCSS(NaN,""):new DecimalCSS(this.num-_.num,this.unit)}multiply(_){return this.unit!==""&&_.unit!==""&&this.unit!==_.unit?new DecimalCSS(NaN,""):new DecimalCSS(this.num*_.num,this.unit||_.unit)}divide(_){return this.unit!==""&&_.unit!==""&&this.unit!==_.unit?new DecimalCSS(NaN,""):new DecimalCSS(this.num/_.num,this.unit||_.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return isNan(this.num)}}_DecimalCSS=DecimalCSS;_defineProperty$9(DecimalCSS,"NaN",new _DecimalCSS(NaN,""));function calculateArithmetic(o){if(o==null||o.includes(STR_NAN))return STR_NAN;for(var _=o;_.includes("*")||_.includes("/");){var $,[,j,_e,et]=($=MULTIPLY_OR_DIVIDE_REGEX.exec(_))!==null&&$!==void 0?$:[],tt=DecimalCSS.parse(j??""),rt=DecimalCSS.parse(et??""),nt=_e==="*"?tt.multiply(rt):tt.divide(rt);if(nt.isNaN())return STR_NAN;_=_.replace(MULTIPLY_OR_DIVIDE_REGEX,nt.toString())}for(;_.includes("+")||/.-\d+(?:\.\d+)?/.test(_);){var ot,[,it,st,at]=(ot=ADD_OR_SUBTRACT_REGEX.exec(_))!==null&&ot!==void 0?ot:[],lt=DecimalCSS.parse(it??""),ct=DecimalCSS.parse(at??""),ft=st==="+"?lt.add(ct):lt.subtract(ct);if(ft.isNaN())return STR_NAN;_=_.replace(ADD_OR_SUBTRACT_REGEX,ft.toString())}return _}var PARENTHESES_REGEX=/\(([^()]*)\)/;function calculateParentheses(o){for(var _=o,$;($=PARENTHESES_REGEX.exec(_))!=null;){var[,j]=$;_=_.replace(PARENTHESES_REGEX,calculateArithmetic(j))}return _}function evaluateExpression(o){var _=o.replace(/\s+/g,"");return _=calculateParentheses(_),_=calculateArithmetic(_),_}function safeEvaluateExpression(o){try{return evaluateExpression(o)}catch{return STR_NAN}}function reduceCSSCalc(o){var _=safeEvaluateExpression(o.slice(5,-1));return _===STR_NAN?"":_}var _excluded$8=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],_excluded2$3=["dx","dy","angle","className","breakAll"];function _extends$9(){return _extends$9=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var{children:_,breakAll:$,style:j}=o;try{var _e=[];isNullish(_)||($?_e=_.toString().split(""):_e=_.toString().split(BREAKING_SPACES));var et=_e.map(rt=>({word:rt,width:getStringSize(rt,j).width})),tt=$?0:getStringSize("Ā ",j).width;return{wordsWithComputedWidth:et,spaceWidth:tt}}catch{return null}};function isValidTextAnchor(o){return o==="start"||o==="middle"||o==="end"||o==="inherit"}var calculate=(o,_,$,j)=>o.reduce((_e,et)=>{var{word:tt,width:rt}=et,nt=_e[_e.length-1];if(nt&&rt!=null&&(_==null||j||nt.width+rt+$o.reduce((_,$)=>_.width>$.width?_:$),suffix="…",checkOverflow=(o,_,$,j,_e,et,tt,rt)=>{var nt=o.slice(0,_),ot=calculateWordWidths({breakAll:$,style:j,children:nt+suffix});if(!ot)return[!1,[]];var it=calculate(ot.wordsWithComputedWidth,et,tt,rt),st=it.length>_e||findLongestLine(it).width>Number(et);return[st,it]},calculateWordsByLines=(o,_,$,j,_e)=>{var{maxLines:et,children:tt,style:rt,breakAll:nt}=o,ot=isNumber(et),it=String(tt),st=calculate(_,j,$,_e);if(!ot||_e)return st;var at=st.length>et||findLongestLine(st).width>Number(j);if(!at)return st;for(var lt=0,ct=it.length-1,ft=0,dt;lt<=ct&&ft<=it.length-1;){var pt=Math.floor((lt+ct)/2),yt=pt-1,[vt,wt]=checkOverflow(it,yt,nt,rt,et,j,$,_e),[Ct]=checkOverflow(it,pt,nt,rt,et,j,$,_e);if(!vt&&!Ct&&(lt=pt+1),vt&&Ct&&(ct=pt-1),!vt&&Ct){dt=wt;break}ft++}return dt||st},getWordsWithoutCalculate=o=>{var _=isNullish(o)?[]:o.toString().split(BREAKING_SPACES);return[{words:_,width:void 0}]},getWordsByLines=o=>{var{width:_,scaleToFit:$,children:j,style:_e,breakAll:et,maxLines:tt}=o;if((_||$)&&!Global.isSsr){var rt,nt,ot=calculateWordWidths({breakAll:et,children:j,style:_e});if(ot){var{wordsWithComputedWidth:it,spaceWidth:st}=ot;rt=it,nt=st}else return getWordsWithoutCalculate(j);return calculateWordsByLines({breakAll:et,children:j,maxLines:tt,style:_e},rt,nt,_,!!$)}return getWordsWithoutCalculate(j)},DEFAULT_FILL="#808080",textDefaultProps={angle:0,breakAll:!1,capHeight:"0.71em",fill:DEFAULT_FILL,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},Text=reactExports.forwardRef((o,_)=>{var $=resolveDefaultProps(o,textDefaultProps),{x:j,y:_e,lineHeight:et,capHeight:tt,fill:rt,scaleToFit:nt,textAnchor:ot,verticalAnchor:it}=$,st=_objectWithoutProperties$8($,_excluded$8),at=reactExports.useMemo(()=>getWordsByLines({breakAll:st.breakAll,children:st.children,maxLines:st.maxLines,scaleToFit:nt,style:st.style,width:st.width}),[st.breakAll,st.children,st.maxLines,nt,st.style,st.width]),{dx:lt,dy:ct,angle:ft,className:dt,breakAll:pt}=st,yt=_objectWithoutProperties$8(st,_excluded2$3);if(!isNumOrStr(j)||!isNumOrStr(_e)||at.length===0)return null;var vt=Number(j)+(isNumber(lt)?lt:0),wt=Number(_e)+(isNumber(ct)?ct:0);if(!isWellBehavedNumber(vt)||!isWellBehavedNumber(wt))return null;var Ct;switch(it){case"start":Ct=reduceCSSCalc("calc(".concat(tt,")"));break;case"middle":Ct=reduceCSSCalc("calc(".concat((at.length-1)/2," * -").concat(et," + (").concat(tt," / 2))"));break;default:Ct=reduceCSSCalc("calc(".concat(at.length-1," * -").concat(et,")"));break}var Pt=[],Bt=at[0];if(nt&&Bt!=null){var At=Bt.width,{width:kt}=st;Pt.push("scale(".concat(isNumber(kt)&&isNumber(At)?kt/At:1,")"))}return ft&&Pt.push("rotate(".concat(ft,", ").concat(vt,", ").concat(wt,")")),Pt.length&&(yt.transform=Pt.join(" ")),reactExports.createElement("text",_extends$9({},svgPropertiesAndEvents(yt),{ref:_,x:vt,y:wt,className:clsx("recharts-text",dt),textAnchor:ot,fill:rt.includes("url")?DEFAULT_FILL:rt}),at.map((Ot,Tt)=>{var ht=Ot.words.join(pt?"":" ");return reactExports.createElement("tspan",{x:vt,dy:Tt===0?Ct:et,key:"".concat(ht,"-").concat(Tt)},ht)}))});Text.displayName="Text";function ownKeys$8(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$8(o){for(var _=1;_{var{viewBox:_,position:$,offset:j=0,parentViewBox:_e}=o,{x:et,y:tt,height:rt,upperWidth:nt,lowerWidth:ot}=cartesianViewBoxToTrapezoid(_),it=et,st=et+(nt-ot)/2,at=(it+st)/2,lt=(nt+ot)/2,ct=it+nt/2,ft=rt>=0?1:-1,dt=ft*j,pt=ft>0?"end":"start",yt=ft>0?"start":"end",vt=nt>=0?1:-1,wt=vt*j,Ct=vt>0?"end":"start",Pt=vt>0?"start":"end",Bt=_e;if($==="top"){var At={x:it+nt/2,y:tt-dt,horizontalAnchor:"middle",verticalAnchor:pt};return Bt&&(At.height=Math.max(tt-Bt.y,0),At.width=nt),At}if($==="bottom"){var kt={x:st+ot/2,y:tt+rt+dt,horizontalAnchor:"middle",verticalAnchor:yt};return Bt&&(kt.height=Math.max(Bt.y+Bt.height-(tt+rt),0),kt.width=ot),kt}if($==="left"){var Ot={x:at-wt,y:tt+rt/2,horizontalAnchor:Ct,verticalAnchor:"middle"};return Bt&&(Ot.width=Math.max(Ot.x-Bt.x,0),Ot.height=rt),Ot}if($==="right"){var Tt={x:at+lt+wt,y:tt+rt/2,horizontalAnchor:Pt,verticalAnchor:"middle"};return Bt&&(Tt.width=Math.max(Bt.x+Bt.width-Tt.x,0),Tt.height=rt),Tt}var ht=Bt?{width:lt,height:rt}:{};return $==="insideLeft"?_objectSpread$8({x:at+wt,y:tt+rt/2,horizontalAnchor:Pt,verticalAnchor:"middle"},ht):$==="insideRight"?_objectSpread$8({x:at+lt-wt,y:tt+rt/2,horizontalAnchor:Ct,verticalAnchor:"middle"},ht):$==="insideTop"?_objectSpread$8({x:it+nt/2,y:tt+dt,horizontalAnchor:"middle",verticalAnchor:yt},ht):$==="insideBottom"?_objectSpread$8({x:st+ot/2,y:tt+rt-dt,horizontalAnchor:"middle",verticalAnchor:pt},ht):$==="insideTopLeft"?_objectSpread$8({x:it+wt,y:tt+dt,horizontalAnchor:Pt,verticalAnchor:yt},ht):$==="insideTopRight"?_objectSpread$8({x:it+nt-wt,y:tt+dt,horizontalAnchor:Ct,verticalAnchor:yt},ht):$==="insideBottomLeft"?_objectSpread$8({x:st+wt,y:tt+rt-dt,horizontalAnchor:Pt,verticalAnchor:pt},ht):$==="insideBottomRight"?_objectSpread$8({x:st+ot-wt,y:tt+rt-dt,horizontalAnchor:Ct,verticalAnchor:pt},ht):$&&typeof $=="object"&&(isNumber($.x)||isPercent($.x))&&(isNumber($.y)||isPercent($.y))?_objectSpread$8({x:et+getPercentValue($.x,lt),y:tt+getPercentValue($.y,rt),horizontalAnchor:"end",verticalAnchor:"end"},ht):_objectSpread$8({x:ct,y:tt+rt/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ht)},_excluded$7=["labelRef"],_excluded2$2=["content"];function _objectWithoutProperties$7(o,_){if(o==null)return{};var $,j,_e=_objectWithoutPropertiesLoose$7(o,_);if(Object.getOwnPropertySymbols){var et=Object.getOwnPropertySymbols(o);for(j=0;j{var o=reactExports.useContext(CartesianLabelContext),_=useViewBox();return o||(_?cartesianViewBoxToTrapezoid(_):void 0)},PolarLabelContext=reactExports.createContext(null),usePolarLabelContext=()=>{var o=reactExports.useContext(PolarLabelContext),_=useAppSelector(selectPolarViewBox);return o||_},getLabel=o=>{var{value:_,formatter:$}=o,j=isNullish(o.children)?_:o.children;return typeof $=="function"?$(j):j},isLabelContentAFunction=o=>o!=null&&typeof o=="function",getDeltaAngle=(o,_)=>{var $=mathSign(_-o),j=Math.min(Math.abs(_-o),360);return $*j},renderRadialLabel=(o,_,$,j,_e)=>{var{offset:et,className:tt}=o,{cx:rt,cy:nt,innerRadius:ot,outerRadius:it,startAngle:st,endAngle:at,clockWise:lt}=_e,ct=(ot+it)/2,ft=getDeltaAngle(st,at),dt=ft>=0?1:-1,pt,yt;switch(_){case"insideStart":pt=st+dt*et,yt=lt;break;case"insideEnd":pt=at-dt*et,yt=!lt;break;case"end":pt=at+dt*et,yt=lt;break;default:throw new Error("Unsupported position ".concat(_))}yt=ft<=0?yt:!yt;var vt=polarToCartesian(rt,nt,ct,pt),wt=polarToCartesian(rt,nt,ct,pt+(yt?1:-1)*359),Ct="M".concat(vt.x,",").concat(vt.y,` - A`).concat(ct,",").concat(ct,",0,1,").concat(yt?0:1,`, - `).concat(wt.x,",").concat(wt.y),Pt=isNullish(o.id)?uniqueId("recharts-radial-line-"):o.id;return reactExports.createElement("text",_extends$8({},j,{dominantBaseline:"central",className:clsx("recharts-radial-bar-label",tt)}),reactExports.createElement("defs",null,reactExports.createElement("path",{id:Pt,d:Ct})),reactExports.createElement("textPath",{xlinkHref:"#".concat(Pt)},$))},getAttrsOfPolarLabel=(o,_,$)=>{var{cx:j,cy:_e,innerRadius:et,outerRadius:tt,startAngle:rt,endAngle:nt}=o,ot=(rt+nt)/2;if($==="outside"){var{x:it,y:st}=polarToCartesian(j,_e,tt+_,ot);return{x:it,y:st,textAnchor:it>=j?"start":"end",verticalAnchor:"middle"}}if($==="center")return{x:j,y:_e,textAnchor:"middle",verticalAnchor:"middle"};if($==="centerTop")return{x:j,y:_e,textAnchor:"middle",verticalAnchor:"start"};if($==="centerBottom")return{x:j,y:_e,textAnchor:"middle",verticalAnchor:"end"};var at=(et+tt)/2,{x:lt,y:ct}=polarToCartesian(j,_e,at,ot);return{x:lt,y:ct,textAnchor:"middle",verticalAnchor:"middle"}},isPolar=o=>o!=null&&"cx"in o&&isNumber(o.cx),defaultLabelProps={angle:0,offset:5,zIndex:DefaultZIndexes.label,position:"middle",textBreakAll:!1};function polarViewBoxToTrapezoid(o){if(!isPolar(o))return o;var{cx:_,cy:$,outerRadius:j}=o,_e=j*2;return{x:_-j,y:$-j,width:_e,upperWidth:_e,lowerWidth:_e,height:_e}}function Label(o){var _=resolveDefaultProps(o,defaultLabelProps),{viewBox:$,parentViewBox:j,position:_e,value:et,children:tt,content:rt,className:nt="",textBreakAll:ot,labelRef:it}=_,st=usePolarLabelContext(),at=useCartesianLabelContext(),lt=_e==="center"?at:st??at,ct,ft,dt;$==null?ct=lt:isPolar($)?ct=$:ct=cartesianViewBoxToTrapezoid($);var pt=polarViewBoxToTrapezoid(ct);if(!ct||isNullish(et)&&isNullish(tt)&&!reactExports.isValidElement(rt)&&typeof rt!="function")return null;var yt=_objectSpread$7(_objectSpread$7({},_),{},{viewBox:ct});if(reactExports.isValidElement(rt)){var{labelRef:vt}=yt,wt=_objectWithoutProperties$7(yt,_excluded$7);return reactExports.cloneElement(rt,wt)}if(typeof rt=="function"){var{content:Ct}=yt,Pt=_objectWithoutProperties$7(yt,_excluded2$2);if(ft=reactExports.createElement(rt,Pt),reactExports.isValidElement(ft))return ft}else ft=getLabel(_);var Bt=svgPropertiesAndEvents(_);if(isPolar(ct)){if(_e==="insideStart"||_e==="insideEnd"||_e==="end")return renderRadialLabel(_,_e,ft,Bt,ct);dt=getAttrsOfPolarLabel(ct,_.offset,_.position)}else{if(!pt)return null;var At=getCartesianPosition({viewBox:pt,position:_e,offset:_.offset,parentViewBox:isPolar(j)?void 0:j});dt=_objectSpread$7(_objectSpread$7({x:At.x,y:At.y,textAnchor:At.horizontalAnchor,verticalAnchor:At.verticalAnchor},At.width!==void 0?{width:At.width}:{}),At.height!==void 0?{height:At.height}:{})}return reactExports.createElement(ZIndexLayer,{zIndex:_.zIndex},reactExports.createElement(Text,_extends$8({ref:it,className:clsx("recharts-label",nt)},Bt,dt,{textAnchor:isValidTextAnchor(Bt.textAnchor)?Bt.textAnchor:dt.textAnchor,breakAll:ot}),ft))}Label.displayName="Label";var last$3={},last$2={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return $[$.length-1]}o.last=_})(last$2);var toArray={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){return Array.isArray($)?$:Array.from($)}o.toArray=_})(toArray);(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});const _=last$2,$=toArray,j=isArrayLike;function _e(et){if(j.isArrayLike(et))return _.last($.toArray(et))}o.last=_e})(last$3);var last=last$3.last;const last$1=getDefaultExportFromCjs$1(last);var _excluded$6=["valueAccessor"],_excluded2$1=["dataKey","clockWise","id","textBreakAll","zIndex"];function _extends$7(){return _extends$7=Object.assign?Object.assign.bind():function(o){for(var _=1;_Array.isArray(o.value)?last$1(o.value):o.value,CartesianLabelListContext=reactExports.createContext(void 0),CartesianLabelListContextProvider=CartesianLabelListContext.Provider,PolarLabelListContext=reactExports.createContext(void 0);PolarLabelListContext.Provider;function useCartesianLabelListContext(){return reactExports.useContext(CartesianLabelListContext)}function usePolarLabelListContext(){return reactExports.useContext(PolarLabelListContext)}function LabelList(o){var{valueAccessor:_=defaultAccessor}=o,$=_objectWithoutProperties$6(o,_excluded$6),{dataKey:j,clockWise:_e,id:et,textBreakAll:tt,zIndex:rt}=$,nt=_objectWithoutProperties$6($,_excluded2$1),ot=useCartesianLabelListContext(),it=usePolarLabelListContext(),st=ot||it;return!st||!st.length?null:reactExports.createElement(ZIndexLayer,{zIndex:rt??DefaultZIndexes.label},reactExports.createElement(Layer,{className:"recharts-label-list"},st.map((at,lt)=>{var ct,ft=isNullish(j)?_(at,lt):getValueByDataKey(at.payload,j),dt=isNullish(et)?{}:{id:"".concat(et,"-").concat(lt)};return reactExports.createElement(Label,_extends$7({key:"label-".concat(lt)},svgPropertiesAndEvents(at),nt,dt,{fill:(ct=$.fill)!==null&&ct!==void 0?ct:at.fill,parentViewBox:at.parentViewBox,value:ft,textBreakAll:tt,viewBox:at.viewBox,index:lt,zIndex:0}))})))}LabelList.displayName="LabelList";function LabelListFromLabelProp(o){var{label:_}=o;return _?_===!0?reactExports.createElement(LabelList,{key:"labelList-implicit"}):reactExports.isValidElement(_)||isLabelContentAFunction(_)?reactExports.createElement(LabelList,{key:"labelList-implicit",content:_}):typeof _=="object"?reactExports.createElement(LabelList,_extends$7({key:"labelList-implicit"},_,{type:String(_.type)})):null:null}function _extends$6(){return _extends$6=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var{cx:_,cy:$,r:j,className:_e}=o,et=clsx("recharts-dot",_e);return isNumber(_)&&isNumber($)&&isNumber(j)?reactExports.createElement("circle",_extends$6({},svgPropertiesNoEvents(o),adaptEventHandlers(o),{className:et,cx:_,cy:$,r:j})):null},initialState$7={radiusAxis:{},angleAxis:{}},polarAxisSlice=createSlice({name:"polarAxis",initialState:initialState$7,reducers:{addRadiusAxis(o,_){o.radiusAxis[_.payload.id]=_.payload},removeRadiusAxis(o,_){delete o.radiusAxis[_.payload.id]},addAngleAxis(o,_){o.angleAxis[_.payload.id]=_.payload},removeAngleAxis(o,_){delete o.angleAxis[_.payload.id]}}}),{addRadiusAxis,removeRadiusAxis,addAngleAxis,removeAngleAxis}=polarAxisSlice.actions,polarAxisReducer=polarAxisSlice.reducer,isClipDot=o=>o&&typeof o=="object"&&"clipDot"in o?!!o.clipDot:!0,isPlainObject$2={};(function(o){Object.defineProperty(o,Symbol.toStringTag,{value:"Module"});function _($){var _e;if(typeof $!="object"||$==null)return!1;if(Object.getPrototypeOf($)===null)return!0;if(Object.prototype.toString.call($)!=="[object Object]"){const et=$[Symbol.toStringTag];return et==null||!((_e=Object.getOwnPropertyDescriptor($,Symbol.toStringTag))!=null&&_e.writable)?!1:$.toString()===`[object ${et}]`}let j=$;for(;Object.getPrototypeOf(j)!==null;)j=Object.getPrototypeOf(j);return Object.getPrototypeOf($)===j}o.isPlainObject=_})(isPlainObject$2);var isPlainObject=isPlainObject$2.isPlainObject;const isPlainObject$1=getDefaultExportFromCjs$1(isPlainObject);var _templateObject,_templateObject2,_templateObject3,_templateObject4,_templateObject5;function ownKeys$6(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$6(o){for(var _=1;_{var et=$-j,tt;return tt=roundTemplateLiteral(_templateObject||(_templateObject=_taggedTemplateLiteral(["M ",",",""])),o,_),tt+=roundTemplateLiteral(_templateObject2||(_templateObject2=_taggedTemplateLiteral(["L ",",",""])),o+$,_),tt+=roundTemplateLiteral(_templateObject3||(_templateObject3=_taggedTemplateLiteral(["L ",",",""])),o+$-et/2,_+_e),tt+=roundTemplateLiteral(_templateObject4||(_templateObject4=_taggedTemplateLiteral(["L ",",",""])),o+$-et/2-j,_+_e),tt+=roundTemplateLiteral(_templateObject5||(_templateObject5=_taggedTemplateLiteral(["L ",","," Z"])),o,_),tt},defaultTrapezoidProps={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},Trapezoid=o=>{var _=resolveDefaultProps(o,defaultTrapezoidProps),{x:$,y:j,upperWidth:_e,lowerWidth:et,height:tt,className:rt}=_,{animationEasing:nt,animationDuration:ot,animationBegin:it,isUpdateAnimationActive:st}=_,at=reactExports.useRef(null),[lt,ct]=reactExports.useState(-1),ft=reactExports.useRef(_e),dt=reactExports.useRef(et),pt=reactExports.useRef(tt),yt=reactExports.useRef($),vt=reactExports.useRef(j),wt=useAnimationId(o,"trapezoid-");if(reactExports.useEffect(()=>{if(at.current&&at.current.getTotalLength)try{var mt=at.current.getTotalLength();mt&&ct(mt)}catch{}},[]),$!==+$||j!==+j||_e!==+_e||et!==+et||tt!==+tt||_e===0&&et===0||tt===0)return null;var Ct=clsx("recharts-trapezoid",rt);if(!st)return reactExports.createElement("g",null,reactExports.createElement("path",_extends$5({},svgPropertiesAndEvents(_),{className:Ct,d:getTrapezoidPath($,j,_e,et,tt)})));var Pt=ft.current,Bt=dt.current,At=pt.current,kt=yt.current,Ot=vt.current,Tt="0px ".concat(lt===-1?1:lt,"px"),ht="".concat(lt,"px 0px"),bt=getTransitionVal(["strokeDasharray"],ot,nt);return reactExports.createElement(JavascriptAnimate,{animationId:wt,key:wt,canBegin:lt>0,duration:ot,easing:nt,isActive:st,begin:it},mt=>{var gt=interpolate$1(Pt,_e,mt),xt=interpolate$1(Bt,et,mt),Et=interpolate$1(At,tt,mt),_t=interpolate$1(kt,$,mt),$t=interpolate$1(Ot,j,mt);at.current&&(ft.current=gt,dt.current=xt,pt.current=Et,yt.current=_t,vt.current=$t);var St=mt>0?{transition:bt,strokeDasharray:ht}:{strokeDasharray:Tt};return reactExports.createElement("path",_extends$5({},svgPropertiesAndEvents(_),{className:Ct,d:getTrapezoidPath(_t,$t,gt,xt,Et),ref:at,style:_objectSpread$6(_objectSpread$6({},St),_.style)}))})},_excluded$5=["option","shapeType","activeClassName"];function _objectWithoutProperties$5(o,_){if(o==null)return{};var $,j,_e=_objectWithoutPropertiesLoose$5(o,_);if(Object.getOwnPropertySymbols){var et=Object.getOwnPropertySymbols(o);for(j=0;j{j||(_e.current===null?$(addTooltipEntrySettings(_)):_e.current!==_&&$(replaceTooltipEntrySettings({prev:_e.current,next:_})),_e.current=_)},[_,$,j]),reactExports.useLayoutEffect(()=>()=>{_e.current&&($(removeTooltipEntrySettings(_e.current)),_e.current=null)},[$]),null}function SetLegendPayload(o){var{legendPayload:_}=o,$=useAppDispatch(),j=useIsPanorama(),_e=reactExports.useRef(null);return reactExports.useLayoutEffect(()=>{j||(_e.current===null?$(addLegendPayload(_)):_e.current!==_&&$(replaceLegendPayload({prev:_e.current,next:_})),_e.current=_)},[$,j,_]),reactExports.useLayoutEffect(()=>()=>{_e.current&&($(removeLegendPayload(_e.current)),_e.current=null)},[$]),null}var _ref,useIdFallback=()=>{var[o]=reactExports.useState(()=>uniqueId("uid-"));return o},useId=(_ref=React$4.useId)!==null&&_ref!==void 0?_ref:useIdFallback;function useUniqueId(o,_){var $=useId();return _||(o?"".concat(o,"-").concat($):$)}var GraphicalItemIdContext=reactExports.createContext(void 0),RegisterGraphicalItemId=o=>{var{id:_,type:$,children:j}=o,_e=useUniqueId("recharts-".concat($),_);return reactExports.createElement(GraphicalItemIdContext.Provider,{value:_e},j(_e))},initialState$6={cartesianItems:[],polarItems:[]},graphicalItemsSlice=createSlice({name:"graphicalItems",initialState:initialState$6,reducers:{addCartesianGraphicalItem:{reducer(o,_){o.cartesianItems.push(_.payload)},prepare:prepareAutoBatched()},replaceCartesianGraphicalItem:{reducer(o,_){var{prev:$,next:j}=_.payload,_e=current$1(o).cartesianItems.indexOf($);_e>-1&&(o.cartesianItems[_e]=j)},prepare:prepareAutoBatched()},removeCartesianGraphicalItem:{reducer(o,_){var $=current$1(o).cartesianItems.indexOf(_.payload);$>-1&&o.cartesianItems.splice($,1)},prepare:prepareAutoBatched()},addPolarGraphicalItem:{reducer(o,_){o.polarItems.push(_.payload)},prepare:prepareAutoBatched()},removePolarGraphicalItem:{reducer(o,_){var $=current$1(o).polarItems.indexOf(_.payload);$>-1&&o.polarItems.splice($,1)},prepare:prepareAutoBatched()}}}),{addCartesianGraphicalItem,replaceCartesianGraphicalItem,removeCartesianGraphicalItem,addPolarGraphicalItem,removePolarGraphicalItem}=graphicalItemsSlice.actions,graphicalItemsReducer=graphicalItemsSlice.reducer,SetCartesianGraphicalItemImpl=o=>{var _=useAppDispatch(),$=reactExports.useRef(null);return reactExports.useLayoutEffect(()=>{$.current===null?_(addCartesianGraphicalItem(o)):$.current!==o&&_(replaceCartesianGraphicalItem({prev:$.current,next:o})),$.current=o},[_,o]),reactExports.useLayoutEffect(()=>()=>{$.current&&(_(removeCartesianGraphicalItem($.current)),$.current=null)},[_]),null},SetCartesianGraphicalItem=reactExports.memo(SetCartesianGraphicalItemImpl),_excluded$4=["points"];function ownKeys$4(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$4(o){for(var _=1;_{var dt,pt,yt=_objectSpread$4(_objectSpread$4(_objectSpread$4({r:3},tt),st),{},{index:ft,cx:(dt=ct.x)!==null&&dt!==void 0?dt:void 0,cy:(pt=ct.y)!==null&&pt!==void 0?pt:void 0,dataKey:et,value:ct.value,payload:ct.payload,points:_});return reactExports.createElement(DotItem,{key:"dot-".concat(ft),option:$,dotProps:yt,className:_e})}),lt={};return rt&&nt!=null&&(lt.clipPath="url(#clipPath-".concat(it?"":"dots-").concat(nt,")")),reactExports.createElement(ZIndexLayer,{zIndex:ot},reactExports.createElement(Layer,_extends$4({className:j},lt),at))}function ownKeys$3(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$3(o){for(var _=1;_({top:o.top,bottom:o.bottom,left:o.left,right:o.right})),selectPlotArea=createSelector([selectChartOffset,selectChartWidth,selectChartHeight],(o,_,$)=>{if(!(!o||_==null||$==null))return{x:o.left,y:o.top,width:Math.max(0,_-o.left-o.right),height:Math.max(0,$-o.top-o.bottom)}}),usePlotArea=()=>useAppSelector(selectPlotArea),useActiveTooltipDataPoints=()=>useAppSelector(selectActiveTooltipDataPoints);function ownKeys$2(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread$2(o){for(var _=1;_{var{point:_,childIndex:$,mainColor:j,activeDot:_e,dataKey:et,clipPath:tt}=o;if(_e===!1||_.x==null||_.y==null)return null;var rt={index:$,dataKey:et,cx:_.x,cy:_.y,r:4,fill:j??"none",strokeWidth:2,stroke:"#fff",payload:_.payload,value:_.value},nt=_objectSpread$2(_objectSpread$2(_objectSpread$2({},rt),svgPropertiesNoEventsFromUnknown(_e)),adaptEventHandlers(_e)),ot;return reactExports.isValidElement(_e)?ot=reactExports.cloneElement(_e,nt):typeof _e=="function"?ot=_e(nt):ot=reactExports.createElement(Dot,nt),reactExports.createElement(Layer,{className:"recharts-active-dot",clipPath:tt},ot)};function ActivePoints(o){var{points:_,mainColor:$,activeDot:j,itemDataKey:_e,clipPath:et,zIndex:tt=DefaultZIndexes.activeDot}=o,rt=useAppSelector(selectActiveTooltipIndex),nt=useActiveTooltipDataPoints();if(_==null||nt==null)return null;var ot=_.find(it=>nt.includes(it.payload));return isNullish(ot)?null:reactExports.createElement(ZIndexLayer,{zIndex:tt},reactExports.createElement(ActivePoint,{point:ot,childIndex:Number(rt),mainColor:$,dataKey:_e,activeDot:j,clipPath:et}))}var ChartDataContextProvider=o=>{var{chartData:_}=o,$=useAppDispatch(),j=useIsPanorama();return reactExports.useEffect(()=>j?()=>{}:($(setChartData(_)),()=>{$(setChartData(void 0))}),[_,$,j]),null},initialState$4={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},brushSlice=createSlice({name:"brush",initialState:initialState$4,reducers:{setBrushSettings(o,_){return _.payload==null?initialState$4:_.payload}}}),{setBrushSettings}=brushSlice.actions,brushReducer=brushSlice.reducer,initialState$3={dots:[],areas:[],lines:[]},referenceElementsSlice=createSlice({name:"referenceElements",initialState:initialState$3,reducers:{addDot:(o,_)=>{o.dots.push(_.payload)},removeDot:(o,_)=>{var $=current$1(o).dots.findIndex(j=>j===_.payload);$!==-1&&o.dots.splice($,1)},addArea:(o,_)=>{o.areas.push(_.payload)},removeArea:(o,_)=>{var $=current$1(o).areas.findIndex(j=>j===_.payload);$!==-1&&o.areas.splice($,1)},addLine:(o,_)=>{o.lines.push(_.payload)},removeLine:(o,_)=>{var $=current$1(o).lines.findIndex(j=>j===_.payload);$!==-1&&o.lines.splice($,1)}}}),{addDot,removeDot,addArea,removeArea,addLine,removeLine}=referenceElementsSlice.actions,referenceElementsReducer=referenceElementsSlice.reducer,ClipPathIdContext=reactExports.createContext(void 0),ClipPathProvider=o=>{var{children:_}=o,[$]=reactExports.useState("".concat(uniqueId("recharts"),"-clip")),j=usePlotArea();if(j==null)return null;var{x:_e,y:et,width:tt,height:rt}=j;return reactExports.createElement(ClipPathIdContext.Provider,{value:$},reactExports.createElement("defs",null,reactExports.createElement("clipPath",{id:$},reactExports.createElement("rect",{x:_e,y:et,height:rt,width:tt}))),_)},initialState$2={},errorBarSlice=createSlice({name:"errorBars",initialState:initialState$2,reducers:{addErrorBar:(o,_)=>{var{itemId:$,errorBar:j}=_.payload;o[$]||(o[$]=[]),o[$].push(j)},replaceErrorBar:(o,_)=>{var{itemId:$,prev:j,next:_e}=_.payload;o[$]&&(o[$]=o[$].map(et=>et.dataKey===j.dataKey&&et.direction===j.direction?_e:et))},removeErrorBar:(o,_)=>{var{itemId:$,errorBar:j}=_.payload;o[$]&&(o[$]=o[$].filter(_e=>_e.dataKey!==j.dataKey||_e.direction!==j.direction))}}}),{addErrorBar,replaceErrorBar,removeErrorBar}=errorBarSlice.actions,errorBarReducer=errorBarSlice.reducer,_excluded$3=["children"];function _objectWithoutProperties$3(o,_){if(o==null)return{};var $,j,_e=_objectWithoutPropertiesLoose$3(o,_);if(Object.getOwnPropertySymbols){var et=Object.getOwnPropertySymbols(o);for(j=0;j({x:0,y:0,value:0}),errorBarOffset:0},ErrorBarContext=reactExports.createContext(initialContextState);function SetErrorBarContext(o){var{children:_}=o,$=_objectWithoutProperties$3(o,_excluded$3);return reactExports.createElement(ErrorBarContext.Provider,{value:$},_)}function useNeedsClip(o,_){var $,j,_e=useAppSelector(ot=>selectXAxisSettings(ot,o)),et=useAppSelector(ot=>selectYAxisSettings(ot,_)),tt=($=_e==null?void 0:_e.allowDataOverflow)!==null&&$!==void 0?$:implicitXAxis.allowDataOverflow,rt=(j=et==null?void 0:et.allowDataOverflow)!==null&&j!==void 0?j:implicitYAxis.allowDataOverflow,nt=tt||rt;return{needClip:nt,needClipX:tt,needClipY:rt}}function GraphicalItemClipPath(o){var{xAxisId:_,yAxisId:$,clipPathId:j}=o,_e=usePlotArea(),{needClipX:et,needClipY:tt,needClip:rt}=useNeedsClip(_,$);if(!rt||!_e)return null;var{x:nt,y:ot,width:it,height:st}=_e;return reactExports.createElement("clipPath",{id:"clipPath-".concat(j)},reactExports.createElement("rect",{x:et?nt:nt-it/2,y:tt?ot:ot-st/2,width:et?it:it*2,height:tt?st:st*2}))}var selectXAxisWithScale=(o,_,$,j)=>selectAxisWithScale(o,"xAxis",_,j),selectXAxisTicks=(o,_,$,j)=>selectTicksOfGraphicalItem(o,"xAxis",_,j),selectYAxisWithScale=(o,_,$,j)=>selectAxisWithScale(o,"yAxis",$,j),selectYAxisTicks=(o,_,$,j)=>selectTicksOfGraphicalItem(o,"yAxis",$,j),selectBandSize=createSelector([selectChartLayout,selectXAxisWithScale,selectYAxisWithScale,selectXAxisTicks,selectYAxisTicks],(o,_,$,j,_e)=>isCategoricalAxis(o,"xAxis")?getBandSizeOfAxis(_,j,!1):getBandSizeOfAxis($,_e,!1)),pickLineId=(o,_,$,j,_e)=>_e;function isLineSettings(o){return o.type==="line"}var selectSynchronisedLineSettings=createSelector([selectUnfilteredCartesianItems,pickLineId],(o,_)=>o.filter(isLineSettings).find($=>$.id===_)),selectLinePoints=createSelector([selectChartLayout,selectXAxisWithScale,selectYAxisWithScale,selectXAxisTicks,selectYAxisTicks,selectSynchronisedLineSettings,selectBandSize,selectChartDataWithIndexesIfNotInPanoramaPosition4],(o,_,$,j,_e,et,tt,rt)=>{var{chartData:nt,dataStartIndex:ot,dataEndIndex:it}=rt;if(!(et==null||_==null||$==null||j==null||_e==null||j.length===0||_e.length===0||tt==null||o!=="horizontal"&&o!=="vertical")){var{dataKey:st,data:at}=et,lt;if(at!=null&&at.length>0?lt=at:lt=nt==null?void 0:nt.slice(ot,it+1),lt!=null)return computeLinePoints({layout:o,xAxis:_,yAxis:$,xAxisTicks:j,yAxisTicks:_e,dataKey:st,bandSize:tt,displayedData:lt})}});function getRadiusAndStrokeWidthFromDot(o){var _=svgPropertiesNoEventsFromUnknown(o),$=3,j=2;if(_!=null){var{r:_e,strokeWidth:et}=_,tt=Number(_e),rt=Number(et);return(Number.isNaN(tt)||tt<0)&&(tt=$),(Number.isNaN(rt)||rt<0)&&(rt=j),{r:tt,strokeWidth:rt}}return{r:$,strokeWidth:j}}var useSyncExternalStoreWithSelector_production={};/** - * @license React - * use-sync-external-store-with-selector.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */var React=reactExports;function is$1(o,_){return o===_&&(o!==0||1/o===1/_)||o!==o&&_!==_}var objectIs=typeof Object.is=="function"?Object.is:is$1,useSyncExternalStore=React.useSyncExternalStore,useRef=React.useRef,useEffect=React.useEffect,useMemo=React.useMemo,useDebugValue=React.useDebugValue;useSyncExternalStoreWithSelector_production.useSyncExternalStoreWithSelector=function(o,_,$,j,_e){var et=useRef(null);if(et.current===null){var tt={hasValue:!1,value:null};et.current=tt}else tt=et.current;et=useMemo(function(){function nt(lt){if(!ot){if(ot=!0,it=lt,lt=j(lt),_e!==void 0&&tt.hasValue){var ct=tt.value;if(_e(ct,lt))return st=ct}return st=lt}if(ct=st,objectIs(it,lt))return ct;var ft=j(lt);return _e!==void 0&&_e(ct,ft)?(it=lt,ct):(it=lt,st=ft)}var ot=!1,it,st,at=$===void 0?null:$;return[function(){return nt(_())},at===null?void 0:function(){return nt(at())}]},[_,$,j,_e]);var rt=useSyncExternalStore(o,et[0],et[1]);return useEffect(function(){tt.hasValue=!0,tt.value=rt},[rt]),useDebugValue(rt),rt};function defaultNoopBatch(o){o()}function createListenerCollection(){let o=null,_=null;return{clear(){o=null,_=null},notify(){defaultNoopBatch(()=>{let $=o;for(;$;)$.callback(),$=$.next})},get(){const $=[];let j=o;for(;j;)$.push(j),j=j.next;return $},subscribe($){let j=!0;const _e=_={callback:$,next:null,prev:_};return _e.prev?_e.prev.next=_e:o=_e,function(){!j||o===null||(j=!1,_e.next?_e.next.prev=_e.prev:_=_e.prev,_e.prev?_e.prev.next=_e.next:o=_e.next)}}}}var nullListeners={notify(){},get:()=>[]};function createSubscription(o,_){let $,j=nullListeners,_e=0,et=!1;function tt(ft){it();const dt=j.subscribe(ft);let pt=!1;return()=>{pt||(pt=!0,dt(),st())}}function rt(){j.notify()}function nt(){ct.onStateChange&&ct.onStateChange()}function ot(){return et}function it(){_e++,$||($=o.subscribe(nt),j=createListenerCollection())}function st(){_e--,$&&_e===0&&($(),$=void 0,j.clear(),j=nullListeners)}function at(){et||(et=!0,it())}function lt(){et&&(et=!1,st())}const ct={addNestedSub:tt,notifyNestedSubs:rt,handleChangeWrapper:nt,isSubscribed:ot,trySubscribe:at,tryUnsubscribe:lt,getListeners:()=>j};return ct}var canUseDOM=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",isDOM=canUseDOM(),isRunningInReactNative=()=>typeof navigator<"u"&&navigator.product==="ReactNative",isReactNative=isRunningInReactNative(),getUseIsomorphicLayoutEffect=()=>isDOM||isReactNative?reactExports.useLayoutEffect:reactExports.useEffect,useIsomorphicLayoutEffect=getUseIsomorphicLayoutEffect();function is(o,_){return o===_?o!==0||_!==0||1/o===1/_:o!==o&&_!==_}function shallowEqual(o,_){if(is(o,_))return!0;if(typeof o!="object"||o===null||typeof _!="object"||_===null)return!1;const $=Object.keys(o),j=Object.keys(_);if($.length!==j.length)return!1;for(let _e=0;_e<$.length;_e++)if(!Object.prototype.hasOwnProperty.call(_,$[_e])||!is(o[$[_e]],_[$[_e]]))return!1;return!0}var ContextKey=Symbol.for("react-redux-context"),gT=typeof globalThis<"u"?globalThis:{};function getContext(){if(!reactExports.createContext)return{};const o=gT[ContextKey]??(gT[ContextKey]=new Map);let _=o.get(reactExports.createContext);return _||(_=reactExports.createContext(null),o.set(reactExports.createContext,_)),_}var ReactReduxContext=getContext();function Provider(o){const{children:_,context:$,serverState:j,store:_e}=o,et=reactExports.useMemo(()=>{const nt=createSubscription(_e);return{store:_e,subscription:nt,getServerState:j?()=>j:void 0}},[_e,j]),tt=reactExports.useMemo(()=>_e.getState(),[_e]);useIsomorphicLayoutEffect(()=>{const{subscription:nt}=et;return nt.onStateChange=nt.notifyNestedSubs,nt.trySubscribe(),tt!==_e.getState()&&nt.notifyNestedSubs(),()=>{nt.tryUnsubscribe(),nt.onStateChange=void 0}},[et,tt]);const rt=$||ReactReduxContext;return reactExports.createElement(rt.Provider,{value:et},_)}var Provider_default=Provider,propsToShallowCompare=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius"]);function sameValueZero(o,_){return o==null&&_==null?!0:typeof o=="number"&&typeof _=="number"?o===_||o!==o&&_!==_:o===_}function propsAreEqual(o,_){var $=new Set([...Object.keys(o),...Object.keys(_)]);for(var j of $)if(propsToShallowCompare.has(j)){if(o[j]==null&&_[j]==null)continue;if(!shallowEqual(o[j],_[j]))return!1}else if(!sameValueZero(o[j],_[j]))return!1;return!0}var _excluded$2=["id"],_excluded2=["type","layout","connectNulls","needClip","shape"],_excluded3=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId","id"];function _extends$3(){return _extends$3=Object.assign?Object.assign.bind():function(o){for(var _=1;_{var{dataKey:_,name:$,stroke:j,legendType:_e,hide:et}=o;return[{inactive:et,dataKey:_,type:_e,color:j,value:getTooltipNameProp($,_),payload:o}]},SetLineTooltipEntrySettings=reactExports.memo(o=>{var{dataKey:_,data:$,stroke:j,strokeWidth:_e,fill:et,name:tt,hide:rt,unit:nt,tooltipType:ot,id:it}=o,st={dataDefinedOnItem:$,getPosition:noop$2,settings:{stroke:j,strokeWidth:_e,fill:et,dataKey:_,nameKey:void 0,name:getTooltipNameProp(tt,_),hide:rt,type:ot,color:j,unit:nt,graphicalItemId:it}};return reactExports.createElement(SetTooltipEntrySettings,{tooltipEntrySettings:st})}),generateSimpleStrokeDasharray=(o,_)=>"".concat(_,"px ").concat(o-_,"px");function repeat(o,_){for(var $=o.length%2!==0?[...o,0]:o,j=[],_e=0;_e<_;++_e)j=[...j,...$];return j}var getStrokeDasharray=(o,_,$)=>{var j=$.reduce((lt,ct)=>lt+ct);if(!j)return generateSimpleStrokeDasharray(_,o);for(var _e=Math.floor(o/j),et=o%j,tt=_-o,rt=[],nt=0,ot=0;nt<$.length;ot+=(it=$[nt])!==null&&it!==void 0?it:0,++nt){var it,st=$[nt];if(st!=null&&ot+st>et){rt=[...$.slice(0,nt),et-ot];break}}var at=rt.length%2===0?[0,tt]:[tt];return[...repeat($,_e),...rt,...at].map(lt=>"".concat(lt,"px")).join(", ")};function LineDotsWrapper(o){var{clipPathId:_,points:$,props:j}=o,{dot:_e,dataKey:et,needClip:tt}=j,{id:rt}=j,nt=_objectWithoutProperties$2(j,_excluded$2),ot=svgPropertiesNoEvents(nt);return reactExports.createElement(Dots,{points:$,dot:_e,className:"recharts-line-dots",dotClassName:"recharts-line-dot",dataKey:et,baseProps:ot,needClip:tt,clipPathId:_})}function LineLabelListProvider(o){var{showLabels:_,children:$,points:j}=o,_e=reactExports.useMemo(()=>j==null?void 0:j.map(et=>{var tt,rt,nt={x:(tt=et.x)!==null&&tt!==void 0?tt:0,y:(rt=et.y)!==null&&rt!==void 0?rt:0,width:0,lowerWidth:0,upperWidth:0,height:0};return _objectSpread$1(_objectSpread$1({},nt),{},{value:et.value,payload:et.payload,viewBox:nt,parentViewBox:void 0,fill:void 0})}),[j]);return reactExports.createElement(CartesianLabelListContextProvider,{value:_?_e:void 0},$)}function StaticCurve(o){var{clipPathId:_,pathRef:$,points:j,strokeDasharray:_e,props:et}=o,{type:tt,layout:rt,connectNulls:nt,needClip:ot,shape:it}=et,st=_objectWithoutProperties$2(et,_excluded2),at=_objectSpread$1(_objectSpread$1({},svgPropertiesAndEvents(st)),{},{fill:"none",className:"recharts-line-curve",clipPath:ot?"url(#clipPath-".concat(_,")"):void 0,points:j,type:tt,layout:rt,connectNulls:nt,strokeDasharray:_e??et.strokeDasharray});return reactExports.createElement(reactExports.Fragment,null,(j==null?void 0:j.length)>1&&reactExports.createElement(Shape,_extends$3({shapeType:"curve",option:it},at,{pathRef:$})),reactExports.createElement(LineDotsWrapper,{points:j,clipPathId:_,props:et}))}function getTotalLength(o){try{return o&&o.getTotalLength&&o.getTotalLength()||0}catch{return 0}}function CurveWithAnimation(o){var{clipPathId:_,props:$,pathRef:j,previousPointsRef:_e,longestAnimatedLengthRef:et}=o,{points:tt,strokeDasharray:rt,isAnimationActive:nt,animationBegin:ot,animationDuration:it,animationEasing:st,animateNewValues:at,width:lt,height:ct,onAnimationEnd:ft,onAnimationStart:dt}=$,pt=_e.current,yt=useAnimationId(tt,"recharts-line-"),vt=reactExports.useRef(yt),[wt,Ct]=reactExports.useState(!1),Pt=!wt,Bt=reactExports.useCallback(()=>{typeof ft=="function"&&ft(),Ct(!1)},[ft]),At=reactExports.useCallback(()=>{typeof dt=="function"&&dt(),Ct(!0)},[dt]),kt=getTotalLength(j.current),Ot=reactExports.useRef(0);vt.current!==yt&&(Ot.current=et.current,vt.current=yt);var Tt=Ot.current;return reactExports.createElement(LineLabelListProvider,{points:tt,showLabels:Pt},$.children,reactExports.createElement(JavascriptAnimate,{animationId:yt,begin:ot,duration:it,isActive:nt,easing:st,onAnimationEnd:Bt,onAnimationStart:At,key:yt},ht=>{var bt=interpolate$1(Tt,kt+Tt,ht),mt=Math.min(bt,kt),gt;if(nt)if(rt){var xt="".concat(rt).split(/[,\s]+/gim).map($t=>parseFloat($t));gt=getStrokeDasharray(mt,kt,xt)}else gt=generateSimpleStrokeDasharray(kt,mt);else gt=rt==null?void 0:String(rt);if(ht>0&&kt>0&&(_e.current=tt,et.current=Math.max(et.current,mt)),pt){var Et=pt.length/tt.length,_t=ht===1?tt:tt.map(($t,St)=>{var Rt=Math.floor(St*Et);if(pt[Rt]){var It=pt[Rt];return _objectSpread$1(_objectSpread$1({},$t),{},{x:interpolate$1(It.x,$t.x,ht),y:interpolate$1(It.y,$t.y,ht)})}return at?_objectSpread$1(_objectSpread$1({},$t),{},{x:interpolate$1(lt*2,$t.x,ht),y:interpolate$1(ct/2,$t.y,ht)}):_objectSpread$1(_objectSpread$1({},$t),{},{x:$t.x,y:$t.y})});return _e.current=_t,reactExports.createElement(StaticCurve,{props:$,points:_t,clipPathId:_,pathRef:j,strokeDasharray:gt})}return reactExports.createElement(StaticCurve,{props:$,points:tt,clipPathId:_,pathRef:j,strokeDasharray:gt})}),reactExports.createElement(LabelListFromLabelProp,{label:$.label}))}function RenderCurve(o){var{clipPathId:_,props:$}=o,j=reactExports.useRef(null),_e=reactExports.useRef(0),et=reactExports.useRef(null);return reactExports.createElement(CurveWithAnimation,{props:$,clipPathId:_,previousPointsRef:j,longestAnimatedLengthRef:_e,pathRef:et})}var errorBarDataPointFormatter=(o,_)=>{var $,j;return{x:($=o.x)!==null&&$!==void 0?$:void 0,y:(j=o.y)!==null&&j!==void 0?j:void 0,value:o.value,errorVal:getValueByDataKey(o.payload,_)}};class LineWithState extends reactExports.Component{render(){var{hide:_,dot:$,points:j,className:_e,xAxisId:et,yAxisId:tt,top:rt,left:nt,width:ot,height:it,id:st,needClip:at,zIndex:lt}=this.props;if(_)return null;var ct=clsx("recharts-line",_e),ft=st,{r:dt,strokeWidth:pt}=getRadiusAndStrokeWidthFromDot($),yt=isClipDot($),vt=dt*2+pt,wt=at?"url(#clipPath-".concat(yt?"":"dots-").concat(ft,")"):void 0;return reactExports.createElement(ZIndexLayer,{zIndex:lt},reactExports.createElement(Layer,{className:ct},at&&reactExports.createElement("defs",null,reactExports.createElement(GraphicalItemClipPath,{clipPathId:ft,xAxisId:et,yAxisId:tt}),!yt&&reactExports.createElement("clipPath",{id:"clipPath-dots-".concat(ft)},reactExports.createElement("rect",{x:nt-vt/2,y:rt-vt/2,width:ot+vt,height:it+vt}))),reactExports.createElement(SetErrorBarContext,{xAxisId:et,yAxisId:tt,data:j,dataPointFormatter:errorBarDataPointFormatter,errorBarOffset:0},reactExports.createElement(RenderCurve,{props:this.props,clipPathId:ft}))),reactExports.createElement(ActivePoints,{activeDot:this.props.activeDot,points:j,mainColor:this.props.stroke,itemDataKey:this.props.dataKey,clipPath:wt}))}}var defaultLineProps={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:"auto",label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0,zIndex:DefaultZIndexes.line,type:"linear"};function LineImpl(o){var _=resolveDefaultProps(o,defaultLineProps),{activeDot:$,animateNewValues:j,animationBegin:_e,animationDuration:et,animationEasing:tt,connectNulls:rt,dot:nt,hide:ot,isAnimationActive:it,label:st,legendType:at,xAxisId:lt,yAxisId:ct,id:ft}=_,dt=_objectWithoutProperties$2(_,_excluded3),{needClip:pt}=useNeedsClip(lt,ct),yt=usePlotArea(),vt=useChartLayout(),wt=useIsPanorama(),Ct=useAppSelector(Ot=>selectLinePoints(Ot,lt,ct,wt,ft));if(vt!=="horizontal"&&vt!=="vertical"||Ct==null||yt==null)return null;var{height:Pt,width:Bt,x:At,y:kt}=yt;return reactExports.createElement(LineWithState,_extends$3({},dt,{id:ft,connectNulls:rt,dot:nt,activeDot:$,animateNewValues:j,animationBegin:_e,animationDuration:et,animationEasing:tt,isAnimationActive:it,hide:ot,label:st,legendType:at,xAxisId:lt,yAxisId:ct,points:Ct,layout:vt,height:Pt,width:Bt,left:At,top:kt,needClip:pt}))}function computeLinePoints(o){var{layout:_,xAxis:$,yAxis:j,xAxisTicks:_e,yAxisTicks:et,dataKey:tt,bandSize:rt,displayedData:nt}=o;return nt.map((ot,it)=>{var st=getValueByDataKey(ot,tt);if(_==="horizontal"){var at=getCateCoordinateOfLine({axis:$,ticks:_e,bandSize:rt,entry:ot,index:it}),lt=isNullish(st)?null:j.scale.map(st);return{x:at,y:lt??null,value:st,payload:ot}}var ct=isNullish(st)?null:$.scale.map(st),ft=getCateCoordinateOfLine({axis:j,ticks:et,bandSize:rt,entry:ot,index:it});return ct==null||ft==null?null:{x:ct,y:ft,value:st,payload:ot}}).filter(Boolean)}function LineFn(o){var _=resolveDefaultProps(o,defaultLineProps),$=useIsPanorama();return reactExports.createElement(RegisterGraphicalItemId,{id:_.id,type:"line"},j=>reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(SetLegendPayload,{legendPayload:computeLegendPayloadFromAreaData(_)}),reactExports.createElement(SetLineTooltipEntrySettings,{dataKey:_.dataKey,data:_.data,stroke:_.stroke,strokeWidth:_.strokeWidth,fill:_.fill,name:_.name,hide:_.hide,unit:_.unit,tooltipType:_.tooltipType,id:j}),reactExports.createElement(SetCartesianGraphicalItem,{type:"line",id:j,data:_.data,xAxisId:_.xAxisId,yAxisId:_.yAxisId,zAxisId:0,dataKey:_.dataKey,hide:_.hide,isPanorama:$}),reactExports.createElement(LineImpl,_extends$3({},_,{id:j}))))}var Line=reactExports.memo(LineFn,propsAreEqual);Line.displayName="Line";var pickChartPointer=(o,_)=>_,selectActivePropsFromChartPointer=createSelector([pickChartPointer,selectChartLayout,selectPolarViewBox,selectTooltipAxisType,selectTooltipAxisRangeWithReverse,selectTooltipAxisTicks,selectOrderedTooltipTicks,selectChartOffsetInternal],combineActiveProps),getChartPointer=o=>{var _=o.currentTarget.getBoundingClientRect(),$=_.width/o.currentTarget.offsetWidth,j=_.height/o.currentTarget.offsetHeight;return{chartX:Math.round((o.clientX-_.left)/$),chartY:Math.round((o.clientY-_.top)/j)}},mouseClickAction=createAction("mouseClick"),mouseClickMiddleware=createListenerMiddleware();mouseClickMiddleware.startListening({actionCreator:mouseClickAction,effect:(o,_)=>{var $=o.payload,j=selectActivePropsFromChartPointer(_.getState(),getChartPointer($));(j==null?void 0:j.activeIndex)!=null&&_.dispatch(setMouseClickAxisIndex({activeIndex:j.activeIndex,activeDataKey:void 0,activeCoordinate:j.activeCoordinate}))}});var mouseMoveAction=createAction("mouseMove"),mouseMoveMiddleware=createListenerMiddleware(),rafId=null;mouseMoveMiddleware.startListening({actionCreator:mouseMoveAction,effect:(o,_)=>{var $=o.payload;rafId!==null&&cancelAnimationFrame(rafId);var j=getChartPointer($);rafId=requestAnimationFrame(()=>{var _e=_.getState(),et=selectTooltipEventType$1(_e,_e.tooltip.settings.shared);if(et==="axis"){var tt=selectActivePropsFromChartPointer(_e,j);(tt==null?void 0:tt.activeIndex)!=null?_.dispatch(setMouseOverAxisIndex({activeIndex:tt.activeIndex,activeDataKey:void 0,activeCoordinate:tt.activeCoordinate})):_.dispatch(mouseLeaveChart())}rafId=null})}});function reduxDevtoolsJsonStringifyReplacer(o,_){return _ instanceof HTMLElement?"HTMLElement <".concat(_.tagName,' class="').concat(_.className,'">'):_===window?"global.window":o==="children"&&typeof _=="object"&&_!==null?"<>":_}var initialState$1={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},rootPropsSlice=createSlice({name:"rootProps",initialState:initialState$1,reducers:{updateOptions:(o,_)=>{var $;o.accessibilityLayer=_.payload.accessibilityLayer,o.barCategoryGap=_.payload.barCategoryGap,o.barGap=($=_.payload.barGap)!==null&&$!==void 0?$:initialState$1.barGap,o.barSize=_.payload.barSize,o.maxBarSize=_.payload.maxBarSize,o.stackOffset=_.payload.stackOffset,o.syncId=_.payload.syncId,o.syncMethod=_.payload.syncMethod,o.className=_.payload.className,o.baseValue=_.payload.baseValue,o.reverseStackOrder=_.payload.reverseStackOrder}}}),rootPropsReducer=rootPropsSlice.reducer,{updateOptions}=rootPropsSlice.actions,initialState=null,reducers={updatePolarOptions:(o,_)=>_.payload},polarOptionsSlice=createSlice({name:"polarOptions",initialState,reducers}),{updatePolarOptions}=polarOptionsSlice.actions,polarOptionsReducer=polarOptionsSlice.reducer,keyDownAction=createAction("keyDown"),focusAction=createAction("focus"),keyboardEventsMiddleware=createListenerMiddleware();keyboardEventsMiddleware.startListening({actionCreator:keyDownAction,effect:(o,_)=>{var $=_.getState(),j=$.rootProps.accessibilityLayer!==!1;if(j){var{keyboardInteraction:_e}=$.tooltip,et=o.payload;if(!(et!=="ArrowRight"&&et!=="ArrowLeft"&&et!=="Enter")){var tt=combineActiveTooltipIndex(_e,selectTooltipDisplayedData($),selectTooltipAxisDataKey($),selectTooltipAxisDomain($)),rt=tt==null?-1:Number(tt);if(!(!Number.isFinite(rt)||rt<0)){var nt=selectTooltipAxisTicks($);if(et==="Enter"){var ot=selectCoordinateForDefaultIndex($,"axis","hover",String(_e.index));_.dispatch(setKeyboardInteraction({active:!_e.active,activeIndex:_e.index,activeCoordinate:ot}));return}var it=selectChartDirection($),st=it==="left-to-right"?1:-1,at=et==="ArrowRight"?1:-1,lt=rt+at*st;if(!(nt==null||lt>=nt.length||lt<0)){var ct=selectCoordinateForDefaultIndex($,"axis","hover",String(lt));_.dispatch(setKeyboardInteraction({active:!0,activeIndex:lt.toString(),activeCoordinate:ct}))}}}}}});keyboardEventsMiddleware.startListening({actionCreator:focusAction,effect:(o,_)=>{var $=_.getState(),j=$.rootProps.accessibilityLayer!==!1;if(j){var{keyboardInteraction:_e}=$.tooltip;if(!_e.active&&_e.index==null){var et="0",tt=selectCoordinateForDefaultIndex($,"axis","hover",String(et));_.dispatch(setKeyboardInteraction({active:!0,activeIndex:et,activeCoordinate:tt}))}}}});var externalEventAction=createAction("externalEvent"),externalEventsMiddleware=createListenerMiddleware(),rafIdMap=new Map;externalEventsMiddleware.startListening({actionCreator:externalEventAction,effect:(o,_)=>{var{handler:$,reactEvent:j}=o.payload;if($!=null){j.persist();var _e=j.type,et=rafIdMap.get(_e);et!==void 0&&cancelAnimationFrame(et);var tt=requestAnimationFrame(()=>{try{var rt=_.getState(),nt={activeCoordinate:selectActiveTooltipCoordinate(rt),activeDataKey:selectActiveTooltipDataKey(rt),activeIndex:selectActiveTooltipIndex(rt),activeLabel:selectActiveLabel$1(rt),activeTooltipIndex:selectActiveTooltipIndex(rt),isTooltipActive:selectIsTooltipActive$1(rt)};$(nt,j)}finally{rafIdMap.delete(_e)}});rafIdMap.set(_e,tt)}}});var selectAllTooltipPayloadConfiguration=createSelector([selectTooltipState],o=>o.tooltipItemPayloads),selectTooltipCoordinate=createSelector([selectAllTooltipPayloadConfiguration,(o,_)=>_,(o,_,$)=>$],(o,_,$)=>{if(_!=null){var j=o.find(et=>et.settings.graphicalItemId===$);if(j!=null){var{getPosition:_e}=j;if(_e!=null)return _e(_)}}}),touchEventAction=createAction("touchMove"),touchEventMiddleware=createListenerMiddleware();touchEventMiddleware.startListening({actionCreator:touchEventAction,effect:(o,_)=>{var $=o.payload;if(!($.touches==null||$.touches.length===0)){var j=_.getState(),_e=selectTooltipEventType$1(j,j.tooltip.settings.shared);if(_e==="axis"){var et=$.touches[0];if(et==null)return;var tt=selectActivePropsFromChartPointer(j,getChartPointer({clientX:et.clientX,clientY:et.clientY,currentTarget:$.currentTarget}));(tt==null?void 0:tt.activeIndex)!=null&&_.dispatch(setMouseOverAxisIndex({activeIndex:tt.activeIndex,activeDataKey:void 0,activeCoordinate:tt.activeCoordinate}))}else if(_e==="item"){var rt,nt=$.touches[0];if(document.elementFromPoint==null||nt==null)return;var ot=document.elementFromPoint(nt.clientX,nt.clientY);if(!ot||!ot.getAttribute)return;var it=ot.getAttribute(DATA_ITEM_INDEX_ATTRIBUTE_NAME),st=(rt=ot.getAttribute(DATA_ITEM_GRAPHICAL_ITEM_ID_ATTRIBUTE_NAME))!==null&&rt!==void 0?rt:void 0,at=selectAllGraphicalItemsSettings(j).find(ft=>ft.id===st);if(it==null||at==null||st==null)return;var{dataKey:lt}=at,ct=selectTooltipCoordinate(j,it,st);_.dispatch(setActiveMouseOverItemIndex({activeDataKey:lt,activeIndex:it,activeCoordinate:ct,activeGraphicalItemId:st}))}}}});var rootReducer=combineReducers({brush:brushReducer,cartesianAxis:cartesianAxisReducer,chartData:chartDataReducer,errorBars:errorBarReducer,graphicalItems:graphicalItemsReducer,layout:chartLayoutReducer,legend:legendReducer,options:optionsReducer,polarAxis:polarAxisReducer,polarOptions:polarOptionsReducer,referenceElements:referenceElementsReducer,rootProps:rootPropsReducer,tooltip:tooltipReducer,zIndex:zIndexReducer}),createRechartsStore=function o(_){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return configureStore({reducer:rootReducer,preloadedState:_,middleware:j=>{var _e;return j({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((_e="es6")!==null&&_e!==void 0?_e:"")}).concat([mouseClickMiddleware.middleware,mouseMoveMiddleware.middleware,keyboardEventsMiddleware.middleware,externalEventsMiddleware.middleware,touchEventMiddleware.middleware])},enhancers:j=>{var _e=j;return typeof j=="function"&&(_e=j()),_e.concat(autoBatchEnhancer({type:"raf"}))},devTools:{serialize:{replacer:reduxDevtoolsJsonStringifyReplacer},name:"recharts-".concat($)}})};function RechartsStoreProvider(o){var{preloadedState:_,children:$,reduxStoreName:j}=o,_e=useIsPanorama(),et=reactExports.useRef(null);if(_e)return $;et.current==null&&(et.current=createRechartsStore(_,j));var tt=RechartsReduxContext;return reactExports.createElement(Provider_default,{context:tt,store:et.current},$)}function ReportMainChartPropsImpl(o){var{layout:_,margin:$}=o,j=useAppDispatch(),_e=useIsPanorama();return reactExports.useEffect(()=>{_e||(j(setLayout(_)),j(setMargin($)))},[j,_e,_,$]),null}var ReportMainChartProps=reactExports.memo(ReportMainChartPropsImpl,propsAreEqual);function ReportChartProps(o){var _=useAppDispatch();return reactExports.useEffect(()=>{_(updateOptions(o))},[_,o]),null}function ZIndexSvgPortal(o){var{zIndex:_,isPanorama:$}=o,j=reactExports.useRef(null),_e=useAppDispatch();return reactExports.useLayoutEffect(()=>(j.current&&_e(registerZIndexPortalElement({zIndex:_,element:j.current,isPanorama:$})),()=>{_e(unregisterZIndexPortalElement({zIndex:_,isPanorama:$}))}),[_e,_,$]),reactExports.createElement("g",{tabIndex:-1,ref:j})}function AllZIndexPortals(o){var{children:_,isPanorama:$}=o,j=useAppSelector(selectAllRegisteredZIndexes);if(!j||j.length===0)return _;var _e=j.filter(tt=>tt<0),et=j.filter(tt=>tt>0);return reactExports.createElement(reactExports.Fragment,null,_e.map(tt=>reactExports.createElement(ZIndexSvgPortal,{key:tt,zIndex:tt,isPanorama:$})),_,et.map(tt=>reactExports.createElement(ZIndexSvgPortal,{key:tt,zIndex:tt,isPanorama:$})))}var _excluded$1=["children"];function _objectWithoutProperties$1(o,_){if(o==null)return{};var $,j,_e=_objectWithoutPropertiesLoose$1(o,_);if(Object.getOwnPropertySymbols){var et=Object.getOwnPropertySymbols(o);for(j=0;j{var $=useChartWidth(),j=useChartHeight(),_e=useAccessibilityLayer();if(!isPositiveNumber($)||!isPositiveNumber(j))return null;var{children:et,otherAttributes:tt,title:rt,desc:nt}=o,ot,it;return tt!=null&&(typeof tt.tabIndex=="number"?ot=tt.tabIndex:ot=_e?0:void 0,typeof tt.role=="string"?it=tt.role:it=_e?"application":void 0),reactExports.createElement(Surface,_extends$2({},tt,{title:rt,desc:nt,role:it,tabIndex:ot,width:$,height:j,style:FULL_WIDTH_AND_HEIGHT,ref:_}),et)}),BrushPanoramaSurface=o=>{var{children:_}=o,$=useAppSelector(selectBrushDimensions);if(!$)return null;var{width:j,height:_e,y:et,x:tt}=$;return reactExports.createElement(Surface,{width:j,height:_e,x:tt,y:et},_)},RootSurface=reactExports.forwardRef((o,_)=>{var{children:$}=o,j=_objectWithoutProperties$1(o,_excluded$1),_e=useIsPanorama();return _e?reactExports.createElement(BrushPanoramaSurface,null,reactExports.createElement(AllZIndexPortals,{isPanorama:!0},$)):reactExports.createElement(MainChartSurface,_extends$2({ref:_},j),reactExports.createElement(AllZIndexPortals,{isPanorama:!1},$))});function useReportScale(){var o=useAppDispatch(),[_,$]=reactExports.useState(null),j=useAppSelector(selectContainerScale);return reactExports.useEffect(()=>{if(_!=null){var _e=_.getBoundingClientRect(),et=_e.width/_.offsetWidth;isWellBehavedNumber(et)&&et!==j&&o(setScale(et))}},[_,o,j]),$}function ownKeys(o,_){var $=Object.keys(o);if(Object.getOwnPropertySymbols){var j=Object.getOwnPropertySymbols(o);_&&(j=j.filter(function(_e){return Object.getOwnPropertyDescriptor(o,_e).enumerable})),$.push.apply($,j)}return $}function _objectSpread(o){for(var _=1;_(useSynchronisedEventsFromOtherCharts(),null);function getNumberOrZero(o){if(typeof o=="number")return o;if(typeof o=="string"){var _=parseFloat(o);if(!Number.isNaN(_))return _}return 0}var ResponsiveDiv=reactExports.forwardRef((o,_)=>{var $,j,_e=reactExports.useRef(null),[et,tt]=reactExports.useState({containerWidth:getNumberOrZero(($=o.style)===null||$===void 0?void 0:$.width),containerHeight:getNumberOrZero((j=o.style)===null||j===void 0?void 0:j.height)}),rt=reactExports.useCallback((ot,it)=>{tt(st=>{var at=Math.round(ot),lt=Math.round(it);return st.containerWidth===at&&st.containerHeight===lt?st:{containerWidth:at,containerHeight:lt}})},[]),nt=reactExports.useCallback(ot=>{if(typeof _=="function"&&_(ot),ot!=null&&typeof ResizeObserver<"u"){var{width:it,height:st}=ot.getBoundingClientRect();rt(it,st);var at=ct=>{var ft=ct[0];if(ft!=null){var{width:dt,height:pt}=ft.contentRect;rt(dt,pt)}},lt=new ResizeObserver(at);lt.observe(ot),_e.current=lt}},[_,rt]);return reactExports.useEffect(()=>()=>{var ot=_e.current;ot!=null&&ot.disconnect()},[rt]),reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(ReportChartSize,{width:et.containerWidth,height:et.containerHeight}),reactExports.createElement("div",_extends$1({ref:nt},o)))}),ReadSizeOnceDiv=reactExports.forwardRef((o,_)=>{var{width:$,height:j}=o,[_e,et]=reactExports.useState({containerWidth:getNumberOrZero($),containerHeight:getNumberOrZero(j)}),tt=reactExports.useCallback((nt,ot)=>{et(it=>{var st=Math.round(nt),at=Math.round(ot);return it.containerWidth===st&&it.containerHeight===at?it:{containerWidth:st,containerHeight:at}})},[]),rt=reactExports.useCallback(nt=>{if(typeof _=="function"&&_(nt),nt!=null){var{width:ot,height:it}=nt.getBoundingClientRect();tt(ot,it)}},[_,tt]);return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(ReportChartSize,{width:_e.containerWidth,height:_e.containerHeight}),reactExports.createElement("div",_extends$1({ref:rt},o)))}),StaticDiv=reactExports.forwardRef((o,_)=>{var{width:$,height:j}=o;return reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(ReportChartSize,{width:$,height:j}),reactExports.createElement("div",_extends$1({ref:_},o)))}),NonResponsiveDiv=reactExports.forwardRef((o,_)=>{var{width:$,height:j}=o;return typeof $=="string"||typeof j=="string"?reactExports.createElement(ReadSizeOnceDiv,_extends$1({},o,{ref:_})):typeof $=="number"&&typeof j=="number"?reactExports.createElement(StaticDiv,_extends$1({},o,{width:$,height:j,ref:_})):reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(ReportChartSize,{width:$,height:j}),reactExports.createElement("div",_extends$1({ref:_},o)))});function getWrapperDivComponent(o){return o?ResponsiveDiv:NonResponsiveDiv}var RechartsWrapper=reactExports.forwardRef((o,_)=>{var{children:$,className:j,height:_e,onClick:et,onContextMenu:tt,onDoubleClick:rt,onMouseDown:nt,onMouseEnter:ot,onMouseLeave:it,onMouseMove:st,onMouseUp:at,onTouchEnd:lt,onTouchMove:ct,onTouchStart:ft,style:dt,width:pt,responsive:yt,dispatchTouchEvents:vt=!0}=o,wt=reactExports.useRef(null),Ct=useAppDispatch(),[Pt,Bt]=reactExports.useState(null),[At,kt]=reactExports.useState(null),Ot=useReportScale(),Tt=useResponsiveContainerContext(),ht=(Tt==null?void 0:Tt.width)>0?Tt.width:pt,bt=(Tt==null?void 0:Tt.height)>0?Tt.height:_e,mt=reactExports.useCallback(qt=>{Ot(qt),typeof _=="function"&&_(qt),Bt(qt),kt(qt),qt!=null&&(wt.current=qt)},[Ot,_,Bt,kt]),gt=reactExports.useCallback(qt=>{Ct(mouseClickAction(qt)),Ct(externalEventAction({handler:et,reactEvent:qt}))},[Ct,et]),xt=reactExports.useCallback(qt=>{Ct(mouseMoveAction(qt)),Ct(externalEventAction({handler:ot,reactEvent:qt}))},[Ct,ot]),Et=reactExports.useCallback(qt=>{Ct(mouseLeaveChart()),Ct(externalEventAction({handler:it,reactEvent:qt}))},[Ct,it]),_t=reactExports.useCallback(qt=>{Ct(mouseMoveAction(qt)),Ct(externalEventAction({handler:st,reactEvent:qt}))},[Ct,st]),$t=reactExports.useCallback(()=>{Ct(focusAction())},[Ct]),St=reactExports.useCallback(qt=>{Ct(keyDownAction(qt.key))},[Ct]),Rt=reactExports.useCallback(qt=>{Ct(externalEventAction({handler:tt,reactEvent:qt}))},[Ct,tt]),It=reactExports.useCallback(qt=>{Ct(externalEventAction({handler:rt,reactEvent:qt}))},[Ct,rt]),Mt=reactExports.useCallback(qt=>{Ct(externalEventAction({handler:nt,reactEvent:qt}))},[Ct,nt]),Vt=reactExports.useCallback(qt=>{Ct(externalEventAction({handler:at,reactEvent:qt}))},[Ct,at]),Gt=reactExports.useCallback(qt=>{Ct(externalEventAction({handler:ft,reactEvent:qt}))},[Ct,ft]),zt=reactExports.useCallback(qt=>{vt&&Ct(touchEventAction(qt)),Ct(externalEventAction({handler:ct,reactEvent:qt}))},[Ct,vt,ct]),jt=reactExports.useCallback(qt=>{Ct(externalEventAction({handler:lt,reactEvent:qt}))},[Ct,lt]),Ft=getWrapperDivComponent(yt);return reactExports.createElement(TooltipPortalContext.Provider,{value:Pt},reactExports.createElement(LegendPortalContext.Provider,{value:At},reactExports.createElement(Ft,{width:ht??(dt==null?void 0:dt.width),height:bt??(dt==null?void 0:dt.height),className:clsx("recharts-wrapper",j),style:_objectSpread({position:"relative",cursor:"default",width:ht,height:bt},dt),onClick:gt,onContextMenu:Rt,onDoubleClick:It,onFocus:$t,onKeyDown:St,onMouseDown:Mt,onMouseEnter:xt,onMouseLeave:Et,onMouseMove:_t,onMouseUp:Vt,onTouchEnd:jt,onTouchMove:zt,onTouchStart:Gt,ref:mt},reactExports.createElement(EventSynchronizer,null),$)))}),_excluded=["width","height","responsive","children","className","style","compact","title","desc"];function _objectWithoutProperties(o,_){if(o==null)return{};var $,j,_e=_objectWithoutPropertiesLoose(o,_);if(Object.getOwnPropertySymbols){var et=Object.getOwnPropertySymbols(o);for(j=0;j{var{width:$,height:j,responsive:_e,children:et,className:tt,style:rt,compact:nt,title:ot,desc:it}=o,st=_objectWithoutProperties(o,_excluded),at=svgPropertiesNoEvents(st);return nt?reactExports.createElement(reactExports.Fragment,null,reactExports.createElement(ReportChartSize,{width:$,height:j}),reactExports.createElement(RootSurface,{otherAttributes:at,title:ot,desc:it},et)):reactExports.createElement(RechartsWrapper,{className:tt,style:rt,width:$,height:j,responsive:_e??!1,onClick:o.onClick,onMouseLeave:o.onMouseLeave,onMouseEnter:o.onMouseEnter,onMouseMove:o.onMouseMove,onMouseDown:o.onMouseDown,onMouseUp:o.onMouseUp,onContextMenu:o.onContextMenu,onDoubleClick:o.onDoubleClick,onTouchStart:o.onTouchStart,onTouchMove:o.onTouchMove,onTouchEnd:o.onTouchEnd},reactExports.createElement(RootSurface,{otherAttributes:at,title:ot,desc:it,ref:_},reactExports.createElement(ClipPathProvider,null,et)))});function _extends(){return _extends=Object.assign?Object.assign.bind():function(o){for(var _=1;_reactExports.createElement(CartesianChart,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:allowedTooltipTypes,tooltipPayloadSearcher:arrayTooltipSearcher,categoricalChartProps:o,ref:_}));function getEasGraphqlEndpoint$2(o){switch(o){case 8453:return"https://base.easscan.org/graphql";case 84532:return"https://base-sepolia.easscan.org/graphql";default:return"https://base-sepolia.easscan.org/graphql"}}const IDENTITY_SCHEMA_UID$2="0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af",CONTRIBUTION_SCHEMA_UID$1="0x7425c71616d2959f30296d8e013a8fd23320145b1dfda0718ab0a692087f8782";async function fetchStats(o){var ft,dt,pt,yt;const _=getEasGraphqlEndpoint$2(o),$=` - query GetIdentities($schemaId: String!) { - attestations( - where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } - orderBy: { time: asc } - ) { - id - time - decodedDataJson - } - } - `,j=` - query GetContributions($schemaId: String!) { - attestations( - where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } - orderBy: { time: asc } - ) { - id - time - decodedDataJson - } - } - `,[_e,et]=await Promise.all([fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:$,variables:{schemaId:IDENTITY_SCHEMA_UID$2}})}),fetch(_,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:j,variables:{schemaId:CONTRIBUTION_SCHEMA_UID$1}})})]);if(!_e.ok||!et.ok)throw new Error("EAS API error");const[tt,rt]=await Promise.all([_e.json(),et.json()]),nt=((ft=tt==null?void 0:tt.data)==null?void 0:ft.attestations)??[],ot=((dt=rt==null?void 0:rt.data)==null?void 0:dt.attestations)??[],it=new Map;for(const vt of nt){let wt="unknown";try{const Bt=JSON.parse(vt.decodedDataJson).find(At=>At.name==="username");(pt=Bt==null?void 0:Bt.value)!=null&&pt.value&&(wt=Bt.value.value)}catch{}const Ct=it.get(wt);(!Ct||vt.time>Ct.time)&&it.set(wt,{time:vt.time})}const st=new Set,at=[];for(const vt of ot){at.push(vt.time);try{const Ct=JSON.parse(vt.decodedDataJson).find(Pt=>Pt.name==="repo");(yt=Ct==null?void 0:Ct.value)!=null&&yt.value&&st.add(Ct.value.value)}catch{}}const lt=buildCumulativeChart(Array.from(it.values()).map(vt=>vt.time)),ct=buildCumulativeChart(at);return{totalIdentities:it.size,totalCommits:ot.length,totalRepos:st.size,identityChart:lt,commitsChart:ct}}function buildCumulativeChart(o){const _=[...o].sort((_e,et)=>_e-et),$=new Map;let j=0;for(const _e of _){const et=new Date(_e*1e3).toISOString().split("T")[0];j++,$.set(et,j)}return Array.from($.entries()).map(([_e,et])=>({date:new Date(_e).toLocaleDateString("en-US",{month:"short",day:"numeric"}),count:et}))}const StatBox=({icon:o,value:_,label:$,loading:j,error:_e,chartData:et,chartColor:tt="#00d4aa"})=>jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1,minWidth:140},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1.5},children:[o,jsxRuntimeExports.jsxs(Box,{children:[j?jsxRuntimeExports.jsx(Skeleton,{variant:"text",width:50,height:36}):_e?jsxRuntimeExports.jsx(Typography,{variant:"h5",sx:{color:"#ff6b6b"},children:"--"}):jsxRuntimeExports.jsx(Typography,{variant:"h5",sx:{color:"white",fontWeight:"bold"},children:_}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"rgba(255,255,255,0.7)"},children:$})]})]}),et&&et.length>1&&jsxRuntimeExports.jsx(Box,{sx:{height:50,width:"100%"},children:jsxRuntimeExports.jsx(ResponsiveContainer,{width:"100%",height:"100%",children:jsxRuntimeExports.jsxs(LineChart,{data:et,children:[jsxRuntimeExports.jsx(Line,{type:"monotone",dataKey:"count",stroke:tt,strokeWidth:2,dot:!1}),jsxRuntimeExports.jsx(Tooltip,{contentStyle:{background:"#1a1a2e",border:"1px solid rgba(255,255,255,0.2)",borderRadius:4,fontSize:12},labelStyle:{color:"rgba(255,255,255,0.7)"},itemStyle:{color:tt}})]})})})]}),StatsCard=()=>{const[o,_]=reactExports.useState({totalIdentities:0,totalCommits:0,totalRepos:0,identityChart:[],commitsChart:[],loading:!0,error:null}),$=appConfig();reactExports.useEffect(()=>{fetchStats($.CHAIN_ID).then(_e=>{_({..._e,loading:!1,error:null})}).catch(_e=>{console.error("Failed to fetch stats:",_e),_(et=>({...et,loading:!1,error:_e.message}))})},[$.CHAIN_ID]);const j=$.CHAIN_ID===84532;return jsxRuntimeExports.jsxs(Paper,{elevation:3,sx:{p:3,mb:4,background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)",border:"1px solid rgba(255,255,255,0.1)"},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1,mb:3},children:[jsxRuntimeExports.jsx(TrendingUp,{sx:{color:"#00d4aa"}}),jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{color:"white"},children:"Registry Stats"}),j&&jsxRuntimeExports.jsx(Chip,{label:"Testnet",size:"small",sx:{bgcolor:"rgba(255,193,7,0.2)",color:"#ffc107",fontSize:"0.7rem"}})]}),jsxRuntimeExports.jsxs(Grid,{container:!0,spacing:3,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,sm:4,children:jsxRuntimeExports.jsx(StatBox,{icon:jsxRuntimeExports.jsx(VerifiedUser,{sx:{color:"#00d4aa",fontSize:32}}),value:o.totalIdentities,label:"Verified Identities",loading:o.loading,error:!!o.error,chartData:o.identityChart,chartColor:"#00d4aa"})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,sm:4,children:jsxRuntimeExports.jsx(StatBox,{icon:jsxRuntimeExports.jsx(Code,{sx:{color:"#6c5ce7",fontSize:32}}),value:o.totalCommits,label:"Commits Attested",loading:o.loading,error:!!o.error,chartData:o.commitsChart,chartColor:"#6c5ce7"})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,sm:4,children:jsxRuntimeExports.jsx(StatBox,{icon:jsxRuntimeExports.jsx(FolderSpecial,{sx:{color:"#fdcb6e",fontSize:32}}),value:o.totalRepos,label:"Unique Repos",loading:o.loading,error:!!o.error})})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:2,mt:3,pt:2,borderTop:"1px solid rgba(255,255,255,0.1)"},children:[jsxRuntimeExports.jsx(GitHub,{sx:{color:"rgba(255,255,255,0.5)"}}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",component:"a",href:"https://github.com/cyberstorm-dev/didgit/tree/main/skills/didgit-onboarding",target:"_blank",rel:"noopener noreferrer",sx:{color:"#00d4aa",textDecoration:"none","&:hover":{textDecoration:"underline"}},children:"Agent Onboarding →"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"rgba(255,255,255,0.5)",display:"block"},children:"Register via CLI in 5 minutes"})]})]}),o.error&&jsxRuntimeExports.jsxs(Typography,{variant:"caption",sx:{color:"#ff6b6b",mt:2,display:"block"},children:["Could not load stats: ",o.error]})]})},AgentOnboardingCard=()=>jsxRuntimeExports.jsxs(Paper,{elevation:3,sx:{p:4,mb:4,background:"linear-gradient(135deg, #0d1117 0%, #161b22 100%)",border:"2px solid #00d4aa",borderRadius:2},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:2,mb:3},children:[jsxRuntimeExports.jsx(Terminal,{sx:{color:"#00d4aa",fontSize:32}}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"h5",sx:{color:"white",fontWeight:"bold"},children:"Agent Onboarding"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"rgba(255,255,255,0.7)"},children:"Register via CLI in 5 minutes — no dapp needed"})]}),jsxRuntimeExports.jsx(Chip,{label:"Recommended",size:"small",sx:{ml:"auto",bgcolor:"#00d4aa",color:"#000",fontWeight:"bold"}})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"grid",gridTemplateColumns:{xs:"1fr",md:"1fr 1fr"},gap:3,mb:3},children:[jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{color:"#00d4aa",mb:1.5,fontWeight:"bold"},children:"Why CLI?"}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",flexDirection:"column",gap:1},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Speed,{sx:{color:"#00d4aa",fontSize:18}}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"rgba(255,255,255,0.9)"},children:"Faster than the web UI"})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Code,{sx:{color:"#00d4aa",fontSize:18}}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"rgba(255,255,255,0.9)"},children:"Scriptable & automatable"})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(GitHub,{sx:{color:"#00d4aa",fontSize:18}}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"rgba(255,255,255,0.9)"},children:"Works with any wallet & GitHub token"})]})]})]}),jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",sx:{color:"#00d4aa",mb:1.5,fontWeight:"bold"},children:"Quick Start"}),jsxRuntimeExports.jsx(Box,{component:"pre",sx:{bgcolor:"#0d1117",border:"1px solid #30363d",borderRadius:1,p:1.5,fontSize:"0.75rem",color:"#e6edf3",overflow:"auto",fontFamily:"monospace"},children:`# 1. Sign message with your wallet -cast wallet sign "github.com:username" - -# 2. Create proof gist -curl -X POST api.github.com/gists ... - -# 3. Submit attestation -# See full guide →`})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:2,flexWrap:"wrap"},children:[jsxRuntimeExports.jsx(Button$1,{variant:"contained",href:"https://github.com/cyberstorm-dev/didgit/tree/main/skills/didgit-onboarding",target:"_blank",rel:"noopener noreferrer",sx:{bgcolor:"#00d4aa",color:"#000",fontWeight:"bold","&:hover":{bgcolor:"#00b894"}},startIcon:jsxRuntimeExports.jsx(Terminal,{}),children:"View Full Skill Guide"}),jsxRuntimeExports.jsx(Button$1,{variant:"outlined",href:"https://github.com/cyberstorm-dev/didgit/blob/main/docs/AGENT_ONBOARDING.md",target:"_blank",rel:"noopener noreferrer",sx:{borderColor:"rgba(255,255,255,0.3)",color:"rgba(255,255,255,0.9)","&:hover":{borderColor:"#00d4aa",color:"#00d4aa"}},children:"Human Guide"})]})]});function getEasGraphqlEndpoint$1(o){switch(o){case 8453:return"https://base.easscan.org/graphql";case 84532:return"https://base-sepolia.easscan.org/graphql";default:return"https://base-sepolia.easscan.org/graphql"}}function getEasScanUrl(o){switch(o){case 8453:return"https://base.easscan.org";case 84532:return"https://base-sepolia.easscan.org";default:return"https://base-sepolia.easscan.org"}}const IDENTITY_SCHEMA_UID$1="0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af";async function fetchIdentities(o,_,$){var at,lt,ct,ft;const j=getEasGraphqlEndpoint$1(o),et=await fetch(j,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:` - query GetIdentities($schemaId: String!, $skip: Int!, $take: Int!) { - attestations( - where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } - orderBy: { time: desc } - skip: $skip - take: $take - ) { - id - recipient - attester - time - txid - decodedDataJson - } - aggregateAttestation(where: { schemaId: { equals: $schemaId }, revoked: { equals: false } }) { - _count { - _all - } - } - } - `,variables:{schemaId:IDENTITY_SCHEMA_UID$1,skip:_,take:$}})});if(!et.ok)throw new Error(`EAS API error: ${et.status}`);const tt=await et.json(),rt=((at=tt==null?void 0:tt.data)==null?void 0:at.attestations)??[],nt=((ft=(ct=(lt=tt==null?void 0:tt.data)==null?void 0:lt.aggregateAttestation)==null?void 0:ct._count)==null?void 0:ft._all)??0,ot=rt.map(dt=>{var yt;let pt="unknown";try{const wt=JSON.parse(dt.decodedDataJson).find(Ct=>Ct.name==="username");(yt=wt==null?void 0:wt.value)!=null&&yt.value&&(pt=wt.value.value)}catch{}return{id:dt.id,username:pt,wallet:dt.recipient,attestedAt:new Date(dt.time*1e3).toISOString(),txHash:dt.txid}}),it=new Map;for(const dt of ot){const pt=it.get(dt.username);(!pt||new Date(dt.attestedAt)>new Date(pt.attestedAt))&&it.set(dt.username,dt)}return{identities:Array.from(it.values()),total:nt}}function truncateAddress(o){return!o||o.length<10?o:`${o.slice(0,6)}...${o.slice(-4)}`}function formatDate(o){return new Date(o).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}const RegistryBrowser=()=>{const[o,_]=reactExports.useState({identities:[],total:0,loading:!0,error:null}),[$,j]=reactExports.useState(0),[_e,et]=reactExports.useState(10),[tt,rt]=reactExports.useState(null),nt=appConfig(),ot=getEasScanUrl(nt.CHAIN_ID);reactExports.useEffect(()=>{_(lt=>({...lt,loading:!0,error:null})),fetchIdentities(nt.CHAIN_ID,$*_e,_e).then(({identities:lt,total:ct})=>{_({identities:lt,total:ct,loading:!1,error:null})}).catch(lt=>{console.error("Failed to fetch identities:",lt),_(ct=>({...ct,loading:!1,error:lt.message}))})},[nt.CHAIN_ID,$,_e]);const it=(lt,ct)=>{j(ct)},st=lt=>{et(parseInt(lt.target.value,10)),j(0)},at=(lt,ct)=>{navigator.clipboard.writeText(lt),rt(ct),setTimeout(()=>rt(null),2e3)};return jsxRuntimeExports.jsxs(Paper,{elevation:2,sx:{p:3,mb:4},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",mb:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"šŸ“‹ Identity Registry"}),jsxRuntimeExports.jsx(Chip,{label:`${o.identities.length} verified`,size:"small",color:"success",variant:"outlined"})]}),o.error&&jsxRuntimeExports.jsxs(Typography,{color:"error",sx:{mb:2},children:["Failed to load registry: ",o.error]}),jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsxs(Table,{size:"small",children:[jsxRuntimeExports.jsx(TableHead,{children:jsxRuntimeExports.jsxs(TableRow,{children:[jsxRuntimeExports.jsx(TableCell,{children:"GitHub"}),jsxRuntimeExports.jsx(TableCell,{children:"Wallet"}),jsxRuntimeExports.jsx(TableCell,{children:"Attested"}),jsxRuntimeExports.jsx(TableCell,{align:"right",children:"Links"})]})}),jsxRuntimeExports.jsx(TableBody,{children:o.loading?[...Array(5)].map((lt,ct)=>jsxRuntimeExports.jsxs(TableRow,{children:[jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Skeleton,{width:100})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Skeleton,{width:120})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Skeleton,{width:80})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Skeleton,{width:60})})]},ct)):o.identities.length===0?jsxRuntimeExports.jsx(TableRow,{children:jsxRuntimeExports.jsx(TableCell,{colSpan:4,align:"center",children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"No identities found"})})}):o.identities.map(lt=>jsxRuntimeExports.jsxs(TableRow,{hover:!0,children:[jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(GitHub,{sx:{fontSize:16,color:"text.secondary"}}),jsxRuntimeExports.jsx(Link,{href:`https://github.com/${lt.username}`,target:"_blank",rel:"noopener noreferrer",sx:{textDecoration:"none"},children:lt.username})]})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:.5},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{fontFamily:"monospace"},children:truncateAddress(lt.wallet)}),jsxRuntimeExports.jsx(Tooltip$1,{title:tt===lt.id?"Copied!":"Copy address",children:jsxRuntimeExports.jsx(IconButton,{size:"small",onClick:()=>at(lt.wallet,lt.id),children:jsxRuntimeExports.jsx(ContentCopy,{sx:{fontSize:14}})})})]})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:formatDate(lt.attestedAt)})}),jsxRuntimeExports.jsx(TableCell,{align:"right",children:jsxRuntimeExports.jsx(Tooltip$1,{title:"View on EAS",children:jsxRuntimeExports.jsx(IconButton,{size:"small",href:`${ot}/attestation/view/${lt.id}`,target:"_blank",rel:"noopener noreferrer",children:jsxRuntimeExports.jsx(OpenInNew,{sx:{fontSize:16}})})})})]},lt.id))})]})}),jsxRuntimeExports.jsx(TablePagination,{component:"div",count:o.total,page:$,onPageChange:it,rowsPerPage:_e,onRowsPerPageChange:st,rowsPerPageOptions:[5,10,25]})]})},VERIFIER_ADDRESS="0x0CA6A71045C26087F8dCe6d3F93437f31B81C138";function EnableDelegatedAttestations(){const{smartAddress:o,connected:_,balanceWei:$}=useWallet(),[j,_e]=reactExports.useState(0),[et,tt]=reactExports.useState(!1),[rt,nt]=reactExports.useState(!1),[ot,it]=reactExports.useState(null),[st,at]=reactExports.useState(null),[lt,ct]=reactExports.useState(null),ft=appConfig(),dt=$?$>0n:!1,pt=_&&o&&dt;reactExports.useEffect(()=>{_e(rt?3:dt?2:_&&o?1:0)},[_,o,dt,rt]);const vt=[{label:"Connect Wallet",description:"Connect your smart wallet to continue",completed:_&&!!o,action:null},{label:"Fund Wallet",description:"Your wallet needs ETH to pay gas (~$0.01 per attestation)",completed:dt,action:null},{label:"Enable Permission",description:"Grant the verifier permission to create attestations on your behalf",completed:rt,action:async()=>{if(!o){it("Smart wallet not initialized");return}tt(!0),it(null);try{console.log("[permission] User consented to permission for verifier:",VERIFIER_ADDRESS),console.log("[permission] User kernel address:",o),ct("0x0f78222c"),nt(!0),_e(3)}catch(wt){console.error("[permission] Error:",wt),it(wt.message||"Failed to enable permission")}finally{tt(!1)}}},{label:"Ready",description:"Your wallet is configured for automated commit attestations",completed:rt,action:null}];return jsxRuntimeExports.jsxs(Paper,{elevation:2,sx:{p:3,mb:3},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,mb:3,children:[jsxRuntimeExports.jsx(Security,{color:"primary"}),jsxRuntimeExports.jsx(Typography,{variant:"h6",children:"Enable Automated Attestations"})]}),jsxRuntimeExports.jsxs(Alert$1,{severity:"info",sx:{mb:3},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",gutterBottom:!0,children:jsxRuntimeExports.jsx("strong",{children:"How it works:"})}),jsxRuntimeExports.jsx(Typography,{variant:"body2",component:"div",children:jsxRuntimeExports.jsxs("ul",{style:{margin:0,paddingLeft:"1.5em"},children:[jsxRuntimeExports.jsxs("li",{children:["You grant a ",jsxRuntimeExports.jsx("strong",{children:"scoped permission"})," to our verifier service"]}),jsxRuntimeExports.jsxs("li",{children:["The permission only allows calling ",jsxRuntimeExports.jsx("code",{children:"EAS.attest()"})]}),jsxRuntimeExports.jsx("li",{children:"Your smart wallet pays gas, but you don't sign each attestation"}),jsxRuntimeExports.jsxs("li",{children:[jsxRuntimeExports.jsx("strong",{children:"Your wallet is the attester"})," — not a third party"]})]})})]}),jsxRuntimeExports.jsx(Stepper,{activeStep:j,orientation:"vertical",children:vt.map((wt,Ct)=>jsxRuntimeExports.jsxs(Step$1,{completed:wt.completed,children:[jsxRuntimeExports.jsx(StepLabel,{optional:wt.completed?jsxRuntimeExports.jsx(Chip,{icon:jsxRuntimeExports.jsx(CheckCircle,{}),label:"Complete",color:"success",size:"small"}):null,children:wt.label}),jsxRuntimeExports.jsxs(StepContent,{children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:2},children:wt.description}),wt.action&&!wt.completed&&jsxRuntimeExports.jsx(Button$1,{variant:"contained",onClick:wt.action,disabled:et||!pt,startIcon:et?jsxRuntimeExports.jsx(CircularProgress,{size:20}):jsxRuntimeExports.jsx(Security,{}),children:et?"Enabling...":"Enable Permission"}),Ct===0&&!_&&jsxRuntimeExports.jsx(Alert$1,{severity:"info",sx:{mt:2},children:'Use the "Connect Wallet" button in the top-right corner'}),Ct===1&&!dt&&o&&jsxRuntimeExports.jsxs(Alert$1,{severity:"warning",sx:{mt:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"body2",gutterBottom:!0,children:"Send ETH to your smart wallet:"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",fontFamily:"monospace",sx:{wordBreak:"break-all"},children:o}),ft.CHAIN_ID===84532&&jsxRuntimeExports.jsx(Button$1,{size:"small",sx:{mt:1},href:`https://www.coinbase.com/faucets/base-sepolia-faucet?address=${o}`,target:"_blank",rel:"noopener noreferrer",children:"Get Test ETH"})]})]})]},wt.label))}),ot&&jsxRuntimeExports.jsx(Alert$1,{severity:"error",sx:{mt:2},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",children:ot})}),st&&jsxRuntimeExports.jsx(Alert$1,{severity:"success",sx:{mt:2},children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",children:["Transaction submitted!"," ",jsxRuntimeExports.jsx(Link,{href:`https://${ft.CHAIN_ID===8453?"":"sepolia."}basescan.org/tx/${st}`,target:"_blank",rel:"noopener noreferrer",children:"View on Basescan"})]})}),rt&&jsxRuntimeExports.jsxs(Alert$1,{severity:"success",sx:{mt:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"āœ… Automated Attestations Enabled!"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:"The didgit verifier will automatically attest your commits. Gas will be deducted from your smart wallet balance."})]}),jsxRuntimeExports.jsxs(Box,{sx:{mt:3,p:2,bgcolor:"background.default",borderRadius:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",gutterBottom:!0,children:jsxRuntimeExports.jsx("strong",{children:"Technical Details:"})}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",display:"block",children:["Verifier: ",jsxRuntimeExports.jsx("code",{children:VERIFIER_ADDRESS})]}),jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",display:"block",children:["Permission Scope: ",jsxRuntimeExports.jsx("code",{children:"EAS.attest()"})," only"]}),lt&&jsxRuntimeExports.jsxs(Typography,{variant:"caption",color:"text.secondary",display:"block",children:["Permission ID: ",jsxRuntimeExports.jsx("code",{children:lt})]}),jsxRuntimeExports.jsx(Typography,{variant:"caption",color:"text.secondary",display:"block",children:"Protocol: ZeroDev Kernel v3.1 + Permission Plugin"})]})]})}function getEasGraphqlEndpoint(o){switch(o){case 8453:return"https://base.easscan.org/graphql";case 84532:return"https://base-sepolia.easscan.org/graphql";default:return"https://base-sepolia.easscan.org/graphql"}}const CONTRIBUTION_SCHEMA_UID="0x7425c71616d2959f30296d8e013a8fd23320145b1dfda0718ab0a692087f8782",IDENTITY_SCHEMA_UID="0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af";async function fetchLeaderboards(o,_){var dt,pt,yt,vt,wt,Ct,Pt,Bt;const $=getEasGraphqlEndpoint(o),j=` - query GetContributions($schemaId: String!) { - attestations( - where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } - ) { - id - time - recipient - decodedDataJson - } - } - `,_e=` - query GetIdentities($schemaId: String!) { - attestations( - where: { schemaId: { equals: $schemaId }, revoked: { equals: false } } - ) { - recipient - decodedDataJson - } - } - `,[et,tt]=await Promise.all([fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:j,variables:{schemaId:CONTRIBUTION_SCHEMA_UID}})}),fetch($,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:_e,variables:{schemaId:IDENTITY_SCHEMA_UID}})})]);if(!et.ok||!tt.ok)throw new Error("EAS API error");const[rt,nt]=await Promise.all([et.json(),tt.json()]),ot=((dt=rt==null?void 0:rt.data)==null?void 0:dt.attestations)??[],it=((pt=nt==null?void 0:nt.data)==null?void 0:pt.attestations)??[],st=new Map;for(const At of it)try{const Ot=(vt=(yt=JSON.parse(At.decodedDataJson).find(Tt=>Tt.name==="username"))==null?void 0:yt.value)==null?void 0:vt.value;Ot&&At.recipient&&st.set(At.recipient.toLowerCase(),Ot)}catch{}const at=new Map,lt=new Map;for(const At of ot)try{const kt=JSON.parse(At.decodedDataJson),Ot=kt.find(bt=>bt.name==="repo");if((wt=Ot==null?void 0:Ot.value)!=null&&wt.value){const bt=Ot.value.value;at.set(bt,(at.get(bt)||0)+1)}const Tt=(Ct=At.recipient)==null?void 0:Ct.toLowerCase(),ht=st.get(Tt)||((Bt=(Pt=kt.find(bt=>bt.name==="author"))==null?void 0:Pt.value)==null?void 0:Bt.value)||"unknown";lt.set(ht,(lt.get(ht)||0)+1)}catch{}const ct=Array.from(at.entries()).sort((At,kt)=>kt[1]-At[1]).slice(0,10).map(([At,kt],Ot)=>({rank:Ot+1,name:At,count:kt})),ft=Array.from(lt.entries()).sort((At,kt)=>kt[1]-At[1]).slice(0,10).map(([At,kt],Ot)=>({rank:Ot+1,name:At,count:kt}));return{topRepos:ct,topAccounts:ft}}const RankBadge=({rank:o})=>{const $={1:"#FFD700",2:"#C0C0C0",3:"#CD7F32"}[o]||"rgba(255,255,255,0.3)";return jsxRuntimeExports.jsx(Box,{sx:{width:28,height:28,borderRadius:"50%",display:"flex",alignItems:"center",justifyContent:"center",bgcolor:o<=3?`${$}22`:"transparent",border:`2px solid ${$}`,fontWeight:"bold",fontSize:12,color:$},children:o})},LeaderboardTable=({data:o,loading:_,icon:$,nameLabel:j})=>_?jsxRuntimeExports.jsx(Box,{sx:{p:2},children:[1,2,3,4,5].map(_e=>jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",height:40,sx:{mb:1,borderRadius:1}},_e))}):o.length===0?jsxRuntimeExports.jsx(Box,{sx:{p:4,textAlign:"center"},children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"rgba(255,255,255,0.5)"},children:"No data yet"})}):jsxRuntimeExports.jsx(TableContainer,{children:jsxRuntimeExports.jsxs(Table,{size:"small",children:[jsxRuntimeExports.jsx(TableHead,{children:jsxRuntimeExports.jsxs(TableRow,{children:[jsxRuntimeExports.jsx(TableCell,{sx:{color:"rgba(255,255,255,0.5)",borderColor:"rgba(255,255,255,0.1)",width:50},children:"Rank"}),jsxRuntimeExports.jsx(TableCell,{sx:{color:"rgba(255,255,255,0.5)",borderColor:"rgba(255,255,255,0.1)"},children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[$,j]})}),jsxRuntimeExports.jsx(TableCell,{align:"right",sx:{color:"rgba(255,255,255,0.5)",borderColor:"rgba(255,255,255,0.1)",width:80},children:"Commits"})]})}),jsxRuntimeExports.jsx(TableBody,{children:o.map(_e=>jsxRuntimeExports.jsxs(TableRow,{sx:{"&:hover":{bgcolor:"rgba(255,255,255,0.05)"},"& td":{borderColor:"rgba(255,255,255,0.05)"}},children:[jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(RankBadge,{rank:_e.rank})}),jsxRuntimeExports.jsx(TableCell,{children:jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{color:"white",fontFamily:"monospace",fontSize:"0.85rem"},children:_e.name})}),jsxRuntimeExports.jsx(TableCell,{align:"right",children:jsxRuntimeExports.jsx(Chip,{label:_e.count,size:"small",sx:{bgcolor:"rgba(0,212,170,0.2)",color:"#00d4aa",fontWeight:"bold"}})})]},_e.name))})]})}),Leaderboards=()=>{const[o,_]=reactExports.useState({topRepos:[],topAccounts:[],loading:!0,error:null}),[$,j]=reactExports.useState("all"),[_e,et]=reactExports.useState(0),tt=appConfig();return reactExports.useEffect(()=>{_(rt=>({...rt,loading:!0})),fetchLeaderboards(tt.CHAIN_ID).then(rt=>{_({...rt,loading:!1,error:null})}).catch(rt=>{console.error("Failed to fetch leaderboards:",rt),_(nt=>({...nt,loading:!1,error:rt.message}))})},[tt.CHAIN_ID,$]),jsxRuntimeExports.jsxs(Paper,{elevation:2,sx:{mb:3,background:"linear-gradient(135deg, #1a1a2e 0%, #16213e 100%)",border:"1px solid rgba(255,255,255,0.1)",overflow:"hidden"},children:[jsxRuntimeExports.jsx(Box,{sx:{p:2,borderBottom:"1px solid rgba(255,255,255,0.1)"},children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:2},children:[jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(EmojiEvents,{sx:{color:"#FFD700"}}),jsxRuntimeExports.jsx(Typography,{variant:"h6",sx:{color:"white"},children:"Leaderboards"})]}),jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",gap:1},children:[jsxRuntimeExports.jsx(Chip,{label:"All Time",size:"small",onClick:()=>j("all"),sx:{bgcolor:$==="all"?"rgba(0,212,170,0.3)":"rgba(255,255,255,0.1)",color:$==="all"?"#00d4aa":"rgba(255,255,255,0.5)",cursor:"pointer","&:hover":{bgcolor:"rgba(0,212,170,0.2)"}}}),jsxRuntimeExports.jsx(Chip,{label:"This Week",size:"small",disabled:!0,sx:{bgcolor:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.3)",cursor:"not-allowed"}}),jsxRuntimeExports.jsx(Chip,{label:"This Month",size:"small",disabled:!0,sx:{bgcolor:"rgba(255,255,255,0.05)",color:"rgba(255,255,255,0.3)",cursor:"not-allowed"}})]})]})}),jsxRuntimeExports.jsxs(Tabs,{value:_e,onChange:(rt,nt)=>et(nt),sx:{borderBottom:"1px solid rgba(255,255,255,0.1)","& .MuiTab-root":{color:"rgba(255,255,255,0.5)","&.Mui-selected":{color:"#00d4aa"}},"& .MuiTabs-indicator":{bgcolor:"#00d4aa"}},children:[jsxRuntimeExports.jsx(Tab,{icon:jsxRuntimeExports.jsx(FolderSpecial,{sx:{fontSize:18}}),iconPosition:"start",label:"Top Repos",sx:{minHeight:48}}),jsxRuntimeExports.jsx(Tab,{icon:jsxRuntimeExports.jsx(Person,{sx:{fontSize:18}}),iconPosition:"start",label:"Top Contributors",sx:{minHeight:48}})]}),jsxRuntimeExports.jsxs(Box,{sx:{minHeight:300},children:[_e===0&&jsxRuntimeExports.jsx(LeaderboardTable,{data:o.topRepos,loading:o.loading,icon:jsxRuntimeExports.jsx(FolderSpecial,{sx:{fontSize:16,color:"rgba(255,255,255,0.5)"}}),nameLabel:"Repository"}),_e===1&&jsxRuntimeExports.jsx(LeaderboardTable,{data:o.topAccounts,loading:o.loading,icon:jsxRuntimeExports.jsx(Person,{sx:{fontSize:16,color:"rgba(255,255,255,0.5)"}}),nameLabel:"Contributor"})]}),o.error&&jsxRuntimeExports.jsx(Box,{sx:{p:2,borderTop:"1px solid rgba(255,255,255,0.1)"},children:jsxRuntimeExports.jsxs(Typography,{variant:"caption",sx:{color:"#ff6b6b"},children:["Error loading leaderboards: ",o.error]})})]})},RegisterPage=()=>{const{connected:o}=useWallet();return jsxRuntimeExports.jsxs(Container,{maxWidth:"lg",sx:{py:4},children:[jsxRuntimeExports.jsx(StatsCard,{}),jsxRuntimeExports.jsx(Leaderboards,{}),jsxRuntimeExports.jsx(AgentOnboardingCard,{}),jsxRuntimeExports.jsx(RegistryBrowser,{}),jsxRuntimeExports.jsx(EnableDelegatedAttestations,{}),jsxRuntimeExports.jsxs(Accordion,{elevation:1,sx:{mb:2},children:[jsxRuntimeExports.jsx(AccordionSummary,{expandIcon:jsxRuntimeExports.jsx(ExpandMore,{}),children:jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",sx:{fontWeight:"medium"},children:"šŸ” Verify an Identity"})}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsx(VerifyPanel,{})})]}),jsxRuntimeExports.jsxs(Accordion,{elevation:1,sx:{mb:2},children:[jsxRuntimeExports.jsx(AccordionSummary,{expandIcon:jsxRuntimeExports.jsx(ExpandMore,{}),children:jsxRuntimeExports.jsxs(Box,{sx:{display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle1",sx:{fontWeight:"medium"},children:"šŸ”§ Manual Registration (Web UI)"}),jsxRuntimeExports.jsx(Typography,{variant:"caption",sx:{color:"text.secondary"},children:"— Higher friction, use CLI if possible"})]})}),jsxRuntimeExports.jsxs(AccordionDetails,{children:[jsxRuntimeExports.jsx(Alert$1,{severity:"info",sx:{mb:3},children:jsxRuntimeExports.jsxs(Typography,{variant:"body2",children:["The web UI requires wallet connection and multiple signing steps. For a smoother experience, use the ",jsxRuntimeExports.jsx("strong",{children:"CLI-based agent onboarding"})," above."]})}),jsxRuntimeExports.jsxs(Grid,{container:!0,spacing:3,sx:{mb:3},children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,md:6,children:jsxRuntimeExports.jsx(Paper,{elevation:2,sx:{p:3,height:"100%"},children:jsxRuntimeExports.jsx(AAWalletStatus,{},o?"connected":"disconnected")})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,md:6,children:jsxRuntimeExports.jsx(Paper,{elevation:2,sx:{p:3,height:"100%"},children:jsxRuntimeExports.jsx(GithubSection,{})})})]}),jsxRuntimeExports.jsx(Paper,{elevation:2,sx:{p:3,mb:3},children:jsxRuntimeExports.jsx(AttestForm,{})}),jsxRuntimeExports.jsxs(Paper,{elevation:1,sx:{p:3},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,children:"How it Works (Web UI)"}),jsxRuntimeExports.jsxs(Box,{component:"ol",sx:{pl:2,"& li":{mb:1}},children:[jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"Connect your wallet using Web3Auth (Google, GitHub, or email)"}),jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"Connect your GitHub account for identity verification"}),jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"Fund your smart wallet to cover gas fees (~$0.01)"}),jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"Sign your GitHub username with your wallet"}),jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"Create a proof Gist and submit the attestation"})]})]})]})]}),jsxRuntimeExports.jsxs(Paper,{elevation:1,sx:{p:3,mt:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,children:"What is didgit.dev?"}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:{mb:2},children:["didgit.dev creates ",jsxRuntimeExports.jsx("strong",{children:"on-chain proof"})," linking your GitHub username to your wallet address. This verified identity can be used for:"]}),jsxRuntimeExports.jsxs(Box,{component:"ul",sx:{pl:2,"& li":{mb:.5}},children:[jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"šŸ† Building portable developer reputation"}),jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"šŸ’° Receiving bounties and payments to a verified address"}),jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"šŸ” Accessing gated services that verify identity"}),jsxRuntimeExports.jsx(Typography,{component:"li",variant:"body2",children:"šŸ¤– Agent identity — prove your agent controls both accounts"})]}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",sx:{mt:2,color:"text.secondary"},children:["Powered by ",jsxRuntimeExports.jsx("a",{href:"https://attest.sh",target:"_blank",rel:"noopener noreferrer",children:"EAS"})," on Base. Built by ",jsxRuntimeExports.jsx("a",{href:"https://cyberstorm.dev",target:"_blank",rel:"noopener noreferrer",children:"cyberstorm.dev"}),"."]})]})]})};function validateDomain(o){return o.length>0&&o.length<=100}function validateUsername(o){return o.length>0&&o.length<=39}function validateNamespace(o){return o.length>0&&o.length<=39}function validateRepoName(o){return o.length>0&&o.length<=100}objectType({domain:stringType().min(1).max(100),username:stringType().min(1).max(39),namespace:stringType().min(1).max(39),name:stringType().min(1).max(100),enabled:booleanType()});const RepoManagerMUI=({domain:o="github.com",username:_})=>{const{address:$,smartAddress:j,connected:_e,getWalletClient:et}=useWallet(),{user:tt}=useGithubAuth(),rt=reactExports.useMemo(()=>appConfig(),[]),[nt,ot]=reactExports.useState({namespace:"*",name:"*",enabled:!0}),[it,st]=reactExports.useState("set"),[at,lt]=reactExports.useState([]),[ct,ft]=reactExports.useState({}),[dt,pt]=reactExports.useState(!1),[yt,vt]=reactExports.useState(!1),[wt,Ct]=reactExports.useState(null),[Pt,Bt]=reactExports.useState(null),[At,kt]=reactExports.useState(null),[Ot,Tt]=reactExports.useState(!1),ht=rt.RESOLVER_ADDRESS,bt=!!ht,mt=_||(tt==null?void 0:tt.login)||"",gt=o;reactExports.useEffect(()=>{it==="list"&&!Ot&&_e&&ht&>&&mt&&(Tt(!0),_t()),it==="set"&&Tt(!1)},[it,_e,ht,gt,mt]);const xt=reactExports.useMemo(()=>createPublicClient({chain:baseSepolia,transport:http()}),[]),Et=()=>{const It={};if(gt){if(!validateDomain(gt))return Ct("Invalid domain format"),!1}else return Ct("Domain is required"),!1;if(mt){if(!validateUsername(mt))return Ct("Invalid username format"),!1}else return Ct("Username is required"),!1;return nt.namespace?validateNamespace(nt.namespace)||(It.namespace="Invalid namespace format"):It.namespace="Namespace is required",nt.name?validateRepoName(nt.name)||(It.name="Invalid repository name format"):It.name="Repository name is required",ft(It),Object.keys(It).length===0},_t=async()=>{if(!(!_e||!$||!ht||!gt||!mt))try{vt(!0),Ct(null);const It=await xt.readContract({address:ht,abi:UsernameUniqueResolverABI,functionName:"getRepositoryPatterns",args:[gt,mt]});lt(It)}catch(It){It.message.includes("NOT_OWNER")?Ct("You can only view patterns for identities you own"):Ct(It.message??"Failed to load patterns")}finally{vt(!1)}},$t=async()=>{if(Ct(null),kt(null),Bt(null),!!Et()){if(!_e||!$)return Ct("Connect wallet first");if(!ht)return Ct("Resolver address not configured");try{pt(!0);const It=await et();if(!It)throw new Error("No wallet client available");const Mt=await It.writeContract({address:ht,abi:UsernameUniqueResolverABI,functionName:"setRepositoryPattern",args:[gt,mt,nt.namespace,nt.name,nt.enabled],gas:BigInt(2e5)});Bt(Mt),await xt.waitForTransactionReceipt({hash:Mt}),kt(`Repository pattern ${nt.enabled?"enabled":"disabled"} successfully!`),Tt(!1),await _t()}catch(It){It.message.includes("NOT_OWNER")?Ct("You can only set patterns for identities you own"):It.message.includes("IDENTITY_NOT_FOUND")?Ct("Identity not found. Make sure you have an attestation for this domain/username combination"):Ct(It.message??"Failed to set repository pattern")}finally{pt(!1)}}},St=()=>{ot({namespace:"*",name:"*",enabled:!0}),ft({}),Ct(null),kt(null),Bt(null)},Rt=dt||yt;return jsxRuntimeExports.jsx(Container,{maxWidth:"lg",sx:{py:4},children:jsxRuntimeExports.jsxs(Paper,{elevation:2,sx:{overflow:"hidden"},children:[jsxRuntimeExports.jsxs(Box,{sx:{p:3,pb:0},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,mb:2,children:[jsxRuntimeExports.jsx(Settings,{color:"primary",fontSize:"large"}),jsxRuntimeExports.jsx(Typography,{variant:"h5",fontWeight:600,children:"Repository Pattern Management"})]}),jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",sx:{mb:3},children:["Configure repository patterns to control which repositories can be indexed for attestations. Use wildcards (*) to match multiple repositories.",jsxRuntimeExports.jsx(Tooltip$1,{title:"Learn about pattern syntax",arrow:!0,children:jsxRuntimeExports.jsx(IconButton,{size:"small",sx:{ml:1},children:jsxRuntimeExports.jsx(HelpOutline,{fontSize:"small"})})})]})]}),jsxRuntimeExports.jsx(Box,{sx:{borderBottom:1,borderColor:"divider"},children:jsxRuntimeExports.jsxs(Tabs,{value:it,onChange:(It,Mt)=>st(Mt),"aria-label":"pattern management tabs",sx:{px:3},children:[jsxRuntimeExports.jsx(Tab,{value:"set",label:"Set Pattern",icon:jsxRuntimeExports.jsx(Add,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:500}}),jsxRuntimeExports.jsx(Tab,{value:"list",label:jsxRuntimeExports.jsx(Badge,{badgeContent:at.length,color:"primary",showZero:!1,children:"View Patterns"}),icon:jsxRuntimeExports.jsx(List,{}),iconPosition:"start",sx:{textTransform:"none",fontWeight:500}})]})}),Rt&&jsxRuntimeExports.jsx(LinearProgress,{sx:{height:2}}),it==="set"&&jsxRuntimeExports.jsxs(Box,{sx:{p:3},children:[jsxRuntimeExports.jsxs(Grid,{container:!0,spacing:3,children:[jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,sm:6,children:jsxRuntimeExports.jsx(TextField,{fullWidth:!0,label:"Namespace (Owner)",placeholder:"octocat or *",value:nt.namespace,onChange:It=>ot({...nt,namespace:It.target.value}),error:!!ct.namespace,helperText:ct.namespace||"Repository owner/organization or * for wildcard",disabled:Rt,variant:"outlined"})}),jsxRuntimeExports.jsx(Grid,{item:!0,xs:12,sm:6,children:jsxRuntimeExports.jsx(TextField,{fullWidth:!0,label:"Repository Name",placeholder:"hello-world or *",value:nt.name,onChange:It=>ot({...nt,name:It.target.value}),error:!!ct.name,helperText:ct.name||"Repository name or * for wildcard",disabled:Rt,variant:"outlined"})})]}),jsxRuntimeExports.jsxs(Box,{sx:{mt:3,mb:3},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"Pattern Preview:"}),jsxRuntimeExports.jsxs(Paper,{variant:"outlined",sx:{p:2,bgcolor:"grey.50",fontFamily:"monospace",fontSize:"1rem",display:"flex",alignItems:"center",gap:1},children:[jsxRuntimeExports.jsx(Code,{fontSize:"small",color:"action"}),jsxRuntimeExports.jsxs(Box,{component:"span",sx:{color:nt.enabled?"success.main":"text.disabled"},children:[nt.namespace,"/",nt.name]}),jsxRuntimeExports.jsx(Chip,{label:nt.enabled?"Enabled":"Disabled",color:nt.enabled?"success":"default",size:"small"})]})]}),jsxRuntimeExports.jsx(FormControlLabel,{control:jsxRuntimeExports.jsx(Switch,{checked:nt.enabled,onChange:It=>ot({...nt,enabled:It.target.checked}),disabled:Rt,color:"primary"}),label:jsxRuntimeExports.jsx(Typography,{variant:"body1",color:nt.enabled?"text.primary":"text.secondary",children:nt.enabled?"Enable this pattern":"Disable this pattern"}),sx:{mb:3}}),jsxRuntimeExports.jsxs(Stack,{direction:"row",spacing:2,sx:{mb:3},children:[jsxRuntimeExports.jsx(Button$1,{variant:"contained",startIcon:dt?jsxRuntimeExports.jsx(CircularProgress,{size:20}):jsxRuntimeExports.jsx(Add,{}),onClick:$t,disabled:Rt||!bt||!_e,size:"large",sx:{flex:1},children:dt?nt.enabled?"Enabling Pattern...":"Disabling Pattern...":nt.enabled?"Enable Pattern":"Disable Pattern"}),jsxRuntimeExports.jsx(Button$1,{variant:"outlined",onClick:St,disabled:Rt,size:"large",children:"Reset"})]}),jsxRuntimeExports.jsx(Alert$1,{severity:"info",sx:{borderRadius:2},children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"Pattern Examples:"}),jsxRuntimeExports.jsxs(Box,{component:"ul",sx:{m:0,pl:2,"& li":{mb:.5}},children:[jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",children:[jsxRuntimeExports.jsx(Box,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"octocat/hello-world"})," ","- Specific repository"]}),jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",children:[jsxRuntimeExports.jsx(Box,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"octocat/*"})," ","- All repositories from octocat"]}),jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",children:[jsxRuntimeExports.jsx(Box,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"*/hello-world"})," ","- hello-world repository from any owner"]}),jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",children:[jsxRuntimeExports.jsx(Box,{component:"code",sx:{bgcolor:"grey.100",px:.5,borderRadius:.5},children:"*/*"})," ","- All repositories (use with caution)"]})]})]})})]}),it==="list"&&jsxRuntimeExports.jsxs(Box,{sx:{p:3},children:[jsxRuntimeExports.jsxs(Stack,{direction:"row",justifyContent:"space-between",alignItems:"center",sx:{mb:3},children:[jsxRuntimeExports.jsxs(Typography,{variant:"h6",children:["Current Patterns",at.length>0&&jsxRuntimeExports.jsx(Chip,{label:`${at.length} pattern${at.length!==1?"s":""}`,size:"small",sx:{ml:2}})]}),jsxRuntimeExports.jsx(Button$1,{variant:"outlined",startIcon:yt?jsxRuntimeExports.jsx(CircularProgress,{size:20}):jsxRuntimeExports.jsx(Refresh,{}),onClick:_t,disabled:yt||!bt||!_e,size:"small",children:yt?"Loading...":"Refresh"})]}),yt&&at.length===0&&jsxRuntimeExports.jsx(Stack,{spacing:2,children:[...Array(3)].map((It,Mt)=>jsxRuntimeExports.jsx(Skeleton,{variant:"rectangular",height:72,sx:{borderRadius:1}},Mt))}),at.length>0&&jsxRuntimeExports.jsx(Stack,{spacing:2,children:at.map((It,Mt)=>jsxRuntimeExports.jsx(Paper,{variant:"outlined",sx:{p:3,bgcolor:It.enabled?"success.light":"action.hover",borderColor:It.enabled?"success.main":"divider",borderWidth:It.enabled?2:1,transition:"all 0.2s ease-in-out","&:hover":{elevation:2,transform:"translateY(-1px)"}},children:jsxRuntimeExports.jsxs(Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,children:[jsxRuntimeExports.jsx(Code,{color:It.enabled?"success":"action"}),jsxRuntimeExports.jsxs(Typography,{variant:"h6",sx:{fontFamily:"monospace",color:It.enabled?"success.dark":"text.secondary",fontWeight:500},children:[It.namespace,"/",It.name]})]}),jsxRuntimeExports.jsx(Chip,{label:It.enabled?"Enabled":"Disabled",color:It.enabled?"success":"default",variant:It.enabled?"filled":"outlined"})]})},Mt))}),at.length===0&&!yt&>&&mt&&jsxRuntimeExports.jsxs(Box,{sx:{textAlign:"center",py:6},children:[jsxRuntimeExports.jsx(List,{sx:{fontSize:64,color:"text.disabled",mb:2}}),jsxRuntimeExports.jsx(Typography,{variant:"h6",color:"text.secondary",gutterBottom:!0,children:"No patterns configured"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",sx:{mb:3},children:"You haven't set up any repository patterns yet."}),jsxRuntimeExports.jsx(Button$1,{variant:"contained",startIcon:jsxRuntimeExports.jsx(Add,{}),onClick:()=>st("set"),children:"Create Your First Pattern"})]})]}),jsxRuntimeExports.jsxs(Box,{sx:{p:3,pt:0},children:[!bt&&jsxRuntimeExports.jsxs(Alert$1,{severity:"warning",sx:{mb:2,borderRadius:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"Configuration Required"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:"Resolver contract address is not configured. Add VITE_RESOLVER_ADDRESS to environment variables."})]}),wt&&jsxRuntimeExports.jsxs(Alert$1,{severity:"error",sx:{mb:2,borderRadius:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:wt.includes("IDENTITY_NOT_FOUND")?"Identity Not Found":wt.includes("NOT_OWNER")?"Permission Denied":"Operation Failed"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:wt.includes("IDENTITY_NOT_FOUND")?"Make sure you have registered this GitHub identity first in the attestation section above.":wt.includes("NOT_OWNER")?"You can only manage patterns for GitHub identities that you own.":wt})]}),At&&jsxRuntimeExports.jsxs(Alert$1,{severity:"success",sx:{mb:2,borderRadius:2},children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"Success!"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:At})]}),Pt&&jsxRuntimeExports.jsx(Alert$1,{severity:"info",sx:{mb:2,borderRadius:2},children:jsxRuntimeExports.jsxs(Box,{children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"Transaction Submitted"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",sx:{mb:1},children:"Your pattern update has been submitted to the blockchain."}),jsxRuntimeExports.jsx(Button$1,{variant:"text",size:"small",href:`https://sepolia.basescan.org/tx/${Pt}`,target:"_blank",rel:"noreferrer",sx:{p:0,textTransform:"none"},children:"View on BaseScan →"})]})})]})]})})},SettingsPage=()=>{const{connected:o,address:_}=useWallet(),{user:$}=useGithubAuth(),[j,_e]=reactExports.useState([]),[et,tt]=reactExports.useState(!1),rt=reactExports.useMemo(()=>appConfig(),[]),nt=async()=>{var it;if(!(!o||!_)){tt(!0);try{const dt=(((it=(await(await fetch("https://base-sepolia.easscan.org/graphql",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({query:`query ($schemaId: String!, $recipient: String!) { - attestations(take: 50, where: { - schemaId: { equals: $schemaId }, - recipient: { equals: $recipient } - }) { - id - recipient - decodedDataJson - } - }`,variables:{schemaId:rt.EAS_SCHEMA_UID,recipient:_}})})).json()).data)==null?void 0:it.attestations)??[]).map(pt=>{const yt=ot(pt.decodedDataJson);return yt!=null&&yt.github_username?{domain:"github.com",username:yt.github_username,attestationUid:pt.id,verified:!0}:null}).filter(Boolean);_e(dt)}catch(st){console.error("Failed to load identities:",st)}finally{tt(!1)}}};function ot(it){var st;if(!it)return null;try{const at=JSON.parse(it),lt=new Map;for(const ft of at)lt.set(ft.name,(st=ft.value)==null?void 0:st.value);const ct={github_username:String(lt.get("github_username")??""),wallet_address:String(lt.get("wallet_address")??""),github_proof_url:String(lt.get("github_proof_url")??""),wallet_signature:String(lt.get("wallet_signature")??"")};return!ct.github_username||!ct.wallet_address?null:ct}catch{return null}}return reactExports.useEffect(()=>{nt()},[o,_]),o?jsxRuntimeExports.jsxs(Container,{maxWidth:"lg",sx:{py:4},children:[jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,mb:4,children:[jsxRuntimeExports.jsx(Settings,{color:"primary",fontSize:"large"}),jsxRuntimeExports.jsx(Typography,{variant:"h4",fontWeight:600,children:"GitHub Identity Settings"})]}),jsxRuntimeExports.jsx(Typography,{variant:"body1",color:"text.secondary",sx:{mb:4},children:"Manage repository patterns for your verified GitHub identities. Configure which repositories should be indexed for attestations."}),et&&jsxRuntimeExports.jsxs(Box,{display:"flex",alignItems:"center",gap:2,sx:{mb:4},children:[jsxRuntimeExports.jsx(CircularProgress,{size:20}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:"Loading your GitHub identities..."})]}),!et&&o&&j.length===0&&jsxRuntimeExports.jsxs(Alert$1,{severity:"info",children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"No GitHub Identities Found"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:"You haven't registered any GitHub identities yet. Go to the Register page to create your first attestation."})]}),!et&&j.length>0&&jsxRuntimeExports.jsxs(Stack,{spacing:3,children:[jsxRuntimeExports.jsxs(Typography,{variant:"h6",children:["Your Registered Identities (",j.length,")"]}),j.map((it,st)=>jsxRuntimeExports.jsxs(Accordion,{elevation:2,children:[jsxRuntimeExports.jsxs(AccordionSummary,{expandIcon:jsxRuntimeExports.jsx(ExpandMore,{}),sx:{"& .MuiAccordionSummary-content":{alignItems:"center",gap:2}},children:[jsxRuntimeExports.jsx(GitHub,{color:"primary"}),jsxRuntimeExports.jsxs(Box,{sx:{flex:1},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",children:it.username}),jsxRuntimeExports.jsx(Typography,{variant:"body2",color:"text.secondary",children:it.domain})]}),jsxRuntimeExports.jsx(Chip,{label:it.verified?"Verified":"Pending",color:it.verified?"success":"warning",size:"small"})]}),jsxRuntimeExports.jsx(AccordionDetails,{children:jsxRuntimeExports.jsxs(Box,{sx:{pt:2},children:[jsxRuntimeExports.jsxs(Typography,{variant:"body2",color:"text.secondary",sx:{mb:3},children:["Configure repository patterns for ",it.username,"@",it.domain,". These patterns determine which repositories will be indexed for attestations."]}),jsxRuntimeExports.jsx(RepoManagerMUI,{domain:it.domain,username:it.username})]})})]},`${it.domain}-${it.username}`))]}),jsxRuntimeExports.jsxs(Paper,{elevation:1,sx:{p:3,mt:4,bgcolor:"info.light",color:"info.contrastText"},children:[jsxRuntimeExports.jsx(Typography,{variant:"h6",gutterBottom:!0,children:"Repository Pattern Information"}),jsxRuntimeExports.jsxs(Box,{component:"ul",sx:{m:0,pl:2},children:[jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",sx:{mb:1},children:[jsxRuntimeExports.jsx("strong",{children:"Default Pattern:"})," All new identities start with ",jsxRuntimeExports.jsx("code",{children:"*/*"})," (all repositories enabled)"]}),jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",sx:{mb:1},children:[jsxRuntimeExports.jsx("strong",{children:"Wildcard Support:"})," Use ",jsxRuntimeExports.jsx("code",{children:"*"})," to match any namespace or repository name"]}),jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",sx:{mb:1},children:[jsxRuntimeExports.jsx("strong",{children:"Specific Patterns:"})," Use exact names like ",jsxRuntimeExports.jsx("code",{children:"myorg/myrepo"})," for precise control"]}),jsxRuntimeExports.jsxs(Typography,{component:"li",variant:"body2",children:[jsxRuntimeExports.jsx("strong",{children:"Pattern Priority:"})," More specific patterns take precedence over wildcards"]})]})]})]}):jsxRuntimeExports.jsx(Container,{maxWidth:"lg",sx:{py:4},children:jsxRuntimeExports.jsxs(Alert$1,{severity:"info",children:[jsxRuntimeExports.jsx(Typography,{variant:"subtitle2",gutterBottom:!0,children:"Connect Your Wallet"}),jsxRuntimeExports.jsx(Typography,{variant:"body2",children:"Please connect your wallet using the button in the top-right corner to manage your GitHub identity settings."})]})})},AppMUI=()=>{const[o,_]=reactExports.useState("register"),$=j=>{_(j)};return jsxRuntimeExports.jsxs(Box,{sx:{minHeight:"100vh",bgcolor:"background.default"},children:[jsxRuntimeExports.jsx(Navigation,{currentPage:o,onPageChange:$}),jsxRuntimeExports.jsxs(Box,{sx:{flex:1},children:[o==="register"&&jsxRuntimeExports.jsx(RegisterPage,{}),o==="settings"&&jsxRuntimeExports.jsx(SettingsPage,{})]})]})},theme=createTheme({palette:{primary:{main:blue[600],light:blue[400],dark:blue[800]},secondary:{main:grey[600],light:grey[400],dark:grey[800]},success:{main:green[600],light:green[100]},error:{main:red[600]},warning:{main:orange[600]},background:{default:"#f5f5f5",paper:"#ffffff"},text:{primary:grey[900],secondary:grey[600]}},typography:{fontFamily:'"Inter", "Roboto", "Helvetica", "Arial", sans-serif',h6:{fontWeight:600},body2:{fontSize:"0.875rem"}},shape:{borderRadius:8},components:{MuiButton:{styleOverrides:{root:{textTransform:"none",fontWeight:500},contained:{boxShadow:"none","&:hover":{boxShadow:"0 2px 4px rgba(0,0,0,0.1)"}}}},MuiCard:{styleOverrides:{root:{boxShadow:"0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24)"}}},MuiAlert:{styleOverrides:{root:{borderRadius:8}}}}}),ThemeProvider=({children:o})=>jsxRuntimeExports.jsxs(ThemeProvider$1,{theme,children:[jsxRuntimeExports.jsx(CssBaseline,{}),o]}),el=document.getElementById("root");if(!el)throw new Error("Root element not found");createRoot(el).render(jsxRuntimeExports.jsx(ThemeProvider,{children:jsxRuntimeExports.jsx(Web3AuthProvider,{children:jsxRuntimeExports.jsx(WalletProvider,{children:jsxRuntimeExports.jsx(GithubAuthProvider,{children:jsxRuntimeExports.jsx(AppMUI,{})})})})}));export{hashMessage$1 as $,version as A,AbiEncodingLengthMismatchError as B,concatHex as C,isAddress as D,pad$3 as E,stringToHex as F,boolToHex as G,integerRegex$1 as H,InvalidAddressError$1 as I,numberToHex as J,bytesRegex$1 as K,BytesSizeMismatchError$1 as L,MessagePrefix as M,arrayRegex$1 as N,getChainId as O,signMessage$1 as P,zeroAddress as Q,isAddressEqual as R,SHA2 as S,getAction as T,UnsupportedPackedAbiType as U,encodeFunctionData as V,toHex$1 as W,getTypesForEIP712Domain as X,validateTypedData as Y,ZeroHash as Z,hashTypedData as _,assertArgument as a,getUrl as a$,getCode as a0,signAuthorization as a1,verifyAuthorization as a2,toBytes$5 as a3,concat$2 as a4,toFunctionSelector as a5,getAbiItem as a6,encodeAbiParameters as a7,parseAbiParameters as a8,decodeFunctionData as a9,decodeErrorResult as aA,ContractFunctionZeroDataError as aB,ContractFunctionRevertedError as aC,ContractFunctionExecutionError as aD,AccountNotFoundError as aE,estimateFeesPerGas as aF,prepareAuthorization as aG,parseAccount as aH,serializeStateOverride as aI,formatLog as aJ,formatTransactionReceipt as aK,stringify$5 as aL,observe as aM,poll as aN,RpcRequestError as aO,InvalidInputRpcError as aP,UnknownRpcError as aQ,RawContractError as aR,serializeSignature as aS,erc20Abi as aT,createWalletClient as aU,custom as aV,signTypedData as aW,decodeFunctionResult as aX,publicActions as aY,maxUint192 as aZ,domainSeparator as a_,readContract as aa,parseAbi as ab,encodeDeployData as ac,keccak256$4 as ad,createClient as ae,eventsExports as af,hexToBigInt as ag,simulateContract as ah,createContractEventFilter as ai,getContractEvents as aj,watchContractEvent as ak,writeContract as al,estimateContractGas as am,getAddress as an,slice$4 as ao,getStorageAt as ap,isHex as aq,maxUint16 as ar,LruMap$1 as as,hexToBytes$4 as at,secp256k1$3 as au,process$1$1 as av,size$3 as aw,BaseError$1 as ax,prettyPrint as ay,formatGwei as az,assert as b,localBatchGatewayUrl as b0,localBatchGatewayRequest as b1,call as b2,HttpRequestError as b3,Signature as c,getBigInt as d,SigningKey as e,getNumber as f,getBytes as g,hexlify as h,isHexString as i,isBytesLike as j,keccak256 as k,concat as l,assertPrivate as m,dataLength as n,defineProperties as o,getBytesCopy as p,getUint as q,hashMessage as r,sha256 as s,toBeArray as t,u64 as u,makeError as v,wrapConstructor as w,toBeHex as x,toUtf8Bytes as y,zeroPadValue as z}; diff --git a/public/assets/index-SdYwD8P5.js b/public/assets/index-SdYwD8P5.js deleted file mode 100644 index 757ea0e..0000000 --- a/public/assets/index-SdYwD8P5.js +++ /dev/null @@ -1 +0,0 @@ -var Te=t=>{throw TypeError(t)};var we=(t,e,s)=>e.has(t)||Te("Cannot "+s);var m=(t,e,s)=>(we(t,e,"read from private field"),s?s.call(t):e.get(t)),P=(t,e,s)=>e.has(t)?Te("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,s),l=(t,e,s,n)=>(we(t,e,"write to private field"),n?n.call(t,s):e.set(t,s),s),ge=(t,e,s)=>(we(t,e,"access private method"),s);import{g as A,a as o,b as E,h as g,w as Ye,S as et,u as c,s as tt,k as Pe,i as xe,c as j,d as G,e as Ce,f as Ee,j as st,t as B,l as R,z as oe}from"./index-CGdEoSbI.js";import{M as Ot,Z as Dt,m as Rt,n as jt,o as Wt,p as Zt,q as Mt,r as Jt,v as qt,x as Xt,y as Qt,A as Yt}from"./index-CGdEoSbI.js";function nt(t){let e=t.toString(16);for(;e.length<2;)e="0"+e;return"0x"+e}function _e(t,e,s){let n=0;for(let i=0;i{E(n<=t.length,"data short segment too short","BUFFER_OVERRUN",{buffer:t,length:t.length,offset:n})};if(t[e]>=248){const n=t[e]-247;s(e+1+n);const i=_e(t,e+1,n);return s(e+1+n+i),Ne(t,e,e+1+n,n+i)}else if(t[e]>=192){const n=t[e]-192;return s(e+1+n),Ne(t,e,e+1,n)}else if(t[e]>=184){const n=t[e]-183;s(e+1+n);const i=_e(t,e+1,n);s(e+1+n+i);const r=g(t.slice(e+1+n,e+1+n+i));return{consumed:1+n+i,result:r}}else if(t[e]>=128){const n=t[e]-128;s(e+1+n);const i=g(t.slice(e+1,e+1+n));return{consumed:1+n,result:i}}return{consumed:1,result:nt(t[e])}}function fe(t){const e=A(t,"data"),s=We(e,0);return o(s.consumed===e.length,"unexpected junk after rlp payload","data",t),s.result}function Ue(t){const e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function Ze(t){if(Array.isArray(t)){let n=[];if(t.forEach(function(r){n=n.concat(Ze(r))}),n.length<=55)return n.unshift(192+n.length),n;const i=Ue(n.length);return i.unshift(247+i.length),i.concat(n)}const e=Array.prototype.slice.call(A(t,"object"));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;const s=Ue(e.length);return s.unshift(183+s.length),s.concat(e)}const $e="0123456789abcdef";function O(t){let e="0x";for(const s of Ze(t))e+=$e[s>>4],e+=$e[s&15];return e}const[it,rt]=c.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map(t=>BigInt(t))),N=new Uint32Array(80),U=new Uint32Array(80);class at extends et{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:s,Bh:n,Bl:i,Ch:r,Cl:a,Dh:u,Dl:d,Eh:f,El:F,Fh:y,Fl:L,Gh:v,Gl:w,Hh:S,Hl:H}=this;return[e,s,n,i,r,a,u,d,f,F,y,L,v,w,S,H]}set(e,s,n,i,r,a,u,d,f,F,y,L,v,w,S,H){this.Ah=e|0,this.Al=s|0,this.Bh=n|0,this.Bl=i|0,this.Ch=r|0,this.Cl=a|0,this.Dh=u|0,this.Dl=d|0,this.Eh=f|0,this.El=F|0,this.Fh=y|0,this.Fl=L|0,this.Gh=v|0,this.Gl=w|0,this.Hh=S|0,this.Hl=H|0}process(e,s){for(let p=0;p<16;p++,s+=4)N[p]=e.getUint32(s),U[p]=e.getUint32(s+=4);for(let p=16;p<80;p++){const T=N[p-15]|0,_=U[p-15]|0,Fe=c.rotrSH(T,_,1)^c.rotrSH(T,_,8)^c.shrSH(T,_,7),Ge=c.rotrSL(T,_,1)^c.rotrSL(T,_,8)^c.shrSL(T,_,7),K=N[p-2]|0,V=U[p-2]|0,be=c.rotrSH(K,V,19)^c.rotrBH(K,V,61)^c.shrSH(K,V,6),Ie=c.rotrSL(K,V,19)^c.rotrBL(K,V,61)^c.shrSL(K,V,6),me=c.add4L(Ge,Ie,U[p-7],U[p-16]),ve=c.add4H(me,Fe,be,N[p-7],N[p-16]);N[p]=ve|0,U[p]=me|0}let{Ah:n,Al:i,Bh:r,Bl:a,Ch:u,Cl:d,Dh:f,Dl:F,Eh:y,El:L,Fh:v,Fl:w,Gh:S,Gl:H,Hh:he,Hl:ue}=this;for(let p=0;p<80;p++){const T=c.rotrSH(y,L,14)^c.rotrSH(y,L,18)^c.rotrBH(y,L,41),_=c.rotrSL(y,L,14)^c.rotrSL(y,L,18)^c.rotrBL(y,L,41),Fe=y&v^~y&S,Ge=L&w^~L&H,K=c.add5L(ue,_,Ge,rt[p],U[p]),V=c.add5H(K,he,T,Fe,it[p],N[p]),be=K|0,Ie=c.rotrSH(n,i,28)^c.rotrBH(n,i,34)^c.rotrBH(n,i,39),me=c.rotrSL(n,i,28)^c.rotrBL(n,i,34)^c.rotrBL(n,i,39),ve=n&r^n&u^r&u,Qe=i&a^i&d^a&d;he=S|0,ue=H|0,S=v|0,H=w|0,v=y|0,w=L|0,{h:y,l:L}=c.add(f|0,F|0,V|0,be|0),f=u|0,F=d|0,u=r|0,d=a|0,r=n|0,a=i|0;const Ve=c.add3L(be,me,Qe);n=c.add3H(Ve,V,Ie,ve),i=Ve|0}({h:n,l:i}=c.add(this.Ah|0,this.Al|0,n|0,i|0)),{h:r,l:a}=c.add(this.Bh|0,this.Bl|0,r|0,a|0),{h:u,l:d}=c.add(this.Ch|0,this.Cl|0,u|0,d|0),{h:f,l:F}=c.add(this.Dh|0,this.Dl|0,f|0,F|0),{h:y,l:L}=c.add(this.Eh|0,this.El|0,y|0,L|0),{h:v,l:w}=c.add(this.Fh|0,this.Fl|0,v|0,w|0),{h:S,l:H}=c.add(this.Gh|0,this.Gl|0,S|0,H|0),{h:he,l:ue}=c.add(this.Hh|0,this.Hl|0,he|0,ue|0),this.set(n,i,r,a,u,d,f,F,y,L,v,w,S,H,he,ue)}roundClean(){N.fill(0),U.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const ot=Ye(()=>new at);function lt(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof globalThis<"u")return globalThis;throw new Error("unable to locate global object")}const ke=lt();ke.crypto||ke.msCrypto;function ct(t){switch(t){case"sha256":return tt.create();case"sha512":return ot.create()}o(!1,"invalid hashing algorithm name","algorithm",t)}const Me=function(t){return ct("sha256").update(t).digest()};let Je=Me,qe=!1;function le(t){const e=A(t,"data");return g(Je(e))}le._=Me;le.lock=function(){qe=!0};le.register=function(t){if(qe)throw new Error("sha256 is locked");Je=t};Object.freeze(le);Object.freeze(le);const Xe="0x0000000000000000000000000000000000000000",ht=BigInt(0),ut=BigInt(36);function Oe(t){t=t.toLowerCase();const e=t.substring(2).split(""),s=new Uint8Array(40);for(let i=0;i<40;i++)s[i]=e[i].charCodeAt(0);const n=A(Pe(s));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(n[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}const ze={};for(let t=0;t<10;t++)ze[String(t)]=String(t);for(let t=0;t<26;t++)ze[String.fromCharCode(65+t)]=String(10+t);const De=15;function ft(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(n=>ze[n]).join("");for(;e.length>=De;){let n=e.substring(0,De);e=parseInt(n,10)%97+e.substring(n.length)}let s=String(98-parseInt(e,10)%97);for(;s.length<2;)s="0"+s;return s}const dt=function(){const t={};for(let e=0;e<36;e++){const s="0123456789abcdefghijklmnopqrstuvwxyz"[e];t[s]=BigInt(e)}return t}();function bt(t){t=t.toLowerCase();let e=ht;for(let s=0;s(o(xe(s,32),"invalid slot",`storageKeys[${n}]`,s),s.toLowerCase()))}}function Ke(t){if(Array.isArray(t))return t.map((s,n)=>Array.isArray(s)?(o(s.length===2,"invalid slot set",`value[${n}]`,s),Se(s[0],s[1])):(o(s!=null&&typeof s=="object","invalid address-slot set","value",t),Se(s.address,s.storageKeys)));o(t!=null&&typeof t=="object","invalid access list","value",t);const e=Object.keys(t).map(s=>{const n=t[s].reduce((i,r)=>(i[r]=!0,i),{});return Se(s,Object.keys(n).sort())});return e.sort((s,n)=>s.address.localeCompare(n.address)),e}function mt(t){return{address:de(t.address),nonce:G(t.nonce!=null?t.nonce:0),chainId:G(t.chainId!=null?t.chainId:0),signature:j.from(t.signature)}}function gt(t){let e;return typeof t=="string"?e=Ce.computePublicKey(t,!1):e=t.publicKey,de(Pe("0x"+e.substring(4)).substring(26))}function pt(t,e){return gt(Ce.recoverPublicKey(t,e))}const x=BigInt(0),yt=BigInt(2),Pt=BigInt(27),xt=BigInt(28),Lt=BigInt(35),At=BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Bt=Symbol.for("nodejs.util.inspect.custom"),He=4096*32,pe=128;function Ft(t){return{blobToKzgCommitment:n=>{if("computeBlobProof"in t){if("blobToKzgCommitment"in t&&typeof t.blobToKzgCommitment=="function")return A(t.blobToKzgCommitment(g(n)))}else if("blobToKzgCommitment"in t&&typeof t.blobToKzgCommitment=="function")return A(t.blobToKzgCommitment(n));if("blobToKZGCommitment"in t&&typeof t.blobToKZGCommitment=="function")return A(t.blobToKZGCommitment(g(n)));o(!1,"unsupported KZG library","kzg",t)},computeBlobKzgProof:(n,i)=>{if("computeBlobProof"in t&&typeof t.computeBlobProof=="function")return A(t.computeBlobProof(g(n),g(i)));if("computeBlobKzgProof"in t&&typeof t.computeBlobKzgProof=="function")return t.computeBlobKzgProof(n,i);if("computeBlobKZGProof"in t&&typeof t.computeBlobKZGProof=="function")return A(t.computeBlobKZGProof(g(n),g(i)));o(!1,"unsupported KZG library","kzg",t)}}}function Re(t,e){let s=t.toString(16);for(;s.length<2;)s="0"+s;return s+=le(e).substring(4),"0x"+s}function ce(t){return t==="0x"?null:de(t)}function Le(t,e){try{return Ke(t)}catch(s){o(!1,s.message,e,t)}}function Gt(t,e){try{if(!Array.isArray(t))throw new Error("authorizationList: invalid array");const s=[];for(let n=0;n[e.address,e.storageKeys])}function It(t){return t.map(e=>[h(e.chainId,"chainId"),e.address,h(e.nonce,"nonce"),h(e.signature.yParity,"yParity"),B(e.signature.r),B(e.signature._s)])}function vt(t,e){o(Array.isArray(t),`invalid ${e}`,"value",t);for(let s=0;sa.data),s.map(a=>a.commitment),r])])}return R(["0x03",O([n,s.map(i=>i.data),s.map(i=>i.commitment),s.map(i=>i.proof)])])}return R(["0x03",O(n)])}function Tt(t){const e=fe(A(t).slice(1));o(Array.isArray(e)&&(e.length===10||e.length===13),"invalid field count for transaction type: 4","data",g(t));const s={type:4,chainId:b(e[0],"chainId"),nonce:W(e[1],"nonce"),maxPriorityFeePerGas:b(e[2],"maxPriorityFeePerGas"),maxFeePerGas:b(e[3],"maxFeePerGas"),gasPrice:null,gasLimit:b(e[4],"gasLimit"),to:ce(e[5]),value:b(e[6],"value"),data:g(e[7]),accessList:Le(e[8],"accessList"),authorizationList:Gt(e[9],"authorizationList")};return e.length===10||Be(s,e.slice(10)),s}function _t(t,e){const s=[h(t.chainId,"chainId"),h(t.nonce,"nonce"),h(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),h(t.maxFeePerGas||0,"maxFeePerGas"),h(t.gasLimit,"gasLimit"),t.to||"0x",h(t.value,"value"),t.data,Ae(t.accessList||[]),It(t.authorizationList||[])];return e&&(s.push(h(e.yParity,"yParity")),s.push(B(e.r)),s.push(B(e.s))),R(["0x04",O(s)])}var I,Z,M,J,q,X,Q,Y,ee,te,se,ne,D,$,z,k,ie,re,ae,ye;const C=class C{constructor(){P(this,ae);P(this,I);P(this,Z);P(this,M);P(this,J);P(this,q);P(this,X);P(this,Q);P(this,Y);P(this,ee);P(this,te);P(this,se);P(this,ne);P(this,D);P(this,$);P(this,z);P(this,k);P(this,ie);P(this,re);l(this,I,null),l(this,Z,null),l(this,J,0),l(this,q,x),l(this,X,null),l(this,Q,null),l(this,Y,null),l(this,M,"0x"),l(this,ee,x),l(this,te,x),l(this,se,null),l(this,ne,null),l(this,D,null),l(this,$,null),l(this,z,null),l(this,k,null),l(this,ie,null),l(this,re,null)}get type(){return m(this,I)}set type(e){switch(e){case null:l(this,I,null);break;case 0:case"legacy":l(this,I,0);break;case 1:case"berlin":case"eip-2930":l(this,I,1);break;case 2:case"london":case"eip-1559":l(this,I,2);break;case 3:case"cancun":case"eip-4844":l(this,I,3);break;case 4:case"pectra":case"eip-7702":l(this,I,4);break;default:o(!1,"unsupported transaction type","type",e)}}get typeName(){switch(this.type){case 0:return"legacy";case 1:return"eip-2930";case 2:return"eip-1559";case 3:return"eip-4844";case 4:return"eip-7702"}return null}get to(){const e=m(this,Z);return e==null&&this.type===3?Xe:e}set to(e){l(this,Z,e==null?null:de(e))}get nonce(){return m(this,J)}set nonce(e){l(this,J,Ee(e,"value"))}get gasLimit(){return m(this,q)}set gasLimit(e){l(this,q,G(e))}get gasPrice(){const e=m(this,X);return e==null&&(this.type===0||this.type===1)?x:e}set gasPrice(e){l(this,X,e==null?null:G(e,"gasPrice"))}get maxPriorityFeePerGas(){const e=m(this,Q);return e??(this.type===2||this.type===3?x:null)}set maxPriorityFeePerGas(e){l(this,Q,e==null?null:G(e,"maxPriorityFeePerGas"))}get maxFeePerGas(){const e=m(this,Y);return e??(this.type===2||this.type===3?x:null)}set maxFeePerGas(e){l(this,Y,e==null?null:G(e,"maxFeePerGas"))}get data(){return m(this,M)}set data(e){l(this,M,g(e))}get value(){return m(this,ee)}set value(e){l(this,ee,G(e,"value"))}get chainId(){return m(this,te)}set chainId(e){l(this,te,G(e))}get signature(){return m(this,se)||null}set signature(e){l(this,se,e==null?null:j.from(e))}isValid(){const e=this.signature;if(e&&!e.isValid())return!1;const s=this.authorizationList;if(s){for(const n of s)if(!n.signature.isValid())return!1}return!0}get accessList(){const e=m(this,ne)||null;return e??(this.type===1||this.type===2||this.type===3?[]:null)}set accessList(e){l(this,ne,e==null?null:Ke(e))}get authorizationList(){const e=m(this,ie)||null;return e==null&&this.type===4?[]:e}set authorizationList(e){l(this,ie,e==null?null:e.map(s=>mt(s)))}get maxFeePerBlobGas(){const e=m(this,D);return e==null&&this.type===3?x:e}set maxFeePerBlobGas(e){l(this,D,e==null?null:G(e,"maxFeePerBlobGas"))}get blobVersionedHashes(){let e=m(this,$);return e==null&&this.type===3?[]:e}set blobVersionedHashes(e){if(e!=null){o(Array.isArray(e),"blobVersionedHashes must be an Array","value",e),e=e.slice();for(let s=0;sObject.assign({},e))}set blobs(e){if(e==null){l(this,k,null);return}const s=[],n=[];for(let i=0;i=0?2:e.pop()}inferTypes(){const e=this.gasPrice!=null,s=this.maxFeePerGas!=null||this.maxPriorityFeePerGas!=null,n=this.accessList!=null,i=m(this,D)!=null||m(this,$);this.maxFeePerGas!=null&&this.maxPriorityFeePerGas!=null&&E(this.maxFeePerGas>=this.maxPriorityFeePerGas,"priorityFee cannot be more than maxFee","BAD_DATA",{value:this}),E(!s||this.type!==0&&this.type!==1,"transaction type cannot have maxFeePerGas or maxPriorityFeePerGas","BAD_DATA",{value:this}),E(this.type!==0||!n,"legacy transaction cannot have accessList","BAD_DATA",{value:this});const r=[];return this.type!=null?r.push(this.type):this.authorizationList&&this.authorizationList.length?r.push(4):s?r.push(2):e?(r.push(1),n||r.push(0)):n?(r.push(1),r.push(2)):(i&&this.to||(r.push(0),r.push(1),r.push(2)),r.push(3)),r.sort(),r}isLegacy(){return this.type===0}isBerlin(){return this.type===1}isLondon(){return this.type===2}isCancun(){return this.type===3}clone(){return C.from(this)}toJSON(){const e=s=>s==null?null:s.toString();return{type:this.type,to:this.to,data:this.data,nonce:this.nonce,gasLimit:e(this.gasLimit),gasPrice:e(this.gasPrice),maxPriorityFeePerGas:e(this.maxPriorityFeePerGas),maxFeePerGas:e(this.maxFeePerGas),value:e(this.value),chainId:e(this.chainId),sig:this.signature?this.signature.toJSON():null,accessList:this.accessList}}[Bt](){return this.toString()}toString(){const e=[],s=i=>{let r=this[i];typeof r=="string"&&(r=JSON.stringify(r)),e.push(`${i}: ${r}`)};this.type&&s("type"),s("to"),s("data"),s("nonce"),s("gasLimit"),s("value"),this.chainId!=null&&s("chainId"),this.signature&&(s("from"),e.push(`signature: ${this.signature.toString()}`));const n=this.authorizationList;if(n){const i=[];for(const r of n){const a=[];a.push(`address: ${JSON.stringify(r.address)}`),r.nonce!=null&&a.push(`nonce: ${r.nonce}`),r.chainId!=null&&a.push(`chainId: ${r.chainId}`),r.signature&&a.push(`signature: ${r.signature.toString()}`),i.push(`Authorization { ${a.join(", ")} }`)}e.push(`authorizations: [ ${i.join(", ")} ]`)}return`Transaction { ${e.join(", ")} }`}static from(e){if(e==null)return new C;if(typeof e=="string"){const n=A(e);if(n[0]>=127)return C.from(wt(n));switch(n[0]){case 1:return C.from(Et(n));case 2:return C.from(Ht(n));case 3:return C.from(Kt(n));case 4:return C.from(Tt(n))}E(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:"from"})}const s=new C;return e.type!=null&&(s.type=e.type),e.to!=null&&(s.to=e.to),e.nonce!=null&&(s.nonce=e.nonce),e.gasLimit!=null&&(s.gasLimit=e.gasLimit),e.gasPrice!=null&&(s.gasPrice=e.gasPrice),e.maxPriorityFeePerGas!=null&&(s.maxPriorityFeePerGas=e.maxPriorityFeePerGas),e.maxFeePerGas!=null&&(s.maxFeePerGas=e.maxFeePerGas),e.maxFeePerBlobGas!=null&&(s.maxFeePerBlobGas=e.maxFeePerBlobGas),e.data!=null&&(s.data=e.data),e.value!=null&&(s.value=e.value),e.chainId!=null&&(s.chainId=e.chainId),e.signature!=null&&(s.signature=j.from(e.signature)),e.accessList!=null&&(s.accessList=e.accessList),e.authorizationList!=null&&(s.authorizationList=e.authorizationList),e.blobVersionedHashes!=null&&(s.blobVersionedHashes=e.blobVersionedHashes),e.kzg!=null&&(s.kzg=e.kzg),e.blobWrapperVersion!=null&&(s.blobWrapperVersion=e.blobWrapperVersion),e.blobs!=null&&(s.blobs=e.blobs),e.hash!=null&&(o(s.isSigned(),"unsigned transaction cannot define '.hash'","tx",e),o(s.hash===e.hash,"hash mismatch","tx",e)),e.from!=null&&(o(s.isSigned(),"unsigned transaction cannot define '.from'","tx",e),o(s.from.toLowerCase()===(e.from||"").toLowerCase(),"from mismatch","tx",e)),s}};I=new WeakMap,Z=new WeakMap,M=new WeakMap,J=new WeakMap,q=new WeakMap,X=new WeakMap,Q=new WeakMap,Y=new WeakMap,ee=new WeakMap,te=new WeakMap,se=new WeakMap,ne=new WeakMap,D=new WeakMap,$=new WeakMap,z=new WeakMap,k=new WeakMap,ie=new WeakMap,re=new WeakMap,ae=new WeakSet,ye=function(e,s){E(!e||this.signature!=null,"cannot serialize unsigned transaction; maybe you meant .unsignedSerialized","UNSUPPORTED_OPERATION",{operation:".serialized"});const n=e?this.signature:null;switch(this.inferType()){case 0:return St(this,n);case 1:return zt(this,n);case 2:return Ct(this,n);case 3:return Vt(this,n,s?this.blobs:null);case 4:return _t(this,n)}E(!1,"unsupported transaction type","UNSUPPORTED_OPERATION",{operation:".serialized"})};let je=C;export{Ot as MessagePrefix,j as Signature,Ce as SigningKey,je as Transaction,Xe as ZeroAddress,Dt as ZeroHash,Ke as accessListify,E as assert,o as assertArgument,Rt as assertPrivate,mt as authorizationify,gt as computeAddress,R as concat,jt as dataLength,fe as decodeRlp,Wt as defineProperties,O as encodeRlp,de as getAddress,G as getBigInt,A as getBytes,Zt as getBytesCopy,Ee as getNumber,Mt as getUint,Jt as hashMessage,g as hexlify,st as isBytesLike,xe as isHexString,Pe as keccak256,qt as makeError,pt as recoverAddress,le as sha256,B as toBeArray,Xt as toBeHex,Qt as toUtf8Bytes,Yt as version,oe as zeroPadValue}; diff --git a/public/assets/index-uTQGe5qG.js b/public/assets/index-uTQGe5qG.js new file mode 100644 index 0000000..42356ae --- /dev/null +++ b/public/assets/index-uTQGe5qG.js @@ -0,0 +1 @@ +import{b as X,t as _e,c as ie,v as F,F as Se,M as xe,n as de,o as J,e as se,f as ce,h as ue,j as le,k as fe,d as ge,l as Ae,K as Te,p as he,q as G,r as z,u as N,w as ye,C as He,x as W,H as ke,a3 as Ke,B as re,y as Oe,z as Re,A as ze}from"./kernelAccountClient-DgEyP8pS.js";import{j as x,G as Ne,N as Fe,O as Le,P as Ve,Q as Pe,R as Ue,S as Ye,w as U,T as q,p as Z,K as L,V as we,x as Ce,W as Be,X as We,t as V,g as ee,f as Q,z as O,k as H,c as v,i as Ge,h as te,l as pe,v as Ee,m as Ie,o as me,Y as $e,q as je,r as qe,u as Qe}from"./index-C4xokDO6.js";import{b as Xe,K as k,V as K,e as ve,D as Je,M as De,d as Ze}from"./constants-DBcQLFY6.js";function et({abi:e,address:t,client:n}){const a=n,[o,s]=a?"public"in a&&"wallet"in a?[a.public,a.wallet]:"public"in a?[a.public,void 0]:"wallet"in a?[void 0,a.wallet]:[a,a]:[void 0,void 0],C=o!=null,I=s!=null,f={};let A=!1,h=!1,m=!1;for(const u of e)if(u.type==="function"?u.stateMutability==="view"||u.stateMutability==="pure"?A=!0:h=!0:u.type==="event"&&(m=!0),A&&h&&m)break;return C&&(A&&(f.read=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(o,Ne,"readContract")({abi:e,address:t,functionName:w,args:d,...g})}}})),h&&(f.simulate=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(o,Fe,"simulateContract")({abi:e,address:t,functionName:w,args:d,...g})}}})),m&&(f.createEventFilter=new Proxy({},{get(u,w){return(...c)=>{const d=e.find(D=>D.type==="event"&&D.name===w),{args:g,options:E}=j(c,d);return x(o,Le,"createContractEventFilter")({abi:e,address:t,eventName:w,args:g,...E})}}}),f.getEvents=new Proxy({},{get(u,w){return(...c)=>{const d=e.find(D=>D.type==="event"&&D.name===w),{args:g,options:E}=j(c,d);return x(o,Ve,"getContractEvents")({abi:e,address:t,eventName:w,args:g,...E})}}}),f.watchEvent=new Proxy({},{get(u,w){return(...c)=>{const d=e.find(D=>D.type==="event"&&D.name===w),{args:g,options:E}=j(c,d);return x(o,Pe,"watchContractEvent")({abi:e,address:t,eventName:w,args:g,...E})}}}))),I&&h&&(f.write=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(s,Ue,"writeContract")({abi:e,address:t,functionName:w,args:d,...g})}}})),(C||I)&&h&&(f.estimateGas=new Proxy({},{get(u,w){return(...c)=>{const{args:d,options:g}=Y(c);return x(o??s,Ye,"estimateContractGas")({abi:e,address:t,functionName:w,args:d,...g,account:g.account??s.account})}}})),f.address=t,f.abi=e,f}function Y(e){const t=e.length&&Array.isArray(e[0]),n=t?e[0]:[],a=(t?e[1]:e[0])??{};return{args:n,options:a}}function j(e,t){let n=!1;Array.isArray(e[0])?n=!0:e.length===1?n=t.inputs.some(s=>s.indexed):e.length===2&&(n=!0);const a=n?e[0]:void 0,o=(n?e[1]:e[0])??{};return{args:a,options:o}}function oe(e){return!e||typeof e!="object"||!("BYTES_PER_ELEMENT"in e)?!1:e.BYTES_PER_ELEMENT===1&&e.constructor.name==="Uint8Array"}function tt(e){return at(e)}function at(e){const t=U(q(e.from)),n=Z(oe(e.salt)?e.salt:U(e.salt),{size:32}),a="bytecodeHash"in e?oe(e.bytecodeHash)?e.bytecodeHash:U(e.bytecodeHash):L(e.bytecode,"bytes");return q(we(L(Ce([U("0xff"),t,n,a])),12))}const nt=async(e,t)=>{const{address:n}=t,a=await x(e,Be,"getStorageAt")({address:n,slot:Xe});if(!a)throw new Error("Kernel implementation address not found");const o=we(a,12),s=We(o)?o:V(o);return q(s)},st={"0.0.2 - 0.2.4":"0xd9AB5096a832b9ce79914329DAEE236f8Eea0390","0.3.0":"0x8104e3Ad430EA6d354d013A6789fDFc71E671c43",">=0.3.1":"0x845ADb2C711129d4f3966735eD98a9F09fC4cE57"},$=(e,t,n)=>{var o;F(e.version,t);const a=(o=Object.entries(st).find(([s])=>Se(t,s)))==null?void 0:o[1];if(!a&&!n)throw new Error(`Validator not found for Kernel version: ${t}`);return n??a??O};async function be(e,{signer:t,entryPoint:n,kernelVersion:a,validatorAddress:o}){const s=$(n,a,o),C=await X({signer:t}),I=await ee(e);return{..._e({address:C.address,async signMessage({message:A}){return Q(e,{account:C,message:A})},async signTransaction(A,h){throw new Error("Smart account signer doesn't need to sign transactions")},async signTypedData(A){return C.signTypedData(A)}}),supportedKernelVersions:a,validatorType:"SECONDARY",address:s,source:"ECDSAValidator",getIdentifier(){return s},async getEnableData(){return C.address},async getNonceKey(A,h){return h||0n},async signUserOperation(A){const h=ie({userOperation:{...A,signature:"0x"},entryPointAddress:n.address,entryPointVersion:n.version,chainId:I});return await Q(e,{account:C,message:{raw:h}})},async getStubSignature(){return"0xfffffffffffffffffffffffffffffff0000000000000000000000000000000007aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa1c"},async isEnabled(A,h){return!1}}}const rt=async(e,t,n)=>{F(t.version,n);const a=k[n];return t.version==="0.6"?await ot(e,a.factoryAddress):it(a.accountImplementationAddress)},ot=async(e,t)=>await et({address:t,abi:[{type:"function",name:"initCodeHash",inputs:[],outputs:[{name:"result",type:"bytes32",internalType:"bytes32"}],stateMutability:"view"}],client:e}).read.initCodeHash(),it=e=>{if(!Ge(e))throw new Error("Invalid implementation address");const t=v(["0x603d3d8160223d3973",e,"0x6009","0x5155f3363d3d373d3d363d7f360894a13ba1a3210667c828492db98dca3e2076","0xcc3735a920a3ca505d382bbc545af43d6000803e6038573d6000fd5b3d6000f3"]);return L(t)},dt=(e,t,n)=>{const a=V(t,{size:32}),o=H({abi:xe,functionName:"initialize",args:[n,e]}),s=Ce([o,a]),C=BigInt(L(s)),I=BigInt("0xffffffffffffffffffffffff");return V(C&I,{size:32})},ct=(e,t,n,a,o,s,C)=>{const I=V(t,{size:32});let f;if(s==="0.3.0"){f=H({abi:de,functionName:"initialize",args:[v([K.SECONDARY,o]),n,e,a]});const h=v([f,I]);return L(h)}f=H({abi:J,functionName:"initialize",args:[v([K.SECONDARY,o]),n,e,a,C]});const A=v([f,I]);return L(A)};async function wt(e){F(e.entryPoint.version,e.kernelVersion);const t=k[e.kernelVersion],n=$(e.entryPoint,e.kernelVersion),a=await(async()=>{if("initCodeHash"in e&&e.initCodeHash)return e.initCodeHash;if("publicClient"in e&&e.publicClient)return await rt(e.publicClient,e.entryPoint,e.kernelVersion);throw new Error("Either initCodeHash or publicClient must be provided")})();let o;if(e.entryPoint.version==="0.6")o=dt(e.eoaAddress,e.index,n);else{const s="hookAddress"in e&&e.hookAddress?e.hookAddress:O,C="hookData"in e&&e.hookData?e.hookData:"0x",I="initConfig"in e&&e.initConfig?e.initConfig:[];o=ct(e.eoaAddress,e.index,s,C,n,e.kernelVersion,I)}return tt({bytecodeHash:a,opcode:"CREATE2",from:t.factoryAddress,salt:o})}const ut=({entryPointVersion:e,kernelVersion:t,validatorAddress:n,validatorData:a})=>{const o=v([K.SECONDARY,n]);return t==="0.3.0"?H({abi:de,functionName:"initialize",args:[o,O,a,"0x"]}):H({abi:J,functionName:"initialize",args:[o,O,a,"0x",[]]})},lt=async({entryPointVersion:e,kernelVersion:t,validatorData:n,index:a,factoryAddress:o,validatorAddress:s})=>{const C=ut({entryPointVersion:e,kernelVersion:t,validatorAddress:s,validatorData:n});return H({abi:Te,functionName:"deployWithFactory",args:[o,C,V(a,{size:32})]})},B=async(e,t,n)=>{const a=await nt(e,{address:t});return te(a,k[n].accountImplementationAddress)};async function Ct(e,{entryPoint:t,signer:n,index:a=0n,address:o,migrationVersion:s,pluginMigrations:C}){if(t.version==="0.6")throw new Error("EntryPointV0.6 is not supported for migration");F(t.version,s.from),F(t.version,s.to);const I=k[s.from],f=$(t,s.from),A=$(t,s.to),h=await X({signer:n});let m;const u=async()=>m||(m=e.chain?e.chain.id:await x(e,ee,"getChainId")({}),m),w=async()=>lt({entryPointVersion:t.version,factoryAddress:I.factoryAddress,index:a,kernelVersion:s.from,validatorAddress:f,validatorData:h.address}),c=async()=>({factory:I.metaFactoryAddress??O,factoryData:await w()});let d=o??await(async()=>{const{factory:l,factoryData:p}=await c();return await se(e,{factory:l,factoryData:p,entryPointAddress:t.address})})(),g=await B(e,d,s.to);const E={pendingPlugins:C||[],allInstalled:!1},D=async()=>{if(!E.pendingPlugins.length||E.allInstalled){E.allInstalled=!0;return}const l=await Promise.all(E.pendingPlugins.map(p=>Ae(e,{address:d,plugin:p})));E.pendingPlugins=E.pendingPlugins.filter((p,r)=>!l[r]),E.allInstalled=E.pendingPlugins.length===0};await D();const M={address:(t==null?void 0:t.address)??ve,abi:((t==null?void 0:t.version)??"0.7")==="0.6"?ce:ue,version:(t==null?void 0:t.version)??"0.7"};return le({kernelVersion:s.to,kernelPluginManager:await ge(e,{entryPoint:t,kernelVersion:s.to,chainId:await u(),sudo:await be(e,{entryPoint:t,signer:h,kernelVersion:s.to,validatorAddress:A})}),factoryAddress:(await c()).factory,generateInitCode:w,accountImplementationAddress:k[s.to].accountImplementationAddress,encodeModuleInstallCallData:async()=>{throw new Error("Not implemented")},nonceKeyManager:fe({source:{get:()=>0,set:()=>{}}}),client:e,entryPoint:M,getFactoryArgs:c,async getAddress(){if(d)return d;const{factory:l,factoryData:p}=await c();return d=await se(e,{factory:l,factoryData:p,entryPointAddress:t.address}),d},async encodeDeployCallData(l){throw new Error("Not implemented")},async encodeCalls(l,p){await D();const r=[];if(E.pendingPlugins.length>0&&t.version==="0.7")for(const y of E.pendingPlugins)r.push(ye(d,y));g=g||await B(e,d,s.to);let i=l;if(g)i=[...r,...l];else{const y=k[s.to].accountImplementationAddress,_={to:d,data:H({abi:He,functionName:"upgradeTo",args:[y]}),value:0n};if(!te(f,A)){const b=v([K.SECONDARY,Z(A,{size:20,dir:"right"})]),S={to:d,data:H({abi:J,functionName:"changeRootValidator",args:[b,O,h.address,"0x"]}),value:0n};i=[_,S,...r,...l]}i=[_,...r,...l]}return W(i,p)},async sign({hash:l}){return this.signMessage({message:l})},async signMessage({message:l,useReplayableSignature:p}){g=g||await B(e,d,s.to);const r=me(l),i=g?s.to:s.from,y=i==="0.3.0"?"0.3.0-beta":i,_=await G(r,{name:"Kernel",chainId:m,version:y,verifyingContract:d},p);let b=await h.signMessage({message:{raw:_}});return z(N.ERC1271_WITH_VALIDATOR,y)?(p&&z(N.ERC1271_REPLAYABLE,y)&&(b=v([De,b])),v([K.SUDO,b])):b},async signTypedData(l){const{message:p,primaryType:r,types:i,domain:y}=l,_={EIP712Domain:pe({domain:y}),...i};Ee({domain:y,message:p,primaryType:r,types:_});const b=Ie(l);g=g||await B(e,d,s.to);const S=g?s.to:s.from,R=S==="0.3.0"?"0.3.0-beta":S,T=await G(b,{name:"Kernel",chainId:m,version:R,verifyingContract:d}),P=await h.signMessage({message:{raw:T}});return z(N.ERC1271_WITH_VALIDATOR,R)?v([K.SUDO,P]):P},async getNonce(l){const p=ft(f,l==null?void 0:l.key);return he(e,{address:d,entryPointAddress:t.address,key:p})},async getStubSignature(){return Je},async signUserOperation(l){const{chainId:p=await u(),...r}=l,i=ie({userOperation:{...r,sender:r.sender??d,signature:"0x"},entryPointAddress:t.address,entryPointVersion:t.version,chainId:p});return await Q(e,{account:h,message:{raw:i}})}})}const ft=(e,t=0n)=>{if(t>$e)throw new Error("nonce key must be equal or less than 2 bytes(maxUint16) for Kernel version v0.7");const n=Ze.DEFAULT,a=K.SUDO,o=Z(v([n,a,e,V(t,{size:2})]),{size:24});return BigInt(o)};function pt(e){return ke({...e,account:e.account,userOperation:{...e.userOperation,prepareUserOperation:async(t,n)=>{const a=n.authorization||await e.account.signAuthorization(),o={...n,authorization:a};return await Ke(t,o)}}})}const gt=(e,t,{accountImplementationAddress:n,factoryAddress:a,metaFactoryAddress:o})=>{F(e,t);const s=k[t];if(!s)throw new Error(`No addresses found for kernel version ${t}`);return{accountImplementationAddress:n??s.accountImplementationAddress,factoryAddress:s.factoryAddress,metaFactoryAddress:s.metaFactoryAddress??O}};async function Et(e,{signer:t,plugins:n,entryPoint:a,accountImplementationAddress:o,kernelVersion:s,pluginMigrations:C,eip7702Auth:I}){var p;const{accountImplementationAddress:f}=gt(a.version,s,{accountImplementationAddress:o,factoryAddress:void 0,metaFactoryAddress:void 0});let A,h;typeof t=="object"&&t!==null&&"account"in t&&(h=(p=t.account)==null?void 0:p.address);const m=await X({signer:t,address:h}),u=m.address,w=async()=>A||(A=e.chain?e.chain.id:await x(e,ee,"getChainId")({}),A),c=await ge(e,{sudo:await be(e,{signer:m,entryPoint:a,kernelVersion:s}),entryPoint:a,kernelVersion:s,chainId:await w()}),d=async()=>"0x",g=async()=>({factory:void 0,factoryData:void 0}),E=async()=>{const r=await je(e,{address:u});if(!r||r.length===0||!r.toLowerCase().startsWith(`0xef0100${f.slice(2).toLowerCase()}`)){if(I&&!te(I.address,f))throw new Error("EIP-7702 authorization delegate address does not match account implementation address");const i=I??await qe(e,{account:m,address:f,chainId:await w()});if(!await Qe({authorization:i,address:u}))throw new Error("Authorization verification failed");return i}},D={address:(a==null?void 0:a.address)??ve,abi:((a==null?void 0:a.version)??"0.7")==="0.6"?ce:ue,version:(a==null?void 0:a.version)??"0.7"},M={pendingPlugins:C||[],allInstalled:!1},l=async()=>{if(!M.pendingPlugins.length||M.allInstalled){M.allInstalled=!0;return}const r=await Promise.all(M.pendingPlugins.map(i=>Ae(e,{address:u,plugin:i})));M.pendingPlugins=M.pendingPlugins.filter((i,y)=>!r[y]),M.allInstalled=M.pendingPlugins.length===0};return await l(),le({kernelVersion:s,kernelPluginManager:c,accountImplementationAddress:f,factoryAddress:void 0,generateInitCode:d,encodeModuleInstallCallData:async()=>await c.encodeModuleInstallCallData(u),nonceKeyManager:fe({source:{get:()=>0,set:()=>{}}}),client:e,entryPoint:D,getFactoryArgs:g,async getAddress(){return u},signAuthorization:E,async encodeDeployCallData(r){return a.version==="0.6"?Re(r):ze(r)},async encodeCalls(r,i){if(await l(),M.pendingPlugins.length>0&&a.version==="0.7"&&c.activeValidatorMode==="sudo"){const y=[];for(const _ of M.pendingPlugins)y.push(ye(u,_));return W([...r,...y],i,n!=null&&n.hook?!0:void 0)}return r.length===1&&(!i||i==="call")&&r[0].to.toLowerCase()===u.toLowerCase()?r[0].data??"0x":a.version==="0.6"?Oe(r,i):n!=null&&n.hook?W(r,i,!0):W(r,i)},async sign({hash:r}){return this.signMessage({message:r})},async signMessage({message:r,useReplayableSignature:i}){const y=me(r),{name:_,chainId:b,version:S}=await re(e,u,s,A),R=await G(y,{name:_,chainId:Number(b),version:S,verifyingContract:u},i);let T=await c.signMessage({message:{raw:R}});return z(N.ERC1271_WITH_VALIDATOR,S)?(i&&z(N.ERC1271_REPLAYABLE,S)&&(T=v([De,T])),v([c.getIdentifier(),T])):T},async signTypedData(r){const{message:i,primaryType:y,types:_,domain:b}=r,S={EIP712Domain:pe({domain:b}),..._};Ee({domain:b,message:i,primaryType:y,types:S});const R=Ie(r),{name:T,chainId:P,version:ae}=await re(e,u,s,A),Me=await G(R,{name:T,chainId:Number(P),version:ae,verifyingContract:u}),ne=await c.signMessage({message:{raw:Me}});return z(N.ERC1271_WITH_VALIDATOR,ae)?v([c.getIdentifier(),ne]):ne},async getNonce(r){const i=await c.getNonceKey(u,r==null?void 0:r.key);return he(e,{address:u,entryPointAddress:a.address,key:i})},async getStubSignature(r){if(!r)throw new Error("No user operation provided");return c.getStubSignature(r)},async signUserOperation(r){const{chainId:i=await w(),...y}=r;return c.signUserOperation({...y,sender:y.sender??await this.getAddress(),chainId:i})}})}export{Et as create7702KernelAccount,pt as create7702KernelAccountClient,Ct as createEcdsaKernelMigrationAccount,wt as getKernelAddressFromECDSA,$ as getValidatorAddress,st as kernelVersionRangeToValidator,be as signerToEcdsaValidator}; diff --git a/public/assets/kernelAccountClient-DrOnjQwj.js b/public/assets/kernelAccountClient-DgEyP8pS.js similarity index 65% rename from public/assets/kernelAccountClient-DrOnjQwj.js rename to public/assets/kernelAccountClient-DgEyP8pS.js index 864d51b..f918604 100644 --- a/public/assets/kernelAccountClient-DrOnjQwj.js +++ b/public/assets/kernelAccountClient-DgEyP8pS.js @@ -1,5 +1,5 @@ -import{as as wa,C as Y,a7 as ee,at as va,au as Ia,J as N,av as xa,a4 as z,E as M,aw as Oa,_ as Pa,ad as W,T as $,aa as ue,ab as ea,a0 as Aa,D as Dt,I as Rt,ax as I,ay as Da,az as Gt,aA as ve,aB as Ra,aC as Xe,aD as Ga,ag as me,aE as vt,V as B,aF as La,aG as Ca,aH as K,O as Ie,aI as Sa,aJ as Na,aK as Ma,aL as $a,aM as Ua,aN as Fa,ah as Va,aO as Lt,aP as Ct,aQ as St,aR as _a,W as J,aq as Nt,aS as ka,aT as Ba,aU as Ha,aV as za,a1 as ja,aW as Ka,P as Xa,aX as Wa,aY as Ya,a5 as We,a6 as Ye,Q as ae,a8 as qe,aZ as qa,ar as Za,ac as ta,F as Ja,a_ as Qa,R as en,X as tn,Y as an,ae as nn}from"./index-CGdEoSbI.js";import{f as rn,C as ye,V as H,O as sn,d as Mt,s as aa,E as na,a as ra,K as sa,g as on,h as pn}from"./constants-VN1kIEzb.js";function un(e){const{source:t}=e,a=new Map,n=new wa(8192),r=new Map,p=({address:i,chainId:u})=>`${i}.${u}`;return{async consume({address:i,chainId:u,client:s}){const y=p({address:i,chainId:u}),o=this.get({address:i,chainId:u,client:s});this.increment({address:i,chainId:u});const m=await o;return await t.set({address:i,chainId:u},m),n.set(y,m),m},async increment({address:i,chainId:u}){const s=p({address:i,chainId:u}),y=a.get(s)??0;a.set(s,y+1)},async get({address:i,chainId:u,client:s}){const y=p({address:i,chainId:u});let o=r.get(y);return o||(o=(async()=>{try{const v=await t.get({address:i,chainId:u,client:s}),A=n.get(y)??0;return A>0&&v<=A?A+1:(n.delete(y),v)}finally{this.reset({address:i,chainId:u})}})(),r.set(y,o)),(a.get(y)??0)+await o},reset({address:i,chainId:u}){const s=p({address:i,chainId:u});a.delete(s),r.delete(s)}}}const yn="0x6492649264926492649264926492649264926492649264926492649264926492";function Ve(e){const{address:t,data:a,signature:n,to:r="hex"}=e,p=Y([ee([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,a,n]),yn]);return r==="hex"?p:va(p)}function ln(e){const{r:t,s:a}=Ia.Signature.fromCompact(e.slice(2,130)),n=+`0x${e.slice(130)}`,[r,p]=(()=>{if(n===0||n===1)return[void 0,n];if(n===27)return[BigInt(n),0];if(n===28)return[BigInt(n),1];throw new Error("Invalid yParityOrV value")})();return typeof r<"u"?{r:N(t,{size:32}),s:N(a,{size:32}),v:r,yParity:p}:{r:N(t,{size:32}),s:N(a,{size:32}),yParity:p}}var Ze={exports:{}};const dn="2.0.0",ia=256,cn=Number.MAX_SAFE_INTEGER||9007199254740991,mn=16,fn=ia-6,bn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ne={MAX_LENGTH:ia,MAX_SAFE_COMPONENT_LENGTH:mn,MAX_SAFE_BUILD_LENGTH:fn,MAX_SAFE_INTEGER:cn,RELEASE_TYPES:bn,SEMVER_SPEC_VERSION:dn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},_e={};const gn=typeof xa=="object"&&_e&&_e.NODE_DEBUG&&/\bsemver\b/i.test(_e.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Me=gn;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:r}=Ne,p=Me;t=e.exports={};const i=t.re=[],u=t.safeRe=[],s=t.src=[],y=t.safeSrc=[],o=t.t={};let m=0;const v="[a-zA-Z0-9-]",A=[["\\s",1],["\\d",r],[v,n]],d=b=>{for(const[P,L]of A)b=b.split(`${P}*`).join(`${P}{0,${L}}`).split(`${P}+`).join(`${P}{1,${L}}`);return b},l=(b,P,L)=>{const R=d(P),F=m++;p(b,F,P),o[b]=F,s[F]=P,y[F]=R,i[F]=new RegExp(P,L?"g":void 0),u[F]=new RegExp(R,L?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","\\d+"),l("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${v}*`),l("MAINVERSION",`(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${s[o.NONNUMERICIDENTIFIER]}|${s[o.NUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${s[o.NONNUMERICIDENTIFIER]}|${s[o.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASE",`(?:-(${s[o.PRERELEASEIDENTIFIER]}(?:\\.${s[o.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${s[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[o.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER",`${v}+`),l("BUILD",`(?:\\+(${s[o.BUILDIDENTIFIER]}(?:\\.${s[o.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${s[o.MAINVERSION]}${s[o.PRERELEASE]}?${s[o.BUILD]}?`),l("FULL",`^${s[o.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${s[o.MAINVERSIONLOOSE]}${s[o.PRERELEASELOOSE]}?${s[o.BUILD]}?`),l("LOOSE",`^${s[o.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",`${s[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),l("XRANGEIDENTIFIER",`${s[o.NUMERICIDENTIFIER]}|x|X|\\*`),l("XRANGEPLAIN",`[v=\\s]*(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:${s[o.PRERELEASE]})?${s[o.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:${s[o.PRERELEASELOOSE]})?${s[o.BUILD]}?)?)?`),l("XRANGE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAINLOOSE]}$`),l("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),l("COERCE",`${s[o.COERCEPLAIN]}(?:$|[^\\d])`),l("COERCEFULL",s[o.COERCEPLAIN]+`(?:${s[o.PRERELEASE]})?(?:${s[o.BUILD]})?(?:$|[^\\d])`),l("COERCERTL",s[o.COERCE],!0),l("COERCERTLFULL",s[o.COERCEFULL],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${s[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",l("TILDE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${s[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",l("CARET",`^${s[o.LONECARET]}${s[o.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${s[o.LONECARET]}${s[o.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${s[o.GTLT]}\\s*(${s[o.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]}|${s[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${s[o.XRANGEPLAIN]})\\s+-\\s+(${s[o.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${s[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[o.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ze,Ze.exports);var fe=Ze.exports;const hn=Object.freeze({loose:!0}),Tn=Object.freeze({}),En=e=>e?typeof e!="object"?hn:e:Tn;var It=En;const $t=/^[0-9]+$/,oa=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eoa(t,e);var pa={compareIdentifiers:oa,rcompareIdentifiers:wn};const ge=Me,{MAX_LENGTH:Ut,MAX_SAFE_INTEGER:he}=Ne,{safeRe:Te,t:Ee}=fe,vn=It,{compareIdentifiers:ke}=pa;let In=class Z{constructor(t,a){if(a=vn(a),t instanceof Z){if(t.loose===!!a.loose&&t.includePrerelease===!!a.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ut)throw new TypeError(`version is longer than ${Ut} characters`);ge("SemVer",t,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const n=t.trim().match(a.loose?Te[Ee.LOOSE]:Te[Ee.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>he||this.major<0)throw new TypeError("Invalid major version");if(this.minor>he||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>he||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const p=+r;if(p>=0&&pt.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof Z||(t=new Z(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let a=0;do{const n=this.prerelease[a],r=t.prerelease[a];if(ge("prerelease compare",a,n,r),n===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(n===void 0)return-1;if(n===r)continue;return ke(n,r)}while(++a)}compareBuild(t){t instanceof Z||(t=new Z(t,this.options));let a=0;do{const n=this.build[a],r=t.build[a];if(ge("build compare",a,n,r),n===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(n===void 0)return-1;if(n===r)continue;return ke(n,r)}while(++a)}inc(t,a,n){if(t.startsWith("pre")){if(!a&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(a){const r=`-${a}`.match(this.options.loose?Te[Ee.PRERELEASELOOSE]:Te[Ee.PRERELEASE]);if(!r||r[1]!==a)throw new Error(`invalid identifier: ${a}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",a,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",a,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",a,n),this.inc("pre",a,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",a,n),this.inc("pre",a,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const r=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let p=this.prerelease.length;for(;--p>=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(a===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(a){let p=[a,r];n===!1&&(p=[a]),ke(this.prerelease[0],a)===0?isNaN(this.prerelease[1])&&(this.prerelease=p):this.prerelease=p}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var xt=In;const Ft=xt,xn=(e,t,a)=>new Ft(e,a).compare(new Ft(t,a));var le=xn;const On=le,Pn=(e,t,a)=>On(e,t,a)>0;var An=Pn;const Dn=le,Rn=(e,t,a)=>Dn(e,t,a)<0;var Gn=Rn;const Ln=le,Cn=(e,t,a)=>Ln(e,t,a)===0;var Sn=Cn;const Nn=le,Mn=(e,t,a)=>Nn(e,t,a)!==0;var $n=Mn;const Un=le,Fn=(e,t,a)=>Un(e,t,a)>=0;var Vn=Fn;const _n=le,kn=(e,t,a)=>_n(e,t,a)<=0;var Bn=kn;const Hn=Sn,zn=$n,jn=An,Kn=Vn,Xn=Gn,Wn=Bn,Yn=(e,t,a,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof a=="object"&&(a=a.version),e===a;case"!==":return typeof e=="object"&&(e=e.version),typeof a=="object"&&(a=a.version),e!==a;case"":case"=":case"==":return Hn(e,a,n);case"!=":return zn(e,a,n);case">":return jn(e,a,n);case">=":return Kn(e,a,n);case"<":return Xn(e,a,n);case"<=":return Wn(e,a,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var qn=Yn;const{safeRe:ts,t:as}=fe;class Zn{constructor(){this.max=1e3,this.map=new Map}get(t){const a=this.map.get(t);if(a!==void 0)return this.map.delete(t),this.map.set(t,a),a}delete(t){return this.map.delete(t)}set(t,a){if(!this.delete(t)&&a!==void 0){if(this.map.size>=this.max){const r=this.map.keys().next().value;this.delete(r)}this.map.set(t,a)}return this}}var Jn=Zn,Be,Vt;function q(){if(Vt)return Be;Vt=1;const e=/\s+/g;class t{constructor(c,E){if(E=r(E),c instanceof t)return c.loose===!!E.loose&&c.includePrerelease===!!E.includePrerelease?c:new t(c.raw,E);if(c instanceof p)return this.raw=c.value,this.set=[[c]],this.formatted=void 0,this;if(this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease,this.raw=c.trim().replace(e," "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(w=>!l(w[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const w of this.set)if(w.length===1&&b(w[0])){this.set=[w];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let c=0;c0&&(this.formatted+="||");const E=this.set[c];for(let g=0;g0&&(this.formatted+=" "),this.formatted+=E[g].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(c){const g=((this.options.includePrerelease&&A)|(this.options.loose&&d))+":"+c,w=n.get(g);if(w)return w;const h=this.options.loose,O=h?s[y.HYPHENRANGELOOSE]:s[y.HYPHENRANGE];c=c.replace(O,Fe(this.options.includePrerelease)),i("hyphen replace",c),c=c.replace(s[y.COMPARATORTRIM],o),i("comparator trim",c),c=c.replace(s[y.TILDETRIM],m),i("tilde trim",c),c=c.replace(s[y.CARETTRIM],v),i("caret trim",c);let C=c.split(" ").map(k=>L(k,this.options)).join(" ").split(/\s+/).map(k=>X(k,this.options));h&&(C=C.filter(k=>(i("loose invalid filter",k,this.options),!!k.match(s[y.COMPARATORLOOSE])))),i("range list",C);const D=new Map,U=C.map(k=>new p(k,this.options));for(const k of U){if(l(k))return[k];D.set(k.value,k)}D.size>1&&D.has("")&&D.delete("");const j=[...D.values()];return n.set(g,j),j}intersects(c,E){if(!(c instanceof t))throw new TypeError("a Range is required");return this.set.some(g=>P(g,E)&&c.set.some(w=>P(w,E)&&g.every(h=>w.every(O=>h.intersects(O,E)))))}test(c){if(!c)return!1;if(typeof c=="string")try{c=new u(c,this.options)}catch{return!1}for(let E=0;Ef.value==="<0.0.0-0",b=f=>f.value==="",P=(f,c)=>{let E=!0;const g=f.slice();let w=g.pop();for(;E&&g.length;)E=g.every(h=>w.intersects(h,c)),w=g.pop();return E},L=(f,c)=>(f=f.replace(s[y.BUILD],""),i("comp",f,c),f=S(f,c),i("caret",f),f=F(f,c),i("tildes",f),f=_(f,c),i("xrange",f),f=G(f,c),i("stars",f),f),R=f=>!f||f.toLowerCase()==="x"||f==="*",F=(f,c)=>f.trim().split(/\s+/).map(E=>T(E,c)).join(" "),T=(f,c)=>{const E=c.loose?s[y.TILDELOOSE]:s[y.TILDE];return f.replace(E,(g,w,h,O,C)=>{i("tilde",f,g,w,h,O,C);let D;return R(w)?D="":R(h)?D=`>=${w}.0.0 <${+w+1}.0.0-0`:R(O)?D=`>=${w}.${h}.0 <${w}.${+h+1}.0-0`:C?(i("replaceTilde pr",C),D=`>=${w}.${h}.${O}-${C} <${w}.${+h+1}.0-0`):D=`>=${w}.${h}.${O} <${w}.${+h+1}.0-0`,i("tilde return",D),D})},S=(f,c)=>f.trim().split(/\s+/).map(E=>V(E,c)).join(" "),V=(f,c)=>{i("caret",f,c);const E=c.loose?s[y.CARETLOOSE]:s[y.CARET],g=c.includePrerelease?"-0":"";return f.replace(E,(w,h,O,C,D)=>{i("caret",f,w,h,O,C,D);let U;return R(h)?U="":R(O)?U=`>=${h}.0.0${g} <${+h+1}.0.0-0`:R(C)?h==="0"?U=`>=${h}.${O}.0${g} <${h}.${+O+1}.0-0`:U=`>=${h}.${O}.0${g} <${+h+1}.0.0-0`:D?(i("replaceCaret pr",D),h==="0"?O==="0"?U=`>=${h}.${O}.${C}-${D} <${h}.${O}.${+C+1}-0`:U=`>=${h}.${O}.${C}-${D} <${h}.${+O+1}.0-0`:U=`>=${h}.${O}.${C}-${D} <${+h+1}.0.0-0`):(i("no pr"),h==="0"?O==="0"?U=`>=${h}.${O}.${C}${g} <${h}.${O}.${+C+1}-0`:U=`>=${h}.${O}.${C}${g} <${h}.${+O+1}.0-0`:U=`>=${h}.${O}.${C} <${+h+1}.0.0-0`),i("caret return",U),U})},_=(f,c)=>(i("replaceXRanges",f,c),f.split(/\s+/).map(E=>x(E,c)).join(" ")),x=(f,c)=>{f=f.trim();const E=c.loose?s[y.XRANGELOOSE]:s[y.XRANGE];return f.replace(E,(g,w,h,O,C,D)=>{i("xRange",f,g,w,h,O,C,D);const U=R(h),j=U||R(O),k=j||R(C),ce=k;return w==="="&&ce&&(w=""),D=c.includePrerelease?"-0":"",U?w===">"||w==="<"?g="<0.0.0-0":g="*":w&&ce?(j&&(O=0),C=0,w===">"?(w=">=",j?(h=+h+1,O=0,C=0):(O=+O+1,C=0)):w==="<="&&(w="<",j?h=+h+1:O=+O+1),w==="<"&&(D="-0"),g=`${w+h}.${O}.${C}${D}`):j?g=`>=${h}.0.0${D} <${+h+1}.0.0-0`:k&&(g=`>=${h}.${O}.0${D} <${h}.${+O+1}.0-0`),i("xRange return",g),g})},G=(f,c)=>(i("replaceStars",f,c),f.trim().replace(s[y.STAR],"")),X=(f,c)=>(i("replaceGTE0",f,c),f.trim().replace(s[c.includePrerelease?y.GTE0PRE:y.GTE0],"")),Fe=f=>(c,E,g,w,h,O,C,D,U,j,k,ce)=>(R(g)?E="":R(w)?E=`>=${g}.0.0${f?"-0":""}`:R(h)?E=`>=${g}.${w}.0${f?"-0":""}`:O?E=`>=${E}`:E=`>=${E}${f?"-0":""}`,R(U)?D="":R(j)?D=`<${+U+1}.0.0-0`:R(k)?D=`<${U}.${+j+1}.0-0`:ce?D=`<=${U}.${j}.${k}-${ce}`:f?D=`<${U}.${j}.${+k+1}-0`:D=`<=${D}`,`${E} ${D}`.trim()),be=(f,c,E)=>{for(let g=0;g0){const w=f[g].semver;if(w.major===c.major&&w.minor===c.minor&&w.patch===c.patch)return!0}return!1}return!0};return Be}var He,_t;function $e(){if(_t)return He;_t=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(o,m){if(m=a(m),o instanceof t){if(o.loose===!!m.loose)return o;o=o.value}o=o.trim().split(/\s+/).join(" "),i("comparator",o,m),this.options=m,this.loose=!!m.loose,this.parse(o),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(o){const m=this.options.loose?n[r.COMPARATORLOOSE]:n[r.COMPARATOR],v=o.match(m);if(!v)throw new TypeError(`Invalid comparator: ${o}`);this.operator=v[1]!==void 0?v[1]:"",this.operator==="="&&(this.operator=""),v[2]?this.semver=new u(v[2],this.options.loose):this.semver=e}toString(){return this.value}test(o){if(i("Comparator.test",o,this.options.loose),this.semver===e||o===e)return!0;if(typeof o=="string")try{o=new u(o,this.options)}catch{return!1}return p(o,this.operator,this.semver,this.options)}intersects(o,m){if(!(o instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new s(o.value,m).test(this.value):o.operator===""?o.value===""?!0:new s(this.value,m).test(o.semver):(m=a(m),m.includePrerelease&&(this.value==="<0.0.0-0"||o.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||o.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&o.operator.startsWith(">")||this.operator.startsWith("<")&&o.operator.startsWith("<")||this.semver.version===o.semver.version&&this.operator.includes("=")&&o.operator.includes("=")||p(this.semver,"<",o.semver,m)&&this.operator.startsWith(">")&&o.operator.startsWith("<")||p(this.semver,">",o.semver,m)&&this.operator.startsWith("<")&&o.operator.startsWith(">")))}}He=t;const a=It,{safeRe:n,t:r}=fe,p=qn,i=Me,u=xt,s=q();return He}const Qn=q(),er=(e,t,a)=>{try{t=new Qn(t,a)}catch{return!1}return t.test(e)};var tr=er;q();q();q();q();q();const ar=$e(),{ANY:ns}=ar;q();q();q();const Ot=$e(),{ANY:rs}=Ot;new Ot(">=0.0.0-0");new Ot(">=0.0.0");const ze=fe,kt=Ne,Bt=pa;$e();q();const nr=tr;var ie={satisfies:nr,re:ze.re,src:ze.src,tokens:ze.t,SEMVER_SPEC_VERSION:kt.SEMVER_SPEC_VERSION,RELEASE_TYPES:kt.RELEASE_TYPES,compareIdentifiers:Bt.compareIdentifiers,rcompareIdentifiers:Bt.rcompareIdentifiers};const ss=[{inputs:[{name:"preOpGas",type:"uint256"},{name:"paid",type:"uint256"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"targetSuccess",type:"bool"},{name:"targetResult",type:"bytes"}],name:"ExecutionResult",type:"error"},{inputs:[{name:"opIndex",type:"uint256"},{name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{inputs:[{components:[{name:"preOpGas",type:"uint256"},{name:"prefund",type:"uint256"},{name:"sigFailed",type:"bool"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"paymasterContext",type:"bytes"}],name:"returnInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"senderInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"factoryInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"paymasterInfo",type:"tuple"}],name:"ValidationResult",type:"error"},{inputs:[{components:[{name:"preOpGas",type:"uint256"},{name:"prefund",type:"uint256"},{name:"sigFailed",type:"bool"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"paymasterContext",type:"bytes"}],name:"returnInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"senderInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"factoryInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"paymasterInfo",type:"tuple"},{components:[{name:"aggregator",type:"address"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"stakeInfo",type:"tuple"}],name:"aggregatorInfo",type:"tuple"}],name:"ValidationResultWithAggregation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"factory",type:"address"},{indexed:!1,name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalStaked",type:"uint256"},{indexed:!1,name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"paymaster",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"success",type:"bool"},{indexed:!1,name:"actualGasCost",type:"uint256"},{indexed:!1,name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[],name:"SIG_VALIDATION_FAILED",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"},{name:"sender",type:"address"},{name:"paymasterAndData",type:"bytes"}],name:"_validateSenderAndPaymaster",outputs:[],stateMutability:"view",type:"function"},{inputs:[{name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"",type:"address"}],name:"deposits",outputs:[{name:"deposit",type:"uint112"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{name:"deposit",type:"uint112"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{name:"sender",type:"address"},{name:"key",type:"uint192"}],name:"getNonce",outputs:[{name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOps",type:"tuple[]"},{name:"aggregator",type:"address"},{name:"signature",type:"bytes"}],name:"opsPerAggregator",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"ops",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"callData",type:"bytes"},{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"paymaster",type:"address"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"}],name:"mUserOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"prefund",type:"uint256"},{name:"contextOffset",type:"uint256"},{name:"preOpGas",type:"uint256"}],name:"opInfo",type:"tuple"},{name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"",type:"address"},{name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"op",type:"tuple"},{name:"target",type:"address"},{name:"targetCallData",type:"bytes"}],name:"simulateHandleOp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"simulateValidation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"},{name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],is=[{inputs:[{name:"success",type:"bool"},{name:"ret",type:"bytes"}],name:"DelegateAndRevert",type:"error"},{inputs:[{name:"opIndex",type:"uint256"},{name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{name:"opIndex",type:"uint256"},{name:"reason",type:"string"},{name:"inner",type:"bytes"}],name:"FailedOpWithRevert",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"PostOpReverted",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"factory",type:"address"},{indexed:!1,name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"revertReason",type:"bytes"}],name:"PostOpRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalStaked",type:"uint256"},{indexed:!1,name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"paymaster",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"success",type:"bool"},{indexed:!1,name:"actualGasCost",type:"uint256"},{indexed:!1,name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"}],name:"UserOperationPrefundTooLow",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[{name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"target",type:"address"},{name:"data",type:"bytes"}],name:"delegateAndRevert",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"",type:"address"}],name:"deposits",outputs:[{name:"deposit",type:"uint256"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{name:"deposit",type:"uint256"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{name:"sender",type:"address"},{name:"key",type:"uint192"}],name:"getNonce",outputs:[{name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOps",type:"tuple[]"},{name:"aggregator",type:"address"},{name:"signature",type:"bytes"}],name:"opsPerAggregator",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"ops",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"callData",type:"bytes"},{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"callGasLimit",type:"uint256"},{name:"paymasterVerificationGasLimit",type:"uint256"},{name:"paymasterPostOpGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"paymaster",type:"address"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"}],name:"mUserOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"prefund",type:"uint256"},{name:"contextOffset",type:"uint256"},{name:"preOpGas",type:"uint256"}],name:"opInfo",type:"tuple"},{name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"",type:"address"},{name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"},{name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];function ua(e,t={}){const{forHash:a}=t,{authorization:n,factory:r,factoryData:p}=e;return a&&(r==="0x7702"||r==="0x7702000000000000000000000000000000000000")?n?z([n.address,p??"0x"]):"0x7702000000000000000000000000000000000000":r?z([r,p??"0x"]):"0x"}const Ht="0x22e325a297439656";function ya(e,t={}){const{callGasLimit:a,callData:n,maxPriorityFeePerGas:r,maxFeePerGas:p,paymaster:i,paymasterData:u,paymasterPostOpGasLimit:s,paymasterSignature:y,paymasterVerificationGasLimit:o,sender:m,signature:v="0x",verificationGasLimit:A}=e,d=z([M(N(A||0n),{size:16}),M(N(a||0n),{size:16})]),l=ua(e,t),b=z([M(N(r||0n),{size:16}),M(N(p||0n),{size:16})]),P=e.nonce??0n,L=i?z([i,M(N(o||0n),{size:16}),M(N(s||0n),{size:16}),u||"0x",...y?t.forHash?[Ht]:[y,M(N(Oa(y)),{size:2}),Ht]:[]]):"0x",R=e.preVerificationGas??0n;return{accountGasLimits:d,callData:n,initCode:l,gasFees:b,nonce:P,paymasterAndData:L,preVerificationGas:R,sender:m,signature:v}}const rr={PackedUserOperation:[{type:"address",name:"sender"},{type:"uint256",name:"nonce"},{type:"bytes",name:"initCode"},{type:"bytes",name:"callData"},{type:"bytes32",name:"accountGasLimits"},{type:"uint256",name:"preVerificationGas"},{type:"bytes32",name:"gasFees"},{type:"bytes",name:"paymasterAndData"}]};function sr(e){const{chainId:t,entryPointAddress:a,userOperation:n}=e,r=ya(n,{forHash:!0});return{types:rr,primaryType:"PackedUserOperation",domain:{name:"ERC4337",version:"1",chainId:t,verifyingContract:a},message:r}}function os(e){const{chainId:t,entryPointAddress:a,entryPointVersion:n}=e,r=e.userOperation,{authorization:p,callData:i="0x",callGasLimit:u,maxFeePerGas:s,maxPriorityFeePerGas:y,nonce:o,paymasterAndData:m="0x",preVerificationGas:v,sender:A,verificationGasLimit:d}=r;if(n==="0.8"||n==="0.9")return Pa(sr({chainId:t,entryPointAddress:a,userOperation:r}));const l=(()=>{var b,P;if(n==="0.6"){const L=(b=r.initCode)==null?void 0:b.slice(0,42),R=(P=r.initCode)==null?void 0:P.slice(42),F=ua({authorization:p,factory:L,factoryData:R},{forHash:!0});return ee([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[A,o,W(F),W(i),u,d,v,s,y,W(m)])}if(n==="0.7"){const L=ya(r,{forHash:!0});return ee([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[L.sender,L.nonce,W(L.initCode),W(L.callData),L.accountGasLimits,L.preVerificationGas,L.gasFees,W(L.paymasterAndData)])}throw new Error(`entryPointVersion "${n}" not supported.`)})();return W(ee([{type:"bytes32"},{type:"address"},{type:"uint256"}],[W(l),a,BigInt(t)]))}async function ps(e){const{extend:t,nonceKeyManager:a=un({source:{get(){return Date.now()},set(){}}}),...n}=e;let r=!1;const p=await e.getAddress();return{...t,...n,address:p,async getFactoryArgs(){return"isDeployed"in this&&await this.isDeployed()?{factory:void 0,factoryData:void 0}:e.getFactoryArgs()},async getNonce(i){const u=(i==null?void 0:i.key)??BigInt(await a.consume({address:p,chainId:e.client.chain.id,client:e.client}));return e.getNonce?await e.getNonce({...i,key:u}):await ue(e.client,{abi:ea(["function getNonce(address, uint192) pure returns (uint256)"]),address:e.entryPoint.address,functionName:"getNonce",args:[p,u]})},async isDeployed(){return r?!0:(r=!!await $(e.client,Aa,"getCode")({address:p}),r)},...e.sign?{async sign(i){const[{factory:u,factoryData:s},y]=await Promise.all([this.getFactoryArgs(),e.sign(i)]);return u&&s?Ve({address:u,data:s,signature:y}):y}}:{},async signMessage(i){const[{factory:u,factoryData:s},y]=await Promise.all([this.getFactoryArgs(),e.signMessage(i)]);return u&&s&&u!=="0x7702"?Ve({address:u,data:s,signature:y}):y},async signTypedData(i){const[{factory:u,factoryData:s},y]=await Promise.all([this.getFactoryArgs(),e.signTypedData(i)]);return u&&s&&u!=="0x7702"?Ve({address:u,data:s,signature:y}):y},type:"smart"}}function ir(e){if(typeof e=="string"){if(!Dt(e,{strict:!1}))throw new Rt({address:e});return{address:e,type:"json-rpc"}}if(!Dt(e.address,{strict:!1}))throw new Rt({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}class Je extends I{constructor({cause:t}){super("Smart Account is not deployed.",{cause:t,metaMessages:["This could arise when:","- No `factory`/`factoryData` or `initCode` properties are provided for Smart Account deployment.","- An incorrect `sender` address is provided."],name:"AccountNotDeployedError"})}}Object.defineProperty(Je,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa20/});class oe extends I{constructor({cause:t,data:a,message:n}={}){var p;const r=(p=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:p.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a}}Object.defineProperty(oe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32521});Object.defineProperty(oe,"message",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Qe extends I{constructor({cause:t}){super("Failed to send funds to beneficiary.",{cause:t,name:"FailedToSendToBeneficiaryError"})}}Object.defineProperty(Qe,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa91/});class et extends I{constructor({cause:t}){super("Gas value overflowed.",{cause:t,metaMessages:["This could arise when:","- one of the gas values exceeded 2**120 (uint120)"].filter(Boolean),name:"GasValuesOverflowError"})}}Object.defineProperty(et,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa94/});class tt extends I{constructor({cause:t}){super("The `handleOps` function was called by the Bundler with a gas limit too low.",{cause:t,name:"HandleOpsOutOfGasError"})}}Object.defineProperty(tt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa95/});class at extends I{constructor({cause:t,factory:a,factoryData:n,initCode:r}){super("Failed to simulate deployment for Smart Account.",{cause:t,metaMessages:["This could arise when:","- Invalid `factory`/`factoryData` or `initCode` properties are present","- Smart Account deployment execution ran out of gas (low `verificationGasLimit` value)",`- Smart Account deployment execution reverted with an error +import{Z as va,c as Y,D as ee,_ as wa,$ as Ia,n as N,a0 as xa,x as z,p as M,a1 as Oa,m as Pa,K as W,j as $,G as ue,H as ea,q as Aa,i as Dt,I as Rt,a2 as I,a3 as Da,a4 as Gt,a5 as we,a6 as Ra,a7 as Xe,a8 as Ga,M as me,a9 as wt,k as B,aa as La,ab as Ca,ac as K,g as Ie,ad as Sa,ae as Na,af as Ma,ag as $a,ah as Ua,ai as Fa,N as Va,aj as Lt,ak as Ct,al as St,am as _a,t as J,X as Nt,an as ka,ao as Ba,ap as Ha,aq as za,r as ja,ar as Ka,f as Xa,as as Wa,at as Ya,y as We,C as Ye,z as ae,E as qe,au as qa,Y as Za,J as ta,s as Ja,av as Qa,h as en,l as tn,v as an,L as nn}from"./index-C4xokDO6.js";import{f as rn,C as ye,V as H,O as sn,d as Mt,s as aa,E as na,a as ra,K as sa,g as on,h as pn}from"./constants-DBcQLFY6.js";function un(e){const{source:t}=e,a=new Map,n=new va(8192),r=new Map,p=({address:i,chainId:u})=>`${i}.${u}`;return{async consume({address:i,chainId:u,client:s}){const y=p({address:i,chainId:u}),o=this.get({address:i,chainId:u,client:s});this.increment({address:i,chainId:u});const m=await o;return await t.set({address:i,chainId:u},m),n.set(y,m),m},async increment({address:i,chainId:u}){const s=p({address:i,chainId:u}),y=a.get(s)??0;a.set(s,y+1)},async get({address:i,chainId:u,client:s}){const y=p({address:i,chainId:u});let o=r.get(y);return o||(o=(async()=>{try{const w=await t.get({address:i,chainId:u,client:s}),A=n.get(y)??0;return A>0&&w<=A?A+1:(n.delete(y),w)}finally{this.reset({address:i,chainId:u})}})(),r.set(y,o)),(a.get(y)??0)+await o},reset({address:i,chainId:u}){const s=p({address:i,chainId:u});a.delete(s),r.delete(s)}}}const yn="0x6492649264926492649264926492649264926492649264926492649264926492";function Ve(e){const{address:t,data:a,signature:n,to:r="hex"}=e,p=Y([ee([{type:"address"},{type:"bytes"},{type:"bytes"}],[t,a,n]),yn]);return r==="hex"?p:wa(p)}function ln(e){const{r:t,s:a}=Ia.Signature.fromCompact(e.slice(2,130)),n=+`0x${e.slice(130)}`,[r,p]=(()=>{if(n===0||n===1)return[void 0,n];if(n===27)return[BigInt(n),0];if(n===28)return[BigInt(n),1];throw new Error("Invalid yParityOrV value")})();return typeof r<"u"?{r:N(t,{size:32}),s:N(a,{size:32}),v:r,yParity:p}:{r:N(t,{size:32}),s:N(a,{size:32}),yParity:p}}var Ze={exports:{}};const dn="2.0.0",ia=256,cn=Number.MAX_SAFE_INTEGER||9007199254740991,mn=16,fn=ia-6,bn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];var Ne={MAX_LENGTH:ia,MAX_SAFE_COMPONENT_LENGTH:mn,MAX_SAFE_BUILD_LENGTH:fn,MAX_SAFE_INTEGER:cn,RELEASE_TYPES:bn,SEMVER_SPEC_VERSION:dn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},_e={};const gn=typeof xa=="object"&&_e&&_e.NODE_DEBUG&&/\bsemver\b/i.test(_e.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};var Me=gn;(function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:a,MAX_SAFE_BUILD_LENGTH:n,MAX_LENGTH:r}=Ne,p=Me;t=e.exports={};const i=t.re=[],u=t.safeRe=[],s=t.src=[],y=t.safeSrc=[],o=t.t={};let m=0;const w="[a-zA-Z0-9-]",A=[["\\s",1],["\\d",r],[w,n]],d=b=>{for(const[P,L]of A)b=b.split(`${P}*`).join(`${P}{0,${L}}`).split(`${P}+`).join(`${P}{1,${L}}`);return b},l=(b,P,L)=>{const R=d(P),F=m++;p(b,F,P),o[b]=F,s[F]=P,y[F]=R,i[F]=new RegExp(P,L?"g":void 0),u[F]=new RegExp(R,L?"g":void 0)};l("NUMERICIDENTIFIER","0|[1-9]\\d*"),l("NUMERICIDENTIFIERLOOSE","\\d+"),l("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${w}*`),l("MAINVERSION",`(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})\\.(${s[o.NUMERICIDENTIFIER]})`),l("MAINVERSIONLOOSE",`(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})\\.(${s[o.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASEIDENTIFIER",`(?:${s[o.NONNUMERICIDENTIFIER]}|${s[o.NUMERICIDENTIFIER]})`),l("PRERELEASEIDENTIFIERLOOSE",`(?:${s[o.NONNUMERICIDENTIFIER]}|${s[o.NUMERICIDENTIFIERLOOSE]})`),l("PRERELEASE",`(?:-(${s[o.PRERELEASEIDENTIFIER]}(?:\\.${s[o.PRERELEASEIDENTIFIER]})*))`),l("PRERELEASELOOSE",`(?:-?(${s[o.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${s[o.PRERELEASEIDENTIFIERLOOSE]})*))`),l("BUILDIDENTIFIER",`${w}+`),l("BUILD",`(?:\\+(${s[o.BUILDIDENTIFIER]}(?:\\.${s[o.BUILDIDENTIFIER]})*))`),l("FULLPLAIN",`v?${s[o.MAINVERSION]}${s[o.PRERELEASE]}?${s[o.BUILD]}?`),l("FULL",`^${s[o.FULLPLAIN]}$`),l("LOOSEPLAIN",`[v=\\s]*${s[o.MAINVERSIONLOOSE]}${s[o.PRERELEASELOOSE]}?${s[o.BUILD]}?`),l("LOOSE",`^${s[o.LOOSEPLAIN]}$`),l("GTLT","((?:<|>)?=?)"),l("XRANGEIDENTIFIERLOOSE",`${s[o.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),l("XRANGEIDENTIFIER",`${s[o.NUMERICIDENTIFIER]}|x|X|\\*`),l("XRANGEPLAIN",`[v=\\s]*(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:\\.(${s[o.XRANGEIDENTIFIER]})(?:${s[o.PRERELEASE]})?${s[o.BUILD]}?)?)?`),l("XRANGEPLAINLOOSE",`[v=\\s]*(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:\\.(${s[o.XRANGEIDENTIFIERLOOSE]})(?:${s[o.PRERELEASELOOSE]})?${s[o.BUILD]}?)?)?`),l("XRANGE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAIN]}$`),l("XRANGELOOSE",`^${s[o.GTLT]}\\s*${s[o.XRANGEPLAINLOOSE]}$`),l("COERCEPLAIN",`(^|[^\\d])(\\d{1,${a}})(?:\\.(\\d{1,${a}}))?(?:\\.(\\d{1,${a}}))?`),l("COERCE",`${s[o.COERCEPLAIN]}(?:$|[^\\d])`),l("COERCEFULL",s[o.COERCEPLAIN]+`(?:${s[o.PRERELEASE]})?(?:${s[o.BUILD]})?(?:$|[^\\d])`),l("COERCERTL",s[o.COERCE],!0),l("COERCERTLFULL",s[o.COERCEFULL],!0),l("LONETILDE","(?:~>?)"),l("TILDETRIM",`(\\s*)${s[o.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",l("TILDE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAIN]}$`),l("TILDELOOSE",`^${s[o.LONETILDE]}${s[o.XRANGEPLAINLOOSE]}$`),l("LONECARET","(?:\\^)"),l("CARETTRIM",`(\\s*)${s[o.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",l("CARET",`^${s[o.LONECARET]}${s[o.XRANGEPLAIN]}$`),l("CARETLOOSE",`^${s[o.LONECARET]}${s[o.XRANGEPLAINLOOSE]}$`),l("COMPARATORLOOSE",`^${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]})$|^$`),l("COMPARATOR",`^${s[o.GTLT]}\\s*(${s[o.FULLPLAIN]})$|^$`),l("COMPARATORTRIM",`(\\s*)${s[o.GTLT]}\\s*(${s[o.LOOSEPLAIN]}|${s[o.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",l("HYPHENRANGE",`^\\s*(${s[o.XRANGEPLAIN]})\\s+-\\s+(${s[o.XRANGEPLAIN]})\\s*$`),l("HYPHENRANGELOOSE",`^\\s*(${s[o.XRANGEPLAINLOOSE]})\\s+-\\s+(${s[o.XRANGEPLAINLOOSE]})\\s*$`),l("STAR","(<|>)?=?\\s*\\*"),l("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),l("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")})(Ze,Ze.exports);var fe=Ze.exports;const hn=Object.freeze({loose:!0}),Tn=Object.freeze({}),En=e=>e?typeof e!="object"?hn:e:Tn;var It=En;const $t=/^[0-9]+$/,oa=(e,t)=>{if(typeof e=="number"&&typeof t=="number")return e===t?0:eoa(t,e);var pa={compareIdentifiers:oa,rcompareIdentifiers:vn};const ge=Me,{MAX_LENGTH:Ut,MAX_SAFE_INTEGER:he}=Ne,{safeRe:Te,t:Ee}=fe,wn=It,{compareIdentifiers:ke}=pa;let In=class Z{constructor(t,a){if(a=wn(a),t instanceof Z){if(t.loose===!!a.loose&&t.includePrerelease===!!a.includePrerelease)return t;t=t.version}else if(typeof t!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>Ut)throw new TypeError(`version is longer than ${Ut} characters`);ge("SemVer",t,a),this.options=a,this.loose=!!a.loose,this.includePrerelease=!!a.includePrerelease;const n=t.trim().match(a.loose?Te[Ee.LOOSE]:Te[Ee.FULL]);if(!n)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>he||this.major<0)throw new TypeError("Invalid major version");if(this.minor>he||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>he||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(r=>{if(/^[0-9]+$/.test(r)){const p=+r;if(p>=0&&pt.major?1:this.minort.minor?1:this.patcht.patch?1:0}comparePre(t){if(t instanceof Z||(t=new Z(t,this.options)),this.prerelease.length&&!t.prerelease.length)return-1;if(!this.prerelease.length&&t.prerelease.length)return 1;if(!this.prerelease.length&&!t.prerelease.length)return 0;let a=0;do{const n=this.prerelease[a],r=t.prerelease[a];if(ge("prerelease compare",a,n,r),n===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(n===void 0)return-1;if(n===r)continue;return ke(n,r)}while(++a)}compareBuild(t){t instanceof Z||(t=new Z(t,this.options));let a=0;do{const n=this.build[a],r=t.build[a];if(ge("build compare",a,n,r),n===void 0&&r===void 0)return 0;if(r===void 0)return 1;if(n===void 0)return-1;if(n===r)continue;return ke(n,r)}while(++a)}inc(t,a,n){if(t.startsWith("pre")){if(!a&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(a){const r=`-${a}`.match(this.options.loose?Te[Ee.PRERELEASELOOSE]:Te[Ee.PRERELEASE]);if(!r||r[1]!==a)throw new Error(`invalid identifier: ${a}`)}}switch(t){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",a,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",a,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",a,n),this.inc("pre",a,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",a,n),this.inc("pre",a,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{const r=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[r];else{let p=this.prerelease.length;for(;--p>=0;)typeof this.prerelease[p]=="number"&&(this.prerelease[p]++,p=-2);if(p===-1){if(a===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(r)}}if(a){let p=[a,r];n===!1&&(p=[a]),ke(this.prerelease[0],a)===0?isNaN(this.prerelease[1])&&(this.prerelease=p):this.prerelease=p}break}default:throw new Error(`invalid increment argument: ${t}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};var xt=In;const Ft=xt,xn=(e,t,a)=>new Ft(e,a).compare(new Ft(t,a));var le=xn;const On=le,Pn=(e,t,a)=>On(e,t,a)>0;var An=Pn;const Dn=le,Rn=(e,t,a)=>Dn(e,t,a)<0;var Gn=Rn;const Ln=le,Cn=(e,t,a)=>Ln(e,t,a)===0;var Sn=Cn;const Nn=le,Mn=(e,t,a)=>Nn(e,t,a)!==0;var $n=Mn;const Un=le,Fn=(e,t,a)=>Un(e,t,a)>=0;var Vn=Fn;const _n=le,kn=(e,t,a)=>_n(e,t,a)<=0;var Bn=kn;const Hn=Sn,zn=$n,jn=An,Kn=Vn,Xn=Gn,Wn=Bn,Yn=(e,t,a,n)=>{switch(t){case"===":return typeof e=="object"&&(e=e.version),typeof a=="object"&&(a=a.version),e===a;case"!==":return typeof e=="object"&&(e=e.version),typeof a=="object"&&(a=a.version),e!==a;case"":case"=":case"==":return Hn(e,a,n);case"!=":return zn(e,a,n);case">":return jn(e,a,n);case">=":return Kn(e,a,n);case"<":return Xn(e,a,n);case"<=":return Wn(e,a,n);default:throw new TypeError(`Invalid operator: ${t}`)}};var qn=Yn;const{safeRe:ts,t:as}=fe;class Zn{constructor(){this.max=1e3,this.map=new Map}get(t){const a=this.map.get(t);if(a!==void 0)return this.map.delete(t),this.map.set(t,a),a}delete(t){return this.map.delete(t)}set(t,a){if(!this.delete(t)&&a!==void 0){if(this.map.size>=this.max){const r=this.map.keys().next().value;this.delete(r)}this.map.set(t,a)}return this}}var Jn=Zn,Be,Vt;function q(){if(Vt)return Be;Vt=1;const e=/\s+/g;class t{constructor(c,E){if(E=r(E),c instanceof t)return c.loose===!!E.loose&&c.includePrerelease===!!E.includePrerelease?c:new t(c.raw,E);if(c instanceof p)return this.raw=c.value,this.set=[[c]],this.formatted=void 0,this;if(this.options=E,this.loose=!!E.loose,this.includePrerelease=!!E.includePrerelease,this.raw=c.trim().replace(e," "),this.set=this.raw.split("||").map(g=>this.parseRange(g.trim())).filter(g=>g.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const g=this.set[0];if(this.set=this.set.filter(v=>!l(v[0])),this.set.length===0)this.set=[g];else if(this.set.length>1){for(const v of this.set)if(v.length===1&&b(v[0])){this.set=[v];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let c=0;c0&&(this.formatted+="||");const E=this.set[c];for(let g=0;g0&&(this.formatted+=" "),this.formatted+=E[g].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(c){const g=((this.options.includePrerelease&&A)|(this.options.loose&&d))+":"+c,v=n.get(g);if(v)return v;const h=this.options.loose,O=h?s[y.HYPHENRANGELOOSE]:s[y.HYPHENRANGE];c=c.replace(O,Fe(this.options.includePrerelease)),i("hyphen replace",c),c=c.replace(s[y.COMPARATORTRIM],o),i("comparator trim",c),c=c.replace(s[y.TILDETRIM],m),i("tilde trim",c),c=c.replace(s[y.CARETTRIM],w),i("caret trim",c);let C=c.split(" ").map(k=>L(k,this.options)).join(" ").split(/\s+/).map(k=>X(k,this.options));h&&(C=C.filter(k=>(i("loose invalid filter",k,this.options),!!k.match(s[y.COMPARATORLOOSE])))),i("range list",C);const D=new Map,U=C.map(k=>new p(k,this.options));for(const k of U){if(l(k))return[k];D.set(k.value,k)}D.size>1&&D.has("")&&D.delete("");const j=[...D.values()];return n.set(g,j),j}intersects(c,E){if(!(c instanceof t))throw new TypeError("a Range is required");return this.set.some(g=>P(g,E)&&c.set.some(v=>P(v,E)&&g.every(h=>v.every(O=>h.intersects(O,E)))))}test(c){if(!c)return!1;if(typeof c=="string")try{c=new u(c,this.options)}catch{return!1}for(let E=0;Ef.value==="<0.0.0-0",b=f=>f.value==="",P=(f,c)=>{let E=!0;const g=f.slice();let v=g.pop();for(;E&&g.length;)E=g.every(h=>v.intersects(h,c)),v=g.pop();return E},L=(f,c)=>(f=f.replace(s[y.BUILD],""),i("comp",f,c),f=S(f,c),i("caret",f),f=F(f,c),i("tildes",f),f=_(f,c),i("xrange",f),f=G(f,c),i("stars",f),f),R=f=>!f||f.toLowerCase()==="x"||f==="*",F=(f,c)=>f.trim().split(/\s+/).map(E=>T(E,c)).join(" "),T=(f,c)=>{const E=c.loose?s[y.TILDELOOSE]:s[y.TILDE];return f.replace(E,(g,v,h,O,C)=>{i("tilde",f,g,v,h,O,C);let D;return R(v)?D="":R(h)?D=`>=${v}.0.0 <${+v+1}.0.0-0`:R(O)?D=`>=${v}.${h}.0 <${v}.${+h+1}.0-0`:C?(i("replaceTilde pr",C),D=`>=${v}.${h}.${O}-${C} <${v}.${+h+1}.0-0`):D=`>=${v}.${h}.${O} <${v}.${+h+1}.0-0`,i("tilde return",D),D})},S=(f,c)=>f.trim().split(/\s+/).map(E=>V(E,c)).join(" "),V=(f,c)=>{i("caret",f,c);const E=c.loose?s[y.CARETLOOSE]:s[y.CARET],g=c.includePrerelease?"-0":"";return f.replace(E,(v,h,O,C,D)=>{i("caret",f,v,h,O,C,D);let U;return R(h)?U="":R(O)?U=`>=${h}.0.0${g} <${+h+1}.0.0-0`:R(C)?h==="0"?U=`>=${h}.${O}.0${g} <${h}.${+O+1}.0-0`:U=`>=${h}.${O}.0${g} <${+h+1}.0.0-0`:D?(i("replaceCaret pr",D),h==="0"?O==="0"?U=`>=${h}.${O}.${C}-${D} <${h}.${O}.${+C+1}-0`:U=`>=${h}.${O}.${C}-${D} <${h}.${+O+1}.0-0`:U=`>=${h}.${O}.${C}-${D} <${+h+1}.0.0-0`):(i("no pr"),h==="0"?O==="0"?U=`>=${h}.${O}.${C}${g} <${h}.${O}.${+C+1}-0`:U=`>=${h}.${O}.${C}${g} <${h}.${+O+1}.0-0`:U=`>=${h}.${O}.${C} <${+h+1}.0.0-0`),i("caret return",U),U})},_=(f,c)=>(i("replaceXRanges",f,c),f.split(/\s+/).map(E=>x(E,c)).join(" ")),x=(f,c)=>{f=f.trim();const E=c.loose?s[y.XRANGELOOSE]:s[y.XRANGE];return f.replace(E,(g,v,h,O,C,D)=>{i("xRange",f,g,v,h,O,C,D);const U=R(h),j=U||R(O),k=j||R(C),ce=k;return v==="="&&ce&&(v=""),D=c.includePrerelease?"-0":"",U?v===">"||v==="<"?g="<0.0.0-0":g="*":v&&ce?(j&&(O=0),C=0,v===">"?(v=">=",j?(h=+h+1,O=0,C=0):(O=+O+1,C=0)):v==="<="&&(v="<",j?h=+h+1:O=+O+1),v==="<"&&(D="-0"),g=`${v+h}.${O}.${C}${D}`):j?g=`>=${h}.0.0${D} <${+h+1}.0.0-0`:k&&(g=`>=${h}.${O}.0${D} <${h}.${+O+1}.0-0`),i("xRange return",g),g})},G=(f,c)=>(i("replaceStars",f,c),f.trim().replace(s[y.STAR],"")),X=(f,c)=>(i("replaceGTE0",f,c),f.trim().replace(s[c.includePrerelease?y.GTE0PRE:y.GTE0],"")),Fe=f=>(c,E,g,v,h,O,C,D,U,j,k,ce)=>(R(g)?E="":R(v)?E=`>=${g}.0.0${f?"-0":""}`:R(h)?E=`>=${g}.${v}.0${f?"-0":""}`:O?E=`>=${E}`:E=`>=${E}${f?"-0":""}`,R(U)?D="":R(j)?D=`<${+U+1}.0.0-0`:R(k)?D=`<${U}.${+j+1}.0-0`:ce?D=`<=${U}.${j}.${k}-${ce}`:f?D=`<${U}.${j}.${+k+1}-0`:D=`<=${D}`,`${E} ${D}`.trim()),be=(f,c,E)=>{for(let g=0;g0){const v=f[g].semver;if(v.major===c.major&&v.minor===c.minor&&v.patch===c.patch)return!0}return!1}return!0};return Be}var He,_t;function $e(){if(_t)return He;_t=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(o,m){if(m=a(m),o instanceof t){if(o.loose===!!m.loose)return o;o=o.value}o=o.trim().split(/\s+/).join(" "),i("comparator",o,m),this.options=m,this.loose=!!m.loose,this.parse(o),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(o){const m=this.options.loose?n[r.COMPARATORLOOSE]:n[r.COMPARATOR],w=o.match(m);if(!w)throw new TypeError(`Invalid comparator: ${o}`);this.operator=w[1]!==void 0?w[1]:"",this.operator==="="&&(this.operator=""),w[2]?this.semver=new u(w[2],this.options.loose):this.semver=e}toString(){return this.value}test(o){if(i("Comparator.test",o,this.options.loose),this.semver===e||o===e)return!0;if(typeof o=="string")try{o=new u(o,this.options)}catch{return!1}return p(o,this.operator,this.semver,this.options)}intersects(o,m){if(!(o instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new s(o.value,m).test(this.value):o.operator===""?o.value===""?!0:new s(this.value,m).test(o.semver):(m=a(m),m.includePrerelease&&(this.value==="<0.0.0-0"||o.value==="<0.0.0-0")||!m.includePrerelease&&(this.value.startsWith("<0.0.0")||o.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&o.operator.startsWith(">")||this.operator.startsWith("<")&&o.operator.startsWith("<")||this.semver.version===o.semver.version&&this.operator.includes("=")&&o.operator.includes("=")||p(this.semver,"<",o.semver,m)&&this.operator.startsWith(">")&&o.operator.startsWith("<")||p(this.semver,">",o.semver,m)&&this.operator.startsWith("<")&&o.operator.startsWith(">")))}}He=t;const a=It,{safeRe:n,t:r}=fe,p=qn,i=Me,u=xt,s=q();return He}const Qn=q(),er=(e,t,a)=>{try{t=new Qn(t,a)}catch{return!1}return t.test(e)};var tr=er;q();q();q();q();q();const ar=$e(),{ANY:ns}=ar;q();q();q();const Ot=$e(),{ANY:rs}=Ot;new Ot(">=0.0.0-0");new Ot(">=0.0.0");const ze=fe,kt=Ne,Bt=pa;$e();q();const nr=tr;var ie={satisfies:nr,re:ze.re,src:ze.src,tokens:ze.t,SEMVER_SPEC_VERSION:kt.SEMVER_SPEC_VERSION,RELEASE_TYPES:kt.RELEASE_TYPES,compareIdentifiers:Bt.compareIdentifiers,rcompareIdentifiers:Bt.rcompareIdentifiers};const ss=[{inputs:[{name:"preOpGas",type:"uint256"},{name:"paid",type:"uint256"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"targetSuccess",type:"bool"},{name:"targetResult",type:"bytes"}],name:"ExecutionResult",type:"error"},{inputs:[{name:"opIndex",type:"uint256"},{name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{inputs:[{components:[{name:"preOpGas",type:"uint256"},{name:"prefund",type:"uint256"},{name:"sigFailed",type:"bool"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"paymasterContext",type:"bytes"}],name:"returnInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"senderInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"factoryInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"paymasterInfo",type:"tuple"}],name:"ValidationResult",type:"error"},{inputs:[{components:[{name:"preOpGas",type:"uint256"},{name:"prefund",type:"uint256"},{name:"sigFailed",type:"bool"},{name:"validAfter",type:"uint48"},{name:"validUntil",type:"uint48"},{name:"paymasterContext",type:"bytes"}],name:"returnInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"senderInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"factoryInfo",type:"tuple"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"paymasterInfo",type:"tuple"},{components:[{name:"aggregator",type:"address"},{components:[{name:"stake",type:"uint256"},{name:"unstakeDelaySec",type:"uint256"}],name:"stakeInfo",type:"tuple"}],name:"aggregatorInfo",type:"tuple"}],name:"ValidationResultWithAggregation",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"factory",type:"address"},{indexed:!1,name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalStaked",type:"uint256"},{indexed:!1,name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"paymaster",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"success",type:"bool"},{indexed:!1,name:"actualGasCost",type:"uint256"},{indexed:!1,name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[],name:"SIG_VALIDATION_FAILED",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"},{name:"sender",type:"address"},{name:"paymasterAndData",type:"bytes"}],name:"_validateSenderAndPaymaster",outputs:[],stateMutability:"view",type:"function"},{inputs:[{name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"",type:"address"}],name:"deposits",outputs:[{name:"deposit",type:"uint112"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{name:"deposit",type:"uint112"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{name:"sender",type:"address"},{name:"key",type:"uint192"}],name:"getNonce",outputs:[{name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOps",type:"tuple[]"},{name:"aggregator",type:"address"},{name:"signature",type:"bytes"}],name:"opsPerAggregator",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"ops",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"callData",type:"bytes"},{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"paymaster",type:"address"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"}],name:"mUserOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"prefund",type:"uint256"},{name:"contextOffset",type:"uint256"},{name:"preOpGas",type:"uint256"}],name:"opInfo",type:"tuple"},{name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"",type:"address"},{name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"op",type:"tuple"},{name:"target",type:"address"},{name:"targetCallData",type:"bytes"}],name:"simulateHandleOp",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"callGasLimit",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"simulateValidation",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"},{name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}],is=[{inputs:[{name:"success",type:"bool"},{name:"ret",type:"bytes"}],name:"DelegateAndRevert",type:"error"},{inputs:[{name:"opIndex",type:"uint256"},{name:"reason",type:"string"}],name:"FailedOp",type:"error"},{inputs:[{name:"opIndex",type:"uint256"},{name:"reason",type:"string"},{name:"inner",type:"bytes"}],name:"FailedOpWithRevert",type:"error"},{inputs:[{name:"returnData",type:"bytes"}],name:"PostOpReverted",type:"error"},{inputs:[],name:"ReentrancyGuardReentrantCall",type:"error"},{inputs:[{name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{name:"aggregator",type:"address"}],name:"SignatureValidationFailed",type:"error"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"factory",type:"address"},{indexed:!1,name:"paymaster",type:"address"}],name:"AccountDeployed",type:"event"},{anonymous:!1,inputs:[],name:"BeforeExecution",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalDeposit",type:"uint256"}],name:"Deposited",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"revertReason",type:"bytes"}],name:"PostOpRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"aggregator",type:"address"}],name:"SignatureAggregatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"totalStaked",type:"uint256"},{indexed:!1,name:"unstakeDelaySec",type:"uint256"}],name:"StakeLocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawTime",type:"uint256"}],name:"StakeUnlocked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"StakeWithdrawn",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!0,name:"paymaster",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"success",type:"bool"},{indexed:!1,name:"actualGasCost",type:"uint256"},{indexed:!1,name:"actualGasUsed",type:"uint256"}],name:"UserOperationEvent",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"}],name:"UserOperationPrefundTooLow",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"userOpHash",type:"bytes32"},{indexed:!0,name:"sender",type:"address"},{indexed:!1,name:"nonce",type:"uint256"},{indexed:!1,name:"revertReason",type:"bytes"}],name:"UserOperationRevertReason",type:"event"},{anonymous:!1,inputs:[{indexed:!0,name:"account",type:"address"},{indexed:!1,name:"withdrawAddress",type:"address"},{indexed:!1,name:"amount",type:"uint256"}],name:"Withdrawn",type:"event"},{inputs:[{name:"unstakeDelaySec",type:"uint32"}],name:"addStake",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"balanceOf",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"target",type:"address"},{name:"data",type:"bytes"}],name:"delegateAndRevert",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"account",type:"address"}],name:"depositTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{name:"",type:"address"}],name:"deposits",outputs:[{name:"deposit",type:"uint256"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{name:"account",type:"address"}],name:"getDepositInfo",outputs:[{components:[{name:"deposit",type:"uint256"},{name:"staked",type:"bool"},{name:"stake",type:"uint112"},{name:"unstakeDelaySec",type:"uint32"},{name:"withdrawTime",type:"uint48"}],name:"info",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[{name:"sender",type:"address"},{name:"key",type:"uint192"}],name:"getNonce",outputs:[{name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOp",type:"tuple"}],name:"getUserOpHash",outputs:[{name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"userOps",type:"tuple[]"},{name:"aggregator",type:"address"},{name:"signature",type:"bytes"}],name:"opsPerAggregator",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleAggregatedOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"initCode",type:"bytes"},{name:"callData",type:"bytes"},{name:"accountGasLimits",type:"bytes32"},{name:"preVerificationGas",type:"uint256"},{name:"gasFees",type:"bytes32"},{name:"paymasterAndData",type:"bytes"},{name:"signature",type:"bytes"}],name:"ops",type:"tuple[]"},{name:"beneficiary",type:"address"}],name:"handleOps",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"key",type:"uint192"}],name:"incrementNonce",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"callData",type:"bytes"},{components:[{components:[{name:"sender",type:"address"},{name:"nonce",type:"uint256"},{name:"verificationGasLimit",type:"uint256"},{name:"callGasLimit",type:"uint256"},{name:"paymasterVerificationGasLimit",type:"uint256"},{name:"paymasterPostOpGasLimit",type:"uint256"},{name:"preVerificationGas",type:"uint256"},{name:"paymaster",type:"address"},{name:"maxFeePerGas",type:"uint256"},{name:"maxPriorityFeePerGas",type:"uint256"}],name:"mUserOp",type:"tuple"},{name:"userOpHash",type:"bytes32"},{name:"prefund",type:"uint256"},{name:"contextOffset",type:"uint256"},{name:"preOpGas",type:"uint256"}],name:"opInfo",type:"tuple"},{name:"context",type:"bytes"}],name:"innerHandleOp",outputs:[{name:"actualGasCost",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"",type:"address"},{name:"",type:"uint192"}],name:"nonceSequenceNumber",outputs:[{name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"unlockStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"}],name:"withdrawStake",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{name:"withdrawAddress",type:"address"},{name:"withdrawAmount",type:"uint256"}],name:"withdrawTo",outputs:[],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];function ua(e,t={}){const{forHash:a}=t,{authorization:n,factory:r,factoryData:p}=e;return a&&(r==="0x7702"||r==="0x7702000000000000000000000000000000000000")?n?z([n.address,p??"0x"]):"0x7702000000000000000000000000000000000000":r?z([r,p??"0x"]):"0x"}const Ht="0x22e325a297439656";function ya(e,t={}){const{callGasLimit:a,callData:n,maxPriorityFeePerGas:r,maxFeePerGas:p,paymaster:i,paymasterData:u,paymasterPostOpGasLimit:s,paymasterSignature:y,paymasterVerificationGasLimit:o,sender:m,signature:w="0x",verificationGasLimit:A}=e,d=z([M(N(A||0n),{size:16}),M(N(a||0n),{size:16})]),l=ua(e,t),b=z([M(N(r||0n),{size:16}),M(N(p||0n),{size:16})]),P=e.nonce??0n,L=i?z([i,M(N(o||0n),{size:16}),M(N(s||0n),{size:16}),u||"0x",...y?t.forHash?[Ht]:[y,M(N(Oa(y)),{size:2}),Ht]:[]]):"0x",R=e.preVerificationGas??0n;return{accountGasLimits:d,callData:n,initCode:l,gasFees:b,nonce:P,paymasterAndData:L,preVerificationGas:R,sender:m,signature:w}}const rr={PackedUserOperation:[{type:"address",name:"sender"},{type:"uint256",name:"nonce"},{type:"bytes",name:"initCode"},{type:"bytes",name:"callData"},{type:"bytes32",name:"accountGasLimits"},{type:"uint256",name:"preVerificationGas"},{type:"bytes32",name:"gasFees"},{type:"bytes",name:"paymasterAndData"}]};function sr(e){const{chainId:t,entryPointAddress:a,userOperation:n}=e,r=ya(n,{forHash:!0});return{types:rr,primaryType:"PackedUserOperation",domain:{name:"ERC4337",version:"1",chainId:t,verifyingContract:a},message:r}}function os(e){const{chainId:t,entryPointAddress:a,entryPointVersion:n}=e,r=e.userOperation,{authorization:p,callData:i="0x",callGasLimit:u,maxFeePerGas:s,maxPriorityFeePerGas:y,nonce:o,paymasterAndData:m="0x",preVerificationGas:w,sender:A,verificationGasLimit:d}=r;if(n==="0.8"||n==="0.9")return Pa(sr({chainId:t,entryPointAddress:a,userOperation:r}));const l=(()=>{var b,P;if(n==="0.6"){const L=(b=r.initCode)==null?void 0:b.slice(0,42),R=(P=r.initCode)==null?void 0:P.slice(42),F=ua({authorization:p,factory:L,factoryData:R},{forHash:!0});return ee([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"uint256"},{type:"bytes32"}],[A,o,W(F),W(i),u,d,w,s,y,W(m)])}if(n==="0.7"){const L=ya(r,{forHash:!0});return ee([{type:"address"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"},{type:"bytes32"},{type:"uint256"},{type:"bytes32"},{type:"bytes32"}],[L.sender,L.nonce,W(L.initCode),W(L.callData),L.accountGasLimits,L.preVerificationGas,L.gasFees,W(L.paymasterAndData)])}throw new Error(`entryPointVersion "${n}" not supported.`)})();return W(ee([{type:"bytes32"},{type:"address"},{type:"uint256"}],[W(l),a,BigInt(t)]))}async function ps(e){const{extend:t,nonceKeyManager:a=un({source:{get(){return Date.now()},set(){}}}),...n}=e;let r=!1;const p=await e.getAddress();return{...t,...n,address:p,async getFactoryArgs(){return"isDeployed"in this&&await this.isDeployed()?{factory:void 0,factoryData:void 0}:e.getFactoryArgs()},async getNonce(i){const u=(i==null?void 0:i.key)??BigInt(await a.consume({address:p,chainId:e.client.chain.id,client:e.client}));return e.getNonce?await e.getNonce({...i,key:u}):await ue(e.client,{abi:ea(["function getNonce(address, uint192) pure returns (uint256)"]),address:e.entryPoint.address,functionName:"getNonce",args:[p,u]})},async isDeployed(){return r?!0:(r=!!await $(e.client,Aa,"getCode")({address:p}),r)},...e.sign?{async sign(i){const[{factory:u,factoryData:s},y]=await Promise.all([this.getFactoryArgs(),e.sign(i)]);return u&&s?Ve({address:u,data:s,signature:y}):y}}:{},async signMessage(i){const[{factory:u,factoryData:s},y]=await Promise.all([this.getFactoryArgs(),e.signMessage(i)]);return u&&s&&u!=="0x7702"?Ve({address:u,data:s,signature:y}):y},async signTypedData(i){const[{factory:u,factoryData:s},y]=await Promise.all([this.getFactoryArgs(),e.signTypedData(i)]);return u&&s&&u!=="0x7702"?Ve({address:u,data:s,signature:y}):y},type:"smart"}}function ir(e){if(typeof e=="string"){if(!Dt(e,{strict:!1}))throw new Rt({address:e});return{address:e,type:"json-rpc"}}if(!Dt(e.address,{strict:!1}))throw new Rt({address:e.address});return{address:e.address,nonceManager:e.nonceManager,sign:e.sign,signAuthorization:e.signAuthorization,signMessage:e.signMessage,signTransaction:e.signTransaction,signTypedData:e.signTypedData,source:"custom",type:"local"}}class Je extends I{constructor({cause:t}){super("Smart Account is not deployed.",{cause:t,metaMessages:["This could arise when:","- No `factory`/`factoryData` or `initCode` properties are provided for Smart Account deployment.","- An incorrect `sender` address is provided."],name:"AccountNotDeployedError"})}}Object.defineProperty(Je,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa20/});class oe extends I{constructor({cause:t,data:a,message:n}={}){var p;const r=(p=n==null?void 0:n.replace("execution reverted: ",""))==null?void 0:p.replace("execution reverted","");super(`Execution reverted ${r?`with reason: ${r}`:"for an unknown reason"}.`,{cause:t,name:"ExecutionRevertedError"}),Object.defineProperty(this,"data",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.data=a}}Object.defineProperty(oe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32521});Object.defineProperty(oe,"message",{enumerable:!0,configurable:!0,writable:!0,value:/execution reverted/});class Qe extends I{constructor({cause:t}){super("Failed to send funds to beneficiary.",{cause:t,name:"FailedToSendToBeneficiaryError"})}}Object.defineProperty(Qe,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa91/});class et extends I{constructor({cause:t}){super("Gas value overflowed.",{cause:t,metaMessages:["This could arise when:","- one of the gas values exceeded 2**120 (uint120)"].filter(Boolean),name:"GasValuesOverflowError"})}}Object.defineProperty(et,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa94/});class tt extends I{constructor({cause:t}){super("The `handleOps` function was called by the Bundler with a gas limit too low.",{cause:t,name:"HandleOpsOutOfGasError"})}}Object.defineProperty(tt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa95/});class at extends I{constructor({cause:t,factory:a,factoryData:n,initCode:r}){super("Failed to simulate deployment for Smart Account.",{cause:t,metaMessages:["This could arise when:","- Invalid `factory`/`factoryData` or `initCode` properties are present","- Smart Account deployment execution ran out of gas (low `verificationGasLimit` value)",`- Smart Account deployment execution reverted with an error `,a&&`factory: ${a}`,n&&`factoryData: ${n}`,r&&`initCode: ${r}`].filter(Boolean),name:"InitCodeFailedError"})}}Object.defineProperty(at,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa13/});class nt extends I{constructor({cause:t,factory:a,factoryData:n,initCode:r}){super("Smart Account initialization implementation did not create an account.",{cause:t,metaMessages:["This could arise when:","- `factory`/`factoryData` or `initCode` properties are invalid",`- Smart Account initialization implementation is incorrect `,a&&`factory: ${a}`,n&&`factoryData: ${n}`,r&&`initCode: ${r}`].filter(Boolean),name:"InitCodeMustCreateSenderError"})}}Object.defineProperty(nt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa15/});class rt extends I{constructor({cause:t,factory:a,factoryData:n,initCode:r,sender:p}){super("Smart Account initialization implementation does not return the expected sender.",{cause:t,metaMessages:["This could arise when:",`Smart Account initialization implementation does not return a sender address -`,a&&`factory: ${a}`,n&&`factoryData: ${n}`,r&&`initCode: ${r}`,p&&`sender: ${p}`].filter(Boolean),name:"InitCodeMustReturnSenderError"})}}Object.defineProperty(rt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa14/});class st extends I{constructor({cause:t}){super("Smart Account does not have sufficient funds to execute the User Operation.",{cause:t,metaMessages:["This could arise when:","- the Smart Account does not have sufficient funds to cover the required prefund, or","- a Paymaster was not provided"].filter(Boolean),name:"InsufficientPrefundError"})}}Object.defineProperty(st,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa21/});class it extends I{constructor({cause:t}){super("Bundler attempted to call an invalid function on the EntryPoint.",{cause:t,name:"InternalCallOnlyError"})}}Object.defineProperty(it,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa92/});class ot extends I{constructor({cause:t}){super("Bundler used an invalid aggregator for handling aggregated User Operations.",{cause:t,name:"InvalidAggregatorError"})}}Object.defineProperty(ot,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa96/});class pt extends I{constructor({cause:t,nonce:a}){super("Invalid Smart Account nonce used for User Operation.",{cause:t,metaMessages:[a&&`nonce: ${a}`].filter(Boolean),name:"InvalidAccountNonceError"})}}Object.defineProperty(pt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa25/});class ut extends I{constructor({cause:t}){super("Bundler has not set a beneficiary address.",{cause:t,name:"InvalidBeneficiaryError"})}}Object.defineProperty(ut,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa90/});class xe extends I{constructor({cause:t}){super("Invalid fields set on User Operation.",{cause:t,name:"InvalidFieldsError"})}}Object.defineProperty(xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class yt extends I{constructor({cause:t,paymasterAndData:a}){super("Paymaster properties provided are invalid.",{cause:t,metaMessages:["This could arise when:","- the `paymasterAndData` property is of an incorrect length\n",a&&`paymasterAndData: ${a}`].filter(Boolean),name:"InvalidPaymasterAndDataError"})}}Object.defineProperty(yt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa93/});class re extends I{constructor({cause:t}){super("Paymaster deposit for the User Operation is too low.",{cause:t,metaMessages:["This could arise when:","- the Paymaster has deposited less than the expected amount via the `deposit` function"].filter(Boolean),name:"PaymasterDepositTooLowError"})}}Object.defineProperty(re,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32508});Object.defineProperty(re,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa31/});class lt extends I{constructor({cause:t}){super("The `validatePaymasterUserOp` function on the Paymaster reverted.",{cause:t,name:"PaymasterFunctionRevertedError"})}}Object.defineProperty(lt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa33/});class dt extends I{constructor({cause:t}){super("The Paymaster contract has not been deployed.",{cause:t,name:"PaymasterNotDeployedError"})}}Object.defineProperty(dt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa30/});class Oe extends I{constructor({cause:t}){super("UserOperation rejected because paymaster (or signature aggregator) is throttled/banned.",{cause:t,name:"PaymasterRateLimitError"})}}Object.defineProperty(Oe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32504});class Pe extends I{constructor({cause:t}){super("UserOperation rejected because paymaster (or signature aggregator) is throttled/banned.",{cause:t,name:"PaymasterStakeTooLowError"})}}Object.defineProperty(Pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32505});class ct extends I{constructor({cause:t}){super("Paymaster `postOp` function reverted.",{cause:t,name:"PaymasterPostOpFunctionRevertedError"})}}Object.defineProperty(ct,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa50/});class mt extends I{constructor({cause:t,factory:a,factoryData:n,initCode:r}){super("Smart Account has already been deployed.",{cause:t,metaMessages:["Remove the following properties and try again:",a&&"`factory`",n&&"`factoryData`",r&&"`initCode`"].filter(Boolean),name:"SenderAlreadyConstructedError"})}}Object.defineProperty(mt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa10/});class Ae extends I{constructor({cause:t}){super("UserOperation rejected because account signature check failed (or paymaster signature, if the paymaster uses its data as signature).",{cause:t,name:"SignatureCheckFailedError"})}}Object.defineProperty(Ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32507});class ft extends I{constructor({cause:t}){super("The `validateUserOp` function on the Smart Account reverted.",{cause:t,name:"SmartAccountFunctionRevertedError"})}}Object.defineProperty(ft,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa23/});class De extends I{constructor({cause:t}){super("UserOperation rejected because account specified unsupported signature aggregator.",{cause:t,name:"UnsupportedSignatureAggregatorError"})}}Object.defineProperty(De,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32506});class bt extends I{constructor({cause:t}){super("User Operation expired.",{cause:t,metaMessages:["This could arise when:","- the `validAfter` or `validUntil` values returned from `validateUserOp` on the Smart Account are not satisfied"].filter(Boolean),name:"UserOperationExpiredError"})}}Object.defineProperty(bt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa22/});class gt extends I{constructor({cause:t}){super("Paymaster for User Operation expired.",{cause:t,metaMessages:["This could arise when:","- the `validAfter` or `validUntil` values returned from `validatePaymasterUserOp` on the Paymaster are not satisfied"].filter(Boolean),name:"UserOperationPaymasterExpiredError"})}}Object.defineProperty(gt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa32/});class ht extends I{constructor({cause:t}){super("Signature provided for the User Operation is invalid.",{cause:t,metaMessages:["This could arise when:","- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Smart Account"].filter(Boolean),name:"UserOperationSignatureError"})}}Object.defineProperty(ht,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa24/});class Tt extends I{constructor({cause:t}){super("Signature provided for the User Operation is invalid.",{cause:t,metaMessages:["This could arise when:","- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Paymaster"].filter(Boolean),name:"UserOperationPaymasterSignatureError"})}}Object.defineProperty(Tt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa34/});class Re extends I{constructor({cause:t}){super("User Operation rejected by EntryPoint's `simulateValidation` during account creation or validation.",{cause:t,name:"UserOperationRejectedByEntryPointError"})}}Object.defineProperty(Re,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32500});class Ge extends I{constructor({cause:t}){super("User Operation rejected by Paymaster's `validatePaymasterUserOp`.",{cause:t,name:"UserOperationRejectedByPaymasterError"})}}Object.defineProperty(Ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32501});class Le extends I{constructor({cause:t}){super("User Operation rejected with op code validation error.",{cause:t,name:"UserOperationRejectedByOpCodeError"})}}Object.defineProperty(Le,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32502});class Ce extends I{constructor({cause:t}){super("UserOperation out of time-range: either wallet or paymaster returned a time-range, and it is already expired (or will expire soon).",{cause:t,name:"UserOperationOutOfTimeRangeError"})}}Object.defineProperty(Ce,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32503});class or extends I{constructor({cause:t}){super(`An error occurred while executing user operation: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownBundlerError"})}}class Et extends I{constructor({cause:t}){super("User Operation verification gas limit exceeded.",{cause:t,metaMessages:["This could arise when:","- the gas used for verification exceeded the `verificationGasLimit`"].filter(Boolean),name:"VerificationGasLimitExceededError"})}}Object.defineProperty(Et,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa40/});class wt extends I{constructor({cause:t}){super("User Operation verification gas limit is too low.",{cause:t,metaMessages:["This could arise when:","- the `verificationGasLimit` is too low to verify the User Operation"].filter(Boolean),name:"VerificationGasLimitTooLowError"})}}Object.defineProperty(wt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa41/});class pr extends I{constructor(t,{callData:a,callGasLimit:n,docsPath:r,factory:p,factoryData:i,initCode:u,maxFeePerGas:s,maxPriorityFeePerGas:y,nonce:o,paymaster:m,paymasterAndData:v,paymasterData:A,paymasterPostOpGasLimit:d,paymasterVerificationGasLimit:l,preVerificationGas:b,sender:P,signature:L,verificationGasLimit:R}){const F=Da({callData:a,callGasLimit:n,factory:p,factoryData:i,initCode:u,maxFeePerGas:typeof s<"u"&&`${Gt(s)} gwei`,maxPriorityFeePerGas:typeof y<"u"&&`${Gt(y)} gwei`,nonce:o,paymaster:m,paymasterAndData:v,paymasterData:A,paymasterPostOpGasLimit:d,paymasterVerificationGasLimit:l,preVerificationGas:b,sender:P,signature:L,verificationGasLimit:R});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",F].filter(Boolean),name:"UserOperationExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class ur extends I{constructor({hash:t}){super(`User Operation receipt with hash "${t}" could not be found. The User Operation may not have been processed yet.`,{name:"UserOperationReceiptNotFoundError"})}}class yr extends I{constructor({hash:t}){super(`User Operation with hash "${t}" could not be found.`,{name:"UserOperationNotFoundError"})}}class zt extends I{constructor({hash:t}){super(`Timed out while waiting for User Operation with hash "${t}" to be confirmed.`,{name:"WaitForUserOperationReceiptTimeoutError"})}}const lr=[oe,xe,re,Oe,Pe,Ae,De,Ce,Re,Ge,Le];function dr(e,t){const a=(e.details||"").toLowerCase();if(Je.message.test(a))return new Je({cause:e});if(Qe.message.test(a))return new Qe({cause:e});if(et.message.test(a))return new et({cause:e});if(tt.message.test(a))return new tt({cause:e});if(at.message.test(a))return new at({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(nt.message.test(a))return new nt({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(rt.message.test(a))return new rt({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode,sender:t.sender});if(st.message.test(a))return new st({cause:e});if(it.message.test(a))return new it({cause:e});if(pt.message.test(a))return new pt({cause:e,nonce:t.nonce});if(ot.message.test(a))return new ot({cause:e});if(ut.message.test(a))return new ut({cause:e});if(yt.message.test(a))return new yt({cause:e});if(re.message.test(a))return new re({cause:e});if(lt.message.test(a))return new lt({cause:e});if(dt.message.test(a))return new dt({cause:e});if(ct.message.test(a))return new ct({cause:e});if(ft.message.test(a))return new ft({cause:e});if(mt.message.test(a))return new mt({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(bt.message.test(a))return new bt({cause:e});if(gt.message.test(a))return new gt({cause:e});if(Tt.message.test(a))return new Tt({cause:e});if(ht.message.test(a))return new ht({cause:e});if(Et.message.test(a))return new Et({cause:e});if(wt.message.test(a))return new wt({cause:e});const n=e.walk(r=>lr.some(p=>p.code===r.code));if(n){if(n.code===oe.code)return new oe({cause:e,data:n.data,message:n.details});if(n.code===xe.code)return new xe({cause:e});if(n.code===re.code)return new re({cause:e});if(n.code===Oe.code)return new Oe({cause:e});if(n.code===Pe.code)return new Pe({cause:e});if(n.code===Ae.code)return new Ae({cause:e});if(n.code===De.code)return new De({cause:e});if(n.code===Ce.code)return new Ce({cause:e});if(n.code===Re.code)return new Re({cause:e});if(n.code===Ge.code)return new Ge({cause:e});if(n.code===Le.code)return new Le({cause:e})}return new or({cause:e})}function la(e,{calls:t,docsPath:a,...n}){const r=(()=>{const p=dr(e,n);if(t&&p instanceof oe){const i=cr(p),u=t==null?void 0:t.filter(s=>s.abi);if(i&&u.length>0)return mr({calls:u,revertData:i})}return p})();return new pr(r,{docsPath:a,...n})}function cr(e){let t;return e.walk(a=>{var r,p,i,u;const n=a;if(typeof n.data=="string"||typeof((r=n.data)==null?void 0:r.revertData)=="string"||!(n instanceof I)&&typeof n.message=="string"){const s=(u=(i=((p=n.data)==null?void 0:p.revertData)||n.data||n.message).match)==null?void 0:u.call(i,/(0x[A-Za-z0-9]*)/);if(s)return t=s[1],!0}return!1}),t}function mr(e){const{calls:t,revertData:a}=e,{abi:n,functionName:r,args:p,to:i}=(()=>{const s=t==null?void 0:t.filter(o=>!!o.abi);if(s.length===1)return s[0];const y=s.filter(o=>{try{return!!ve({abi:o.abi,data:a})}catch{return!1}});return y.length===1?y[0]:{abi:[],functionName:s.reduce((o,m)=>`${o?`${o} | `:""}${m.functionName}`,""),args:void 0,to:void 0}})(),u=a==="0x"?new Ra({functionName:r}):new Xe({abi:n,data:a,functionName:r});return new Ga(u,{abi:n,args:p,contractAddress:i,functionName:r})}function fr(e){const t={};return e.callGasLimit&&(t.callGasLimit=BigInt(e.callGasLimit)),e.preVerificationGas&&(t.preVerificationGas=BigInt(e.preVerificationGas)),e.verificationGasLimit&&(t.verificationGasLimit=BigInt(e.verificationGasLimit)),e.paymasterPostOpGasLimit&&(t.paymasterPostOpGasLimit=BigInt(e.paymasterPostOpGasLimit)),e.paymasterVerificationGasLimit&&(t.paymasterVerificationGasLimit=BigInt(e.paymasterVerificationGasLimit)),t}function Ue(e){const t={};return typeof e.callData<"u"&&(t.callData=e.callData),typeof e.callGasLimit<"u"&&(t.callGasLimit=N(e.callGasLimit)),typeof e.factory<"u"&&(t.factory=e.factory),typeof e.factoryData<"u"&&(t.factoryData=e.factoryData),typeof e.initCode<"u"&&(t.initCode=e.initCode),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=N(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=N(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=N(e.nonce)),typeof e.paymaster<"u"&&(t.paymaster=e.paymaster),typeof e.paymasterAndData<"u"&&(t.paymasterAndData=e.paymasterAndData||"0x"),typeof e.paymasterData<"u"&&(t.paymasterData=e.paymasterData),typeof e.paymasterPostOpGasLimit<"u"&&(t.paymasterPostOpGasLimit=N(e.paymasterPostOpGasLimit)),typeof e.paymasterSignature<"u"&&(t.paymasterSignature=e.paymasterSignature),typeof e.paymasterVerificationGasLimit<"u"&&(t.paymasterVerificationGasLimit=N(e.paymasterVerificationGasLimit)),typeof e.preVerificationGas<"u"&&(t.preVerificationGas=N(e.preVerificationGas)),typeof e.sender<"u"&&(t.sender=e.sender),typeof e.signature<"u"&&(t.signature=e.signature),typeof e.verificationGasLimit<"u"&&(t.verificationGasLimit=N(e.verificationGasLimit)),typeof e.authorization<"u"&&(t.eip7702Auth=br(e.authorization)),t}function br(e){return{address:e.address,chainId:N(e.chainId),nonce:N(e.nonce),r:e.r?N(BigInt(e.r),{size:32}):M("0x",{size:32}),s:e.s?N(BigInt(e.s),{size:32}):M("0x",{size:32}),yParity:e.yParity?N(e.yParity,{size:1}):M("0x",{size:32})}}async function gr(e,t){const{chainId:a,entryPointAddress:n,context:r,...p}=t,i=Ue(p),{paymasterPostOpGasLimit:u,paymasterVerificationGasLimit:s,...y}=await e.request({method:"pm_getPaymasterData",params:[{...i,callGasLimit:i.callGasLimit??"0x0",verificationGasLimit:i.verificationGasLimit??"0x0",preVerificationGas:i.preVerificationGas??"0x0"},n,N(a),r]});return{...y,...u&&{paymasterPostOpGasLimit:me(u)},...s&&{paymasterVerificationGasLimit:me(s)}}}async function hr(e,t){const{chainId:a,entryPointAddress:n,context:r,...p}=t,i=Ue(p),{paymasterPostOpGasLimit:u,paymasterVerificationGasLimit:s,...y}=await e.request({method:"pm_getPaymasterStubData",params:[{...i,callGasLimit:i.callGasLimit??"0x0",verificationGasLimit:i.verificationGasLimit??"0x0",preVerificationGas:i.preVerificationGas??"0x0"},n,N(a),r]});return{...y,...u&&{paymasterPostOpGasLimit:me(u)},...s&&{paymasterVerificationGasLimit:me(s)}}}const Tr=["factory","fees","gas","paymaster","nonce","signature","authorization"];async function pe(e,t){var V,_;const a=t,{account:n=e.account,dataSuffix:r=typeof e.dataSuffix=="string"?e.dataSuffix:(V=e.dataSuffix)==null?void 0:V.value,parameters:p=Tr,stateOverride:i}=a;if(!n)throw new vt;const u=K(n),s=e,y=a.paymaster??(s==null?void 0:s.paymaster),o=typeof y=="string"?y:void 0,{getPaymasterStubData:m,getPaymasterData:v}=(()=>{if(y===!0)return{getPaymasterStubData:x=>$(s,hr,"getPaymasterStubData")(x),getPaymasterData:x=>$(s,gr,"getPaymasterData")(x)};if(typeof y=="object"){const{getPaymasterStubData:x,getPaymasterData:G}=y;return{getPaymasterStubData:G&&x?x:G,getPaymasterData:G&&x?G:void 0}}return{getPaymasterStubData:void 0,getPaymasterData:void 0}})(),A=a.paymasterContext?a.paymasterContext:s==null?void 0:s.paymasterContext;let d={...a,paymaster:o,sender:u.address};const[l,b,P,L,R]=await Promise.all([(async()=>a.calls?u.encodeCalls(a.calls.map(x=>{const G=x;return G.abi?{data:B(G),to:G.to,value:G.value}:G})):a.callData)(),(async()=>{if(!p.includes("factory"))return;if(a.initCode)return{initCode:a.initCode};if(a.factory&&a.factoryData)return{factory:a.factory,factoryData:a.factoryData};const{factory:x,factoryData:G}=await u.getFactoryArgs();return u.entryPoint.version==="0.6"?{initCode:x&&G?z([x,G]):void 0}:{factory:x,factoryData:G}})(),(async()=>{var x;if(p.includes("fees")){if(typeof a.maxFeePerGas=="bigint"&&typeof a.maxPriorityFeePerGas=="bigint")return d;if((x=s==null?void 0:s.userOperation)!=null&&x.estimateFeesPerGas){const G=await s.userOperation.estimateFeesPerGas({account:u,bundlerClient:s,userOperation:d});return{...d,...G}}try{const G=s.client??e,X=await $(G,La,"estimateFeesPerGas")({chain:G.chain,type:"eip1559"});return{maxFeePerGas:typeof a.maxFeePerGas=="bigint"?a.maxFeePerGas:BigInt(2n*X.maxFeePerGas),maxPriorityFeePerGas:typeof a.maxPriorityFeePerGas=="bigint"?a.maxPriorityFeePerGas:BigInt(2n*X.maxPriorityFeePerGas)}}catch{return}}})(),(async()=>{if(p.includes("nonce"))return typeof a.nonce=="bigint"?a.nonce:u.getNonce()})(),(async()=>{if(p.includes("authorization")){if(typeof a.authorization=="object")return a.authorization;if(u.authorization&&!await u.isDeployed())return{...await Ca(u.client,u.authorization),r:"0xfffffffffffffffffffffffffffffff000000000000000000000000000000000",s:"0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",yParity:1}}})()]);typeof l<"u"&&(d.callData=r?z([l,r]):l),typeof b<"u"&&(d={...d,...b}),typeof P<"u"&&(d={...d,...P}),typeof L<"u"&&(d.nonce=L),typeof R<"u"&&(d.authorization=R),p.includes("signature")&&(typeof a.signature<"u"?d.signature=a.signature:d.signature=await u.getStubSignature(d)),u.entryPoint.version==="0.6"&&!d.initCode&&(d.initCode="0x");let F;async function T(){return F||(e.chain?e.chain.id:(F=await $(e,Ie,"getChainId")({}),F))}let S=!1;if(p.includes("paymaster")&&m&&!o&&!a.paymasterAndData){const{isFinal:x=!1,sponsor:G,...X}=await m({chainId:await T(),entryPointAddress:u.entryPoint.address,context:A,...d});S=x,d={...d,...X}}if(u.entryPoint.version==="0.6"&&!d.paymasterAndData&&(d.paymasterAndData="0x"),p.includes("gas")){if((_=u.userOperation)!=null&&_.estimateGas){const x=await u.userOperation.estimateGas(d);d={...d,...x}}if(typeof d.callGasLimit>"u"||typeof d.preVerificationGas>"u"||typeof d.verificationGasLimit>"u"||d.paymaster&&typeof d.paymasterPostOpGasLimit>"u"||d.paymaster&&typeof d.paymasterVerificationGasLimit>"u"){const x=await $(s,da,"estimateUserOperationGas")({account:u,callGasLimit:0n,preVerificationGas:0n,verificationGasLimit:0n,stateOverride:i,...d.paymaster?{paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n}:{},...d});d={...d,callGasLimit:d.callGasLimit??x.callGasLimit,preVerificationGas:d.preVerificationGas??x.preVerificationGas,verificationGasLimit:d.verificationGasLimit??x.verificationGasLimit,paymasterPostOpGasLimit:d.paymasterPostOpGasLimit??x.paymasterPostOpGasLimit,paymasterVerificationGasLimit:d.paymasterVerificationGasLimit??x.paymasterVerificationGasLimit}}}if(p.includes("paymaster")&&v&&!o&&!a.paymasterAndData&&!S){const x=await v({chainId:await T(),entryPointAddress:u.entryPoint.address,context:A,...d});d={...d,...x}}return delete d.calls,delete d.parameters,delete d.paymasterContext,typeof d.paymaster!="string"&&delete d.paymaster,d}async function da(e,t){var s;const{account:a=e.account,entryPointAddress:n,stateOverride:r}=t;if(!a&&!t.sender)throw new vt;const p=a?K(a):void 0,i=Sa(r),u=p?await $(e,pe,"prepareUserOperation")({...t,parameters:["authorization","factory","nonce","paymaster","signature"]}):t;try{const y=[Ue(u),n??((s=p==null?void 0:p.entryPoint)==null?void 0:s.address)],o=await e.request({method:"eth_estimateUserOperationGas",params:i?[...y,i]:[...y]});return fr(o)}catch(y){const o=t.calls;throw la(y,{...u,...o?{calls:o}:{}})}}function Er(e){return e.request({method:"eth_supportedEntryPoints"})}function wr(e){const t={...e};return e.callGasLimit&&(t.callGasLimit=BigInt(e.callGasLimit)),e.maxFeePerGas&&(t.maxFeePerGas=BigInt(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=BigInt(e.maxPriorityFeePerGas)),e.nonce&&(t.nonce=BigInt(e.nonce)),e.paymasterPostOpGasLimit&&(t.paymasterPostOpGasLimit=BigInt(e.paymasterPostOpGasLimit)),e.paymasterVerificationGasLimit&&(t.paymasterVerificationGasLimit=BigInt(e.paymasterVerificationGasLimit)),e.preVerificationGas&&(t.preVerificationGas=BigInt(e.preVerificationGas)),e.verificationGasLimit&&(t.verificationGasLimit=BigInt(e.verificationGasLimit)),t}async function vr(e,{hash:t}){const a=await e.request({method:"eth_getUserOperationByHash",params:[t]},{dedupe:!0});if(!a)throw new yr({hash:t});const{blockHash:n,blockNumber:r,entryPoint:p,transactionHash:i,userOperation:u}=a;return{blockHash:n,blockNumber:BigInt(r),entryPoint:p,transactionHash:i,userOperation:wr(u)}}function Ir(e){const t={...e};return e.actualGasCost&&(t.actualGasCost=BigInt(e.actualGasCost)),e.actualGasUsed&&(t.actualGasUsed=BigInt(e.actualGasUsed)),e.logs&&(t.logs=e.logs.map(a=>Na(a))),e.receipt&&(t.receipt=Ma(t.receipt)),t}async function ca(e,{hash:t}){const a=await e.request({method:"eth_getUserOperationReceipt",params:[t]},{dedupe:!0});if(!a)throw new ur({hash:t});return Ir(a)}async function ne(e,t){var s,y;const{account:a=e.account,entryPointAddress:n}=t;if(!a&&!t.sender)throw new vt;const r=a?K(a):void 0,p=r?await $(e,pe,"prepareUserOperation")(t):t,i=t.signature||await((s=r==null?void 0:r.signUserOperation)==null?void 0:s.call(r,p)),u=Ue({...p,signature:i});try{return await e.request({method:"eth_sendUserOperation",params:[u,n??((y=r==null?void 0:r.entryPoint)==null?void 0:y.address)]},{retryCount:0})}catch(o){const m=t.calls;throw la(o,{...p,...m?{calls:m}:{},signature:i})}}function ma(e,t){const{hash:a,pollingInterval:n=e.pollingInterval,retryCount:r,timeout:p=12e4}=t;let i=0;const u=$a(["waitForUserOperationReceipt",e.uid,a]);return new Promise((s,y)=>{const o=Ua(u,{resolve:s,reject:y},m=>{const v=l=>{d(),l(),o()},A=p?setTimeout(()=>v(()=>m.reject(new zt({hash:a}))),p):void 0,d=Fa(async()=>{r&&i>=r&&(clearTimeout(A),v(()=>m.reject(new zt({hash:a}))));try{const l=await $(e,ca,"getUserOperationReceipt")({hash:a});clearTimeout(A),v(()=>m.resolve(l))}catch(l){const b=l;b.name!=="UserOperationReceiptNotFoundError"&&(clearTimeout(A),v(()=>m.reject(b)))}i++},{emitOnBegin:!0,interval:n});return d})})}function we(e){return{estimateUserOperationGas:t=>da(e,t),getChainId:()=>Ie(e),getSupportedEntryPoints:()=>Er(e),getUserOperation:t=>vr(e,t),getUserOperationReceipt:t=>ca(e,t),prepareUserOperation:t=>pe(e,t),sendUserOperation:t=>ne(e,t),waitForUserOperationReceipt:t=>ma(e,t)}}const us=async(e,t)=>{const{address:a,entryPointAddress:n,key:r=BigInt(0)}=t;return await $(e,ue,"readContract")({address:n,abi:[{inputs:[{name:"sender",type:"address"},{name:"key",type:"uint192"}],name:"getNonce",outputs:[{name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"getNonce",args:[a,r]})};class xr extends I{constructor({cause:t,entryPointAddress:a}={}){super(`The entry point address (\`entryPoint\`${a?` = ${a}`:""}) is not a valid entry point. getSenderAddress did not revert with a SenderAddressResult error.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidEntryPointError"})}}const ys=async(e,t)=>{var i,u,s,y,o,m,v,A;const{initCode:a,entryPointAddress:n,factory:r,factoryData:p}=t;if(!a&&!r&&!p)throw new Error("Either `initCode` or `factory` and `factoryData` must be provided");try{await $(e,Va,"simulateContract")({address:n,abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"}],functionName:"getSenderAddress",args:[a||z([r,p])]})}catch(d){const l=d.walk(b=>b instanceof Xe||b instanceof Lt||b instanceof Ct||b instanceof St);if(!l){const b=d.cause;if((((i=b==null?void 0:b.data)==null?void 0:i.errorName)??"")==="SenderAddressResult"&&((u=b==null?void 0:b.data)!=null&&u.args)&&((s=b==null?void 0:b.data)!=null&&s.args[0]))return(y=b.data)==null?void 0:y.args[0]}if(l instanceof Xe&&(((o=l.data)==null?void 0:o.errorName)??"")==="SenderAddressResult"&&(m=l.data)!=null&&m.args&&(v=l.data)!=null&&v.args[0])return(A=l.data)==null?void 0:A.args[0];if(l instanceof Lt){const b=/0x[a-fA-F0-9]+/,P=l.cause.data.match(b);if(!P)throw new Error("Failed to parse revert bytes from RPC response");const L=P[0];return ve({abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"}],data:L}).args[0]}if(l instanceof Ct){const{data:b}=d instanceof _a?d:d instanceof I?d.walk(R=>"data"in R)||d.walk():{},P=typeof b=="string"?b:b==null?void 0:b.data;if(P===void 0)throw new Error("Failed to parse revert bytes from RPC response");return ve({abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"}],data:P}).args[0]}if(l instanceof St){const P=JSON.parse(l.cause.body).error.data,L=/0x[a-fA-F0-9]+/,R=P.match(L);if(!R)throw new Error("Failed to parse revert bytes from RPC response");const F=R[0];return ve({abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"}],data:F}).args[0]}throw d}throw new xr({entryPointAddress:n})},Or=[{type:"function",name:"isInitialized",inputs:[{name:"smartAccount",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"}],Pr=[{inputs:[{internalType:"uint256",name:"moduleType",type:"uint256"},{internalType:"address",name:"module",type:"address"},{internalType:"bytes",name:"initData",type:"bytes"}],stateMutability:"payable",type:"function",name:"installModule"}],Ar=[{inputs:[{internalType:"uint256",name:"moduleType",type:"uint256"},{internalType:"address",name:"module",type:"address"},{internalType:"bytes",name:"additionalContext",type:"bytes"}],stateMutability:"view",type:"function",name:"isModuleInstalled",outputs:[{internalType:"bool",name:"",type:"bool"}]}],ls=async(e,t)=>{const{address:a,plugin:n}=t,{type:r,address:p,data:i="0x"}=n;try{return await $(e,ue,"readContract")({address:a,abi:Ar,functionName:"isModuleInstalled",args:[BigInt(r),p,i]})}catch{return!1}};var Q;(function(e){e.ERC1271_SIG_WRAPPER="ERC1271_SIG_WRAPPER",e.ERC1271_WITH_VALIDATOR="ERC1271_WITH_VALIDATOR",e.ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH="ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH",e.ERC1271_REPLAYABLE="ERC1271_REPLAYABLE"})(Q||(Q={}));const jt={[Q.ERC1271_SIG_WRAPPER]:">=0.2.3 || >=0.3.0-beta",[Q.ERC1271_WITH_VALIDATOR]:">=0.3.0-beta",[Q.ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH]:">=0.3.0-beta",[Q.ERC1271_REPLAYABLE]:">=0.3.2"},je=(e,t)=>e in jt?ie.satisfies(t,jt[e]):!1,ds=async(e,{gasToken:t,approveAmount:a,entryPoint:n})=>{var p;const r=await e.request({method:"zd_pm_accounts",params:[{chainId:(p=e.chain)==null?void 0:p.id,entryPointAddress:n.address}]});return{to:t,data:B({abi:Ba,functionName:"approve",args:[r[0],a]}),value:0n}},cs=e=>{let t=e;if(!Nt(t)&&(t=`0x${t}`,!Nt(t)))throw new Error(`Invalid signed data ${e}`);let{r:a,s:n,v:r}=ln(t);return(r===0n||r===1n)&&(r+=27n),ka({r:a,s:n,v:r})},Kt=({callType:e,execType:t})=>Y([e,t,"0x00000000","0x00000000",M("0x00000000",{size:22})]),Dr=(e,t)=>{if(e==="0.6"&&!ie.satisfies(t,">=0.2.2 || <=0.2.4")||e==="0.7"&&!ie.satisfies(t,">=0.3.0"))throw new Error("KernelVersion should be >= 0.2.2 and <= 0.2.4 for EntryPointV0.6 and >= 0.3.0 for EntryPointV0.7")},ms=(e,t)=>ie.satisfies(e,t);function Se(e){if(typeof e!="function")return e==null||typeof e=="string"||typeof e=="boolean"?e:typeof e=="bigint"||typeof e=="number"?J(e):e._isBigNumber!=null||typeof e!="object"?J(e).replace(/^0x0/,"0x"):Array.isArray(e)?e.map(t=>Se(t)):Object.keys(e).reduce((t,a)=>(t[a]=Se(e[a]),t),{})}async function fs({signer:e,address:t}){if("type"in e&&(e.type==="local"||e.type==="smart"))return e;let a;if("request"in e&&!(e!=null&&e.account)){if(t||(t=(await Promise.any([e.request({method:"eth_requestAccounts"}),e.request({method:"eth_accounts"})]))[0]),!t)throw new Error("address is required");a=Ha({account:t,transport:za(e)})}return a||(a=e),ir({address:a.account.address,async signMessage({message:n}){return Xa(a,{message:n})},async signTypedData(n){const{primaryType:r,domain:p,message:i,types:u}=n;return Ka(a,{primaryType:r,domain:p,message:i,types:u})},async signTransaction(n){throw new Error("Smart account signer doesn't need to sign transactions")},async signAuthorization(n){return ja(a,n)}})}const Pt=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"",type:"uint8"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct Call[]",name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"executeDelegateCall",outputs:[],stateMutability:"payable",type:"function"}],bs=[{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"}],fa=[{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyInitialized",type:"error"},{inputs:[],name:"DisabledMode",type:"error"},{inputs:[],name:"NotAuthorizedCaller",type:"error"},{inputs:[],name:"NotEntryPoint",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldValidator",type:"address"},{indexed:!0,internalType:"address",name:"newValidator",type:"address"}],name:"DefaultValidatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"selector",type:"bytes4"},{indexed:!0,internalType:"address",name:"executor",type:"address"},{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"ExecutionChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Received",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newImplementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[{internalType:"bytes4",name:"_disableFlag",type:"bytes4"}],name:"disableMode",outputs:[],stateMutability:"payable",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:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"",type:"uint8"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct Call[]",name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"executeDelegateCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"getDefaultValidator",outputs:[{internalType:"contract IKernelValidator",name:"validator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getDisabledMode",outputs:[{internalType:"bytes4",name:"disabled",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"}],name:"getExecution",outputs:[{components:[{internalType:"ValidAfter",name:"validAfter",type:"uint48"},{internalType:"ValidUntil",name:"validUntil",type:"uint48"},{internalType:"address",name:"executor",type:"address"},{internalType:"contract IKernelValidator",name:"validator",type:"address"}],internalType:"struct ExecutionDetail",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastDisabledTime",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"setDefaultValidator",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"},{internalType:"address",name:"_executor",type:"address"},{internalType:"contract IKernelValidator",name:"_validator",type:"address"},{internalType:"ValidUntil",name:"_validUntil",type:"uint48"},{internalType:"ValidAfter",name:"_validAfter",type:"uint48"},{internalType:"bytes",name:"_enableData",type:"bytes"}],name:"setExecution",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"_userOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{internalType:"ValidationData",name:"validationData",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],Rr=e=>B({abi:Pt,functionName:"executeBatch",args:[e.map(t=>({to:t.to,value:t.value||0n,data:t.data||"0x"}))]}),ba=e=>B({abi:Pt,functionName:"executeDelegateCall",args:[e.to,e.data||"0x"]}),Gr=e=>B({abi:Pt,functionName:"execute",args:[e.to,e.value||0n,e.data||"0x",0]}),Lr=async(e,t)=>{if(e.length>1){if(t==="delegatecall")throw new Error("Cannot batch delegatecall");return Rr(e)}const a=e.length===0?void 0:e[0];if(!a)throw new Error("No calls to encode");if(!t||t==="call")return Gr(a);if(t==="delegatecall")return ba({to:a.to,data:a.data});throw new Error("Invalid call type")},Cr=async({accountAddress:e,enableData:t,executor:a,selector:n,validAfter:r,validUntil:p,validator:i})=>Lr([{to:e,value:0n,data:B({abi:fa,functionName:"setExecution",args:[n,a,i,p,r,t]})}],"call");var se;(function(e){e.sudo="0x00000000",e.plugin="0x00000001",e.enable="0x00000002"})(se||(se={}));const gs=[{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"}],Ke=[{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"}],de=[{type:"constructor",inputs:[{name:"_entrypoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"accountId",inputs:[],outputs:[{name:"accountImplementationId",type:"string",internalType:"string"}],stateMutability:"pure"},{type:"function",name:"currentNonce",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"entrypoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executorConfig",inputs:[{name:"executor",type:"address",internalType:"contract IExecutor"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutorManager.ExecutorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"installModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"initData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"installValidations",inputs:[{name:"vIds",type:"bytes21[]",internalType:"ValidationId[]"},{name:"configs",type:"tuple[]",internalType:"struct ValidationManager.ValidationConfig[]",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]},{name:"validationData",type:"bytes[]",internalType:"bytes[]"},{name:"hookData",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"payable"},{type:"function",name:"invalidateNonce",inputs:[{name:"nonce",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"isAllowedSelector",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isModuleInstalled",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"additionalContext",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"permissionConfig",inputs:[{name:"pId",type:"bytes4",internalType:"PermissionId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.PermissionConfig",components:[{name:"permissionFlag",type:"bytes2",internalType:"PassFlag"},{name:"signer",type:"address",internalType:"contract ISigner"},{name:"policyData",type:"bytes22[]",internalType:"PolicyData[]"}]}],stateMutability:"view"},{type:"function",name:"rootValidator",inputs:[],outputs:[{name:"",type:"bytes21",internalType:"ValidationId"}],stateMutability:"view"},{type:"function",name:"selectorConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct SelectorManager.SelectorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"},{name:"target",type:"address",internalType:"address"},{name:"callType",type:"bytes1",internalType:"CallType"}]}],stateMutability:"view"},{type:"function",name:"supportsExecutionMode",inputs:[{name:"mode",type:"bytes32",internalType:"ExecMode"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"supportsModule",inputs:[{name:"moduleTypeId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"uninstallModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"deInitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"uninstallValidation",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"deinitData",type:"bytes",internalType:"bytes"},{name:"hookDeinitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"validNonceFrom",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"ValidationData"}],stateMutability:"payable"},{type:"function",name:"validationConfig",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.ValidationConfig",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"event",name:"ModuleInstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ModuleUninstallResult",inputs:[{name:"module",type:"address",indexed:!1,internalType:"address"},{name:"result",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"ModuleUninstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"NonceInvalidated",inputs:[{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionInstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionUninstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"}],anonymous:!1},{type:"event",name:"Received",inputs:[{name:"sender",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RootValidatorUpdated",inputs:[{name:"rootValidator",type:"bytes21",indexed:!1,internalType:"ValidationId"}],anonymous:!1},{type:"event",name:"SelectorSet",inputs:[{name:"selector",type:"bytes4",indexed:!1,internalType:"bytes4"},{name:"vId",type:"bytes21",indexed:!1,internalType:"ValidationId"},{name:"allowed",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"TryExecuteUnsuccessful",inputs:[{name:"batchExecutionindex",type:"uint256",indexed:!1,internalType:"uint256"},{name:"result",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ValidatorInstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"ValidatorUninstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"}],anonymous:!1},{type:"error",name:"EnableNotApproved",inputs:[]},{type:"error",name:"ExecutionReverted",inputs:[]},{type:"error",name:"InvalidCallType",inputs:[]},{type:"error",name:"InvalidCaller",inputs:[]},{type:"error",name:"InvalidExecutor",inputs:[]},{type:"error",name:"InvalidFallback",inputs:[]},{type:"error",name:"InvalidMode",inputs:[]},{type:"error",name:"InvalidModuleType",inputs:[]},{type:"error",name:"InvalidNonce",inputs:[]},{type:"error",name:"InvalidSelector",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"InvalidValidationType",inputs:[]},{type:"error",name:"InvalidValidator",inputs:[]},{type:"error",name:"NonceInvalidationError",inputs:[]},{type:"error",name:"NotSupportedCallType",inputs:[]},{type:"error",name:"OnlyExecuteUserOp",inputs:[]},{type:"error",name:"PermissionDataLengthMismatch",inputs:[]},{type:"error",name:"PermissionNotAlllowedForSignature",inputs:[]},{type:"error",name:"PermissionNotAlllowedForUserOp",inputs:[]},{type:"error",name:"PolicyDataTooLarge",inputs:[]},{type:"error",name:"PolicyFailed",inputs:[{name:"i",type:"uint256",internalType:"uint256"}]},{type:"error",name:"PolicySignatureOrderError",inputs:[]},{type:"error",name:"RootValidatorCannotBeRemoved",inputs:[]},{type:"error",name:"SignerPrefixNotPresent",inputs:[]}],Xt=async(e,t)=>{try{const a=await $(e,ue,"readContract")({abi:de,address:t,functionName:"currentNonce",args:[]});return a===0?1:a}catch{return 1}},Wt=[{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"data",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"magicValue",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"}],Yt=async(e,t,a,n)=>{try{const r=await e.request({method:"eth_call",params:[{to:t,data:B({abi:Wt,functionName:"eip712Domain"})},"latest"]});if(r!=="0x"){const p=Wa({abi:[...Wt],functionName:"eip712Domain",data:r});return{name:p[1],version:p[2],chainId:p[3]}}}catch{}return{name:rn,version:a==="0.3.0"?"0.3.0-beta":a,chainId:BigInt(n??(e.chain?e.chain.id:await e.extend(Ya).getChainId()))}},qt=e=>{if(e==="0.6")return We(Ye({abi:fa,name:"execute"}));if(e==="0.7")return We(Ye({abi:de,name:"execute"}));throw new Error("Unsupported entry point version")},Sr=async({accountAddress:e,enableSignature:t,action:a,validator:n,validUntil:r,validAfter:p})=>{const i=await n.getEnableData(e),u=i.length/2-1;return z([se.enable,M(J(r,{size:6}),{size:6}),M(J(p),{size:6}),M(n.address,{size:20}),M(a.address,{size:20}),M(J(u),{size:32}),i,M(J(t.length/2-1),{size:32}),t])},Nr=async({accountAddress:e,chainId:t,kernelVersion:a,action:n,validator:r,validUntil:p,validAfter:i})=>({domain:{name:"Kernel",version:a,chainId:t,verifyingContract:e},types:{ValidatorApproved:[{name:"sig",type:"bytes4"},{name:"validatorData",type:"uint256"},{name:"executor",type:"address"},{name:"enableData",type:"bytes"}]},message:{sig:n.selector,validatorData:me(Y([M(J(p??0),{size:6}),M(J(i??0),{size:6}),r.address]),{size:32}),executor:n.address,enableData:await r.getEnableData(e)},primaryType:"ValidatorApproved"}),Mr=async({enableSignature:e,userOpSignature:t,action:a,enableData:n,hook:r})=>{var p;return z([(r==null?void 0:r.getIdentifier())??ae,ee(qe("bytes validatorData, bytes hookData, bytes selectorData, bytes enableSig, bytes userOpSig"),[n,await(r==null?void 0:r.getEnableData())??"0x",z([a.selector,a.address,((p=a.hook)==null?void 0:p.address)??ae,ee(qe("bytes selectorInitData, bytes hookInitData"),[ye.DELEGATE_CALL,"0x0000"])]),e,t])])},Zt=async({accountAddress:e,chainId:t,kernelVersion:a,action:n,hook:r,validator:p,validatorNonce:i})=>{var u;return{domain:{name:"Kernel",version:a==="0.3.0"?"0.3.0-beta":a,chainId:t,verifyingContract:e},types:{Enable:[{name:"validationId",type:"bytes21"},{name:"nonce",type:"uint32"},{name:"hook",type:"address"},{name:"validatorData",type:"bytes"},{name:"hookData",type:"bytes"},{name:"selectorData",type:"bytes"}]},message:{validationId:z([H[p.validatorType],M(p.getIdentifier(),{size:20,dir:"right"})]),nonce:i,hook:(r==null?void 0:r.getIdentifier())??ae,validatorData:await p.getEnableData(e),hookData:await(r==null?void 0:r.getEnableData(e))??"0x",selectorData:z([n.selector,n.address,((u=n.hook)==null?void 0:u.address)??ae,ee(qe("bytes selectorInitData, bytes hookInitData"),[ye.DELEGATE_CALL,"0x0000"])])},primaryType:"Enable"}},$r=async(e,t,a)=>{try{return await $(e,ue,"readContract")({abi:Or,address:a,functionName:"isInitialized",args:[t]})}catch{}return!1};function hs(e){return(e==null?void 0:e.getPluginEnableSignature)!==void 0}async function Ts(e,{sudo:t,regular:a,hook:n,pluginEnableSignature:r,validatorInitData:p,action:i,validAfter:u=0,validUntil:s=0,entryPoint:y,kernelVersion:o,chainId:m,isPreInstalled:v=!1}){var F;if(t&&!ie.satisfies(o,t==null?void 0:t.supportedKernelVersions)||a&&!ie.satisfies(o,a==null?void 0:a.supportedKernelVersions))throw new Error("Either sudo or/and regular validator version mismatch. Update to latest plugin package and use the proper plugin version");let A=v;const d=a||t;if(!d)throw new Error("One of `sudo` or `regular` validator must be set");if(i={selector:(i==null?void 0:i.selector)??qt(y.version),address:(i==null?void 0:i.address)??ae},y.version==="0.7"&&(i.address.toLowerCase()!==ae.toLowerCase()||i.selector.toLowerCase()!==qt(y.version).toLowerCase())&&o==="0.3.0"&&(i.hook={address:((F=i.hook)==null?void 0:F.address)??sn}),!i)throw new Error("Action data must be set");const l=async(T,S,V="0x")=>{if(!i)throw new Error("Action data must be set");if(y.version==="0.6")if(a){if(A||await b(T,S))return se.plugin;const _=await P(T);if(!_)throw new Error("Enable signature not set");return Sr({accountAddress:T,enableSignature:_,action:i,validator:a,validUntil:s,validAfter:u})}else{if(t)return se.sudo;throw new Error("One of `sudo` or `regular` validator must be set")}if(a){if(A||await b(T,i.selector))return V;const _=await P(T);return Mr({enableSignature:_,userOpSignature:V,action:i,enableData:await a.getEnableData(T),hook:n})}else{if(t)return V;throw new Error("One of `sudo` or `regular` validator must be set")}},b=async(T,S,V)=>{const _=!!V,x=V??a;if(v&&!_)return!0;if(!i)throw new Error("Action data must be set");if(!x)throw new Error("regular validator not set");if(y.version==="0.6")return x.isEnabled(T,S);const G=await x.isEnabled(T,i.selector)||await $r(e,T,x.address);return G&&!_&&(A=!0),G},P=async(T,S)=>{var be;const V=!!S,_=S??a;if(!i)throw new Error("Action data must be set");if(r&&!V)return r;if(!t)throw new Error("sudo validator not set -- need it to enable the validator");if(!_)throw new Error("regular validator not set");const{version:x}=await Yt(e,T,o);m||(m=((be=e.chain)==null?void 0:be.id)??await Ie(e));let G;if(y.version==="0.6"){const f=await Nr({accountAddress:T,chainId:m,kernelVersion:x??o,action:i,validator:_,validUntil:s,validAfter:u});return G=await t.signTypedData(f),V||(r=G),G}const X=await Xt(e,T),Fe=await Zt({accountAddress:T,chainId:m,kernelVersion:x,action:i,hook:n,validator:_,validatorNonce:X});return G=await t.signTypedData(Fe),V||(r=G),G},L=(T=!1)=>{const S=(T?t:a)??d;return z([H[S.validatorType],S.getIdentifier()])};return{sudoValidator:t,regularValidator:a,activeValidatorMode:t&&!a?"sudo":"regular",...d,hook:n,getIdentifier:L,encodeModuleInstallCallData:async T=>{if(!i)throw new Error("Action data must be set");if(!a)throw new Error("regular validator not set");if(y.version==="0.6")return await Cr({accountAddress:T,selector:i.selector,executor:i.address,validator:a==null?void 0:a.address,validUntil:s,validAfter:u,enableData:await a.getEnableData(T)});throw new Error("EntryPoint v0.7 not supported yet")},signUserOperation:async T=>{const S=await d.signUserOperation(T);return y.version==="0.6"?Y([await l(T.sender,T.callData.toString().slice(0,10)),S]):await l(T.sender,T.callData.toString().slice(0,10),S)},getAction:()=>{if(!i)throw new Error("Action data must be set");return i},getValidityData:()=>({validAfter:u,validUntil:s}),getStubSignature:async T=>{const S=await d.getStubSignature(T);return y.version==="0.6"?Y([await l(T.sender,T.callData.toString().slice(0,10)),S]):await l(T.sender,T.callData.toString().slice(0,10),S)},getNonceKey:async(T=ae,S=0n)=>{if(!i)throw new Error("Action data must be set");if(y.version==="0.6"){if(S>qa)throw new Error("Custom nonce key must be equal or less than maxUint192 for 0.6");return await d.getNonceKey(T,S)}if(S>Za)throw new Error("Custom nonce key must be equal or less than 2 bytes(maxUint16) for v0.7");const V=!a||await b(T,i.selector)?Mt.DEFAULT:Mt.ENABLE,_=a?H[a.validatorType]:H.SUDO,x=M(Y([V,_,M(d.getIdentifier(),{size:20,dir:"right"}),M(J(await d.getNonceKey(T,S)),{size:2})]),{size:24});return BigInt(x)},isPluginEnabled:b,getPluginEnableSignature:P,getPluginsEnableTypedData:async(T,S)=>{var X;const V=S??a;if(!i)throw new Error("Action data must be set");if(!t)throw new Error("sudo validator not set -- need it to enable the validator");if(!V)throw new Error("regular validator not set");const{version:_}=await Yt(e,T,o),x=await Xt(e,T);return m||(m=((X=e.chain)==null?void 0:X.id)??await Ie(e)),await Zt({accountAddress:T,chainId:m,kernelVersion:_,action:i,validator:V,validatorNonce:x})},getValidatorInitData:async()=>p||{validatorAddress:(t==null?void 0:t.address)??d.address,enableData:await(t==null?void 0:t.getEnableData())??await d.getEnableData(),identifier:M(L(!0),{size:21,dir:"right"})},signUserOperationWithActiveValidator:async T=>d.signUserOperation(T)}}const Es=[{type:"constructor",inputs:[{name:"_owner",type:"address",internalType:"address"}],stateMutability:"nonpayable"},{type:"function",name:"approveFactory",inputs:[{name:"factory",type:"address",internalType:"contract KernelFactory"},{name:"approval",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"payable"},{type:"function",name:"approved",inputs:[{name:"",type:"address",internalType:"contract KernelFactory"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"cancelOwnershipHandover",inputs:[],outputs:[],stateMutability:"payable"},{type:"function",name:"completeOwnershipHandover",inputs:[{name:"pendingOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"deployWithFactory",inputs:[{name:"factory",type:"address",internalType:"contract KernelFactory"},{name:"createData",type:"bytes",internalType:"bytes"},{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"payable"},{type:"function",name:"owner",inputs:[],outputs:[{name:"result",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"ownershipHandoverExpiresAt",inputs:[{name:"pendingOwner",type:"address",internalType:"address"}],outputs:[{name:"result",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"payable"},{type:"function",name:"requestOwnershipHandover",inputs:[],outputs:[],stateMutability:"payable"},{type:"function",name:"stake",inputs:[{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"},{name:"unstakeDelay",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"unlockStake",inputs:[{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"}],outputs:[],stateMutability:"payable"},{type:"function",name:"withdrawStake",inputs:[{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"},{name:"recipient",type:"address",internalType:"address payable"}],outputs:[],stateMutability:"payable"},{type:"event",name:"OwnershipHandoverCanceled",inputs:[{name:"pendingOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipHandoverRequested",inputs:[{name:"pendingOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"oldOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"error",name:"AlreadyInitialized",inputs:[]},{type:"error",name:"NewOwnerIsZeroAddress",inputs:[]},{type:"error",name:"NoHandoverRequest",inputs:[]},{type:"error",name:"NotApprovedFactory",inputs:[]},{type:"error",name:"Unauthorized",inputs:[]}],Jt=[{type:"constructor",inputs:[{name:"_entrypoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"accountId",inputs:[],outputs:[{name:"accountImplementationId",type:"string",internalType:"string"}],stateMutability:"pure"},{type:"function",name:"changeRootValidator",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"currentNonce",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"entrypoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executorConfig",inputs:[{name:"executor",type:"address",internalType:"contract IExecutor"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutorManager.ExecutorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"},{name:"initConfig",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"installModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"initData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"installValidations",inputs:[{name:"vIds",type:"bytes21[]",internalType:"ValidationId[]"},{name:"configs",type:"tuple[]",internalType:"struct ValidationManager.ValidationConfig[]",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]},{name:"validationData",type:"bytes[]",internalType:"bytes[]"},{name:"hookData",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"payable"},{type:"function",name:"invalidateNonce",inputs:[{name:"nonce",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"isAllowedSelector",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isModuleInstalled",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"additionalContext",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"permissionConfig",inputs:[{name:"pId",type:"bytes4",internalType:"PermissionId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.PermissionConfig",components:[{name:"permissionFlag",type:"bytes2",internalType:"PassFlag"},{name:"signer",type:"address",internalType:"contract ISigner"},{name:"policyData",type:"bytes22[]",internalType:"PolicyData[]"}]}],stateMutability:"view"},{type:"function",name:"rootValidator",inputs:[],outputs:[{name:"",type:"bytes21",internalType:"ValidationId"}],stateMutability:"view"},{type:"function",name:"selectorConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct SelectorManager.SelectorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"},{name:"target",type:"address",internalType:"address"},{name:"callType",type:"bytes1",internalType:"CallType"}]}],stateMutability:"view"},{type:"function",name:"supportsExecutionMode",inputs:[{name:"mode",type:"bytes32",internalType:"ExecMode"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"supportsModule",inputs:[{name:"moduleTypeId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"uninstallModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"deInitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"uninstallValidation",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"deinitData",type:"bytes",internalType:"bytes"},{name:"hookDeinitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"validNonceFrom",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"ValidationData"}],stateMutability:"payable"},{type:"function",name:"validationConfig",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.ValidationConfig",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"event",name:"ModuleInstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ModuleUninstallResult",inputs:[{name:"module",type:"address",indexed:!1,internalType:"address"},{name:"result",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"ModuleUninstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"NonceInvalidated",inputs:[{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionInstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionUninstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"}],anonymous:!1},{type:"event",name:"Received",inputs:[{name:"sender",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RootValidatorUpdated",inputs:[{name:"rootValidator",type:"bytes21",indexed:!1,internalType:"ValidationId"}],anonymous:!1},{type:"event",name:"SelectorSet",inputs:[{name:"selector",type:"bytes4",indexed:!1,internalType:"bytes4"},{name:"vId",type:"bytes21",indexed:!1,internalType:"ValidationId"},{name:"allowed",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"TryExecuteUnsuccessful",inputs:[{name:"batchExecutionindex",type:"uint256",indexed:!1,internalType:"uint256"},{name:"result",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ValidatorInstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"ValidatorUninstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"}],anonymous:!1},{type:"error",name:"EnableNotApproved",inputs:[]},{type:"error",name:"ExecutionReverted",inputs:[]},{type:"error",name:"InitConfigError",inputs:[{name:"idx",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidCallType",inputs:[]},{type:"error",name:"InvalidCaller",inputs:[]},{type:"error",name:"InvalidExecutor",inputs:[]},{type:"error",name:"InvalidFallback",inputs:[]},{type:"error",name:"InvalidMode",inputs:[]},{type:"error",name:"InvalidModuleType",inputs:[]},{type:"error",name:"InvalidNonce",inputs:[]},{type:"error",name:"InvalidSelector",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"InvalidValidationType",inputs:[]},{type:"error",name:"InvalidValidator",inputs:[]},{type:"error",name:"NonceInvalidationError",inputs:[]},{type:"error",name:"NotSupportedCallType",inputs:[]},{type:"error",name:"OnlyExecuteUserOp",inputs:[]},{type:"error",name:"PermissionDataLengthMismatch",inputs:[]},{type:"error",name:"PermissionNotAlllowedForSignature",inputs:[]},{type:"error",name:"PermissionNotAlllowedForUserOp",inputs:[]},{type:"error",name:"PolicyDataTooLarge",inputs:[]},{type:"error",name:"PolicyFailed",inputs:[{name:"i",type:"uint256",internalType:"uint256"}]},{type:"error",name:"PolicySignatureOrderError",inputs:[]},{type:"error",name:"RootValidatorCannotBeRemoved",inputs:[]},{type:"error",name:"SignerPrefixNotPresent",inputs:[]}],Ur=ea(["function performCreate(uint256 value, bytes memory deploymentData) public returns (address newContract)","function performCreate2(uint256 value, bytes memory deploymentData, bytes32 salt) public returns (address newContract)"]),ga=e=>B({abi:Ur,functionName:"performCreate",args:e}),ws=e=>{const t={to:aa,data:ga([0n,ta(e)])};return ba(t)},At=(e,t,a=!1)=>{let n;"calldata"in e?n=e.calldata:n=Y([e.to,t.callType!==ye.DELEGATE_CALL?J(e.value||0n,{size:32}):"0x",e.data||"0x"]);const r=We(Ye({abi:Ke,name:"executeUserOp"}));return a?Y([r,B({abi:Ke,functionName:"execute",args:[Kt(t),n]})]):B({abi:Ke,functionName:"execute",args:[Kt(t),n]})},Fr=(e,t,a)=>{const n=ee([{name:"executionBatch",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"callData",type:"bytes"}]}],[e.map(r=>({target:r.to,value:r.value||0n,callData:r.data||"0x"}))]);return At({calldata:n},{callType:ye.BATCH,execType:t.execType},a)},ha=(e,t,a)=>At(e,{callType:ye.DELEGATE_CALL,execType:t.execType},a),Vr=(e,t,a)=>At(e,{callType:ye.SINGLE,execType:t.execType},a),vs=async(e,t,a,n=na.DEFAULT)=>{if(e.length>1){if(t==="delegatecall")throw new Error("Cannot batch delegatecall");return Fr(e,{execType:n},a)}const r=e.length===0?void 0:e[0];if(!r)throw new Error("No calls to encode");if(!t||t==="call")return Vr(r,{execType:n},a);if(t==="delegatecall")return ha({to:r.to,data:r.data},{execType:n},a);throw new Error("Invalid call type")},Is=e=>{const t={to:aa,data:ga([0n,ta(e)])};return ha(t,{execType:na.DEFAULT})},_r=e=>W(ee([{type:"bytes32"},{type:"bytes32"}],[W(Ja("Kernel(bytes32 hash)")),e])),xs=async(e,t,a)=>{const{name:n,version:r,chainId:p,verifyingContract:i}=t;if(!je(Q.ERC1271_SIG_WRAPPER,r))return e;const u=je(Q.ERC1271_REPLAYABLE,r)&&a?0:p,s=Qa({domain:{name:n,version:r,chainId:u,verifyingContract:i}});let y=e;return je(Q.ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH,r)&&(y=_r(y)),W(Y(["0x1901",s,y]))},Os=(e,t)=>{const a=B({abi:Pr,functionName:"installModule",args:[t.type,t.address,t.data]});return{to:e,data:a}},kr=async(e,t)=>{var o;const{userOperation:{chainId:a,entryPointAddress:n,context:r,calls:p,account:i,...u}}=t,s=await e.request({method:"zd_sponsorUserOperation",params:[{chainId:(o=e.chain)==null?void 0:o.id,userOp:Se(u),entryPointAddress:n,gasTokenData:t.gasToken&&{tokenAddress:t.gasToken},shouldOverrideFee:t.shouldOverrideFee??!1,shouldConsume:t.shouldConsume??!0}]});if(en(n,ra))return{paymasterAndData:s.paymasterAndData,preVerificationGas:BigInt(s.preVerificationGas),verificationGasLimit:BigInt(s.verificationGasLimit),callGasLimit:BigInt(s.callGasLimit),maxFeePerGas:s.maxFeePerGas?BigInt(s.maxFeePerGas):t.userOperation.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas?BigInt(s.maxPriorityFeePerGas):t.userOperation.maxPriorityFeePerGas};const y=s;return{callGasLimit:BigInt(y.callGasLimit),verificationGasLimit:BigInt(y.verificationGasLimit),preVerificationGas:BigInt(y.preVerificationGas),paymaster:y.paymaster,paymasterVerificationGasLimit:BigInt(y.paymasterVerificationGasLimit),paymasterPostOpGasLimit:BigInt(y.paymasterPostOpGasLimit),paymasterData:y.paymasterData,maxFeePerGas:s.maxFeePerGas?BigInt(s.maxFeePerGas):t.userOperation.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas?BigInt(s.maxPriorityFeePerGas):t.userOperation.maxPriorityFeePerGas}};function Br(e,t){Dr(e.entryPoint.version,t);const a=sa[t].accountImplementationAddress;return{to:e.address,data:B({abi:de,functionName:"upgradeTo",args:[a]}),value:0n}}class te extends I{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` -`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class Ps extends I{constructor(){super("Smart account signer doesn't need to sign transactions",{name:"SignTransactionNotSupportedError"})}}async function Hr(e,t){const{account:a=e.account,kernelVersion:n}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const r=K(a),p=Br(r,n);return await $(e,ne,"sendUserOperation")({...t,calls:[p],account:r})}async function zr(e,t){const{sudoValidator:a,hook:n,...r}=t,p=r.account??e.account;if(!p)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const i=K(p);let u;if([H.PERMISSION,H.SECONDARY,H.EIP7702].includes(H[a.validatorType]))u=Y([H[a.validatorType],M(a.getIdentifier(),{size:20,dir:"right"})]);else throw new Error(`Cannot change sudo validator to type ${a.validatorType}`);const s=await a.getEnableData(i.address),y=(n==null?void 0:n.getIdentifier())??ae,o=await(n==null?void 0:n.getEnableData(i.address))??"0x";return i.kernelVersion===on?await $(e,ne,"sendUserOperation")({...r,callData:await i.encodeCalls([{to:sa[pn].accountImplementationAddress,value:0n,data:B({abi:Jt,functionName:"changeRootValidator",args:[u,y,s,o]})}],"delegatecall")}):await $(e,ne,"sendUserOperation")({...r,callData:await i.encodeCalls([{to:i.address,value:0n,data:B({abi:Jt,functionName:"changeRootValidator",args:[u,y,s,o]})}])})}async function jr(e,t){const{account:a=e.account,nonceToSet:n}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const r=K(a);return await $(e,ne,"sendUserOperation")({...t,calls:[{to:r.address,data:B({abi:de,functionName:"invalidateNonce",args:[n]}),value:0n}],account:r})}async function Kr(e,t){const{account:a=e.account,plugin:n,hook:r,...p}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const i=K(a);let u;if([H.PERMISSION,H.SECONDARY,H.EIP7702].includes(H[n.validatorType]))u=Y([H[n.validatorType],M(n.getIdentifier(),{size:20,dir:"right"})]);else throw new Error(`Cannot uninstall ${n.validatorType} plugin`);const s=await n.getEnableData(i.address),y=await(r==null?void 0:r.getEnableData(i.address))??"0x";return await $(e,ne,"sendUserOperation")({...p,calls:[{to:i.address,data:B({abi:de,functionName:"uninstallValidation",args:[u,s,y]}),value:0n}],account:i})}async function Xr(e,t){const{account:a=e.account}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const n=K(a),r=await $(e,pe,"prepareUserOperation")({...t,account:n});return r.signature=await n.signUserOperation(r),r}async function Wr(e){const t=e.account;if(!t)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const a=K(t);try{return await $(e,ue,"readContract")({abi:de,address:a.address,functionName:"currentNonce",args:[]})}catch{return 1}}const Ta=async e=>{const t=await e.request({method:"zd_getUserOperationGasPrice",params:[]});return{maxFeePerGas:BigInt(t.standard.maxFeePerGas),maxPriorityFeePerGas:BigInt(t.standard.maxPriorityFeePerGas)}};async function Ea(e,t){let a;if("to"in t){const{account:r=e.account,data:p,maxFeePerGas:i,maxPriorityFeePerGas:u,to:s,value:y,nonce:o}=t;if(!r)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const m=K(r);if(!s)throw new Error("Missing to address");a=await $(e,ne,"sendUserOperation")({calls:[{to:s,value:y||BigInt(0),data:p||"0x"}],account:m,maxFeePerGas:i,maxPriorityFeePerGas:u,nonce:o?BigInt(o):void 0})}else a=await $(e,ne,"sendUserOperation")({...t});const n=await $(e,ma,"waitForUserOperationReceipt")({hash:a});return n==null?void 0:n.receipt.transactionHash}async function Yr(e,{account:t=e.account,message:a}){if(!t)throw new te({docsPath:"/docs/actions/wallet/signMessage"});return K(t).signMessage({message:a})}async function qr(e,{account:t=e.account,domain:a,message:n,primaryType:r,types:p}){if(!t)throw new te({docsPath:"/docs/actions/wallet/signMessage"});const i=K(t),u={EIP712Domain:tn({domain:a}),...p};return an({domain:a,message:n,primaryType:r,types:u}),i.signTypedData({domain:a,primaryType:r,types:u,message:n})}async function Zr(e,{abi:t,address:a,args:n,dataSuffix:r,functionName:p,...i}){const u=B({abi:t,args:n,functionName:p});return await $(e,Ea,"sendTransaction")({data:`${u}${r?r.replace("0x",""):""}`,to:a,...i})}const Jr=async(e,t)=>{var p;const a=await e.request({method:"stackup_getERC20TokenQuotes",params:[{chainId:(p=e.chain)==null?void 0:p.id,userOp:{...Se(t.userOperation),initCode:t.userOperation.initCode||"0x"},tokenAddress:t.gasTokenAddress,entryPointAddress:t.entryPoint??ra}]}),n={maxGasCostToken:a.maxGasCostToken,tokenDecimals:a.tokenDecimals};return{amount:Number(n.maxGasCostToken)/10**Number(n.tokenDecimals)}},As=()=>e=>({sponsorUserOperation:async t=>kr(e,{...t}),estimateGasInERC20:async t=>Jr(e,t)});function Qt(){return e=>({signUserOperation:t=>Xr(e,t),getUserOperationGasPrice:async()=>Ta(e),uninstallPlugin:async t=>Kr(e,t),changeSudoValidator:async t=>zr(e,t),invalidateNonce:async t=>jr(e,t),getKernelV3ModuleCurrentNonce:async()=>Wr(e),upgradeKernel:async t=>Hr(e,t),sendTransaction:t=>Ea(e,t),signMessage:t=>Yr(e,t),signTypedData:t=>qr(e,t),writeContract:t=>Zr(e,t)})}function Ds(e){var y,o;const{client:t,key:a="Account",name:n="Kernel Account Client",paymaster:r,paymasterContext:p,bundlerTransport:i,userOperation:u}=e,s=Object.assign(nn({...e,chain:e.chain??(t==null?void 0:t.chain),transport:i,key:a,name:n,type:"kernelAccountClient",pollingInterval:e.pollingInterval??1e3}),{client:t,paymaster:r,paymasterContext:p,userOperation:u});if((y=e.userOperation)!=null&&y.prepareUserOperation){const m=e.userOperation.prepareUserOperation;return s.extend(we).extend(v=>({prepareUserOperation:A=>m(v,A)})).extend(we).extend(v=>({prepareUserOperation:A=>m(v,A)})).extend(Qt())}return(o=s.userOperation)!=null&&o.estimateFeesPerGas||(s.userOperation={...s.userOperation,estimateFeesPerGas:async({bundlerClient:m})=>await Ta(m)}),s.extend(we).extend(m=>({prepareUserOperation:async v=>{var d,l,b;let A=v;if((d=m.account)!=null&&d.authorization){const P=v.authorization||await((b=(l=m.account)==null?void 0:l.eip7702Authorization)==null?void 0:b.call(l));A={...v,authorization:P}}return await pe(m,A)}})).extend(we).extend(m=>({prepareUserOperation:async v=>{var d,l,b;let A=v;if((d=m.account)!=null&&d.authorization){const P=v.authorization||await((b=(l=m.account)==null?void 0:l.eip7702Authorization)==null?void 0:b.call(l));A={...v,authorization:P}}return await pe(m,A)}})).extend(Qt())}export{Xr as $,Is as A,Yt as B,de as C,Ke as D,As as E,ms as F,qt as G,Ds as H,te as I,Wt as J,Es as K,jt as L,fa as M,zr as N,Se as O,cs as P,ds as Q,Mr as R,Ps as S,Kt as T,Xt as U,Zt as V,Br as W,Ta as X,jr as Y,$r as Z,Qt as _,gr as a,kr as a0,Kr as a1,Hr as a2,pe as a3,fs as b,os as c,Ts as d,ys as e,ss as f,hr as g,is as h,hs as i,ps as j,un as k,ls as l,bs as m,gs as n,Jt as o,us as p,xs as q,je as r,ie as s,ir as t,Q as u,Dr as v,Os as w,vs as x,Lr as y,ws as z}; +`,a&&`factory: ${a}`,n&&`factoryData: ${n}`,r&&`initCode: ${r}`,p&&`sender: ${p}`].filter(Boolean),name:"InitCodeMustReturnSenderError"})}}Object.defineProperty(rt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa14/});class st extends I{constructor({cause:t}){super("Smart Account does not have sufficient funds to execute the User Operation.",{cause:t,metaMessages:["This could arise when:","- the Smart Account does not have sufficient funds to cover the required prefund, or","- a Paymaster was not provided"].filter(Boolean),name:"InsufficientPrefundError"})}}Object.defineProperty(st,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa21/});class it extends I{constructor({cause:t}){super("Bundler attempted to call an invalid function on the EntryPoint.",{cause:t,name:"InternalCallOnlyError"})}}Object.defineProperty(it,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa92/});class ot extends I{constructor({cause:t}){super("Bundler used an invalid aggregator for handling aggregated User Operations.",{cause:t,name:"InvalidAggregatorError"})}}Object.defineProperty(ot,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa96/});class pt extends I{constructor({cause:t,nonce:a}){super("Invalid Smart Account nonce used for User Operation.",{cause:t,metaMessages:[a&&`nonce: ${a}`].filter(Boolean),name:"InvalidAccountNonceError"})}}Object.defineProperty(pt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa25/});class ut extends I{constructor({cause:t}){super("Bundler has not set a beneficiary address.",{cause:t,name:"InvalidBeneficiaryError"})}}Object.defineProperty(ut,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa90/});class xe extends I{constructor({cause:t}){super("Invalid fields set on User Operation.",{cause:t,name:"InvalidFieldsError"})}}Object.defineProperty(xe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32602});class yt extends I{constructor({cause:t,paymasterAndData:a}){super("Paymaster properties provided are invalid.",{cause:t,metaMessages:["This could arise when:","- the `paymasterAndData` property is of an incorrect length\n",a&&`paymasterAndData: ${a}`].filter(Boolean),name:"InvalidPaymasterAndDataError"})}}Object.defineProperty(yt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa93/});class re extends I{constructor({cause:t}){super("Paymaster deposit for the User Operation is too low.",{cause:t,metaMessages:["This could arise when:","- the Paymaster has deposited less than the expected amount via the `deposit` function"].filter(Boolean),name:"PaymasterDepositTooLowError"})}}Object.defineProperty(re,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32508});Object.defineProperty(re,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa31/});class lt extends I{constructor({cause:t}){super("The `validatePaymasterUserOp` function on the Paymaster reverted.",{cause:t,name:"PaymasterFunctionRevertedError"})}}Object.defineProperty(lt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa33/});class dt extends I{constructor({cause:t}){super("The Paymaster contract has not been deployed.",{cause:t,name:"PaymasterNotDeployedError"})}}Object.defineProperty(dt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa30/});class Oe extends I{constructor({cause:t}){super("UserOperation rejected because paymaster (or signature aggregator) is throttled/banned.",{cause:t,name:"PaymasterRateLimitError"})}}Object.defineProperty(Oe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32504});class Pe extends I{constructor({cause:t}){super("UserOperation rejected because paymaster (or signature aggregator) is throttled/banned.",{cause:t,name:"PaymasterStakeTooLowError"})}}Object.defineProperty(Pe,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32505});class ct extends I{constructor({cause:t}){super("Paymaster `postOp` function reverted.",{cause:t,name:"PaymasterPostOpFunctionRevertedError"})}}Object.defineProperty(ct,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa50/});class mt extends I{constructor({cause:t,factory:a,factoryData:n,initCode:r}){super("Smart Account has already been deployed.",{cause:t,metaMessages:["Remove the following properties and try again:",a&&"`factory`",n&&"`factoryData`",r&&"`initCode`"].filter(Boolean),name:"SenderAlreadyConstructedError"})}}Object.defineProperty(mt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa10/});class Ae extends I{constructor({cause:t}){super("UserOperation rejected because account signature check failed (or paymaster signature, if the paymaster uses its data as signature).",{cause:t,name:"SignatureCheckFailedError"})}}Object.defineProperty(Ae,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32507});class ft extends I{constructor({cause:t}){super("The `validateUserOp` function on the Smart Account reverted.",{cause:t,name:"SmartAccountFunctionRevertedError"})}}Object.defineProperty(ft,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa23/});class De extends I{constructor({cause:t}){super("UserOperation rejected because account specified unsupported signature aggregator.",{cause:t,name:"UnsupportedSignatureAggregatorError"})}}Object.defineProperty(De,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32506});class bt extends I{constructor({cause:t}){super("User Operation expired.",{cause:t,metaMessages:["This could arise when:","- the `validAfter` or `validUntil` values returned from `validateUserOp` on the Smart Account are not satisfied"].filter(Boolean),name:"UserOperationExpiredError"})}}Object.defineProperty(bt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa22/});class gt extends I{constructor({cause:t}){super("Paymaster for User Operation expired.",{cause:t,metaMessages:["This could arise when:","- the `validAfter` or `validUntil` values returned from `validatePaymasterUserOp` on the Paymaster are not satisfied"].filter(Boolean),name:"UserOperationPaymasterExpiredError"})}}Object.defineProperty(gt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa32/});class ht extends I{constructor({cause:t}){super("Signature provided for the User Operation is invalid.",{cause:t,metaMessages:["This could arise when:","- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Smart Account"].filter(Boolean),name:"UserOperationSignatureError"})}}Object.defineProperty(ht,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa24/});class Tt extends I{constructor({cause:t}){super("Signature provided for the User Operation is invalid.",{cause:t,metaMessages:["This could arise when:","- the `signature` for the User Operation is incorrectly computed, and unable to be verified by the Paymaster"].filter(Boolean),name:"UserOperationPaymasterSignatureError"})}}Object.defineProperty(Tt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa34/});class Re extends I{constructor({cause:t}){super("User Operation rejected by EntryPoint's `simulateValidation` during account creation or validation.",{cause:t,name:"UserOperationRejectedByEntryPointError"})}}Object.defineProperty(Re,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32500});class Ge extends I{constructor({cause:t}){super("User Operation rejected by Paymaster's `validatePaymasterUserOp`.",{cause:t,name:"UserOperationRejectedByPaymasterError"})}}Object.defineProperty(Ge,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32501});class Le extends I{constructor({cause:t}){super("User Operation rejected with op code validation error.",{cause:t,name:"UserOperationRejectedByOpCodeError"})}}Object.defineProperty(Le,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32502});class Ce extends I{constructor({cause:t}){super("UserOperation out of time-range: either wallet or paymaster returned a time-range, and it is already expired (or will expire soon).",{cause:t,name:"UserOperationOutOfTimeRangeError"})}}Object.defineProperty(Ce,"code",{enumerable:!0,configurable:!0,writable:!0,value:-32503});class or extends I{constructor({cause:t}){super(`An error occurred while executing user operation: ${t==null?void 0:t.shortMessage}`,{cause:t,name:"UnknownBundlerError"})}}class Et extends I{constructor({cause:t}){super("User Operation verification gas limit exceeded.",{cause:t,metaMessages:["This could arise when:","- the gas used for verification exceeded the `verificationGasLimit`"].filter(Boolean),name:"VerificationGasLimitExceededError"})}}Object.defineProperty(Et,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa40/});class vt extends I{constructor({cause:t}){super("User Operation verification gas limit is too low.",{cause:t,metaMessages:["This could arise when:","- the `verificationGasLimit` is too low to verify the User Operation"].filter(Boolean),name:"VerificationGasLimitTooLowError"})}}Object.defineProperty(vt,"message",{enumerable:!0,configurable:!0,writable:!0,value:/aa41/});class pr extends I{constructor(t,{callData:a,callGasLimit:n,docsPath:r,factory:p,factoryData:i,initCode:u,maxFeePerGas:s,maxPriorityFeePerGas:y,nonce:o,paymaster:m,paymasterAndData:w,paymasterData:A,paymasterPostOpGasLimit:d,paymasterVerificationGasLimit:l,preVerificationGas:b,sender:P,signature:L,verificationGasLimit:R}){const F=Da({callData:a,callGasLimit:n,factory:p,factoryData:i,initCode:u,maxFeePerGas:typeof s<"u"&&`${Gt(s)} gwei`,maxPriorityFeePerGas:typeof y<"u"&&`${Gt(y)} gwei`,nonce:o,paymaster:m,paymasterAndData:w,paymasterData:A,paymasterPostOpGasLimit:d,paymasterVerificationGasLimit:l,preVerificationGas:b,sender:P,signature:L,verificationGasLimit:R});super(t.shortMessage,{cause:t,docsPath:r,metaMessages:[...t.metaMessages?[...t.metaMessages," "]:[],"Request Arguments:",F].filter(Boolean),name:"UserOperationExecutionError"}),Object.defineProperty(this,"cause",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.cause=t}}class ur extends I{constructor({hash:t}){super(`User Operation receipt with hash "${t}" could not be found. The User Operation may not have been processed yet.`,{name:"UserOperationReceiptNotFoundError"})}}class yr extends I{constructor({hash:t}){super(`User Operation with hash "${t}" could not be found.`,{name:"UserOperationNotFoundError"})}}class zt extends I{constructor({hash:t}){super(`Timed out while waiting for User Operation with hash "${t}" to be confirmed.`,{name:"WaitForUserOperationReceiptTimeoutError"})}}const lr=[oe,xe,re,Oe,Pe,Ae,De,Ce,Re,Ge,Le];function dr(e,t){const a=(e.details||"").toLowerCase();if(Je.message.test(a))return new Je({cause:e});if(Qe.message.test(a))return new Qe({cause:e});if(et.message.test(a))return new et({cause:e});if(tt.message.test(a))return new tt({cause:e});if(at.message.test(a))return new at({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(nt.message.test(a))return new nt({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(rt.message.test(a))return new rt({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode,sender:t.sender});if(st.message.test(a))return new st({cause:e});if(it.message.test(a))return new it({cause:e});if(pt.message.test(a))return new pt({cause:e,nonce:t.nonce});if(ot.message.test(a))return new ot({cause:e});if(ut.message.test(a))return new ut({cause:e});if(yt.message.test(a))return new yt({cause:e});if(re.message.test(a))return new re({cause:e});if(lt.message.test(a))return new lt({cause:e});if(dt.message.test(a))return new dt({cause:e});if(ct.message.test(a))return new ct({cause:e});if(ft.message.test(a))return new ft({cause:e});if(mt.message.test(a))return new mt({cause:e,factory:t.factory,factoryData:t.factoryData,initCode:t.initCode});if(bt.message.test(a))return new bt({cause:e});if(gt.message.test(a))return new gt({cause:e});if(Tt.message.test(a))return new Tt({cause:e});if(ht.message.test(a))return new ht({cause:e});if(Et.message.test(a))return new Et({cause:e});if(vt.message.test(a))return new vt({cause:e});const n=e.walk(r=>lr.some(p=>p.code===r.code));if(n){if(n.code===oe.code)return new oe({cause:e,data:n.data,message:n.details});if(n.code===xe.code)return new xe({cause:e});if(n.code===re.code)return new re({cause:e});if(n.code===Oe.code)return new Oe({cause:e});if(n.code===Pe.code)return new Pe({cause:e});if(n.code===Ae.code)return new Ae({cause:e});if(n.code===De.code)return new De({cause:e});if(n.code===Ce.code)return new Ce({cause:e});if(n.code===Re.code)return new Re({cause:e});if(n.code===Ge.code)return new Ge({cause:e});if(n.code===Le.code)return new Le({cause:e})}return new or({cause:e})}function la(e,{calls:t,docsPath:a,...n}){const r=(()=>{const p=dr(e,n);if(t&&p instanceof oe){const i=cr(p),u=t==null?void 0:t.filter(s=>s.abi);if(i&&u.length>0)return mr({calls:u,revertData:i})}return p})();return new pr(r,{docsPath:a,...n})}function cr(e){let t;return e.walk(a=>{var r,p,i,u;const n=a;if(typeof n.data=="string"||typeof((r=n.data)==null?void 0:r.revertData)=="string"||!(n instanceof I)&&typeof n.message=="string"){const s=(u=(i=((p=n.data)==null?void 0:p.revertData)||n.data||n.message).match)==null?void 0:u.call(i,/(0x[A-Za-z0-9]*)/);if(s)return t=s[1],!0}return!1}),t}function mr(e){const{calls:t,revertData:a}=e,{abi:n,functionName:r,args:p,to:i}=(()=>{const s=t==null?void 0:t.filter(o=>!!o.abi);if(s.length===1)return s[0];const y=s.filter(o=>{try{return!!we({abi:o.abi,data:a})}catch{return!1}});return y.length===1?y[0]:{abi:[],functionName:s.reduce((o,m)=>`${o?`${o} | `:""}${m.functionName}`,""),args:void 0,to:void 0}})(),u=a==="0x"?new Ra({functionName:r}):new Xe({abi:n,data:a,functionName:r});return new Ga(u,{abi:n,args:p,contractAddress:i,functionName:r})}function fr(e){const t={};return e.callGasLimit&&(t.callGasLimit=BigInt(e.callGasLimit)),e.preVerificationGas&&(t.preVerificationGas=BigInt(e.preVerificationGas)),e.verificationGasLimit&&(t.verificationGasLimit=BigInt(e.verificationGasLimit)),e.paymasterPostOpGasLimit&&(t.paymasterPostOpGasLimit=BigInt(e.paymasterPostOpGasLimit)),e.paymasterVerificationGasLimit&&(t.paymasterVerificationGasLimit=BigInt(e.paymasterVerificationGasLimit)),t}function Ue(e){const t={};return typeof e.callData<"u"&&(t.callData=e.callData),typeof e.callGasLimit<"u"&&(t.callGasLimit=N(e.callGasLimit)),typeof e.factory<"u"&&(t.factory=e.factory),typeof e.factoryData<"u"&&(t.factoryData=e.factoryData),typeof e.initCode<"u"&&(t.initCode=e.initCode),typeof e.maxFeePerGas<"u"&&(t.maxFeePerGas=N(e.maxFeePerGas)),typeof e.maxPriorityFeePerGas<"u"&&(t.maxPriorityFeePerGas=N(e.maxPriorityFeePerGas)),typeof e.nonce<"u"&&(t.nonce=N(e.nonce)),typeof e.paymaster<"u"&&(t.paymaster=e.paymaster),typeof e.paymasterAndData<"u"&&(t.paymasterAndData=e.paymasterAndData||"0x"),typeof e.paymasterData<"u"&&(t.paymasterData=e.paymasterData),typeof e.paymasterPostOpGasLimit<"u"&&(t.paymasterPostOpGasLimit=N(e.paymasterPostOpGasLimit)),typeof e.paymasterSignature<"u"&&(t.paymasterSignature=e.paymasterSignature),typeof e.paymasterVerificationGasLimit<"u"&&(t.paymasterVerificationGasLimit=N(e.paymasterVerificationGasLimit)),typeof e.preVerificationGas<"u"&&(t.preVerificationGas=N(e.preVerificationGas)),typeof e.sender<"u"&&(t.sender=e.sender),typeof e.signature<"u"&&(t.signature=e.signature),typeof e.verificationGasLimit<"u"&&(t.verificationGasLimit=N(e.verificationGasLimit)),typeof e.authorization<"u"&&(t.eip7702Auth=br(e.authorization)),t}function br(e){return{address:e.address,chainId:N(e.chainId),nonce:N(e.nonce),r:e.r?N(BigInt(e.r),{size:32}):M("0x",{size:32}),s:e.s?N(BigInt(e.s),{size:32}):M("0x",{size:32}),yParity:e.yParity?N(e.yParity,{size:1}):M("0x",{size:32})}}async function gr(e,t){const{chainId:a,entryPointAddress:n,context:r,...p}=t,i=Ue(p),{paymasterPostOpGasLimit:u,paymasterVerificationGasLimit:s,...y}=await e.request({method:"pm_getPaymasterData",params:[{...i,callGasLimit:i.callGasLimit??"0x0",verificationGasLimit:i.verificationGasLimit??"0x0",preVerificationGas:i.preVerificationGas??"0x0"},n,N(a),r]});return{...y,...u&&{paymasterPostOpGasLimit:me(u)},...s&&{paymasterVerificationGasLimit:me(s)}}}async function hr(e,t){const{chainId:a,entryPointAddress:n,context:r,...p}=t,i=Ue(p),{paymasterPostOpGasLimit:u,paymasterVerificationGasLimit:s,...y}=await e.request({method:"pm_getPaymasterStubData",params:[{...i,callGasLimit:i.callGasLimit??"0x0",verificationGasLimit:i.verificationGasLimit??"0x0",preVerificationGas:i.preVerificationGas??"0x0"},n,N(a),r]});return{...y,...u&&{paymasterPostOpGasLimit:me(u)},...s&&{paymasterVerificationGasLimit:me(s)}}}const Tr=["factory","fees","gas","paymaster","nonce","signature","authorization"];async function pe(e,t){var V,_;const a=t,{account:n=e.account,dataSuffix:r=typeof e.dataSuffix=="string"?e.dataSuffix:(V=e.dataSuffix)==null?void 0:V.value,parameters:p=Tr,stateOverride:i}=a;if(!n)throw new wt;const u=K(n),s=e,y=a.paymaster??(s==null?void 0:s.paymaster),o=typeof y=="string"?y:void 0,{getPaymasterStubData:m,getPaymasterData:w}=(()=>{if(y===!0)return{getPaymasterStubData:x=>$(s,hr,"getPaymasterStubData")(x),getPaymasterData:x=>$(s,gr,"getPaymasterData")(x)};if(typeof y=="object"){const{getPaymasterStubData:x,getPaymasterData:G}=y;return{getPaymasterStubData:G&&x?x:G,getPaymasterData:G&&x?G:void 0}}return{getPaymasterStubData:void 0,getPaymasterData:void 0}})(),A=a.paymasterContext?a.paymasterContext:s==null?void 0:s.paymasterContext;let d={...a,paymaster:o,sender:u.address};const[l,b,P,L,R]=await Promise.all([(async()=>a.calls?u.encodeCalls(a.calls.map(x=>{const G=x;return G.abi?{data:B(G),to:G.to,value:G.value}:G})):a.callData)(),(async()=>{if(!p.includes("factory"))return;if(a.initCode)return{initCode:a.initCode};if(a.factory&&a.factoryData)return{factory:a.factory,factoryData:a.factoryData};const{factory:x,factoryData:G}=await u.getFactoryArgs();return u.entryPoint.version==="0.6"?{initCode:x&&G?z([x,G]):void 0}:{factory:x,factoryData:G}})(),(async()=>{var x;if(p.includes("fees")){if(typeof a.maxFeePerGas=="bigint"&&typeof a.maxPriorityFeePerGas=="bigint")return d;if((x=s==null?void 0:s.userOperation)!=null&&x.estimateFeesPerGas){const G=await s.userOperation.estimateFeesPerGas({account:u,bundlerClient:s,userOperation:d});return{...d,...G}}try{const G=s.client??e,X=await $(G,La,"estimateFeesPerGas")({chain:G.chain,type:"eip1559"});return{maxFeePerGas:typeof a.maxFeePerGas=="bigint"?a.maxFeePerGas:BigInt(2n*X.maxFeePerGas),maxPriorityFeePerGas:typeof a.maxPriorityFeePerGas=="bigint"?a.maxPriorityFeePerGas:BigInt(2n*X.maxPriorityFeePerGas)}}catch{return}}})(),(async()=>{if(p.includes("nonce"))return typeof a.nonce=="bigint"?a.nonce:u.getNonce()})(),(async()=>{if(p.includes("authorization")){if(typeof a.authorization=="object")return a.authorization;if(u.authorization&&!await u.isDeployed())return{...await Ca(u.client,u.authorization),r:"0xfffffffffffffffffffffffffffffff000000000000000000000000000000000",s:"0x7aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",yParity:1}}})()]);typeof l<"u"&&(d.callData=r?z([l,r]):l),typeof b<"u"&&(d={...d,...b}),typeof P<"u"&&(d={...d,...P}),typeof L<"u"&&(d.nonce=L),typeof R<"u"&&(d.authorization=R),p.includes("signature")&&(typeof a.signature<"u"?d.signature=a.signature:d.signature=await u.getStubSignature(d)),u.entryPoint.version==="0.6"&&!d.initCode&&(d.initCode="0x");let F;async function T(){return F||(e.chain?e.chain.id:(F=await $(e,Ie,"getChainId")({}),F))}let S=!1;if(p.includes("paymaster")&&m&&!o&&!a.paymasterAndData){const{isFinal:x=!1,sponsor:G,...X}=await m({chainId:await T(),entryPointAddress:u.entryPoint.address,context:A,...d});S=x,d={...d,...X}}if(u.entryPoint.version==="0.6"&&!d.paymasterAndData&&(d.paymasterAndData="0x"),p.includes("gas")){if((_=u.userOperation)!=null&&_.estimateGas){const x=await u.userOperation.estimateGas(d);d={...d,...x}}if(typeof d.callGasLimit>"u"||typeof d.preVerificationGas>"u"||typeof d.verificationGasLimit>"u"||d.paymaster&&typeof d.paymasterPostOpGasLimit>"u"||d.paymaster&&typeof d.paymasterVerificationGasLimit>"u"){const x=await $(s,da,"estimateUserOperationGas")({account:u,callGasLimit:0n,preVerificationGas:0n,verificationGasLimit:0n,stateOverride:i,...d.paymaster?{paymasterPostOpGasLimit:0n,paymasterVerificationGasLimit:0n}:{},...d});d={...d,callGasLimit:d.callGasLimit??x.callGasLimit,preVerificationGas:d.preVerificationGas??x.preVerificationGas,verificationGasLimit:d.verificationGasLimit??x.verificationGasLimit,paymasterPostOpGasLimit:d.paymasterPostOpGasLimit??x.paymasterPostOpGasLimit,paymasterVerificationGasLimit:d.paymasterVerificationGasLimit??x.paymasterVerificationGasLimit}}}if(p.includes("paymaster")&&w&&!o&&!a.paymasterAndData&&!S){const x=await w({chainId:await T(),entryPointAddress:u.entryPoint.address,context:A,...d});d={...d,...x}}return delete d.calls,delete d.parameters,delete d.paymasterContext,typeof d.paymaster!="string"&&delete d.paymaster,d}async function da(e,t){var s;const{account:a=e.account,entryPointAddress:n,stateOverride:r}=t;if(!a&&!t.sender)throw new wt;const p=a?K(a):void 0,i=Sa(r),u=p?await $(e,pe,"prepareUserOperation")({...t,parameters:["authorization","factory","nonce","paymaster","signature"]}):t;try{const y=[Ue(u),n??((s=p==null?void 0:p.entryPoint)==null?void 0:s.address)],o=await e.request({method:"eth_estimateUserOperationGas",params:i?[...y,i]:[...y]});return fr(o)}catch(y){const o=t.calls;throw la(y,{...u,...o?{calls:o}:{}})}}function Er(e){return e.request({method:"eth_supportedEntryPoints"})}function vr(e){const t={...e};return e.callGasLimit&&(t.callGasLimit=BigInt(e.callGasLimit)),e.maxFeePerGas&&(t.maxFeePerGas=BigInt(e.maxFeePerGas)),e.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=BigInt(e.maxPriorityFeePerGas)),e.nonce&&(t.nonce=BigInt(e.nonce)),e.paymasterPostOpGasLimit&&(t.paymasterPostOpGasLimit=BigInt(e.paymasterPostOpGasLimit)),e.paymasterVerificationGasLimit&&(t.paymasterVerificationGasLimit=BigInt(e.paymasterVerificationGasLimit)),e.preVerificationGas&&(t.preVerificationGas=BigInt(e.preVerificationGas)),e.verificationGasLimit&&(t.verificationGasLimit=BigInt(e.verificationGasLimit)),t}async function wr(e,{hash:t}){const a=await e.request({method:"eth_getUserOperationByHash",params:[t]},{dedupe:!0});if(!a)throw new yr({hash:t});const{blockHash:n,blockNumber:r,entryPoint:p,transactionHash:i,userOperation:u}=a;return{blockHash:n,blockNumber:BigInt(r),entryPoint:p,transactionHash:i,userOperation:vr(u)}}function Ir(e){const t={...e};return e.actualGasCost&&(t.actualGasCost=BigInt(e.actualGasCost)),e.actualGasUsed&&(t.actualGasUsed=BigInt(e.actualGasUsed)),e.logs&&(t.logs=e.logs.map(a=>Na(a))),e.receipt&&(t.receipt=Ma(t.receipt)),t}async function ca(e,{hash:t}){const a=await e.request({method:"eth_getUserOperationReceipt",params:[t]},{dedupe:!0});if(!a)throw new ur({hash:t});return Ir(a)}async function ne(e,t){var s,y;const{account:a=e.account,entryPointAddress:n}=t;if(!a&&!t.sender)throw new wt;const r=a?K(a):void 0,p=r?await $(e,pe,"prepareUserOperation")(t):t,i=t.signature||await((s=r==null?void 0:r.signUserOperation)==null?void 0:s.call(r,p)),u=Ue({...p,signature:i});try{return await e.request({method:"eth_sendUserOperation",params:[u,n??((y=r==null?void 0:r.entryPoint)==null?void 0:y.address)]},{retryCount:0})}catch(o){const m=t.calls;throw la(o,{...p,...m?{calls:m}:{},signature:i})}}function ma(e,t){const{hash:a,pollingInterval:n=e.pollingInterval,retryCount:r,timeout:p=12e4}=t;let i=0;const u=$a(["waitForUserOperationReceipt",e.uid,a]);return new Promise((s,y)=>{const o=Ua(u,{resolve:s,reject:y},m=>{const w=l=>{d(),l(),o()},A=p?setTimeout(()=>w(()=>m.reject(new zt({hash:a}))),p):void 0,d=Fa(async()=>{r&&i>=r&&(clearTimeout(A),w(()=>m.reject(new zt({hash:a}))));try{const l=await $(e,ca,"getUserOperationReceipt")({hash:a});clearTimeout(A),w(()=>m.resolve(l))}catch(l){const b=l;b.name!=="UserOperationReceiptNotFoundError"&&(clearTimeout(A),w(()=>m.reject(b)))}i++},{emitOnBegin:!0,interval:n});return d})})}function ve(e){return{estimateUserOperationGas:t=>da(e,t),getChainId:()=>Ie(e),getSupportedEntryPoints:()=>Er(e),getUserOperation:t=>wr(e,t),getUserOperationReceipt:t=>ca(e,t),prepareUserOperation:t=>pe(e,t),sendUserOperation:t=>ne(e,t),waitForUserOperationReceipt:t=>ma(e,t)}}const us=async(e,t)=>{const{address:a,entryPointAddress:n,key:r=BigInt(0)}=t;return await $(e,ue,"readContract")({address:n,abi:[{inputs:[{name:"sender",type:"address"},{name:"key",type:"uint192"}],name:"getNonce",outputs:[{name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"}],functionName:"getNonce",args:[a,r]})};class xr extends I{constructor({cause:t,entryPointAddress:a}={}){super(`The entry point address (\`entryPoint\`${a?` = ${a}`:""}) is not a valid entry point. getSenderAddress did not revert with a SenderAddressResult error.`,{cause:t}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"InvalidEntryPointError"})}}const ys=async(e,t)=>{var i,u,s,y,o,m,w,A;const{initCode:a,entryPointAddress:n,factory:r,factoryData:p}=t;if(!a&&!r&&!p)throw new Error("Either `initCode` or `factory` and `factoryData` must be provided");try{await $(e,Va,"simulateContract")({address:n,abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"},{inputs:[{internalType:"bytes",name:"initCode",type:"bytes"}],name:"getSenderAddress",outputs:[],stateMutability:"nonpayable",type:"function"}],functionName:"getSenderAddress",args:[a||z([r,p])]})}catch(d){const l=d.walk(b=>b instanceof Xe||b instanceof Lt||b instanceof Ct||b instanceof St);if(!l){const b=d.cause;if((((i=b==null?void 0:b.data)==null?void 0:i.errorName)??"")==="SenderAddressResult"&&((u=b==null?void 0:b.data)!=null&&u.args)&&((s=b==null?void 0:b.data)!=null&&s.args[0]))return(y=b.data)==null?void 0:y.args[0]}if(l instanceof Xe&&(((o=l.data)==null?void 0:o.errorName)??"")==="SenderAddressResult"&&(m=l.data)!=null&&m.args&&(w=l.data)!=null&&w.args[0])return(A=l.data)==null?void 0:A.args[0];if(l instanceof Lt){const b=/0x[a-fA-F0-9]+/,P=l.cause.data.match(b);if(!P)throw new Error("Failed to parse revert bytes from RPC response");const L=P[0];return we({abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"}],data:L}).args[0]}if(l instanceof Ct){const{data:b}=d instanceof _a?d:d instanceof I?d.walk(R=>"data"in R)||d.walk():{},P=typeof b=="string"?b:b==null?void 0:b.data;if(P===void 0)throw new Error("Failed to parse revert bytes from RPC response");return we({abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"}],data:P}).args[0]}if(l instanceof St){const P=JSON.parse(l.cause.body).error.data,L=/0x[a-fA-F0-9]+/,R=P.match(L);if(!R)throw new Error("Failed to parse revert bytes from RPC response");const F=R[0];return we({abi:[{inputs:[{internalType:"address",name:"sender",type:"address"}],name:"SenderAddressResult",type:"error"}],data:F}).args[0]}throw d}throw new xr({entryPointAddress:n})},Or=[{type:"function",name:"isInitialized",inputs:[{name:"smartAccount",type:"address",internalType:"address"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"}],Pr=[{inputs:[{internalType:"uint256",name:"moduleType",type:"uint256"},{internalType:"address",name:"module",type:"address"},{internalType:"bytes",name:"initData",type:"bytes"}],stateMutability:"payable",type:"function",name:"installModule"}],Ar=[{inputs:[{internalType:"uint256",name:"moduleType",type:"uint256"},{internalType:"address",name:"module",type:"address"},{internalType:"bytes",name:"additionalContext",type:"bytes"}],stateMutability:"view",type:"function",name:"isModuleInstalled",outputs:[{internalType:"bool",name:"",type:"bool"}]}],ls=async(e,t)=>{const{address:a,plugin:n}=t,{type:r,address:p,data:i="0x"}=n;try{return await $(e,ue,"readContract")({address:a,abi:Ar,functionName:"isModuleInstalled",args:[BigInt(r),p,i]})}catch{return!1}};var Q;(function(e){e.ERC1271_SIG_WRAPPER="ERC1271_SIG_WRAPPER",e.ERC1271_WITH_VALIDATOR="ERC1271_WITH_VALIDATOR",e.ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH="ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH",e.ERC1271_REPLAYABLE="ERC1271_REPLAYABLE"})(Q||(Q={}));const jt={[Q.ERC1271_SIG_WRAPPER]:">=0.2.3 || >=0.3.0-beta",[Q.ERC1271_WITH_VALIDATOR]:">=0.3.0-beta",[Q.ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH]:">=0.3.0-beta",[Q.ERC1271_REPLAYABLE]:">=0.3.2"},je=(e,t)=>e in jt?ie.satisfies(t,jt[e]):!1,ds=async(e,{gasToken:t,approveAmount:a,entryPoint:n})=>{var p;const r=await e.request({method:"zd_pm_accounts",params:[{chainId:(p=e.chain)==null?void 0:p.id,entryPointAddress:n.address}]});return{to:t,data:B({abi:Ba,functionName:"approve",args:[r[0],a]}),value:0n}},cs=e=>{let t=e;if(!Nt(t)&&(t=`0x${t}`,!Nt(t)))throw new Error(`Invalid signed data ${e}`);let{r:a,s:n,v:r}=ln(t);return(r===0n||r===1n)&&(r+=27n),ka({r:a,s:n,v:r})},Kt=({callType:e,execType:t})=>Y([e,t,"0x00000000","0x00000000",M("0x00000000",{size:22})]),Dr=(e,t)=>{if(e==="0.6"&&!ie.satisfies(t,">=0.2.2 || <=0.2.4")||e==="0.7"&&!ie.satisfies(t,">=0.3.0"))throw new Error("KernelVersion should be >= 0.2.2 and <= 0.2.4 for EntryPointV0.6 and >= 0.3.0 for EntryPointV0.7")},ms=(e,t)=>ie.satisfies(e,t);function Se(e){if(typeof e!="function")return e==null||typeof e=="string"||typeof e=="boolean"?e:typeof e=="bigint"||typeof e=="number"?J(e):e._isBigNumber!=null||typeof e!="object"?J(e).replace(/^0x0/,"0x"):Array.isArray(e)?e.map(t=>Se(t)):Object.keys(e).reduce((t,a)=>(t[a]=Se(e[a]),t),{})}async function fs({signer:e,address:t}){if("type"in e&&(e.type==="local"||e.type==="smart"))return e;let a;if("request"in e&&!(e!=null&&e.account)){if(t||(t=(await Promise.any([e.request({method:"eth_requestAccounts"}),e.request({method:"eth_accounts"})]))[0]),!t)throw new Error("address is required");a=Ha({account:t,transport:za(e)})}return a||(a=e),ir({address:a.account.address,async signMessage({message:n}){return Xa(a,{message:n})},async signTypedData(n){const{primaryType:r,domain:p,message:i,types:u}=n;return Ka(a,{primaryType:r,domain:p,message:i,types:u})},async signTransaction(n){throw new Error("Smart account signer doesn't need to sign transactions")},async signAuthorization(n){return ja(a,n)}})}const Pt=[{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"",type:"uint8"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct Call[]",name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"executeDelegateCall",outputs:[],stateMutability:"payable",type:"function"}],bs=[{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"}],fa=[{inputs:[{internalType:"contract IEntryPoint",name:"_entryPoint",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AlreadyInitialized",type:"error"},{inputs:[],name:"DisabledMode",type:"error"},{inputs:[],name:"NotAuthorizedCaller",type:"error"},{inputs:[],name:"NotEntryPoint",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"oldValidator",type:"address"},{indexed:!0,internalType:"address",name:"newValidator",type:"address"}],name:"DefaultValidatorChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes4",name:"selector",type:"bytes4"},{indexed:!0,internalType:"address",name:"executor",type:"address"},{indexed:!0,internalType:"address",name:"validator",type:"address"}],name:"ExecutionChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"sender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Received",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"newImplementation",type:"address"}],name:"Upgraded",type:"event"},{stateMutability:"payable",type:"fallback"},{inputs:[{internalType:"bytes4",name:"_disableFlag",type:"bytes4"}],name:"disableMode",outputs:[],stateMutability:"payable",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:[],name:"entryPoint",outputs:[{internalType:"contract IEntryPoint",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"},{internalType:"enum Operation",name:"",type:"uint8"}],name:"execute",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct Call[]",name:"calls",type:"tuple[]"}],name:"executeBatch",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"bytes",name:"data",type:"bytes"}],name:"executeDelegateCall",outputs:[],stateMutability:"payable",type:"function"},{inputs:[],name:"getDefaultValidator",outputs:[{internalType:"contract IKernelValidator",name:"validator",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"getDisabledMode",outputs:[{internalType:"bytes4",name:"disabled",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"}],name:"getExecution",outputs:[{components:[{internalType:"ValidAfter",name:"validAfter",type:"uint48"},{internalType:"ValidUntil",name:"validUntil",type:"uint48"},{internalType:"address",name:"executor",type:"address"},{internalType:"contract IKernelValidator",name:"validator",type:"address"}],internalType:"struct ExecutionDetail",name:"",type:"tuple"}],stateMutability:"view",type:"function"},{inputs:[],name:"getLastDisabledTime",outputs:[{internalType:"uint48",name:"",type:"uint48"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint192",name:"key",type:"uint192"}],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"getNonce",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"initialize",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes32",name:"hash",type:"bytes32"},{internalType:"bytes",name:"signature",type:"bytes"}],name:"isValidSignature",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"uint256[]",name:"",type:"uint256[]"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155BatchReceived",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC1155Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"},{internalType:"bytes",name:"",type:"bytes"}],name:"onERC721Received",outputs:[{internalType:"bytes4",name:"",type:"bytes4"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"contract IKernelValidator",name:"_defaultValidator",type:"address"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"setDefaultValidator",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"bytes4",name:"_selector",type:"bytes4"},{internalType:"address",name:"_executor",type:"address"},{internalType:"contract IKernelValidator",name:"_validator",type:"address"},{internalType:"ValidUntil",name:"_validUntil",type:"uint48"},{internalType:"ValidAfter",name:"_validAfter",type:"uint48"},{internalType:"bytes",name:"_enableData",type:"bytes"}],name:"setExecution",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_newImplementation",type:"address"}],name:"upgradeTo",outputs:[],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"sender",type:"address"},{internalType:"uint256",name:"nonce",type:"uint256"},{internalType:"bytes",name:"initCode",type:"bytes"},{internalType:"bytes",name:"callData",type:"bytes"},{internalType:"uint256",name:"callGasLimit",type:"uint256"},{internalType:"uint256",name:"verificationGasLimit",type:"uint256"},{internalType:"uint256",name:"preVerificationGas",type:"uint256"},{internalType:"uint256",name:"maxFeePerGas",type:"uint256"},{internalType:"uint256",name:"maxPriorityFeePerGas",type:"uint256"},{internalType:"bytes",name:"paymasterAndData",type:"bytes"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct UserOperation",name:"_userOp",type:"tuple"},{internalType:"bytes32",name:"userOpHash",type:"bytes32"},{internalType:"uint256",name:"missingAccountFunds",type:"uint256"}],name:"validateUserOp",outputs:[{internalType:"ValidationData",name:"validationData",type:"uint256"}],stateMutability:"payable",type:"function"},{inputs:[],name:"version",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{stateMutability:"payable",type:"receive"}],Rr=e=>B({abi:Pt,functionName:"executeBatch",args:[e.map(t=>({to:t.to,value:t.value||0n,data:t.data||"0x"}))]}),ba=e=>B({abi:Pt,functionName:"executeDelegateCall",args:[e.to,e.data||"0x"]}),Gr=e=>B({abi:Pt,functionName:"execute",args:[e.to,e.value||0n,e.data||"0x",0]}),Lr=async(e,t)=>{if(e.length>1){if(t==="delegatecall")throw new Error("Cannot batch delegatecall");return Rr(e)}const a=e.length===0?void 0:e[0];if(!a)throw new Error("No calls to encode");if(!t||t==="call")return Gr(a);if(t==="delegatecall")return ba({to:a.to,data:a.data});throw new Error("Invalid call type")},Cr=async({accountAddress:e,enableData:t,executor:a,selector:n,validAfter:r,validUntil:p,validator:i})=>Lr([{to:e,value:0n,data:B({abi:fa,functionName:"setExecution",args:[n,a,i,p,r,t]})}],"call");var se;(function(e){e.sudo="0x00000000",e.plugin="0x00000001",e.enable="0x00000002"})(se||(se={}));const gs=[{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"}],Ke=[{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"}],de=[{type:"constructor",inputs:[{name:"_entrypoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"accountId",inputs:[],outputs:[{name:"accountImplementationId",type:"string",internalType:"string"}],stateMutability:"pure"},{type:"function",name:"currentNonce",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"entrypoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executorConfig",inputs:[{name:"executor",type:"address",internalType:"contract IExecutor"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutorManager.ExecutorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"installModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"initData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"installValidations",inputs:[{name:"vIds",type:"bytes21[]",internalType:"ValidationId[]"},{name:"configs",type:"tuple[]",internalType:"struct ValidationManager.ValidationConfig[]",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]},{name:"validationData",type:"bytes[]",internalType:"bytes[]"},{name:"hookData",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"payable"},{type:"function",name:"invalidateNonce",inputs:[{name:"nonce",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"isAllowedSelector",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isModuleInstalled",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"additionalContext",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"permissionConfig",inputs:[{name:"pId",type:"bytes4",internalType:"PermissionId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.PermissionConfig",components:[{name:"permissionFlag",type:"bytes2",internalType:"PassFlag"},{name:"signer",type:"address",internalType:"contract ISigner"},{name:"policyData",type:"bytes22[]",internalType:"PolicyData[]"}]}],stateMutability:"view"},{type:"function",name:"rootValidator",inputs:[],outputs:[{name:"",type:"bytes21",internalType:"ValidationId"}],stateMutability:"view"},{type:"function",name:"selectorConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct SelectorManager.SelectorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"},{name:"target",type:"address",internalType:"address"},{name:"callType",type:"bytes1",internalType:"CallType"}]}],stateMutability:"view"},{type:"function",name:"supportsExecutionMode",inputs:[{name:"mode",type:"bytes32",internalType:"ExecMode"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"supportsModule",inputs:[{name:"moduleTypeId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"uninstallModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"deInitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"uninstallValidation",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"deinitData",type:"bytes",internalType:"bytes"},{name:"hookDeinitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"validNonceFrom",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"ValidationData"}],stateMutability:"payable"},{type:"function",name:"validationConfig",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.ValidationConfig",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"event",name:"ModuleInstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ModuleUninstallResult",inputs:[{name:"module",type:"address",indexed:!1,internalType:"address"},{name:"result",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"ModuleUninstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"NonceInvalidated",inputs:[{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionInstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionUninstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"}],anonymous:!1},{type:"event",name:"Received",inputs:[{name:"sender",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RootValidatorUpdated",inputs:[{name:"rootValidator",type:"bytes21",indexed:!1,internalType:"ValidationId"}],anonymous:!1},{type:"event",name:"SelectorSet",inputs:[{name:"selector",type:"bytes4",indexed:!1,internalType:"bytes4"},{name:"vId",type:"bytes21",indexed:!1,internalType:"ValidationId"},{name:"allowed",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"TryExecuteUnsuccessful",inputs:[{name:"batchExecutionindex",type:"uint256",indexed:!1,internalType:"uint256"},{name:"result",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ValidatorInstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"ValidatorUninstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"}],anonymous:!1},{type:"error",name:"EnableNotApproved",inputs:[]},{type:"error",name:"ExecutionReverted",inputs:[]},{type:"error",name:"InvalidCallType",inputs:[]},{type:"error",name:"InvalidCaller",inputs:[]},{type:"error",name:"InvalidExecutor",inputs:[]},{type:"error",name:"InvalidFallback",inputs:[]},{type:"error",name:"InvalidMode",inputs:[]},{type:"error",name:"InvalidModuleType",inputs:[]},{type:"error",name:"InvalidNonce",inputs:[]},{type:"error",name:"InvalidSelector",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"InvalidValidationType",inputs:[]},{type:"error",name:"InvalidValidator",inputs:[]},{type:"error",name:"NonceInvalidationError",inputs:[]},{type:"error",name:"NotSupportedCallType",inputs:[]},{type:"error",name:"OnlyExecuteUserOp",inputs:[]},{type:"error",name:"PermissionDataLengthMismatch",inputs:[]},{type:"error",name:"PermissionNotAlllowedForSignature",inputs:[]},{type:"error",name:"PermissionNotAlllowedForUserOp",inputs:[]},{type:"error",name:"PolicyDataTooLarge",inputs:[]},{type:"error",name:"PolicyFailed",inputs:[{name:"i",type:"uint256",internalType:"uint256"}]},{type:"error",name:"PolicySignatureOrderError",inputs:[]},{type:"error",name:"RootValidatorCannotBeRemoved",inputs:[]},{type:"error",name:"SignerPrefixNotPresent",inputs:[]}],Xt=async(e,t)=>{try{const a=await $(e,ue,"readContract")({abi:de,address:t,functionName:"currentNonce",args:[]});return a===0?1:a}catch{return 1}},Wt=[{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"data",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"magicValue",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"}],Yt=async(e,t,a,n)=>{try{const r=await e.request({method:"eth_call",params:[{to:t,data:B({abi:Wt,functionName:"eip712Domain"})},"latest"]});if(r!=="0x"){const p=Wa({abi:[...Wt],functionName:"eip712Domain",data:r});return{name:p[1],version:p[2],chainId:p[3]}}}catch{}return{name:rn,version:a==="0.3.0"?"0.3.0-beta":a,chainId:BigInt(n??(e.chain?e.chain.id:await e.extend(Ya).getChainId()))}},qt=e=>{if(e==="0.6")return We(Ye({abi:fa,name:"execute"}));if(e==="0.7")return We(Ye({abi:de,name:"execute"}));throw new Error("Unsupported entry point version")},Sr=async({accountAddress:e,enableSignature:t,action:a,validator:n,validUntil:r,validAfter:p})=>{const i=await n.getEnableData(e),u=i.length/2-1;return z([se.enable,M(J(r,{size:6}),{size:6}),M(J(p),{size:6}),M(n.address,{size:20}),M(a.address,{size:20}),M(J(u),{size:32}),i,M(J(t.length/2-1),{size:32}),t])},Nr=async({accountAddress:e,chainId:t,kernelVersion:a,action:n,validator:r,validUntil:p,validAfter:i})=>({domain:{name:"Kernel",version:a,chainId:t,verifyingContract:e},types:{ValidatorApproved:[{name:"sig",type:"bytes4"},{name:"validatorData",type:"uint256"},{name:"executor",type:"address"},{name:"enableData",type:"bytes"}]},message:{sig:n.selector,validatorData:me(Y([M(J(p??0),{size:6}),M(J(i??0),{size:6}),r.address]),{size:32}),executor:n.address,enableData:await r.getEnableData(e)},primaryType:"ValidatorApproved"}),Mr=async({enableSignature:e,userOpSignature:t,action:a,enableData:n,hook:r})=>{var p;return z([(r==null?void 0:r.getIdentifier())??ae,ee(qe("bytes validatorData, bytes hookData, bytes selectorData, bytes enableSig, bytes userOpSig"),[n,await(r==null?void 0:r.getEnableData())??"0x",z([a.selector,a.address,((p=a.hook)==null?void 0:p.address)??ae,ee(qe("bytes selectorInitData, bytes hookInitData"),[ye.DELEGATE_CALL,"0x0000"])]),e,t])])},Zt=async({accountAddress:e,chainId:t,kernelVersion:a,action:n,hook:r,validator:p,validatorNonce:i})=>{var u;return{domain:{name:"Kernel",version:a==="0.3.0"?"0.3.0-beta":a,chainId:t,verifyingContract:e},types:{Enable:[{name:"validationId",type:"bytes21"},{name:"nonce",type:"uint32"},{name:"hook",type:"address"},{name:"validatorData",type:"bytes"},{name:"hookData",type:"bytes"},{name:"selectorData",type:"bytes"}]},message:{validationId:z([H[p.validatorType],M(p.getIdentifier(),{size:20,dir:"right"})]),nonce:i,hook:(r==null?void 0:r.getIdentifier())??ae,validatorData:await p.getEnableData(e),hookData:await(r==null?void 0:r.getEnableData(e))??"0x",selectorData:z([n.selector,n.address,((u=n.hook)==null?void 0:u.address)??ae,ee(qe("bytes selectorInitData, bytes hookInitData"),[ye.DELEGATE_CALL,"0x0000"])])},primaryType:"Enable"}},$r=async(e,t,a)=>{try{return await $(e,ue,"readContract")({abi:Or,address:a,functionName:"isInitialized",args:[t]})}catch{}return!1};function hs(e){return(e==null?void 0:e.getPluginEnableSignature)!==void 0}async function Ts(e,{sudo:t,regular:a,hook:n,pluginEnableSignature:r,validatorInitData:p,action:i,validAfter:u=0,validUntil:s=0,entryPoint:y,kernelVersion:o,chainId:m,isPreInstalled:w=!1}){var F;if(t&&!ie.satisfies(o,t==null?void 0:t.supportedKernelVersions)||a&&!ie.satisfies(o,a==null?void 0:a.supportedKernelVersions))throw new Error("Either sudo or/and regular validator version mismatch. Update to latest plugin package and use the proper plugin version");let A=w;const d=a||t;if(!d)throw new Error("One of `sudo` or `regular` validator must be set");if(i={selector:(i==null?void 0:i.selector)??qt(y.version),address:(i==null?void 0:i.address)??ae},y.version==="0.7"&&(i.address.toLowerCase()!==ae.toLowerCase()||i.selector.toLowerCase()!==qt(y.version).toLowerCase())&&o==="0.3.0"&&(i.hook={address:((F=i.hook)==null?void 0:F.address)??sn}),!i)throw new Error("Action data must be set");const l=async(T,S,V="0x")=>{if(!i)throw new Error("Action data must be set");if(y.version==="0.6")if(a){if(A||await b(T,S))return se.plugin;const _=await P(T);if(!_)throw new Error("Enable signature not set");return Sr({accountAddress:T,enableSignature:_,action:i,validator:a,validUntil:s,validAfter:u})}else{if(t)return se.sudo;throw new Error("One of `sudo` or `regular` validator must be set")}if(a){if(A||await b(T,i.selector))return V;const _=await P(T);return Mr({enableSignature:_,userOpSignature:V,action:i,enableData:await a.getEnableData(T),hook:n})}else{if(t)return V;throw new Error("One of `sudo` or `regular` validator must be set")}},b=async(T,S,V)=>{const _=!!V,x=V??a;if(w&&!_)return!0;if(!i)throw new Error("Action data must be set");if(!x)throw new Error("regular validator not set");if(y.version==="0.6")return x.isEnabled(T,S);const G=await x.isEnabled(T,i.selector)||await $r(e,T,x.address);return G&&!_&&(A=!0),G},P=async(T,S)=>{var be;const V=!!S,_=S??a;if(!i)throw new Error("Action data must be set");if(r&&!V)return r;if(!t)throw new Error("sudo validator not set -- need it to enable the validator");if(!_)throw new Error("regular validator not set");const{version:x}=await Yt(e,T,o);m||(m=((be=e.chain)==null?void 0:be.id)??await Ie(e));let G;if(y.version==="0.6"){const f=await Nr({accountAddress:T,chainId:m,kernelVersion:x??o,action:i,validator:_,validUntil:s,validAfter:u});return G=await t.signTypedData(f),V||(r=G),G}const X=await Xt(e,T),Fe=await Zt({accountAddress:T,chainId:m,kernelVersion:x,action:i,hook:n,validator:_,validatorNonce:X});return G=await t.signTypedData(Fe),V||(r=G),G},L=(T=!1)=>{const S=(T?t:a)??d;return z([H[S.validatorType],S.getIdentifier()])};return{sudoValidator:t,regularValidator:a,activeValidatorMode:t&&!a?"sudo":"regular",...d,hook:n,getIdentifier:L,encodeModuleInstallCallData:async T=>{if(!i)throw new Error("Action data must be set");if(!a)throw new Error("regular validator not set");if(y.version==="0.6")return await Cr({accountAddress:T,selector:i.selector,executor:i.address,validator:a==null?void 0:a.address,validUntil:s,validAfter:u,enableData:await a.getEnableData(T)});throw new Error("EntryPoint v0.7 not supported yet")},signUserOperation:async T=>{const S=await d.signUserOperation(T);return y.version==="0.6"?Y([await l(T.sender,T.callData.toString().slice(0,10)),S]):await l(T.sender,T.callData.toString().slice(0,10),S)},getAction:()=>{if(!i)throw new Error("Action data must be set");return i},getValidityData:()=>({validAfter:u,validUntil:s}),getStubSignature:async T=>{const S=await d.getStubSignature(T);return y.version==="0.6"?Y([await l(T.sender,T.callData.toString().slice(0,10)),S]):await l(T.sender,T.callData.toString().slice(0,10),S)},getNonceKey:async(T=ae,S=0n)=>{if(!i)throw new Error("Action data must be set");if(y.version==="0.6"){if(S>qa)throw new Error("Custom nonce key must be equal or less than maxUint192 for 0.6");return await d.getNonceKey(T,S)}if(S>Za)throw new Error("Custom nonce key must be equal or less than 2 bytes(maxUint16) for v0.7");const V=!a||await b(T,i.selector)?Mt.DEFAULT:Mt.ENABLE,_=a?H[a.validatorType]:H.SUDO,x=M(Y([V,_,M(d.getIdentifier(),{size:20,dir:"right"}),M(J(await d.getNonceKey(T,S)),{size:2})]),{size:24});return BigInt(x)},isPluginEnabled:b,getPluginEnableSignature:P,getPluginsEnableTypedData:async(T,S)=>{var X;const V=S??a;if(!i)throw new Error("Action data must be set");if(!t)throw new Error("sudo validator not set -- need it to enable the validator");if(!V)throw new Error("regular validator not set");const{version:_}=await Yt(e,T,o),x=await Xt(e,T);return m||(m=((X=e.chain)==null?void 0:X.id)??await Ie(e)),await Zt({accountAddress:T,chainId:m,kernelVersion:_,action:i,validator:V,validatorNonce:x})},getValidatorInitData:async()=>p||{validatorAddress:(t==null?void 0:t.address)??d.address,enableData:await(t==null?void 0:t.getEnableData())??await d.getEnableData(),identifier:M(L(!0),{size:21,dir:"right"})},signUserOperationWithActiveValidator:async T=>d.signUserOperation(T)}}const Es=[{type:"constructor",inputs:[{name:"_owner",type:"address",internalType:"address"}],stateMutability:"nonpayable"},{type:"function",name:"approveFactory",inputs:[{name:"factory",type:"address",internalType:"contract KernelFactory"},{name:"approval",type:"bool",internalType:"bool"}],outputs:[],stateMutability:"payable"},{type:"function",name:"approved",inputs:[{name:"",type:"address",internalType:"contract KernelFactory"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"cancelOwnershipHandover",inputs:[],outputs:[],stateMutability:"payable"},{type:"function",name:"completeOwnershipHandover",inputs:[{name:"pendingOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"deployWithFactory",inputs:[{name:"factory",type:"address",internalType:"contract KernelFactory"},{name:"createData",type:"bytes",internalType:"bytes"},{name:"salt",type:"bytes32",internalType:"bytes32"}],outputs:[{name:"",type:"address",internalType:"address"}],stateMutability:"payable"},{type:"function",name:"owner",inputs:[],outputs:[{name:"result",type:"address",internalType:"address"}],stateMutability:"view"},{type:"function",name:"ownershipHandoverExpiresAt",inputs:[{name:"pendingOwner",type:"address",internalType:"address"}],outputs:[{name:"result",type:"uint256",internalType:"uint256"}],stateMutability:"view"},{type:"function",name:"renounceOwnership",inputs:[],outputs:[],stateMutability:"payable"},{type:"function",name:"requestOwnershipHandover",inputs:[],outputs:[],stateMutability:"payable"},{type:"function",name:"stake",inputs:[{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"},{name:"unstakeDelay",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"transferOwnership",inputs:[{name:"newOwner",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"unlockStake",inputs:[{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"}],outputs:[],stateMutability:"payable"},{type:"function",name:"withdrawStake",inputs:[{name:"entryPoint",type:"address",internalType:"contract IEntryPoint"},{name:"recipient",type:"address",internalType:"address payable"}],outputs:[],stateMutability:"payable"},{type:"event",name:"OwnershipHandoverCanceled",inputs:[{name:"pendingOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipHandoverRequested",inputs:[{name:"pendingOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"OwnershipTransferred",inputs:[{name:"oldOwner",type:"address",indexed:!0,internalType:"address"},{name:"newOwner",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"error",name:"AlreadyInitialized",inputs:[]},{type:"error",name:"NewOwnerIsZeroAddress",inputs:[]},{type:"error",name:"NoHandoverRequest",inputs:[]},{type:"error",name:"NotApprovedFactory",inputs:[]},{type:"error",name:"Unauthorized",inputs:[]}],Jt=[{type:"constructor",inputs:[{name:"_entrypoint",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"nonpayable"},{type:"fallback",stateMutability:"payable"},{type:"receive",stateMutability:"payable"},{type:"function",name:"accountId",inputs:[],outputs:[{name:"accountImplementationId",type:"string",internalType:"string"}],stateMutability:"pure"},{type:"function",name:"changeRootValidator",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"currentNonce",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"eip712Domain",inputs:[],outputs:[{name:"fields",type:"bytes1",internalType:"bytes1"},{name:"name",type:"string",internalType:"string"},{name:"version",type:"string",internalType:"string"},{name:"chainId",type:"uint256",internalType:"uint256"},{name:"verifyingContract",type:"address",internalType:"address"},{name:"salt",type:"bytes32",internalType:"bytes32"},{name:"extensions",type:"uint256[]",internalType:"uint256[]"}],stateMutability:"view"},{type:"function",name:"entrypoint",inputs:[],outputs:[{name:"",type:"address",internalType:"contract IEntryPoint"}],stateMutability:"view"},{type:"function",name:"execute",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executeFromExecutor",inputs:[{name:"execMode",type:"bytes32",internalType:"ExecMode"},{name:"executionCalldata",type:"bytes",internalType:"bytes"}],outputs:[{name:"returnData",type:"bytes[]",internalType:"bytes[]"}],stateMutability:"payable"},{type:"function",name:"executeUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"executorConfig",inputs:[{name:"executor",type:"address",internalType:"contract IExecutor"}],outputs:[{name:"",type:"tuple",internalType:"struct ExecutorManager.ExecutorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"function",name:"initialize",inputs:[{name:"_rootValidator",type:"bytes21",internalType:"ValidationId"},{name:"hook",type:"address",internalType:"contract IHook"},{name:"validatorData",type:"bytes",internalType:"bytes"},{name:"hookData",type:"bytes",internalType:"bytes"},{name:"initConfig",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"nonpayable"},{type:"function",name:"installModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"initData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"installValidations",inputs:[{name:"vIds",type:"bytes21[]",internalType:"ValidationId[]"},{name:"configs",type:"tuple[]",internalType:"struct ValidationManager.ValidationConfig[]",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]},{name:"validationData",type:"bytes[]",internalType:"bytes[]"},{name:"hookData",type:"bytes[]",internalType:"bytes[]"}],outputs:[],stateMutability:"payable"},{type:"function",name:"invalidateNonce",inputs:[{name:"nonce",type:"uint32",internalType:"uint32"}],outputs:[],stateMutability:"payable"},{type:"function",name:"isAllowedSelector",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isModuleInstalled",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"additionalContext",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"view"},{type:"function",name:"isValidSignature",inputs:[{name:"hash",type:"bytes32",internalType:"bytes32"},{name:"signature",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"view"},{type:"function",name:"onERC1155BatchReceived",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"uint256[]",internalType:"uint256[]"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC1155Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"onERC721Received",inputs:[{name:"",type:"address",internalType:"address"},{name:"",type:"address",internalType:"address"},{name:"",type:"uint256",internalType:"uint256"},{name:"",type:"bytes",internalType:"bytes"}],outputs:[{name:"",type:"bytes4",internalType:"bytes4"}],stateMutability:"pure"},{type:"function",name:"permissionConfig",inputs:[{name:"pId",type:"bytes4",internalType:"PermissionId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.PermissionConfig",components:[{name:"permissionFlag",type:"bytes2",internalType:"PassFlag"},{name:"signer",type:"address",internalType:"contract ISigner"},{name:"policyData",type:"bytes22[]",internalType:"PolicyData[]"}]}],stateMutability:"view"},{type:"function",name:"rootValidator",inputs:[],outputs:[{name:"",type:"bytes21",internalType:"ValidationId"}],stateMutability:"view"},{type:"function",name:"selectorConfig",inputs:[{name:"selector",type:"bytes4",internalType:"bytes4"}],outputs:[{name:"",type:"tuple",internalType:"struct SelectorManager.SelectorConfig",components:[{name:"hook",type:"address",internalType:"contract IHook"},{name:"target",type:"address",internalType:"address"},{name:"callType",type:"bytes1",internalType:"CallType"}]}],stateMutability:"view"},{type:"function",name:"supportsExecutionMode",inputs:[{name:"mode",type:"bytes32",internalType:"ExecMode"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"supportsModule",inputs:[{name:"moduleTypeId",type:"uint256",internalType:"uint256"}],outputs:[{name:"",type:"bool",internalType:"bool"}],stateMutability:"pure"},{type:"function",name:"uninstallModule",inputs:[{name:"moduleType",type:"uint256",internalType:"uint256"},{name:"module",type:"address",internalType:"address"},{name:"deInitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"uninstallValidation",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"},{name:"deinitData",type:"bytes",internalType:"bytes"},{name:"hookDeinitData",type:"bytes",internalType:"bytes"}],outputs:[],stateMutability:"payable"},{type:"function",name:"upgradeTo",inputs:[{name:"_newImplementation",type:"address",internalType:"address"}],outputs:[],stateMutability:"payable"},{type:"function",name:"validNonceFrom",inputs:[],outputs:[{name:"",type:"uint32",internalType:"uint32"}],stateMutability:"view"},{type:"function",name:"validateUserOp",inputs:[{name:"userOp",type:"tuple",internalType:"struct PackedUserOperation",components:[{name:"sender",type:"address",internalType:"address"},{name:"nonce",type:"uint256",internalType:"uint256"},{name:"initCode",type:"bytes",internalType:"bytes"},{name:"callData",type:"bytes",internalType:"bytes"},{name:"accountGasLimits",type:"bytes32",internalType:"bytes32"},{name:"preVerificationGas",type:"uint256",internalType:"uint256"},{name:"gasFees",type:"bytes32",internalType:"bytes32"},{name:"paymasterAndData",type:"bytes",internalType:"bytes"},{name:"signature",type:"bytes",internalType:"bytes"}]},{name:"userOpHash",type:"bytes32",internalType:"bytes32"},{name:"missingAccountFunds",type:"uint256",internalType:"uint256"}],outputs:[{name:"validationData",type:"uint256",internalType:"ValidationData"}],stateMutability:"payable"},{type:"function",name:"validationConfig",inputs:[{name:"vId",type:"bytes21",internalType:"ValidationId"}],outputs:[{name:"",type:"tuple",internalType:"struct ValidationManager.ValidationConfig",components:[{name:"nonce",type:"uint32",internalType:"uint32"},{name:"hook",type:"address",internalType:"contract IHook"}]}],stateMutability:"view"},{type:"event",name:"ModuleInstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"ModuleUninstallResult",inputs:[{name:"module",type:"address",indexed:!1,internalType:"address"},{name:"result",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"ModuleUninstalled",inputs:[{name:"moduleTypeId",type:"uint256",indexed:!1,internalType:"uint256"},{name:"module",type:"address",indexed:!1,internalType:"address"}],anonymous:!1},{type:"event",name:"NonceInvalidated",inputs:[{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionInstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"PermissionUninstalled",inputs:[{name:"permission",type:"bytes4",indexed:!1,internalType:"PermissionId"}],anonymous:!1},{type:"event",name:"Received",inputs:[{name:"sender",type:"address",indexed:!1,internalType:"address"},{name:"amount",type:"uint256",indexed:!1,internalType:"uint256"}],anonymous:!1},{type:"event",name:"RootValidatorUpdated",inputs:[{name:"rootValidator",type:"bytes21",indexed:!1,internalType:"ValidationId"}],anonymous:!1},{type:"event",name:"SelectorSet",inputs:[{name:"selector",type:"bytes4",indexed:!1,internalType:"bytes4"},{name:"vId",type:"bytes21",indexed:!1,internalType:"ValidationId"},{name:"allowed",type:"bool",indexed:!1,internalType:"bool"}],anonymous:!1},{type:"event",name:"TryExecuteUnsuccessful",inputs:[{name:"batchExecutionindex",type:"uint256",indexed:!1,internalType:"uint256"},{name:"result",type:"bytes",indexed:!1,internalType:"bytes"}],anonymous:!1},{type:"event",name:"Upgraded",inputs:[{name:"implementation",type:"address",indexed:!0,internalType:"address"}],anonymous:!1},{type:"event",name:"ValidatorInstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"},{name:"nonce",type:"uint32",indexed:!1,internalType:"uint32"}],anonymous:!1},{type:"event",name:"ValidatorUninstalled",inputs:[{name:"validator",type:"address",indexed:!1,internalType:"contract IValidator"}],anonymous:!1},{type:"error",name:"EnableNotApproved",inputs:[]},{type:"error",name:"ExecutionReverted",inputs:[]},{type:"error",name:"InitConfigError",inputs:[{name:"idx",type:"uint256",internalType:"uint256"}]},{type:"error",name:"InvalidCallType",inputs:[]},{type:"error",name:"InvalidCaller",inputs:[]},{type:"error",name:"InvalidExecutor",inputs:[]},{type:"error",name:"InvalidFallback",inputs:[]},{type:"error",name:"InvalidMode",inputs:[]},{type:"error",name:"InvalidModuleType",inputs:[]},{type:"error",name:"InvalidNonce",inputs:[]},{type:"error",name:"InvalidSelector",inputs:[]},{type:"error",name:"InvalidSignature",inputs:[]},{type:"error",name:"InvalidValidationType",inputs:[]},{type:"error",name:"InvalidValidator",inputs:[]},{type:"error",name:"NonceInvalidationError",inputs:[]},{type:"error",name:"NotSupportedCallType",inputs:[]},{type:"error",name:"OnlyExecuteUserOp",inputs:[]},{type:"error",name:"PermissionDataLengthMismatch",inputs:[]},{type:"error",name:"PermissionNotAlllowedForSignature",inputs:[]},{type:"error",name:"PermissionNotAlllowedForUserOp",inputs:[]},{type:"error",name:"PolicyDataTooLarge",inputs:[]},{type:"error",name:"PolicyFailed",inputs:[{name:"i",type:"uint256",internalType:"uint256"}]},{type:"error",name:"PolicySignatureOrderError",inputs:[]},{type:"error",name:"RootValidatorCannotBeRemoved",inputs:[]},{type:"error",name:"SignerPrefixNotPresent",inputs:[]}],Ur=ea(["function performCreate(uint256 value, bytes memory deploymentData) public returns (address newContract)","function performCreate2(uint256 value, bytes memory deploymentData, bytes32 salt) public returns (address newContract)"]),ga=e=>B({abi:Ur,functionName:"performCreate",args:e}),vs=e=>{const t={to:aa,data:ga([0n,ta(e)])};return ba(t)},At=(e,t,a=!1)=>{let n;"calldata"in e?n=e.calldata:n=Y([e.to,t.callType!==ye.DELEGATE_CALL?J(e.value||0n,{size:32}):"0x",e.data||"0x"]);const r=We(Ye({abi:Ke,name:"executeUserOp"}));return a?Y([r,B({abi:Ke,functionName:"execute",args:[Kt(t),n]})]):B({abi:Ke,functionName:"execute",args:[Kt(t),n]})},Fr=(e,t,a)=>{const n=ee([{name:"executionBatch",type:"tuple[]",components:[{name:"target",type:"address"},{name:"value",type:"uint256"},{name:"callData",type:"bytes"}]}],[e.map(r=>({target:r.to,value:r.value||0n,callData:r.data||"0x"}))]);return At({calldata:n},{callType:ye.BATCH,execType:t.execType},a)},ha=(e,t,a)=>At(e,{callType:ye.DELEGATE_CALL,execType:t.execType},a),Vr=(e,t,a)=>At(e,{callType:ye.SINGLE,execType:t.execType},a),ws=async(e,t,a,n=na.DEFAULT)=>{if(e.length>1){if(t==="delegatecall")throw new Error("Cannot batch delegatecall");return Fr(e,{execType:n},a)}const r=e.length===0?void 0:e[0];if(!r)throw new Error("No calls to encode");if(!t||t==="call")return Vr(r,{execType:n},a);if(t==="delegatecall")return ha({to:r.to,data:r.data},{execType:n},a);throw new Error("Invalid call type")},Is=e=>{const t={to:aa,data:ga([0n,ta(e)])};return ha(t,{execType:na.DEFAULT})},_r=e=>W(ee([{type:"bytes32"},{type:"bytes32"}],[W(Ja("Kernel(bytes32 hash)")),e])),xs=async(e,t,a)=>{const{name:n,version:r,chainId:p,verifyingContract:i}=t;if(!je(Q.ERC1271_SIG_WRAPPER,r))return e;const u=je(Q.ERC1271_REPLAYABLE,r)&&a?0:p,s=Qa({domain:{name:n,version:r,chainId:u,verifyingContract:i}});let y=e;return je(Q.ERC1271_SIG_WRAPPER_WITH_WRAPPED_HASH,r)&&(y=_r(y)),W(Y(["0x1901",s,y]))},Os=(e,t)=>{const a=B({abi:Pr,functionName:"installModule",args:[t.type,t.address,t.data]});return{to:e,data:a}},kr=async(e,t)=>{var o;const{userOperation:{chainId:a,entryPointAddress:n,context:r,calls:p,account:i,...u}}=t,s=await e.request({method:"zd_sponsorUserOperation",params:[{chainId:(o=e.chain)==null?void 0:o.id,userOp:Se(u),entryPointAddress:n,gasTokenData:t.gasToken&&{tokenAddress:t.gasToken},shouldOverrideFee:t.shouldOverrideFee??!1,shouldConsume:t.shouldConsume??!0}]});if(en(n,ra))return{paymasterAndData:s.paymasterAndData,preVerificationGas:BigInt(s.preVerificationGas),verificationGasLimit:BigInt(s.verificationGasLimit),callGasLimit:BigInt(s.callGasLimit),maxFeePerGas:s.maxFeePerGas?BigInt(s.maxFeePerGas):t.userOperation.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas?BigInt(s.maxPriorityFeePerGas):t.userOperation.maxPriorityFeePerGas};const y=s;return{callGasLimit:BigInt(y.callGasLimit),verificationGasLimit:BigInt(y.verificationGasLimit),preVerificationGas:BigInt(y.preVerificationGas),paymaster:y.paymaster,paymasterVerificationGasLimit:BigInt(y.paymasterVerificationGasLimit),paymasterPostOpGasLimit:BigInt(y.paymasterPostOpGasLimit),paymasterData:y.paymasterData,maxFeePerGas:s.maxFeePerGas?BigInt(s.maxFeePerGas):t.userOperation.maxFeePerGas,maxPriorityFeePerGas:s.maxPriorityFeePerGas?BigInt(s.maxPriorityFeePerGas):t.userOperation.maxPriorityFeePerGas}};function Br(e,t){Dr(e.entryPoint.version,t);const a=sa[t].accountImplementationAddress;return{to:e.address,data:B({abi:de,functionName:"upgradeTo",args:[a]}),value:0n}}class te extends I{constructor({docsPath:t}={}){super(["Could not find an Account to execute with this Action.","Please provide an Account with the `account` argument on the Action, or by supplying an `account` to the Client."].join(` +`),{docsPath:t,docsSlug:"account",name:"AccountNotFoundError"})}}class Ps extends I{constructor(){super("Smart account signer doesn't need to sign transactions",{name:"SignTransactionNotSupportedError"})}}async function Hr(e,t){const{account:a=e.account,kernelVersion:n}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const r=K(a),p=Br(r,n);return await $(e,ne,"sendUserOperation")({...t,calls:[p],account:r})}async function zr(e,t){const{sudoValidator:a,hook:n,...r}=t,p=r.account??e.account;if(!p)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const i=K(p);let u;if([H.PERMISSION,H.SECONDARY,H.EIP7702].includes(H[a.validatorType]))u=Y([H[a.validatorType],M(a.getIdentifier(),{size:20,dir:"right"})]);else throw new Error(`Cannot change sudo validator to type ${a.validatorType}`);const s=await a.getEnableData(i.address),y=(n==null?void 0:n.getIdentifier())??ae,o=await(n==null?void 0:n.getEnableData(i.address))??"0x";return i.kernelVersion===on?await $(e,ne,"sendUserOperation")({...r,callData:await i.encodeCalls([{to:sa[pn].accountImplementationAddress,value:0n,data:B({abi:Jt,functionName:"changeRootValidator",args:[u,y,s,o]})}],"delegatecall")}):await $(e,ne,"sendUserOperation")({...r,callData:await i.encodeCalls([{to:i.address,value:0n,data:B({abi:Jt,functionName:"changeRootValidator",args:[u,y,s,o]})}])})}async function jr(e,t){const{account:a=e.account,nonceToSet:n}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const r=K(a);return await $(e,ne,"sendUserOperation")({...t,calls:[{to:r.address,data:B({abi:de,functionName:"invalidateNonce",args:[n]}),value:0n}],account:r})}async function Kr(e,t){const{account:a=e.account,plugin:n,hook:r,...p}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const i=K(a);let u;if([H.PERMISSION,H.SECONDARY,H.EIP7702].includes(H[n.validatorType]))u=Y([H[n.validatorType],M(n.getIdentifier(),{size:20,dir:"right"})]);else throw new Error(`Cannot uninstall ${n.validatorType} plugin`);const s=await n.getEnableData(i.address),y=await(r==null?void 0:r.getEnableData(i.address))??"0x";return await $(e,ne,"sendUserOperation")({...p,calls:[{to:i.address,data:B({abi:de,functionName:"uninstallValidation",args:[u,s,y]}),value:0n}],account:i})}async function Xr(e,t){const{account:a=e.account}=t;if(!a)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const n=K(a),r=await $(e,pe,"prepareUserOperation")({...t,account:n});return r.signature=await n.signUserOperation(r),r}async function Wr(e){const t=e.account;if(!t)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const a=K(t);try{return await $(e,ue,"readContract")({abi:de,address:a.address,functionName:"currentNonce",args:[]})}catch{return 1}}const Ta=async e=>{const t=await e.request({method:"zd_getUserOperationGasPrice",params:[]});return{maxFeePerGas:BigInt(t.standard.maxFeePerGas),maxPriorityFeePerGas:BigInt(t.standard.maxPriorityFeePerGas)}};async function Ea(e,t){let a;if("to"in t){const{account:r=e.account,data:p,maxFeePerGas:i,maxPriorityFeePerGas:u,to:s,value:y,nonce:o}=t;if(!r)throw new te({docsPath:"/docs/actions/wallet/sendTransaction"});const m=K(r);if(!s)throw new Error("Missing to address");a=await $(e,ne,"sendUserOperation")({calls:[{to:s,value:y||BigInt(0),data:p||"0x"}],account:m,maxFeePerGas:i,maxPriorityFeePerGas:u,nonce:o?BigInt(o):void 0})}else a=await $(e,ne,"sendUserOperation")({...t});const n=await $(e,ma,"waitForUserOperationReceipt")({hash:a});return n==null?void 0:n.receipt.transactionHash}async function Yr(e,{account:t=e.account,message:a}){if(!t)throw new te({docsPath:"/docs/actions/wallet/signMessage"});return K(t).signMessage({message:a})}async function qr(e,{account:t=e.account,domain:a,message:n,primaryType:r,types:p}){if(!t)throw new te({docsPath:"/docs/actions/wallet/signMessage"});const i=K(t),u={EIP712Domain:tn({domain:a}),...p};return an({domain:a,message:n,primaryType:r,types:u}),i.signTypedData({domain:a,primaryType:r,types:u,message:n})}async function Zr(e,{abi:t,address:a,args:n,dataSuffix:r,functionName:p,...i}){const u=B({abi:t,args:n,functionName:p});return await $(e,Ea,"sendTransaction")({data:`${u}${r?r.replace("0x",""):""}`,to:a,...i})}const Jr=async(e,t)=>{var p;const a=await e.request({method:"stackup_getERC20TokenQuotes",params:[{chainId:(p=e.chain)==null?void 0:p.id,userOp:{...Se(t.userOperation),initCode:t.userOperation.initCode||"0x"},tokenAddress:t.gasTokenAddress,entryPointAddress:t.entryPoint??ra}]}),n={maxGasCostToken:a.maxGasCostToken,tokenDecimals:a.tokenDecimals};return{amount:Number(n.maxGasCostToken)/10**Number(n.tokenDecimals)}},As=()=>e=>({sponsorUserOperation:async t=>kr(e,{...t}),estimateGasInERC20:async t=>Jr(e,t)});function Qt(){return e=>({signUserOperation:t=>Xr(e,t),getUserOperationGasPrice:async()=>Ta(e),uninstallPlugin:async t=>Kr(e,t),changeSudoValidator:async t=>zr(e,t),invalidateNonce:async t=>jr(e,t),getKernelV3ModuleCurrentNonce:async()=>Wr(e),upgradeKernel:async t=>Hr(e,t),sendTransaction:t=>Ea(e,t),signMessage:t=>Yr(e,t),signTypedData:t=>qr(e,t),writeContract:t=>Zr(e,t)})}function Ds(e){var y,o;const{client:t,key:a="Account",name:n="Kernel Account Client",paymaster:r,paymasterContext:p,bundlerTransport:i,userOperation:u}=e,s=Object.assign(nn({...e,chain:e.chain??(t==null?void 0:t.chain),transport:i,key:a,name:n,type:"kernelAccountClient",pollingInterval:e.pollingInterval??1e3}),{client:t,paymaster:r,paymasterContext:p,userOperation:u});if((y=e.userOperation)!=null&&y.prepareUserOperation){const m=e.userOperation.prepareUserOperation;return s.extend(ve).extend(w=>({prepareUserOperation:A=>m(w,A)})).extend(ve).extend(w=>({prepareUserOperation:A=>m(w,A)})).extend(Qt())}return(o=s.userOperation)!=null&&o.estimateFeesPerGas||(s.userOperation={...s.userOperation,estimateFeesPerGas:async({bundlerClient:m})=>await Ta(m)}),s.extend(ve).extend(m=>({prepareUserOperation:async w=>{var d,l,b;let A=w;if((d=m.account)!=null&&d.authorization){const P=w.authorization||await((b=(l=m.account)==null?void 0:l.eip7702Authorization)==null?void 0:b.call(l));A={...w,authorization:P}}return await pe(m,A)}})).extend(ve).extend(m=>({prepareUserOperation:async w=>{var d,l,b;let A=w;if((d=m.account)!=null&&d.authorization){const P=w.authorization||await((b=(l=m.account)==null?void 0:l.eip7702Authorization)==null?void 0:b.call(l));A={...w,authorization:P}}return await pe(m,A)}})).extend(Qt())}export{Xr as $,Is as A,Yt as B,de as C,Ke as D,As as E,ms as F,qt as G,Ds as H,te as I,Wt as J,Es as K,jt as L,fa as M,zr as N,Se as O,cs as P,ds as Q,Mr as R,Ps as S,Kt as T,Xt as U,Zt as V,Br as W,Ta as X,jr as Y,$r as Z,Qt as _,gr as a,kr as a0,Kr as a1,Hr as a2,pe as a3,fs as b,os as c,Ts as d,ys as e,ss as f,hr as g,is as h,hs as i,ps as j,un as k,ls as l,bs as m,gs as n,Jt as o,us as p,xs as q,je as r,ie as s,ir as t,Q as u,Dr as v,Os as w,ws as x,Lr as y,vs as z}; diff --git a/public/index.html b/public/index.html index 301c271..806e7f2 100644 --- a/public/index.html +++ b/public/index.html @@ -5,7 +5,7 @@ DIDGit - + diff --git a/src/main/typescript/apps/web/tsconfig.tsbuildinfo b/src/main/typescript/apps/web/tsconfig.tsbuildinfo index bb60e6a..e7d5973 100644 --- a/src/main/typescript/apps/web/tsconfig.tsbuildinfo +++ b/src/main/typescript/apps/web/tsconfig.tsbuildinfo @@ -1 +1 @@ -{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2016.intl.d.ts","./node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","./node_modules/typescript/lib/lib.es2017.date.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/@types/react/global.d.ts","./node_modules/csstype/index.d.ts","./node_modules/@types/prop-types/index.d.ts","./node_modules/@types/react/index.d.ts","./node_modules/@types/react/jsx-runtime.d.ts","./node_modules/buffer/index.d.ts","./src/polyfills/node-globals.ts","./vite.config.ts","./node_modules/@types/d3-array/index.d.ts","./node_modules/@types/d3-color/index.d.ts","./node_modules/@types/d3-ease/index.d.ts","./node_modules/@types/d3-interpolate/index.d.ts","./node_modules/@types/d3-path/index.d.ts","./node_modules/@types/d3-time/index.d.ts","./node_modules/@types/d3-scale/index.d.ts","./node_modules/@types/d3-timer/index.d.ts","./node_modules/@types/node/globals.typedarray.d.ts","./node_modules/@types/node/buffer.buffer.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/undici-types/header.d.ts","./node_modules/undici-types/readable.d.ts","./node_modules/undici-types/file.d.ts","./node_modules/undici-types/fetch.d.ts","./node_modules/undici-types/formdata.d.ts","./node_modules/undici-types/connector.d.ts","./node_modules/undici-types/client.d.ts","./node_modules/undici-types/errors.d.ts","./node_modules/undici-types/dispatcher.d.ts","./node_modules/undici-types/global-dispatcher.d.ts","./node_modules/undici-types/global-origin.d.ts","./node_modules/undici-types/pool-stats.d.ts","./node_modules/undici-types/pool.d.ts","./node_modules/undici-types/handlers.d.ts","./node_modules/undici-types/balanced-pool.d.ts","./node_modules/undici-types/agent.d.ts","./node_modules/undici-types/mock-interceptor.d.ts","./node_modules/undici-types/mock-agent.d.ts","./node_modules/undici-types/mock-client.d.ts","./node_modules/undici-types/mock-pool.d.ts","./node_modules/undici-types/mock-errors.d.ts","./node_modules/undici-types/proxy-agent.d.ts","./node_modules/undici-types/env-http-proxy-agent.d.ts","./node_modules/undici-types/retry-handler.d.ts","./node_modules/undici-types/retry-agent.d.ts","./node_modules/undici-types/api.d.ts","./node_modules/undici-types/interceptors.d.ts","./node_modules/undici-types/util.d.ts","./node_modules/undici-types/cookies.d.ts","./node_modules/undici-types/patch.d.ts","./node_modules/undici-types/websocket.d.ts","./node_modules/undici-types/eventsource.d.ts","./node_modules/undici-types/filereader.d.ts","./node_modules/undici-types/diagnostics-channel.d.ts","./node_modules/undici-types/content-type.d.ts","./node_modules/undici-types/cache.d.ts","./node_modules/undici-types/index.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/sea.d.ts","./node_modules/@types/node/sqlite.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/index.d.ts","./node_modules/@types/parse-json/index.d.ts","./node_modules/@types/react-dom/index.d.ts","./node_modules/@types/react-transition-group/config.d.ts","./node_modules/@types/react-transition-group/Transition.d.ts","./node_modules/@types/react-transition-group/CSSTransition.d.ts","./node_modules/@types/react-transition-group/SwitchTransition.d.ts","./node_modules/@types/react-transition-group/TransitionGroup.d.ts","./node_modules/@types/react-transition-group/index.d.ts","./node_modules/@types/use-sync-external-store/index.d.ts"],"fileIdsList":[[66,108],[58,66,108],[62,66,108],[66,67,108],[66,107,108],[108],[66,108,113,143],[66,108,109,114,120,121,128,140,151],[66,108,109,110,120,128],[66,108,111,152],[66,108,112,113,121,129],[66,108,113,140,148],[66,108,114,116,120,128],[66,107,108,115],[66,108,116,117],[66,108,120],[66,108,118,120],[66,107,108,120],[66,108,120,121,122,140,151],[66,108,120,121,122,135,140,143],[66,105,108,156],[66,105,108,116,120,123,128,140,151],[66,108,120,121,123,124,128,140,148,151],[66,108,123,125,140,148,151],[65,66,67,68,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158],[66,108,120,126],[66,108,127,151,156],[66,108,116,120,128,140],[66,108,129],[66,108,130],[66,107,108,131],[66,67,68,107,108,109,110,111,112,113,114,115,116,117,118,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157],[66,108,133],[66,108,134],[66,108,120,135,136],[66,108,135,137,152,154],[66,108,120,140,141,142,143],[66,108,140,142],[66,108,140,141],[66,108,143],[66,108,144],[66,67,108,140],[66,108,120,146,147],[66,108,146,147],[66,108,113,128,140,148],[66,108,149],[66,108,128,150],[66,108,123,134,151],[66,108,113,152],[66,108,140,153],[66,108,127,154],[66,108,155],[66,108,113,120,122,131,140,151,154,156],[66,108,140,157],[52,66,108],[52,66,108,163],[66,108,162,163,164,165,166],[49,50,51,66,108],[66,77,81,108,151],[66,77,108,140,151],[66,72,108],[66,74,77,108,148,151],[66,108,128,148],[66,108,159],[66,72,108,159],[66,74,77,108,128,151],[66,69,70,73,76,108,120,140,151],[66,77,84,108],[66,69,75,108],[66,77,98,99,108],[66,73,77,108,143,151,159],[66,98,108,159],[66,71,72,108,159],[66,77,108],[66,71,72,73,74,75,76,77,78,79,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,99,100,101,102,103,104,108],[66,77,92,108],[66,77,84,85,108],[66,75,77,85,86,108],[66,76,108],[66,69,72,77,108],[66,77,81,85,86,108],[66,81,108],[66,75,77,80,108,151],[66,69,74,77,84,108],[66,108,140],[66,72,77,98,108,156,159],[53,66,108,132],[53,66,108]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"7a3aa194cfd5919c4da251ef04ea051077e22702638d4edcb9579e9101653519","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","impliedFormat":1},{"version":"601144923e595d510cffa52b2ef75b16e894cb11751405f6ca6798614b068832","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},{"version":"224502644e4569a14557c60464e25c09253c923f7545745b78c2243905dd63bb","signature":"46a0b34e1264c4d25ca6646ff0e6cfaa7275ea1ae5a6bc23d4dfd84edf2f2b2e"},{"version":"b1538a92b9bae8d230267210c5db38c2eb6bdb352128a3ce3aa8c6acf9fc9622","impliedFormat":1},{"version":"6fc1a4f64372593767a9b7b774e9b3b92bf04e8785c3f9ea98973aa9f4bbe490","impliedFormat":1},{"version":"ff09b6fbdcf74d8af4e131b8866925c5e18d225540b9b19ce9485ca93e574d84","impliedFormat":1},{"version":"d5895252efa27a50f134a9b580aa61f7def5ab73d0a8071f9b5bf9a317c01c2d","impliedFormat":1},{"version":"a5a362a67cbaf83d5a2bc330f65481f3cfec7b1078dec7efad76166b3157b4dc","impliedFormat":1},{"version":"56208c500dcb5f42be7e18e8cb578f257a1a89b94b3280c506818fed06391805","impliedFormat":1},{"version":"0c94c2e497e1b9bcfda66aea239d5d36cd980d12a6d9d59e66f4be1fa3da5d5a","impliedFormat":1},{"version":"1f366bde16e0513fa7b64f87f86689c4d36efd85afce7eb24753e9c99b91c319","impliedFormat":1},{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fd06258805d26c72f5997e07a23155d322d5f05387adb3744a791fe6a0b042d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f6114eb1e8f70ec08816bdaa6ec740a0a7a01f25743e36f655f00157be394374","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","impliedFormat":1},{"version":"93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"bb2cd9339d0201e7e78ccb6ff2f71aac103934bf35eaaa37e139ac2b68af0db8","affectsGlobalScope":true,"impliedFormat":1},{"version":"76103716ba397bbb61f9fa9c9090dca59f39f9047cb1352b2179c5d8e7f4e8d0","impliedFormat":1},{"version":"53eac70430b30089a3a1959d8306b0f9cfaf0de75224b68ef25243e0b5ad1ca3","affectsGlobalScope":true,"impliedFormat":1},{"version":"4314c7a11517e221f7296b46547dbc4df047115b182f544d072bdccffa57fc72","impliedFormat":1},{"version":"115971d64632ea4742b5b115fb64ed04bcaae2c3c342f13d9ba7e3f9ee39c4e7","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"46e07db372dd75edc1a26e68f16d1b7ffb34b7ab3db5cdb3e391a3604ad7bb7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"24642567d3729bcc545bacb65ee7c0db423400c7f1ef757cab25d05650064f98","impliedFormat":1},{"version":"e6f5a38687bebe43a4cef426b69d34373ef68be9a6b1538ec0a371e69f309354","impliedFormat":1},{"version":"a6bf63d17324010ca1fbf0389cab83f93389bb0b9a01dc8a346d092f65b3605f","impliedFormat":1},{"version":"e009777bef4b023a999b2e5b9a136ff2cde37dc3f77c744a02840f05b18be8ff","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"42a872b757f365f61369e869f8403ec1e78b5a85418622801011009a1430d87f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c956ba45704d4a97f7a96923a307a6203bc0e7c4c532930d4c8ca261eaaff32a","impliedFormat":1},{"version":"ab0e88d33ccf15d8b3c891038b5a16094b0dd7e860ab0e2ba08da4384afce02b","impliedFormat":1},{"version":"954580f86c8e2a4abd5dcd1bcdf1a4c7e012495f1c39e058dc738bc93024642a","impliedFormat":1},{"version":"fa56be9b96f747e93b895d8dc2aa4fb9f0816743e6e2abb9d60705e88d4743a2","impliedFormat":1},{"version":"8257c55ff6bff6169142a35fce6811b511d857b4ae4f522cdb6ce20fd2116b2c","impliedFormat":1},{"version":"6d386bc0d7f3afa1d401afc3e00ed6b09205a354a9795196caed937494a713e6","impliedFormat":1},{"version":"3a9e5dddbd6ca9507d0c06a557535ba2224a94a2b0f3e146e8215f93b7e5b3a8","affectsGlobalScope":true,"impliedFormat":1},{"version":"94c4187083503a74f4544503b5a30e2bd7af0032dc739b0c9a7ce87f8bddc7b9","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"3c36ab47df4668254ccc170fc42e7d5116fd86a7e408d8dc220e559837cd2bbb","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f6abdaf8764ef01a552a958f45e795b5e79153b87ddad3af5264b86d2681b72","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"c6b4e0a02545304935ecbf7de7a8e056a31bb50939b5b321c9d50a405b5a0bba","impliedFormat":1},{"version":"c86b9afa9b39b12db8e877d23b48888d80f26e1fe72a95f58552746a6e1fa4fe","impliedFormat":1},{"version":"e432b0e3761ca9ba734bdd41e19a75fec1454ca8e9769bfdf8b31011854cf06a","impliedFormat":1},{"version":"e1120271ebbc9952fdc7b2dd3e145560e52e06956345e6fdf91d70ca4886464f","impliedFormat":1},{"version":"15c5e91b5f08be34a78e3d976179bf5b7a9cc28dc0ef1ffebffeb3c7812a2dca","impliedFormat":1},{"version":"a8f06c2382a30b7cb89ad2dfc48fc3b2b490f3dafcd839dadc008e4e5d57031d","impliedFormat":1},{"version":"07b9d3b7204d931acc29269c98ac3aac87ebcba6e05141552d42a4c17f895aa4","impliedFormat":1},{"version":"269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"1425f76ac97ce8617d1e2fa79e9a14e0fd1cfdaa155e13d4e92403a468177bc2","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"cca97c55398b8699fa3a96ef261b01d200ed2a44d2983586ab1a81d7d7b23cd9","affectsGlobalScope":true,"impliedFormat":1},{"version":"bef91efa0baea5d0e0f0f27b574a8bc100ce62a6d7e70220a0d58af6acab5e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"f59493f68eade5200559e5016b5855f7d12e6381eb6cab9ad8a379af367b3b2d","impliedFormat":1},{"version":"125e3472965f529de239d2bc85b54579fed8e0b060d1d04de6576fb910a6ec7f","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"18f5c7c4ad71748cffdd42e829398acdfd2d150a887e5f07aae4f2acab68e71b","affectsGlobalScope":true,"impliedFormat":1},{"version":"72ed3074450a4a315063278f046637afdeea90aa72b2292a7976958ceafc344a","affectsGlobalScope":true,"impliedFormat":1},{"version":"a5c09990a37469b0311a92ce8feeb8682e83918723aedbd445bd7a0f510eaaa3","impliedFormat":1},{"version":"6b29aea17044029b257e5bd4e3e4f765cd72b8d3c11c753f363ab92cc3f9f947","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"d008cf1330c86b37a8128265c80795397c287cecff273bc3ce3a4883405f5112","affectsGlobalScope":true,"impliedFormat":1},{"version":"78dc0513cc4f1642906b74dda42146bcbd9df7401717d6e89ea6d72d12ecb539","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"1428b46f53efef128041d6e9ac86963e6460ab7f91472c2bd0207744f60f6e85","impliedFormat":1},{"version":"916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","impliedFormat":1},{"version":"17ed71200119e86ccef2d96b73b02ce8854b76ad6bd21b5021d4269bec527b5f","impliedFormat":1},{"version":"960a68ced7820108787135bdae5265d2cc4b511b7dcfd5b8f213432a8483daf1","impliedFormat":1},{"version":"7c52a6d05a6e68269e63bc63fad6e869368a141ad23a20e2350c831dc499c5f2","impliedFormat":1},{"version":"2e7ebdc7d8af978c263890bbde991e88d6aa31cc29d46735c9c5f45f0a41243b","impliedFormat":1},{"version":"b57fd1c0a680d220e714b76d83eff51a08670f56efcc5d68abc82f5a2684f0c0","impliedFormat":1},{"version":"8cf121e98669f724256d06bebafec912b92bb042a06d4944f7fb27a56c545109","impliedFormat":1},{"version":"1084565c68b2aed5d6d5cea394799bd688afdf4dc99f4e3615957857c15bb231","impliedFormat":1},{"version":"7fa8d75d229eeaee235a801758d9c694e94405013fe77d5d1dd8e3201fc414f1","impliedFormat":1}],"root":[55,56],"options":{"composite":true,"exactOptionalPropertyTypes":true,"jsx":4,"module":99,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"skipLibCheck":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[57,1],[58,1],[59,1],[60,2],[61,1],[63,3],[62,1],[64,1],[67,4],[68,4],[107,5],[66,6],[108,7],[109,8],[110,9],[111,10],[112,11],[113,12],[114,13],[115,14],[116,15],[117,15],[119,16],[118,17],[120,18],[121,19],[122,20],[106,21],[158,1],[65,1],[123,22],[124,23],[125,24],[159,25],[126,26],[127,27],[128,28],[129,29],[130,30],[131,31],[132,32],[133,33],[134,34],[135,35],[136,35],[137,36],[138,1],[139,1],[140,37],[142,38],[141,39],[143,40],[144,41],[145,42],[146,43],[147,44],[148,45],[149,46],[150,47],[151,48],[152,49],[153,50],[154,51],[155,52],[156,53],[157,54],[160,1],[51,1],[161,55],[164,56],[165,55],[163,55],[166,56],[162,1],[167,57],[49,1],[52,58],[53,55],[168,1],[54,1],[50,1],[47,1],[48,1],[8,1],[9,1],[11,1],[10,1],[2,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[3,1],[20,1],[21,1],[4,1],[22,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[1,1],[46,1],[84,59],[94,60],[83,59],[104,61],[75,62],[74,63],[103,64],[97,65],[102,66],[77,67],[91,68],[76,69],[100,70],[72,71],[71,64],[101,72],[73,73],[78,74],[79,1],[82,74],[69,1],[105,75],[95,76],[86,77],[87,78],[89,79],[85,80],[88,81],[98,64],[80,82],[81,83],[90,84],[70,85],[93,76],[92,74],[96,1],[99,86],[55,87],[56,88]],"semanticDiagnosticsPerFile":[[56,[{"start":68,"length":22,"messageText":"Cannot find module '@vitejs/plugin-react' or its corresponding type declarations.","category":1,"code":2307},{"start":121,"length":6,"messageText":"Cannot find module 'vite' or its corresponding type declarations.","category":1,"code":2307},{"start":159,"length":28,"messageText":"Cannot find module 'vite-plugin-node-polyfills' or its corresponding type declarations.","category":1,"code":2307}]]],"affectedFilesPendingEmit":[55,56],"emitSignatures":[55,56],"version":"5.9.3"} \ No newline at end of file +{"fileNames":["./node_modules/typescript/lib/lib.es5.d.ts","./node_modules/typescript/lib/lib.es2015.d.ts","./node_modules/typescript/lib/lib.es2016.d.ts","./node_modules/typescript/lib/lib.es2017.d.ts","./node_modules/typescript/lib/lib.es2018.d.ts","./node_modules/typescript/lib/lib.es2019.d.ts","./node_modules/typescript/lib/lib.es2020.d.ts","./node_modules/typescript/lib/lib.dom.d.ts","./node_modules/typescript/lib/lib.dom.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.core.d.ts","./node_modules/typescript/lib/lib.es2015.collection.d.ts","./node_modules/typescript/lib/lib.es2015.generator.d.ts","./node_modules/typescript/lib/lib.es2015.iterable.d.ts","./node_modules/typescript/lib/lib.es2015.promise.d.ts","./node_modules/typescript/lib/lib.es2015.proxy.d.ts","./node_modules/typescript/lib/lib.es2015.reflect.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.d.ts","./node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2016.array.include.d.ts","./node_modules/typescript/lib/lib.es2016.intl.d.ts","./node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","./node_modules/typescript/lib/lib.es2017.date.d.ts","./node_modules/typescript/lib/lib.es2017.object.d.ts","./node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2017.string.d.ts","./node_modules/typescript/lib/lib.es2017.intl.d.ts","./node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","./node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","./node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","./node_modules/typescript/lib/lib.es2018.intl.d.ts","./node_modules/typescript/lib/lib.es2018.promise.d.ts","./node_modules/typescript/lib/lib.es2018.regexp.d.ts","./node_modules/typescript/lib/lib.es2019.array.d.ts","./node_modules/typescript/lib/lib.es2019.object.d.ts","./node_modules/typescript/lib/lib.es2019.string.d.ts","./node_modules/typescript/lib/lib.es2019.symbol.d.ts","./node_modules/typescript/lib/lib.es2019.intl.d.ts","./node_modules/typescript/lib/lib.es2020.bigint.d.ts","./node_modules/typescript/lib/lib.es2020.date.d.ts","./node_modules/typescript/lib/lib.es2020.promise.d.ts","./node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","./node_modules/typescript/lib/lib.es2020.string.d.ts","./node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","./node_modules/typescript/lib/lib.es2020.intl.d.ts","./node_modules/typescript/lib/lib.es2020.number.d.ts","./node_modules/typescript/lib/lib.esnext.intl.d.ts","./node_modules/typescript/lib/lib.decorators.d.ts","./node_modules/typescript/lib/lib.decorators.legacy.d.ts","./node_modules/@types/react/global.d.ts","./node_modules/csstype/index.d.ts","./node_modules/@types/prop-types/index.d.ts","./node_modules/@types/react/index.d.ts","./node_modules/@types/react/jsx-runtime.d.ts","./node_modules/buffer/index.d.ts","./src/polyfills/node-globals.ts","./node_modules/@types/node/globals.typedarray.d.ts","./node_modules/@types/node/buffer.buffer.d.ts","./node_modules/@types/node/assert.d.ts","./node_modules/@types/node/assert/strict.d.ts","./node_modules/undici-types/header.d.ts","./node_modules/undici-types/readable.d.ts","./node_modules/undici-types/file.d.ts","./node_modules/undici-types/fetch.d.ts","./node_modules/undici-types/formdata.d.ts","./node_modules/undici-types/connector.d.ts","./node_modules/undici-types/client.d.ts","./node_modules/undici-types/errors.d.ts","./node_modules/undici-types/dispatcher.d.ts","./node_modules/undici-types/global-dispatcher.d.ts","./node_modules/undici-types/global-origin.d.ts","./node_modules/undici-types/pool-stats.d.ts","./node_modules/undici-types/pool.d.ts","./node_modules/undici-types/handlers.d.ts","./node_modules/undici-types/balanced-pool.d.ts","./node_modules/undici-types/agent.d.ts","./node_modules/undici-types/mock-interceptor.d.ts","./node_modules/undici-types/mock-agent.d.ts","./node_modules/undici-types/mock-client.d.ts","./node_modules/undici-types/mock-pool.d.ts","./node_modules/undici-types/mock-errors.d.ts","./node_modules/undici-types/proxy-agent.d.ts","./node_modules/undici-types/env-http-proxy-agent.d.ts","./node_modules/undici-types/retry-handler.d.ts","./node_modules/undici-types/retry-agent.d.ts","./node_modules/undici-types/api.d.ts","./node_modules/undici-types/interceptors.d.ts","./node_modules/undici-types/util.d.ts","./node_modules/undici-types/cookies.d.ts","./node_modules/undici-types/patch.d.ts","./node_modules/undici-types/websocket.d.ts","./node_modules/undici-types/eventsource.d.ts","./node_modules/undici-types/filereader.d.ts","./node_modules/undici-types/diagnostics-channel.d.ts","./node_modules/undici-types/content-type.d.ts","./node_modules/undici-types/cache.d.ts","./node_modules/undici-types/index.d.ts","./node_modules/@types/node/globals.d.ts","./node_modules/@types/node/async_hooks.d.ts","./node_modules/@types/node/buffer.d.ts","./node_modules/@types/node/child_process.d.ts","./node_modules/@types/node/cluster.d.ts","./node_modules/@types/node/console.d.ts","./node_modules/@types/node/constants.d.ts","./node_modules/@types/node/crypto.d.ts","./node_modules/@types/node/dgram.d.ts","./node_modules/@types/node/diagnostics_channel.d.ts","./node_modules/@types/node/dns.d.ts","./node_modules/@types/node/dns/promises.d.ts","./node_modules/@types/node/domain.d.ts","./node_modules/@types/node/dom-events.d.ts","./node_modules/@types/node/events.d.ts","./node_modules/@types/node/fs.d.ts","./node_modules/@types/node/fs/promises.d.ts","./node_modules/@types/node/http.d.ts","./node_modules/@types/node/http2.d.ts","./node_modules/@types/node/https.d.ts","./node_modules/@types/node/inspector.d.ts","./node_modules/@types/node/module.d.ts","./node_modules/@types/node/net.d.ts","./node_modules/@types/node/os.d.ts","./node_modules/@types/node/path.d.ts","./node_modules/@types/node/perf_hooks.d.ts","./node_modules/@types/node/process.d.ts","./node_modules/@types/node/punycode.d.ts","./node_modules/@types/node/querystring.d.ts","./node_modules/@types/node/readline.d.ts","./node_modules/@types/node/readline/promises.d.ts","./node_modules/@types/node/repl.d.ts","./node_modules/@types/node/sea.d.ts","./node_modules/@types/node/sqlite.d.ts","./node_modules/@types/node/stream.d.ts","./node_modules/@types/node/stream/promises.d.ts","./node_modules/@types/node/stream/consumers.d.ts","./node_modules/@types/node/stream/web.d.ts","./node_modules/@types/node/string_decoder.d.ts","./node_modules/@types/node/test.d.ts","./node_modules/@types/node/timers.d.ts","./node_modules/@types/node/timers/promises.d.ts","./node_modules/@types/node/tls.d.ts","./node_modules/@types/node/trace_events.d.ts","./node_modules/@types/node/tty.d.ts","./node_modules/@types/node/url.d.ts","./node_modules/@types/node/util.d.ts","./node_modules/@types/node/v8.d.ts","./node_modules/@types/node/vm.d.ts","./node_modules/@types/node/wasi.d.ts","./node_modules/@types/node/worker_threads.d.ts","./node_modules/@types/node/zlib.d.ts","./node_modules/@types/node/globals.global.d.ts","./node_modules/@types/node/index.d.ts","./node_modules/@types/estree/index.d.ts","./node_modules/rollup/dist/rollup.d.ts","./node_modules/rollup/dist/parseAst.d.ts","./node_modules/vite/types/hmrPayload.d.ts","./node_modules/vite/types/customEvent.d.ts","./node_modules/vite/types/hot.d.ts","./node_modules/vite/dist/node/types.d-aGj9QkWt.d.ts","./node_modules/vite/node_modules/esbuild/lib/main.d.ts","./node_modules/source-map-js/source-map.d.ts","./node_modules/postcss/lib/previous-map.d.ts","./node_modules/postcss/lib/input.d.ts","./node_modules/postcss/lib/css-syntax-error.d.ts","./node_modules/postcss/lib/declaration.d.ts","./node_modules/postcss/lib/root.d.ts","./node_modules/postcss/lib/warning.d.ts","./node_modules/postcss/lib/lazy-result.d.ts","./node_modules/postcss/lib/no-work-result.d.ts","./node_modules/postcss/lib/processor.d.ts","./node_modules/postcss/lib/result.d.ts","./node_modules/postcss/lib/document.d.ts","./node_modules/postcss/lib/rule.d.ts","./node_modules/postcss/lib/node.d.ts","./node_modules/postcss/lib/comment.d.ts","./node_modules/postcss/lib/container.d.ts","./node_modules/postcss/lib/at-rule.d.ts","./node_modules/postcss/lib/list.d.ts","./node_modules/postcss/lib/postcss.d.ts","./node_modules/postcss/lib/postcss.d.mts","./node_modules/vite/dist/node/runtime.d.ts","./node_modules/vite/types/importGlob.d.ts","./node_modules/vite/types/metadata.d.ts","./node_modules/vite/dist/node/index.d.ts","./node_modules/@babel/types/lib/index.d.ts","./node_modules/@types/babel__generator/index.d.ts","./node_modules/@babel/parser/typings/babel-parser.d.ts","./node_modules/@types/babel__template/index.d.ts","./node_modules/@types/babel__traverse/index.d.ts","./node_modules/@types/babel__core/index.d.ts","./node_modules/@vitejs/plugin-react/dist/index.d.ts","./node_modules/node-stdlib-browser/esm/index.d.ts","./node_modules/vite-plugin-node-polyfills/dist/index.d.ts","./vite.config.ts","./node_modules/@types/d3-array/index.d.ts","./node_modules/@types/d3-color/index.d.ts","./node_modules/@types/d3-ease/index.d.ts","./node_modules/@types/d3-interpolate/index.d.ts","./node_modules/@types/d3-path/index.d.ts","./node_modules/@types/d3-time/index.d.ts","./node_modules/@types/d3-scale/index.d.ts","./node_modules/@types/d3-shape/index.d.ts","./node_modules/@types/d3-timer/index.d.ts","./node_modules/@types/parse-json/index.d.ts","./node_modules/@types/react-dom/index.d.ts","./node_modules/@types/react-transition-group/config.d.ts","./node_modules/@types/react-transition-group/Transition.d.ts","./node_modules/@types/react-transition-group/CSSTransition.d.ts","./node_modules/@types/react-transition-group/SwitchTransition.d.ts","./node_modules/@types/react-transition-group/TransitionGroup.d.ts","./node_modules/@types/react-transition-group/index.d.ts","./node_modules/@types/recharts/index.d.ts","./node_modules/@types/use-sync-external-store/index.d.ts"],"fileIdsList":[[57,99,183],[57,99],[57,99,183,184,185,186,187],[57,99,183,185],[57,99,194],[57,99,198],[57,99,197],[57,58,99],[57,98,99],[99],[57,99,104,134],[57,99,100,105,111,112,119,131,142],[57,99,100,101,111,119],[57,99,102,143],[57,99,103,104,112,120],[57,99,104,131,139],[57,99,105,107,111,119],[57,98,99,106],[57,99,107,108],[57,99,111],[57,99,109,111],[57,98,99,111],[57,99,111,112,113,131,142],[57,99,111,112,113,126,131,134],[57,96,99,147],[57,96,99,107,111,114,119,131,142],[57,99,111,112,114,115,119,131,139,142],[57,99,114,116,131,139,142],[56,57,58,59,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149],[57,99,111,117],[57,99,118,142,147],[57,99,107,111,119,131],[57,99,120],[57,99,121],[57,98,99,122],[57,58,59,98,99,100,101,102,103,104,105,106,107,108,109,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148],[57,99,124],[57,99,125],[57,99,111,126,127],[57,99,126,128,143,145],[57,99,111,131,132,133,134],[57,99,131,133],[57,99,131,132],[57,99,134],[57,99,135],[57,58,99,131],[57,99,111,137,138],[57,99,137,138],[57,99,104,119,131,139],[57,99,140],[57,99,119,141],[57,99,114,125,142],[57,99,104,143],[57,99,131,144],[57,99,118,145],[57,99,146],[57,99,104,111,113,122,131,142,145,147],[57,99,131,148],[52,57,99],[52,57,99,205],[57,99,204,205,206,207,208],[49,50,51,57,99],[52,57,99,200],[57,99,182,188],[57,99,174],[57,99,172,174],[57,99,163,171,172,173,175,177],[57,99,161],[57,99,164,169,174,177],[57,99,160,177],[57,99,164,165,168,169,170,177],[57,99,164,165,166,168,169,177],[57,99,161,162,163,164,165,169,170,171,173,174,175,177],[57,99,177],[57,99,159,161,162,163,164,165,166,168,169,170,171,172,173,174,175,176],[57,99,159,177],[57,99,164,166,167,169,170,177],[57,99,168,177],[57,99,169,170,174,177],[57,99,162,172],[57,99,152,181],[57,99,151,152],[57,68,72,99,142],[57,68,99,131,142],[57,63,99],[57,65,68,99,139,142],[57,99,119,139],[57,99,150],[57,63,99,150],[57,65,68,99,119,142],[57,60,61,64,67,99,111,131,142],[57,68,75,99],[57,60,66,99],[57,68,89,90,99],[57,64,68,99,134,142,150],[57,89,99,150],[57,62,63,99,150],[57,68,99],[57,62,63,64,65,66,67,68,69,70,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,90,91,92,93,94,95,99],[57,68,83,99],[57,68,75,76,99],[57,66,68,76,77,99],[57,67,99],[57,60,63,68,99],[57,68,72,76,77,99],[57,72,99],[57,66,68,71,99,142],[57,60,65,68,75,99],[57,99,131],[57,63,68,89,99,147,150],[57,99,182,190],[57,99,111,112,114,115,116,119,131,139,142,148,150,152,153,154,155,156,157,158,178,179,180,181],[57,99,154,155,156,157],[57,99,154,155,156],[57,99,154],[57,99,155],[57,99,152],[53,57,99,123],[53,57,99,182,189,191]],"fileInfos":[{"version":"c430d44666289dae81f30fa7b2edebf186ecc91a2d4c71266ea6ae76388792e1","affectsGlobalScope":true,"impliedFormat":1},{"version":"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","impliedFormat":1},{"version":"3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","impliedFormat":1},{"version":"e44bb8bbac7f10ecc786703fe0a6a4b952189f908707980ba8f3c8975a760962","impliedFormat":1},{"version":"5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","impliedFormat":1},{"version":"68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","impliedFormat":1},{"version":"5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","impliedFormat":1},{"version":"080941d9f9ff9307f7e27a83bcd888b7c8270716c39af943532438932ec1d0b9","affectsGlobalScope":true,"impliedFormat":1},{"version":"2e80ee7a49e8ac312cc11b77f1475804bee36b3b2bc896bead8b6e1266befb43","affectsGlobalScope":true,"impliedFormat":1},{"version":"c57796738e7f83dbc4b8e65132f11a377649c00dd3eee333f672b8f0a6bea671","affectsGlobalScope":true,"impliedFormat":1},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true,"impliedFormat":1},{"version":"515d0b7b9bea2e31ea4ec968e9edd2c39d3eebf4a2d5cbd04e88639819ae3b71","affectsGlobalScope":true,"impliedFormat":1},{"version":"0559b1f683ac7505ae451f9a96ce4c3c92bdc71411651ca6ddb0e88baaaad6a3","affectsGlobalScope":true,"impliedFormat":1},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true,"impliedFormat":1},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true,"impliedFormat":1},{"version":"fb0f136d372979348d59b3f5020b4cdb81b5504192b1cacff5d1fbba29378aa1","affectsGlobalScope":true,"impliedFormat":1},{"version":"d15bea3d62cbbdb9797079416b8ac375ae99162a7fba5de2c6c505446486ac0a","affectsGlobalScope":true,"impliedFormat":1},{"version":"68d18b664c9d32a7336a70235958b8997ebc1c3b8505f4f1ae2b7e7753b87618","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb3d66c8327153d8fa7dd03f9c58d351107fe824c79e9b56b462935176cdf12a","affectsGlobalScope":true,"impliedFormat":1},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true,"impliedFormat":1},{"version":"69ab18c3b76cd9b1be3d188eaf8bba06112ebbe2f47f6c322b5105a6fbc45a2e","affectsGlobalScope":true,"impliedFormat":1},{"version":"a680117f487a4d2f30ea46f1b4b7f58bef1480456e18ba53ee85c2746eeca012","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true,"impliedFormat":1},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true,"impliedFormat":1},{"version":"954296b30da6d508a104a3a0b5d96b76495c709785c1d11610908e63481ee667","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac9538681b19688c8eae65811b329d3744af679e0bdfa5d842d0e32524c73e1c","affectsGlobalScope":true,"impliedFormat":1},{"version":"0a969edff4bd52585473d24995c5ef223f6652d6ef46193309b3921d65dd4376","affectsGlobalScope":true,"impliedFormat":1},{"version":"9e9fbd7030c440b33d021da145d3232984c8bb7916f277e8ffd3dc2e3eae2bdb","affectsGlobalScope":true,"impliedFormat":1},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true,"impliedFormat":1},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true,"impliedFormat":1},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true,"impliedFormat":1},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true,"impliedFormat":1},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true,"impliedFormat":1},{"version":"74f7fa2d027d5b33eb0471c8e82a6c87216223181ec31247c357a3e8e2fddc5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"d6d7ae4d1f1f3772e2a3cde568ed08991a8ae34a080ff1151af28b7f798e22ca","affectsGlobalScope":true,"impliedFormat":1},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true,"impliedFormat":1},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true,"impliedFormat":1},{"version":"52ada8e0b6e0482b728070b7639ee42e83a9b1c22d205992756fe020fd9f4a47","affectsGlobalScope":true,"impliedFormat":1},{"version":"3bdefe1bfd4d6dee0e26f928f93ccc128f1b64d5d501ff4a8cf3c6371200e5e6","affectsGlobalScope":true,"impliedFormat":1},{"version":"59fb2c069260b4ba00b5643b907ef5d5341b167e7d1dbf58dfd895658bda2867","affectsGlobalScope":true,"impliedFormat":1},{"version":"639e512c0dfc3fad96a84caad71b8834d66329a1f28dc95e3946c9b58176c73a","affectsGlobalScope":true,"impliedFormat":1},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true,"impliedFormat":1},{"version":"811c71eee4aa0ac5f7adf713323a5c41b0cf6c4e17367a34fbce379e12bbf0a4","affectsGlobalScope":true,"impliedFormat":1},{"version":"8e7f8264d0fb4c5339605a15daadb037bf238c10b654bb3eee14208f860a32ea","affectsGlobalScope":true,"impliedFormat":1},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true,"impliedFormat":1},{"version":"eb5b19b86227ace1d29ea4cf81387279d04bb34051e944bc53df69f58914b788","affectsGlobalScope":true,"impliedFormat":1},{"version":"ac51dd7d31333793807a6abaa5ae168512b6131bd41d9c5b98477fc3b7800f9f","impliedFormat":1},{"version":"87d9d29dbc745f182683f63187bf3d53fd8673e5fca38ad5eaab69798ed29fbc","impliedFormat":1},{"version":"7a3aa194cfd5919c4da251ef04ea051077e22702638d4edcb9579e9101653519","affectsGlobalScope":true,"impliedFormat":1},{"version":"42c169fb8c2d42f4f668c624a9a11e719d5d07dacbebb63cbcf7ef365b0a75b3","impliedFormat":1},{"version":"4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","impliedFormat":1},"601144923e595d510cffa52b2ef75b16e894cb11751405f6ca6798614b068832",{"version":"a79e62f1e20467e11a904399b8b18b18c0c6eea6b50c1168bf215356d5bebfaf","affectsGlobalScope":true,"impliedFormat":1},{"version":"0fd06258805d26c72f5997e07a23155d322d5f05387adb3744a791fe6a0b042d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f6114eb1e8f70ec08816bdaa6ec740a0a7a01f25743e36f655f00157be394374","impliedFormat":1},{"version":"7394959e5a741b185456e1ef5d64599c36c60a323207450991e7a42e08911419","impliedFormat":1},{"version":"5929864ce17fba74232584d90cb721a89b7ad277220627cc97054ba15a98ea8f","impliedFormat":1},{"version":"24bd580b5743dc56402c440dc7f9a4f5d592ad7a419f25414d37a7bfe11e342b","impliedFormat":1},{"version":"25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","impliedFormat":1},{"version":"c464d66b20788266e5353b48dc4aa6bc0dc4a707276df1e7152ab0c9ae21fad8","impliedFormat":1},{"version":"78d0d27c130d35c60b5e5566c9f1e5be77caf39804636bc1a40133919a949f21","impliedFormat":1},{"version":"c6fd2c5a395f2432786c9cb8deb870b9b0e8ff7e22c029954fabdd692bff6195","impliedFormat":1},{"version":"1d6e127068ea8e104a912e42fc0a110e2aa5a66a356a917a163e8cf9a65e4a75","impliedFormat":1},{"version":"5ded6427296cdf3b9542de4471d2aa8d3983671d4cac0f4bf9c637208d1ced43","impliedFormat":1},{"version":"6bdc71028db658243775263e93a7db2fd2abfce3ca569c3cca5aee6ed5eb186d","impliedFormat":1},{"version":"cadc8aced301244057c4e7e73fbcae534b0f5b12a37b150d80e5a45aa4bebcbd","impliedFormat":1},{"version":"385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","impliedFormat":1},{"version":"9670d44354bab9d9982eca21945686b5c24a3f893db73c0dae0fd74217a4c219","impliedFormat":1},{"version":"0b8a9268adaf4da35e7fa830c8981cfa22adbbe5b3f6f5ab91f6658899e657a7","impliedFormat":1},{"version":"11396ed8a44c02ab9798b7dca436009f866e8dae3c9c25e8c1fbc396880bf1bb","impliedFormat":1},{"version":"ba7bc87d01492633cb5a0e5da8a4a42a1c86270e7b3d2dea5d156828a84e4882","impliedFormat":1},{"version":"4893a895ea92c85345017a04ed427cbd6a1710453338df26881a6019432febdd","impliedFormat":1},{"version":"c21dc52e277bcfc75fac0436ccb75c204f9e1b3fa5e12729670910639f27343e","impliedFormat":1},{"version":"13f6f39e12b1518c6650bbb220c8985999020fe0f21d818e28f512b7771d00f9","impliedFormat":1},{"version":"9b5369969f6e7175740bf51223112ff209f94ba43ecd3bb09eefff9fd675624a","impliedFormat":1},{"version":"4fe9e626e7164748e8769bbf74b538e09607f07ed17c2f20af8d680ee49fc1da","impliedFormat":1},{"version":"24515859bc0b836719105bb6cc3d68255042a9f02a6022b3187948b204946bd2","impliedFormat":1},{"version":"ea0148f897b45a76544ae179784c95af1bd6721b8610af9ffa467a518a086a43","impliedFormat":1},{"version":"24c6a117721e606c9984335f71711877293a9651e44f59f3d21c1ea0856f9cc9","impliedFormat":1},{"version":"dd3273ead9fbde62a72949c97dbec2247ea08e0c6952e701a483d74ef92d6a17","impliedFormat":1},{"version":"405822be75ad3e4d162e07439bac80c6bcc6dbae1929e179cf467ec0b9ee4e2e","impliedFormat":1},{"version":"0db18c6e78ea846316c012478888f33c11ffadab9efd1cc8bcc12daded7a60b6","impliedFormat":1},{"version":"4d2b0eb911816f66abe4970898f97a2cfc902bcd743cbfa5017fad79f7ef90d8","impliedFormat":1},{"version":"bd0532fd6556073727d28da0edfd1736417a3f9f394877b6d5ef6ad88fba1d1a","impliedFormat":1},{"version":"89167d696a849fce5ca508032aabfe901c0868f833a8625d5a9c6e861ef935d2","impliedFormat":1},{"version":"e53a3c2a9f624d90f24bf4588aacd223e7bec1b9d0d479b68d2f4a9e6011147f","impliedFormat":1},{"version":"24b8685c62562f5d98615c5a0c1d05f297cf5065f15246edfe99e81ec4c0e011","impliedFormat":1},{"version":"93507c745e8f29090efb99399c3f77bec07db17acd75634249dc92f961573387","impliedFormat":1},{"version":"339dc5265ee5ed92e536a93a04c4ebbc2128f45eeec6ed29f379e0085283542c","impliedFormat":1},{"version":"4732aec92b20fb28c5fe9ad99521fb59974289ed1e45aecb282616202184064f","impliedFormat":1},{"version":"2e85db9e6fd73cfa3d7f28e0ab6b55417ea18931423bd47b409a96e4a169e8e6","impliedFormat":1},{"version":"c46e079fe54c76f95c67fb89081b3e399da2c7d109e7dca8e4b58d83e332e605","impliedFormat":1},{"version":"bf67d53d168abc1298888693338cb82854bdb2e69ef83f8a0092093c2d562107","impliedFormat":1},{"version":"bb2cd9339d0201e7e78ccb6ff2f71aac103934bf35eaaa37e139ac2b68af0db8","affectsGlobalScope":true,"impliedFormat":1},{"version":"76103716ba397bbb61f9fa9c9090dca59f39f9047cb1352b2179c5d8e7f4e8d0","impliedFormat":1},{"version":"53eac70430b30089a3a1959d8306b0f9cfaf0de75224b68ef25243e0b5ad1ca3","affectsGlobalScope":true,"impliedFormat":1},{"version":"4314c7a11517e221f7296b46547dbc4df047115b182f544d072bdccffa57fc72","impliedFormat":1},{"version":"115971d64632ea4742b5b115fb64ed04bcaae2c3c342f13d9ba7e3f9ee39c4e7","impliedFormat":1},{"version":"c2510f124c0293ab80b1777c44d80f812b75612f297b9857406468c0f4dafe29","affectsGlobalScope":true,"impliedFormat":1},{"version":"a40826e8476694e90da94aa008283a7de50d1dafd37beada623863f1901cb7fb","impliedFormat":1},{"version":"46e07db372dd75edc1a26e68f16d1b7ffb34b7ab3db5cdb3e391a3604ad7bb7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"24642567d3729bcc545bacb65ee7c0db423400c7f1ef757cab25d05650064f98","impliedFormat":1},{"version":"e6f5a38687bebe43a4cef426b69d34373ef68be9a6b1538ec0a371e69f309354","impliedFormat":1},{"version":"a6bf63d17324010ca1fbf0389cab83f93389bb0b9a01dc8a346d092f65b3605f","impliedFormat":1},{"version":"e009777bef4b023a999b2e5b9a136ff2cde37dc3f77c744a02840f05b18be8ff","impliedFormat":1},{"version":"1e0d1f8b0adfa0b0330e028c7941b5a98c08b600efe7f14d2d2a00854fb2f393","impliedFormat":1},{"version":"ee1ee365d88c4c6c0c0a5a5701d66ebc27ccd0bcfcfaa482c6e2e7fe7b98edf7","affectsGlobalScope":true,"impliedFormat":1},{"version":"42a872b757f365f61369e869f8403ec1e78b5a85418622801011009a1430d87f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c956ba45704d4a97f7a96923a307a6203bc0e7c4c532930d4c8ca261eaaff32a","impliedFormat":1},{"version":"ab0e88d33ccf15d8b3c891038b5a16094b0dd7e860ab0e2ba08da4384afce02b","impliedFormat":1},{"version":"954580f86c8e2a4abd5dcd1bcdf1a4c7e012495f1c39e058dc738bc93024642a","impliedFormat":1},{"version":"fa56be9b96f747e93b895d8dc2aa4fb9f0816743e6e2abb9d60705e88d4743a2","impliedFormat":1},{"version":"8257c55ff6bff6169142a35fce6811b511d857b4ae4f522cdb6ce20fd2116b2c","impliedFormat":1},{"version":"6d386bc0d7f3afa1d401afc3e00ed6b09205a354a9795196caed937494a713e6","impliedFormat":1},{"version":"3a9e5dddbd6ca9507d0c06a557535ba2224a94a2b0f3e146e8215f93b7e5b3a8","affectsGlobalScope":true,"impliedFormat":1},{"version":"94c4187083503a74f4544503b5a30e2bd7af0032dc739b0c9a7ce87f8bddc7b9","impliedFormat":1},{"version":"b1b6ee0d012aeebe11d776a155d8979730440082797695fc8e2a5c326285678f","impliedFormat":1},{"version":"45875bcae57270aeb3ebc73a5e3fb4c7b9d91d6b045f107c1d8513c28ece71c0","impliedFormat":1},{"version":"3c36ab47df4668254ccc170fc42e7d5116fd86a7e408d8dc220e559837cd2bbb","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f6abdaf8764ef01a552a958f45e795b5e79153b87ddad3af5264b86d2681b72","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f16a7e4deafa527ed9995a772bb380eb7d3c2c0fd4ae178c5263ed18394db2c","impliedFormat":1},{"version":"c6b4e0a02545304935ecbf7de7a8e056a31bb50939b5b321c9d50a405b5a0bba","impliedFormat":1},{"version":"c86b9afa9b39b12db8e877d23b48888d80f26e1fe72a95f58552746a6e1fa4fe","impliedFormat":1},{"version":"e432b0e3761ca9ba734bdd41e19a75fec1454ca8e9769bfdf8b31011854cf06a","impliedFormat":1},{"version":"e1120271ebbc9952fdc7b2dd3e145560e52e06956345e6fdf91d70ca4886464f","impliedFormat":1},{"version":"15c5e91b5f08be34a78e3d976179bf5b7a9cc28dc0ef1ffebffeb3c7812a2dca","impliedFormat":1},{"version":"a8f06c2382a30b7cb89ad2dfc48fc3b2b490f3dafcd839dadc008e4e5d57031d","impliedFormat":1},{"version":"07b9d3b7204d931acc29269c98ac3aac87ebcba6e05141552d42a4c17f895aa4","impliedFormat":1},{"version":"269929a24b2816343a178008ac9ae9248304d92a8ba8e233055e0ed6dbe6ef71","impliedFormat":1},{"version":"93452d394fdd1dc551ec62f5042366f011a00d342d36d50793b3529bfc9bd633","impliedFormat":1},{"version":"1425f76ac97ce8617d1e2fa79e9a14e0fd1cfdaa155e13d4e92403a468177bc2","affectsGlobalScope":true,"impliedFormat":1},{"version":"2754d8221d77c7b382096651925eb476f1066b3348da4b73fe71ced7801edada","impliedFormat":1},{"version":"cca97c55398b8699fa3a96ef261b01d200ed2a44d2983586ab1a81d7d7b23cd9","affectsGlobalScope":true,"impliedFormat":1},{"version":"bef91efa0baea5d0e0f0f27b574a8bc100ce62a6d7e70220a0d58af6acab5e89","affectsGlobalScope":true,"impliedFormat":1},{"version":"f59493f68eade5200559e5016b5855f7d12e6381eb6cab9ad8a379af367b3b2d","impliedFormat":1},{"version":"125e3472965f529de239d2bc85b54579fed8e0b060d1d04de6576fb910a6ec7f","impliedFormat":1},{"version":"66ba1b2c3e3a3644a1011cd530fb444a96b1b2dfe2f5e837a002d41a1a799e60","impliedFormat":1},{"version":"7e514f5b852fdbc166b539fdd1f4e9114f29911592a5eb10a94bb3a13ccac3c4","impliedFormat":1},{"version":"18f5c7c4ad71748cffdd42e829398acdfd2d150a887e5f07aae4f2acab68e71b","affectsGlobalScope":true,"impliedFormat":1},{"version":"72ed3074450a4a315063278f046637afdeea90aa72b2292a7976958ceafc344a","affectsGlobalScope":true,"impliedFormat":1},{"version":"a5c09990a37469b0311a92ce8feeb8682e83918723aedbd445bd7a0f510eaaa3","impliedFormat":1},{"version":"6b29aea17044029b257e5bd4e3e4f765cd72b8d3c11c753f363ab92cc3f9f947","impliedFormat":1},{"version":"ac5ed35e649cdd8143131964336ab9076937fa91802ec760b3ea63b59175c10a","impliedFormat":1},{"version":"d008cf1330c86b37a8128265c80795397c287cecff273bc3ce3a4883405f5112","affectsGlobalScope":true,"impliedFormat":1},{"version":"78dc0513cc4f1642906b74dda42146bcbd9df7401717d6e89ea6d72d12ecb539","impliedFormat":1},{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true,"impliedFormat":1},{"version":"1428b46f53efef128041d6e9ac86963e6460ab7f91472c2bd0207744f60f6e85","impliedFormat":1},{"version":"151ff381ef9ff8da2da9b9663ebf657eac35c4c9a19183420c05728f31a6761d","impliedFormat":1},{"version":"ee70b8037ecdf0de6c04f35277f253663a536d7e38f1539d270e4e916d225a3f","affectsGlobalScope":true,"impliedFormat":1},{"version":"a660aa95476042d3fdcc1343cf6bb8fdf24772d31712b1db321c5a4dcc325434","impliedFormat":1},{"version":"282f98006ed7fa9bb2cd9bdbe2524595cfc4bcd58a0bb3232e4519f2138df811","impliedFormat":1},{"version":"6222e987b58abfe92597e1273ad7233626285bc2d78409d4a7b113d81a83496b","impliedFormat":1},{"version":"cbe726263ae9a7bf32352380f7e8ab66ee25b3457137e316929269c19e18a2be","impliedFormat":1},{"version":"8b96046bf5fb0a815cba6b0880d9f97b7f3a93cf187e8dcfe8e2792e97f38f87","impliedFormat":99},{"version":"bacf2c84cf448b2cd02c717ad46c3d7fd530e0c91282888c923ad64810a4d511","affectsGlobalScope":true,"impliedFormat":1},{"version":"402e5c534fb2b85fa771170595db3ac0dd532112c8fa44fc23f233bc6967488b","impliedFormat":1},{"version":"8885cf05f3e2abf117590bbb951dcf6359e3e5ac462af1c901cfd24c6a6472e2","impliedFormat":1},{"version":"333caa2bfff7f06017f114de738050dd99a765c7eb16571c6d25a38c0d5365dc","impliedFormat":1},{"version":"e61df3640a38d535fd4bc9f4a53aef17c296b58dc4b6394fd576b808dd2fe5e6","impliedFormat":1},{"version":"459920181700cec8cbdf2a5faca127f3f17fd8dd9d9e577ed3f5f3af5d12a2e4","impliedFormat":1},{"version":"4719c209b9c00b579553859407a7e5dcfaa1c472994bd62aa5dd3cc0757eb077","impliedFormat":1},{"version":"7ec359bbc29b69d4063fe7dad0baaf35f1856f914db16b3f4f6e3e1bca4099fa","impliedFormat":1},{"version":"70790a7f0040993ca66ab8a07a059a0f8256e7bb57d968ae945f696cbff4ac7a","impliedFormat":1},{"version":"d1b9a81e99a0050ca7f2d98d7eedc6cda768f0eb9fa90b602e7107433e64c04c","impliedFormat":1},{"version":"a022503e75d6953d0e82c2c564508a5c7f8556fad5d7f971372d2d40479e4034","impliedFormat":1},{"version":"b215c4f0096f108020f666ffcc1f072c81e9f2f95464e894a5d5f34c5ea2a8b1","impliedFormat":1},{"version":"644491cde678bd462bb922c1d0cfab8f17d626b195ccb7f008612dc31f445d2d","impliedFormat":1},{"version":"dfe54dab1fa4961a6bcfba68c4ca955f8b5bbeb5f2ab3c915aa7adaa2eabc03a","impliedFormat":1},{"version":"1251d53755b03cde02466064260bb88fd83c30006a46395b7d9167340bc59b73","impliedFormat":1},{"version":"47865c5e695a382a916b1eedda1b6523145426e48a2eae4647e96b3b5e52024f","impliedFormat":1},{"version":"4cdf27e29feae6c7826cdd5c91751cc35559125e8304f9e7aed8faef97dcf572","impliedFormat":1},{"version":"331b8f71bfae1df25d564f5ea9ee65a0d847c4a94baa45925b6f38c55c7039bf","impliedFormat":1},{"version":"2a771d907aebf9391ac1f50e4ad37952943515eeea0dcc7e78aa08f508294668","impliedFormat":1},{"version":"0146fd6262c3fd3da51cb0254bb6b9a4e42931eb2f56329edd4c199cb9aaf804","impliedFormat":1},{"version":"183f480885db5caa5a8acb833c2be04f98056bdcc5fb29e969ff86e07efe57ab","impliedFormat":99},{"version":"82e687ebd99518bc63ea04b0c3810fb6e50aa6942decd0ca6f7a56d9b9a212a6","impliedFormat":99},{"version":"7f698624bbbb060ece7c0e51b7236520ebada74b747d7523c7df376453ed6fea","impliedFormat":1},{"version":"8f07f2b6514744ac96e51d7cb8518c0f4de319471237ea10cf688b8d0e9d0225","impliedFormat":1},{"version":"257b83faa134d971c738a6b9e4c47e59bb7b23274719d92197580dd662bfafc3","impliedFormat":99},{"version":"556ccd493ec36c7d7cb130d51be66e147b91cc1415be383d71da0f1e49f742a9","impliedFormat":1},{"version":"b6d03c9cfe2cf0ba4c673c209fcd7c46c815b2619fd2aad59fc4229aaef2ed43","impliedFormat":1},{"version":"95aba78013d782537cc5e23868e736bec5d377b918990e28ed56110e3ae8b958","impliedFormat":1},{"version":"670a76db379b27c8ff42f1ba927828a22862e2ab0b0908e38b671f0e912cc5ed","impliedFormat":1},{"version":"13b77ab19ef7aadd86a1e54f2f08ea23a6d74e102909e3c00d31f231ed040f62","impliedFormat":1},{"version":"069bebfee29864e3955378107e243508b163e77ab10de6a5ee03ae06939f0bb9","impliedFormat":1},{"version":"26e0ffceb2198feb1ef460d5d14111c69ad07d44c5a67fd4bfeb74c969aa9afb","impliedFormat":99},{"version":"816ad2333292d54fb1b764ee3ac7cc86c84f10333d6591d8e5b9b0e82af4c781","impliedFormat":99},{"version":"ca859c194937779fddd72780f4cf0d88369cbf0f40c49900a3cab6234a3a23a7","impliedFormat":99},{"version":"224502644e4569a14557c60464e25c09253c923f7545745b78c2243905dd63bb","signature":"4b96dd19fd2949d28ce80e913412b0026dc421e5bf6c31d87c7b5eb11b5753b4"},{"version":"b1538a92b9bae8d230267210c5db38c2eb6bdb352128a3ce3aa8c6acf9fc9622","impliedFormat":1},{"version":"6fc1a4f64372593767a9b7b774e9b3b92bf04e8785c3f9ea98973aa9f4bbe490","impliedFormat":1},{"version":"ff09b6fbdcf74d8af4e131b8866925c5e18d225540b9b19ce9485ca93e574d84","impliedFormat":1},{"version":"d5895252efa27a50f134a9b580aa61f7def5ab73d0a8071f9b5bf9a317c01c2d","impliedFormat":1},{"version":"a5a362a67cbaf83d5a2bc330f65481f3cfec7b1078dec7efad76166b3157b4dc","impliedFormat":1},{"version":"56208c500dcb5f42be7e18e8cb578f257a1a89b94b3280c506818fed06391805","impliedFormat":1},{"version":"0c94c2e497e1b9bcfda66aea239d5d36cd980d12a6d9d59e66f4be1fa3da5d5a","impliedFormat":1},{"version":"ecf78c072af4ca30eda369734fff1c1196d927fddf22a3cd831766416f329524","affectsGlobalScope":true,"impliedFormat":1},{"version":"1f366bde16e0513fa7b64f87f86689c4d36efd85afce7eb24753e9c99b91c319","impliedFormat":1},{"version":"916be7d770b0ae0406be9486ac12eb9825f21514961dd050594c4b250617d5a8","impliedFormat":1},{"version":"17ed71200119e86ccef2d96b73b02ce8854b76ad6bd21b5021d4269bec527b5f","impliedFormat":1},{"version":"960a68ced7820108787135bdae5265d2cc4b511b7dcfd5b8f213432a8483daf1","impliedFormat":1},{"version":"7c52a6d05a6e68269e63bc63fad6e869368a141ad23a20e2350c831dc499c5f2","impliedFormat":1},{"version":"2e7ebdc7d8af978c263890bbde991e88d6aa31cc29d46735c9c5f45f0a41243b","impliedFormat":1},{"version":"b57fd1c0a680d220e714b76d83eff51a08670f56efcc5d68abc82f5a2684f0c0","impliedFormat":1},{"version":"8cf121e98669f724256d06bebafec912b92bb042a06d4944f7fb27a56c545109","impliedFormat":1},{"version":"1084565c68b2aed5d6d5cea394799bd688afdf4dc99f4e3615957857c15bb231","impliedFormat":1},{"version":"31acb42da6c0f18648970b452719fa5f2aa5060fa9455de400df0b4d8dde391b","impliedFormat":1},{"version":"7fa8d75d229eeaee235a801758d9c694e94405013fe77d5d1dd8e3201fc414f1","impliedFormat":1}],"root":[55,192],"options":{"composite":true,"exactOptionalPropertyTypes":true,"jsx":4,"module":99,"noImplicitOverride":true,"noUncheckedIndexedAccess":true,"skipLibCheck":true,"strict":true,"target":7,"useDefineForClassFields":true},"referencedMap":[[185,1],[183,2],[188,3],[184,1],[186,4],[187,1],[193,2],[194,2],[195,2],[196,5],[197,2],[199,6],[200,7],[198,2],[201,2],[151,2],[58,8],[59,8],[98,9],[57,10],[99,11],[100,12],[101,13],[102,14],[103,15],[104,16],[105,17],[106,18],[107,19],[108,19],[110,20],[109,21],[111,22],[112,23],[113,24],[97,25],[149,2],[56,2],[114,26],[115,27],[116,28],[150,29],[117,30],[118,31],[119,32],[120,33],[121,34],[122,35],[123,36],[124,37],[125,38],[126,39],[127,39],[128,40],[129,2],[130,2],[131,41],[133,42],[132,43],[134,44],[135,45],[136,46],[137,47],[138,48],[139,49],[140,50],[141,51],[142,52],[143,53],[144,54],[145,55],[146,56],[147,57],[148,58],[202,2],[51,2],[203,59],[206,60],[207,59],[205,59],[208,60],[204,2],[209,61],[49,2],[52,62],[53,59],[210,63],[211,2],[189,64],[54,2],[50,2],[190,2],[175,65],[173,66],[174,67],[162,68],[163,66],[170,69],[161,70],[166,71],[176,2],[167,72],[172,73],[178,74],[177,75],[160,76],[168,77],[169,78],[164,79],[171,65],[165,80],[153,81],[152,82],[159,2],[47,2],[48,2],[8,2],[9,2],[11,2],[10,2],[2,2],[12,2],[13,2],[14,2],[15,2],[16,2],[17,2],[18,2],[19,2],[3,2],[20,2],[21,2],[4,2],[22,2],[26,2],[23,2],[24,2],[25,2],[27,2],[28,2],[29,2],[5,2],[30,2],[31,2],[32,2],[33,2],[6,2],[37,2],[34,2],[35,2],[36,2],[38,2],[7,2],[39,2],[44,2],[45,2],[40,2],[41,2],[42,2],[43,2],[1,2],[46,2],[75,83],[85,84],[74,83],[95,85],[66,86],[65,87],[94,88],[88,89],[93,90],[68,91],[82,92],[67,93],[91,94],[63,95],[62,88],[92,96],[64,97],[69,98],[70,2],[73,98],[60,2],[96,99],[86,100],[77,101],[78,102],[80,103],[76,104],[79,105],[89,88],[71,106],[72,107],[81,108],[61,109],[84,100],[83,98],[87,2],[90,110],[191,111],[182,112],[179,113],[157,114],[158,2],[155,115],[154,2],[156,116],[180,2],[181,117],[55,118],[192,119]],"affectedFilesPendingEmit":[[55,17],[192,17]],"emitSignatures":[55,192],"version":"5.9.3"} \ No newline at end of file diff --git a/src/main/typescript/apps/web/ui/AttestForm.tsx b/src/main/typescript/apps/web/ui/AttestForm.tsx index d729ff7..9d622d0 100644 --- a/src/main/typescript/apps/web/ui/AttestForm.tsx +++ b/src/main/typescript/apps/web/ui/AttestForm.tsx @@ -5,8 +5,34 @@ import { useGithubAuth } from '../auth/useGithub'; import { appConfig } from '../utils/config'; import { attestIdentityBinding, encodeBindingData, EASAddresses, getChainConfig } from '../utils/eas'; import { Hex, verifyMessage, createPublicClient, http } from 'viem'; -import { UsernameUniqueResolverABI } from '@didgit/abi'; import { Button } from '../components/ui/button'; + +// UsernameUniqueResolver ABI (functions needed for duplicate prevention and repo patterns) +const UsernameUniqueResolverABI = [ + { + type: 'function', + name: 'getIdentityOwner', + inputs: [ + { name: 'domain', type: 'string' }, + { name: 'username', type: 'string' } + ], + outputs: [{ name: '', type: 'address' }], + stateMutability: 'view' + }, + { + type: 'function', + name: 'setRepositoryPattern', + inputs: [ + { name: 'domain', type: 'string' }, + { name: 'username', type: 'string' }, + { name: 'namespace', type: 'string' }, + { name: 'name', type: 'string' }, + { name: 'enabled', type: 'bool' } + ], + outputs: [], + stateMutability: 'nonpayable' + } +] as const; import { Input } from '../components/ui/input'; import { Alert } from '../components/ui/alert'; @@ -63,24 +89,7 @@ export const AttestForm: React.FC = () => { } }; - // UsernameUniqueResolver ABI (just the setRepoPattern function) - const UsernameUniqueResolverABI = [ - { - "type": "function", - "name": "setRepoPattern", - "inputs": [ - { "name": "domain", "type": "string" }, - { "name": "username", "type": "string" }, - { "name": "namespace", "type": "string" }, - { "name": "name", "type": "string" }, - { "name": "enabled", "type": "bool" } - ], - "outputs": [], - "stateMutability": "nonpayable" - } - ] as const; - - const setDefaultRepoPattern = async (username: string, walletClient: any) => { + const setDefaultRepoPattern = async (username: string, walletClient: { writeContract: (args: unknown) => Promise }) => { const resolverAddress = cfg.RESOLVER_ADDRESS as `0x${string}` | undefined; if (!resolverAddress) { throw new Error('Resolver address not configured'); @@ -90,7 +99,7 @@ export const AttestForm: React.FC = () => { await walletClient.writeContract({ address: resolverAddress, abi: UsernameUniqueResolverABI, - functionName: 'setRepoPattern', + functionName: 'setRepositoryPattern', args: ['github.com', username, '*', '*', true], gas: BigInt(200000), }); @@ -194,10 +203,17 @@ export const AttestForm: React.FC = () => { } } } catch (e) { + // Build error context without async calls to avoid potential double-throws + let hasAaClient = false; + try { + hasAaClient = !!(await getSmartWalletClient()); + } catch { + // Ignore - just report false + } const ctx = { eoaAddress: address ?? null, easContract: ((): string | null => { try { return EASAddresses.forChain(cfg.CHAIN_ID, cfg).contract as unknown as string; } catch { return null; } })(), - hasAaClient: !!(await getSmartWalletClient()), + hasAaClient, hasSig: !!signature, hasGist: !!gistUrl, }; From b3a2ac68ffc04bf828e28ac099e4c77e17703fad Mon Sep 17 00:00:00 2001 From: "Loki (AI Agent)" Date: Tue, 3 Feb 2026 00:57:51 +0000 Subject: [PATCH 4/4] fix: improve PR #13 based on plan audit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Fix documentation path in revoke-duplicates.ts header comment - Add GraphQL error handling in fetchIdentityAttestations() - Add comment clarifying testnet configuration šŸ¤– Authored by Loki --- backend/src/revoke-duplicates.ts | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/backend/src/revoke-duplicates.ts b/backend/src/revoke-duplicates.ts index e4203ec..1af09f5 100644 --- a/backend/src/revoke-duplicates.ts +++ b/backend/src/revoke-duplicates.ts @@ -5,14 +5,15 @@ * keeping only the most recent attestation per username. * * Usage: - * DRY RUN: npx ts-node tools/revoke-duplicates.ts - * EXECUTE: PRIVATE_KEY=0x... npx ts-node tools/revoke-duplicates.ts --execute + * DRY RUN: npx ts-node backend/src/revoke-duplicates.ts + * EXECUTE: PRIVATE_KEY=0x... npx ts-node backend/src/revoke-duplicates.ts --execute */ import { createPublicClient, createWalletClient, http, parseAbi, type WalletClient, type PublicClient } from 'viem'; import { privateKeyToAccount } from 'viem/accounts'; import { baseSepolia } from 'viem/chains'; +// Base Sepolia testnet configuration const EAS_GRAPHQL = 'https://base-sepolia.easscan.org/graphql'; const EAS_ADDRESS = '0x4200000000000000000000000000000000000021'; const IDENTITY_SCHEMA_UID = '0x6ba0509abc1a1ed41df2cce6cbc7350ea21922dae7fcbc408b54150a40be66af'; @@ -72,7 +73,13 @@ async function fetchIdentityAttestations(): Promise { throw new Error(`EAS API error: ${response.statusText}`); } - const data = await response.json() as { data?: { attestations?: Attestation[] } }; + const data = await response.json() as { data?: { attestations?: Attestation[] }; errors?: Array<{ message: string }> }; + + // Check for GraphQL errors + if (data.errors && data.errors.length > 0) { + throw new Error(`GraphQL error: ${data.errors.map(e => e.message).join(', ')}`); + } + const attestations = data?.data?.attestations ?? []; if (attestations.length === 0) {